aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFrederic Lepied <flepied@mandriva.com>2003-09-03 15:36:44 +0000
committerFrederic Lepied <flepied@mandriva.com>2003-09-03 15:36:44 +0000
commita73561fadd0c88f9b0322db93a0e8168efbb5844 (patch)
tree4aaedcce3bddf6739a496717c46baced162a519b
parent4a7e7a5d824d797fdb728edc1f547460ce2b6556 (diff)
downloadmsec-a73561fadd0c88f9b0322db93a0e8168efbb5844.tar
msec-a73561fadd0c88f9b0322db93a0e8168efbb5844.tar.gz
msec-a73561fadd0c88f9b0322db93a0e8168efbb5844.tar.bz2
msec-a73561fadd0c88f9b0322db93a0e8168efbb5844.tar.xz
msec-a73561fadd0c88f9b0322db93a0e8168efbb5844.zip
correct broken code in fix_perms which add +x for all files
when it finds a directory in a glob.
-rwxr-xr-xshare/Perms.py7
1 files changed, 4 insertions, 3 deletions
diff --git a/share/Perms.py b/share/Perms.py
index aea87c0..fee009b 100755
--- a/share/Perms.py
+++ b/share/Perms.py
@@ -155,9 +155,9 @@ def fix_perms(path, _interactive):
mode_str = fields[2]
if mode_str == 'current':
- newperm = -1
+ perm = -1
else:
- newperm = int(mode_str, 8)
+ perm = int(mode_str, 8)
if fields[1] == 'current':
user = group = -1
@@ -169,6 +169,7 @@ def fix_perms(path, _interactive):
if len(fields) == 4:
for f in glob.glob(fields[0]):
+ newperm = perm
if fs_regexp and fs_regexp.search(f):
_interactive and log(_('Non local file: "%s". Nothing changed.') % fields[0])
continue
@@ -186,7 +187,7 @@ def fix_perms(path, _interactive):
mode = stat.S_IMODE(full[stat.ST_MODE])
- if stat.S_ISDIR(full[stat.ST_MODE]):
+ if newperm != -1 and stat.S_ISDIR(full[stat.ST_MODE]):
if newperm & 0400:
newperm = newperm | 0100
if newperm & 0040: