[1616] in Kerberos-V5-bugs

home help back first fref pref prev next nref lref last post

Fixes for login.krb5

daemon@ATHENA.MIT.EDU (Joe Ramus)
Tue Sep 5 17:18:09 1995

Date: Tue, 5 Sep 95 11:10:32 PDT
From: ramus@nersc.gov (Joe Ramus)
To: krb5-bugs@MIT.EDU

Here are fixes for login.krb5 in K5.5.
This suppresses the message "Warning: No Kerberos tickets obtained" when
a ticket is forwarded.

It also includes fixes for the  utmp/utmpx log files.
In some cases, the host name was not recorded as part of the login
record.  I have added "host" as a parameter on several calls.

----------------------------------------------------------------
| Joe Ramus  NERSC Livermore  (510) 423-8917   ramus@nersc.gov |
----------------------------------------------------------------

==================================================================================

*** appl/bsd/,login.c	Mon Jul 31 11:08:42 1995
--- appl/bsd/login.c	Fri Aug 25 12:51:33 1995
***************
*** 875,880 ****
--- 875,881 ----
  	setenv("PATH", LPATH, 0);
  	setenv("USER", pwd->pw_name, 0);
  	setenv("SHELL", pwd->pw_shell, 0);
+ 	setenv("LOGNAME", pwd->pw_name, 0);
  
  	if (term[0] == '\0')
  		(void) strncpy(term, stypeof(tty), sizeof(term));
***************
*** 941,947 ****
  		struct stat st;
  
  #ifdef KRB4
! 		if (!krbflag)
  		    printf("\nWarning: No Kerberos tickets obtained.\n\n");
  #endif /* KRB4 */
  		motd();
--- 942,948 ----
  		struct stat st;
  
  #ifdef KRB4
! 		if (!krbflag && !fflag && !Fflag && !eflag )
  		    printf("\nWarning: No Kerberos tickets obtained.\n\n");
  #endif /* KRB4 */
  		motd();
*** appl/bsd/,logutil.c	Mon Jul 31 11:42:52 1995
--- appl/bsd/logutil.c	Tue Sep  5 10:42:29 1995
***************
*** 124,129 ****
--- 124,130 ----
  #ifdef HAVE_SETUTXENT
      setutxent();
      getutmpx(ent, &utx);
+     strncpy(utx.ut_host, host, sizeof(utx.ut_host));
      pututxline(&utx);
      endutxent();
  #endif /* HAVE_SETUTXENT */
***************
*** 139,149 ****
  
  #endif /* HAVE_SETUTENT */
  
!     update_wtmp(ent);
  }
  
! void update_wtmp(ent)
      struct utmp *ent;
  {
      struct utmp ut;
      struct stat statb;
--- 140,151 ----
  
  #endif /* HAVE_SETUTENT */
  
!     update_wtmp(ent, host);
  }
  
! void update_wtmp(ent, host)
      struct utmp *ent;
+     char *host;
  {
      struct utmp ut;
      struct stat statb;
***************
*** 152,162 ****
--- 154,170 ----
      struct utmpx utx;
  
      getutmpx(ent, &utx);
+     strncpy(utx.ut_host, host, sizeof(utx.ut_host));
      updwtmpx(WTMPX_FILE, &utx);
  #endif
  
  #ifdef HAVE_UPDWTMP
+ #ifndef HAVE_SETUTXENT
+     /**  This operation is already done by updwtmpx()
+     ***  when HAVE_SETUTXENT is defined.
+     **/
      updwtmp(WTMP_FILE, ent);
+ #endif
  #else /* HAVE_UPDWTMP */
  
      if ((fd = open(WTMP_FILE, O_WRONLY|O_APPEND, 0)) >= 0) {
***************
*** 220,225 ****
      strncpy(ut.ut_name, locuser, sizeof(ut.ut_name));
  #endif
  
!     update_wtmp(&ut);
  }
  #endif
--- 228,233 ----
      strncpy(ut.ut_name, locuser, sizeof(ut.ut_name));
  #endif
  
!     update_wtmp(&ut, host);
  }
  #endif

home help back first fref pref prev next nref lref last post