Set the login shell of new members
authorMichael Spang <mspang@csclub.uwaterloo.ca>
Wed, 12 Dec 2007 07:11:56 +0000 (02:11 -0500)
committerMichael Spang <mspang@csclub.uwaterloo.ca>
Wed, 12 Dec 2007 07:12:14 +0000 (02:12 -0500)
Somehow this got left out of addmember. The default
is sh which isn't terribly friendly.

src/ldap.c

index bd07cff..244c2af 100644 (file)
@@ -122,6 +122,12 @@ int ceo_add_user(char *uid, char *basedn, char *objclass, char *cn, char *home,
 
     mods[++i] = xmalloc(sizeof(LDAPMod));
     mods[i]->mod_op = LDAP_MOD_ADD;
+    mods[i]->mod_type = "loginShell";
+    char *shells[] = { shell, NULL };
+    mods[i]->mod_values = shells;
+
+    mods[++i] = xmalloc(sizeof(LDAPMod));
+    mods[i]->mod_op = LDAP_MOD_ADD;
     mods[i]->mod_type = "uidNumber";
     char idno[16];
     snprintf(idno, sizeof(idno), "%d", no);