Module Name:    src
Committed By:   bouyer
Date:           Sun Nov 15 17:39:10 UTC 2015

Modified Files:
        src/libexec/ftpd [netbsd-6]: logwtmp.c

Log Message:
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


To generate a diff of this commit:
cvs rdiff -u -r1.25 -r1.25.42.1 src/libexec/ftpd/logwtmp.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/libexec/ftpd/logwtmp.c
diff -u src/libexec/ftpd/logwtmp.c:1.25 src/libexec/ftpd/logwtmp.c:1.25.42.1
--- src/libexec/ftpd/logwtmp.c:1.25	Sat Sep 23 16:03:50 2006
+++ src/libexec/ftpd/logwtmp.c	Sun Nov 15 17:39:10 2015
@@ -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 @@ ftpd_logwtmpx(const char *line, const ch
 	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);

Reply via email to