From: joey <> Date: Sat, 20 Nov 2004 18:51:28 +0000 (+0000) Subject: Added a routine to convert common Debian groups into numerical ids. X-Git-Tag: debian_userdir-ldap_0-3-8~46 X-Git-Url: https://git.adam-barratt.org.uk/?p=mirror%2Fuserdir-ldap.git;a=commitdiff_plain;h=fea6354172af1a49210329337dcf8daaa0778af1 Added a routine to convert common Debian groups into numerical ids. Currently only supported are Debian and guest, but more may follow. --- 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