Module Name:    othersrc
Committed By:   lukem
Date:           Sun Oct  1 01:48:50 UTC 2023

Modified Files:
        othersrc/libexec/tnftpd/src: conf.c ftpd.c version.h

Log Message:
merge conflicts between NetBSD-20230922 and NetBSD-20230930


To generate a diff of this commit:
cvs rdiff -u -r1.11 -r1.12 othersrc/libexec/tnftpd/src/conf.c \
    othersrc/libexec/tnftpd/src/version.h
cvs rdiff -u -r1.39 -r1.40 othersrc/libexec/tnftpd/src/ftpd.c

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

Modified files:

Index: othersrc/libexec/tnftpd/src/conf.c
diff -u othersrc/libexec/tnftpd/src/conf.c:1.11 othersrc/libexec/tnftpd/src/conf.c:1.12
--- othersrc/libexec/tnftpd/src/conf.c:1.11	Thu Mar 21 01:01:56 2013
+++ othersrc/libexec/tnftpd/src/conf.c	Sun Oct  1 01:48:50 2023
@@ -1,5 +1,5 @@
-/*	$NetBSD: conf.c,v 1.11 2013/03/21 01:01:56 lukem Exp $	*/
-/*	from	NetBSD: conf.c,v 1.64 2012/11/04 20:46:46 christos Exp	*/
+/*	$NetBSD: conf.c,v 1.12 2023/10/01 01:48:50 lukem Exp $	*/
+/*	from	NetBSD: conf.c,v 1.65 2023/09/29 14:49:03 shm Exp	*/
 
 /*-
  * Copyright (c) 1997-2009 The NetBSD Foundation, Inc.
@@ -36,7 +36,7 @@
 
 #include <sys/cdefs.h>
 #ifndef lint
-__RCSID(" NetBSD: conf.c,v 1.64 2012/11/04 20:46:46 christos Exp  ");
+__RCSID(" NetBSD: conf.c,v 1.65 2023/09/29 14:49:03 shm Exp  ");
 #endif /* not lint */
 
 #include <sys/types.h>
@@ -916,7 +916,7 @@ count_users(void)
 		goto cleanup_count;
 	if (fstat(fd, &sb) == -1)
 		goto cleanup_count;
-	if ((pids = malloc(sb.st_size + sizeof(pid_t))) == NULL)
+	if ((pids = calloc(sb.st_size + sizeof(pid_t), 1)) == NULL)
 		goto cleanup_count;
 /* XXX: implement a better read loop */
 	scount = read(fd, pids, sb.st_size);
Index: othersrc/libexec/tnftpd/src/version.h
diff -u othersrc/libexec/tnftpd/src/version.h:1.11 othersrc/libexec/tnftpd/src/version.h:1.12
--- othersrc/libexec/tnftpd/src/version.h:1.11	Sat Sep 23 05:30:36 2023
+++ othersrc/libexec/tnftpd/src/version.h	Sun Oct  1 01:48:50 2023
@@ -1,5 +1,5 @@
-/*	$NetBSD: version.h,v 1.11 2023/09/23 05:30:36 lukem Exp $	*/
-/*	from	NetBSD: version.h,v 1.79 2023/09/22 21:57:55 lukem Exp	*/
+/*	$NetBSD: version.h,v 1.12 2023/10/01 01:48:50 lukem Exp $	*/
+/*	from	NetBSD: version.h,v 1.80 2023/09/30 18:10:55 shm Exp	*/
 /*-
  * Copyright (c) 1999-2023 The NetBSD Foundation, Inc.
  * All rights reserved.
@@ -30,5 +30,5 @@
  */
 
 #ifndef FTPD_VERSION
-#define	FTPD_VERSION	"NetBSD-ftpd 20230922"
+#define	FTPD_VERSION	"NetBSD-ftpd 20230930"
 #endif

Index: othersrc/libexec/tnftpd/src/ftpd.c
diff -u othersrc/libexec/tnftpd/src/ftpd.c:1.39 othersrc/libexec/tnftpd/src/ftpd.c:1.40
--- othersrc/libexec/tnftpd/src/ftpd.c:1.39	Sat Sep 23 05:30:36 2023
+++ othersrc/libexec/tnftpd/src/ftpd.c	Sun Oct  1 01:48:50 2023
@@ -1,5 +1,5 @@
-/*	$NetBSD: ftpd.c,v 1.39 2023/09/23 05:30:36 lukem Exp $	*/
-/*	from	NetBSD: ftpd.c,v 1.207 2023/09/02 12:16:29 lukem Exp	*/
+/*	$NetBSD: ftpd.c,v 1.40 2023/10/01 01:48:50 lukem Exp $	*/
+/*	from	NetBSD: ftpd.c,v 1.208 2023/09/30 18:06:24 shm Exp	*/
 
 /*
  * Copyright (c) 1997-2023 The NetBSD Foundation, Inc.
@@ -108,7 +108,7 @@ __COPYRIGHT("@(#) Copyright (c) 1985, 19
 #if 0
 static char sccsid[] = "@(#)ftpd.c	8.5 (Berkeley) 4/28/95";
 #else
-__RCSID(" NetBSD: ftpd.c,v 1.207 2023/09/02 12:16:29 lukem Exp  ");
+__RCSID(" NetBSD: ftpd.c,v 1.208 2023/09/30 18:06:24 shm Exp  ");
 #endif
 #endif /* not lint */
 
@@ -4058,6 +4058,7 @@ auth_pam(void)
 	int e;
 	ftpd_cred_t auth_cred = { curname, 0 };
 	struct pam_conv conv = { &auth_conv, &auth_cred };
+	struct sockaddr_storage ss;
 
 	e = pam_start("ftpd", curname, &conv, &pamh);
 	if (e != PAM_SUCCESS) {
@@ -4081,7 +4082,9 @@ auth_pam(void)
 	}
 
 #if defined(PAM_SOCKADDR)
-	e = pam_set_item(pamh, PAM_SOCKADDR, &his_addr);
+	memset(&ss, 0, sizeof(ss));
+	memcpy(&ss, &his_addr.si_su, his_addr.su_len);
+	e = pam_set_item(pamh, PAM_SOCKADDR, &ss);
 	if (e != PAM_SUCCESS) {
 		syslog(LOG_ERR, "pam_set_item(PAM_SOCKADDR): %s",
 			pam_strerror(pamh, e));

Reply via email to