Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/netbsd-7]: src/libexec/ftpd Pull up following revision(s) (requested by ...



details:   https://anonhg.NetBSD.org/src/rev/b65f6f576996
branches:  netbsd-7
changeset: 799616:b65f6f576996
user:      riz <riz%NetBSD.org@localhost>
date:      Wed Nov 04 17:07:07 2015 +0000

description:
Pull up following revision(s) (requested by shm in ticket #944):
        libexec/ftpd/logwtmp.c: revision 1.26
        libexec/ftpd/logwtmp.c: revision 1.27
Removed unnecessary memset(3) call
Clear utmpx struct before writing it to wtmpx files

diffstat:

 libexec/ftpd/logwtmp.c |  7 +++----
 1 files changed, 3 insertions(+), 4 deletions(-)

diffs (33 lines):

diff -r 8eb2202c2fe2 -r b65f6f576996 libexec/ftpd/logwtmp.c
--- a/libexec/ftpd/logwtmp.c    Wed Nov 04 17:04:14 2015 +0000
+++ b/libexec/ftpd/logwtmp.c    Wed Nov 04 17:07:07 2015 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: logwtmp.c,v 1.25 2006/09/23 16:03:50 xtraeme Exp $     */
+/*     $NetBSD: logwtmp.c,v 1.25.60.1 2015/11/04 17:07:07 riz Exp $    */
 
 /*
  * Copyright (c) 1988, 1993
@@ -36,7 +36,7 @@
 #if 0
 static char sccsid[] = "@(#)logwtmp.c  8.1 (Berkeley) 6/4/93";
 #else
-__RCSID("$NetBSD: logwtmp.c,v 1.25 2006/09/23 16:03:50 xtraeme Exp $");
+__RCSID("$NetBSD: logwtmp.c,v 1.25.60.1 2015/11/04 17:07:07 riz Exp $");
 #endif
 #endif /* not lint */
 
@@ -124,13 +124,12 @@
        if (fdx < 0) 
                return;
        if (fstat(fdx, &buf) == 0) {
+               (void)memset(&ut, 0, sizeof(ut));
                (void)strncpy(ut.ut_line, line, sizeof(ut.ut_line));
                (void)strncpy(ut.ut_name, name, sizeof(ut.ut_name));
                (void)strncpy(ut.ut_host, host, sizeof(ut.ut_host));
                if (haddr)
                        (void)memcpy(&ut.ut_ss, &haddr->si_su, haddr->su_len);
-               else
-                       (void)memset(&ut.ut_ss, 0, sizeof(ut.ut_ss));
                ut.ut_type = utx_type;
                if (WIFEXITED(status))
                        ut.ut_exit.e_exit = (uint16_t)WEXITSTATUS(status);



Home | Main Index | Thread Index | Old Index