diff options
author | Eugeni Dodonov <eugeni@mandriva.org> | 2010-02-23 20:35:27 +0000 |
---|---|---|
committer | Eugeni Dodonov <eugeni@mandriva.org> | 2010-02-23 20:35:27 +0000 |
commit | bbb00e6df6d1fc5ef47ad6e125311a1b9b2eb205 (patch) | |
tree | 275c7cfa1da74755e52b9feb911d140e0a3f7867 /share | |
parent | 1c6b4f3fe91e932d1286fbd39b6bb62f857c969b (diff) | |
download | msec-bbb00e6df6d1fc5ef47ad6e125311a1b9b2eb205.tar msec-bbb00e6df6d1fc5ef47ad6e125311a1b9b2eb205.tar.gz msec-bbb00e6df6d1fc5ef47ad6e125311a1b9b2eb205.tar.bz2 msec-bbb00e6df6d1fc5ef47ad6e125311a1b9b2eb205.tar.xz msec-bbb00e6df6d1fc5ef47ad6e125311a1b9b2eb205.zip |
Correctly change file permissions changes (#57793)
Diffstat (limited to 'share')
-rwxr-xr-x | share/Perms.py | 12 |
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: |