]> andersk Git - openssh.git/commitdiff
- (djm) Fix broken inet_ntoa check and ut_user/ut_name confusion, report
authordjm <djm>
Tue, 11 Jul 2000 02:15:54 +0000 (02:15 +0000)
committerdjm <djm>
Tue, 11 Jul 2000 02:15:54 +0000 (02:15 +0000)
   from Jim Watt <jimw@peisj.pebio.com>

ChangeLog
fake-getaddrinfo.c
loginrec.c

index 4afa18b154fe7b6df7d7e731bafda12aea5a3741..5e75845377708911d47fb769c82ebd14c7f384ba 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -4,6 +4,8 @@
  - (djm) ReliantUNIX support from Udo Schweigert <ust@cert.siemens.de>
  - (djm) NeXT: dirent structures to get scp working from Ben Lindstrom 
    <mouring@pconline.com>
+ - (djm) Fix broken inet_ntoa check and ut_user/ut_name confusion, report 
+   from Jim Watt <jimw@peisj.pebio.com>
 
 20000709
  - (djm) Only enable PAM_TTY kludge for Linux. Problem report from
index c9bc03a3549bbd9f78f6d3dff90494c0f3687a73..73c122ed11776cd01c3397ed4ad07b3c1aea43b6 100644 (file)
@@ -87,7 +87,7 @@ int getaddrinfo(const char *hostname, const char *servname,
                        return EAI_MEMORY;
        }
        
-       if (inet_aton(hostname, &in) != -1) {
+       if (inet_aton(hostname, &in)) {
                if (NULL != (*res = malloc_ai(port, in.s_addr)))
                        return 0;
                else
index 0c02283ae6b937a71254f61186a113ce9fc63964..6e9c4ce46ce46d34473dc5400a89ba56f13ebe6c 100644 (file)
@@ -606,7 +606,7 @@ construct_utmp(struct logininfo *li,
         */
 
        /* Use strncpy because we don't necessarily want null termination */
-       strncpy(ut->ut_user, li->username, MIN_SIZEOF(ut->ut_user, li->username));
+       strncpy(ut->ut_name, li->username, MIN_SIZEOF(ut->ut_name, li->username));
 # ifdef HAVE_HOST_IN_UTMP
        strncpy(ut->ut_host, li->hostname, MIN_SIZEOF(ut->ut_host, li->hostname));
 # endif
@@ -670,7 +670,7 @@ construct_utmpx(struct logininfo *li, struct utmpx *utx)
         */
 
        /* strncpy(): Don't necessarily want null termination */
-       strncpy(utx->ut_user, li->username, MIN_SIZEOF(utx->ut_user, li->username));
+       strncpy(utx->ut_name, li->username, MIN_SIZEOF(utx->ut_name, li->username));
 # ifdef HAVE_HOST_IN_UTMPX
        strncpy(utx->ut_host, li->hostname, MIN_SIZEOF(utx->ut_host, li->hostname));
 # endif
@@ -730,12 +730,12 @@ utmp_write_direct(struct logininfo *li, struct utmp *ut)
                /*
                 * Prevent luser from zero'ing out ut_host.
                 * If the new ut_line is empty but the old one is not
-                * and ut_line and ut_user match, preserve the old ut_line.
+                * and ut_line and ut_name match, preserve the old ut_line.
                 */
                if (atomicio(read, fd, &old_ut, sizeof(old_ut)) == sizeof(old_ut) && 
                        (ut->ut_host[0] == '\0') && (old_ut.ut_host[0] != '\0') && 
                        (strncmp(old_ut.ut_line, ut->ut_line, sizeof(ut->ut_line)) == 0) && 
-                       (strncmp(old_ut.ut_user, ut->ut_user, sizeof(ut->ut_user)) == 0)) {
+                       (strncmp(old_ut.ut_name, ut->ut_name, sizeof(ut->ut_name)) == 0)) {
                        (void)memcpy(ut->ut_host, old_ut.ut_host, sizeof(ut->ut_host));
                }
                
@@ -996,8 +996,8 @@ wtmp_write_entry(struct logininfo *li)
 static int
 wtmp_islogin(struct logininfo *li, struct utmp *ut)
 {
-       if (strncmp(li->username, ut->ut_user
-               MIN_SIZEOF(li->username, ut->ut_user)) == 0) {
+       if (strncmp(li->username, ut->ut_name
+               MIN_SIZEOF(li->username, ut->ut_name)) == 0) {
 # ifdef HAVE_TYPE_IN_UTMP
                if (ut->ut_type & USER_PROCESS)
                        return 1;
@@ -1151,8 +1151,8 @@ wtmpx_write_entry(struct logininfo *li)
 static int
 wtmpx_islogin(struct logininfo *li, struct utmpx *utx)
 {
-       if ( strncmp(li->username, utx->ut_user,
-               MIN_SIZEOF(li->username, utx->ut_user)) == 0 ) {
+       if ( strncmp(li->username, utx->ut_name,
+               MIN_SIZEOF(li->username, utx->ut_name)) == 0 ) {
 # ifdef HAVE_TYPE_IN_UTMPX
                if (utx->ut_type == USER_PROCESS)
                        return 1;
This page took 1.672349 seconds and 5 git commands to generate.