[1202] in testers
cleanup complains if /etc/passwd.local doesn't exist
daemon@ATHENA.MIT.EDU (daemon@ATHENA.MIT.EDU)
Wed Nov 28 09:57:47 1990
From: epeisach@ATHENA.MIT.EDU
Date: Wed, 28 Nov 90 09:57:24 -0500
To: testers@ATHENA.MIT.EDU
Cc: mar@ATHENA.MIT.EDU
I logged in to find:
Couldn't open "/etc/passwd.local", No such file or directory.
In the console.
Cleanup reports this error when it can't open /etc/passwd.local. It also
leavs /etc/passwd.new sitting around.
The following patch fixes the problem along with:
"cleanup.c", line 245: warning: statement not reached
"cleanup.c", line 261: warning: & before array or function: ignored
*** /tmp/,RCSt1009248 Wed Nov 28 09:56:55 1990
--- cleanup.c Wed Nov 28 09:55:17 1990
***************
*** 242,248 ****
{
fprintf(stderr, "Error: can't get kernel name list.\n");
return(5);
! exit(5);
}
n_done = 1;
if((kmem = open("/dev/kmem", O_RDONLY)) < 0)
--- 242,248 ----
{
fprintf(stderr, "Error: can't get kernel name list.\n");
return(5);
! /* exit(5);*/
}
n_done = 1;
if((kmem = open("/dev/kmem", O_RDONLY)) < 0)
***************
*** 258,264 ****
lseek(kmem, procp, L_SET);
for(i=0; i<nproc; i+=NPROCS)
{
! read(kmem, &p, sizeof(p));
for(j=i; j < (i+NPROCS); j++)
{
if(j >= nproc)
--- 258,264 ----
lseek(kmem, procp, L_SET);
for(i=0; i<nproc; i+=NPROCS)
{
! read(kmem, p, sizeof(p));
for(j=i; j < (i+NPROCS); j++)
{
if(j >= nproc)
***************
*** 299,308 ****
char (*plist)[];
#endif
{
! int fd = open("/etc/passwd.new",O_WRONLY | O_CREAT | O_TRUNC, 0644);
int proto,r,i;
char buf[BUFSIZ],**ret;
! if(fd == -1)
{
fprintf(stderr,"Couldn't open \"/etc/passwd.new\", %s.\n",
sys_errlist[errno]);
--- 299,309 ----
char (*plist)[];
#endif
{
! int fd;
int proto,r,i;
char buf[BUFSIZ],**ret;
! if(access("/etc/passwd.local", R_OK) < 0) return;
! if((fd = open("/etc/passwd.new",O_WRONLY | O_CREAT | O_TRUNC, 0644)) == -1)
{
fprintf(stderr,"Couldn't open \"/etc/passwd.new\", %s.\n",
sys_errlist[errno]);