]> andersk Git - moira.git/commitdiff
When generating usernames for Lincoln users, strip leading zeroes after
authorzacheiss <zacheiss>
Mon, 9 Sep 2002 03:41:59 +0000 (03:41 +0000)
committerzacheiss <zacheiss>
Mon, 9 Sep 2002 03:41:59 +0000 (03:41 +0000)
removing the first 4 characters (usually "9100") of their MIT ID.

regtape/common.pc

index 88dc6a1e2413d08d213022bc00d01e3e9c861d0e..24a32a6552c7578834680edd2e6619830df14a95 100644 (file)
@@ -254,9 +254,15 @@ void newuser(struct entry *e, int secure)
   uid = set_next_uid();
   if (!strcmp(e->type, "LINCOLN"))
     {
+      char *p;
+
       strncpy(login, e->first, 2);
       login[2] = '\0';
-      strncat(login, e->id+4, 5);
+      /* strip leading zeroes */
+      p = e->id+4;
+      while (*p == '0')
+       p++;
+      strncat(login, p, strlen(p));
       lowercase(login);
       st = US_NO_LOGIN_YET_KERBEROS_ONLY;
     }
This page took 0.041197 seconds and 5 git commands to generate.