CVS commit: othersrc/libexec/tnftpd/ls

2023-11-30 Thread Luke Mewburn
Module Name:othersrc
Committed By:   lukem
Date:   Thu Nov 30 09:42:36 UTC 2023

Modified Files:
othersrc/libexec/tnftpd/ls: ls.c

Log Message:
workaround FreeBSD  changing fts_open()'s compar signature

FreeBSD 5.2 changed fts_open()'s compar function signature by
adding extra const to the pointer arguments, and compilers
may complain about the mismatch.
Add workaround if compiling for FreeBSD and its .


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 othersrc/libexec/tnftpd/ls/ls.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/ls/ls.c
diff -u othersrc/libexec/tnftpd/ls/ls.c:1.5 othersrc/libexec/tnftpd/ls/ls.c:1.6
--- othersrc/libexec/tnftpd/ls/ls.c:1.5	Sun Mar  1 22:58:20 2009
+++ othersrc/libexec/tnftpd/ls/ls.c	Thu Nov 30 09:42:36 2023
@@ -1,4 +1,4 @@
-/*	$NetBSD: ls.c,v 1.5 2009/03/01 22:58:20 lukem Exp $	*/
+/*	$NetBSD: ls.c,v 1.6 2023/11/30 09:42:36 lukem Exp $	*/
 
 /*
  * Copyright (c) 1989, 1993, 1994
@@ -46,7 +46,7 @@ __COPYRIGHT("@(#) Copyright (c) 1989, 19
 #if 0
 static char sccsid[] = "@(#)ls.c	8.7 (Berkeley) 8/5/94";
 #else
-__RCSID("$NetBSD: ls.c,v 1.5 2009/03/01 22:58:20 lukem Exp $");
+__RCSID("$NetBSD: ls.c,v 1.6 2023/11/30 09:42:36 lukem Exp $");
 #endif
 #endif /* not lint */
 
