aboutsummaryrefslogtreecommitdiffstats
path: root/share/Perms.py
diff options
context:
space:
mode:
authorFrederic Lepied <flepied@mandriva.com>2004-07-29 23:37:28 +0000
committerFrederic Lepied <flepied@mandriva.com>2004-07-29 23:37:28 +0000
commitaacf5e47baa4207ed0bbbb43502ddc9699f1459f (patch)
treec00206e7a0dea795ba8b0d07fba5cc98850604ae /share/Perms.py
parent38869aa45192fccb2c1c60f564cbdf689c71cf78 (diff)
downloadmsec-aacf5e47baa4207ed0bbbb43502ddc9699f1459f.tar
msec-aacf5e47baa4207ed0bbbb43502ddc9699f1459f.tar.gz
msec-aacf5e47baa4207ed0bbbb43502ddc9699f1459f.tar.bz2
msec-aacf5e47baa4207ed0bbbb43502ddc9699f1459f.tar.xz
msec-aacf5e47baa4207ed0bbbb43502ddc9699f1459f.zip
the config file is now forcing permissions even if it's lowering the security.
Diffstat (limited to 'share/Perms.py')
-rwxr-xr-xshare/Perms.py9
1 files changed, 5 insertions, 4 deletions
diff --git a/share/Perms.py b/share/Perms.py
index 0d594e1..7a9cb24 100755
--- a/share/Perms.py
+++ b/share/Perms.py
@@ -135,7 +135,7 @@ def get_sylink_name(path):
# content of the path file.
assoc = {}
-def fix_perms(path, _interactive):
+def fix_perms(path, _interactive, force):
try:
file = open(path, 'r')
except IOError:
@@ -215,7 +215,7 @@ def fix_perms(path, _interactive):
f = f[:-1]
if f[-2:] == '/.':
f = f[:-2]
- assoc[f] = (mode, uid, gid, newperm, user, group, user_str, group_str, mandatory)
+ assoc[f] = (mode, uid, gid, newperm, user, group, user_str, group_str, mandatory or force)
else:
error(_('invalid syntax in %s line %d') % (path, lineno))
file.close()
@@ -305,9 +305,10 @@ if __name__ == '__main__':
_interactive and log(_('Fixing owners and permissions of files and directories'))
# process the files
- for p in args:
+ fix_perms(args[0], _interactive, 0)
+ for p in args[1:]:
_interactive and log(_('Reading data from %s') % p)
- fix_perms(p, _interactive)
+ fix_perms(p, _interactive, 1)
# do the modifications
act(change)