From 63018bad00f532a24631f35f24e98727a539efae Mon Sep 17 00:00:00 2001 From: Tom Yu Date: Sat, 8 Dec 2001 01:57:17 +0000 Subject: [PATCH] * update_utmp.c (PTY_GETUTXENT): Fix typo. Thanks to Shawn Stepper. [fixes krb5-build/1020] [pullup from 1.2.3] git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@14057 dc483132-0cff-0310-8789-dd5450dbe970 --- src/util/pty/ChangeLog | 11 +++++++++++ src/util/pty/update_utmp.c | 7 +++++-- 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a/src/util/pty/ChangeLog b/src/util/pty/ChangeLog index c1741b2c0..ec6398cee 100644 --- a/src/util/pty/ChangeLog +++ b/src/util/pty/ChangeLog @@ -2,6 +2,17 @@ * README: s-pty_init_ets/pty_init/ +2001-11-28 Tom Yu + + * update_utmp.c (PTY_GETUTXENT): Fix typo. Thanks to Shawn + Stepper. [fixes krb5-build/1020] + +2001-11-19 Tom Yu + + * update_utmp.c (pty_update_utmp): Patch from Garry Zacheiss to + kludge around cases where we need to use more than 2 characters of + LINE in order to avoid conflicts in UT_ID. + 2001-10-18 Ezra Peisach * sane_hostname.c (pty_make_sane_hostname): Do not declare addrbuf diff --git a/src/util/pty/update_utmp.c b/src/util/pty/update_utmp.c index af4e9874d..72c41be4e 100644 --- a/src/util/pty/update_utmp.c +++ b/src/util/pty/update_utmp.c @@ -338,7 +338,7 @@ #else #define PTY_STRUCT_UTMPX struct utmp #define PTY_SETUTXENT setutent -#define PTY_GETUTXENT gettutent +#define PTY_GETUTXENT getutent #define PTY_GETUTXLINE getutline #define PTY_PUTUTXLINE pututline #define PTY_ENDUTXENT endutent @@ -532,7 +532,10 @@ pty_update_utmp(int process_type, int pid, const char *username, #ifdef __hpux strcpy(utmp_id, cp); #else - sprintf(utmp_id, "kl%s", cp); + if (len > 2 && *(cp - 1) != '/') + sprintf(utmp_id, "k%s", cp - 1); + else + sprintf(utmp_id, "k0%s", cp); #endif strncpy(utx.ut_id, utmp_id, sizeof(utx.ut_id)); /* -- 2.26.2