@@ -73,7 +73,14 @@ __RCSID("$NetBSD: ls.c,v 1.5 2009/03/01 
 #include "extern.h"
 
 static void	 display(FTSENT *, FTSENT *);
+
+/* workaround FreeBSD  changing fts_open()'s compar signature */
+#if defined(__FreeBSD__) && defined(USE_FTS_H)
+static int	 mastercmp(const FTSENT * const *, const FTSENT * const *);
+#else
 static int	 mastercmp(const FTSENT **, const FTSENT **);
+#endif
+
 static void	 traverse(int, char **, int);
 
 static void (*printfcn)(DISPLAY *);
@@ -595,7 +602,11 @@ display(FTSENT *p, FTSENT *list)
  * All other levels use the sort function.  Error entries remain unsorted.
  */
 static int
+#if defined(__FreeBSD__) && defined(USE_FTS_H)
+mastercmp(const FTSENT * const *a, const FTSENT * const *b)
+#else
 mastercmp(const FTSENT **a, const FTSENT **b)
+#endif
 {
 	int a_info, b_info;
 



CVS commit: othersrc/libexec/tnftpd/ls

2023-11-30 Thread Luke Mewburn
Module Name:othersrc
Committed By:   lukem
Date:   Thu Nov 30 09:42:36 UTC 2023

Modified Files:
othersrc/libexec/tnftpd/ls: ls.c

Log Message:
workaround FreeBSD  changing fts_open()'s compar signature

FreeBSD 5.2 changed fts_open()'s compar function signature by
adding extra const to the pointer arguments, and compilers
may complain about the mismatch.
Add workaround if compiling for FreeBSD and its .


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 othersrc/libexec/tnftpd/ls/ls.c

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



CVS commit: othersrc/libexec/tnftpd

2023-11-24 Thread Luke Mewburn
Module Name:othersrc
Committed By:   lukem
Date:   Sat Nov 25 01:22:53 UTC 2023

Modified Files:
othersrc/libexec/tnftpd: ChangeLog NEWS

Log Message:
Add history of various security advisories to ChangeLog and NEWS.


To generate a diff of this commit:
cvs rdiff -u -r1.68 -r1.69 othersrc/libexec/tnftpd/ChangeLog
cvs rdiff -u -r1.18 -r1.19 othersrc/libexec/tnftpd/NEWS

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/ChangeLog
diff -u othersrc/libexec/tnftpd/ChangeLog:1.68 othersrc/libexec/tnftpd/ChangeLog:1.69
--- othersrc/libexec/tnftpd/ChangeLog:1.68	Sun Oct  1 06:15:30 2023
+++ othersrc/libexec/tnftpd/ChangeLog	Sat Nov 25 01:22:53 2023
@@ -1,10 +1,35 @@
-$NetBSD: ChangeLog,v 1.68 2023/10/01 06:15:30 lukem Exp $
+$NetBSD: ChangeLog,v 1.69 2023/11/25 01:22:53 lukem Exp $
 
 
+Sat Nov 25 01:21:53 UTC 2023	lu...@netbsd.org
+
+	* Add history of various security advisories to ChangeLog and NEWS.
+
 Sun Oct  1 05:57:14 UTC 2023	lu...@netbsd.org
 
 	* Release as "tnftpd 20231001".
 
+	* Security advisories:
+		* CVE-2020-7468: In FreeBSD 12.2-STABLE before r365772,
+		  11.4-STABLE before r365773, 12.1-RELEASE before p10,
+		  11.4-RELEASE before p4 and 11.3-RELEASE before p14 a ftpd(8)
+		  bug in the implementation of the file system sandbox, combined
+		  with capabilities available to an authenticated FTP user, can
+		  be used to escape the file system restriction configured in
+		  ftpchroot(5). Moreover, the bug allows a malicious client to
+		  gain root privileges.
+		* CVE-2023-40303: GNU inetutils through 2.4 may allow
+		  privilege escalation because of unchecked return values of
+		  set*id() family functions in ftpd, rcp, rlogin, rsh, rshd, and
+		  uucpd. This is, for example, relevant if the setuid system
+		  call fails when a process is trying to drop privileges before
+		  letting an ordinary user control the activities of the
+		  process.
+		* CVE-2023-45198: ftpd before "NetBSD-ftpd 20230930" can leak
+		  information about the host filesystem before authentication
+		  via an MLSD or MLST command.
+		* NetBSD-SA2023-007: multiple vulnerabilities in ftpd(8).
+
 	* Always use $YACC even without --enable-maintainer-mode.
 
 	* Update to NetBSD-ftpd 20230930:
@@ -28,7 +53,7 @@ Sat Sep 23 05:39:49 UTC 2023	lukem@NetBS
 		  fatal. Also treat failed set{e,}(u,g}id calls as fatal.
 		  Addresses CVE-2020-7468, via FreeBSD.
 		* Improve seteuid error handling, per suggestion by Simon
-		  Josefsson.
+		  Josefsson and CVE-2023-40303.
 		* Add missing check_login checks for MLST and MLSD.
 
 	* Sync libnetbsd replacements with NetBSD upstream:
@@ -117,6 +142,15 @@ Fri Mar 22 09:00:00 UTC 2013	lukem@NetBS
 
 	* Release as "tnftpd 20130322"
 
+	* Security advisories:
+		* CVE-2011-0418: The glob implementation in Pure-FTPd before
+		  1.0.32, and in libc in NetBSD 5.1, does not properly expand
+		  expressions containing curly brackets, which allows remote
+		  authenticated users to cause a denial of service (memory
+		  consumption) via a crafted FTP STAT command.
+		* NetBSD-SA2010-008: sftp(1)/ftp(1)/glob(3) related resource
+		  exhaustion.
+
 	* Update build framekwork to autoconf 2.69, automake 1.11.1,
 	  libtool 2.4.2.
 
@@ -153,6 +187,16 @@ Wed Dec 30 01:48:57 UTC 2009	lukem@NetBS
 
 	* Release as "tnftpd 20091122"
 
+	* Security advisories:
+		* CVE-2009-0537: Integer overflow in the fts_build function in
+		  fts.c in libc in (1) OpenBSD 4.4 and earlier and (2) Microsoft
+		  Interix 6.0 build 10.0.6030.0 allows context-dependent
+		  attackers to cause a denial of service (application crash) via
+		  a deep directory tree, related to the fts_level structure
+		  member, as demonstrated by (a) du, (b) rm, (c) chmod, and (d)
+		  chgrp on OpenBSD; and (e) SearchIndexer.exe on Vista
+		  Enterprise.
+
 Sat Nov  7 11:13:38 UTC 2009	lu...@netbsd.org
 
 	* Convert to automake & libtool.
@@ -180,7 +224,8 @@ Sun Mar  1 03:10:40 UTC 2009	lukem@NetBS
 		  fts_options.
 		- Avoid possible integer overflow and subsequent collateral
 		  damage.
-		   Received from OpenBSD via US-CERT as VU #590371.
+		  Received from OpenBSD via US-CERT as VU #590371 and
+		  as CVE-2009-0537.
 
 Tue Dec 30 22:36:05 UTC 2008	lu...@netbsd.org
 
@@ -229,6 +274,16 @@ Mon Sep 29 00:56:00 UTC 2008	lukem@NetBS
 
 	* Tagged as "tnftpd-20080929".
 
+	* Security advisories:
+		* CVE-2008-4247: ftpd in OpenBSD 4.3, FreeBSD 7.0, NetBSD 4.0,
+		  Solaris, and possibly other operating systems interprets long
+		  commands from an FTP client as multiple commands, which allows
+		  remote attackers to conduct cross-site request forgery (CSRF)
+		  attacks and execute arbitrary FTP commands via a long ftp://
+		  URI that leverages an existing session from the FTP client
+		  implementation in a web browser.
+		* NetBSD-SA2008-014: Cross-site request forgery in ftpd(8).
+
 	* Updated version to 

CVS commit: othersrc/libexec/tnftpd

2023-11-24 Thread Luke Mewburn
Module Name:othersrc
Committed By:   lukem
Date:   Sat Nov 25 01:22:53 UTC 2023

Modified Files:
othersrc/libexec/tnftpd: ChangeLog NEWS

Log Message:
Add history of various security advisories to ChangeLog and NEWS.


To generate a diff of this commit:
cvs rdiff -u -r1.68 -r1.69 othersrc/libexec/tnftpd/ChangeLog
cvs rdiff -u -r1.18 -r1.19 othersrc/libexec/tnftpd/NEWS

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



CVS commit: othersrc/libexec/tnftpd

2023-10-01 Thread Luke Mewburn
Module Name:othersrc
Committed By:   lukem
Date:   Sun Oct  1 06:15:30 UTC 2023

Modified Files:
othersrc/libexec/tnftpd: ChangeLog NEWS configure configure.ac

Log Message:
tnftpd 20231001 release

Changes since tnftpd 20200704
* Security fixes to improve error handling when switching UID/GID,
  and to prevent MLSD and MLST before authentication succeeds.
* Fix buffer overflows when counting users, and when authenticating
  using PAM.


To generate a diff of this commit:
cvs rdiff -u -r1.67 -r1.68 othersrc/libexec/tnftpd/ChangeLog
cvs rdiff -u -r1.17 -r1.18 othersrc/libexec/tnftpd/NEWS
cvs rdiff -u -r1.56 -r1.57 othersrc/libexec/tnftpd/configure
cvs rdiff -u -r1.55 -r1.56 othersrc/libexec/tnftpd/configure.ac

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



CVS commit: othersrc/libexec/tnftpd

2023-10-01 Thread Luke Mewburn
Module Name:othersrc
Committed By:   lukem
Date:   Sun Oct  1 06:15:30 UTC 2023

Modified Files:
othersrc/libexec/tnftpd: ChangeLog NEWS configure configure.ac

Log Message:
tnftpd 20231001 release

Changes since tnftpd 20200704
* Security fixes to improve error handling when switching UID/GID,
  and to prevent MLSD and MLST before authentication succeeds.
* Fix buffer overflows when counting users, and when authenticating
  using PAM.


To generate a diff of this commit:
cvs rdiff -u -r1.67 -r1.68 othersrc/libexec/tnftpd/ChangeLog
cvs rdiff -u -r1.17 -r1.18 othersrc/libexec/tnftpd/NEWS
cvs rdiff -u -r1.56 -r1.57 othersrc/libexec/tnftpd/configure
cvs rdiff -u -r1.55 -r1.56 othersrc/libexec/tnftpd/configure.ac

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/ChangeLog
diff -u othersrc/libexec/tnftpd/ChangeLog:1.67 othersrc/libexec/tnftpd/ChangeLog:1.68
--- othersrc/libexec/tnftpd/ChangeLog:1.67	Sun Oct  1 03:10:51 2023
+++ othersrc/libexec/tnftpd/ChangeLog	Sun Oct  1 06:15:30 2023
@@ -1,6 +1,9 @@
-$NetBSD: ChangeLog,v 1.67 2023/10/01 03:10:51 lukem Exp $
+$NetBSD: ChangeLog,v 1.68 2023/10/01 06:15:30 lukem Exp $
 
-Sun Oct  1 01:49:23 UTC 2023	lu...@netbsd.org
+
+Sun Oct  1 05:57:14 UTC 2023	lu...@netbsd.org
+
+	* Release as "tnftpd 20231001".
 
 	* Always use $YACC even without --enable-maintainer-mode.
 

Index: othersrc/libexec/tnftpd/NEWS
diff -u othersrc/libexec/tnftpd/NEWS:1.17 othersrc/libexec/tnftpd/NEWS:1.18
--- othersrc/libexec/tnftpd/NEWS:1.17	Sun Oct  1 02:09:12 2023
+++ othersrc/libexec/tnftpd/NEWS	Sun Oct  1 06:15:30 2023
@@ -1,13 +1,13 @@
-$NetBSD: NEWS,v 1.17 2023/10/01 02:09:12 lukem Exp $
+$NetBSD: NEWS,v 1.18 2023/10/01 06:15:30 lukem Exp $
 
-This is tnftpd version 20200704.
+This is tnftpd version 20231001.
 
-Changes in tnftpd from 20200704 to unreleased:
+Changes in tnftpd from 20200704 to 20231001:
 
 	Security fixes to improve error handling when switching UID/GID,
 	and to prevent MLSD and MLST before authentication succeeds.
 
-	Fix buffer overflows when counting users and when authenticating
+	Fix buffer overflows when counting users, and when authenticating
 	using PAM.
 
 Changes in tnftpd from 20190602 to 20200704:

Index: othersrc/libexec/tnftpd/configure
diff -u othersrc/libexec/tnftpd/configure:1.56 othersrc/libexec/tnftpd/configure:1.57
--- othersrc/libexec/tnftpd/configure:1.56	Sun Oct  1 03:11:29 2023
+++ othersrc/libexec/tnftpd/configure	Sun Oct  1 06:15:30 2023
@@ -1,6 +1,6 @@
 #! /bin/sh
 # Guess values for system-dependent variables and create Makefiles.
-# Generated by GNU Autoconf 2.69 for tnftpd 20200704.
+# Generated by GNU Autoconf 2.69 for tnftpd 20231001.
 #
 # Report bugs to .
 #
@@ -595,8 +595,8 @@ MAKEFLAGS=
 # Identity of this package.
 PACKAGE_NAME='tnftpd'
 PACKAGE_TARNAME='tnftpd'
-PACKAGE_VERSION='20200704'
-PACKAGE_STRING='tnftpd 20200704'
+PACKAGE_VERSION='20231001'
+PACKAGE_STRING='tnftpd 20231001'
 PACKAGE_BUGREPORT='lu...@netbsd.org'
 PACKAGE_URL=''
 
@@ -1337,7 +1337,7 @@ if test "$ac_init_help" = "long"; then
   # Omit some internal or obsolete options to make the list less imposing.
   # This message is too long to be a string in the A/UX 3.1 sh.
   cat <<_ACEOF
-\`configure' configures tnftpd 20200704 to adapt to many kinds of systems.
+\`configure' configures tnftpd 20231001 to adapt to many kinds of systems.
 
 Usage: $0 [OPTION]... [VAR=VALUE]...
 
@@ -1407,7 +1407,7 @@ fi
 
 if test -n "$ac_init_help"; then
   case $ac_init_help in
- short | recursive ) echo "Configuration of tnftpd 20200704:";;
+ short | recursive ) echo "Configuration of tnftpd 20231001:";;
esac
   cat <<\_ACEOF
 
@@ -1538,7 +1538,7 @@ fi
 test -n "$ac_init_help" && exit $ac_status
 if $ac_init_version; then
   cat <<\_ACEOF
-tnftpd configure 20200704
+tnftpd configure 20231001
 generated by GNU Autoconf 2.69
 
 Copyright (C) 2012 Free Software Foundation, Inc.
@@ -2123,7 +2123,7 @@ cat >config.log <<_ACEOF
 This file contains any messages produced by compilers while
 running configure, to aid debugging if configure makes a mistake.
 
-It was created by tnftpd $as_me 20200704, which was
+It was created by tnftpd $as_me 20231001, which was
 generated by GNU Autoconf 2.69.  Invocation command line was
 
   $ $0 $@
@@ -4493,7 +4493,7 @@ fi
 
 # Define the identity of the package.
  PACKAGE='tnftpd'
- VERSION='20200704'
+ VERSION='20231001'
 
 
 cat >>confdefs.h <<_ACEOF
@@ -16843,7 +16843,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_wri
 # report actual input values of CONFIG_FILES etc. instead of their
 # values after options handling.
 ac_log="
-This file was extended by tnftpd $as_me 20200704, which was
+This file was extended by tnftpd $as_me 20231001, which was
 generated by GNU Autoconf 2.69.  Invocation command line was
 
   CONFIG_FILES= $CONFIG_FILES
@@ -16909,7 +16909,7 @@ _ACEOF
 cat >>$CONFIG_STATUS <<_ACEOF || 

CVS commit: othersrc/libexec/tnftpd

2023-09-30 Thread Luke Mewburn
Module Name:othersrc
Committed By:   lukem
Date:   Sun Oct  1 05:56:23 UTC 2023

Modified Files:
othersrc/libexec/tnftpd: todo

Log Message:
todo: portability issues, libnetbsd updates


To generate a diff of this commit:
cvs rdiff -u -r1.23 -r1.24 othersrc/libexec/tnftpd/todo

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/todo
diff -u othersrc/libexec/tnftpd/todo:1.23 othersrc/libexec/tnftpd/todo:1.24
--- othersrc/libexec/tnftpd/todo:1.23	Sat Sep 23 04:28:51 2023
+++ othersrc/libexec/tnftpd/todo	Sun Oct  1 05:56:23 2023
@@ -1,16 +1,24 @@
-$NetBSD: todo,v 1.23 2023/09/23 04:28:51 lukem Exp $
+$NetBSD: todo,v 1.24 2023/10/01 05:56:23 lukem Exp $
+
+General todo
+
 
 check for pidfile returning void (old netbsd such as 1.6) ?
 
 fix detection of largefile support:
 	- solaris: lfcompile(5)
 
+macos 13 issues:
+	- daemon() deprecated
+	- vfork() deprecated
+	- getgrouplist() uses int not gid_t
+
 cygwin missing:
 	- SA_NOCLDWAIT
 
 enable LOGIN_CAP (with autoconf portability)
 
-consider updating: ls/* [s-u]*
+consider updating: ls/*
 
 provide replacement for pidfile
 
@@ -33,3 +41,28 @@ autoconf check for FNM_NORES for detecti
 less like to be a problem since it's only parsed from ftpd.conf
 
 tools/compat/configure.ac BROKEN_FPARSELN
+
+
+libnetbsd
+-
+
+getaddrinfo.c
+- very out of date compared to lib/libc/net/getaddrinfo.c
+
+getnameinfo.c
+- very out of date compared to lib/libc/net/getnameinfo.c
+
+getusershell.c
+- check NetBSD: getusershell.c,v 1.21 2000/07/07 08:03:37 itohy Exp
+
+mkstemp.c:
+- upstream implementation changed to lib/libc/stdio/gettemp.c
+
+snprintf.c:
+- tools/compat/snprintf.c looks different
+
+strtoll.c:
+- upstream changed to common/lib/libc/stdlib/_strtol.h
+
+user_from_uid.c:
+- I enhanced upstream with pwcache_userdb() which tnftpd doesn't need



CVS commit: othersrc/libexec/tnftpd

2023-09-30 Thread Luke Mewburn
Module Name:othersrc
Committed By:   lukem
Date:   Sun Oct  1 05:56:23 UTC 2023

Modified Files:
othersrc/libexec/tnftpd: todo

Log Message:
todo: portability issues, libnetbsd updates


To generate a diff of this commit:
cvs rdiff -u -r1.23 -r1.24 othersrc/libexec/tnftpd/todo

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



CVS commit: othersrc/libexec/tnftpd

2023-09-30 Thread Luke Mewburn
Module Name:othersrc
Committed By:   lukem
Date:   Sun Oct  1 03:11:30 UTC 2023

Modified Files:
othersrc/libexec/tnftpd: configure
othersrc/libexec/tnftpd/src: Makefile.in

Log Message:
regen


To generate a diff of this commit:
cvs rdiff -u -r1.55 -r1.56 othersrc/libexec/tnftpd/configure
cvs rdiff -u -r1.17 -r1.18 othersrc/libexec/tnftpd/src/Makefile.in

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/configure
diff -u othersrc/libexec/tnftpd/configure:1.55 othersrc/libexec/tnftpd/configure:1.56
--- othersrc/libexec/tnftpd/configure:1.55	Sat Sep 30 08:29:13 2023
+++ othersrc/libexec/tnftpd/configure	Sun Oct  1 03:11:29 2023
@@ -18618,6 +18618,10 @@ $as_echo "$as_me: CPPFLAGS  
 $as_echo "$as_me: LDFLAGS$LDFLAGS" >&6;}
 { $as_echo "$as_me:${as_lineno-$LINENO}: LIBS   $LIBS" >&5
 $as_echo "$as_me: LIBS   $LIBS" >&6;}
+{ $as_echo "$as_me:${as_lineno-$LINENO}: YACC   $YACC" >&5
+$as_echo "$as_me: YACC   $YACC" >&6;}
+{ $as_echo "$as_me:${as_lineno-$LINENO}: YFLAGS $YFLAGS" >&5
+$as_echo "$as_me: YFLAGS $YFLAGS" >&6;}
 { $as_echo "$as_me:${as_lineno-$LINENO}: --enable-builtinls $opt_builtinls" >&5
 $as_echo "$as_me: --enable-builtinls $opt_builtinls" >&6;}
 { $as_echo "$as_me:${as_lineno-$LINENO}: --enable-ipv6  $opt_ipv6" >&5

Index: othersrc/libexec/tnftpd/src/Makefile.in
diff -u othersrc/libexec/tnftpd/src/Makefile.in:1.17 othersrc/libexec/tnftpd/src/Makefile.in:1.18
--- othersrc/libexec/tnftpd/src/Makefile.in:1.17	Sat Sep 23 03:32:41 2023
+++ othersrc/libexec/tnftpd/src/Makefile.in	Sun Oct  1 03:11:30 2023
@@ -110,8 +110,9 @@ am__installdirs = "$(DESTDIR)$(libexecdi
 	"$(DESTDIR)$(man8dir)"
 PROGRAMS = $(libexec_PROGRAMS)
 am_tnftpd_OBJECTS = cmds.$(OBJEXT) conf.$(OBJEXT) ftpd.$(OBJEXT) \
-	ftpcmd.$(OBJEXT) pfilter.$(OBJEXT) popen.$(OBJEXT)
-tnftpd_OBJECTS = $(am_tnftpd_OBJECTS)
+	pfilter.$(OBJEXT) popen.$(OBJEXT)
+nodist_tnftpd_OBJECTS = ftpcmd.$(OBJEXT)
+tnftpd_OBJECTS = $(am_tnftpd_OBJECTS) $(nodist_tnftpd_OBJECTS)
 tnftpd_DEPENDENCIES = ../libnetbsd/libnetbsd.la ../ls/libls.la
 AM_V_lt = $(am__v_lt_@AM_V@)
 am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@)
@@ -154,18 +155,7 @@ AM_V_CCLD = $(am__v_CCLD_@AM_V@)
 am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@)
 am__v_CCLD_0 = @echo "  CCLD" $@;
 am__v_CCLD_1 = 
-@MAINTAINER_MODE_FALSE@am__skipyacc = test -f $@ ||
-am__yacc_c2h = sed -e s/cc$$/hh/ -e s/cpp$$/hpp/ -e s/cxx$$/hxx/ \
-		   -e s/c++$$/h++/ -e s/c$$/h/
-YACCCOMPILE = $(YACC) $(AM_YFLAGS) $(YFLAGS)
-LTYACCCOMPILE = $(LIBTOOL) $(AM_V_lt) $(AM_LIBTOOLFLAGS) \
-	$(LIBTOOLFLAGS) --mode=compile $(YACC) $(AM_YFLAGS) $(YFLAGS)
-AM_V_YACC = $(am__v_YACC_@AM_V@)
-am__v_YACC_ = $(am__v_YACC_@AM_DEFAULT_V@)
-am__v_YACC_0 = @echo "  YACC" $@;
-am__v_YACC_1 = 
-YLWRAP = $(top_srcdir)/buildaux/ylwrap
-SOURCES = $(tnftpd_SOURCES)
+SOURCES = $(tnftpd_SOURCES) $(nodist_tnftpd_SOURCES)
 DIST_SOURCES = $(tnftpd_SOURCES)
 am__can_run_installinfo = \
   case $$AM_UPDATE_INFO_DIR in \
@@ -223,8 +213,7 @@ am__define_uniq_tagged_files = \
   done | $(am__uniquify_input)`
 ETAGS = etags
 CTAGS = ctags
-am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/buildaux/depcomp \
-	$(top_srcdir)/buildaux/ylwrap ftpcmd.c
+am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/buildaux/depcomp
 DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
 ACLOCAL = @ACLOCAL@
 AMTAR = @AMTAR@
@@ -349,7 +338,6 @@ tnftpd_SOURCES = \
 	cmds.c \
 	conf.c \
 	ftpd.c \
-	ftpcmd.y \
 	pfilter.c \
 	popen.c
 
@@ -378,27 +366,32 @@ man5_MANS = \
 man8_MANS = \
 	tnftpd.man
 
-CLEANFILES = \
-	ftpcmd.c \
-	ftpd.conf.man \
-	ftpusers.man \
-	tnftpd.man
-
+CLEANFILES = ftpd.conf.man ftpusers.man tnftpd.man ftpcmd.c
 seddotin = \
 	sed -e 's|@datadir[@]|${datadir}|g' \
 	-e 's|@sysconfdir[@]|${sysconfdir}|g'
 
-EXTRA_DIST = \
-	ftpd.conf.manin \
-	ftpusers.manin \
-	logutmp.c \
-	logwtmp.c \
-	tnftpd.manin
+EXTRA_DIST = ftpd.conf.manin ftpusers.manin logutmp.c logwtmp.c \
+	tnftpd.manin ftpcmd.y
 
-all: all-am
+# Custom yacc rules to always yacc ftpcmd.y,
+# even without --enable-maintainer-mode.
+nodist_tnftpd_SOURCES = \
+	ftpcmd.c
+
+BUILT_SOURCES = \
+	ftpcmd.c
+
+AUTOMAKE_OPTIONS = -Wno-portability-recursive
+TNFTPD_V_YACC = $(TNFTPD__V_YACC_$(V))
+TNFTPD__V_YACC_ = $(TNFTPD__V_YACC_$(AM_DEFAULT_VERBOSITY))
+TNFTPD__V_YACC_0 = @echo "  YACC" $@;
+TNFTPD__V_YACC_1 = 
+all: $(BUILT_SOURCES)
+	$(MAKE) $(AM_MAKEFLAGS) all-am
 
 .SUFFIXES:
-.SUFFIXES: .c .lo .man .manin .o .obj .y
+.SUFFIXES: .c .lo .man .manin .o .obj
 $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am  $(am__configure_deps)
 	@for dep in $?; do \
 	  case '$(am__configure_deps)' in \
@@ -522,9 +515,6 @@ am--depfiles: $(am__depfiles_remade)
 

CVS commit: othersrc/libexec/tnftpd

2023-09-30 Thread Luke Mewburn
Module Name:othersrc
Committed By:   lukem
Date:   Sun Oct  1 03:11:30 UTC 2023

Modified Files:
othersrc/libexec/tnftpd: configure
othersrc/libexec/tnftpd/src: Makefile.in

Log Message:
regen


To generate a diff of this commit:
cvs rdiff -u -r1.55 -r1.56 othersrc/libexec/tnftpd/configure
cvs rdiff -u -r1.17 -r1.18 othersrc/libexec/tnftpd/src/Makefile.in

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



CVS commit: othersrc/libexec/tnftpd

2023-09-30 Thread Luke Mewburn
Module Name:othersrc
Committed By:   lukem
Date:   Sun Oct  1 03:10:51 UTC 2023

Modified Files:
othersrc/libexec/tnftpd: ChangeLog configure.ac
othersrc/libexec/tnftpd/src: Makefile.am

Log Message:
always use $YACC even without --enable-maintainer-mode

Provide custom rules to create ftpcmd.c from $(YACC) ftpcmd.y,
instead of relying upon automake's default rules, so that
we always use $(YACC) even without --enable-maintainer-mode,
and we ship ftpcmd.y not ftpcmd.c.

(There should be an easier way in automake to do this.)

Display YACC and YFLAGS at end of configure.


To generate a diff of this commit:
cvs rdiff -u -r1.66 -r1.67 othersrc/libexec/tnftpd/ChangeLog
cvs rdiff -u -r1.54 -r1.55 othersrc/libexec/tnftpd/configure.ac
cvs rdiff -u -r1.5 -r1.6 othersrc/libexec/tnftpd/src/Makefile.am

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/ChangeLog
diff -u othersrc/libexec/tnftpd/ChangeLog:1.66 othersrc/libexec/tnftpd/ChangeLog:1.67
--- othersrc/libexec/tnftpd/ChangeLog:1.66	Sun Oct  1 02:09:12 2023
+++ othersrc/libexec/tnftpd/ChangeLog	Sun Oct  1 03:10:51 2023
@@ -1,7 +1,9 @@
-$NetBSD: ChangeLog,v 1.66 2023/10/01 02:09:12 lukem Exp $
+$NetBSD: ChangeLog,v 1.67 2023/10/01 03:10:51 lukem Exp $
 
 Sun Oct  1 01:49:23 UTC 2023	lu...@netbsd.org
 
+	* Always use $YACC even without --enable-maintainer-mode.
+
 	* Update to NetBSD-ftpd 20230930:
 		* Fix uninitialized memory usage in count_users().
 		* Fix pam_set_item() call with proper struct passed as

Index: othersrc/libexec/tnftpd/configure.ac
diff -u othersrc/libexec/tnftpd/configure.ac:1.54 othersrc/libexec/tnftpd/configure.ac:1.55
--- othersrc/libexec/tnftpd/configure.ac:1.54	Sun Sep 24 04:54:13 2023
+++ othersrc/libexec/tnftpd/configure.ac	Sun Oct  1 03:10:51 2023
@@ -1,4 +1,4 @@
-# $NetBSD: configure.ac,v 1.54 2023/09/24 04:54:13 lukem Exp $
+# $NetBSD: configure.ac,v 1.55 2023/10/01 03:10:51 lukem Exp $
 #
 # Process this file with autoconf to produce a configure script.
 
@@ -536,6 +536,8 @@ AC_MSG_NOTICE([CFLAGS $C
 AC_MSG_NOTICE([CPPFLAGS   $CPPFLAGS])
 AC_MSG_NOTICE([LDFLAGS$LDFLAGS])
 AC_MSG_NOTICE([LIBS   $LIBS])
+AC_MSG_NOTICE([YACC   $YACC])
+AC_MSG_NOTICE([YFLAGS $YFLAGS])
 AC_MSG_NOTICE([--enable-builtinls $opt_builtinls])
 AC_MSG_NOTICE([--enable-ipv6  $opt_ipv6])
 AC_MSG_NOTICE([--with-blocklist   $with_blocklist])

Index: othersrc/libexec/tnftpd/src/Makefile.am
diff -u othersrc/libexec/tnftpd/src/Makefile.am:1.5 othersrc/libexec/tnftpd/src/Makefile.am:1.6
--- othersrc/libexec/tnftpd/src/Makefile.am:1.5	Tue Jan 29 12:51:38 2019
+++ othersrc/libexec/tnftpd/src/Makefile.am	Sun Oct  1 03:10:51 2023
@@ -1,4 +1,4 @@
-## $NetBSD: Makefile.am,v 1.5 2019/01/29 12:51:38 lukem Exp $
+## $NetBSD: Makefile.am,v 1.6 2023/10/01 03:10:51 lukem Exp $
 
 libexec_PROGRAMS = tnftpd
 
@@ -6,7 +6,6 @@ tnftpd_SOURCES = \
 	cmds.c \
 	conf.c \
 	ftpd.c \
-	ftpcmd.y \
 	pfilter.c \
 	popen.c
 
@@ -36,7 +35,6 @@ man8_MANS = \
 	tnftpd.man
 
 CLEANFILES = \
-	ftpcmd.c \
 	ftpd.conf.man \
 	ftpusers.man \
 	tnftpd.man
@@ -46,7 +44,7 @@ seddotin = \
 	-e 's|@sysconfdir[@]|${sysconfdir}|g'
 
 .manin.man:
-	${seddotin} $< > $@
+	$(seddotin) $< > $@
 
 EXTRA_DIST = \
 	ftpd.conf.manin \
@@ -54,3 +52,29 @@ EXTRA_DIST = \
 	logutmp.c \
 	logwtmp.c \
 	tnftpd.manin
+
+
+# Custom yacc rules to always yacc ftpcmd.y,
+# even without --enable-maintainer-mode.
+
+nodist_tnftpd_SOURCES = \
+	ftpcmd.c
+
+BUILT_SOURCES = \
+	ftpcmd.c
+
+CLEANFILES += \
+	ftpcmd.c
+
+EXTRA_DIST += \
+	ftpcmd.y
+
+AUTOMAKE_OPTIONS = -Wno-portability-recursive
+
+TNFTPD_V_YACC = $(TNFTPD__V_YACC_$(V))
+TNFTPD__V_YACC_ = $(TNFTPD__V_YACC_$(AM_DEFAULT_VERBOSITY))
+TNFTPD__V_YACC_0 = @echo "  YACC" $@;
+TNFTPD__V_YACC_1 =
+
+ftpcmd.c: $(srcdir)/ftpcmd.y
+	$(TNFTPD_V_YACC)$(YACC) $(YFLAGS) -o $@ $?



CVS commit: othersrc/libexec/tnftpd

2023-09-30 Thread Luke Mewburn
Module Name:othersrc
Committed By:   lukem
Date:   Sun Oct  1 03:10:51 UTC 2023

Modified Files:
othersrc/libexec/tnftpd: ChangeLog configure.ac
othersrc/libexec/tnftpd/src: Makefile.am

Log Message:
always use $YACC even without --enable-maintainer-mode

Provide custom rules to create ftpcmd.c from $(YACC) ftpcmd.y,
instead of relying upon automake's default rules, so that
we always use $(YACC) even without --enable-maintainer-mode,
and we ship ftpcmd.y not ftpcmd.c.

(There should be an easier way in automake to do this.)

Display YACC and YFLAGS at end of configure.


To generate a diff of this commit:
cvs rdiff -u -r1.66 -r1.67 othersrc/libexec/tnftpd/ChangeLog
cvs rdiff -u -r1.54 -r1.55 othersrc/libexec/tnftpd/configure.ac
cvs rdiff -u -r1.5 -r1.6 othersrc/libexec/tnftpd/src/Makefile.am

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



CVS commit: othersrc/libexec/tnftpd

2023-09-30 Thread Luke Mewburn
Module Name:othersrc
Committed By:   lukem
Date:   Sun Oct  1 02:09:12 UTC 2023

Modified Files:
othersrc/libexec/tnftpd: ChangeLog NEWS THANKS

Log Message:
docs for NetBSD-20230930 import


To generate a diff of this commit:
cvs rdiff -u -r1.65 -r1.66 othersrc/libexec/tnftpd/ChangeLog
cvs rdiff -u -r1.16 -r1.17 othersrc/libexec/tnftpd/NEWS
cvs rdiff -u -r1.5 -r1.6 othersrc/libexec/tnftpd/THANKS

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/ChangeLog
diff -u othersrc/libexec/tnftpd/ChangeLog:1.65 othersrc/libexec/tnftpd/ChangeLog:1.66
--- othersrc/libexec/tnftpd/ChangeLog:1.65	Sun Sep 24 01:23:17 2023
+++ othersrc/libexec/tnftpd/ChangeLog	Sun Oct  1 02:09:12 2023
@@ -1,4 +1,16 @@
-$NetBSD: ChangeLog,v 1.65 2023/09/24 01:23:17 lukem Exp $
+$NetBSD: ChangeLog,v 1.66 2023/10/01 02:09:12 lukem Exp $
+
+Sun Oct  1 01:49:23 UTC 2023	lu...@netbsd.org
+
+	* Update to NetBSD-ftpd 20230930:
+		* Fix uninitialized memory usage in count_users().
+		* Fix pam_set_item() call with proper struct passed as
+		  PAM_SOCKADDR.
+
+	* Build fixes:
+		* Check for inet_net_pton() in -lresolv (for glibc).
+		* Improve configure's display of make variables.
+		* Remove deprecated autoconf macros.
 
 Sat Sep 23 05:39:49 UTC 2023	lu...@netbsd.org
 

Index: othersrc/libexec/tnftpd/NEWS
diff -u othersrc/libexec/tnftpd/NEWS:1.16 othersrc/libexec/tnftpd/NEWS:1.17
--- othersrc/libexec/tnftpd/NEWS:1.16	Sun Sep 24 01:23:17 2023
+++ othersrc/libexec/tnftpd/NEWS	Sun Oct  1 02:09:12 2023
@@ -1,4 +1,4 @@
-$NetBSD: NEWS,v 1.16 2023/09/24 01:23:17 lukem Exp $
+$NetBSD: NEWS,v 1.17 2023/10/01 02:09:12 lukem Exp $
 
 This is tnftpd version 20200704.
 
@@ -7,6 +7,9 @@ Changes in tnftpd from 20200704 to unrel
 	Security fixes to improve error handling when switching UID/GID,
 	and to prevent MLSD and MLST before authentication succeeds.
 
+	Fix buffer overflows when counting users and when authenticating
+	using PAM.
+
 Changes in tnftpd from 20190602 to 20200704:
 
 	Adapt to NetBSD blocklistd(8) service rename.

Index: othersrc/libexec/tnftpd/THANKS
diff -u othersrc/libexec/tnftpd/THANKS:1.5 othersrc/libexec/tnftpd/THANKS:1.6
--- othersrc/libexec/tnftpd/THANKS:1.5	Thu Mar 21 07:44:03 2013
+++ othersrc/libexec/tnftpd/THANKS	Sun Oct  1 02:09:12 2023
@@ -9,6 +9,7 @@ Johnny Billquist
 Jun-ichiro itojun Hagino
 Luke Mewburn
 Maksymilian Arciemowicz
+Mateusz Kocielski
 Matthew R. Green
 Moritz Jodeit
 Paul Janzen



CVS commit: othersrc/libexec/tnftpd

2023-09-30 Thread Luke Mewburn
Module Name:othersrc
Committed By:   lukem
Date:   Sun Oct  1 02:09:12 UTC 2023

Modified Files:
othersrc/libexec/tnftpd: ChangeLog NEWS THANKS

Log Message:
docs for NetBSD-20230930 import


To generate a diff of this commit:
cvs rdiff -u -r1.65 -r1.66 othersrc/libexec/tnftpd/ChangeLog
cvs rdiff -u -r1.16 -r1.17 othersrc/libexec/tnftpd/NEWS
cvs rdiff -u -r1.5 -r1.6 othersrc/libexec/tnftpd/THANKS

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



CVS commit: othersrc/libexec/tnftpd/src

2023-09-30 Thread Luke Mewburn
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 
 #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 
@@ -916,7 +916,7 @@ count_users(void)
 		goto cleanup_count;
 	if (fstat(fd, ) == -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 = { _conv, _cred };
+	struct sockaddr_storage ss;
 
 	e = pam_start("ftpd", curname, , );
 	if (e != PAM_SUCCESS) {
@@ -4081,7 +4082,9 @@ auth_pam(void)
 	}
 
 #if defined(PAM_SOCKADDR)
-	e = pam_set_item(pamh, PAM_SOCKADDR, _addr);
+	memset(, 0, sizeof(ss));
+	memcpy(, _addr.si_su, his_addr.su_len);
+	e = pam_set_item(pamh, PAM_SOCKADDR, );
 	if (e != PAM_SUCCESS) {
 		syslog(LOG_ERR, "pam_set_item(PAM_SOCKADDR): %s",
 			pam_strerror(pamh, e));



CVS commit: othersrc/libexec/tnftpd/src

2023-09-30 Thread Luke Mewburn
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.



CVS commit: othersrc/libexec/tnftpd

2023-09-30 Thread Luke Mewburn
Module Name:othersrc
Committed By:   lukem
Date:   Sat Sep 30 08:29:13 UTC 2023

Modified Files:
othersrc/libexec/tnftpd: configure tnftpd_config.h.in

Log Message:
regen


To generate a diff of this commit:
cvs rdiff -u -r1.54 -r1.55 othersrc/libexec/tnftpd/configure
cvs rdiff -u -r1.8 -r1.9 othersrc/libexec/tnftpd/tnftpd_config.h.in

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/configure
diff -u othersrc/libexec/tnftpd/configure:1.54 othersrc/libexec/tnftpd/configure:1.55
--- othersrc/libexec/tnftpd/configure:1.54	Sat Sep 23 04:50:41 2023
+++ othersrc/libexec/tnftpd/configure	Sat Sep 30 08:29:13 2023
@@ -13431,123 +13431,128 @@ rm -f core conftest.err conftest.$ac_obj
 esac
 
 #
-# Checks for libraries.
+# Checks for header files.
 #
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing crypt" >&5
-$as_echo_n "checking for library containing crypt... " >&6; }
-if ${ac_cv_search_crypt+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  ac_func_search_save_LIBS=$LIBS
-cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-
-/* Override any GCC internal prototype to avoid an error.
-   Use char because int might match the return type of a GCC
-   builtin and then its argument prototype would still apply.  */
-#ifdef __cplusplus
-extern "C"
+accheck_includes='
+#include 
+#if defined(HAVE_SYS_TYPES_H)
+# include 
 #endif
-char crypt ();
-int
-main ()
-{
-return crypt ();
-  ;
-  return 0;
-}
+#if defined(HAVE_SYS_STAT_H)
+# include 
+#endif
+#if defined(STDC_HEADERS)
+# include 
+# include 
+# include 
+#endif
+#if defined(HAVE_PWD_H)
+# include 
+#endif
+#if defined(HAVE_FNMATCH_H)
+# include 
+#endif
+#if defined(HAVE_UNISTD_H)
+# include 
+#endif
+#if defined(HAVE_POLL_H)
+# include 
+#elif defined(HAVE_SYS_POLL_H)
+# include 
+#endif
+#if defined(HAVE_SYS_SOCKET_H)
+# include 
+#endif
+#if defined(HAVE_NETINET_IN_H)
+# include 
+#endif
+#if defined(HAVE_NETINET_IN_SYSTM_H)
+# include 
+#endif
+#if defined(HAVE_NETDB_H)
+# include 
+#endif
+#if defined(HAVE_ARPA_INET_H)
+# include 
+#endif
+#if defined(HAVE_DIRENT_H)
+# include 
+#else
+# define dirent direct
+# if defined(HAVE_SYS_NDIR_H)
+#  include 
+# endif
+# if defined(HAVE_SYS_DIR_H)
+#  include 
+# endif
+# if defined(HAVE_NDIR_H)
+#  include 
+# endif
+#endif
+' # accheck_includes
+
+for ac_header in sys/types.h sys/ioctl.h sys/mman.h sys/param.h \
+  sys/stat.h sys/socket.h sys/syslimits.h \
+  sys/sysmacros.h sys/time.h sys/wait.h
+do :
+  as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
+ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "$accheck_includes
+"
+if eval test \"x\$"$as_ac_Header"\" = x"yes"; then :
+  cat >>confdefs.h <<_ACEOF
+#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
 _ACEOF
-for ac_lib in '' crypt; do
-  if test -z "$ac_lib"; then
-ac_res="none required"
-  else
-ac_res=-l$ac_lib
-LIBS="-l$ac_lib  $ac_func_search_save_LIBS"
-  fi
-  if ac_fn_c_try_link "$LINENO"; then :
-  ac_cv_search_crypt=$ac_res
-fi
-rm -f core conftest.err conftest.$ac_objext \
-conftest$ac_exeext
-  if ${ac_cv_search_crypt+:} false; then :
-  break
-fi
-done
-if ${ac_cv_search_crypt+:} false; then :
 
-else
-  ac_cv_search_crypt=no
 fi
-rm conftest.$ac_ext
-LIBS=$ac_func_search_save_LIBS
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_crypt" >&5
-$as_echo "$ac_cv_search_crypt" >&6; }
-ac_res=$ac_cv_search_crypt
-if test "$ac_res" != no; then :
-  test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
 
-fi
+done
 
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing pidfile" >&5
-$as_echo_n "checking for library containing pidfile... " >&6; }
-if ${ac_cv_search_pidfile+:} false; then :
+ac_header_dirent=no
+for ac_hdr in dirent.h sys/ndir.h sys/dir.h ndir.h; do
+  as_ac_Header=`$as_echo "ac_cv_header_dirent_$ac_hdr" | $as_tr_sh`
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_hdr that defines DIR" >&5
+$as_echo_n "checking for $ac_hdr that defines DIR... " >&6; }
+if eval \${$as_ac_Header+:} false; then :
   $as_echo_n "(cached) " >&6
 else
-  ac_func_search_save_LIBS=$LIBS
-cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
+#include 
+#include <$ac_hdr>
 
-/* Override any GCC internal prototype to avoid an error.
-   Use char because int might match the return type of a GCC
-   builtin and then its argument prototype would still apply.  */
-#ifdef __cplusplus
-extern "C"
-#endif
-char pidfile ();
 int
 main ()
 {
-return pidfile ();
+if ((DIR *) 0)
+return 0;
   ;
   return 0;
 }
 _ACEOF
-for ac_lib in '' util; do
-  if test -z "$ac_lib"; then
-ac_res="none required"
-  else
-ac_res=-l$ac_lib
-LIBS="-l$ac_lib  $ac_func_search_save_LIBS"
-  fi
-  if ac_fn_c_try_link 

CVS commit: othersrc/libexec/tnftpd

2023-09-30 Thread Luke Mewburn
Module Name:othersrc
Committed By:   lukem
Date:   Sat Sep 30 08:29:13 UTC 2023

Modified Files:
othersrc/libexec/tnftpd: configure tnftpd_config.h.in

Log Message:
regen


To generate a diff of this commit:
cvs rdiff -u -r1.54 -r1.55 othersrc/libexec/tnftpd/configure
cvs rdiff -u -r1.8 -r1.9 othersrc/libexec/tnftpd/tnftpd_config.h.in

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



CVS commit: othersrc/libexec/tnftpd

2023-09-23 Thread Luke Mewburn
Module Name:othersrc
Committed By:   lukem
Date:   Sun Sep 24 04:54:13 UTC 2023

Modified Files:
othersrc/libexec/tnftpd: configure.ac tnftpd.h

Log Message:
configure: remove obsolete macros

Remove macros marked obsolescent in autoconf 2.69 and
warned as obsolete in autoconf 2.71:
 AC_HEADER_STDC()
 AC_HEADER_TIME()
 AC_TYPE_SIGNAL()


To generate a diff of this commit:
cvs rdiff -u -r1.53 -r1.54 othersrc/libexec/tnftpd/configure.ac
cvs rdiff -u -r1.41 -r1.42 othersrc/libexec/tnftpd/tnftpd.h

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



CVS commit: othersrc/libexec/tnftpd

2023-09-23 Thread Luke Mewburn
Module Name:othersrc
Committed By:   lukem
Date:   Sun Sep 24 04:54:13 UTC 2023

Modified Files:
othersrc/libexec/tnftpd: configure.ac tnftpd.h

Log Message:
configure: remove obsolete macros

Remove macros marked obsolescent in autoconf 2.69 and
warned as obsolete in autoconf 2.71:
 AC_HEADER_STDC()
 AC_HEADER_TIME()
 AC_TYPE_SIGNAL()


To generate a diff of this commit:
cvs rdiff -u -r1.53 -r1.54 othersrc/libexec/tnftpd/configure.ac
cvs rdiff -u -r1.41 -r1.42 othersrc/libexec/tnftpd/tnftpd.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/configure.ac
diff -u othersrc/libexec/tnftpd/configure.ac:1.53 othersrc/libexec/tnftpd/configure.ac:1.54
--- othersrc/libexec/tnftpd/configure.ac:1.53	Sun Sep 24 02:07:11 2023
+++ othersrc/libexec/tnftpd/configure.ac	Sun Sep 24 04:54:13 2023
@@ -1,4 +1,4 @@
-# $NetBSD: configure.ac,v 1.53 2023/09/24 02:07:11 lukem Exp $
+# $NetBSD: configure.ac,v 1.54 2023/09/24 04:54:13 lukem Exp $
 #
 # Process this file with autoconf to produce a configure script.
 
@@ -206,8 +206,6 @@ AC_CHECK_HEADERS([sys/types.h sys/ioctl.
 AC_HEADER_DIRENT()
 AC_HEADER_RESOLV()
 AC_HEADER_STAT()
-AC_HEADER_STDC()
-AC_HEADER_TIME()
 AC_HEADER_TIOCGWINSZ()
 AC_CHECK_HEADERS([sys/resource.h \
   arpa/inet.h arpa/nameser.h arpa/telnet.h err.h \
@@ -249,7 +247,6 @@ AC_TYPE_LONG_LONG_INT()
 AC_TYPE_UINT32_T()
 AC_TYPE_OFF_T()
 AC_TYPE_PID_T()
-AC_TYPE_SIGNAL()
 AC_TYPE_SIZE_T()
 AC_STRUCT_TM()
 AC_CHECK_MEMBERS([struct sockaddr.sa_len, struct sockaddr_in.sin_len,

Index: othersrc/libexec/tnftpd/tnftpd.h
diff -u othersrc/libexec/tnftpd/tnftpd.h:1.41 othersrc/libexec/tnftpd/tnftpd.h:1.42
--- othersrc/libexec/tnftpd/tnftpd.h:1.41	Sat Sep 23 04:45:03 2023
+++ othersrc/libexec/tnftpd/tnftpd.h	Sun Sep 24 04:54:13 2023
@@ -1,4 +1,4 @@
-/* $NetBSD: tnftpd.h,v 1.41 2023/09/23 04:45:03 lukem Exp $ */
+/* $NetBSD: tnftpd.h,v 1.42 2023/09/24 04:54:13 lukem Exp $ */
 
 #define	FTPD_VERSION	PACKAGE_STRING
 
@@ -11,11 +11,9 @@
 #if defined(HAVE_SYS_TYPES_H)
 # include 
 #endif
-#if defined(STDC_HEADERS)
-# include 
-# include 
-# include 
-#endif
+#include 
+#include 
+#include 
 #if defined(HAVE_UNISTD_H)
 # include 
 #endif
@@ -154,16 +152,10 @@ struct pollfd {
 };
 #endif
 
-#if defined(TIME_WITH_SYS_TIME)
+#if defined(HAVE_SYS_TIME_H)
 # include 
-# include 
-#else
-# if defined(HAVE_SYS_TIME_H)
-#  include 
-# else
-#  include 
-# endif
 #endif
+#include 
 
 #if defined(HAVE_SYS_RESOURCE_H)
 # include 



CVS commit: othersrc/libexec/tnftpd

2023-09-23 Thread Luke Mewburn
Module Name:othersrc
Committed By:   lukem
Date:   Sun Sep 24 02:07:12 UTC 2023

Modified Files:
othersrc/libexec/tnftpd: configure.ac

Log Message:
configure: improve check for inet_net_pton()

Look for inet_net_pton() in -lresolv (for glibc).
Move library checks after header checks, in case latter are needed for former.
Display vars at end of configure: CC, CFLAGS, CPPFLAGS, LDFLAGS, LIBS


To generate a diff of this commit:
cvs rdiff -u -r1.52 -r1.53 othersrc/libexec/tnftpd/configure.ac

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/configure.ac
diff -u othersrc/libexec/tnftpd/configure.ac:1.52 othersrc/libexec/tnftpd/configure.ac:1.53
--- othersrc/libexec/tnftpd/configure.ac:1.52	Sat Sep 23 04:45:03 2023
+++ othersrc/libexec/tnftpd/configure.ac	Sun Sep 24 02:07:11 2023
@@ -1,4 +1,4 @@
-# $NetBSD: configure.ac,v 1.52 2023/09/23 04:45:03 lukem Exp $
+# $NetBSD: configure.ac,v 1.53 2023/09/24 02:07:11 lukem Exp $
 #
 # Process this file with autoconf to produce a configure script.
 
@@ -139,23 +139,6 @@ AS_CASE([$target_os],
 )
 
 #
-# Checks for libraries.
-#
-AC_SEARCH_LIBS([crypt], [crypt])
-AC_SEARCH_LIBS([pidfile], [util])
-AC_SEARCH_LIBS([setproctitle], [util])
-
-AC_SEARCH_LIBS([gethostbyname], [nsl])
-AC_SEARCH_LIBS([socket],
-   [socket],
-   [],
-   [AC_CHECK_LIB([socket],
- [socket],
- [LIBS="-lsocket -lnsl $LIBS"],
- [],
- [-lnsl])])
-
-#
 # Checks for header files.
 #
 accheck_includes='
@@ -236,6 +219,26 @@ AC_CHECK_HEADERS([sys/resource.h \
   [], [], [$accheck_includes])
 
 #
+# Checks for libraries with specific functions.
+#
+AC_SEARCH_LIBS([crypt], [crypt])
+AC_SEARCH_LIBS([pidfile], [util])
+AC_SEARCH_LIBS([setproctitle], [util])
+
+AC_SEARCH_LIBS([gethostbyname], [nsl])
+AC_SEARCH_LIBS([socket],
+   [socket],
+   [],
+   [AC_CHECK_LIB([socket],
+ [socket],
+ [LIBS="-lsocket -lnsl $LIBS"],
+ [],
+ [-lnsl])])
+
+AC_SEARCH_LIBS([inet_net_pton], [resolv], [], [AC_LIBOBJ([inet_net_pton])])
+AC_CHECK_FUNCS([inet_net_pton])
+
+#
 # Checks for typedefs, structures, and compiler characteristics.
 #
 AC_CHECK_DECLS([AI_NUMERICHOST, FNM_CASEFOLD,
@@ -286,7 +289,7 @@ AC_FUNC_FSEEKO()
 AC_FUNC_STRCOLL()
 AC_REPLACE_FUNCS([daemon err explicit_memset fgetln fparseln \
   getaddrinfo getgrouplist getnameinfo getusershell \
-  inet_net_pton inet_ntop inet_pton mkstemp \
+  inet_ntop inet_pton mkstemp \
   setprogname sl_init snprintf strdup strerror strsuftollx \
   strlcat strlcpy strsep usleep])
 AC_CHECK_FUNCS([dirfd getcwd gethostbyaddr gethostbyname gethostbyname2 \
@@ -294,6 +297,7 @@ AC_CHECK_FUNCS([dirfd getcwd gethostbyad
 isascii madvise memmove memset mmap pidfile realpath \
 select setlogin setproctitle setegid seteuid \
 setresgid setresuid strcasecmp strtol strtoul vfork])
+
 AS_IF([test "$ac_cv_func_dirfd" = no],
   [AC_MSG_CHECKING([whether dirfd() is a macro])
AC_EGREP_CPP([have_dirfd_as_macro], [
@@ -530,6 +534,11 @@ AC_OUTPUT()
 AC_MSG_NOTICE([ === Configuration results ===])
 AC_MSG_NOTICE([Package:   $PACKAGE_STRING])
 AC_MSG_NOTICE([Prefix:$prefix])
+AC_MSG_NOTICE([CC $CC])
+AC_MSG_NOTICE([CFLAGS $CFLAGS])
+AC_MSG_NOTICE([CPPFLAGS   $CPPFLAGS])
+AC_MSG_NOTICE([LDFLAGS$LDFLAGS])
+AC_MSG_NOTICE([LIBS   $LIBS])
 AC_MSG_NOTICE([--enable-builtinls $opt_builtinls])
 AC_MSG_NOTICE([--enable-ipv6  $opt_ipv6])
 AC_MSG_NOTICE([--with-blocklist   $with_blocklist])



CVS commit: othersrc/libexec/tnftpd

2023-09-23 Thread Luke Mewburn
Module Name:othersrc
Committed By:   lukem
Date:   Sun Sep 24 02:07:12 UTC 2023

Modified Files:
othersrc/libexec/tnftpd: configure.ac

Log Message:
configure: improve check for inet_net_pton()

Look for inet_net_pton() in -lresolv (for glibc).
Move library checks after header checks, in case latter are needed for former.
Display vars at end of configure: CC, CFLAGS, CPPFLAGS, LDFLAGS, LIBS


To generate a diff of this commit:
cvs rdiff -u -r1.52 -r1.53 othersrc/libexec/tnftpd/configure.ac

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



CVS commit: othersrc/libexec/tnftpd

2023-09-23 Thread Luke Mewburn
Module Name:othersrc
Committed By:   lukem
Date:   Sun Sep 24 01:23:17 UTC 2023

Modified Files:
othersrc/libexec/tnftpd: ChangeLog NEWS

Log Message:
update ChangeLog for yesterday's improvements


To generate a diff of this commit:
cvs rdiff -u -r1.64 -r1.65 othersrc/libexec/tnftpd/ChangeLog
cvs rdiff -u -r1.15 -r1.16 othersrc/libexec/tnftpd/NEWS

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/ChangeLog
diff -u othersrc/libexec/tnftpd/ChangeLog:1.64 othersrc/libexec/tnftpd/ChangeLog:1.65
--- othersrc/libexec/tnftpd/ChangeLog:1.64	Sat Jul  4 06:49:19 2020
+++ othersrc/libexec/tnftpd/ChangeLog	Sun Sep 24 01:23:17 2023
@@ -1,6 +1,40 @@
-$NetBSD: ChangeLog,v 1.64 2020/07/04 06:49:19 lukem Exp $
+$NetBSD: ChangeLog,v 1.65 2023/09/24 01:23:17 lukem Exp $
 
-Sat Jul  4 06:40:38 UTC 2020	lukem
+Sat Sep 23 05:39:49 UTC 2023	lu...@netbsd.org
+
+	* Security fixes:
+		* CVE-2020-7468: Improve error handling when switching UID/GID.
+		* Prevent MLSD and MLST before authentication succeeds.
+
+	* Update to NetBSD-ftpd 20230922:
+		* Treat failed chdir/chroot for guest and chroot accounts as
+		  fatal. Also treat failed set{e,}(u,g}id calls as fatal.
+		  Addresses CVE-2020-7468, via FreeBSD.
+		* Improve seteuid error handling, per suggestion by Simon
+		  Josefsson.
+		* Add missing check_login checks for MLST and MLSD.
+
+	* Sync libnetbsd replacements with NetBSD upstream:
+		* Replace fgetln() with tools/compat implementation that
+		  handles embedded NULs.
+		* Fix inet_net_pton() to avoid integer overflow in bits.
+		* Fix inet_ntop() to set errno when returning NULL.
+		* Fix inet_pton() to improve hex formatting.
+		* Fix sl_add() to not update size unless realloc() succeeds.
+
+	* Improve portability on NetBSD by providing own setprogname()
+	  and getprogname(), instead of defining global __progname. 
+
+	* Update example ftpusers to use example DNS and IP addresses.
+
+	* Build fixes:
+		* Improve configure's display of detected features.
+		* Enable more POSIX extensions.
+		* Only replace glob() if required GLOB_ flags aren't available.
+		* Only replace fts_open() if required FTS_ flags aren't
+		  available.
+
+Sat Jul  4 06:40:38 UTC 2020	lu...@netbsd.org
 
 	* Release as "tnftpd 20200704".
 
@@ -11,11 +45,11 @@ Sat Jul  4 06:40:38 UTC 2020	lukem
 		* Increase some buffer sizes.
 		* Rename blacklist to blocklist.
 
-Sun Jun  2 05:56:12 UTC 2019	lukem
+Sun Jun  2 05:56:12 UTC 2019	lu...@netbsd.org
 
 	* Release as "tnftpd 20190602".
 
-Tue Jan 29 23:12:52 UTC 2019	lukem
+Tue Jan 29 23:12:52 UTC 2019	lu...@netbsd.org
 
 	* Limit fnmatch(), fts(),  strsuftollx() recursion to avoid
 	  DoS attacks. From Maksymilian Arciemowicz.
@@ -56,13 +90,13 @@ Tue Jan 29 23:12:52 UTC 2019	lukem
 
 	* Remove endorsement clause from some of my licenses.
 
-Mon Mar 25 03:51:20 UTC 2013	lukem
+Mon Mar 25 03:51:20 UTC 2013	lu...@netbsd.org
 
 	* Release as "tnftpd 20130325"
 
 	* Fix incorrect use of test(1) in configure.
 
-Fri Mar 22 09:00:00 UTC 2013	lukem
+Fri Mar 22 09:00:00 UTC 2013	lu...@netbsd.org
 
 	* Release as "tnftpd 20130322"
 
@@ -81,7 +115,7 @@ Fri Mar 22 09:00:00 UTC 2013	lukem
 		* Reduce priority of syslog message if getpeername returns
 		  ENOTCONN.  PR/18934 from Greg A Woods.
 
-Wed Mar 24 12:34:09 UTC 2010	lukem
+Wed Mar 24 12:34:09 UTC 2010	lu...@netbsd.org
 
 	* Release as "tnftpd 20100324"
 
@@ -89,7 +123,7 @@ Wed Mar 24 12:34:09 UTC 2010	lukem
 		* Security fix; apply NetBSD popen.c 1.37:
 		  PR/43023: Bruce Cran: FTPD bug remote crash
 
-Mon Jan  4 05:51:15 UTC 2010	lukem
+Mon Jan  4 05:51:15 UTC 2010	lu...@netbsd.org
 
 	* Regenerate .manin manual page sources from upstream sources.
 
@@ -98,12 +132,12 @@ Mon Jan  4 05:51:15 UTC 2010	lukem
 	* Distribute various files not shipped by default automake rules,
 	  to use 'make dist' instead of 'cvs export'.
 
-Wed Dec 30 01:48:57 UTC 2009	lukem
+Wed Dec 30 01:48:57 UTC 2009	lu...@netbsd.org
 
 	* Release as "tnftpd 20091122"
 
-Sat Nov  7 11:13:38 UTC 2009	lukem
-	
+Sat Nov  7 11:13:38 UTC 2009	lu...@netbsd.org
+
 	* Convert to automake & libtool.
 
 	* Rename config.h to tnftpd_config.h.
@@ -121,7 +155,7 @@ Sat Nov  7 11:13:38 UTC 2009	lukem
 		* Log both the hostname and numeric address.
 		* Improve man page mdoc formatting
 
-Sun Mar  1 03:10:40 UTC 2009	lukem
+Sun Mar  1 03:10:40 UTC 2009	lu...@netbsd.org
 
 	* fts_open.c:
 		- Ensure fts_close() doesn't spuriously close fd 0,
@@ -131,22 +165,22 @@ Sun Mar  1 03:10:40 UTC 2009	lukem
 		  damage.
 		   Received from OpenBSD via US-CERT as VU #590371.
 
-Tue Dec 30 22:36:05 UTC 2008	lukem
+Tue Dec 30 22:36:05 UTC 2008	lu...@netbsd.org
 
 	* Fix the SIA implementation, per feedback from Onno van der Linden.
 
-Sat Dec 20 07:41:22 UTC 2008	lukem
+Sat Dec 20 07:41:22 UTC 2008	lu...@netbsd.org
 
 	* Install into ${exec_prefix}/libexec instead of 

CVS commit: othersrc/libexec/tnftpd

2023-09-23 Thread Luke Mewburn
Module Name:othersrc
Committed By:   lukem
Date:   Sun Sep 24 01:23:17 UTC 2023

Modified Files:
othersrc/libexec/tnftpd: ChangeLog NEWS

Log Message:
update ChangeLog for yesterday's improvements


To generate a diff of this commit:
cvs rdiff -u -r1.64 -r1.65 othersrc/libexec/tnftpd/ChangeLog
cvs rdiff -u -r1.15 -r1.16 othersrc/libexec/tnftpd/NEWS

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



CVS commit: othersrc/libexec/tnftpd/src

2023-09-22 Thread Luke Mewburn
Module Name:othersrc
Committed By:   lukem
Date:   Sat Sep 23 05:40:42 UTC 2023

Modified Files:
othersrc/libexec/tnftpd/src: ftpd.conf.manin ftpusers.manin
tnftpd.manin

Log Message:
sync .manin pages with upstream


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 othersrc/libexec/tnftpd/src/ftpd.conf.manin
cvs rdiff -u -r1.1 -r1.2 othersrc/libexec/tnftpd/src/ftpusers.manin
cvs rdiff -u -r1.3 -r1.4 othersrc/libexec/tnftpd/src/tnftpd.manin

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/ftpd.conf.manin
diff -u othersrc/libexec/tnftpd/src/ftpd.conf.manin:1.2 othersrc/libexec/tnftpd/src/ftpd.conf.manin:1.3
--- othersrc/libexec/tnftpd/src/ftpd.conf.manin:1.2	Mon Jan  4 01:10:43 2010
+++ othersrc/libexec/tnftpd/src/ftpd.conf.manin	Sat Sep 23 05:40:42 2023
@@ -1,7 +1,7 @@
-.\"	$NetBSD: ftpd.conf.manin,v 1.2 2010/01/04 01:10:43 lukem Exp $
-.\"	from	NetBSD: ftpd.conf.5,v 1.37 2009/04/09 02:25:45 joerg Exp
+.\"	$NetBSD: ftpd.conf.manin,v 1.3 2023/09/23 05:40:42 lukem Exp $
+.\"	from	NetBSD: ftpd.conf.5,v 1.38 2020/08/22 08:08:47 lukem Exp
 .\"
-.\" Copyright (c) 1997-2008 The NetBSD Foundation, Inc.
+.\" Copyright (c) 1997-2020 The NetBSD Foundation, Inc.
 .\" All rights reserved.
 .\"
 .\" This code is derived from software contributed to The NetBSD Foundation
@@ -28,7 +28,7 @@
 .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
 .\" POSSIBILITY OF SUCH DAMAGE.
 .\"
-.Dd April 13, 2007
+.Dd August 22, 2020
 .Dt FTPD.CONF 5
 .Os
 .Sh NAME
@@ -477,7 +477,7 @@ Set the range of port number which will 
 .Ar max
 must be greater than
 .Ar min ,
-and both numbers must be be between
+and both numbers must be between
 .Dv IPPORT_RESERVED
 (1024) and 65535.
 If

Index: othersrc/libexec/tnftpd/src/ftpusers.manin
diff -u othersrc/libexec/tnftpd/src/ftpusers.manin:1.1 othersrc/libexec/tnftpd/src/ftpusers.manin:1.2
--- othersrc/libexec/tnftpd/src/ftpusers.manin:1.1	Sun Sep 21 16:21:13 2008
+++ othersrc/libexec/tnftpd/src/ftpusers.manin	Sat Sep 23 05:40:42 2023
@@ -1,4 +1,4 @@
-.\"	$NetBSD: ftpusers.manin,v 1.1 2008/09/21 16:21:13 lukem Exp $
+.\"	$NetBSD: ftpusers.manin,v 1.2 2023/09/23 05:40:42 lukem Exp $
 .\"	from	NetBSD: ftpusers.5,v 1.17 2008/09/13 02:41:52 lukem Exp
 .\"
 .\" Copyright (c) 1997-2008 The NetBSD Foundation, Inc.
@@ -28,7 +28,7 @@
 .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
 .\" POSSIBILITY OF SUCH DAMAGE.
 .\"
-.Dd February 28, 2003
+.Dd July 17, 2000
 .Dt FTPUSERS 5
 .Os
 .Sh NAME

Index: othersrc/libexec/tnftpd/src/tnftpd.manin
diff -u othersrc/libexec/tnftpd/src/tnftpd.manin:1.3 othersrc/libexec/tnftpd/src/tnftpd.manin:1.4
--- othersrc/libexec/tnftpd/src/tnftpd.manin:1.3	Tue Jan 29 13:35:58 2019
+++ othersrc/libexec/tnftpd/src/tnftpd.manin	Sat Sep 23 05:40:42 2023
@@ -1,5 +1,5 @@
-.\"	$NetBSD: tnftpd.manin,v 1.3 2019/01/29 13:35:58 lukem Exp $
-+.\"	from	NetBSD: ftpd.8,v 1.87 2018/04/28 13:38:00 riastradh Exp 
+.\"	$NetBSD: tnftpd.manin,v 1.4 2023/09/23 05:40:42 lukem Exp $
+.\"	from	NetBSD: ftpd.8,v 1.87 2018/04/28 13:38:00 riastradh Exp
 .\"
 .\" Copyright (c) 1997-2008 The NetBSD Foundation, Inc.
 .\" All rights reserved.



CVS commit: othersrc/libexec/tnftpd/src

2023-09-22 Thread Luke Mewburn
Module Name:othersrc
Committed By:   lukem
Date:   Sat Sep 23 05:40:42 UTC 2023

Modified Files:
othersrc/libexec/tnftpd/src: ftpd.conf.manin ftpusers.manin
tnftpd.manin

Log Message:
sync .manin pages with upstream


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 othersrc/libexec/tnftpd/src/ftpd.conf.manin
cvs rdiff -u -r1.1 -r1.2 othersrc/libexec/tnftpd/src/ftpusers.manin
cvs rdiff -u -r1.3 -r1.4 othersrc/libexec/tnftpd/src/tnftpd.manin

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



CVS commit: othersrc/libexec/tnftpd/buildaux

2023-09-22 Thread Luke Mewburn
Module Name:othersrc
Committed By:   lukem
Date:   Sat Sep 23 05:39:48 UTC 2023

Modified Files:
othersrc/libexec/tnftpd/buildaux: netbsd2tnftpd

Log Message:
improve netbsd2tnftpd conversion

replace ftpd with tnftpd in more macros


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 othersrc/libexec/tnftpd/buildaux/netbsd2tnftpd

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/buildaux/netbsd2tnftpd
diff -u othersrc/libexec/tnftpd/buildaux/netbsd2tnftpd:1.1 othersrc/libexec/tnftpd/buildaux/netbsd2tnftpd:1.2
--- othersrc/libexec/tnftpd/buildaux/netbsd2tnftpd:1.1	Sat Nov  7 09:54:23 2009
+++ othersrc/libexec/tnftpd/buildaux/netbsd2tnftpd	Sat Sep 23 05:39:48 2023
@@ -1,6 +1,6 @@
 #!/bin/sh
 #
-# $NetBSD: netbsd2tnftpd,v 1.1 2009/11/07 09:54:23 lukem Exp $
+# $NetBSD: netbsd2tnftpd,v 1.2 2023/09/23 05:39:48 lukem Exp $
 
 mantoin()
 {
@@ -8,6 +8,9 @@ mantoin()
 	[ "$1" != "$2" ] || exit 6
 	echo 1>&2 "Converting $1 to $2"
 	sed < "$1" > "$2" \
+		-e 's|Dt FTPD 8|Dt TNFTPD 8|' \
+		-e 's|Nm ftpd$|Nm tnftpd|' \
+		-e 's|Xr ftpd |Xr tnftpd |' \
 		-e 's|/etc/ftpchroot|@sysconfdir@/ftpchroot|' \
 		-e 's|/etc/ftpd.conf|@sysconfdir@/ftpd.conf|' \
 		-e 's|/etc/ftpusers|@sysconfdir@/ftpusers|' \



CVS commit: othersrc/libexec/tnftpd/buildaux

2023-09-22 Thread Luke Mewburn
Module Name:othersrc
Committed By:   lukem
Date:   Sat Sep 23 05:39:48 UTC 2023

Modified Files:
othersrc/libexec/tnftpd/buildaux: netbsd2tnftpd

Log Message:
improve netbsd2tnftpd conversion

replace ftpd with tnftpd in more macros


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 othersrc/libexec/tnftpd/buildaux/netbsd2tnftpd

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



CVS commit: othersrc/libexec/tnftpd/src

2023-09-22 Thread Luke Mewburn
Module Name:othersrc
Committed By:   lukem
Date:   Sat Sep 23 05:30:36 UTC 2023

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

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


To generate a diff of this commit:
cvs rdiff -u -r1.19 -r1.20 othersrc/libexec/tnftpd/src/extern.h \
othersrc/libexec/tnftpd/src/ftpcmd.y
cvs rdiff -u -r1.38 -r1.39 othersrc/libexec/tnftpd/src/ftpd.c
cvs rdiff -u -r1.3 -r1.4 othersrc/libexec/tnftpd/src/pfilter.c
cvs rdiff -u -r1.10 -r1.11 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.19 othersrc/libexec/tnftpd/src/extern.h:1.20
--- othersrc/libexec/tnftpd/src/extern.h:1.19	Sat Jul  4 04:00:53 2020
+++ othersrc/libexec/tnftpd/src/extern.h	Sat Sep 23 05:30:36 2023
@@ -1,5 +1,5 @@
-/*	$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	*/
+/*	$NetBSD: extern.h,v 1.20 2023/09/23 05:30:36 lukem Exp $	*/
+/*	from	NetBSD: extern.h,v 1.66 2022/04/17 21:24:53 andvar Exp	*/
 
 /*-
  * Copyright (c) 1992, 1993
@@ -289,7 +289,7 @@ struct ftpclass {
 	LLT		 maxtimeout;	/* Maximum permitted timeout */
 	char		*motd;		/* MotD file to display after login */
 	char		*notify;	/* Files to notify about upon chdir */
-	LLT		 portmin;	/* Minumum port for passive mode */
+	LLT		 portmin;	/* Minimum port for passive mode */
 	LLT		 portmax;	/* Maximum port for passive mode */
 	LLT		 rateget;	/* Get (RETR) transfer rate throttle */
 	LLT		 rateput;	/* Put (STOR) transfer rate throttle */
Index: othersrc/libexec/tnftpd/src/ftpcmd.y
diff -u othersrc/libexec/tnftpd/src/ftpcmd.y:1.19 othersrc/libexec/tnftpd/src/ftpcmd.y:1.20
--- othersrc/libexec/tnftpd/src/ftpcmd.y:1.19	Tue Jan 29 12:14:46 2019
+++ othersrc/libexec/tnftpd/src/ftpcmd.y	Sat Sep 23 05:30:36 2023
@@ -1,5 +1,5 @@
-/*	$NetBSD: ftpcmd.y,v 1.19 2019/01/29 12:14:46 lukem Exp $	*/
-/*	from	NetBSD: ftpcmd.y,v 1.94 2015/08/10 07:45:50 shm Exp	*/
+/*	$NetBSD: ftpcmd.y,v 1.20 2023/09/23 05:30:36 lukem Exp $	*/
+/*	from	NetBSD: ftpcmd.y,v 1.95 2023/09/22 11:23:28 shm Exp	*/
 
 /*-
  * Copyright (c) 1997-2009 The NetBSD Foundation, Inc.
@@ -78,7 +78,7 @@
 #if 0
 static char sccsid[] = "@(#)ftpcmd.y	8.3 (Berkeley) 4/6/94";
 #else
-__RCSID(" NetBSD: ftpcmd.y,v 1.94 2015/08/10 07:45:50 shm Exp  ");
+__RCSID(" NetBSD: ftpcmd.y,v 1.95 2023/09/22 11:23:28 shm Exp  ");
 #endif
 #endif /* not lint */
 
@@ -863,7 +863,8 @@ cmd
 		
 	| MLST check_login CRLF
 		{
-			mlst(NULL);
+			if ($2)
+mlst(NULL);
 		}
 
 	| MLSD check_login SP pathname CRLF
@@ -876,7 +877,8 @@ cmd
 		
 	| MLSD check_login CRLF
 		{
-			mlsd(NULL);
+			if ($2)
+mlsd(NULL);
 		}
 
 	| error CRLF

Index: othersrc/libexec/tnftpd/src/ftpd.c
diff -u othersrc/libexec/tnftpd/src/ftpd.c:1.38 othersrc/libexec/tnftpd/src/ftpd.c:1.39
--- othersrc/libexec/tnftpd/src/ftpd.c:1.38	Sat Sep 23 04:00:21 2023
+++ othersrc/libexec/tnftpd/src/ftpd.c	Sat Sep 23 05:30:36 2023
@@ -1,8 +1,8 @@
-/*	$NetBSD: ftpd.c,v 1.38 2023/09/23 04:00:21 lukem Exp $	*/
-/*	from	NetBSD: ftpd.c,v 1.205 2019/10/15 18:29:32 christos Exp	*/
+/*	$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	*/
 
 /*
- * Copyright (c) 1997-2009 The NetBSD Foundation, Inc.
+ * Copyright (c) 1997-2023 The NetBSD Foundation, Inc.
  * All rights reserved.
  *
  * This code is derived from software contributed to The NetBSD Foundation
@@ -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.205 2019/10/15 18:29:32 christos Exp  ");
+__RCSID(" NetBSD: ftpd.c,v 1.207 2023/09/02 12:16:29 lukem Exp  ");
 #endif
 #endif /* not lint */
 
@@ -1408,7 +1408,12 @@ end_login(void)
 	quietmessages = 0;
 	gidcount = 0;
 	curclass.type = CLASS_REAL;
-	(void) seteuid((uid_t)0);
+	if (!dropprivs) {
+		if (seteuid((uid_t)0) < 0) {
+			syslog(LOG_NOTICE, "end_login: can't seteuid 0: %m");
+			fatal("Can't reset privileges.");
+		}
+	}
 #ifdef	LOGIN_CAP
 	setusercontext(NULL, getpwuid(0), 0,
 		   LOGIN_SETPRIORITY|LOGIN_SETRESOURCES|LOGIN_SETUMASK);
@@ -1554,8 +1559,8 @@ do_pass(int pass_checked, int pass_rval,
 
 	login_attempts = 0;		/* this time successful */
 	if (setegid((gid_t)pw->pw_gid) < 0) {
-		reply(550, "Can't set gid.");
-		goto bad;
+		syslog(LOG_NOTICE, "user %s: can't setegid: %m", pw->pw_name);
+		fatal("Can't drop privileges.");
 	}
 #ifdef	LOGIN_CAP
 	if ((lc = login_getpwclass(pw)) != NULL) {
@@ -1660,8 +1665,7 @@ do_pass(int pass_checked, int pass_rval,
 			"GUEST user %s: can't chdir to %s: %m",
 			pw->pw_name, homedir);
  bad_guest:
-			reply(550, "Can't set guest 

CVS commit: othersrc/libexec/tnftpd/src

2023-09-22 Thread Luke Mewburn
Module Name:othersrc
Committed By:   lukem
Date:   Sat Sep 23 05:30:36 UTC 2023

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

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


To generate a diff of this commit:
cvs rdiff -u -r1.19 -r1.20 othersrc/libexec/tnftpd/src/extern.h \
othersrc/libexec/tnftpd/src/ftpcmd.y
cvs rdiff -u -r1.38 -r1.39 othersrc/libexec/tnftpd/src/ftpd.c
cvs rdiff -u -r1.3 -r1.4 othersrc/libexec/tnftpd/src/pfilter.c
cvs rdiff -u -r1.10 -r1.11 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.



CVS commit: othersrc/libexec/tnftpd

2023-09-22 Thread Luke Mewburn
Module Name:othersrc
Committed By:   lukem
Date:   Sat Sep 23 04:50:42 UTC 2023

Modified Files:
othersrc/libexec/tnftpd: Makefile.in configure tnftpd_config.h.in
othersrc/libexec/tnftpd/libnetbsd: Makefile.in

Log Message:
regen


To generate a diff of this commit:
cvs rdiff -u -r1.13 -r1.14 othersrc/libexec/tnftpd/Makefile.in
cvs rdiff -u -r1.53 -r1.54 othersrc/libexec/tnftpd/configure
cvs rdiff -u -r1.7 -r1.8 othersrc/libexec/tnftpd/tnftpd_config.h.in
cvs rdiff -u -r1.10 -r1.11 othersrc/libexec/tnftpd/libnetbsd/Makefile.in

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



CVS commit: othersrc/libexec/tnftpd/libnetbsd

2023-09-22 Thread Luke Mewburn
Module Name:othersrc
Committed By:   lukem
Date:   Sat Sep 23 04:47:47 UTC 2023

Modified Files:
othersrc/libexec/tnftpd/libnetbsd: Makefile.am
Added Files:
othersrc/libexec/tnftpd/libnetbsd: libnetbsd.c

Log Message:
libnetbsd: add placeholder source to avoid an empty library


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 othersrc/libexec/tnftpd/libnetbsd/Makefile.am
cvs rdiff -u -r0 -r1.1 othersrc/libexec/tnftpd/libnetbsd/libnetbsd.c

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



CVS commit: othersrc/libexec/tnftpd/libnetbsd

2023-09-22 Thread Luke Mewburn
Module Name:othersrc
Committed By:   lukem
Date:   Sat Sep 23 04:47:47 UTC 2023

Modified Files:
othersrc/libexec/tnftpd/libnetbsd: Makefile.am
Added Files:
othersrc/libexec/tnftpd/libnetbsd: libnetbsd.c

Log Message:
libnetbsd: add placeholder source to avoid an empty library


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 othersrc/libexec/tnftpd/libnetbsd/Makefile.am
cvs rdiff -u -r0 -r1.1 othersrc/libexec/tnftpd/libnetbsd/libnetbsd.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/libnetbsd/Makefile.am
diff -u othersrc/libexec/tnftpd/libnetbsd/Makefile.am:1.4 othersrc/libexec/tnftpd/libnetbsd/Makefile.am:1.5
--- othersrc/libexec/tnftpd/libnetbsd/Makefile.am:1.4	Tue Jan 29 12:51:38 2019
+++ othersrc/libexec/tnftpd/libnetbsd/Makefile.am	Sat Sep 23 04:47:47 2023
@@ -1,8 +1,8 @@
-## $NetBSD: Makefile.am,v 1.4 2019/01/29 12:51:38 lukem Exp $
+## $NetBSD: Makefile.am,v 1.5 2023/09/23 04:47:47 lukem Exp $
 
 noinst_LTLIBRARIES = libnetbsd.la
 
-libnetbsd_la_SOURCES =
+libnetbsd_la_SOURCES = libnetbsd.c
 
 AM_CPPFLAGS = \
 	-DHAVE_TNFTPD_H=1 \

Added files:

Index: othersrc/libexec/tnftpd/libnetbsd/libnetbsd.c
diff -u /dev/null othersrc/libexec/tnftpd/libnetbsd/libnetbsd.c:1.1
--- /dev/null	Sat Sep 23 04:47:47 2023
+++ othersrc/libexec/tnftpd/libnetbsd/libnetbsd.c	Sat Sep 23 04:47:47 2023
@@ -0,0 +1,3 @@
+/* $NetBSD: libnetbsd.c,v 1.1 2023/09/23 04:47:47 lukem Exp $ */
+
+const char libnetbsd_placeholder[] = "Ensure libnetbsd.la is not empty";



CVS commit: othersrc/libexec/tnftpd

2023-09-22 Thread Luke Mewburn
Module Name:othersrc
Committed By:   lukem
Date:   Sat Sep 23 04:45:03 UTC 2023

Modified Files:
othersrc/libexec/tnftpd: configure.ac tnftpd.h

Log Message:
configure: only replace fts_open if required FTS_ flags aren't available

Use system fts_open() if it provides the flags we use:
FTS_COMFOLLOW|FTS_LOGICAL|FTS_NOSTAT|FTS_PHYSICAL|FTS_SEEDOT


To generate a diff of this commit:
cvs rdiff -u -r1.51 -r1.52 othersrc/libexec/tnftpd/configure.ac
cvs rdiff -u -r1.40 -r1.41 othersrc/libexec/tnftpd/tnftpd.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/configure.ac
diff -u othersrc/libexec/tnftpd/configure.ac:1.51 othersrc/libexec/tnftpd/configure.ac:1.52
--- othersrc/libexec/tnftpd/configure.ac:1.51	Sat Sep 23 04:28:10 2023
+++ othersrc/libexec/tnftpd/configure.ac	Sat Sep 23 04:45:03 2023
@@ -1,4 +1,4 @@
-# $NetBSD: configure.ac,v 1.51 2023/09/23 04:28:10 lukem Exp $
+# $NetBSD: configure.ac,v 1.52 2023/09/23 04:45:03 lukem Exp $
 #
 # Process this file with autoconf to produce a configure script.
 
@@ -95,8 +95,10 @@ AH_TEMPLATE([USE_BLOCKLIST],
 [Define if using blocklist.])
 AH_TEMPLATE([USE_BLACKLIST],
 [Define if using blacklist.])
+AH_TEMPLATE([USE_FTS_H],
+[Define if using system  instead of ftpfts.h.])
 AH_TEMPLATE([USE_GLOB_H],
-[Define if using system  instead of local glob.])
+[Define if using system  instead of ftpglob.h.])
 AH_TEMPLATE([USE_INET6],
 [Define if using IPv6 support.])
 AH_TEMPLATE([USE_PAM],
@@ -313,7 +315,7 @@ AC_CHECK_HEADER([glob.h],
 int f = GLOB_BRACE|GLOB_LIMIT|GLOB_NOCHECK|GLOB_TILDE;
 ]])],
  [AC_MSG_RESULT([yes])
-			  use_local_glob=no],
+  use_local_glob=no],
  [AC_MSG_RESULT([no - using local version])],
  [AC_MSG_RESULT([unknown - cross-compiling])])])
 AS_IF([test "$use_local_glob" = yes],
@@ -485,9 +487,25 @@ AS_IF([test "$with_skey" != no],
 AS_IF([test "$opt_builtinls" = yes],
   [AC_MSG_NOTICE([--enable-builtinls; checking for required features])
AC_REPLACE_FUNCS([strmode user_from_uid])
-   # Always replace fts_open(); the vendor's may not be secure.
+
+   # Use system fts if required FTS_ flags are available.
#
-   AC_LIBOBJ([fts_open])
+   use_local_fts=yes
+   AC_CHECK_HEADER([fts.h],
+   [AC_MSG_CHECKING([fts supports required flags])
+AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
+$accheck_includes
+#include ]], [[
+int f = FTS_COMFOLLOW|FTS_LOGICAL|FTS_NOSTAT|FTS_PHYSICAL|FTS_SEEDOT;
+]])],
+[AC_MSG_RESULT([yes])
+ use_local_fts=no],
+[AC_MSG_RESULT([no - using local version])],
+[AC_MSG_RESULT([unknown - cross-compiling])])])
+   AS_IF([test "$use_local_fts" = yes],
+ [AC_LIBOBJ([fts_open])],
+ [AC_DEFINE([USE_FTS_H], [1])])
+
AC_MSG_NOTICE([--enable-builtinls feature check complete])],
   [AC_DEFINE([NO_INTERNAL_LS], [1])])
 

Index: othersrc/libexec/tnftpd/tnftpd.h
diff -u othersrc/libexec/tnftpd/tnftpd.h:1.40 othersrc/libexec/tnftpd/tnftpd.h:1.41
--- othersrc/libexec/tnftpd/tnftpd.h:1.40	Sat Sep 23 04:28:10 2023
+++ othersrc/libexec/tnftpd/tnftpd.h	Sat Sep 23 04:45:03 2023
@@ -1,4 +1,4 @@
-/* $NetBSD: tnftpd.h,v 1.40 2023/09/23 04:28:10 lukem Exp $ */
+/* $NetBSD: tnftpd.h,v 1.41 2023/09/23 04:45:03 lukem Exp $ */
 
 #define	FTPD_VERSION	PACKAGE_STRING
 
@@ -246,7 +246,7 @@ int		 sl_delete(StringList *, const char
 # endif
 #endif
 
-#if defined(HAVE_FTS_H)
+#if defined(USE_FTS_H)
 # include 
 #else
 # include "ftpfts.h"



CVS commit: othersrc/libexec/tnftpd

2023-09-22 Thread Luke Mewburn
Module Name:othersrc
Committed By:   lukem
Date:   Sat Sep 23 04:45:03 UTC 2023

Modified Files:
othersrc/libexec/tnftpd: configure.ac tnftpd.h

Log Message:
configure: only replace fts_open if required FTS_ flags aren't available

Use system fts_open() if it provides the flags we use:
FTS_COMFOLLOW|FTS_LOGICAL|FTS_NOSTAT|FTS_PHYSICAL|FTS_SEEDOT


To generate a diff of this commit:
cvs rdiff -u -r1.51 -r1.52 othersrc/libexec/tnftpd/configure.ac
cvs rdiff -u -r1.40 -r1.41 othersrc/libexec/tnftpd/tnftpd.h

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



CVS commit: othersrc/libexec/tnftpd

2023-09-22 Thread Luke Mewburn
Module Name:othersrc
Committed By:   lukem
Date:   Sat Sep 23 04:28:51 UTC 2023

Modified Files:
othersrc/libexec/tnftpd: todo

Log Message:
todo: DONE: fgetln and glob


To generate a diff of this commit:
cvs rdiff -u -r1.22 -r1.23 othersrc/libexec/tnftpd/todo

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/todo
diff -u othersrc/libexec/tnftpd/todo:1.22 othersrc/libexec/tnftpd/todo:1.23
--- othersrc/libexec/tnftpd/todo:1.22	Sat Jul  4 05:38:28 2020
+++ othersrc/libexec/tnftpd/todo	Sat Sep 23 04:28:51 2023
@@ -1,4 +1,4 @@
-$NetBSD: todo,v 1.22 2020/07/04 05:38:28 lukem Exp $
+$NetBSD: todo,v 1.23 2023/09/23 04:28:51 lukem Exp $
 
 check for pidfile returning void (old netbsd such as 1.6) ?
 
@@ -29,11 +29,7 @@ enable socks once functional autoconf te
 
 add setenv(3) to replace putenv(3) cruft?
 
-convert to tools/compat/fgetln.c for inline NUL handling?
-
 autoconf check for FNM_NORES for detection of recursion attack.
 less like to be a problem since it's only parsed from ftpd.conf
 
 tools/compat/configure.ac BROKEN_FPARSELN
-
-allow glob override to be optional?



CVS commit: othersrc/libexec/tnftpd

2023-09-22 Thread Luke Mewburn
Module Name:othersrc
Committed By:   lukem
Date:   Sat Sep 23 04:28:51 UTC 2023

Modified Files:
othersrc/libexec/tnftpd: todo

Log Message:
todo: DONE: fgetln and glob


To generate a diff of this commit:
cvs rdiff -u -r1.22 -r1.23 othersrc/libexec/tnftpd/todo

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



CVS commit: othersrc/libexec/tnftpd

2023-09-22 Thread Luke Mewburn
Module Name:othersrc
Committed By:   lukem
Date:   Sat Sep 23 04:28:10 UTC 2023

Modified Files:
othersrc/libexec/tnftpd: configure.ac tnftpd.h

Log Message:
configure: only replace glob if required GLOB_ flags aren't available

Use system glob() if it provides the flags we use:
GLOB_BRACE|GLOB_LIMIT|GLOB_NOCHECK|GLOB_TILDE


To generate a diff of this commit:
cvs rdiff -u -r1.50 -r1.51 othersrc/libexec/tnftpd/configure.ac
cvs rdiff -u -r1.39 -r1.40 othersrc/libexec/tnftpd/tnftpd.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/configure.ac
diff -u othersrc/libexec/tnftpd/configure.ac:1.50 othersrc/libexec/tnftpd/configure.ac:1.51
--- othersrc/libexec/tnftpd/configure.ac:1.50	Sat Sep 23 04:12:32 2023
+++ othersrc/libexec/tnftpd/configure.ac	Sat Sep 23 04:28:10 2023
@@ -1,4 +1,4 @@
-# $NetBSD: configure.ac,v 1.50 2023/09/23 04:12:32 lukem Exp $
+# $NetBSD: configure.ac,v 1.51 2023/09/23 04:28:10 lukem Exp $
 #
 # Process this file with autoconf to produce a configure script.
 
@@ -95,6 +95,8 @@ AH_TEMPLATE([USE_BLOCKLIST],
 [Define if using blocklist.])
 AH_TEMPLATE([USE_BLACKLIST],
 [Define if using blacklist.])
+AH_TEMPLATE([USE_GLOB_H],
+[Define if using system  instead of local glob.])
 AH_TEMPLATE([USE_INET6],
 [Define if using IPv6 support.])
 AH_TEMPLATE([USE_PAM],
@@ -301,9 +303,22 @@ have_dirfd_as_macro
  AC_DEFINE([HAVE_DIRFD_AS_MACRO], [1])],
 [AC_MSG_RESULT([no])])])
 
-# Always replace glob(); the vendor's may not be secure.
+# Use system glob if required GLOB_ flags are available.
 #
-AC_LIBOBJ([glob])
+use_local_glob=yes
+AC_CHECK_HEADER([glob.h],
+[AC_MSG_CHECKING([glob supports required flags])
+ AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
+#include ]], [[
+int f = GLOB_BRACE|GLOB_LIMIT|GLOB_NOCHECK|GLOB_TILDE;
+]])],
+ [AC_MSG_RESULT([yes])
+			  use_local_glob=no],
+ [AC_MSG_RESULT([no - using local version])],
+ [AC_MSG_RESULT([unknown - cross-compiling])])])
+AS_IF([test "$use_local_glob" = yes],
+  [AC_LIBOBJ([glob])],
+  [AC_DEFINE([USE_GLOB_H], [1])])
 
 # Replace fnmatch() if FNM_CASEFOLD is not supported.
 #

Index: othersrc/libexec/tnftpd/tnftpd.h
diff -u othersrc/libexec/tnftpd/tnftpd.h:1.39 othersrc/libexec/tnftpd/tnftpd.h:1.40
--- othersrc/libexec/tnftpd/tnftpd.h:1.39	Sat Sep 23 04:00:21 2023
+++ othersrc/libexec/tnftpd/tnftpd.h	Sat Sep 23 04:28:10 2023
@@ -1,4 +1,4 @@
-/* $NetBSD: tnftpd.h,v 1.39 2023/09/23 04:00:21 lukem Exp $ */
+/* $NetBSD: tnftpd.h,v 1.40 2023/09/23 04:28:10 lukem Exp $ */
 
 #define	FTPD_VERSION	PACKAGE_STRING
 
@@ -173,7 +173,11 @@ struct pollfd {
 # include 
 #endif
 
-#include "ftpglob.h"
+#if defined(USE_GLOB_H)
+# include 
+#else
+# include "ftpglob.h"
+#endif
 
 #if defined(HAVE_FNMATCH_H) && HAVE_DECL_FNM_CASEFOLD
 # include 



CVS commit: othersrc/libexec/tnftpd

2023-09-22 Thread Luke Mewburn
Module Name:othersrc
Committed By:   lukem
Date:   Sat Sep 23 04:28:10 UTC 2023

Modified Files:
othersrc/libexec/tnftpd: configure.ac tnftpd.h

Log Message:
configure: only replace glob if required GLOB_ flags aren't available

Use system glob() if it provides the flags we use:
GLOB_BRACE|GLOB_LIMIT|GLOB_NOCHECK|GLOB_TILDE


To generate a diff of this commit:
cvs rdiff -u -r1.50 -r1.51 othersrc/libexec/tnftpd/configure.ac
cvs rdiff -u -r1.39 -r1.40 othersrc/libexec/tnftpd/tnftpd.h

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



CVS commit: othersrc/libexec/tnftpd

2023-09-22 Thread Luke Mewburn
Module Name:othersrc
Committed By:   lukem
Date:   Sat Sep 23 04:12:32 UTC 2023

Modified Files:
othersrc/libexec/tnftpd: configure.ac

Log Message:
configure: enable AC_USE_SYSTEM_EXTENSIONS()

We use various POSIX extensions, so enable them.


To generate a diff of this commit:
cvs rdiff -u -r1.49 -r1.50 othersrc/libexec/tnftpd/configure.ac

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/configure.ac
diff -u othersrc/libexec/tnftpd/configure.ac:1.49 othersrc/libexec/tnftpd/configure.ac:1.50
--- othersrc/libexec/tnftpd/configure.ac:1.49	Sat Sep 23 04:05:57 2023
+++ othersrc/libexec/tnftpd/configure.ac	Sat Sep 23 04:12:32 2023
@@ -1,4 +1,4 @@
-# $NetBSD: configure.ac,v 1.49 2023/09/23 04:05:57 lukem Exp $
+# $NetBSD: configure.ac,v 1.50 2023/09/23 04:12:32 lukem Exp $
 #
 # Process this file with autoconf to produce a configure script.
 
@@ -18,6 +18,8 @@ AC_CONFIG_MACRO_DIR([buildaux])
 AC_CONFIG_HEADERS([tnftpd_config.h])
 AC_CONFIG_LIBOBJ_DIR([libnetbsd])
 
+AC_USE_SYSTEM_EXTENSIONS()
+
 AM_INIT_AUTOMAKE([-Wall -Werror foreign nostdinc silent-rules])
 AM_MAINTAINER_MODE()
 AM_PROG_AR()



CVS commit: othersrc/libexec/tnftpd

2023-09-22 Thread Luke Mewburn
Module Name:othersrc
Committed By:   lukem
Date:   Sat Sep 23 04:12:32 UTC 2023

Modified Files:
othersrc/libexec/tnftpd: configure.ac

Log Message:
configure: enable AC_USE_SYSTEM_EXTENSIONS()

We use various POSIX extensions, so enable them.


To generate a diff of this commit:
cvs rdiff -u -r1.49 -r1.50 othersrc/libexec/tnftpd/configure.ac

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



CVS commit: othersrc/libexec/tnftpd

2023-09-22 Thread Luke Mewburn
Module Name:othersrc
Committed By:   lukem
Date:   Sat Sep 23 04:05:57 UTC 2023

Modified Files:
othersrc/libexec/tnftpd: configure.ac

Log Message:
configure: use --option-name in feature display

Use the appropriate option name in the feature display.
Sort the options.


To generate a diff of this commit:
cvs rdiff -u -r1.48 -r1.49 othersrc/libexec/tnftpd/configure.ac

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



CVS commit: othersrc/libexec/tnftpd

2023-09-22 Thread Luke Mewburn
Module Name:othersrc
Committed By:   lukem
Date:   Sat Sep 23 04:05:57 UTC 2023

Modified Files:
othersrc/libexec/tnftpd: configure.ac

Log Message:
configure: use --option-name in feature display

Use the appropriate option name in the feature display.
Sort the options.


To generate a diff of this commit:
cvs rdiff -u -r1.48 -r1.49 othersrc/libexec/tnftpd/configure.ac

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/configure.ac
diff -u othersrc/libexec/tnftpd/configure.ac:1.48 othersrc/libexec/tnftpd/configure.ac:1.49
--- othersrc/libexec/tnftpd/configure.ac:1.48	Sat Sep 23 04:00:21 2023
+++ othersrc/libexec/tnftpd/configure.ac	Sat Sep 23 04:05:57 2023
@@ -1,4 +1,4 @@
-# $NetBSD: configure.ac,v 1.48 2023/09/23 04:00:21 lukem Exp $
+# $NetBSD: configure.ac,v 1.49 2023/09/23 04:05:57 lukem Exp $
 #
 # Process this file with autoconf to produce a configure script.
 
@@ -495,10 +495,10 @@ AC_OUTPUT()
 AC_MSG_NOTICE([ === Configuration results ===])
 AC_MSG_NOTICE([Package:   $PACKAGE_STRING])
 AC_MSG_NOTICE([Prefix:$prefix])
-AC_MSG_NOTICE([IPv6 support:  $opt_ipv6])
-AC_MSG_NOTICE([Built-in /bin/ls:  $opt_builtinls])
-AC_MSG_NOTICE([blocklist support: $with_blocklist])
-AC_MSG_NOTICE([PAM authentication:$with_pam])
-AC_MSG_NOTICE([SIA authentication:$with_sia])
-AC_MSG_NOTICE([S/Key authentication:  $with_skey])
+AC_MSG_NOTICE([--enable-builtinls $opt_builtinls])
+AC_MSG_NOTICE([--enable-ipv6  $opt_ipv6])
+AC_MSG_NOTICE([--with-blocklist   $with_blocklist])
+AC_MSG_NOTICE([--with-pam $with_pam])
+AC_MSG_NOTICE([--with-sia $with_sia])
+AC_MSG_NOTICE([--with-skey$with_skey])
 AC_MSG_NOTICE([ =])



CVS commit: othersrc/libexec/tnftpd

2023-09-22 Thread Luke Mewburn
Module Name:othersrc
Committed By:   lukem
Date:   Sat Sep 23 04:00:21 UTC 2023

Modified Files:
othersrc/libexec/tnftpd: configure.ac tnftpd.h
othersrc/libexec/tnftpd/libnetbsd: err.c
othersrc/libexec/tnftpd/src: ftpd.c
Added Files:
othersrc/libexec/tnftpd/libnetbsd: setprogname.c

Log Message:
adapt __progname to setprogname() / getprogname()

Import setprogname() and getprogname() from
othersrc/usr.bin/tnftp/libnetbsd/setprogname.c rev 1.4.

Use getprogname() instead of __progname.

Fixes link error on modern NetBSD which correctly complained
about duplicate definition of __progname.


To generate a diff of this commit:
cvs rdiff -u -r1.47 -r1.48 othersrc/libexec/tnftpd/configure.ac
cvs rdiff -u -r1.38 -r1.39 othersrc/libexec/tnftpd/tnftpd.h
cvs rdiff -u -r1.5 -r1.6 othersrc/libexec/tnftpd/libnetbsd/err.c
cvs rdiff -u -r0 -r1.1 othersrc/libexec/tnftpd/libnetbsd/setprogname.c
cvs rdiff -u -r1.37 -r1.38 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/configure.ac
diff -u othersrc/libexec/tnftpd/configure.ac:1.47 othersrc/libexec/tnftpd/configure.ac:1.48
--- othersrc/libexec/tnftpd/configure.ac:1.47	Sat Sep 23 03:26:02 2023
+++ othersrc/libexec/tnftpd/configure.ac	Sat Sep 23 04:00:21 2023
@@ -1,4 +1,4 @@
-# $NetBSD: configure.ac,v 1.47 2023/09/23 03:26:02 lukem Exp $
+# $NetBSD: configure.ac,v 1.48 2023/09/23 04:00:21 lukem Exp $
 #
 # Process this file with autoconf to produce a configure script.
 
@@ -281,7 +281,7 @@ AC_FUNC_STRCOLL()
 AC_REPLACE_FUNCS([daemon err explicit_memset fgetln fparseln \
   getaddrinfo getgrouplist getnameinfo getusershell \
   inet_net_pton inet_ntop inet_pton mkstemp \
-  sl_init snprintf strdup strerror strsuftollx \
+  setprogname sl_init snprintf strdup strerror strsuftollx \
   strlcat strlcpy strsep usleep])
 AC_CHECK_FUNCS([dirfd getcwd gethostbyaddr gethostbyname gethostbyname2 \
 gethostname getrusage getspnam gettimeofday \

Index: othersrc/libexec/tnftpd/tnftpd.h
diff -u othersrc/libexec/tnftpd/tnftpd.h:1.38 othersrc/libexec/tnftpd/tnftpd.h:1.39
--- othersrc/libexec/tnftpd/tnftpd.h:1.38	Sat Sep 23 02:56:08 2023
+++ othersrc/libexec/tnftpd/tnftpd.h	Sat Sep 23 04:00:21 2023
@@ -1,4 +1,4 @@
-/* $NetBSD: tnftpd.h,v 1.38 2023/09/23 02:56:08 lukem Exp $ */
+/* $NetBSD: tnftpd.h,v 1.39 2023/09/23 04:00:21 lukem Exp $ */
 
 #define	FTPD_VERSION	PACKAGE_STRING
 
@@ -464,6 +464,11 @@ int	inet_pton(int, const char *, void *)
 int	mkstemp(const char *);
 #endif
 
+#if !defined(HAVE_SETPROGNAME)
+const char *getprogname(void);
+void	setprogname(const char *);
+#endif
+
 #if !defined(HAVE_SETEGID)
 # if defined(HAVE_SETRESGID)
 #  define setegid(i) setresgid(-1, (i), -1)

Index: othersrc/libexec/tnftpd/libnetbsd/err.c
diff -u othersrc/libexec/tnftpd/libnetbsd/err.c:1.5 othersrc/libexec/tnftpd/libnetbsd/err.c:1.6
--- othersrc/libexec/tnftpd/libnetbsd/err.c:1.5	Wed Jan 23 05:20:01 2019
+++ othersrc/libexec/tnftpd/libnetbsd/err.c	Sat Sep 23 04:00:21 2023
@@ -1,7 +1,10 @@
-/* $NetBSD: err.c,v 1.5 2019/01/23 05:20:01 lukem Exp $ */
+/* $NetBSD: err.c,v 1.6 2023/09/23 04:00:21 lukem Exp $ */
+
+/* from:	NetBSD: err.c,v 1.6 2020/07/05 09:54:26 lukem Exp */
+/* upstream:	othersrc/usr.bin/tnftp/libnetbsd/err.c */
 
 /*
- * Copyright 1997-2002 Luke Mewburn .
+ * Copyright 1997-2000,2020 Luke Mewburn .
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -27,8 +30,6 @@
 
 #include "tnftpd.h"
 
-extern char *__progname;
-
 void
 err(int eval, const char *fmt, ...)
 {
@@ -36,7 +37,7 @@ err(int eval, const char *fmt, ...)
 	int	sverrno;
 
 	sverrno = errno;
-	(void)fprintf(stderr, "%s: ", __progname);
+	(void)fprintf(stderr, "%s: ", getprogname());
 	va_start(ap, fmt);
 	if (fmt != NULL) {
 		(void)vfprintf(stderr, fmt, ap);
@@ -52,7 +53,7 @@ errx(int eval, const char *fmt, ...)
 {
 	va_list ap;
 
-	(void)fprintf(stderr, "%s: ", __progname);
+	(void)fprintf(stderr, "%s: ", getprogname());
 	va_start(ap, fmt);
 	if (fmt != NULL)
 		(void)vfprintf(stderr, fmt, ap);
@@ -68,7 +69,7 @@ warn(const char *fmt, ...)
 	int	sverrno;
 
 	sverrno = errno;
-	(void)fprintf(stderr, "%s: ", __progname);
+	(void)fprintf(stderr, "%s: ", getprogname());
 	va_start(ap, fmt);
 	if (fmt != NULL) {
 		(void)vfprintf(stderr, fmt, ap);
@@ -83,7 +84,7 @@ warnx(const char *fmt, ...)
 {
 	va_list ap;
 
-	(void)fprintf(stderr, "%s: ", __progname);
+	(void)fprintf(stderr, "%s: ", getprogname());
 	va_start(ap, fmt);
 	if (fmt != NULL)
 		(void)vfprintf(stderr, fmt, ap);

Index: othersrc/libexec/tnftpd/src/ftpd.c
diff -u othersrc/libexec/tnftpd/src/ftpd.c:1.37 othersrc/libexec/tnftpd/src/ftpd.c:1.38
--- othersrc/libexec/tnftpd/src/ftpd.c:1.37	Sat Jul  4 04:00:53 2020
+++ 

CVS commit: othersrc/libexec/tnftpd

2023-09-22 Thread Luke Mewburn
Module Name:othersrc
Committed By:   lukem
Date:   Sat Sep 23 04:00:21 UTC 2023

Modified Files:
othersrc/libexec/tnftpd: configure.ac tnftpd.h
othersrc/libexec/tnftpd/libnetbsd: err.c
othersrc/libexec/tnftpd/src: ftpd.c
Added Files:
othersrc/libexec/tnftpd/libnetbsd: setprogname.c

Log Message:
adapt __progname to setprogname() / getprogname()

Import setprogname() and getprogname() from
othersrc/usr.bin/tnftp/libnetbsd/setprogname.c rev 1.4.

Use getprogname() instead of __progname.

Fixes link error on modern NetBSD which correctly complained
about duplicate definition of __progname.


To generate a diff of this commit:
cvs rdiff -u -r1.47 -r1.48 othersrc/libexec/tnftpd/configure.ac
cvs rdiff -u -r1.38 -r1.39 othersrc/libexec/tnftpd/tnftpd.h
cvs rdiff -u -r1.5 -r1.6 othersrc/libexec/tnftpd/libnetbsd/err.c
cvs rdiff -u -r0 -r1.1 othersrc/libexec/tnftpd/libnetbsd/setprogname.c
cvs rdiff -u -r1.37 -r1.38 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.



CVS commit: othersrc/libexec/tnftpd/buildaux

2023-09-22 Thread Luke Mewburn
Module Name:othersrc
Committed By:   lukem
Date:   Sat Sep 23 03:33:32 UTC 2023

Added Files:
othersrc/libexec/tnftpd/buildaux: compile

Log Message:
regen with automake 1.16.1, libtool 2.4.6


To generate a diff of this commit:
cvs rdiff -u -r0 -r1.1 othersrc/libexec/tnftpd/buildaux/compile

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



CVS commit: othersrc/libexec/tnftpd/buildaux

2023-09-22 Thread Luke Mewburn
Module Name:othersrc
Committed By:   lukem
Date:   Sat Sep 23 03:33:32 UTC 2023

Added Files:
othersrc/libexec/tnftpd/buildaux: compile

Log Message:
regen with automake 1.16.1, libtool 2.4.6


To generate a diff of this commit:
cvs rdiff -u -r0 -r1.1 othersrc/libexec/tnftpd/buildaux/compile

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

Added files:

Index: othersrc/libexec/tnftpd/buildaux/compile
diff -u /dev/null othersrc/libexec/tnftpd/buildaux/compile:1.1
--- /dev/null	Sat Sep 23 03:33:32 2023
+++ othersrc/libexec/tnftpd/buildaux/compile	Sat Sep 23 03:33:32 2023
@@ -0,0 +1,348 @@
+#! /bin/sh
+# Wrapper for compilers which do not understand '-c -o'.
+
+scriptversion=2018-03-07.03; # UTC
+
+# Copyright (C) 1999-2018 Free Software Foundation, Inc.
+# Written by Tom Tromey .
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program.  If not, see .
+
+# As a special exception to the GNU General Public License, if you
+# distribute this file as part of a program that contains a
+# configuration script generated by Autoconf, you may include it under
+# the same distribution terms that you use for the rest of that program.
+
+# This file is maintained in Automake, please report
+# bugs to  or send patches to
+# .
+
+nl='
+'
+
+# We need space, tab and new line, in precisely that order.  Quoting is
+# there to prevent tools from complaining about whitespace usage.
+IFS=" ""	$nl"
+
+file_conv=
+
+# func_file_conv build_file lazy
+# Convert a $build file to $host form and store it in $file
+# Currently only supports Windows hosts. If the determined conversion
+# type is listed in (the comma separated) LAZY, no conversion will
+# take place.
+func_file_conv ()
+{
+  file=$1
+  case $file in
+/ | /[!/]*) # absolute file, and not a UNC file
+  if test -z "$file_conv"; then
+	# lazily determine how to convert abs files
+	case `uname -s` in
+	  MINGW*)
+	file_conv=mingw
+	;;
+	  CYGWIN*)
+	file_conv=cygwin
+	;;
+	  *)
+	file_conv=wine
+	;;
+	esac
+  fi
+  case $file_conv/,$2, in
+	*,$file_conv,*)
+	  ;;
+	mingw/*)
+	  file=`cmd //C echo "$file " | sed -e 's/"\(.*\) " *$/\1/'`
+	  ;;
+	cygwin/*)
+	  file=`cygpath -m "$file" || echo "$file"`
+	  ;;
+	wine/*)
+	  file=`winepath -w "$file" || echo "$file"`
+	  ;;
+  esac
+  ;;
+  esac
+}
+
+# func_cl_dashL linkdir
+# Make cl look for libraries in LINKDIR
+func_cl_dashL ()
+{
+  func_file_conv "$1"
+  if test -z "$lib_path"; then
+lib_path=$file
+  else
+lib_path="$lib_path;$file"
+  fi
+  linker_opts="$linker_opts -LIBPATH:$file"
+}
+
+# func_cl_dashl library
+# Do a library search-path lookup for cl
+func_cl_dashl ()
+{
+  lib=$1
+  found=no
+  save_IFS=$IFS
+  IFS=';'
+  for dir in $lib_path $LIB
+  do
+IFS=$save_IFS
+if $shared && test -f "$dir/$lib.dll.lib"; then
+  found=yes
+  lib=$dir/$lib.dll.lib
+  break
+fi
+if test -f "$dir/$lib.lib"; then
+  found=yes
+  lib=$dir/$lib.lib
+  break
+fi
+if test -f "$dir/lib$lib.a"; then
+  found=yes
+  lib=$dir/lib$lib.a
+  break
+fi
+  done
+  IFS=$save_IFS
+
+  if test "$found" != yes; then
+lib=$lib.lib
+  fi
+}
+
+# func_cl_wrapper cl arg...
+# Adjust compile command to suit cl
+func_cl_wrapper ()
+{
+  # Assume a capable shell
+  lib_path=
+  shared=:
+  linker_opts=
+  for arg
+  do
+if test -n "$eat"; then
+  eat=
+else
+  case $1 in
+	-o)
+	  # configure might choose to run compile as 'compile cc -o foo foo.c'.
+	  eat=1
+	  case $2 in
+	*.o | *.[oO][bB][jJ])
+	  func_file_conv "$2"
+	  set x "$@" -Fo"$file"
+	  shift
+	  ;;
+	*)
+	  func_file_conv "$2"
+	  set x "$@" -Fe"$file"
+	  shift
+	  ;;
+	  esac
+	  ;;
+	-I)
+	  eat=1
+	  func_file_conv "$2" mingw
+	  set x "$@" -I"$file"
+	  shift
+	  ;;
+	-I*)
+	  func_file_conv "${1#-I}" mingw
+	  set x "$@" -I"$file"
+	  shift
+	  ;;
+	-l)
+	  eat=1
+	  func_cl_dashl "$2"
+	  set x "$@" "$lib"
+	  shift
+	  ;;
+	-l*)
+	  func_cl_dashl "${1#-l}"
+	  set x "$@" "$lib"
+	  shift
+	  ;;
+	-L)
+	  eat=1
+	  func_cl_dashL "$2"
+	  ;;
+	-L*)
+	  func_cl_dashL "${1#-L}"
+	  ;;
+	-static)
+	  shared=false
+	  ;;
+	-Wl,*)
+	  arg=${1#-Wl,}
+	  save_ifs="$IFS"; IFS=','
+	  for flag in $arg; do
+	IFS="$save_ifs"
+	linker_opts="$linker_opts $flag"
+	  done
+	  

CVS commit: othersrc/libexec/tnftpd

2023-09-22 Thread Luke Mewburn
Module Name:othersrc
Committed By:   lukem
Date:   Sat Sep 23 03:32:42 UTC 2023

Modified Files:
othersrc/libexec/tnftpd: Makefile.in aclocal.m4 configure
tnftpd_config.h.in
othersrc/libexec/tnftpd/buildaux: ar-lib config.guess config.sub
depcomp install-sh libtool.m4 ltmain.sh ltoptions.m4 ltsugar.m4
ltversion.m4 lt~obsolete.m4 missing ylwrap
othersrc/libexec/tnftpd/examples: Makefile.in
othersrc/libexec/tnftpd/libnetbsd: Makefile.in
othersrc/libexec/tnftpd/ls: Makefile.in
othersrc/libexec/tnftpd/src: Makefile.in

Log Message:
regen with automake 1.16.1, libtool 2.4.6


To generate a diff of this commit:
cvs rdiff -u -r1.12 -r1.13 othersrc/libexec/tnftpd/Makefile.in
cvs rdiff -u -r1.9 -r1.10 othersrc/libexec/tnftpd/aclocal.m4
cvs rdiff -u -r1.52 -r1.53 othersrc/libexec/tnftpd/configure
cvs rdiff -u -r1.6 -r1.7 othersrc/libexec/tnftpd/tnftpd_config.h.in
cvs rdiff -u -r1.1 -r1.2 othersrc/libexec/tnftpd/buildaux/ar-lib \
othersrc/libexec/tnftpd/buildaux/libtool.m4 \
othersrc/libexec/tnftpd/buildaux/ltoptions.m4 \
othersrc/libexec/tnftpd/buildaux/ltsugar.m4 \
othersrc/libexec/tnftpd/buildaux/ltversion.m4 \
othersrc/libexec/tnftpd/buildaux/lt~obsolete.m4
cvs rdiff -u -r1.4 -r1.5 othersrc/libexec/tnftpd/buildaux/config.guess \
othersrc/libexec/tnftpd/buildaux/config.sub \
othersrc/libexec/tnftpd/buildaux/ltmain.sh
cvs rdiff -u -r1.2 -r1.3 othersrc/libexec/tnftpd/buildaux/depcomp \
othersrc/libexec/tnftpd/buildaux/missing \
othersrc/libexec/tnftpd/buildaux/ylwrap
cvs rdiff -u -r1.6 -r1.7 othersrc/libexec/tnftpd/buildaux/install-sh
cvs rdiff -u -r1.5 -r1.6 othersrc/libexec/tnftpd/examples/Makefile.in
cvs rdiff -u -r1.9 -r1.10 othersrc/libexec/tnftpd/libnetbsd/Makefile.in
cvs rdiff -u -r1.7 -r1.8 othersrc/libexec/tnftpd/ls/Makefile.in
cvs rdiff -u -r1.16 -r1.17 othersrc/libexec/tnftpd/src/Makefile.in

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



CVS commit: othersrc/libexec/tnftpd

2023-09-22 Thread Luke Mewburn
Module Name:othersrc
Committed By:   lukem
Date:   Sat Sep 23 03:32:42 UTC 2023

Modified Files:
othersrc/libexec/tnftpd: Makefile.in aclocal.m4 configure
tnftpd_config.h.in
othersrc/libexec/tnftpd/buildaux: ar-lib config.guess config.sub
depcomp install-sh libtool.m4 ltmain.sh ltoptions.m4 ltsugar.m4
ltversion.m4 lt~obsolete.m4 missing ylwrap
othersrc/libexec/tnftpd/examples: Makefile.in
othersrc/libexec/tnftpd/libnetbsd: Makefile.in
othersrc/libexec/tnftpd/ls: Makefile.in
othersrc/libexec/tnftpd/src: Makefile.in

Log Message:
regen with automake 1.16.1, libtool 2.4.6


To generate a diff of this commit:
cvs rdiff -u -r1.12 -r1.13 othersrc/libexec/tnftpd/Makefile.in
cvs rdiff -u -r1.9 -r1.10 othersrc/libexec/tnftpd/aclocal.m4
cvs rdiff -u -r1.52 -r1.53 othersrc/libexec/tnftpd/configure
cvs rdiff -u -r1.6 -r1.7 othersrc/libexec/tnftpd/tnftpd_config.h.in
cvs rdiff -u -r1.1 -r1.2 othersrc/libexec/tnftpd/buildaux/ar-lib \
othersrc/libexec/tnftpd/buildaux/libtool.m4 \
othersrc/libexec/tnftpd/buildaux/ltoptions.m4 \
othersrc/libexec/tnftpd/buildaux/ltsugar.m4 \
othersrc/libexec/tnftpd/buildaux/ltversion.m4 \
othersrc/libexec/tnftpd/buildaux/lt~obsolete.m4
cvs rdiff -u -r1.4 -r1.5 othersrc/libexec/tnftpd/buildaux/config.guess \
othersrc/libexec/tnftpd/buildaux/config.sub \
othersrc/libexec/tnftpd/buildaux/ltmain.sh
cvs rdiff -u -r1.2 -r1.3 othersrc/libexec/tnftpd/buildaux/depcomp \
othersrc/libexec/tnftpd/buildaux/missing \
othersrc/libexec/tnftpd/buildaux/ylwrap
cvs rdiff -u -r1.6 -r1.7 othersrc/libexec/tnftpd/buildaux/install-sh
cvs rdiff -u -r1.5 -r1.6 othersrc/libexec/tnftpd/examples/Makefile.in
cvs rdiff -u -r1.9 -r1.10 othersrc/libexec/tnftpd/libnetbsd/Makefile.in
cvs rdiff -u -r1.7 -r1.8 othersrc/libexec/tnftpd/ls/Makefile.in
cvs rdiff -u -r1.16 -r1.17 othersrc/libexec/tnftpd/src/Makefile.in

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

diffs are larger than 1MB and have been omitted


CVS commit: othersrc/libexec/tnftpd

2023-09-22 Thread Luke Mewburn
Module Name:othersrc
Committed By:   lukem
Date:   Sat Sep 23 03:26:02 UTC 2023

Modified Files:
othersrc/libexec/tnftpd: configure.ac

Log Message:
configure.ac: deprecate AC_REVISION

Allows regen as part of the release commit / tag


To generate a diff of this commit:
cvs rdiff -u -r1.46 -r1.47 othersrc/libexec/tnftpd/configure.ac

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/configure.ac
diff -u othersrc/libexec/tnftpd/configure.ac:1.46 othersrc/libexec/tnftpd/configure.ac:1.47
--- othersrc/libexec/tnftpd/configure.ac:1.46	Sat Jul  4 06:49:19 2020
+++ othersrc/libexec/tnftpd/configure.ac	Sat Sep 23 03:26:02 2023
@@ -1,4 +1,4 @@
-# $NetBSD: configure.ac,v 1.46 2020/07/04 06:49:19 lukem Exp $
+# $NetBSD: configure.ac,v 1.47 2023/09/23 03:26:02 lukem Exp $
 #
 # Process this file with autoconf to produce a configure script.
 
@@ -6,10 +6,9 @@ AC_INIT([tnftpd], [20200704], [lukem@Net
 AC_PREREQ([2.69])
 
 AC_COPYRIGHT([
-Copyright (c) 2001-2020 The NetBSD Foundation, Inc.
+Copyright (c) 2001-2023 The NetBSD Foundation, Inc.
 All rights reserved.
 ])
-AC_REVISION([$Revision: 1.46 $])
 
 AS_SHELL_SANITIZE()
 



CVS commit: othersrc/libexec/tnftpd

2023-09-22 Thread Luke Mewburn
Module Name:othersrc
Committed By:   lukem
Date:   Sat Sep 23 03:26:02 UTC 2023

Modified Files:
othersrc/libexec/tnftpd: configure.ac

Log Message:
configure.ac: deprecate AC_REVISION

Allows regen as part of the release commit / tag


To generate a diff of this commit:
cvs rdiff -u -r1.46 -r1.47 othersrc/libexec/tnftpd/configure.ac

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



CVS commit: othersrc/libexec/tnftpd

2023-09-22 Thread Luke Mewburn
Module Name:othersrc
Committed By:   lukem
Date:   Sat Sep 23 02:56:09 UTC 2023

Modified Files:
othersrc/libexec/tnftpd: tnftpd.h
othersrc/libexec/tnftpd/libnetbsd: sl_init.c

Log Message:
sync lib/libc/gen/stringlist.c 1.13

Functional changes since upstream 1.8:
- 1.11: Add sl_delete. Change sl_find() to use const char * argument.
- 1.10: Don't update the size of allocated storage until realloc successes.

Note: not updating to upstream 1.15 because that was a refactor to
use reallocarr() which I'm deferring for now.

Comment out other unneeded upstream code to minimise differences.

Update sl_find() and sl_delete() declarations in tnftpd.h
per include/stringlist.h rev 1.6.


To generate a diff of this commit:
cvs rdiff -u -r1.37 -r1.38 othersrc/libexec/tnftpd/tnftpd.h
cvs rdiff -u -r1.3 -r1.4 othersrc/libexec/tnftpd/libnetbsd/sl_init.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/tnftpd.h
diff -u othersrc/libexec/tnftpd/tnftpd.h:1.37 othersrc/libexec/tnftpd/tnftpd.h:1.38
--- othersrc/libexec/tnftpd/tnftpd.h:1.37	Tue Jan 29 13:06:14 2019
+++ othersrc/libexec/tnftpd/tnftpd.h	Sat Sep 23 02:56:08 2023
@@ -1,4 +1,4 @@
-/* $NetBSD: tnftpd.h,v 1.37 2019/01/29 13:06:14 lukem Exp $ */
+/* $NetBSD: tnftpd.h,v 1.38 2023/09/23 02:56:08 lukem Exp $ */
 
 #define	FTPD_VERSION	PACKAGE_STRING
 
@@ -224,10 +224,11 @@ typedef struct _stringlist {
 	size_t	  sl_cur;
 } StringList;
 
-StringList *sl_init(void);
-int	 sl_add(StringList *, char *);
-void	 sl_free(StringList *, int);
-char	*sl_find(StringList *, char *);
+StringList 	*sl_init(void);
+int		 sl_add(StringList *, char *);
+void		 sl_free(StringList *, int);
+char 		*sl_find(StringList *, const char *);
+int		 sl_delete(StringList *, const char *, int);
 
 #if !defined(NO_INTERNAL_LS)
 

Index: othersrc/libexec/tnftpd/libnetbsd/sl_init.c
diff -u othersrc/libexec/tnftpd/libnetbsd/sl_init.c:1.3 othersrc/libexec/tnftpd/libnetbsd/sl_init.c:1.4
--- othersrc/libexec/tnftpd/libnetbsd/sl_init.c:1.3	Sun Sep 21 16:35:25 2008
+++ othersrc/libexec/tnftpd/libnetbsd/sl_init.c	Sat Sep 23 02:56:08 2023
@@ -1,5 +1,7 @@
-/* $NetBSD: sl_init.c,v 1.3 2008/09/21 16:35:25 lukem Exp $ */
-/* from	NetBSD: stringlist.c,v 1.8 1999/11/28 03:44:09 lukem Exp */
+/* $NetBSD: sl_init.c,v 1.4 2023/09/23 02:56:08 lukem Exp $ */
+
+/* from:	NetBSD: stringlist.c,v 1.13 2008/04/28 20:22:59 martin Exp */
+/* upstream:	lib/libc/gen/stringlist.c */
 
 /*-
  * Copyright (c) 1994, 1999 The NetBSD Foundation, Inc.
@@ -32,6 +34,30 @@
 
 #include "tnftpd.h"
 
+#if 0
+#include 
+#if defined(LIBC_SCCS) && !defined(lint)
+__RCSID("$NetBSD: sl_init.c,v 1.4 2023/09/23 02:56:08 lukem Exp $");
+#endif /* LIBC_SCCS and not lint */
+
+#include "namespace.h"
+
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+
+#ifdef __weak_alias
+__weak_alias(sl_add,_sl_add)
+__weak_alias(sl_find,_sl_find)
+__weak_alias(sl_free,_sl_free)
+__weak_alias(sl_init,_sl_init)
+__weak_alias(sl_delete,_sl_delete)
+#endif
+#endif
+
 #define _SL_CHUNKSIZE	20
 
 /*
@@ -44,7 +70,7 @@ sl_init(void)
 
 	sl = malloc(sizeof(StringList));
 	if (sl == NULL)
-		return (NULL);
+		return NULL;
 
 	sl->sl_cur = 0;
 	sl->sl_max = _SL_CHUNKSIZE;
@@ -53,7 +79,7 @@ sl_init(void)
 		free(sl);
 		sl = NULL;
 	}
-	return (sl);
+	return sl;
 }
 
 
@@ -63,17 +89,21 @@ sl_init(void)
 int
 sl_add(StringList *sl, char *name)
 {
+
+	_DIAGASSERT(sl != NULL);
+
 	if (sl->sl_cur == sl->sl_max - 1) {
 		char	**new;
 
-		sl->sl_max += _SL_CHUNKSIZE;
-		new = (char **)realloc(sl->sl_str, sl->sl_max * sizeof(char *));
+		new = realloc(sl->sl_str,
+		(sl->sl_max + _SL_CHUNKSIZE) * sizeof(char *));
 		if (new == NULL)
-			return (-1);
+			return -1;
+		sl->sl_max += _SL_CHUNKSIZE;
 		sl->sl_str = new;
 	}
 	sl->sl_str[sl->sl_cur++] = name;
-	return (0);
+	return 0;
 }
 
 
@@ -101,13 +131,33 @@ sl_free(StringList *sl, int all)
  * sl_find(): Find a name in the string list
  */
 char *
-sl_find(StringList *sl, char *name)
+sl_find(StringList *sl, const char *name)
 {
 	size_t i;
 
+	_DIAGASSERT(sl != NULL);
+
 	for (i = 0; i < sl->sl_cur; i++)
 		if (strcmp(sl->sl_str[i], name) == 0)
 			return sl->sl_str[i];
 
-	return (NULL);
+	return NULL;
 }
+
+int
+sl_delete(StringList *sl, const char *name, int all)
+{
+	size_t i, j;
+
+	for (i = 0; i < sl->sl_cur; i++)
+		if (strcmp(sl->sl_str[i], name) == 0) {
+			if (all)
+free(sl->sl_str[i]);
+			for (j = i + 1; j < sl->sl_cur; j++)
+sl->sl_str[j - 1] = sl->sl_str[j];
+			sl->sl_str[--sl->sl_cur] = NULL;
+			return 0;
+		}
+	return -1;
+}
+



CVS commit: othersrc/libexec/tnftpd

2023-09-22 Thread Luke Mewburn
Module Name:othersrc
Committed By:   lukem
Date:   Sat Sep 23 02:56:09 UTC 2023

Modified Files:
othersrc/libexec/tnftpd: tnftpd.h
othersrc/libexec/tnftpd/libnetbsd: sl_init.c

Log Message:
sync lib/libc/gen/stringlist.c 1.13

Functional changes since upstream 1.8:
- 1.11: Add sl_delete. Change sl_find() to use const char * argument.
- 1.10: Don't update the size of allocated storage until realloc successes.

Note: not updating to upstream 1.15 because that was a refactor to
use reallocarr() which I'm deferring for now.

Comment out other unneeded upstream code to minimise differences.

Update sl_find() and sl_delete() declarations in tnftpd.h
per include/stringlist.h rev 1.6.


To generate a diff of this commit:
cvs rdiff -u -r1.37 -r1.38 othersrc/libexec/tnftpd/tnftpd.h
cvs rdiff -u -r1.3 -r1.4 othersrc/libexec/tnftpd/libnetbsd/sl_init.c

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



CVS commit: othersrc/libexec/tnftpd/libnetbsd

2023-09-22 Thread Luke Mewburn
Module Name:othersrc
Committed By:   lukem
Date:   Sat Sep 23 02:30:54 UTC 2023

Modified Files:
othersrc/libexec/tnftpd/libnetbsd: inet_pton.c

Log Message:
sync lib/libc/inet/inet_pton.c 1.8

Functional changes since upstream 1.3:
- 1.8: fix lint issues
- 1.4: hex formatting change from bind 9.4.0

Retain tnftpd local changes:
- 1.3: don't use non-standard u_char u_int u_int32_t
- 1.1: only enable IPv6 ifdef INET6.

Comment out other unneeded upstream code to minimise differences.


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 othersrc/libexec/tnftpd/libnetbsd/inet_pton.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/libnetbsd/inet_pton.c
diff -u othersrc/libexec/tnftpd/libnetbsd/inet_pton.c:1.4 othersrc/libexec/tnftpd/libnetbsd/inet_pton.c:1.5
--- othersrc/libexec/tnftpd/libnetbsd/inet_pton.c:1.4	Sun Sep 21 16:35:25 2008
+++ othersrc/libexec/tnftpd/libnetbsd/inet_pton.c	Sat Sep 23 02:30:54 2023
@@ -1,5 +1,7 @@
-/* $NetBSD: inet_pton.c,v 1.4 2008/09/21 16:35:25 lukem Exp $ */
-/* from	NetBSD: inet_pton.c,v 1.3 2006/09/26 05:59:18 lukem Exp */
+/* $NetBSD: inet_pton.c,v 1.5 2023/09/23 02:30:54 lukem Exp $ */
+
+/* from:	NetBSD: inet_pton.c,v 1.8 2012/03/13 21:13:38 christos Exp */
+/* upstream:	lib/libc/inet/inet_pton.c */
 
 /*
  * Copyright (c) 2004 by Internet Systems Consortium, Inc. ("ISC")
@@ -20,7 +22,39 @@
 
 #include "tnftpd.h"
 
-/*
+#if 0
+#include 
+#if defined(LIBC_SCCS) && !defined(lint)
+#if 0
+static const char rcsid[] = "Id: inet_pton.c,v 1.5 2005/07/28 06:51:47 marka Exp";
+#else
+__RCSID("$NetBSD: inet_pton.c,v 1.5 2023/09/23 02:30:54 lukem Exp $");
+#endif
+#endif /* LIBC_SCCS and not lint */
+
+#include "port_before.h"
+
+#include "namespace.h"
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+
+#include "port_after.h"
+
+#ifdef __weak_alias
+__weak_alias(inet_pton,_inet_pton)
+#endif
+#endif
+
+/*%
  * WARNING: Don't even consider trying to compile this on a system where
  * sizeof(int) < 4.  sizeof(int) > 4 is fine; all the world's not a VAX.
  */
@@ -45,6 +79,9 @@ int
 inet_pton(int af, const char *src, void *dst)
 {
 
+	_DIAGASSERT(src != NULL);
+	_DIAGASSERT(dst != NULL);
+
 	switch (af) {
 	case AF_INET:
 		return (inet_pton4(src, dst, 1));
@@ -75,10 +112,13 @@ inet_pton4(const char *src, unsigned cha
 {
 	uint32_t val;
 	unsigned int digit, base;
-	int n;
+	ptrdiff_t n;
 	unsigned char c;
 	unsigned int parts[4];
-	register unsigned int *pp = parts;
+	unsigned int *pp = parts;
+
+	_DIAGASSERT(src != NULL);
+	_DIAGASSERT(dst != NULL);
 
 	c = *src;
 	for (;;) {
@@ -198,9 +238,12 @@ inet_pton6(const char *src, unsigned cha
 			  xdigits_u[] = "0123456789ABCDEF";
 	unsigned char tmp[NS_IN6ADDRSZ], *tp, *endp, *colonp;
 	const char *xdigits, *curtok;
-	int ch, saw_xdigit;
+	int ch, seen_xdigits;
 	unsigned int val;
 
+	_DIAGASSERT(src != NULL);
+	_DIAGASSERT(dst != NULL);
+
 	memset((tp = tmp), '\0', NS_IN6ADDRSZ);
 	endp = tp + NS_IN6ADDRSZ;
 	colonp = NULL;
@@ -209,7 +252,7 @@ inet_pton6(const char *src, unsigned cha
 		if (*++src != ':')
 			return (0);
 	curtok = src;
-	saw_xdigit = 0;
+	seen_xdigits = 0;
 	val = 0;
 	while ((ch = *src++) != '\0') {
 		const char *pch;
@@ -218,15 +261,14 @@ inet_pton6(const char *src, unsigned cha
 			pch = strchr((xdigits = xdigits_u), ch);
 		if (pch != NULL) {
 			val <<= 4;
-			val |= (pch - xdigits);
-			if (val > 0x)
+			val |= (int)(pch - xdigits);
+			if (++seen_xdigits > 4)
 return (0);
-			saw_xdigit = 1;
 			continue;
 		}
 		if (ch == ':') {
 			curtok = src;
-			if (!saw_xdigit) {
+			if (!seen_xdigits) {
 if (colonp)
 	return (0);
 colonp = tp;
@@ -237,19 +279,19 @@ inet_pton6(const char *src, unsigned cha
 return (0);
 			*tp++ = (unsigned char) (val >> 8) & 0xff;
 			*tp++ = (unsigned char) val & 0xff;
-			saw_xdigit = 0;
+			seen_xdigits = 0;
 			val = 0;
 			continue;
 		}
 		if (ch == '.' && ((tp + NS_INADDRSZ) <= endp) &&
 		inet_pton4(curtok, tp, 1) > 0) {
 			tp += NS_INADDRSZ;
-			saw_xdigit = 0;
-			break;	/* '\0' was seen by inet_pton4(). */
+			seen_xdigits = 0;
+			break;	/*%< '\\0' was seen by inet_pton4(). */
 		}
 		return (0);
 	}
-	if (saw_xdigit) {
+	if (seen_xdigits) {
 		if (tp + NS_INT16SZ > endp)
 			return (0);
 		*tp++ = (unsigned char) (val >> 8) & 0xff;
@@ -260,7 +302,7 @@ inet_pton6(const char *src, unsigned cha
 		 * Since some memmove()'s erroneously fail to handle
 		 * overlapping regions, we'll do the shift by hand.
 		 */
-		const int n = tp - colonp;
+		const ptrdiff_t n = tp - colonp;
 		int i;
 
 		if (tp == endp)
@@ -277,3 +319,5 @@ inet_pton6(const char *src, unsigned cha
 	return (1);
 }
 #endif /* INET6 */
+
+/*! \file */



CVS commit: othersrc/libexec/tnftpd/libnetbsd

2023-09-22 Thread Luke Mewburn
Module Name:othersrc
Committed By:   lukem
Date:   Sat Sep 23 02:30:54 UTC 2023

Modified Files:
othersrc/libexec/tnftpd/libnetbsd: inet_pton.c

Log Message:
sync lib/libc/inet/inet_pton.c 1.8

Functional changes since upstream 1.3:
- 1.8: fix lint issues
- 1.4: hex formatting change from bind 9.4.0

Retain tnftpd local changes:
- 1.3: don't use non-standard u_char u_int u_int32_t
- 1.1: only enable IPv6 ifdef INET6.

Comment out other unneeded upstream code to minimise differences.


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 othersrc/libexec/tnftpd/libnetbsd/inet_pton.c

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



CVS commit: othersrc/libexec/tnftpd/libnetbsd

2023-09-22 Thread Luke Mewburn
Module Name:othersrc
Committed By:   lukem
Date:   Sat Sep 23 02:20:39 UTC 2023

Modified Files:
othersrc/libexec/tnftpd/libnetbsd: inet_ntop.c

Log Message:
sync lib/libc/inet/inet_ntop.c 1.12

Functional changes since upstream 1.3:
- 1.10, 1.12: always set errno when returning NULL

Retain tnftpd local changes:
- 1.3: don't use non-standard u_char u_int
- 1.1: only enable IPv6 ifdef INET6.

Comment out other unneeded upstream code to minimise differences.


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 othersrc/libexec/tnftpd/libnetbsd/inet_ntop.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/libnetbsd/inet_ntop.c
diff -u othersrc/libexec/tnftpd/libnetbsd/inet_ntop.c:1.4 othersrc/libexec/tnftpd/libnetbsd/inet_ntop.c:1.5
--- othersrc/libexec/tnftpd/libnetbsd/inet_ntop.c:1.4	Sun Sep 21 16:35:25 2008
+++ othersrc/libexec/tnftpd/libnetbsd/inet_ntop.c	Sat Sep 23 02:20:39 2023
@@ -1,5 +1,7 @@
-/* $NetBSD: inet_ntop.c,v 1.4 2008/09/21 16:35:25 lukem Exp $ */
-/* from	NetBSD: inet_ntop.c,v 1.3 2006/05/10 21:53:15 mrg Exp */
+/* $NetBSD: inet_ntop.c,v 1.5 2023/09/23 02:20:39 lukem Exp $ */
+
+/* from:	NetBSD: inet_ntop.c,v 1.12 2018/03/02 06:31:53 lukem Exp */
+/* upstream:	lib/libc/inet/inet_ntop.c */
 
 /*
  * Copyright (c) 2004 by Internet Systems Consortium, Inc. ("ISC")
@@ -20,7 +22,41 @@
 
 #include "tnftpd.h"
 
-/*
+#if 0
+#include 
+#if defined(LIBC_SCCS) && !defined(lint)
+#if 0
+static const char rcsid[] = "Id: inet_ntop.c,v 1.5 2005/11/03 22:59:52 marka Exp";
+#else
+__RCSID("$NetBSD: inet_ntop.c,v 1.5 2023/09/23 02:20:39 lukem Exp $");
+#endif
+#endif /* LIBC_SCCS and not lint */
+
+#include "port_before.h"
+
+#include "namespace.h"
+#include 
+#include 
+#include 
+
+#include 
+#include 
+#include 
+
+#include 
+#include 
+#include 
+#include 
+#include 
+
+#include "port_after.h"
+
+#ifdef __weak_alias
+__weak_alias(inet_ntop,_inet_ntop)
+#endif
+#endif
+
+/*%
  * WARNING: Don't even consider trying to compile this on a system where
  * sizeof(int) < 4.  sizeof(int) > 4 is fine; all the world's not a VAX.
  */
@@ -42,16 +78,19 @@ const char *
 inet_ntop(int af, const void *src, char *dst, socklen_t size)
 {
 
+	_DIAGASSERT(src != NULL);
+	_DIAGASSERT(dst != NULL);
+
 	switch (af) {
 	case AF_INET:
-		return (inet_ntop4(src, dst, size));
+		return inet_ntop4(src, dst, size);
 #ifdef INET6
 	case AF_INET6:
-		return (inet_ntop6(src, dst, size));
+		return inet_ntop6(src, dst, size);
 #endif /* INET6 */
 	default:
 		errno = EAFNOSUPPORT;
-		return (NULL);
+		return NULL;
 	}
 	/* NOTREACHED */
 }
@@ -73,14 +112,17 @@ inet_ntop4(const unsigned char *src, cha
 	char tmp[sizeof "255.255.255.255"];
 	int l;
 
+	_DIAGASSERT(src != NULL);
+	_DIAGASSERT(dst != NULL);
+
 	l = snprintf(tmp, sizeof(tmp), "%u.%u.%u.%u",
 	src[0], src[1], src[2], src[3]);
 	if (l <= 0 || (socklen_t) l >= size) {
 		errno = ENOSPC;
-		return (NULL);
+		return NULL;
 	}
 	strlcpy(dst, tmp, size);
-	return (dst);
+	return dst;
 }
 
 #ifdef INET6
@@ -107,6 +149,9 @@ inet_ntop6(const unsigned char *src, cha
 	int i;
 	int advance;
 
+	_DIAGASSERT(src != NULL);
+	_DIAGASSERT(dst != NULL);
+
 	/*
 	 * Preprocess:
 	 *	Copy the input (bytewise) array into a wordwise array.
@@ -116,9 +161,9 @@ inet_ntop6(const unsigned char *src, cha
 	for (i = 0; i < NS_IN6ADDRSZ; i++)
 		words[i / 2] |= (src[i] << ((1 - (i % 2)) << 3));
 	best.base = -1;
+	best.len = 0;
 	cur.base = -1;
-	best.len = -1;	/* XXX gcc */
-	cur.len = -1;	/* XXX gcc */
+	cur.len = 0;
 	for (i = 0; i < (NS_IN6ADDRSZ / NS_INT16SZ); i++) {
 		if (words[i] == 0) {
 			if (cur.base == -1)
@@ -156,7 +201,7 @@ inet_ntop6(const unsigned char *src, cha
 		/* Are we following an initial run of 0x00s or any real hex? */
 		if (i != 0) {
 			if (tp + 1 >= ep)
-return (NULL);
+goto out;
 			*tp++ = ':';
 		}
 		/* Is this address an encapsulated IPv4? */
@@ -164,35 +209,38 @@ inet_ntop6(const unsigned char *src, cha
 		(best.len == 6 ||
 		(best.len == 7 && words[7] != 0x0001) ||
 		(best.len == 5 && words[5] == 0x))) {
-			if (!inet_ntop4(src+12, tp, (socklen_t)(ep - tp)))
-return (NULL);
+			if (!inet_ntop4(src + 12, tp, (socklen_t)(ep - tp)))
+goto out;
 			tp += strlen(tp);
 			break;
 		}
 		advance = snprintf(tp, (size_t)(ep - tp), "%x", words[i]);
 		if (advance <= 0 || advance >= ep - tp)
-			return (NULL);
+			goto out;
 		tp += advance;
 	}
 	/* Was it a trailing run of 0x00's? */
 	if (best.base != -1 && (best.base + best.len) == 
 	(NS_IN6ADDRSZ / NS_INT16SZ)) {
 		if (tp + 1 >= ep)
-			return (NULL);
+			goto out;
 		*tp++ = ':';
 	}
 	if (tp + 1 >= ep)
-		return (NULL);
+		goto out;
 	*tp++ = '\0';
 
 	/*
 	 * Check for overflow, copy, and we're done.
 	 */
-	if ((size_t)(tp - tmp) > size) {
-		errno = ENOSPC;
-		return (NULL);
-	}
+	if ((size_t)(tp - tmp) > size)
+		goto out;
 	

CVS commit: othersrc/libexec/tnftpd/libnetbsd

2023-09-22 Thread Luke Mewburn
Module Name:othersrc
Committed By:   lukem
Date:   Sat Sep 23 02:20:39 UTC 2023

Modified Files:
othersrc/libexec/tnftpd/libnetbsd: inet_ntop.c

Log Message:
sync lib/libc/inet/inet_ntop.c 1.12

Functional changes since upstream 1.3:
- 1.10, 1.12: always set errno when returning NULL

Retain tnftpd local changes:
- 1.3: don't use non-standard u_char u_int
- 1.1: only enable IPv6 ifdef INET6.

Comment out other unneeded upstream code to minimise differences.


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 othersrc/libexec/tnftpd/libnetbsd/inet_ntop.c

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



CVS commit: othersrc/libexec/tnftpd/libnetbsd

2023-09-22 Thread Luke Mewburn
Module Name:othersrc
Committed By:   lukem
Date:   Sat Sep 23 00:02:05 UTC 2023

Modified Files:
othersrc/libexec/tnftpd/libnetbsd: inet_net_pton.c

Log Message:
sync lib/libc/inet/inet_net_pton.c 1.5

Functional changes since upstream 1.1:
- 1.3: fix lint issues
- 1.2: Check bits on each loop to prevent integer oveflow.

Retain tnftpd local changes:
- 1.3: don't use non-standard u_char u_int
- 1.1: only enable IPv6 ifdef INET6.

Comment out other unneeded upstream code to minimise differences.


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 othersrc/libexec/tnftpd/libnetbsd/inet_net_pton.c

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



CVS commit: othersrc/libexec/tnftpd/libnetbsd

2023-09-22 Thread Luke Mewburn
Module Name:othersrc
Committed By:   lukem
Date:   Sat Sep 23 00:02:05 UTC 2023

Modified Files:
othersrc/libexec/tnftpd/libnetbsd: inet_net_pton.c

Log Message:
sync lib/libc/inet/inet_net_pton.c 1.5

Functional changes since upstream 1.1:
- 1.3: fix lint issues
- 1.2: Check bits on each loop to prevent integer oveflow.

Retain tnftpd local changes:
- 1.3: don't use non-standard u_char u_int
- 1.1: only enable IPv6 ifdef INET6.

Comment out other unneeded upstream code to minimise differences.


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 othersrc/libexec/tnftpd/libnetbsd/inet_net_pton.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/libnetbsd/inet_net_pton.c
diff -u othersrc/libexec/tnftpd/libnetbsd/inet_net_pton.c:1.4 othersrc/libexec/tnftpd/libnetbsd/inet_net_pton.c:1.5
--- othersrc/libexec/tnftpd/libnetbsd/inet_net_pton.c:1.4	Sun Sep 21 16:35:25 2008
+++ othersrc/libexec/tnftpd/libnetbsd/inet_net_pton.c	Sat Sep 23 00:02:05 2023
@@ -1,5 +1,7 @@
-/* $NetBSD: inet_net_pton.c,v 1.4 2008/09/21 16:35:25 lukem Exp $ */
-/* from	NetBSD: inet_net_pton.c,v 1.1 2004/05/20 23:13:02 christos Exp */
+/* $NetBSD: inet_net_pton.c,v 1.5 2023/09/23 00:02:05 lukem Exp $ */
+
+/* from:	NetBSD: inet_net_pton.c,v 1.5 2018/12/13 08:44:11 maya Exp */
+/* upstream:	lib/libc/inet/inet_net_pton.c */
 
 /*
  * Copyright (c) 1996,1999 by Internet Software Consortium.
@@ -19,14 +21,42 @@
  */
 
 #include "tnftpd.h"
+#undef INSIST
+#define INSIST(x) /* */
 
-
-#ifdef SPRINTF_CHAR
-# define SPRINTF(x) strlen(sprintf/**/x)
+#if 0
+#include 
+#if defined(LIBC_SCCS) && !defined(lint)
+#if 0
+static const char rcsid[] = "Id: inet_net_pton.c,v 1.4.2.1 2002/08/02 02:17:21 marka Exp ";
 #else
-# define SPRINTF(x) ((size_t)sprintf x)
+__RCSID(" NetBSD: inet_net_pton.c,v 1.5 2018/12/13 08:44:11 maya Exp  ");
+#endif
 #endif
 
+#include "port_before.h"
+
+#include "namespace.h"
+#include 
+#include 
+#include 
+#include 
+#include 
+
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+
+#include "port_after.h"
+
+#ifdef __weak_alias
+__weak_alias(inet_net_pton,_inet_net_pton)
+#endif
+#endif
 
 /*
  * static int
@@ -45,12 +75,15 @@
  *	Paul Vixie (ISC), June 1996
  */
 static int
-inet_net_pton_ipv4( const char *src, unsigned char *dst, size_t size) {
+inet_net_pton_ipv4(const char *src, unsigned char *dst, size_t size)
+{
 	static const char xdigits[] = "0123456789abcdef";
 	static const char digits[] = "0123456789";
-	int n, ch, tmp = 0, dirty, bits;
+	int ch, dirty, bits;
+	ptrdiff_t n, tmp;
 	const unsigned char *odst = dst;
 
+	tmp = 0;
 	ch = *src++;
 	if (ch == '0' && (src[0] == 'x' || src[0] == 'X')
 	&& isascii((unsigned char)(src[1]))
@@ -65,6 +98,7 @@ inet_net_pton_ipv4( const char *src, uns
 			if (isupper((unsigned char)ch))
 ch = tolower((unsigned char)ch);
 			n = strchr(xdigits, ch) - xdigits;
+			INSIST(n >= 0 && n <= 15);
 			if (dirty == 0)
 tmp = n;
 			else
@@ -87,13 +121,13 @@ inet_net_pton_ipv4( const char *src, uns
 			tmp = 0;
 			do {
 n = strchr(digits, ch) - digits;
+INSIST(n >= 0 && n <= 9);
 tmp *= 10;
 tmp += n;
 if (tmp > 255)
 	goto enoent;
 			} while ((ch = *src++) != '\0' &&
- isascii((unsigned char)ch) &&
- isdigit((unsigned char)ch));
+ isascii((unsigned char)ch) && isdigit((unsigned char)ch));
 			if (size-- == 0)
 goto emsgsize;
 			*dst++ = (unsigned char) tmp;
@@ -102,8 +136,7 @@ inet_net_pton_ipv4( const char *src, uns
 			if (ch != '.')
 goto enoent;
 			ch = *src++;
-			if (!isascii((unsigned char)ch) ||
-			!isdigit((unsigned char)ch))
+			if (!isascii((unsigned char)ch) || !isdigit((unsigned char)ch))
 goto enoent;
 		}
 	} else
@@ -117,14 +150,15 @@ inet_net_pton_ipv4( const char *src, uns
 		bits = 0;
 		do {
 			n = strchr(digits, ch) - digits;
+			INSIST(n >= 0 && n <= 9);
 			bits *= 10;
-			bits += n;
+			bits += (int)n;
+			if (bits > 32)
+goto emsgsize;
 		} while ((ch = *src++) != '\0' && isascii((unsigned char)ch)
 		&& isdigit((unsigned char)ch));
 		if (ch != '\0')
 			goto enoent;
-		if (bits > 32)
-			goto emsgsize;
 	}
 
 	/* Firey death and destruction unless we prefetched EOS. */
@@ -148,7 +182,7 @@ inet_net_pton_ipv4( const char *src, uns
 			bits = 8;
 		/* If imputed mask is narrower than specified octets, widen. */
 		if (bits >= 8 && bits < ((dst - odst) * 8))
-			bits = (dst - odst) * 8;
+			bits = (int)(dst - odst) * 8;
 	}
 	/* Extend network to cover the actual mask. */
 	while (bits > ((dst - odst) * 8)) {
@@ -169,7 +203,8 @@ inet_net_pton_ipv4( const char *src, uns
 
 #ifdef INET6
 static int
-getbits(const char *src, int *bitsp) {
+getbits(const char *src, int *bitsp)
+{
 	static const char digits[] = "0123456789";
 	int n;
 	int val;
@@ -185,7 +220,7 @@ getbits(const char *src, int *bitsp) {
 			if (n++ != 0 && val == 0)	

CVS commit: othersrc/libexec/tnftpd/libnetbsd

2023-09-22 Thread Luke Mewburn
Module Name:othersrc
Committed By:   lukem
Date:   Fri Sep 22 22:48:31 UTC 2023

Modified Files:
othersrc/libexec/tnftpd/libnetbsd: fgetln.c

Log Message:
sync tools/compat/fgetln.c 1.12

Switch to a version that does not suffer from reporting the wrong length
if the file contains NULs. From OpenBSD.


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 othersrc/libexec/tnftpd/libnetbsd/fgetln.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/libnetbsd/fgetln.c
diff -u othersrc/libexec/tnftpd/libnetbsd/fgetln.c:1.6 othersrc/libexec/tnftpd/libnetbsd/fgetln.c:1.7
--- othersrc/libexec/tnftpd/libnetbsd/fgetln.c:1.6	Sun Sep 21 16:35:25 2008
+++ othersrc/libexec/tnftpd/libnetbsd/fgetln.c	Fri Sep 22 22:48:31 2023
@@ -1,77 +1,101 @@
-/* $NetBSD: fgetln.c,v 1.6 2008/09/21 16:35:25 lukem Exp $ */
+/*	$NetBSD: fgetln.c,v 1.7 2023/09/22 22:48:31 lukem Exp $	*/
 
-/*-
- * Copyright (c) 1998 The NetBSD Foundation, Inc.
- * All rights reserved.
- *
- * This code is derived from software contributed to The NetBSD Foundation
- * by Christos Zoulas.
+/* from:	NetBSD: fgetln.c,v 1.12 2015/10/09 14:42:40 christos Exp */
+/* upstream:	tools/compat/fgetln.c */
+
+/*
+ * Copyright (c) 2015 Joerg Jung 
  *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *notice, this list of conditions and the following disclaimer in the
- *documentation and/or other materials provided with the distribution.
+ * Permission to use, copy, modify, and distribute this software for any
+ * purpose with or without fee is hereby granted, provided that the above
+ * copyright notice and this permission notice appear in all copies.
  *
- * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
- * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
- * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
- * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
+ * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
+ * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
+ * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
+ * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+ * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
+ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
+ * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+ */
+
+/*
+ * portable fgetln() version
  */
 
 #include "tnftpd.h"
 
+#if 0
+#ifdef HAVE_NBTOOL_CONFIG_H
+#include "nbtool_config.h"
+#endif
+#endif
+
+#if !HAVE_FGETLN
+
+#if 0
+#include 
+#ifndef HAVE_NBTOOL_CONFIG_H
+/* These headers are required, but included from nbtool_config.h */
+#include 
+#include 
+#include 
+#endif
+#endif
+
 char *
-fgetln(fp, len)
-	FILE *fp;
-	size_t *len;
+fgetln(FILE *fp, size_t *len)
 {
 	static char *buf = NULL;
-	static size_t bufsiz = 0;
-	char *ptr;
-
+	static size_t bufsz = 0;
+	size_t r = 0;
+	char *p;
+	int c, e;
 
-	if (buf == NULL) {
-		bufsiz = BUFSIZ;
-		if ((buf = malloc(bufsiz)) == NULL)
+	if (!fp || !len) {
+		errno = EINVAL;
+		return NULL;
+	}
+	if (!buf) {
+		if (!(buf = calloc(1, BUFSIZ)))
 			return NULL;
+		bufsz = BUFSIZ;
 	}
+	while ((c = getc(fp)) != EOF) {
+		buf[r++] = c;
+		if (r == bufsz) {
+			/*
+			 * Original uses reallocarray() but we don't have it
+			 * in tools.
+			 */
+			if (!(p = realloc(buf, 2 * bufsz))) {
+e = errno;
+free(buf);
+errno = e;
+buf = NULL, bufsz = 0;
+return NULL;
+			}
+			buf = p, bufsz = 2 * bufsz;
+		}
+		if (c == '\n')
+			break;
+	}
+	return (*len = r) ? buf : NULL;
+}
+#endif
 
-	if (fgets(buf, bufsiz, fp) == NULL)
-		return NULL;
-
-	*len = 0;
-	while ((ptr = strchr([*len], '\n')) == NULL) {
-		size_t nbufsiz = bufsiz + BUFSIZ;
-		char *nbuf = realloc(buf, nbufsiz);
-
-		if (nbuf == NULL) {
-			int oerrno = errno;
-			free(buf);
-			errno = oerrno;
-			buf = NULL;
-			return NULL;
-		} else
-			buf = nbuf;
 
-		*len = bufsiz;
-		if (fgets([bufsiz], 

CVS commit: othersrc/libexec/tnftpd/libnetbsd

2023-09-22 Thread Luke Mewburn
Module Name:othersrc
Committed By:   lukem
Date:   Fri Sep 22 22:48:31 UTC 2023

Modified Files:
othersrc/libexec/tnftpd/libnetbsd: fgetln.c

Log Message:
sync tools/compat/fgetln.c 1.12

Switch to a version that does not suffer from reporting the wrong length
if the file contains NULs. From OpenBSD.


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 othersrc/libexec/tnftpd/libnetbsd/fgetln.c

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



CVS commit: othersrc/libexec/tnftpd/examples

2023-09-22 Thread Luke Mewburn
Module Name:othersrc
Committed By:   lukem
Date:   Fri Sep 22 22:31:34 UTC 2023

Modified Files:
othersrc/libexec/tnftpd/examples: ftpd.conf ftpusers

Log Message:
examples: add in upstream RCSIDs


To generate a diff of this commit:
cvs rdiff -u -r1.1.1.1 -r1.2 othersrc/libexec/tnftpd/examples/ftpd.conf
cvs rdiff -u -r1.2 -r1.3 othersrc/libexec/tnftpd/examples/ftpusers

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/examples/ftpd.conf
diff -u othersrc/libexec/tnftpd/examples/ftpd.conf:1.1.1.1 othersrc/libexec/tnftpd/examples/ftpd.conf:1.2
--- othersrc/libexec/tnftpd/examples/ftpd.conf:1.1.1.1	Sun Jan  9 13:19:19 2000
+++ othersrc/libexec/tnftpd/examples/ftpd.conf	Fri Sep 22 22:31:34 2023
@@ -1,4 +1,5 @@
-#	$NetBSD: ftpd.conf,v 1.1.1.1 2000/01/09 13:19:19 lukem Exp $
+#	$NetBSD: ftpd.conf,v 1.2 2023/09/22 22:31:34 lukem Exp $
+# from: NetBSD: ftpd.conf,v 1.4 2000/01/09 13:19:19 lukem Exp
 #
 # example /etc/ftpd.conf
 

Index: othersrc/libexec/tnftpd/examples/ftpusers
diff -u othersrc/libexec/tnftpd/examples/ftpusers:1.2 othersrc/libexec/tnftpd/examples/ftpusers:1.3
--- othersrc/libexec/tnftpd/examples/ftpusers:1.2	Fri Sep 22 22:23:42 2023
+++ othersrc/libexec/tnftpd/examples/ftpusers	Fri Sep 22 22:31:34 2023
@@ -1,4 +1,5 @@
-#	$NetBSD: ftpusers,v 1.2 2023/09/22 22:23:42 lukem Exp $
+#	$NetBSD: ftpusers,v 1.3 2023/09/22 22:31:34 lukem Exp $
+# from:	NetBSD: ftpusers,v 1.4 2023/09/22 22:15:47 lukem Exp
 #
 # example /etc/ftpusers
 #



CVS commit: othersrc/libexec/tnftpd/examples

2023-09-22 Thread Luke Mewburn
Module Name:othersrc
Committed By:   lukem
Date:   Fri Sep 22 22:31:34 UTC 2023

Modified Files:
othersrc/libexec/tnftpd/examples: ftpd.conf ftpusers

Log Message:
examples: add in upstream RCSIDs


To generate a diff of this commit:
cvs rdiff -u -r1.1.1.1 -r1.2 othersrc/libexec/tnftpd/examples/ftpd.conf
cvs rdiff -u -r1.2 -r1.3 othersrc/libexec/tnftpd/examples/ftpusers

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



CVS commit: othersrc/libexec/tnftpd/examples

2023-09-22 Thread Luke Mewburn
Module Name:othersrc
Committed By:   lukem
Date:   Fri Sep 22 22:23:42 UTC 2023

Modified Files:
othersrc/libexec/tnftpd/examples: ftpusers

Log Message:
sync share/examples/ftpd/ftpusers 1.4

ftpusers(5) example: use IP & DNS examples

Use .example TLD, per IETF RFC 2606.
Use 192.0.2.0/24, per IETF RFC 5737.
Use 127.0.0.1/24 for localguest, not network that ftp.NetBSD.org used to be in.


To generate a diff of this commit:
cvs rdiff -u -r1.1.1.1 -r1.2 othersrc/libexec/tnftpd/examples/ftpusers

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/examples/ftpusers
diff -u othersrc/libexec/tnftpd/examples/ftpusers:1.1.1.1 othersrc/libexec/tnftpd/examples/ftpusers:1.2
--- othersrc/libexec/tnftpd/examples/ftpusers:1.1.1.1	Mon Jul 28 13:35:30 2003
+++ othersrc/libexec/tnftpd/examples/ftpusers	Fri Sep 22 22:23:42 2023
@@ -1,4 +1,4 @@
-#	$NetBSD: ftpusers,v 1.1.1.1 2003/07/28 13:35:30 lukem Exp $
+#	$NetBSD: ftpusers,v 1.2 2023/09/22 22:23:42 lukem Exp $
 #
 # example /etc/ftpusers
 #
@@ -6,20 +6,20 @@
 # prevent the following from logging in:
 #	- users `root' and `toor'
 #	- members of the group `noftp'
-#	- connections from 10.0.0.0/8
-#	- connections from *.spammer.com
+#	- connections from 192.0.2.0/24
+#	- connections from *.spammer.example
 #
 root			deny
 toor			deny
 *:noftp			deny
-*@10.0.0.0/8		deny
-*@*.spammer.com		deny
+*@192.0.2.0/24		deny
+*@*.spammer.example	deny
 
-# anonymous ftp connections from *.NetBSD.org and 204.152.186.0/24 go into
+# anonymous ftp connections from *.NetBSD.org and 127.0.0.0/8 go into
 # class `localguest'
 #
 ftp@*.NetBSD.org	allow	localguest
-ftp@204.152.186.0/24	allow	localguest
+ftp@127.0.0.0/8		allow	localguest
 
 # permit anonymous ftp connections from elsewhere (both entries are required,
 # for backwards compatibility, although `ftp' is the user checked in other



CVS commit: othersrc/libexec/tnftpd/examples

2023-09-22 Thread Luke Mewburn
Module Name:othersrc
Committed By:   lukem
Date:   Fri Sep 22 22:23:42 UTC 2023

Modified Files:
othersrc/libexec/tnftpd/examples: ftpusers

Log Message:
sync share/examples/ftpd/ftpusers 1.4

ftpusers(5) example: use IP & DNS examples

Use .example TLD, per IETF RFC 2606.
Use 192.0.2.0/24, per IETF RFC 5737.
Use 127.0.0.1/24 for localguest, not network that ftp.NetBSD.org used to be in.


To generate a diff of this commit:
cvs rdiff -u -r1.1.1.1 -r1.2 othersrc/libexec/tnftpd/examples/ftpusers

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



CVS commit: othersrc/libexec/tnftpd

2020-07-04 Thread Luke Mewburn
Module Name:othersrc
Committed By:   lukem
Date:   Sat Jul  4 06:57:46 UTC 2020

Modified Files:
othersrc/libexec/tnftpd: configure

Log Message:
regen for tnftpd 20200704


To generate a diff of this commit:
cvs rdiff -u -r1.51 -r1.52 othersrc/libexec/tnftpd/configure

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



CVS commit: othersrc/libexec/tnftpd

2020-07-04 Thread Luke Mewburn
Module Name:othersrc
Committed By:   lukem
Date:   Sat Jul  4 06:57:46 UTC 2020

Modified Files:
othersrc/libexec/tnftpd: configure

Log Message:
regen for tnftpd 20200704


To generate a diff of this commit:
cvs rdiff -u -r1.51 -r1.52 othersrc/libexec/tnftpd/configure

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/configure
diff -u othersrc/libexec/tnftpd/configure:1.51 othersrc/libexec/tnftpd/configure:1.52
--- othersrc/libexec/tnftpd/configure:1.51	Sat Jul  4 04:55:03 2020
+++ othersrc/libexec/tnftpd/configure	Sat Jul  4 06:57:46 2020
@@ -1,7 +1,7 @@
 #! /bin/sh
 # From configure.ac Revision: 1.45 .
 # Guess values for system-dependent variables and create Makefiles.
-# Generated by GNU Autoconf 2.69 for tnftpd 20190602.
+# Generated by GNU Autoconf 2.69 for tnftpd 20200704.
 #
 # Report bugs to .
 #
@@ -13,7 +13,7 @@
 # gives unlimited permission to copy, distribute and modify it.
 #
 #
-# Copyright (c) 2001-2019 The NetBSD Foundation, Inc.
+# Copyright (c) 2001-2020 The NetBSD Foundation, Inc.
 # All rights reserved.
 #
 ##  ##
@@ -596,8 +596,8 @@ MAKEFLAGS=
 # Identity of this package.
 PACKAGE_NAME='tnftpd'
 PACKAGE_TARNAME='tnftpd'
-PACKAGE_VERSION='20190602'
-PACKAGE_STRING='tnftpd 20190602'
+PACKAGE_VERSION='20200704'
+PACKAGE_STRING='tnftpd 20200704'
 PACKAGE_BUGREPORT='lu...@netbsd.org'
 PACKAGE_URL=''
 
@@ -1335,7 +1335,7 @@ if test "$ac_init_help" = "long"; then
   # Omit some internal or obsolete options to make the list less imposing.
   # This message is too long to be a string in the A/UX 3.1 sh.
   cat <<_ACEOF
-\`configure' configures tnftpd 20190602 to adapt to many kinds of systems.
+\`configure' configures tnftpd 20200704 to adapt to many kinds of systems.
 
 Usage: $0 [OPTION]... [VAR=VALUE]...
 
@@ -1405,7 +1405,7 @@ fi
 
 if test -n "$ac_init_help"; then
   case $ac_init_help in
- short | recursive ) echo "Configuration of tnftpd 20190602:";;
+ short | recursive ) echo "Configuration of tnftpd 20200704:";;
esac
   cat <<\_ACEOF
 
@@ -1528,7 +1528,7 @@ fi
 test -n "$ac_init_help" && exit $ac_status
 if $ac_init_version; then
   cat <<\_ACEOF
-tnftpd configure 20190602
+tnftpd configure 20200704
 generated by GNU Autoconf 2.69
 
 Copyright (C) 2012 Free Software Foundation, Inc.
@@ -1536,7 +1536,7 @@ This configure script is free software; 
 gives unlimited permission to copy, distribute and modify it.
 
 
-Copyright (c) 2001-2019 The NetBSD Foundation, Inc.
+Copyright (c) 2001-2020 The NetBSD Foundation, Inc.
 All rights reserved.
 
 _ACEOF
@@ -2113,7 +2113,7 @@ cat >config.log <<_ACEOF
 This file contains any messages produced by compilers while
 running configure, to aid debugging if configure makes a mistake.
 
-It was created by tnftpd $as_me 20190602, which was
+It was created by tnftpd $as_me 20200704, which was
 generated by GNU Autoconf 2.69.  Invocation command line was
 
   $ $0 $@
@@ -3104,7 +3104,7 @@ fi
 
 # Define the identity of the package.
  PACKAGE='tnftpd'
- VERSION='20190602'
+ VERSION='20200704'
 
 
 cat >>confdefs.h <<_ACEOF
@@ -16242,7 +16242,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_wri
 # report actual input values of CONFIG_FILES etc. instead of their
 # values after options handling.
 ac_log="
-This file was extended by tnftpd $as_me 20190602, which was
+This file was extended by tnftpd $as_me 20200704, which was
 generated by GNU Autoconf 2.69.  Invocation command line was
 
   CONFIG_FILES= $CONFIG_FILES
@@ -16308,7 +16308,7 @@ _ACEOF
 cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/&/g'`"
 ac_cs_version="\\
-tnftpd config.status 20190602
+tnftpd config.status 20200704
 configured by $0, generated by GNU Autoconf 2.69,
   with options \\"\$ac_cs_config\\"
 



CVS commit: othersrc/libexec/tnftpd

2020-07-04 Thread Luke Mewburn
Module Name:othersrc
Committed By:   lukem
Date:   Sat Jul  4 06:49:19 UTC 2020

Modified Files:
othersrc/libexec/tnftpd: ChangeLog NEWS configure.ac

Log Message:
tnftpd 20200704 release

Changes since tnftpd 20200704:
- Adapt to NetBSD blocklistd(8) service rename.
- Increase some buffer sizes.


To generate a diff of this commit:
cvs rdiff -u -r1.63 -r1.64 othersrc/libexec/tnftpd/ChangeLog
cvs rdiff -u -r1.14 -r1.15 othersrc/libexec/tnftpd/NEWS
cvs rdiff -u -r1.45 -r1.46 othersrc/libexec/tnftpd/configure.ac

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/ChangeLog
diff -u othersrc/libexec/tnftpd/ChangeLog:1.63 othersrc/libexec/tnftpd/ChangeLog:1.64
--- othersrc/libexec/tnftpd/ChangeLog:1.63	Sun Jun  2 06:54:55 2019
+++ othersrc/libexec/tnftpd/ChangeLog	Sat Jul  4 06:49:19 2020
@@ -1,4 +1,15 @@
-$NetBSD: ChangeLog,v 1.63 2019/06/02 06:54:55 lukem Exp $
+$NetBSD: ChangeLog,v 1.64 2020/07/04 06:49:19 lukem Exp $
+
+Sat Jul  4 06:40:38 UTC 2020	lukem
+
+	* Release as "tnftpd 20200704".
+
+	* Change --with-blacklist to --with-blocklist and search for
+	  libblocklist first, falling back to the legacy libblacklist.
+
+	* Update to NetBSD-ftpd 20200615:
+		* Increase some buffer sizes.
+		* Rename blacklist to blocklist.
 
 Sun Jun  2 05:56:12 UTC 2019	lukem
 
@@ -89,7 +100,7 @@ Mon Jan  4 05:51:15 UTC 2010	lukem
 
 Wed Dec 30 01:48:57 UTC 2009	lukem
 
-	* Release as "tnftpd 20091122" 
+	* Release as "tnftpd 20091122"
 
 Sat Nov  7 11:13:38 UTC 2009	lukem
 	

Index: othersrc/libexec/tnftpd/NEWS
diff -u othersrc/libexec/tnftpd/NEWS:1.14 othersrc/libexec/tnftpd/NEWS:1.15
--- othersrc/libexec/tnftpd/NEWS:1.14	Sun Jun  2 06:54:55 2019
+++ othersrc/libexec/tnftpd/NEWS	Sat Jul  4 06:49:19 2020
@@ -1,6 +1,12 @@
-$NetBSD: NEWS,v 1.14 2019/06/02 06:54:55 lukem Exp $
+$NetBSD: NEWS,v 1.15 2020/07/04 06:49:19 lukem Exp $
 
-This is tnftpd version 20190602.
+This is tnftpd version 20200704.
+
+Changes in tnftpd from 20190602 to 20200704:
+
+	Adapt to NetBSD blocklistd(8) service rename.
+
+	Increase some buffer sizes.
 
 Changes in tnftpd from 20130325 to 20190602:
 

Index: othersrc/libexec/tnftpd/configure.ac
diff -u othersrc/libexec/tnftpd/configure.ac:1.45 othersrc/libexec/tnftpd/configure.ac:1.46
--- othersrc/libexec/tnftpd/configure.ac:1.45	Sat Jul  4 04:39:59 2020
+++ othersrc/libexec/tnftpd/configure.ac	Sat Jul  4 06:49:19 2020
@@ -1,15 +1,15 @@
-# $NetBSD: configure.ac,v 1.45 2020/07/04 04:39:59 lukem Exp $
+# $NetBSD: configure.ac,v 1.46 2020/07/04 06:49:19 lukem Exp $
 #
 # Process this file with autoconf to produce a configure script.
 
-AC_INIT([tnftpd], [20190602], [lu...@netbsd.org])
+AC_INIT([tnftpd], [20200704], [lu...@netbsd.org])
 AC_PREREQ([2.69])
 
 AC_COPYRIGHT([
-Copyright (c) 2001-2019 The NetBSD Foundation, Inc.
+Copyright (c) 2001-2020 The NetBSD Foundation, Inc.
 All rights reserved.
 ])
-AC_REVISION([$Revision: 1.45 $])
+AC_REVISION([$Revision: 1.46 $])
 
 AS_SHELL_SANITIZE()
 



CVS commit: othersrc/libexec/tnftpd

2020-07-04 Thread Luke Mewburn
Module Name:othersrc
Committed By:   lukem
Date:   Sat Jul  4 06:49:19 UTC 2020

Modified Files:
othersrc/libexec/tnftpd: ChangeLog NEWS configure.ac

Log Message:
tnftpd 20200704 release

Changes since tnftpd 20200704:
- Adapt to NetBSD blocklistd(8) service rename.
- Increase some buffer sizes.


To generate a diff of this commit:
cvs rdiff -u -r1.63 -r1.64 othersrc/libexec/tnftpd/ChangeLog
cvs rdiff -u -r1.14 -r1.15 othersrc/libexec/tnftpd/NEWS
cvs rdiff -u -r1.45 -r1.46 othersrc/libexec/tnftpd/configure.ac

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



CVS commit: othersrc/libexec/tnftpd

2020-07-03 Thread Luke Mewburn
Module Name:othersrc
Committed By:   lukem
Date:   Sat Jul  4 05:43:30 UTC 2020

Modified Files:
othersrc/libexec/tnftpd: INSTALL

Log Message:
INSTALL: update for --with-blocklist, --with-sia


To generate a diff of this commit:
cvs rdiff -u -r1.10 -r1.11 othersrc/libexec/tnftpd/INSTALL

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



CVS commit: othersrc/libexec/tnftpd

2020-07-03 Thread Luke Mewburn
Module Name:othersrc
Committed By:   lukem
Date:   Sat Jul  4 05:43:30 UTC 2020

Modified Files:
othersrc/libexec/tnftpd: INSTALL

Log Message:
INSTALL: update for --with-blocklist, --with-sia


To generate a diff of this commit:
cvs rdiff -u -r1.10 -r1.11 othersrc/libexec/tnftpd/INSTALL

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/INSTALL
diff -u othersrc/libexec/tnftpd/INSTALL:1.10 othersrc/libexec/tnftpd/INSTALL:1.11
--- othersrc/libexec/tnftpd/INSTALL:1.10	Sun Sep 21 16:35:24 2008
+++ othersrc/libexec/tnftpd/INSTALL	Sat Jul  4 05:43:29 2020
@@ -1,4 +1,4 @@
-$NetBSD: INSTALL,v 1.10 2008/09/21 16:35:24 lukem Exp $
+$NetBSD: INSTALL,v 1.11 2020/07/04 05:43:29 lukem Exp $
 
 INSTALLATION INTRODUCTION
 -
@@ -44,26 +44,37 @@ tnftpd is configured using an `autoconf'
 * Specific options:
 
   --enable-ipv6   Enable IPv6 support (if your OS supports it).
+  [default=enabled]
   --disable-ipv6  Disable IPv6 support (even if your OS supports it).
-  [default: enabled]
-  --enable-builtinls  Enable built-in /bin/ls.  [default: enabled]
+  --enable-builtinls  Enable built-in /bin/ls.  [default=enabled]
   --disable-builtinls Disable built-in /bin/ls.
-  --with-pam  Enable support for Pluggable Authentication Modules.
-  --with-skey Enable support for S/Key authentication.
   --disable-largefile Omit support for large files.
+  --with-blocklistenable support for NetBSD blocklist daemon
+  [default=auto]
+  --with-pam  enable support for Pluggable Authentication Modules
+  (PAM) authentication [default=auto]
+  --with-sia  enable support for Tru64 Security Integration
+  Architecture (SIA) authentication [default=auto]
+  --with-skey enable support for S/Key authentication (not
+  compatible with --with-pam) [default=no]
 
 The following environment variables can be set to override various
 compiler related settings.
-  CC=compiler		specify name of the C compiler (default: gcc or cc)
-  CFLAGS=flags		specify flags to C compiler (default: -O -g or just -O)
-  LDFLAGS=flags		specify flags to linker (default: none)
+  CC  C compiler command
+  CFLAGS  C compiler flags
+  LDFLAGS linker flags, e.g. -L if you have libraries in a
+  nonstandard directory 
+  LIBSlibraries to pass to the linker, e.g. -l
+  CPPFLAGS(Objective) C/C++ preprocessor flags, e.g. -I if
+  you have headers in a nonstandard directory 
+  CPP C preprocessor
+  YACCThe `Yet Another Compiler Compiler' implementation to use.
+  Defaults to the first program found out of: `bison -y', `byacc',
+  `yacc'.
+  YFLAGS  The list of arguments that will be passed by default to $YACC.
+  This script will default YFLAGS to the empty string to avoid a
+  default value of `-d' given by some make applications.
 
 This can be achieved with:
 	env CC="compiler" CFLAGS="cflags" LDFLAGS="ldflags" ./configure
 
-
-	
-	=	   =
-	=  NOTE: You will need an ANSI C compiler. =
-	=	   =
-	



CVS commit: othersrc/libexec/tnftpd

2020-07-03 Thread Luke Mewburn
Module Name:othersrc
Committed By:   lukem
Date:   Sat Jul  4 05:38:28 UTC 2020

Modified Files:
othersrc/libexec/tnftpd: todo

Log Message:
TODO: more stuff


To generate a diff of this commit:
cvs rdiff -u -r1.21 -r1.22 othersrc/libexec/tnftpd/todo

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/todo
diff -u othersrc/libexec/tnftpd/todo:1.21 othersrc/libexec/tnftpd/todo:1.22
--- othersrc/libexec/tnftpd/todo:1.21	Sun Mar 21 10:49:16 2010
+++ othersrc/libexec/tnftpd/todo	Sat Jul  4 05:38:28 2020
@@ -1,4 +1,4 @@
-$NetBSD: todo,v 1.21 2010/03/21 10:49:16 lukem Exp $
+$NetBSD: todo,v 1.22 2020/07/04 05:38:28 lukem Exp $
 
 check for pidfile returning void (old netbsd such as 1.6) ?
 
@@ -28,3 +28,12 @@ enable kerberos support once its fixed?
 enable socks once functional autoconf tests are available.
 
 add setenv(3) to replace putenv(3) cruft?
+
+convert to tools/compat/fgetln.c for inline NUL handling?
+
+autoconf check for FNM_NORES for detection of recursion attack.
+less like to be a problem since it's only parsed from ftpd.conf
+
+tools/compat/configure.ac BROKEN_FPARSELN
+
+allow glob override to be optional?



CVS commit: othersrc/libexec/tnftpd

2020-07-03 Thread Luke Mewburn
Module Name:othersrc
Committed By:   lukem
Date:   Sat Jul  4 05:38:28 UTC 2020

Modified Files:
othersrc/libexec/tnftpd: todo

Log Message:
TODO: more stuff


To generate a diff of this commit:
cvs rdiff -u -r1.21 -r1.22 othersrc/libexec/tnftpd/todo

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



CVS commit: othersrc/libexec/tnftpd

2020-07-03 Thread Luke Mewburn
Module Name:othersrc
Committed By:   lukem
Date:   Sat Jul  4 04:55:03 UTC 2020

Modified Files:
othersrc/libexec/tnftpd: configure tnftpd_config.h.in

Log Message:
regen for --with-blocklist


To generate a diff of this commit:
cvs rdiff -u -r1.50 -r1.51 othersrc/libexec/tnftpd/configure
cvs rdiff -u -r1.5 -r1.6 othersrc/libexec/tnftpd/tnftpd_config.h.in

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/configure
diff -u othersrc/libexec/tnftpd/configure:1.50 othersrc/libexec/tnftpd/configure:1.51
--- othersrc/libexec/tnftpd/configure:1.50	Sun Jun  2 06:54:55 2019
+++ othersrc/libexec/tnftpd/configure	Sat Jul  4 04:55:03 2020
@@ -1,5 +1,5 @@
 #! /bin/sh
-# From configure.ac Revision: 1.43 .
+# From configure.ac Revision: 1.45 .
 # Guess values for system-dependent variables and create Makefiles.
 # Generated by GNU Autoconf 2.69 for tnftpd 20190602.
 #
@@ -778,7 +778,7 @@ with_sysroot
 enable_libtool_lock
 enable_ipv6
 enable_builtinls
-with_blacklist
+with_blocklist
 with_pam
 with_sia
 with_skey
@@ -1437,7 +1437,7 @@ Optional Packages:
   --with-gnu-ld   assume the C compiler uses GNU ld [default=no]
   --with-sysroot=DIR Search for dependent libraries within DIR
 (or the compiler's sysroot if not specified).
-  --with-blacklistenable support for NetBSD blacklist daemon
+  --with-blocklistenable support for NetBSD blocklist daemon
   [default=auto]
   --with-pam  enable support for Pluggable Authentication Modules
   (PAM) authentication [default=auto]
@@ -11913,11 +11913,11 @@ fi
 
 
 
-# Check whether --with-blacklist was given.
-if test "${with_blacklist+set}" = set; then :
-  withval=$with_blacklist;
+# Check whether --with-blocklist was given.
+if test "${with_blocklist+set}" = set; then :
+  withval=$with_blocklist;
 else
-  with_blacklist=auto
+  with_blocklist=auto
 fi
 
 
@@ -11962,6 +11962,7 @@ fi
 
 
 
+
 #
 # Checks for programs.
 #
@@ -15341,12 +15342,56 @@ $as_echo "using local version" >&6; }
 fi
 fi
 
-# Check for blacklist.
+# Check for blocklist, falling back to legacy blacklist name
 #
-if test "$with_blacklist" != no; then :
-  { $as_echo "$as_me:${as_lineno-$LINENO}: --with-blacklist=$with_blacklist; checking for required blacklist features" >&5
-$as_echo "$as_me: --with-blacklist=$with_blacklist; checking for required blacklist features" >&6;}
-   { $as_echo "$as_me:${as_lineno-$LINENO}: checking for blacklist_open in -lblacklist" >&5
+if test "$with_blocklist" != no; then :
+  { $as_echo "$as_me:${as_lineno-$LINENO}: --with-blocklist=$with_blocklist; checking for required blocklist features" >&5
+$as_echo "$as_me: --with-blocklist=$with_blocklist; checking for required blocklist features" >&6;}
+   { $as_echo "$as_me:${as_lineno-$LINENO}: checking for blocklist_open in -lblocklist" >&5
+$as_echo_n "checking for blocklist_open in -lblocklist... " >&6; }
+if ${ac_cv_lib_blocklist_blocklist_open+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lblocklist  $LIBS"
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char blocklist_open ();
+int
+main ()
+{
+return blocklist_open ();
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  ac_cv_lib_blocklist_blocklist_open=yes
+else
+  ac_cv_lib_blocklist_blocklist_open=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_blocklist_blocklist_open" >&5
+$as_echo "$ac_cv_lib_blocklist_blocklist_open" >&6; }
+if test "x$ac_cv_lib_blocklist_blocklist_open" = xyes; then :
+  LIBS="-lblocklist $LIBS"
+ $as_echo "#define USE_BLOCKLIST 1" >>confdefs.h
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: enabling blocklist support" >&5
+$as_echo "$as_me: enabling blocklist support" >&6;}
+ with_blocklist=yes
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for blacklist_open in -lblacklist" >&5
 $as_echo_n "checking for blacklist_open in -lblacklist... " >&6; }
 if ${ac_cv_lib_blacklist_blacklist_open+:} false; then :
   $as_echo_n "(cached) " >&6
@@ -15384,21 +15429,23 @@ fi
 $as_echo "$ac_cv_lib_blacklist_blacklist_open" >&6; }
 if test "x$ac_cv_lib_blacklist_blacklist_open" = xyes; then :
   LIBS="-lblacklist $LIBS"
- $as_echo "#define USE_BLACKLIST 1" >>confdefs.h
+   $as_echo "#define USE_BLACKLIST 1" >>confdefs.h
 
- { $as_echo 

CVS commit: othersrc/libexec/tnftpd

2020-07-03 Thread Luke Mewburn
Module Name:othersrc
Committed By:   lukem
Date:   Sat Jul  4 04:55:03 UTC 2020

Modified Files:
othersrc/libexec/tnftpd: configure tnftpd_config.h.in

Log Message:
regen for --with-blocklist


To generate a diff of this commit:
cvs rdiff -u -r1.50 -r1.51 othersrc/libexec/tnftpd/configure
cvs rdiff -u -r1.5 -r1.6 othersrc/libexec/tnftpd/tnftpd_config.h.in

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



CVS commit: othersrc/libexec/tnftpd

2020-07-03 Thread Luke Mewburn
Module Name:othersrc
Committed By:   lukem
Date:   Sat Jul  4 04:40:00 UTC 2020

Modified Files:
othersrc/libexec/tnftpd: configure.ac

Log Message:
configure: rename to --with-blocklist

Change --with-blacklist to --with-blocklist and search for
libblocklist first, falling back to the legacy libblacklist.


To generate a diff of this commit:
cvs rdiff -u -r1.44 -r1.45 othersrc/libexec/tnftpd/configure.ac

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



CVS commit: othersrc/libexec/tnftpd

2020-07-03 Thread Luke Mewburn
Module Name:othersrc
Committed By:   lukem
Date:   Sat Jul  4 04:40:00 UTC 2020

Modified Files:
othersrc/libexec/tnftpd: configure.ac

Log Message:
configure: rename to --with-blocklist

Change --with-blacklist to --with-blocklist and search for
libblocklist first, falling back to the legacy libblacklist.


To generate a diff of this commit:
cvs rdiff -u -r1.44 -r1.45 othersrc/libexec/tnftpd/configure.ac

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/configure.ac
diff -u othersrc/libexec/tnftpd/configure.ac:1.44 othersrc/libexec/tnftpd/configure.ac:1.45
--- othersrc/libexec/tnftpd/configure.ac:1.44	Sun Jun  2 06:54:55 2019
+++ othersrc/libexec/tnftpd/configure.ac	Sat Jul  4 04:39:59 2020
@@ -1,4 +1,4 @@
-# $NetBSD: configure.ac,v 1.44 2019/06/02 06:54:55 lukem Exp $
+# $NetBSD: configure.ac,v 1.45 2020/07/04 04:39:59 lukem Exp $
 #
 # Process this file with autoconf to produce a configure script.
 
@@ -9,7 +9,7 @@ AC_COPYRIGHT([
 Copyright (c) 2001-2019 The NetBSD Foundation, Inc.
 All rights reserved.
 ])
-AC_REVISION([$Revision: 1.44 $])
+AC_REVISION([$Revision: 1.45 $])
 
 AS_SHELL_SANITIZE()
 
@@ -44,12 +44,12 @@ AC_ARG_ENABLE([builtinls],
   [opt_builtinls=$enableval],
   [opt_builtinls=yes])
 
-AC_ARG_WITH([blacklist],
-[AS_HELP_STRING([--with-blacklist],
-[enable support for NetBSD blacklist daemon
+AC_ARG_WITH([blocklist],
+[AS_HELP_STRING([--with-blocklist],
+[enable support for NetBSD blocklist daemon
  [default=auto]])],
 [],
-[with_blacklist=auto])
+[with_blocklist=auto])
 
 AC_ARG_WITH([pam],
 [AS_HELP_STRING([--with-pam],
@@ -90,6 +90,8 @@ AH_TEMPLATE([HAVE_PRINTF_LONG_LONG],
  *printf() supports %lld or %qd to print them.])
 AH_TEMPLATE([NO_INTERNAL_LS],
 [Define if not using in-built /bin/ls code.])
+AH_TEMPLATE([USE_BLOCKLIST],
+[Define if using blocklist.])
 AH_TEMPLATE([USE_BLACKLIST],
 [Define if using blacklist.])
 AH_TEMPLATE([USE_INET6],
@@ -385,21 +387,27 @@ AS_IF([test "$ac_cv_have_decl_AI_NUMERIC
   AC_MSG_RESULT([no - using local version])],
  [AC_MSG_RESULT([using local version])])])
 
-# Check for blacklist.
+# Check for blocklist, falling back to legacy blacklist name
 #
-AS_IF([test "$with_blacklist" != no],
-  [AC_MSG_NOTICE([--with-blacklist=$with_blacklist; checking for required blacklist features])
-   AC_CHECK_LIB([blacklist],
-[blacklist_open],
-[LIBS="-lblacklist $LIBS"
- AC_DEFINE([USE_BLACKLIST], [1])
- AC_MSG_NOTICE([enabling blacklist support])
- with_blacklist=yes],
-[AS_IF([test "$with_blacklist" != auto],
-   [AC_MSG_FAILURE(
-[--with-blacklist was given, but blacklist_open() was not found])])
- AC_MSG_NOTICE([disabling --with-blacklist])
- with_blacklist=no])])
+AS_IF([test "$with_blocklist" != no],
+  [AC_MSG_NOTICE([--with-blocklist=$with_blocklist; checking for required blocklist features])
+   AC_CHECK_LIB([blocklist],
+[blocklist_open],
+[LIBS="-lblocklist $LIBS"
+ AC_DEFINE([USE_BLOCKLIST], [1])
+ AC_MSG_NOTICE([enabling blocklist support])
+ with_blocklist=yes],
+[AC_CHECK_LIB([blacklist],
+  [blacklist_open],
+  [LIBS="-lblacklist $LIBS"
+   AC_DEFINE([USE_BLACKLIST], [1])
+   AC_MSG_NOTICE([enabling blocklist legacy support])
+   with_blocklist=yes],
+  [AS_IF([test "$with_blocklist" != auto],
+ [AC_MSG_FAILURE(
+  [--with-blocklist was given, but blocklist_open() was not found])])
+   AC_MSG_NOTICE([disabling --with-blocklist])
+   with_blocklist=no])])])
 
 # Check for PAM.
 #
@@ -490,7 +498,7 @@ AC_MSG_NOTICE([Package:   $P
 AC_MSG_NOTICE([Prefix:$prefix])
 AC_MSG_NOTICE([IPv6 support:  $opt_ipv6])
 AC_MSG_NOTICE([Built-in /bin/ls:  $opt_builtinls])
-AC_MSG_NOTICE([blacklist support: $with_blacklist])
+AC_MSG_NOTICE([blocklist support: $with_blocklist])
 AC_MSG_NOTICE([PAM authentication:$with_pam])
 AC_MSG_NOTICE([SIA authentication:$with_sia])
 AC_MSG_NOTICE([S/Key authentication:  $with_skey])



CVS commit: othersrc/libexec/tnftpd/src

2020-07-03 Thread Luke Mewburn
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 *)>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 
 
-#if USE_BLACKLIST
+#if USE_BLOCKLIST
+#include 
+#elif USE_BLACKLIST
 #include 
 #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	

CVS commit: othersrc/libexec/tnftpd/src

2020-07-03 Thread Luke Mewburn
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.



CVS commit: othersrc/libexec/tnftpd

2019-06-02 Thread Luke Mewburn
Module Name:othersrc
Committed By:   lukem
Date:   Sun Jun  2 06:54:55 UTC 2019

Modified Files:
othersrc/libexec/tnftpd: ChangeLog NEWS configure configure.ac

Log Message:
tnftpd 20190602 release

Changes in tnftpd from 20130325 to 20190602:
* Security fixes to avoid resource exhaustion when globbing paths,
  traversing directories, or parsing numbers.
* Support NetBSD blacklistd(8).
* Add -f option to ftpd to stay in foreground with -D.


To generate a diff of this commit:
cvs rdiff -u -r1.62 -r1.63 othersrc/libexec/tnftpd/ChangeLog
cvs rdiff -u -r1.13 -r1.14 othersrc/libexec/tnftpd/NEWS
cvs rdiff -u -r1.49 -r1.50 othersrc/libexec/tnftpd/configure
cvs rdiff -u -r1.43 -r1.44 othersrc/libexec/tnftpd/configure.ac

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/ChangeLog
diff -u othersrc/libexec/tnftpd/ChangeLog:1.62 othersrc/libexec/tnftpd/ChangeLog:1.63
--- othersrc/libexec/tnftpd/ChangeLog:1.62	Sun Feb  3 06:25:58 2019
+++ othersrc/libexec/tnftpd/ChangeLog	Sun Jun  2 06:54:55 2019
@@ -1,5 +1,8 @@
-$NetBSD: ChangeLog,v 1.62 2019/02/03 06:25:58 lukem Exp $
+$NetBSD: ChangeLog,v 1.63 2019/06/02 06:54:55 lukem Exp $
 
+Sun Jun  2 05:56:12 UTC 2019	lukem
+
+	* Release as "tnftpd 20190602".
 
 Tue Jan 29 23:12:52 UTC 2019	lukem
 

Index: othersrc/libexec/tnftpd/NEWS
diff -u othersrc/libexec/tnftpd/NEWS:1.13 othersrc/libexec/tnftpd/NEWS:1.14
--- othersrc/libexec/tnftpd/NEWS:1.13	Mon Mar 25 04:29:01 2013
+++ othersrc/libexec/tnftpd/NEWS	Sun Jun  2 06:54:55 2019
@@ -1,6 +1,15 @@
-$NetBSD: NEWS,v 1.13 2013/03/25 04:29:01 lukem Exp $
+$NetBSD: NEWS,v 1.14 2019/06/02 06:54:55 lukem Exp $
 
-This is tnftpd version 20130325.
+This is tnftpd version 20190602.
+
+Changes in tnftpd from 20130325 to 20190602:
+
+	Security fixes to avoid resource exhaustion when globbing paths,
+	traversing directories, or parsing numbers.
+
+	Support NetBSD blacklistd(8).
+
+	Add -f option to ftpd to stay in foreground with -D.
 
 Changes in tnftpd from 20130322 to 20130325:
 

Index: othersrc/libexec/tnftpd/configure
diff -u othersrc/libexec/tnftpd/configure:1.49 othersrc/libexec/tnftpd/configure:1.50
--- othersrc/libexec/tnftpd/configure:1.49	Tue Jan 29 23:21:17 2019
+++ othersrc/libexec/tnftpd/configure	Sun Jun  2 06:54:55 2019
@@ -1,7 +1,7 @@
 #! /bin/sh
 # From configure.ac Revision: 1.43 .
 # Guess values for system-dependent variables and create Makefiles.
-# Generated by GNU Autoconf 2.69 for tnftpd 20130325.
+# Generated by GNU Autoconf 2.69 for tnftpd 20190602.
 #
 # Report bugs to .
 #
@@ -596,8 +596,8 @@ MAKEFLAGS=
 # Identity of this package.
 PACKAGE_NAME='tnftpd'
 PACKAGE_TARNAME='tnftpd'
-PACKAGE_VERSION='20130325'
-PACKAGE_STRING='tnftpd 20130325'
+PACKAGE_VERSION='20190602'
+PACKAGE_STRING='tnftpd 20190602'
 PACKAGE_BUGREPORT='lu...@netbsd.org'
 PACKAGE_URL=''
 
@@ -1335,7 +1335,7 @@ if test "$ac_init_help" = "long"; then
   # Omit some internal or obsolete options to make the list less imposing.
   # This message is too long to be a string in the A/UX 3.1 sh.
   cat <<_ACEOF
-\`configure' configures tnftpd 20130325 to adapt to many kinds of systems.
+\`configure' configures tnftpd 20190602 to adapt to many kinds of systems.
 
 Usage: $0 [OPTION]... [VAR=VALUE]...
 
@@ -1405,7 +1405,7 @@ fi
 
 if test -n "$ac_init_help"; then
   case $ac_init_help in
- short | recursive ) echo "Configuration of tnftpd 20130325:";;
+ short | recursive ) echo "Configuration of tnftpd 20190602:";;
esac
   cat <<\_ACEOF
 
@@ -1528,7 +1528,7 @@ fi
 test -n "$ac_init_help" && exit $ac_status
 if $ac_init_version; then
   cat <<\_ACEOF
-tnftpd configure 20130325
+tnftpd configure 20190602
 generated by GNU Autoconf 2.69
 
 Copyright (C) 2012 Free Software Foundation, Inc.
@@ -2113,7 +2113,7 @@ cat >config.log <<_ACEOF
 This file contains any messages produced by compilers while
 running configure, to aid debugging if configure makes a mistake.
 
-It was created by tnftpd $as_me 20130325, which was
+It was created by tnftpd $as_me 20190602, which was
 generated by GNU Autoconf 2.69.  Invocation command line was
 
   $ $0 $@
@@ -3104,7 +3104,7 @@ fi
 
 # Define the identity of the package.
  PACKAGE='tnftpd'
- VERSION='20130325'
+ VERSION='20190602'
 
 
 cat >>confdefs.h <<_ACEOF
@@ -16195,7 +16195,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_wri
 # report actual input values of CONFIG_FILES etc. instead of their
 # values after options handling.
 ac_log="
-This file was extended by tnftpd $as_me 20130325, which was
+This file was extended by tnftpd $as_me 20190602, which was
 generated by GNU Autoconf 2.69.  Invocation command line was
 
   CONFIG_FILES= $CONFIG_FILES
@@ -16261,7 +16261,7 @@ _ACEOF
 cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/&/g'`"
 ac_cs_version="\\
-tnftpd config.status 20130325
+tnftpd config.status 

CVS commit: othersrc/libexec/tnftpd

2019-06-02 Thread Luke Mewburn
Module Name:othersrc
Committed By:   lukem
Date:   Sun Jun  2 06:54:55 UTC 2019

Modified Files:
othersrc/libexec/tnftpd: ChangeLog NEWS configure configure.ac

Log Message:
tnftpd 20190602 release

Changes in tnftpd from 20130325 to 20190602:
* Security fixes to avoid resource exhaustion when globbing paths,
  traversing directories, or parsing numbers.
* Support NetBSD blacklistd(8).
* Add -f option to ftpd to stay in foreground with -D.


To generate a diff of this commit:
cvs rdiff -u -r1.62 -r1.63 othersrc/libexec/tnftpd/ChangeLog
cvs rdiff -u -r1.13 -r1.14 othersrc/libexec/tnftpd/NEWS
cvs rdiff -u -r1.49 -r1.50 othersrc/libexec/tnftpd/configure
cvs rdiff -u -r1.43 -r1.44 othersrc/libexec/tnftpd/configure.ac

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



CVS commit: othersrc/libexec/tnftpd

2019-02-02 Thread Luke Mewburn
Module Name:othersrc
Committed By:   lukem
Date:   Sun Feb  3 06:25:58 UTC 2019

Modified Files:
othersrc/libexec/tnftpd: ChangeLog

Log Message:
fix typo


To generate a diff of this commit:
cvs rdiff -u -r1.61 -r1.62 othersrc/libexec/tnftpd/ChangeLog

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



CVS commit: othersrc/libexec/tnftpd

2019-02-02 Thread Luke Mewburn
Module Name:othersrc
Committed By:   lukem
Date:   Sun Feb  3 06:25:58 UTC 2019

Modified Files:
othersrc/libexec/tnftpd: ChangeLog

Log Message:
fix typo


To generate a diff of this commit:
cvs rdiff -u -r1.61 -r1.62 othersrc/libexec/tnftpd/ChangeLog

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/ChangeLog
diff -u othersrc/libexec/tnftpd/ChangeLog:1.61 othersrc/libexec/tnftpd/ChangeLog:1.62
--- othersrc/libexec/tnftpd/ChangeLog:1.61	Tue Jan 29 23:14:48 2019
+++ othersrc/libexec/tnftpd/ChangeLog	Sun Feb  3 06:25:58 2019
@@ -1,4 +1,4 @@
-$NetBSD: ChangeLog,v 1.61 2019/01/29 23:14:48 lukem Exp $
+$NetBSD: ChangeLog,v 1.62 2019/02/03 06:25:58 lukem Exp $
 
 
 Tue Jan 29 23:12:52 UTC 2019	lukem
@@ -40,7 +40,7 @@ Tue Jan 29 23:12:52 UTC 2019	lukem
 		* Add -f option to ftpd to stay in foreground with -D. PR/53221.
 		* Update version to "NetBSD-ftpd 20180428".
 
-	* Remove endorsment clause from some of my licenses.
+	* Remove endorsement clause from some of my licenses.
 
 Mon Mar 25 03:51:20 UTC 2013	lukem
 



CVS commit: othersrc/libexec/tnftpd

2019-01-29 Thread Luke Mewburn
Module Name:othersrc
Committed By:   lukem
Date:   Tue Jan 29 23:21:18 UTC 2019

Modified Files:
othersrc/libexec/tnftpd: Makefile.in aclocal.m4 configure
tnftpd_config.h.in
othersrc/libexec/tnftpd/buildaux: config.guess config.sub depcomp
install-sh missing ylwrap
othersrc/libexec/tnftpd/examples: Makefile.in
othersrc/libexec/tnftpd/libnetbsd: Makefile.in
othersrc/libexec/tnftpd/ls: Makefile.in
othersrc/libexec/tnftpd/src: Makefile.in
Added Files:
othersrc/libexec/tnftpd/buildaux: ar-lib

Log Message:
regen for recent build improvements


To generate a diff of this commit:
cvs rdiff -u -r1.11 -r1.12 othersrc/libexec/tnftpd/Makefile.in
cvs rdiff -u -r1.8 -r1.9 othersrc/libexec/tnftpd/aclocal.m4
cvs rdiff -u -r1.48 -r1.49 othersrc/libexec/tnftpd/configure
cvs rdiff -u -r1.4 -r1.5 othersrc/libexec/tnftpd/tnftpd_config.h.in
cvs rdiff -u -r0 -r1.1 othersrc/libexec/tnftpd/buildaux/ar-lib
cvs rdiff -u -r1.3 -r1.4 othersrc/libexec/tnftpd/buildaux/config.guess \
othersrc/libexec/tnftpd/buildaux/config.sub
cvs rdiff -u -r1.1 -r1.2 othersrc/libexec/tnftpd/buildaux/depcomp \
othersrc/libexec/tnftpd/buildaux/missing \
othersrc/libexec/tnftpd/buildaux/ylwrap
cvs rdiff -u -r1.5 -r1.6 othersrc/libexec/tnftpd/buildaux/install-sh
cvs rdiff -u -r1.4 -r1.5 othersrc/libexec/tnftpd/examples/Makefile.in
cvs rdiff -u -r1.8 -r1.9 othersrc/libexec/tnftpd/libnetbsd/Makefile.in
cvs rdiff -u -r1.6 -r1.7 othersrc/libexec/tnftpd/ls/Makefile.in
cvs rdiff -u -r1.15 -r1.16 othersrc/libexec/tnftpd/src/Makefile.in

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



CVS commit: othersrc/libexec/tnftpd

2019-01-29 Thread Luke Mewburn
Module Name:othersrc
Committed By:   lukem
Date:   Tue Jan 29 23:14:48 UTC 2019

Modified Files:
othersrc/libexec/tnftpd: ChangeLog

Log Message:
changes so far this year


To generate a diff of this commit:
cvs rdiff -u -r1.60 -r1.61 othersrc/libexec/tnftpd/ChangeLog

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/ChangeLog
diff -u othersrc/libexec/tnftpd/ChangeLog:1.60 othersrc/libexec/tnftpd/ChangeLog:1.61
--- othersrc/libexec/tnftpd/ChangeLog:1.60	Mon Mar 25 04:29:01 2013
+++ othersrc/libexec/tnftpd/ChangeLog	Tue Jan 29 23:14:48 2019
@@ -1,4 +1,46 @@
-$NetBSD: ChangeLog,v 1.60 2013/03/25 04:29:01 lukem Exp $
+$NetBSD: ChangeLog,v 1.61 2019/01/29 23:14:48 lukem Exp $
+
+
+Tue Jan 29 23:12:52 UTC 2019	lukem
+
+	* Limit fnmatch(), fts(),  strsuftollx() recursion to avoid
+	  DoS attacks. From Maksymilian Arciemowicz.
+
+	* Improve glob():
+		* Switch from a recursive pattern matching algorithm to handle
+		  '*' to a backtracking one. Avoids DoS attacks with patterns
+		  "a*a*a*a*a*...b" matching against "...".
+		  See https://research.swtch.com/glob
+		* Bump the glob limits to 512KB for total string size and 64KB
+		  path entries. The old limits were too small for some
+		  important FTP use cases like a pkgsrc repository.
+
+	* Add --with-blacklist to enable support for NetBSD blacklist daemon.
+
+	* Save struct passwd.pw_class if it exists. Inspired by FreeBSD.
+
+	* Sync libnetbsd replacements with NetBSD:
+		* ANSI C, coding, style, copyright improvements.
+		* Fix fparseln() parsing issues.
+		* Fix fts() error handling issues.
+		* Improve strmode() to support S_IFDOOR.
+		* Fix strsuftollx() error message and base 10 handling.
+		* Provide explicit_memset() replacement.
+
+	* Update to NetBSD-ftpd as at 20190129:
+		* Fix violations of the sequence point rule.
+		* Add volatile for gcc 5.
+		* Check that stat and fstat succeed.
+		* Support blacklistd(8) hooks.
+		* Clear utmpx struct before writing it to wtmpx files.
+		* Fix directory stream leaks.
+		* Use explicit_memset(3) instead of memset(3) to clear password.
+		* Fix scope of variable. PR/50665.
+		* Ensure that closing socket exists. CID 603440.
+		* Add -f option to ftpd to stay in foreground with -D. PR/53221.
+		* Update version to "NetBSD-ftpd 20180428".
+
+	* Remove endorsment clause from some of my licenses.
 
 Mon Mar 25 03:51:20 UTC 2013	lukem
 



CVS commit: othersrc/libexec/tnftpd

2019-01-29 Thread Luke Mewburn
Module Name:othersrc
Committed By:   lukem
Date:   Tue Jan 29 23:14:48 UTC 2019

Modified Files:
othersrc/libexec/tnftpd: ChangeLog

Log Message:
changes so far this year


To generate a diff of this commit:
cvs rdiff -u -r1.60 -r1.61 othersrc/libexec/tnftpd/ChangeLog

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



CVS commit: othersrc/libexec/tnftpd

2019-01-29 Thread Luke Mewburn
Module Name:othersrc
Committed By:   lukem
Date:   Tue Jan 29 22:39:11 UTC 2019

Modified Files:
othersrc/libexec/tnftpd: configure.ac

Log Message:
configure: AM_PROG_AR is needed by newer automake


To generate a diff of this commit:
cvs rdiff -u -r1.42 -r1.43 othersrc/libexec/tnftpd/configure.ac

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/configure.ac
diff -u othersrc/libexec/tnftpd/configure.ac:1.42 othersrc/libexec/tnftpd/configure.ac:1.43
--- othersrc/libexec/tnftpd/configure.ac:1.42	Tue Jan 29 13:30:32 2019
+++ othersrc/libexec/tnftpd/configure.ac	Tue Jan 29 22:39:11 2019
@@ -1,4 +1,4 @@
-# $NetBSD: configure.ac,v 1.42 2019/01/29 13:30:32 lukem Exp $
+# $NetBSD: configure.ac,v 1.43 2019/01/29 22:39:11 lukem Exp $
 #
 # Process this file with autoconf to produce a configure script.
 
@@ -9,7 +9,7 @@ AC_COPYRIGHT([
 Copyright (c) 2001-2019 The NetBSD Foundation, Inc.
 All rights reserved.
 ])
-AC_REVISION([$Revision: 1.42 $])
+AC_REVISION([$Revision: 1.43 $])
 
 AS_SHELL_SANITIZE()
 
@@ -21,6 +21,7 @@ AC_CONFIG_LIBOBJ_DIR([libnetbsd])
 
 AM_INIT_AUTOMAKE([-Wall -Werror foreign nostdinc silent-rules])
 AM_MAINTAINER_MODE()
+AM_PROG_AR()
 
 LT_PREREQ([2.4])
 LT_INIT()



CVS commit: othersrc/libexec/tnftpd

2019-01-29 Thread Luke Mewburn
Module Name:othersrc
Committed By:   lukem
Date:   Tue Jan 29 22:39:11 UTC 2019

Modified Files:
othersrc/libexec/tnftpd: configure.ac

Log Message:
configure: AM_PROG_AR is needed by newer automake


To generate a diff of this commit:
cvs rdiff -u -r1.42 -r1.43 othersrc/libexec/tnftpd/configure.ac

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



CVS commit: othersrc/libexec/tnftpd/src

2019-01-29 Thread Luke Mewburn
Module Name:othersrc
Committed By:   lukem
Date:   Tue Jan 29 13:35:58 UTC 2019

Modified Files:
othersrc/libexec/tnftpd/src: tnftpd.manin

Log Message:
merge changes from ftpd.8 1.85 - 1.87


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 othersrc/libexec/tnftpd/src/tnftpd.manin

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/tnftpd.manin
diff -u othersrc/libexec/tnftpd/src/tnftpd.manin:1.2 othersrc/libexec/tnftpd/src/tnftpd.manin:1.3
--- othersrc/libexec/tnftpd/src/tnftpd.manin:1.2	Mon Jan  4 01:10:43 2010
+++ othersrc/libexec/tnftpd/src/tnftpd.manin	Tue Jan 29 13:35:58 2019
@@ -1,5 +1,5 @@
-.\"	$NetBSD: tnftpd.manin,v 1.2 2010/01/04 01:10:43 lukem Exp $
-.\"	from	NetBSD: ftpd.8,v 1.85 2009/05/01 10:53:27 wiz Exp
+.\"	$NetBSD: tnftpd.manin,v 1.3 2019/01/29 13:35:58 lukem Exp $
++.\"	from	NetBSD: ftpd.8,v 1.87 2018/04/28 13:38:00 riastradh Exp 
 .\"
 .\" Copyright (c) 1997-2008 The NetBSD Foundation, Inc.
 .\" All rights reserved.
@@ -66,7 +66,7 @@
 Internet File Transfer Protocol server
 .Sh SYNOPSIS
 .Nm
-.Op Fl 46DdHlnQqrsUuWwX
+.Op Fl 46DdfHlnQqrsUuWwX
 .Op Fl a Ar anondir
 .Op Fl C Ar user Ns Op @ Ns Ar host
 .Op Fl c Ar confdir
@@ -155,6 +155,10 @@ for the
 .Dq "\&%E"
 escape sequence (see
 .Sx Display file escape sequences )
+.It Fl f
+Stops the
+.Fl D
+flag from detaching from the tty and going into the background.
 .It Fl H
 Equivalent to
 .Do
@@ -279,7 +283,7 @@ style
 .Pa xferlog
 file suitable for input into a third-party log analysis tool with a command
 similar to:
-.Dl "sed -ne 's/^.*xferlog: //p' /var/log/xferlog \*[Gt] wuxferlog"
+.Dl "sed -ne 's/^.*xferlog: //p' /var/log/xferlog > wuxferlog"
 .El
 .Pp
 The file



CVS commit: othersrc/libexec/tnftpd/src

2019-01-29 Thread Luke Mewburn
Module Name:othersrc
Committed By:   lukem
Date:   Tue Jan 29 13:35:58 UTC 2019

Modified Files:
othersrc/libexec/tnftpd/src: tnftpd.manin

Log Message:
merge changes from ftpd.8 1.85 - 1.87


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 othersrc/libexec/tnftpd/src/tnftpd.manin

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



CVS commit: othersrc/libexec/tnftpd

2019-01-29 Thread Luke Mewburn
Module Name:othersrc
Committed By:   lukem
Date:   Tue Jan 29 13:30:32 UTC 2019

Modified Files:
othersrc/libexec/tnftpd: configure.ac
othersrc/libexec/tnftpd/src: ftpd.c

Log Message:
save passwd.pw_class if it exists

Add autoconf check for struct passwd.pw_class.
If pw_class is present, save it in sgetpwnam().
Inspired by FreeBSD head/libexec/ftpd/ftpd.c revision 261885.


To generate a diff of this commit:
cvs rdiff -u -r1.41 -r1.42 othersrc/libexec/tnftpd/configure.ac
cvs rdiff -u -r1.35 -r1.36 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.



CVS commit: othersrc/libexec/tnftpd

2019-01-29 Thread Luke Mewburn
Module Name:othersrc
Committed By:   lukem
Date:   Tue Jan 29 13:30:32 UTC 2019

Modified Files:
othersrc/libexec/tnftpd: configure.ac
othersrc/libexec/tnftpd/src: ftpd.c

Log Message:
save passwd.pw_class if it exists

Add autoconf check for struct passwd.pw_class.
If pw_class is present, save it in sgetpwnam().
Inspired by FreeBSD head/libexec/ftpd/ftpd.c revision 261885.


To generate a diff of this commit:
cvs rdiff -u -r1.41 -r1.42 othersrc/libexec/tnftpd/configure.ac
cvs rdiff -u -r1.35 -r1.36 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/configure.ac
diff -u othersrc/libexec/tnftpd/configure.ac:1.41 othersrc/libexec/tnftpd/configure.ac:1.42
--- othersrc/libexec/tnftpd/configure.ac:1.41	Tue Jan 29 13:06:14 2019
+++ othersrc/libexec/tnftpd/configure.ac	Tue Jan 29 13:30:32 2019
@@ -1,4 +1,4 @@
-# $NetBSD: configure.ac,v 1.41 2019/01/29 13:06:14 lukem Exp $
+# $NetBSD: configure.ac,v 1.42 2019/01/29 13:30:32 lukem Exp $
 #
 # Process this file with autoconf to produce a configure script.
 
@@ -9,7 +9,7 @@ AC_COPYRIGHT([
 Copyright (c) 2001-2019 The NetBSD Foundation, Inc.
 All rights reserved.
 ])
-AC_REVISION([$Revision: 1.41 $])
+AC_REVISION([$Revision: 1.42 $])
 
 AS_SHELL_SANITIZE()
 
@@ -243,7 +243,9 @@ AC_TYPE_SIZE_T()
 AC_STRUCT_TM()
 AC_CHECK_MEMBERS([struct sockaddr.sa_len, struct sockaddr_in.sin_len,
   DIR.dd_fd, DIR.__dd_fd, struct dirent.d_namlen,
-  struct passwd.pw_change, struct passwd.pw_expire],
+  struct passwd.pw_change,
+  struct passwd.pw_class,
+  struct passwd.pw_expire],
  [], [], [$accheck_includes])
 AC_CHECK_TYPES([in_port_t, sa_family_t, socklen_t, struct addrinfo],
[], [], [$accheck_includes])

Index: othersrc/libexec/tnftpd/src/ftpd.c
diff -u othersrc/libexec/tnftpd/src/ftpd.c:1.35 othersrc/libexec/tnftpd/src/ftpd.c:1.36
--- othersrc/libexec/tnftpd/src/ftpd.c:1.35	Tue Jan 29 12:14:46 2019
+++ othersrc/libexec/tnftpd/src/ftpd.c	Tue Jan 29 13:30:32 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: ftpd.c,v 1.35 2019/01/29 12:14:46 lukem Exp $	*/
+/*	$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	*/
 
 /*
@@ -946,6 +946,9 @@ sgetpwnam(const char *name)
 		free((char *)save.pw_gecos);
 		free((char *)save.pw_dir);
 		free((char *)save.pw_shell);
+#if defined(HAVE_STRUCT_PASSWD_PW_CLASS)
+		free((char *)save.pw_class);
+#endif
 	}
 	save = *p;
 	save.pw_name = ftpd_strdup(p->pw_name);
@@ -953,6 +956,9 @@ sgetpwnam(const char *name)
 	save.pw_gecos = ftpd_strdup(p->pw_gecos);
 	save.pw_dir = ftpd_strdup(p->pw_dir);
 	save.pw_shell = ftpd_strdup(p->pw_shell);
+#if defined(HAVE_STRUCT_PASSWD_PW_CLASS)
+	save.pw_class = ftpd_strdup(p->pw_class);
+#endif
 	return ();
 }
 



CVS commit: othersrc/libexec/tnftpd

2019-01-29 Thread Luke Mewburn
Module Name:othersrc
Committed By:   lukem
Date:   Tue Jan 29 13:06:14 UTC 2019

Modified Files:
othersrc/libexec/tnftpd: configure.ac tnftpd.h
Added Files:
othersrc/libexec/tnftpd/libnetbsd: explicit_memset.c

Log Message:
provide explicit_memset() from NetBSD

Import NetBSD src/common/lib/libc/string/explicit_memset.c rev 1.4
for explicit_memset(3), because ftpcmd.y now uses that.

Add autoconf AC_REPLACE_FUNCS check for explicit_memset.


To generate a diff of this commit:
cvs rdiff -u -r1.40 -r1.41 othersrc/libexec/tnftpd/configure.ac
cvs rdiff -u -r1.36 -r1.37 othersrc/libexec/tnftpd/tnftpd.h
cvs rdiff -u -r0 -r1.1 othersrc/libexec/tnftpd/libnetbsd/explicit_memset.c

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



CVS commit: othersrc/libexec/tnftpd

2019-01-29 Thread Luke Mewburn
Module Name:othersrc
Committed By:   lukem
Date:   Tue Jan 29 13:06:14 UTC 2019

Modified Files:
othersrc/libexec/tnftpd: configure.ac tnftpd.h
Added Files:
othersrc/libexec/tnftpd/libnetbsd: explicit_memset.c

Log Message:
provide explicit_memset() from NetBSD

Import NetBSD src/common/lib/libc/string/explicit_memset.c rev 1.4
for explicit_memset(3), because ftpcmd.y now uses that.

Add autoconf AC_REPLACE_FUNCS check for explicit_memset.


To generate a diff of this commit:
cvs rdiff -u -r1.40 -r1.41 othersrc/libexec/tnftpd/configure.ac
cvs rdiff -u -r1.36 -r1.37 othersrc/libexec/tnftpd/tnftpd.h
cvs rdiff -u -r0 -r1.1 othersrc/libexec/tnftpd/libnetbsd/explicit_memset.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/configure.ac
diff -u othersrc/libexec/tnftpd/configure.ac:1.40 othersrc/libexec/tnftpd/configure.ac:1.41
--- othersrc/libexec/tnftpd/configure.ac:1.40	Tue Jan 29 12:51:38 2019
+++ othersrc/libexec/tnftpd/configure.ac	Tue Jan 29 13:06:14 2019
@@ -1,4 +1,4 @@
-# $NetBSD: configure.ac,v 1.40 2019/01/29 12:51:38 lukem Exp $
+# $NetBSD: configure.ac,v 1.41 2019/01/29 13:06:14 lukem Exp $
 #
 # Process this file with autoconf to produce a configure script.
 
@@ -9,7 +9,7 @@ AC_COPYRIGHT([
 Copyright (c) 2001-2019 The NetBSD Foundation, Inc.
 All rights reserved.
 ])
-AC_REVISION([$Revision: 1.40 $])
+AC_REVISION([$Revision: 1.41 $])
 
 AS_SHELL_SANITIZE()
 
@@ -274,7 +274,7 @@ AC_FUNC_CLOSEDIR_VOID()
 AC_FUNC_FORK()
 AC_FUNC_FSEEKO()
 AC_FUNC_STRCOLL()
-AC_REPLACE_FUNCS([daemon err fgetln fparseln \
+AC_REPLACE_FUNCS([daemon err explicit_memset fgetln fparseln \
   getaddrinfo getgrouplist getnameinfo getusershell \
   inet_net_pton inet_ntop inet_pton mkstemp \
   sl_init snprintf strdup strerror strsuftollx \

Index: othersrc/libexec/tnftpd/tnftpd.h
diff -u othersrc/libexec/tnftpd/tnftpd.h:1.36 othersrc/libexec/tnftpd/tnftpd.h:1.37
--- othersrc/libexec/tnftpd/tnftpd.h:1.36	Wed Jan 23 07:00:21 2019
+++ othersrc/libexec/tnftpd/tnftpd.h	Tue Jan 29 13:06:14 2019
@@ -1,4 +1,4 @@
-/* $NetBSD: tnftpd.h,v 1.36 2019/01/23 07:00:21 lukem Exp $ */
+/* $NetBSD: tnftpd.h,v 1.37 2019/01/29 13:06:14 lukem Exp $ */
 
 #define	FTPD_VERSION	PACKAGE_STRING
 
@@ -420,6 +420,10 @@ void	warn(const char *, ...);
 void	warnx(const char *, ...);
 #endif
 
+#if !defined(HAVE_EXPLICIT_MEMSET)
+void	*explicit_memset(void *, int, size_t);
+#endif
+
 #if !defined(HAVE_FGETLN)
 char	*fgetln(FILE *, size_t *);
 #endif

Added files:

Index: othersrc/libexec/tnftpd/libnetbsd/explicit_memset.c
diff -u /dev/null othersrc/libexec/tnftpd/libnetbsd/explicit_memset.c:1.1
--- /dev/null	Tue Jan 29 13:06:14 2019
+++ othersrc/libexec/tnftpd/libnetbsd/explicit_memset.c	Tue Jan 29 13:06:14 2019
@@ -0,0 +1,37 @@
+/* $NetBSD: explicit_memset.c,v 1.1 2019/01/29 13:06:14 lukem Exp $ */
+/* from	NetBSD: explicit_memset.c,v 1.4 2014/06/24 16:39:39 drochner Exp */
+
+/*
+ * Written by Matthias Drochner .
+ * Public domain.
+ */
+
+#include "tnftpd.h"
+
+#if 0
+
+#if !defined(_KERNEL) && !defined(_STANDALONE)
+#include "namespace.h"
+#include 
+#ifdef __weak_alias
+__weak_alias(explicit_memset,_explicit_memset)
+#endif
+#define explicit_memset_impl __explicit_memset_impl
+#else
+#include 
+#endif
+
+#endif
+
+/*
+ * The use of a volatile pointer guarantees that the compiler
+ * will not optimise the call away.
+ */
+void *(* volatile explicit_memset_impl)(void *, int, size_t) = memset;
+
+void *
+explicit_memset(void *b, int c, size_t len)
+{
+
+	return (*explicit_memset_impl)(b, c, len);
+}



CVS commit: othersrc/libexec/tnftpd

2019-01-29 Thread Luke Mewburn
Module Name:othersrc
Committed By:   lukem
Date:   Tue Jan 29 12:51:38 UTC 2019

Modified Files:
othersrc/libexec/tnftpd: Makefile.am configure.ac
othersrc/libexec/tnftpd/libnetbsd: Makefile.am
othersrc/libexec/tnftpd/ls: Makefile.am
othersrc/libexec/tnftpd/src: Makefile.am pfilter.c

Log Message:
implement --with-blacklist

Add --with-blacklist to enable NetBSD's blacklistd(8) support.


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 othersrc/libexec/tnftpd/Makefile.am
cvs rdiff -u -r1.39 -r1.40 othersrc/libexec/tnftpd/configure.ac
cvs rdiff -u -r1.3 -r1.4 othersrc/libexec/tnftpd/libnetbsd/Makefile.am
cvs rdiff -u -r1.4 -r1.5 othersrc/libexec/tnftpd/ls/Makefile.am
cvs rdiff -u -r1.4 -r1.5 othersrc/libexec/tnftpd/src/Makefile.am
cvs rdiff -u -r1.1.1.1 -r1.2 othersrc/libexec/tnftpd/src/pfilter.c

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



CVS commit: othersrc/libexec/tnftpd

2019-01-29 Thread Luke Mewburn
Module Name:othersrc
Committed By:   lukem
Date:   Tue Jan 29 12:51:38 UTC 2019

Modified Files:
othersrc/libexec/tnftpd: Makefile.am configure.ac
othersrc/libexec/tnftpd/libnetbsd: Makefile.am
othersrc/libexec/tnftpd/ls: Makefile.am
othersrc/libexec/tnftpd/src: Makefile.am pfilter.c

Log Message:
implement --with-blacklist

Add --with-blacklist to enable NetBSD's blacklistd(8) support.


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 othersrc/libexec/tnftpd/Makefile.am
cvs rdiff -u -r1.39 -r1.40 othersrc/libexec/tnftpd/configure.ac
cvs rdiff -u -r1.3 -r1.4 othersrc/libexec/tnftpd/libnetbsd/Makefile.am
cvs rdiff -u -r1.4 -r1.5 othersrc/libexec/tnftpd/ls/Makefile.am
cvs rdiff -u -r1.4 -r1.5 othersrc/libexec/tnftpd/src/Makefile.am
cvs rdiff -u -r1.1.1.1 -r1.2 othersrc/libexec/tnftpd/src/pfilter.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/Makefile.am
diff -u othersrc/libexec/tnftpd/Makefile.am:1.3 othersrc/libexec/tnftpd/Makefile.am:1.4
--- othersrc/libexec/tnftpd/Makefile.am:1.3	Thu Mar 21 02:56:56 2013
+++ othersrc/libexec/tnftpd/Makefile.am	Tue Jan 29 12:51:38 2019
@@ -1,9 +1,11 @@
-## $NetBSD: Makefile.am,v 1.3 2013/03/21 02:56:56 lukem Exp $
+## $NetBSD: Makefile.am,v 1.4 2019/01/29 12:51:38 lukem Exp $
 
 ACLOCAL_AMFLAGS = -I buildaux
 
 SUBDIRS = examples libnetbsd ls src
 
-EXTRA_DIST = \
-	todo \
+noinst_HEADERS = \
 	tnftpd.h
+
+EXTRA_DIST = \
+	todo

Index: othersrc/libexec/tnftpd/configure.ac
diff -u othersrc/libexec/tnftpd/configure.ac:1.39 othersrc/libexec/tnftpd/configure.ac:1.40
--- othersrc/libexec/tnftpd/configure.ac:1.39	Tue Jan 29 12:28:44 2019
+++ othersrc/libexec/tnftpd/configure.ac	Tue Jan 29 12:51:38 2019
@@ -1,4 +1,4 @@
-# $NetBSD: configure.ac,v 1.39 2019/01/29 12:28:44 lukem Exp $
+# $NetBSD: configure.ac,v 1.40 2019/01/29 12:51:38 lukem Exp $
 #
 # Process this file with autoconf to produce a configure script.
 
@@ -9,7 +9,7 @@ AC_COPYRIGHT([
 Copyright (c) 2001-2019 The NetBSD Foundation, Inc.
 All rights reserved.
 ])
-AC_REVISION([$Revision: 1.39 $])
+AC_REVISION([$Revision: 1.40 $])
 
 AS_SHELL_SANITIZE()
 
@@ -28,18 +28,28 @@ LT_INIT()
 #
 # Arguments for which features are included.
 #
+
 AC_ARG_ENABLE([ipv6],
   [AS_HELP_STRING([--enable-ipv6],
   [enable IPv6 support (if your OS supports it)
[default=enabled]])],
   [opt_ipv6=$enableval],
   [opt_ipv6=yes])
+
 AC_ARG_ENABLE([builtinls],
   [AS_HELP_STRING([--enable-builtinls],
   [enable built-in /bin/ls
[default=enabled]])],
   [opt_builtinls=$enableval],
   [opt_builtinls=yes])
+
+AC_ARG_WITH([blacklist],
+[AS_HELP_STRING([--with-blacklist],
+[enable support for NetBSD blacklist daemon
+ [default=auto]])],
+[],
+[with_blacklist=auto])
+
 AC_ARG_WITH([pam],
 [AS_HELP_STRING([--with-pam],
 [enable support for Pluggable Authentication
@@ -47,6 +57,7 @@ AC_ARG_WITH([pam],
  [default=auto]])],
 [],
 [with_pam=auto])
+
 AC_ARG_WITH([sia],
 [AS_HELP_STRING([--with-sia],
 [enable support for Tru64 Security Integration
@@ -54,6 +65,7 @@ AC_ARG_WITH([sia],
  [default=auto]])],
 [],
 [with_sia=auto])
+
 AC_ARG_WITH([skey],
 [AS_HELP_STRING([--with-skey],
 [enable support for S/Key authentication
@@ -77,6 +89,8 @@ AH_TEMPLATE([HAVE_PRINTF_LONG_LONG],
  *printf() supports %lld or %qd to print them.])
 AH_TEMPLATE([NO_INTERNAL_LS],
 [Define if not using in-built /bin/ls code.])
+AH_TEMPLATE([USE_BLACKLIST],
+[Define if using blacklist.])
 AH_TEMPLATE([USE_INET6],
 [Define if using IPv6 support.])
 AH_TEMPLATE([USE_PAM],
@@ -368,6 +382,22 @@ AS_IF([test "$ac_cv_have_decl_AI_NUMERIC
   AC_MSG_RESULT([no - using local version])],
  [AC_MSG_RESULT([using local version])])])
 
+# Check for blacklist.
+#
+AS_IF([test "$with_blacklist" != no],
+  [AC_MSG_NOTICE([--with-blacklist=$with_blacklist; checking for required blacklist features])
+   AC_CHECK_LIB([blacklist],
+[blacklist_open],
+[LIBS="-lblacklist $LIBS"
+ AC_DEFINE([USE_BLACKLIST], [1])
+ AC_MSG_NOTICE([enabling blacklist support])
+ with_blacklist=yes],
+[AS_IF([test "$with_blacklist" != auto],
+   [AC_MSG_FAILURE(
+[--with-blacklist was given, but blacklist_open() was not 

CVS commit: othersrc/libexec/tnftpd/src

2019-01-29 Thread Luke Mewburn
Module Name:othersrc
Committed By:   lukem
Date:   Tue Jan 29 12:26:47 UTC 2019

Modified Files:
othersrc/libexec/tnftpd/src: extern.h

Log Message:
minimize differences with NetBSD upstream


To generate a diff of this commit:
cvs rdiff -u -r1.17 -r1.18 othersrc/libexec/tnftpd/src/extern.h

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



CVS commit: othersrc/libexec/tnftpd

2019-01-29 Thread Luke Mewburn
Module Name:othersrc
Committed By:   lukem
Date:   Tue Jan 29 12:28:44 UTC 2019

Modified Files:
othersrc/libexec/tnftpd: configure.ac

Log Message:
configure.ac style tweaks

do not use contractions to avoid syntax highlight confusion


To generate a diff of this commit:
cvs rdiff -u -r1.38 -r1.39 othersrc/libexec/tnftpd/configure.ac

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



CVS commit: othersrc/libexec/tnftpd

2019-01-29 Thread Luke Mewburn
Module Name:othersrc
Committed By:   lukem
Date:   Tue Jan 29 12:28:44 UTC 2019

Modified Files:
othersrc/libexec/tnftpd: configure.ac

Log Message:
configure.ac style tweaks

do not use contractions to avoid syntax highlight confusion


To generate a diff of this commit:
cvs rdiff -u -r1.38 -r1.39 othersrc/libexec/tnftpd/configure.ac

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/configure.ac
diff -u othersrc/libexec/tnftpd/configure.ac:1.38 othersrc/libexec/tnftpd/configure.ac:1.39
--- othersrc/libexec/tnftpd/configure.ac:1.38	Mon Mar 25 03:52:48 2013
+++ othersrc/libexec/tnftpd/configure.ac	Tue Jan 29 12:28:44 2019
@@ -1,4 +1,4 @@
-# $NetBSD: configure.ac,v 1.38 2013/03/25 03:52:48 lukem Exp $
+# $NetBSD: configure.ac,v 1.39 2019/01/29 12:28:44 lukem Exp $
 #
 # Process this file with autoconf to produce a configure script.
 
@@ -6,10 +6,10 @@ AC_INIT([tnftpd], [20130325], [lukem@Net
 AC_PREREQ([2.69])
 
 AC_COPYRIGHT([
-Copyright (c) 2001-2013 The NetBSD Foundation, Inc.
+Copyright (c) 2001-2019 The NetBSD Foundation, Inc.
 All rights reserved.
 ])
-AC_REVISION([$Revision: 1.38 $])
+AC_REVISION([$Revision: 1.39 $])
 
 AS_SHELL_SANITIZE()
 
@@ -285,7 +285,7 @@ have_dirfd_as_macro
 #
 AC_LIBOBJ([glob])
 
-# Replace fnmatch() if FNM_CASEFOLD isn't supported.
+# Replace fnmatch() if FNM_CASEFOLD is not supported.
 #
 AS_IF([test "$ac_cv_have_decl_FNM_CASEFOLD" != yes], [AC_LIBOBJ([fnmatch])])
 
@@ -295,7 +295,7 @@ AS_IF([test "$ac_cv_func_getusershell" =
 
 # We assume that if sprintf() supports %lld or %qd,
 # then all of *printf() does. If not, disable long long
-# support because we don't know how to display it.
+# support because we do not know how to display it.
 #
 AS_IF([test "$ac_cv_type_long_long_int" = yes],
   [AC_MSG_CHECKING([*printf() support for %lld])
@@ -335,9 +335,9 @@ int main() {
   [AC_MSG_RESULT([no])])])
 
 # Handle Darwin 7 having a poll() compatibility function,
-# and don't use it if it's emulated.
-# Be conservative, if we don't find one of poll.h or sys/poll.h,
-# don't attempt to use poll().
+# and do not use it if it is emulated.
+# Be conservative, if we do not find one of poll.h or sys/poll.h,
+# do not attempt to use poll().
 #
 AC_CHECK_TYPES([struct pollfd], [], [], [$accheck_includes])
 AC_CHECK_FUNC([poll],
@@ -358,7 +358,7 @@ AS_IF([test "$ac_cv_func_sl_init" = yes]
   AC_LIBOBJ([sl_init])],
  [AC_MSG_RESULT([unknown - cross-compiling])])])
 
-# Replace getaddrinfo() if missing or AI_NUMERICHOST isn't declared.
+# Replace getaddrinfo() if missing or AI_NUMERICHOST is not declared.
 #
 AC_MSG_CHECKING([whether getaddrinfo() is usuable])
 AS_IF([test "$ac_cv_have_decl_AI_NUMERICHOST" = yes],
@@ -380,13 +380,13 @@ AS_IF([test "$with_pam" != no],
   [AC_CHECK_HEADERS([pam/pam_appl.h],
 [],
 [AC_MSG_FAILURE(
-[--with-pam was given, but pam_appl.h wasn't found])])])
+[--with-pam was given, but pam_appl.h was not found])])])
  AC_DEFINE([USE_PAM], [1])
  AC_MSG_NOTICE([enabling PAM authentication])
  with_pam=yes],
 [AS_IF([test "$with_pam" != "auto"],
[AC_MSG_FAILURE(
-[--with-pam was given, but pam_start() wasn't found])])
+[--with-pam was given, but pam_start() was not found])])
  AC_MSG_NOTICE([disabling --with-pam])
  with_pam=no])])
 
@@ -400,7 +400,7 @@ AS_IF([test "$with_sia" != no],
   with_sia=yes],
  [AS_IF([test "$with_sia" != "auto"],
 [AC_MSG_FAILURE(
-[--with-sia was given, but sia_ses_init() wasn't found])])
+[--with-sia was given, but sia_ses_init() was not found])])
   AC_MSG_NOTICE([disabling --with-sia])
   with_sia=no])])
 
@@ -419,7 +419,7 @@ AS_IF([test "$with_skey" != no],
  with_skey=yes],
 [AS_IF([test "$with_skey" != auto],
[AC_MSG_FAILURE(
-[--with-skey was given, but skey_haskey() wasn't found])])
+[--with-skey was given, but skey_haskey() was not found])])
  AC_MSG_NOTICE([disabling --with-skey])
  with_skey=no])])
 



CVS commit: othersrc/libexec/tnftpd/src

2019-01-29 Thread Luke Mewburn
Module Name:othersrc
Committed By:   lukem
Date:   Tue Jan 29 12:26:47 UTC 2019

Modified Files:
othersrc/libexec/tnftpd/src: extern.h

Log Message:
minimize differences with NetBSD upstream


To generate a diff of this commit:
cvs rdiff -u -r1.17 -r1.18 othersrc/libexec/tnftpd/src/extern.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.17 othersrc/libexec/tnftpd/src/extern.h:1.18
--- othersrc/libexec/tnftpd/src/extern.h:1.17	Tue Jan 29 12:14:46 2019
+++ othersrc/libexec/tnftpd/src/extern.h	Tue Jan 29 12:26:47 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: extern.h,v 1.17 2019/01/29 12:14:46 lukem Exp $	*/
+/*	$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	*/
 
 /*-
@@ -304,7 +304,7 @@ struct ftpclass {
 	LLT		 sendlowat;	/* SO_SNDLOWAT size */
 };
 
-extern void		ftp_loop(void);
+__dead extern void		ftp_loop(void);
 extern void		ftp_handle_line(char *);
 
 #ifndef	GLOBAL



  1   2   3   >