Module Name:    othersrc
Committed By:   lukem
Date:           Sat Jul  4 04:00:53 UTC 2020

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

Log Message:
Merge NetBSD-20190129

Prepare pfilter.c for future USE_BLOCKLIST check.


To generate a diff of this commit:
cvs rdiff -u -r1.18 -r1.19 othersrc/libexec/tnftpd/src/extern.h
cvs rdiff -u -r1.36 -r1.37 othersrc/libexec/tnftpd/src/ftpd.c
cvs rdiff -u -r1.2 -r1.3 othersrc/libexec/tnftpd/src/pfilter.c
cvs rdiff -u -r1.9 -r1.10 othersrc/libexec/tnftpd/src/version.h

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/extern.h
diff -u othersrc/libexec/tnftpd/src/extern.h:1.18 othersrc/libexec/tnftpd/src/extern.h:1.19
--- othersrc/libexec/tnftpd/src/extern.h:1.18	Tue Jan 29 12:26:47 2019
+++ othersrc/libexec/tnftpd/src/extern.h	Sat Jul  4 04:00:53 2020
@@ -1,5 +1,5 @@
-/*	$NetBSD: extern.h,v 1.18 2019/01/29 12:26:47 lukem Exp $	*/
-/*	from	NetBSD: extern.h,v 1.64 2018/06/23 07:21:00 gson Exp	*/
+/*	$NetBSD: extern.h,v 1.19 2020/07/04 04:00:53 lukem Exp $	*/
+/*	from	NetBSD: extern.h,v 1.65 2019/10/15 18:29:32 christos Exp	*/
 
 /*-
  * Copyright (c) 1992, 1993
@@ -339,7 +339,7 @@ GLOBAL	char		proctitle[BUFSIZ];	/* initi
 GLOBAL	struct passwd  *pw;
 GLOBAL	int		quietmessages;
 GLOBAL	char		remotehost[MAXHOSTNAMELEN+1];
-GLOBAL	char		remoteloghost[2 * MAXHOSTNAMELEN+1];
+GLOBAL	char		remoteloghost[2 * MAXHOSTNAMELEN + 4];
 GLOBAL	off_t		restart_point;
 GLOBAL	char		tmpline[FTP_BUFLEN];
 GLOBAL	int		type;

Index: othersrc/libexec/tnftpd/src/ftpd.c
diff -u othersrc/libexec/tnftpd/src/ftpd.c:1.36 othersrc/libexec/tnftpd/src/ftpd.c:1.37
--- othersrc/libexec/tnftpd/src/ftpd.c:1.36	Tue Jan 29 13:30:32 2019
+++ othersrc/libexec/tnftpd/src/ftpd.c	Sat Jul  4 04:00:53 2020
@@ -1,5 +1,5 @@
-/*	$NetBSD: ftpd.c,v 1.36 2019/01/29 13:30:32 lukem Exp $	*/
-/*	from	NetBSD: ftpd.c,v 1.204 2018/04/28 13:38:00 riastradh Exp	*/
+/*	$NetBSD: ftpd.c,v 1.37 2020/07/04 04:00:53 lukem Exp $	*/
+/*	from	NetBSD: ftpd.c,v 1.205 2019/10/15 18:29:32 christos Exp	*/
 
 /*
  * Copyright (c) 1997-2009 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.204 2018/04/28 13:38:00 riastradh Exp  ");
+__RCSID(" NetBSD: ftpd.c,v 1.205 2019/10/15 18:29:32 christos Exp  ");
 #endif
 #endif /* not lint */
 
@@ -3003,7 +3003,7 @@ logremotehost(struct sockinet *who)
 {
 
 #if defined(HAVE_SOCKADDR_SNPRINTF)
-	char abuf[BUFSIZ];
+	char abuf[MAXHOSTNAMELEN];
 #endif
 
 	struct sockaddr *sa = (struct sockaddr *)&who->si_su;

Index: othersrc/libexec/tnftpd/src/pfilter.c
diff -u othersrc/libexec/tnftpd/src/pfilter.c:1.2 othersrc/libexec/tnftpd/src/pfilter.c:1.3
--- othersrc/libexec/tnftpd/src/pfilter.c:1.2	Tue Jan 29 12:51:38 2019
+++ othersrc/libexec/tnftpd/src/pfilter.c	Sat Jul  4 04:00:53 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: pfilter.c,v 1.2 2019/01/29 12:51:38 lukem Exp $	*/
+/*	$NetBSD: pfilter.c,v 1.3 2020/07/04 04:00:53 lukem Exp $	*/
 
 #if defined(HAVE_TNFTPD_H)
 #include "tnftpd.h"
@@ -6,20 +6,27 @@
 
 #include <stdio.h>
 
-#if USE_BLACKLIST
+#if USE_BLOCKLIST
+#include <blocklist.h>
+#elif USE_BLACKLIST
 #include <blacklist.h>
 #endif
 
 #include "pfilter.h"
 
-#if USE_BLACKLIST
+#if USE_BLOCKLIST
+static struct blocklist *blstate;
+#elif USE_BLACKLIST
 static struct blacklist *blstate;
 #endif
 
 void
 pfilter_open(void)
 {
-#if USE_BLACKLIST
+#if USE_BLOCKLIST
+	if (blstate == NULL)
+		blstate = blocklist_open();
+#elif USE_BLACKLIST
 	if (blstate == NULL)
 		blstate = blacklist_open();
 #endif
@@ -28,12 +35,17 @@ pfilter_open(void)
 void
 pfilter_notify(int what, const char *msg)
 {
-#if USE_BLACKLIST
+#if USE_BLOCKLIST || USE_BLACKLIST
 	pfilter_open();
 
 	if (blstate == NULL)
 		return;
 
-	blacklist_r(blstate, what, 0, msg);
+
+#if USE_BLOCKLIST
+	blocklist_r(blstate, what, STDIN_FILENO, msg);
+#elif USE_BLOCKLIST
+	blacklist_r(blstate, what, STDIN_FILENO, msg);
 #endif
+#endif /* USE_BLOCKLIST || USE_BLACKLIST */
 }

Index: othersrc/libexec/tnftpd/src/version.h
diff -u othersrc/libexec/tnftpd/src/version.h:1.9 othersrc/libexec/tnftpd/src/version.h:1.10
--- othersrc/libexec/tnftpd/src/version.h:1.9	Tue Jan 29 12:14:46 2019
+++ othersrc/libexec/tnftpd/src/version.h	Sat Jul  4 04:00:53 2020
@@ -1,7 +1,7 @@
-/*	$NetBSD: version.h,v 1.9 2019/01/29 12:14:46 lukem Exp $	*/
-/*	from	NetBSD: version.h,v 1.76 2019/01/29 11:51:05 lukem Exp	*/
+/*	$NetBSD: version.h,v 1.10 2020/07/04 04:00:53 lukem Exp $	*/
+/*	from	NetBSD: version.h,v 1.77 2020/07/04 01:20:42 lukem Exp	*/
 /*-
- * Copyright (c) 1999-2019 The NetBSD Foundation, Inc.
+ * Copyright (c) 1999-2020 The NetBSD Foundation, Inc.
  * All rights reserved.
  *
  * This code is derived from software contributed to The NetBSD Foundation
@@ -30,5 +30,5 @@
  */
 
 #ifndef FTPD_VERSION
-#define	FTPD_VERSION	"NetBSD-ftpd 20180428"
+#define	FTPD_VERSION	"NetBSD-ftpd 20200615"
 #endif

Reply via email to