SCCS-vsn: usr.bin/login/login.c 4.16
SCCS-vsn: usr.bin/login/login.c.1 4.16
-static char *sccsid = "@(#)login.c 4.15 82/03/27";
+static char *sccsid = "@(#)login.c 4.16 82/04/03";
/*
* login [ name ]
* login -r
/*
* login [ name ]
* login -r
printf("%s: No such user\r\n", lusername);
goto abnormal;
}
printf("%s: No such user\r\n", lusername);
goto abnormal;
}
- hostf = fopen("/etc/hosts.equiv", "r");
+ hostf = pwd->pw_uid ? fopen("/etc/hosts.equiv", "r") : 0;
again:
if (hostf) {
char ahost[32];
again:
if (hostf) {
char ahost[32];
signal(SIGINT, SIG_IGN);
stopmotd++;
}
signal(SIGINT, SIG_IGN);
stopmotd++;
}
-/*
- * return true if OK for root to login on this terminal
- */
+ if (rflag)
+ return(1);
if ((fd = fopen(securetty, "r")) == NULL)
return(1);
while (fgets(buf, sizeof buf, fd) != NULL) {
if ((fd = fopen(securetty, "r")) == NULL)
return(1);
while (fgets(buf, sizeof buf, fd) != NULL) {
-static char *sccsid = "@(#)login.c.1 4.15 82/03/27";
+static char *sccsid = "@(#)login.c.1 4.16 82/04/03";
/*
* login [ name ]
* login -r
/*
* login [ name ]
* login -r
printf("%s: No such user\r\n", lusername);
goto abnormal;
}
printf("%s: No such user\r\n", lusername);
goto abnormal;
}
- hostf = fopen("/etc/hosts.equiv", "r");
+ hostf = pwd->pw_uid ? fopen("/etc/hosts.equiv", "r") : 0;
again:
if (hostf) {
char ahost[32];
again:
if (hostf) {
char ahost[32];
signal(SIGINT, SIG_IGN);
stopmotd++;
}
signal(SIGINT, SIG_IGN);
stopmotd++;
}
-/*
- * return true if OK for root to login on this terminal
- */
+ if (rflag)
+ return(1);
if ((fd = fopen(securetty, "r")) == NULL)
return(1);
while (fgets(buf, sizeof buf, fd) != NULL) {
if ((fd = fopen(securetty, "r")) == NULL)
return(1);
while (fgets(buf, sizeof buf, fd) != NULL) {