]> andersk Git - openssh.git/commitdiff
- (djm) Login fixes from Tom Bertelson <tbert@abac.com>
authordjm <djm>
Sat, 1 Jul 2000 03:17:42 +0000 (03:17 +0000)
committerdjm <djm>
Sat, 1 Jul 2000 03:17:42 +0000 (03:17 +0000)
ChangeLog
acconfig.h
configure.in
loginrec.c

index 1d47d6c3ab12bc02199323893ed5f43dc5ff410f..06ed24d5121465ad049ecf277e762f2fae5ff8db 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,6 @@
 20000701
  - (djm) Fix Tru64 SIA problems reported by John P Speno <speno@isc.upenn.edu>
+ - (djm) Login fixes from Tom Bertelson <tbert@abac.com>
 
 20000628
  - (djm) Fixes to lastlog code for Irix
index 6f375212cdbec025caa22636170e242b7ed44f80..f10370df44e54a2e5a1a164e9f5e6563fe1c2c5c 100644 (file)
@@ -57,6 +57,7 @@
 #undef HAVE_TV_IN_UTMP
 #undef HAVE_TV_IN_UTMPX
 #undef HAVE_ID_IN_UTMP
+#undef HAVE_ID_IN_UTMPX
 #undef HAVE_EXIT_IN_UTMP
 #undef HAVE_TIME_IN_UTMP
 #undef HAVE_TIME_IN_UTMPX
index 4dd08c71a5fd82334743ba6b894a4e92fb157272..8e155f26b52139aa17cccf6914aaf6095527ac0a 100644 (file)
@@ -636,6 +636,7 @@ OSSH_CHECK_HEADER_FOR_FIELD(ut_type, utmp.h, HAVE_TYPE_IN_UTMP)
 OSSH_CHECK_HEADER_FOR_FIELD(ut_type, utmpx.h, HAVE_TYPE_IN_UTMPX)
 OSSH_CHECK_HEADER_FOR_FIELD(ut_tv, utmp.h, HAVE_TV_IN_UTMP)
 OSSH_CHECK_HEADER_FOR_FIELD(ut_id, utmp.h, HAVE_ID_IN_UTMP)
+OSSH_CHECK_HEADER_FOR_FIELD(ut_id, utmpx.h, HAVE_ID_IN_UTMPX)
 OSSH_CHECK_HEADER_FOR_FIELD(ut_addr, utmp.h, HAVE_ADDR_IN_UTMP)
 OSSH_CHECK_HEADER_FOR_FIELD(ut_addr, utmpx.h, HAVE_ADDR_IN_UTMPX)
 OSSH_CHECK_HEADER_FOR_FIELD(ut_addr_v6, utmp.h, HAVE_ADDR_V6_IN_UTMP)
index 384136e510e099714f20c66b5dcf6fec2d47e1b3..c286a4490213034760778e2b63f8607e2d546bd4 100644 (file)
@@ -535,11 +535,18 @@ line_abbrevname(char *dst, const char *src, int dstsize)
        
        memset(dst, '\0', dstsize);
        
+       /* Always skip prefix if present */
+       if (strncmp(src, "/dev/", 5) == 0)
+               src += 5;
+               
        len = strlen(src);
 
-       if (len <= 0) {
-               src += (len - dstsize);
-               strncpy(dst, src, dstsize); /* note: _don't_ change this to strlcpy */
+       if (len > 0) {
+               if (((int)len - dstsize) > 0)
+                       src +=  ((int)len - dstsize);
+
+               /* note: _don't_ change this to strlcpy */
+               strncpy(dst, src, (size_t)dstsize); 
        }
        
        return dst;
@@ -647,7 +654,9 @@ void
 construct_utmpx(struct logininfo *li, struct utmpx *utx)
 {
        memset(utx, '\0', sizeof(struct utmpx));
+# ifdef HAVE_ID_IN_UTMPX
        line_abbrevname(utx->ut_id, li->line, sizeof(utx->ut_id));
+# endif
 
        /* this is done here to keep utmp constants out of loginrec.h */
        switch (li->type) {
This page took 2.095379 seconds and 5 git commands to generate.