From c90915ce7930066d70f5c7d80168eb21436eaf8e Mon Sep 17 00:00:00 2001 From: Frederic Lepied Date: Wed, 10 Aug 2005 06:27:28 +0000 Subject: more robust parsing --- share/Perms.py | 12 ++++++++++-- 1 file 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 -- cgit v1.2.1