Arthur de Jong

Open Source / Free Software developer

summaryrefslogtreecommitdiffstats
path: root/pynslcd
diff options
context:
space:
mode:
authorArthur de Jong <arthur@arthurdejong.org>2013-03-09 19:30:18 +0100
committerArthur de Jong <arthur@arthurdejong.org>2013-03-29 20:13:48 +0100
commitd4c5c96f0c94e3f930dcda29a2b843baac37b07f (patch)
tree997f514e3bcbdf1809802113d68d5228047b6a09 /pynslcd
parent11b1739afc43b5e444a5ac173b08b13b5b5fbc07 (diff)
Parse the nscd_invalidate option
Diffstat (limited to 'pynslcd')
-rw-r--r--pynslcd/cfg.py11
1 files changed, 11 insertions, 0 deletions
diff --git a/pynslcd/cfg.py b/pynslcd/cfg.py
index b03b8c7..eaeaff0 100644
--- a/pynslcd/cfg.py
+++ b/pynslcd/cfg.py
@@ -89,6 +89,7 @@ nss_nested_groups = False
validnames = re.compile(r'^[a-z0-9._@$][a-z0-9._@$ \\~-]{0,98}[a-z0-9._@$~-]$', re.IGNORECASE)
pam_authz_searches = []
pam_password_prohibit_message = None
+nscd_invalidate = set()
# allowed boolean values
@@ -312,6 +313,16 @@ def read(filename):
flags = 0 | re.IGNORECASE if m.group('flags') == 'i' else 0
validnames = re.compile(m.group('value'), flags=flags)
continue
+ # nscd_invalidate <MAP>,<MAP>,...
+ m = re.match('nscd_invalidate\s+(?P<value>\S.*)',
+ line, re.IGNORECASE)
+ if m:
+ dbs = re.split('[ ,]+', m.group('value').lower())
+ for db in dbs:
+ if db not in maps:
+ raise ParseError(filename, lineno, 'map %s unknown' % db)
+ nscd_invalidate.update(dbs)
+ continue
# unrecognised line
raise ParseError(filename, lineno, 'error parsing line %r' % line)
# if logging is not configured, default to syslog