diff options
author | Frederic Lepied <flepied@mandriva.com> | 2005-08-10 06:27:28 +0000 |
---|---|---|
committer | Frederic Lepied <flepied@mandriva.com> | 2005-08-10 06:27:28 +0000 |
commit | c90915ce7930066d70f5c7d80168eb21436eaf8e (patch) | |
tree | b5e12f2bc689b46e1a437dbd3125483503ace367 /share | |
parent | c0bffad06bcdd361bc1c448791b8bb561ab86f27 (diff) | |
download | msec-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-x | share/Perms.py | 12 |
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 |