Bug in System V and System V.2 login.c

laman at sdcsvax.UUCP laman at sdcsvax.UUCP
Thu Apr 12 04:16:25 AEST 1984


There is a bug in both System V and SystemV.2 login.c programs.  There are
two calls to strncmp with ONLY TWO arguments in terminal().  We changed ours
to "strcmp".  You can change yours by adding a sizeof for the third argument.
Either way will suffice.  A contextual diff follows.

*** login.c	Wed Apr 11 12:21:58 1984
--- oldlogin.c	Wed Apr 11 12:21:23 1984
***************
*** 563,570
  				continue;
  			if(pass1 && db.d_ino != fsb.st_ino)
  				continue;
! 			if (strcmp(&db.d_name[0],"syscon") == 0 ||
! 				strcmp(&db.d_name[0],"systty") == 0)
  				continue;
  			(void) strcpy(rbuf, dev);
  			(void) strcat(rbuf, db.d_name);

--- 563,570 -----
  				continue;
  			if(pass1 && db.d_ino != fsb.st_ino)
  				continue;
! 			if (strncmp(&db.d_name[0],"syscon") == 0 ||
! 				strncmp(&db.d_name[0],"systty") == 0)
  				continue;
  			(void) strcpy(rbuf, dev);
  			(void) strcat(rbuf, db.d_name);



			Mike Laman
			UUCP: {ucbvax,philabs,sdccsu3,sdcsla}!sdcsvax!laman



More information about the Net.bugs mailing list