Skip to content
This repository was archived by the owner on Jan 22, 2026. It is now read-only.

Commit 377522f

Browse files
committed
VirtualDisk: More logging when changing dir perms
1 parent 7fdc967 commit 377522f

1 file changed

Lines changed: 9 additions & 1 deletion

File tree

virtinst/VirtualDisk.py

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -431,8 +431,15 @@ def fix_perms(dirname, useacl=True):
431431
if proc.returncode != 0:
432432
raise ValueError(err)
433433
else:
434+
logging.debug("Setting +x on %s", dirname)
434435
mode = os.stat(dirname).st_mode
435-
os.chmod(dirname, mode | stat.S_IXOTH)
436+
newmode = mode | stat.S_IXOTH
437+
os.chmod(dirname, newmode)
438+
if os.stat(dirname).st_mode != newmode:
439+
# Trying to change perms on vfat at least doesn't work
440+
# but also doesn't seem to error. Try and detect that
441+
raise ValueError(_("Permissions on '%s' did not stick") %
442+
dirname)
436443

437444
fixlist = VirtualDisk.check_path_search_for_user(conn, path, username)
438445
if not fixlist:
@@ -452,6 +459,7 @@ def fix_perms(dirname, useacl=True):
452459
raise
453460
useacl = False
454461

462+
logging.debug("setfacl failed, trying old fashioned way")
455463
fix_perms(dirname, useacl)
456464
except Exception, e:
457465
errdict[dirname] = str(e)

0 commit comments

Comments
 (0)