* logutil.c
authorRichard Basch <probe@mit.edu>
Wed, 28 Dec 1994 18:55:37 +0000 (18:55 +0000)
committerRichard Basch <probe@mit.edu>
Wed, 28 Dec 1994 18:55:37 +0000 (18:55 +0000)
   Search to the proper position in the utmp/utmpx files.

git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@4764 dc483132-0cff-0310-8789-dd5450dbe970

src/appl/bsd/logutil.c

index 2be2c0db0b8643562f8866027feee4b0148a8f4e..4fcef6d39c078177845b38073630328f7970b632 100644 (file)
@@ -80,28 +80,13 @@ void update_utmp(ent, username, line, host)
     sprintf(utmp_id, "kl%s", tmpx);
     strncpy(ent->ut_id, utmp_id, sizeof(ent->ut_id));
     strncpy(ent->ut_user, username, sizeof(ent->ut_user));
-
-    switch(ent->ut_type) {
-    case LOGIN_PROCESS:
-    case USER_PROCESS:
-       memset((char *)&ut, 0, sizeof(ut));
-       strncpy(ut.ut_id, ent->ut_id, sizeof(ut.ut_id));
-       ut.ut_type = DEAD_PROCESS;
-       getutid(&ut);
-       break;
-    case DEAD_PROCESS:
-       memset((char *)&ut, 0, sizeof(ut));
-       strncpy(ut.ut_id, ent->ut_id, sizeof(ut.ut_id));
-       ut.ut_type = USER_PROCESS;
-       getutid(&ut);
-       break;
-    }
 #else
     strncpy(ent->ut_name, username, sizeof(ent->ut_name));
 #endif
     
 #ifdef HAVE_SETUTXENT
     getutmpx(ent, &utx);
+    getutxid(&ent);
     setutxent();
     pututxline(&utx);
     endutxent();
@@ -109,6 +94,7 @@ void update_utmp(ent, username, line, host)
 #ifdef HAVE_SETUTENT
     utmpname(UTMP_FILE);
     setutent();
+    getutid(ent);
     pututline(ent);
     endutent();
 #else /* HAVE_SETUTENT */