From fea6354172af1a49210329337dcf8daaa0778af1 Mon Sep 17 00:00:00 2001 From: joey <> Date: Sat, 20 Nov 2004 18:51:28 +0000 Subject: [PATCH] Added a routine to convert common Debian groups into numerical ids. Currently only supported are Debian and guest, but more may follow. --- userdir_ldap.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/userdir_ldap.py b/userdir_ldap.py index 72d9762..d70167d 100644 --- a/userdir_ldap.py +++ b/userdir_ldap.py @@ -29,6 +29,9 @@ userdir_gpg.SetKeyrings(string.split(ConfModule.keyrings,":")); # This is a list of common last-name prefixes LastNamesPre = {"van": None, "von": None, "le": None, "de": None, "di": None}; +# This is a list of common groups on Debian hosts +DebianGroups = {"Debian": 800, "guest": 60000} + # SSH Key splitting. The result is: # (options,size,modulous,exponent,comment) SSHAuthSplit = re.compile('^(.* )?(\d+) (\d+) (\d+) ?(.+)$'); @@ -356,3 +359,9 @@ def GetUID(l,Name,UnknownMap = {}): return (None,None); +def Group2GID(name): + """Returns the numerical id of a common group""" + for g in DebianGroups.keys(): + if name == g: + return DebianGroups[g] + return name -- 2.20.1