[net.bugs.4bsd] vipw root shell fix

barto@celerity.UUCP (David Barto) (01/24/85)

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"