Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.2 9/18/84; site celerity.UUCP Path: utzoo!watmath!clyde!burl!ulysses!mhuxr!ihnp4!cbosgd!cbdkc1!desoto!packard!hoxna!houxm!whuxlm!akgua!sdcsvax!sdcc3!sdcc6!celerity!barto From: barto@celerity.UUCP (David Barto) Newsgroups: net.bugs.4bsd Subject: vipw root shell fix Message-ID: <259@celerity.UUCP> Date: Thu, 24-Jan-85 13:08:52 EST Article-I.D.: celerity.259 Posted: Thu Jan 24 13:08:52 1985 Date-Received: Mon, 28-Jan-85 04:56:20 EST Distribution: net Organization: Celerity Computing, San Diego, Ca. Lines: 45 Index: /usr/src/etc/vipw.c 4.2BSD Subject: vipw fails to work if the shell is anything other than empty Description: If you have a root passwd entry with a shell of /bin/csh vipw will always think that you have mangled the passwd file. Try changing the shell from root:lkjdfljsd:0:1:Root user:\0 to root:lkjdfljsd:0:1:Root user:/bin/sh or root:lkjdfljsd:0:1:Root user:/bin/csh vipw will complain--- Fix: change the strncmp, to use the length of the complare! diff follows RCS file: RCS/vipw.c,v retrieving revision 1.1 diff -c -r1.1 vipw.c *** /tmp/,RCSt1011893 Thu Jan 24 10:04:57 1985 --- vipw.c Thu Jan 24 10:04:25 1985 *************** *** 125,131 if (cp == 0) break; /* login directory */ ! if (strncmp(++cp, "/:")) break; cp += 2; if (*cp && strcmp(cp, "/bin/sh") && --- 125,131 ----- if (cp == 0) break; /* login directory */ ! if (strncmp(++cp, "/:", 2)) break; cp += 2; if (*cp && strcmp(cp, "/bin/sh") && -- David Barto akgua!celerity!barto {decvax || ucbvax || ihnp4}!sdcsvax!celerity!barto "If you are using more than 10 sites to get here, you are taking the long way"