From: Sam Hartman Date: Sat, 21 Oct 1995 20:43:18 +0000 (+0000) Subject: Incorperate utmpx patch to take advantage of longer utmpx host names X-Git-Tag: krb5-1.0-beta6~890 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=98eb1d4ea815056fd6401c47016cb0f4f1c73f0f;p=krb5.git Incorperate utmpx patch to take advantage of longer utmpx host names git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@6979 dc483132-0cff-0310-8789-dd5450dbe970 --- diff --git a/src/util/pty/ChangeLog b/src/util/pty/ChangeLog index 06158291d..a456b444f 100644 --- a/src/util/pty/ChangeLog +++ b/src/util/pty/ChangeLog @@ -1,13 +1,57 @@ -Sat Oct 14 20:49:40 1995 Sam Hartman +Mon Oct 16 17:41:45 1995 Sam Hartman + + + * update_wtmp.c (ptyint_update_wtmp): Update to take host name, so + we can get the full host name if it is chopped in utmp. * update_wtmp.c (ptyint_update_wtmp): Insert fallback path for Sunos and others, return defined value. + + + * update_utmp.c (pty_update_utmp): Incorperate utmpx handling patch from ramus@nersc.gov to deal with support for longer hostanmes in utmpx. + + +*update_utmp.c: Add return statement and fallback path for Sunos. + +Sat Oct 14 20:49:40 1995 Sam Hartman Fri Aug 11 17:49:36 1995 Samuel D Hartman (hartmans@vorlon) +>>>>>>> 1.24 +<<<<<<< ChangeLog +Fri Sep 29 14:18:03 1995 Theodore Y. Ts'o +======= * update_wtmp.c (ptyint_update_wtmp): If EMPTY not defined as a utmp type, use DEAD_PROCESS. +>>>>>>> 1.24 + +<<<<<<< ChangeLog + * configure.in: + * Makefile.in: Use the SubdirLibraryRule defined in aclocal.m4 to + create the DONE file (and to properly clean it up). + +Mon Sep 25 16:42:36 1995 Theodore Y. Ts'o + + * Makefile.in: Removed "foo:: foo-$(WHAT)" lines from the + Makefile. + +Thu Sep 7 19:13:05 1995 Mark Eichin + + * update_utmp.c: ultimately fall back to /etc/utmp for UTMP_FILE, + if it is still missing after all previous efforts. + * update_wtmp.c: /usr/adm/wtmp for WTMP_FILE likewise. + +Thu Aug 24 18:40:48 1995 Theodore Y. Ts'o + + * .Sanitize: Update file list + +Tue Aug 15 21:42:16 1995 + + * update_wtmp.c (ptyint_update_wtmp): If EMPTY is not defined, + then set ut.ut_type to 0 instead. +======= +>>>>>>> 1.24 Fri Aug 11 15:49:30 1995 Sam Hartman * Makefile.in (CFILES): Rename initialize_slave.c to init_slave.c diff --git a/src/util/pty/logwtmp.c b/src/util/pty/logwtmp.c index 9c88d5606..89feabb81 100644 --- a/src/util/pty/logwtmp.c +++ b/src/util/pty/logwtmp.c @@ -56,7 +56,7 @@ long pty_logwtmp (tty, user, host ) strncpy(ut.ut_name, user, sizeof(ut.ut_name)); #endif - return ptyint_update_wtmp(&ut); + return ptyint_update_wtmp(&ut, host); #endif /*HAVE_LOGWTMP*/ } diff --git a/src/util/pty/pty-int.h b/src/util/pty/pty-int.h index 8d5d1aeb8..1b59275c5 100644 --- a/src/util/pty/pty-int.h +++ b/src/util/pty/pty-int.h @@ -94,7 +94,7 @@ void initialize_pty_error_table(void); long ptyint_void_association(void); long ptyint_open_ctty (char *slave, int *fd); -long ptyint_update_wtmp (struct utmp *ut); +long ptyint_update_wtmp (struct utmp *ut, char *host); void ptyint_vhangup(void); #else /*__STDC__*/ diff --git a/src/util/pty/update_utmp.c b/src/util/pty/update_utmp.c index 758d40a16..475186dea 100644 --- a/src/util/pty/update_utmp.c +++ b/src/util/pty/update_utmp.c @@ -120,6 +120,9 @@ long pty_update_utmp (process_type, pid, username, line, host) #ifdef HAVE_SETUTXENT setutxent(); getutmpx(&ent, &utx); +if (host) + strncpy(utx.ut_host, host, sizeof(utx.ut_host)); + else utx.ut_host[0] = 0; pututxline(&utx); endutxent(); #endif /* HAVE_SETUTXENT */ @@ -135,5 +138,5 @@ long pty_update_utmp (process_type, pid, username, line, host) #endif /* HAVE_SETUTENT */ - return ptyint_update_wtmp(&ent); + return ptyint_update_wtmp(&ent, host); } diff --git a/src/util/pty/update_wtmp.c b/src/util/pty/update_wtmp.c index 2733b2a7b..de264db66 100644 --- a/src/util/pty/update_wtmp.c +++ b/src/util/pty/update_wtmp.c @@ -29,8 +29,9 @@ #define PATH_WTMP "/usr/adm/wtmp" #endif -long ptyint_update_wtmp (ent) +long ptyint_update_wtmp (ent , host) struct utmp *ent; + char *host; { struct utmp ut; struct stat statb; @@ -39,11 +40,16 @@ long ptyint_update_wtmp (ent) struct utmpx utx; getutmpx(ent, &utx); +if (host) + strncpy(utx.ut_host, host, sizeof(utx.ut_host) ); + else uts.ut_host[0] = 0; updwtmpx(WTMPX_FILE, &utx); #endif #ifdef HAVE_UPDWTMP +#ifndef HAVE_SETUTXENT updwtmp(WTMP_FILE, ent); +#endif /* HAVE_SETUTXENT*/ #else /* HAVE_UPDWTMP */ if ((fd = open(WTMP_FILE, O_WRONLY|O_APPEND, 0)) >= 0) { @@ -79,3 +85,4 @@ long ptyint_update_wtmp (ent) return 0; /* no current failure cases; file not found is not failure!*/ } +