aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEugeni Dodonov <eugeni@mandriva.org>2010-02-23 20:36:36 +0000
committerEugeni Dodonov <eugeni@mandriva.org>2010-02-23 20:36:36 +0000
commit77d71b870b2095576a2da0308cb8be46ad1dc14d (patch)
tree7a7c116cb21874f26136f59cb0d0800be78babbe
parent9001efaa061a441ebb52468827eada48c322b585 (diff)
downloadmsec-77d71b870b2095576a2da0308cb8be46ad1dc14d.tar
msec-77d71b870b2095576a2da0308cb8be46ad1dc14d.tar.gz
msec-77d71b870b2095576a2da0308cb8be46ad1dc14d.tar.bz2
msec-77d71b870b2095576a2da0308cb8be46ad1dc14d.tar.xz
msec-77d71b870b2095576a2da0308cb8be46ad1dc14d.zip
Correctly change file permissions changes (#57793)
-rwxr-xr-xshare/Perms.py12
1 files changed, 6 insertions, 6 deletions
diff --git a/share/Perms.py b/share/Perms.py
index ff4af73..31d08c0 100755
--- a/share/Perms.py
+++ b/share/Perms.py
@@ -217,12 +217,6 @@ def act(change):
# if the user has changed it manually
if not change and not mandatory:
newperm = newperm & mode
- if newperm != -1 and mode != newperm:
- try:
- os.chmod(f, newperm)
- log(_('changed mode of %s from %o to %o') % (f, mode, newperm))
- except:
- error('chmod %s %o: %s' % (f, newperm, str(sys.exc_value)))
if user != -1 and user != uid:
try:
os.chown(f, user, -1)
@@ -235,6 +229,12 @@ def act(change):
log(_('changed group of %s from %s to %s') % (f, get_group_name(gid), group_str))
except:
error('chgrp %s %s: %s' % (f, group, str(sys.exc_value)))
+ if newperm != -1 and mode != newperm:
+ try:
+ os.chmod(f, newperm)
+ log(_('changed mode of %s from %o to %o') % (f, mode, newperm))
+ except:
+ error('chmod %s %o: %s' % (f, newperm, str(sys.exc_value)))
def chmod(f, newperm):
try: