aboutsummaryrefslogtreecommitdiffstats
path: root/share
diff options
context:
space:
mode:
authorFrederic Lepied <flepied@mandriva.com>2005-08-10 06:27:28 +0000
committerFrederic Lepied <flepied@mandriva.com>2005-08-10 06:27:28 +0000
commitc90915ce7930066d70f5c7d80168eb21436eaf8e (patch)
treeb5e12f2bc689b46e1a437dbd3125483503ace367 /share
parentc0bffad06bcdd361bc1c448791b8bb561ab86f27 (diff)
downloadmsec-c90915ce7930066d70f5c7d80168eb21436eaf8e.tar
msec-c90915ce7930066d70f5c7d80168eb21436eaf8e.tar.gz
msec-c90915ce7930066d70f5c7d80168eb21436eaf8e.tar.bz2
msec-c90915ce7930066d70f5c7d80168eb21436eaf8e.tar.xz
msec-c90915ce7930066d70f5c7d80168eb21436eaf8e.zip
more robust parsing
Diffstat (limited to 'share')
-rwxr-xr-xshare/Perms.py12
1 files changed, 10 insertions, 2 deletions
diff --git a/share/Perms.py b/share/Perms.py
index 7a9cb24..a89e821 100755
--- a/share/Perms.py
+++ b/share/Perms.py
@@ -152,12 +152,20 @@ def fix_perms(path, _interactive, force):
continue
fields = re.split('\s*', line)
- mode_str = fields[2]
+ try:
+ mode_str = fields[2]
+ except IndexError:
+ error(_("%s: syntax error line %d") % (path, lineno))
+ continue
if mode_str == 'current':
perm = -1
else:
- perm = int(mode_str, 8)
+ try:
+ perm = int(mode_str, 8)
+ except ValueError:
+ error(_("%s: syntax error line %d") % (path, lineno))
+ continue
if fields[1] == 'current':
user = group = -1