#endif not lint
#ifndef lint
-static char sccsid[] = "@(#)login.c.1 5.21 (Berkeley) %G%";
+static char sccsid[] = "@(#)login.c.1 5.23 (Berkeley) %G%";
#endif not lint
/*
/*
* If user not super-user, check for logins disabled.
*/
- if (pwd->pw_uid != 0 && (nlfd = fopen(nolog, "r")) > 0) {
+ if (pwd->pw_uid != 0 && (nlfd = fopen(nolog, "r"))) {
while ((c = getc(nlfd)) != EOF)
putchar(c);
fflush(stdout);
exit(0);
}
time(&utmp.ut_time);
- t = ttyslot();
- if (t > 0 && (f = open("/etc/utmp", O_WRONLY)) >= 0) {
- lseek(f, (long)(t*sizeof(utmp)), 0);
- SCPYN(utmp.ut_line, tty);
- write(f, (char *)&utmp, sizeof(utmp));
- close(f);
- }
- if ((f = open("/usr/adm/wtmp", O_WRONLY|O_APPEND)) >= 0) {
- write(f, (char *)&utmp, sizeof(utmp));
- close(f);
- }
+ SCPYN(utmp.ut_line, tty);
+ login(&utmp);
quietlog = access(qlog, F_OK) == 0;
if ((f = open(lastlog, O_RDWR)) >= 0) {
struct lastlog ll;