Source-Changes-HG archive

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

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



details:   https://anonhg.NetBSD.org/src/rev/6cf6a531e174
branches:  netbsd-6
changeset: 777004:6cf6a531e174
user:      bouyer <bouyer%NetBSD.org@localhost>
date:      Sun Nov 15 17:39:10 2015 +0000

description:
Pull up following revision(s) (requested by shm in ticket #1321):
        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 a9f2cced8003 -r 6cf6a531e174 libexec/ftpd/logwtmp.c
--- a/libexec/ftpd/logwtmp.c    Sun Nov 15 17:36:32 2015 +0000
+++ b/libexec/ftpd/logwtmp.c    Sun Nov 15 17:39:10 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.42.1 2015/11/15 17:39:10 bouyer 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.42.1 2015/11/15 17:39:10 bouyer 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