use libutil version of login
authorKeith Bostic <bostic@ucbvax.Berkeley.EDU>
Tue, 20 Sep 1988 11:15:42 +0000 (03:15 -0800)
committerKeith Bostic <bostic@ucbvax.Berkeley.EDU>
Tue, 20 Sep 1988 11:15:42 +0000 (03:15 -0800)
SCCS-vsn: usr.bin/login/login.c 5.22
SCCS-vsn: usr.bin/login/login.c.1 5.22

usr/src/usr.bin/login/login.c
usr/src/usr.bin/login/login.c.1

index 926be83..f4a20e1 100644 (file)
@@ -11,7 +11,7 @@ char copyright[] =
 #endif not lint
 
 #ifndef lint
 #endif not lint
 
 #ifndef lint
-static char sccsid[] = "@(#)login.c    5.21 (Berkeley) %G%";
+static char sccsid[] = "@(#)login.c    5.22 (Berkeley) %G%";
 #endif not lint
 
 /*
 #endif not lint
 
 /*
@@ -337,17 +337,8 @@ main(argc, argv)
                exit(0);
        }
        time(&utmp.ut_time);
                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;
        quietlog = access(qlog, F_OK) == 0;
        if ((f = open(lastlog, O_RDWR)) >= 0) {
                struct lastlog ll;
index 9b162f5..4c91d6b 100644 (file)
@@ -11,7 +11,7 @@ char copyright[] =
 #endif not lint
 
 #ifndef lint
 #endif not lint
 
 #ifndef lint
-static char sccsid[] = "@(#)login.c.1  5.21 (Berkeley) %G%";
+static char sccsid[] = "@(#)login.c.1  5.22 (Berkeley) %G%";
 #endif not lint
 
 /*
 #endif not lint
 
 /*
@@ -337,17 +337,8 @@ main(argc, argv)
                exit(0);
        }
        time(&utmp.ut_time);
                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;
        quietlog = access(qlog, F_OK) == 0;
        if ((f = open(lastlog, O_RDWR)) >= 0) {
                struct lastlog ll;