X-Git-Url: https://git.adam-barratt.org.uk/?p=mirror%2Fuserdir-ldap.git;a=blobdiff_plain;f=ud-roleadd;h=f6810f1b22704cdbcae8089dbc0e2757b2679ea3;hp=08f28ac4564215b8c6a9e7151e2313cc314c7d8f;hb=a6fb69805c3999a85c064a96c93417bb1c284c5c;hpb=87683e24b12b5171f9e0f4f814f63f76848a341d diff --git a/ud-roleadd b/ud-roleadd index 08f28ac..f6810f1 100755 --- a/ud-roleadd +++ b/ud-roleadd @@ -19,7 +19,7 @@ # along with this program; if not, write to the Free Software # Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. -import string, time, ldap, getopt, sys, os, pwd +import time, ldap, getopt, sys, os, pwd from userdir_ldap import * # This tries to search for a free UID. There are two possible ways to do @@ -69,7 +69,10 @@ if Res != "": # GID Res = raw_input("Group ID Number? ") if Res != "": - gidNumber = Group2GID(Res) + gidNumber = Group2GID(l, Res) + if gidNumber == -1: + print "Can't figure out which gid %s is" % Res + sys.exit(1) # UID uidNumber = GetFreeID(l) @@ -83,6 +86,7 @@ print " GECOS Field: \"%s,,,,\"" % cn print " Login Shell: /bin/false" Res = raw_input("Continue [No/yes]? ") if Res != "yes": + print "Not adding %s" % cn sys.exit(1) # Submit the modification request @@ -91,8 +95,7 @@ print "Updating LDAP directory..", sys.stdout.flush() Details = [("uid",account), - ("objectClass", - ("top","inetOrgPerson","debianAccount","shadowAccount","debianRoleAccount")), + ("objectClass", RoleObjectClasses), ("uidNumber",str(uidNumber)), ("gidNumber",str(gidNumber)), ("gecos",cn+",,,,"),