CVS commit: src/usr.bin/ftp

2023-12-08 Thread Luke Mewburn
Module Name:src
Committed By:   lukem
Date:   Sat Dec  9 02:15:11 UTC 2023

Modified Files:
src/usr.bin/ftp: ftp.1

Log Message:
ftp(1): wording and formatting improvements

Fix grammar issue with "Support values" reported in private mail.
Document all file transfer types in "type" and cross-reference that.
Consistency fixes in describing file transfer parameters and types.
Fix some mandoc -Tlint issues (except "useless macro: Tn").


To generate a diff of this commit:
cvs rdiff -u -r1.150 -r1.151 src/usr.bin/ftp/ftp.1

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



CVS commit: src/usr.bin/ftp

2023-12-08 Thread Luke Mewburn
Module Name:src
Committed By:   lukem
Date:   Sat Dec  9 02:15:11 UTC 2023

Modified Files:
src/usr.bin/ftp: ftp.1

Log Message:
ftp(1): wording and formatting improvements

Fix grammar issue with "Support values" reported in private mail.
Document all file transfer types in "type" and cross-reference that.
Consistency fixes in describing file transfer parameters and types.
Fix some mandoc -Tlint issues (except "useless macro: Tn").


To generate a diff of this commit:
cvs rdiff -u -r1.150 -r1.151 src/usr.bin/ftp/ftp.1

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

Modified files:

Index: src/usr.bin/ftp/ftp.1
diff -u src/usr.bin/ftp/ftp.1:1.150 src/usr.bin/ftp/ftp.1:1.151
--- src/usr.bin/ftp/ftp.1:1.150	Sat Feb 25 17:37:09 2023
+++ src/usr.bin/ftp/ftp.1	Sat Dec  9 02:15:11 2023
@@ -1,4 +1,4 @@
-.\" 	$NetBSD: ftp.1,v 1.150 2023/02/25 17:37:09 uwe Exp $
+.\" 	$NetBSD: ftp.1,v 1.151 2023/12/09 02:15:11 lukem Exp $
 .\"
 .\" Copyright (c) 1996-2023 The NetBSD Foundation, Inc.
 .\" All rights reserved.
@@ -57,7 +57,7 @@
 .\"
 .\"	@(#)ftp.1	8.3 (Berkeley) 10/9/94
 .\"
-.Dd February 25, 2023
+.Dd December 9, 2023
 .Dt FTP 1
 .Os
 .Sh NAME
@@ -65,7 +65,7 @@
 .Nd Internet file transfer program
 .Sh SYNOPSIS
 .Nm
-.Op Fl 46AadefginpRtVv?
+.Op Fl 46AadefginpRtVv\&?
 .Op Fl N Ar netrc
 .Op Fl o Ar output
 .Op Fl P Ar port
@@ -289,7 +289,7 @@ Uses
 as the local IP address for all connections.
 .It Fl t
 Enables packet tracing.
-.It Fl T Ar direction Ns Cm \&, Ns Ar maximum\| Ns Oo Cm \&, Ns Ar increment Oc
+.It Fl T Ar direction Ns Cm \&, Ns Ar maximum Ns Oo Cm \&, Ns Ar increment Oc
 Set the maximum transfer rate for
 .Ar direction
 to
@@ -392,24 +392,20 @@ or
 .Ic nmap
 setting.
 File transfer uses the current settings for
-.Ic type  ,
-.Ic format ,
-.Ic mode  ,
+.Ic type ,
+.Ic form ,
+.Ic mode ,
 and
-.Ic structure .
+.Ic struct .
 .It Ic ascii
-Set the file transfer
-.Ic type
-to network
-.Tn ASCII .
-This is the default type.
+A synonym for
+.Ic type Cm ascii .
 .It Ic bell
 Arrange that a bell be sounded after each file transfer
 command is completed.
 .It Ic binary
-Set the file transfer
-.Ic type
-to support binary image transfer.
+A synonym for
+.Ic type Cm binary .
 .It Ic bye
 Terminate the
 .Tn FTP
@@ -450,9 +446,12 @@ return to the command interpreter.
 Any defined macros are erased.
 .It Ic \
 Toggle carriage return stripping during
-ascii type file retrieval.
+.Ic type Cm ascii
+file retrieval.
 Records are denoted by a carriage return/linefeed sequence
-during ascii type file transfer.
+during
+.Ic type Cm ascii
+file transfer.
 When
 .Ic \
 is on (the default), carriage returns are stripped from this
@@ -463,7 +462,9 @@ delimiter.
 Records on
 .Pf non\- Ux
 remote systems may contain single linefeeds;
-when an ascii type transfer is made, these linefeeds may be
+when a
+.Ic type Cm ascii
+transfer is made, these linefeeds may be
 distinguished from a record delimiter only when
 .Ic \
 is off.
@@ -541,12 +542,11 @@ Retrieve the files listed in
 .Ar localfile ,
 which has one line per filename.
 .It Ic form Ar format
-Set the file transfer
-.Ic form
-to
+Set the file transfer format control to
 .Ar format .
 The default (and only supported)
-format is
+.Ar format
+is
 .Ql non-print .
 .It Ic ftp Ar host Op Ar port
 A synonym for
@@ -579,27 +579,27 @@ If the local
 file name is not specified, it is given the same
 name it has on the remote machine, subject to
 alteration by the current
-.Ic case  ,
+.Ic case ,
 .Ic ntrans ,
 and
 .Ic nmap
 settings.
 The current settings for
-.Ic type  ,
+.Ic type ,
 .Ic form ,
-.Ic mode  ,
+.Ic mode ,
 and
-.Ic structure
+.Ic struct
 are used while transferring the file.
 .It Ic glob
 Toggle filename expansion for
-.Ic mdelete  ,
+.Ic mdelete ,
 .Ic mget ,
 .Ic mput ,
 and
 .Ic mreget .
 If globbing is turned off with
-.Ic glob  ,
+.Ic glob ,
 the file name arguments
 are taken literally and not expanded.
 Globbing for
@@ -630,7 +630,9 @@ entire directory subtrees of files.
 That can be done by
 transferring a
 .Xr tar 1
-archive of the subtree (in binary mode).
+archive of the subtree (in
+.Ic type Cm binary
+mode).
 .It Ic hash Op Ar size
 Toggle hash-sign
 .Pq Ql #
@@ -658,7 +660,7 @@ If
 is omitted, the current inactivity timer is printed.
 .It Ic image
 A synonym for
-.Ic binary .
+.Ic type Cm binary .
 .It Ic lcd Op Ar directory
 Change the working directory on the local machine.
 If
@@ -682,7 +684,7 @@ A synonym for
 .It Ic macdef Ar macro-name
 Define a macro.
 Subsequent lines are stored as the macro
-.Ar macro-name  ;
+.Ar macro-name ;
 a null line
 .Po
 consecutive newline characters in a file or carriage
@@ -740,7 +742,7 @@ Delete the
 on the remote machine.
 .It Ic mdir Ar remote-files local-file
 Like
-.Ic dir  ,
+.Ic dir ,
 except multiple remote files may be specified.
 If interactive prompting is on,
 .Nm
@@ -759,7 +761,7 @@ See
 .Ic glob
 for details on the filename 

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 import: othersrc/libexec/tnftpd/src

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

Update of /cvsroot/othersrc/libexec/tnftpd/src
In directory ivanova.netbsd.org:/tmp/cvs-serv7335

Log Message:
Import NetBSD-ftpd 20230930

Notable changes since import tag NetBSD-20230922
- Fix uninitialized memory usage in count_users()
- Fix pam_set_item() call with proper struct passed as PAM_SOCKADDR

Status:

Vendor Tag: TNF
Release Tags:   NetBSD-20230930

U othersrc/libexec/tnftpd/src/ftpcmd.y
U othersrc/libexec/tnftpd/src/ftpusers.5
U othersrc/libexec/tnftpd/src/pfilter.h
U othersrc/libexec/tnftpd/src/ftpd.8
U othersrc/libexec/tnftpd/src/Makefile
U othersrc/libexec/tnftpd/src/pathnames.h
C othersrc/libexec/tnftpd/src/version.h
U othersrc/libexec/tnftpd/src/cmds.c
U othersrc/libexec/tnftpd/src/logwtmp.c
C othersrc/libexec/tnftpd/src/conf.c
U othersrc/libexec/tnftpd/src/extern.h
U othersrc/libexec/tnftpd/src/ftpd.conf.5
U othersrc/libexec/tnftpd/src/popen.c
U othersrc/libexec/tnftpd/src/logutmp.c
U othersrc/libexec/tnftpd/src/pfilter.c
C othersrc/libexec/tnftpd/src/ftpd.c

3 conflicts created by this import.
Use the following command to help the merge:

cvs checkout -jTNF:yesterday -jTNF othersrc/libexec/tnftpd/src



CVS import: othersrc/libexec/tnftpd/src

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

Update of /cvsroot/othersrc/libexec/tnftpd/src
In directory ivanova.netbsd.org:/tmp/cvs-serv7335

Log Message:
Import NetBSD-ftpd 20230930

Notable changes since import tag NetBSD-20230922
- Fix uninitialized memory usage in count_users()
- Fix pam_set_item() call with proper struct passed as PAM_SOCKADDR

Status:

Vendor Tag: TNF
Release Tags:   NetBSD-20230930

U othersrc/libexec/tnftpd/src/ftpcmd.y
U othersrc/libexec/tnftpd/src/ftpusers.5
U othersrc/libexec/tnftpd/src/pfilter.h
U othersrc/libexec/tnftpd/src/ftpd.8
U othersrc/libexec/tnftpd/src/Makefile
U othersrc/libexec/tnftpd/src/pathnames.h
C othersrc/libexec/tnftpd/src/version.h
U othersrc/libexec/tnftpd/src/cmds.c
U othersrc/libexec/tnftpd/src/logwtmp.c
C othersrc/libexec/tnftpd/src/conf.c
U othersrc/libexec/tnftpd/src/extern.h
U othersrc/libexec/tnftpd/src/ftpd.conf.5
U othersrc/libexec/tnftpd/src/popen.c
U othersrc/libexec/tnftpd/src/logutmp.c
U othersrc/libexec/tnftpd/src/pfilter.c
C othersrc/libexec/tnftpd/src/ftpd.c

3 conflicts created by this import.
Use the following command to help the merge:

cvs checkout -jTNF:yesterday -jTNF othersrc/libexec/tnftpd/src



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 import: othersrc/libexec/tnftpd/src

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

Update of /cvsroot/othersrc/libexec/tnftpd/src
In directory ivanova.netbsd.org:/tmp/cvs-serv5248

Log Message:
Import NetBSD-ftpd 20230922

Notable changes since import tag NetBSD-20200615:
- 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.

Status:

Vendor Tag: TNF
Release Tags:   NetBSD-20230922

C othersrc/libexec/tnftpd/src/ftpcmd.y
U othersrc/libexec/tnftpd/src/ftpusers.5
U othersrc/libexec/tnftpd/src/pfilter.h
U othersrc/libexec/tnftpd/src/ftpd.8
C othersrc/libexec/tnftpd/src/Makefile
U othersrc/libexec/tnftpd/src/pathnames.h
C othersrc/libexec/tnftpd/src/version.h
U othersrc/libexec/tnftpd/src/cmds.c
U othersrc/libexec/tnftpd/src/logwtmp.c
U othersrc/libexec/tnftpd/src/conf.c
C othersrc/libexec/tnftpd/src/extern.h
C othersrc/libexec/tnftpd/src/ftpd.conf.5
U othersrc/libexec/tnftpd/src/popen.c
U othersrc/libexec/tnftpd/src/logutmp.c
C othersrc/libexec/tnftpd/src/pfilter.c
C othersrc/libexec/tnftpd/src/ftpd.c

7 conflicts created by this import.
Use the following command to help the merge:

cvs checkout -jTNF:yesterday -jTNF othersrc/libexec/tnftpd/src



CVS import: othersrc/libexec/tnftpd/src

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

Update of /cvsroot/othersrc/libexec/tnftpd/src
In directory ivanova.netbsd.org:/tmp/cvs-serv5248

Log Message:
Import NetBSD-ftpd 20230922

Notable changes since import tag NetBSD-20200615:
- 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.

Status:

Vendor Tag: TNF
Release Tags:   NetBSD-20230922

C othersrc/libexec/tnftpd/src/ftpcmd.y
U othersrc/libexec/tnftpd/src/ftpusers.5
U othersrc/libexec/tnftpd/src/pfilter.h
U othersrc/libexec/tnftpd/src/ftpd.8
C othersrc/libexec/tnftpd/src/Makefile
U othersrc/libexec/tnftpd/src/pathnames.h
C othersrc/libexec/tnftpd/src/version.h
U othersrc/libexec/tnftpd/src/cmds.c
U othersrc/libexec/tnftpd/src/logwtmp.c
U othersrc/libexec/tnftpd/src/conf.c
C othersrc/libexec/tnftpd/src/extern.h
C othersrc/libexec/tnftpd/src/ftpd.conf.5
U othersrc/libexec/tnftpd/src/popen.c
U othersrc/libexec/tnftpd/src/logutmp.c
C othersrc/libexec/tnftpd/src/pfilter.c
C othersrc/libexec/tnftpd/src/ftpd.c

7 conflicts created by this import.
Use the following command to help the merge:

cvs checkout -jTNF:yesterday -jTNF othersrc/libexec/tnftpd/src



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/usr.bin/tnftp

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

Modified Files:
othersrc/usr.bin/tnftp: configure.ac tnftp.h

Log Message:
editorial fixes


To generate a diff of this commit:
cvs rdiff -u -r1.48 -r1.49 othersrc/usr.bin/tnftp/configure.ac
cvs rdiff -u -r1.39 -r1.40 othersrc/usr.bin/tnftp/tnftp.h

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

Modified files:

Index: othersrc/usr.bin/tnftp/configure.ac
diff -u othersrc/usr.bin/tnftp/configure.ac:1.48 othersrc/usr.bin/tnftp/configure.ac:1.49
--- othersrc/usr.bin/tnftp/configure.ac:1.48	Sun May  7 18:32:11 2023
+++ othersrc/usr.bin/tnftp/configure.ac	Sat Sep 23 04:50:32 2023
@@ -1,4 +1,4 @@
-#   $NetBSD: configure.ac,v 1.48 2023/05/07 18:32:11 lukem Exp $
+#   $NetBSD: configure.ac,v 1.49 2023/09/23 04:50:32 lukem Exp $
 #
 # Process this file with autoconf to produce a configure script.
 
@@ -336,7 +336,7 @@ AC_CHECK_FUNCS([getcwd gethostbyaddr get
 AS_IF([test "$ac_cv_func_getpgrp" = yes], [AC_FUNC_GETPGRP])
 AS_IF([test "$ac_cv_func_strptime" = yes], [AC_CHECK_DECLS([strptime])])
 
-# Use system glob if GLOB_BRACE and GLOB_TILDE are available.
+# Use system glob if required GLOB_ flags are available.
 #
 use_local_glob=yes
 AC_CHECK_HEADER([glob.h],
@@ -346,7 +346,7 @@ AC_CHECK_HEADER([glob.h],
 int f = GLOB_BRACE|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],

Index: othersrc/usr.bin/tnftp/tnftp.h
diff -u othersrc/usr.bin/tnftp/tnftp.h:1.39 othersrc/usr.bin/tnftp/tnftp.h:1.40
--- othersrc/usr.bin/tnftp/tnftp.h:1.39	Sat Jul  4 14:47:35 2020
+++ othersrc/usr.bin/tnftp/tnftp.h	Sat Sep 23 04:50:32 2023
@@ -1,4 +1,4 @@
-/*	$NetBSD: tnftp.h,v 1.39 2020/07/04 14:47:35 lukem Exp $	*/
+/*	$NetBSD: tnftp.h,v 1.40 2023/09/23 04:50:32 lukem Exp $	*/
 
 #ifndef TNFTP_H
 #define TNFTP_H 1
@@ -170,7 +170,7 @@ struct pollfd {
 # include 
 #endif
 
-#if defined(USE_GLOB_H)	/* not set by configure; used by other build systems */
+#if defined(USE_GLOB_H)
 # include 
 #else
 # include "ftpglob.h"



CVS commit: othersrc/usr.bin/tnftp

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

Modified Files:
othersrc/usr.bin/tnftp: configure.ac tnftp.h

Log Message:
editorial fixes


To generate a diff of this commit:
cvs rdiff -u -r1.48 -r1.49 othersrc/usr.bin/tnftp/configure.ac
cvs rdiff -u -r1.39 -r1.40 othersrc/usr.bin/tnftp/tnftp.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/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

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: src/share/examples/ftpd

2023-09-22 Thread Luke Mewburn
Module Name:src
Committed By:   lukem
Date:   Fri Sep 22 22:15:47 UTC 2023

Modified Files:
src/share/examples/ftpd: ftpusers

Log Message:
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.3 -r1.4 src/share/examples/ftpd/ftpusers

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



CVS commit: src/share/examples/ftpd

2023-09-22 Thread Luke Mewburn
Module Name:src
Committed By:   lukem
Date:   Fri Sep 22 22:15:47 UTC 2023

Modified Files:
src/share/examples/ftpd: ftpusers

Log Message:
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.3 -r1.4 src/share/examples/ftpd/ftpusers

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

Modified files:

Index: src/share/examples/ftpd/ftpusers
diff -u src/share/examples/ftpd/ftpusers:1.3 src/share/examples/ftpd/ftpusers:1.4
--- src/share/examples/ftpd/ftpusers:1.3	Sat Jul 26 20:17:31 2003
+++ src/share/examples/ftpd/ftpusers	Fri Sep 22 22:15:47 2023
@@ -1,4 +1,4 @@
-#	$NetBSD: ftpusers,v 1.3 2003/07/26 20:17:31 salo Exp $
+#	$NetBSD: ftpusers,v 1.4 2023/09/22 22:15:47 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: src/libexec/ftpd

2023-09-22 Thread Luke Mewburn
Module Name:src
Committed By:   lukem
Date:   Fri Sep 22 21:57:55 UTC 2023

Modified Files:
src/libexec/ftpd: version.h

Log Message:
version NetBSD-ftpd 20230922 for MLSD/MLST fix


To generate a diff of this commit:
cvs rdiff -u -r1.78 -r1.79 src/libexec/ftpd/version.h

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

Modified files:

Index: src/libexec/ftpd/version.h
diff -u src/libexec/ftpd/version.h:1.78 src/libexec/ftpd/version.h:1.79
--- src/libexec/ftpd/version.h:1.78	Sat Sep  2 12:16:29 2023
+++ src/libexec/ftpd/version.h	Fri Sep 22 21:57:55 2023
@@ -1,4 +1,4 @@
-/*	$NetBSD: version.h,v 1.78 2023/09/02 12:16:29 lukem Exp $	*/
+/*	$NetBSD: version.h,v 1.79 2023/09/22 21:57:55 lukem Exp $	*/
 /*-
  * Copyright (c) 1999-2023 The NetBSD Foundation, Inc.
  * All rights reserved.
@@ -29,5 +29,5 @@
  */
 
 #ifndef FTPD_VERSION
-#define	FTPD_VERSION	"NetBSD-ftpd 20230902"
+#define	FTPD_VERSION	"NetBSD-ftpd 20230922"
 #endif



CVS commit: src/libexec/ftpd

2023-09-22 Thread Luke Mewburn
Module Name:src
Committed By:   lukem
Date:   Fri Sep 22 21:57:55 UTC 2023

Modified Files:
src/libexec/ftpd: version.h

Log Message:
version NetBSD-ftpd 20230922 for MLSD/MLST fix


To generate a diff of this commit:
cvs rdiff -u -r1.78 -r1.79 src/libexec/ftpd/version.h

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



CVS commit: src/libexec/ftpd

2023-09-02 Thread Luke Mewburn
Module Name:src
Committed By:   lukem
Date:   Sat Sep  2 12:16:29 UTC 2023

Modified Files:
src/libexec/ftpd: ftpd.c version.h

Log Message:
ftpd: improve seteuid error handling

Handle seteuid() failures. Per suggestion by Simon Josefsson.
Consistent logging and fatal exit if uid/gid switching fails.
Log correct errno if dataconn() fails.


To generate a diff of this commit:
cvs rdiff -u -r1.206 -r1.207 src/libexec/ftpd/ftpd.c
cvs rdiff -u -r1.77 -r1.78 src/libexec/ftpd/version.h

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



CVS commit: src/libexec/ftpd

2023-09-02 Thread Luke Mewburn
Module Name:src
Committed By:   lukem
Date:   Sat Sep  2 12:16:29 UTC 2023

Modified Files:
src/libexec/ftpd: ftpd.c version.h

Log Message:
ftpd: improve seteuid error handling

Handle seteuid() failures. Per suggestion by Simon Josefsson.
Consistent logging and fatal exit if uid/gid switching fails.
Log correct errno if dataconn() fails.


To generate a diff of this commit:
cvs rdiff -u -r1.206 -r1.207 src/libexec/ftpd/ftpd.c
cvs rdiff -u -r1.77 -r1.78 src/libexec/ftpd/version.h

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

Modified files:

Index: src/libexec/ftpd/ftpd.c
diff -u src/libexec/ftpd/ftpd.c:1.206 src/libexec/ftpd/ftpd.c:1.207
--- src/libexec/ftpd/ftpd.c:1.206	Sat Jul  3 14:59:49 2021
+++ src/libexec/ftpd/ftpd.c	Sat Sep  2 12:16:29 2023
@@ -1,7 +1,7 @@
-/*	$NetBSD: ftpd.c,v 1.206 2021/07/03 14:59:49 christos Exp $	*/
+/*	$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
@@ -97,7 +97,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.206 2021/07/03 14:59:49 christos Exp $");
+__RCSID("$NetBSD: ftpd.c,v 1.207 2023/09/02 12:16:29 lukem Exp $");
 #endif
 #endif /* not lint */
 
@@ -1300,7 +1300,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);
@@ -1441,8 +1446,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) {
@@ -1615,17 +1620,17 @@ do_pass(int pass_checked, int pass_rval,
 	ntohs(ctrl_addr.su_port) > IPPORT_RESERVED + 1)) {
 		dropprivs++;
 		if (setgid((gid_t)pw->pw_gid) < 0) {
-			reply(550, "Can't set gid.");
-			goto bad_perms;
+			syslog(LOG_NOTICE, "user %s: can't setgid: %m", pw->pw_name);
+			fatal("Can't drop privileges.");
 		}
 		if (setuid((uid_t)pw->pw_uid) < 0) {
-			reply(550, "Can't set uid.");
-			goto bad_perms;
+			syslog(LOG_NOTICE, "user %s: can't setuid: %m", pw->pw_name);
+			fatal("Can't drop privileges.");
 		}
 	} else {
 		if (seteuid((uid_t)pw->pw_uid) < 0) {
-			reply(550, "Can't set uid.");
-			goto bad_perms;
+			syslog(LOG_NOTICE, "user %s: can't seteuid: %m", pw->pw_name);
+			fatal("Can't drop privileges.");
 		}
 	}
 	setenv("HOME", homedir, 1);
@@ -1684,11 +1689,6 @@ do_pass(int pass_checked, int pass_rval,
 #endif
 			/* Forget all about it... */
 	end_login();
-	return;
-
-bad_perms:
-	syslog(LOG_NOTICE, "user %s: can't setuid/gid: %m", pw->pw_name);
-	fatal("Can't drop privileges.");
 }
 
 void
@@ -1924,8 +1924,12 @@ getdatasock(const char *fmode)
 	on = 1;
 	if (data >= 0)
 		return (fdopen(data, fmode));
-	if (! dropprivs)
-		(void) seteuid((uid_t)0);
+	if (! dropprivs) {
+		if (seteuid((uid_t)0) < 0) {
+			syslog(LOG_NOTICE, "getdatasock: can't seteuid 0: %m");
+			fatal("Can't reset privileges.");
+		}
+	}
 	s = socket(ctrl_addr.su_family, SOCK_STREAM, 0);
 	if (s < 0)
 		goto bad;
@@ -1960,8 +1964,12 @@ getdatasock(const char *fmode)
 			goto bad;
 		sleep(tries);
 	}
-	if (! dropprivs)
-		(void) seteuid((uid_t)pw->pw_uid);
+	if (! dropprivs) {
+		if (seteuid((uid_t)pw->pw_uid) < 0) {
+			syslog(LOG_NOTICE, "user %s: can't seteuid: %m", pw->pw_name);
+			fatal("Can't drop privileges.");
+		}
+	}
 #ifdef IP_TOS
 	if (!mapped && ctrl_addr.su_family == AF_INET) {
 		on = IPTOS_THROUGHPUT;
@@ -1974,8 +1982,12 @@ getdatasock(const char *fmode)
  bad:
 		/* Return the real value of errno (close may change it) */
 	t = errno;
-	if (! dropprivs)
-		(void) seteuid((uid_t)pw->pw_uid);
+	if (! dropprivs) {
+		if (seteuid((uid_t)pw->pw_uid) < 0) {
+			syslog(LOG_NOTICE, "user %s: can't seteuid: %m", pw->pw_name);
+			fatal("Can't drop privileges.");
+		}
+	}
 	if (s >= 0)
 		(void) close(s);
 	errno = t;
@@ -2048,13 +2060,13 @@ dataconn(const char *name, off_t size, c
 		if (file == NULL) {
 			char hbuf[NI_MAXHOST];
 			char pbuf[NI_MAXSERV];
-
+			conerrno = errno;
 			if (getnameinfo((struct sockaddr *)_source.si_su,
 			data_source.su_len, hbuf, sizeof(hbuf), pbuf,
 			sizeof(pbuf), NI_NUMERICHOST | NI_NUMERICSERV))
 strlcpy(hbuf, "?", sizeof(hbuf));
 			reply(425, "Can't create data socket 

CVS commit: src/share/mk

2023-09-02 Thread Luke Mewburn
Module Name:src
Committed By:   lukem
Date:   Sat Sep  2 12:09:10 UTC 2023

Modified Files:
src/share/mk: bsd.own.mk

Log Message:
bsd.own.mk: sort the CC_WNO variables


To generate a diff of this commit:
cvs rdiff -u -r1.1359 -r1.1360 src/share/mk/bsd.own.mk

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

Modified files:

Index: src/share/mk/bsd.own.mk
diff -u src/share/mk/bsd.own.mk:1.1359 src/share/mk/bsd.own.mk:1.1360
--- src/share/mk/bsd.own.mk:1.1359	Thu Aug 24 06:18:07 2023
+++ src/share/mk/bsd.own.mk	Sat Sep  2 12:09:10 2023
@@ -1,4 +1,4 @@
-#	$NetBSD: bsd.own.mk,v 1.1359 2023/08/24 06:18:07 rin Exp $
+#	$NetBSD: bsd.own.mk,v 1.1360 2023/09/02 12:09:10 lukem Exp $
 
 # This needs to be before bsd.init.mk
 .if defined(BSD_MK_COMPAT_FILE)
@@ -686,18 +686,18 @@ OBJC=		${TOOL_OBJC.${ACTIVE_OBJC}}
 CC_WNO_ADDRESS_OF_PACKED_MEMBER=${${ACTIVE_CC} == "clang" :? -Wno-error=address-of-packed-member :} \
 ${${ACTIVE_CC} == "gcc" && ${HAVE_GCC:U0} >= 9:? -Wno-address-of-packed-member :}
 
+CC_WNO_ARRAY_BOUNDS=		${${ACTIVE_CC} == "gcc" && ${HAVE_GCC:U0} >= 12:? -Wno-array-bounds :}
 CC_WNO_CAST_FUNCTION_TYPE=	${${ACTIVE_CC} == "gcc" && ${HAVE_GCC:U0} >= 8:? -Wno-cast-function-type :}
 CC_WNO_FORMAT_OVERFLOW=		${${ACTIVE_CC} == "gcc" && ${HAVE_GCC:U0} >= 7:? -Wno-format-overflow :}
 CC_WNO_FORMAT_TRUNCATION=	${${ACTIVE_CC} == "gcc" && ${HAVE_GCC:U0} >= 7:? -Wno-format-truncation :}
 CC_WNO_IMPLICIT_FALLTHROUGH=	${${ACTIVE_CC} == "gcc" && ${HAVE_GCC:U0} >= 7:? -Wno-implicit-fallthrough :}
 CC_WNO_MAYBE_UNINITIALIZED=	${${ACTIVE_CC} == "gcc" && ${HAVE_GCC:U0} >= 10:? -Wno-maybe-uninitialized :}
+CC_WNO_MISSING_TEMPLATE_KEYWORD=${${ACTIVE_CC} == "gcc" && ${HAVE_GCC:U0} >= 12:? -Wno-missing-template-keyword :}
+CC_WNO_REGISTER=		${${ACTIVE_CC} == "gcc" && ${HAVE_GCC:U0} >= 12:? -Wno-register :}
 CC_WNO_RETURN_LOCAL_ADDR=	${${ACTIVE_CC} == "gcc" && ${HAVE_GCC:U0} >= 10:? -Wno-return-local-addr :}
 CC_WNO_STRINGOP_OVERFLOW=	${${ACTIVE_CC} == "gcc" && ${HAVE_GCC:U0} >= 7:? -Wno-stringop-overflow :}
-CC_WNO_STRINGOP_TRUNCATION=	${${ACTIVE_CC} == "gcc" && ${HAVE_GCC:U0} >= 8:? -Wno-stringop-truncation :}
-CC_WNO_MISSING_TEMPLATE_KEYWORD=${${ACTIVE_CC} == "gcc" && ${HAVE_GCC:U0} >= 12:? -Wno-missing-template-keyword :}
 CC_WNO_STRINGOP_OVERREAD=	${${ACTIVE_CC} == "gcc" && ${HAVE_GCC:U0} >= 12:? -Wno-stringop-overread :}
-CC_WNO_REGISTER=		${${ACTIVE_CC} == "gcc" && ${HAVE_GCC:U0} >= 12:? -Wno-register :}
-CC_WNO_ARRAY_BOUNDS=		${${ACTIVE_CC} == "gcc" && ${HAVE_GCC:U0} >= 12:? -Wno-array-bounds :}
+CC_WNO_STRINGOP_TRUNCATION=	${${ACTIVE_CC} == "gcc" && ${HAVE_GCC:U0} >= 8:? -Wno-stringop-truncation :}
 
 # For each ${MACHINE_CPU}, list the ports that use it.
 MACHINES.aarch64=	evbarm



CVS commit: src/share/mk

2023-09-02 Thread Luke Mewburn
Module Name:src
Committed By:   lukem
Date:   Sat Sep  2 12:09:10 UTC 2023

Modified Files:
src/share/mk: bsd.own.mk

Log Message:
bsd.own.mk: sort the CC_WNO variables


To generate a diff of this commit:
cvs rdiff -u -r1.1359 -r1.1360 src/share/mk/bsd.own.mk

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



CVS commit: src

2023-07-23 Thread Luke Mewburn
Module Name:src
Committed By:   lukem
Date:   Sun Jul 23 16:52:38 UTC 2023

Modified Files:
src/doc: CHANGES
src/share/man/man5: mk.conf.5
src/share/mk: bsd.own.mk

Log Message:
bsd.own.mk: force MKSTRIPSYM=no if MKDEBUG=yes

Local symbols are desirable with MKDEBUG=yes, so don't strip them.
Per request from mrg@


To generate a diff of this commit:
cvs rdiff -u -r1.2983 -r1.2984 src/doc/CHANGES
cvs rdiff -u -r1.107 -r1.108 src/share/man/man5/mk.conf.5
cvs rdiff -u -r1.1344 -r1.1345 src/share/mk/bsd.own.mk

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



CVS commit: src

2023-07-23 Thread Luke Mewburn
Module Name:src
Committed By:   lukem
Date:   Sun Jul 23 16:52:38 UTC 2023

Modified Files:
src/doc: CHANGES
src/share/man/man5: mk.conf.5
src/share/mk: bsd.own.mk

Log Message:
bsd.own.mk: force MKSTRIPSYM=no if MKDEBUG=yes

Local symbols are desirable with MKDEBUG=yes, so don't strip them.
Per request from mrg@


To generate a diff of this commit:
cvs rdiff -u -r1.2983 -r1.2984 src/doc/CHANGES
cvs rdiff -u -r1.107 -r1.108 src/share/man/man5/mk.conf.5
cvs rdiff -u -r1.1344 -r1.1345 src/share/mk/bsd.own.mk

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

Modified files:

Index: src/doc/CHANGES
diff -u src/doc/CHANGES:1.2983 src/doc/CHANGES:1.2984
--- src/doc/CHANGES:1.2983	Fri Jul 21 02:42:54 2023
+++ src/doc/CHANGES	Sun Jul 23 16:52:38 2023
@@ -1,4 +1,4 @@
-# LIST OF CHANGES FROM LAST RELEASE:			<$Revision: 1.2983 $>
+# LIST OF CHANGES FROM LAST RELEASE:			<$Revision: 1.2984 $>
 #
 #
 # [Note: This file does not mention every change made to the NetBSD source tree.
@@ -163,3 +163,4 @@ Changes from NetBSD 10.0 to NetBSD 11.0:
 	gcc(1): Import GCC 10.5.  [mrg 20230710]
 	dhcpcd: Import version 10.0.2. [roy 20230719]
 	bta2dpd(8): Add throttle when playing from file. [nat 20230720]
+	build: Force MKSTRIPSYM=no if MKDEBUG=yes.

Index: src/share/man/man5/mk.conf.5
diff -u src/share/man/man5/mk.conf.5:1.107 src/share/man/man5/mk.conf.5:1.108
--- src/share/man/man5/mk.conf.5:1.107	Sat Jul 22 18:49:40 2023
+++ src/share/man/man5/mk.conf.5	Sun Jul 23 16:52:37 2023
@@ -1,4 +1,4 @@
-.\"	$NetBSD: mk.conf.5,v 1.107 2023/07/22 18:49:40 lukem Exp $
+.\"	$NetBSD: mk.conf.5,v 1.108 2023/07/23 16:52:37 lukem Exp $
 .\"
 .\"  Copyright (c) 1999-2023 The NetBSD Foundation, Inc.
 .\"  All rights reserved.
@@ -27,7 +27,7 @@
 .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
 .\" POSSIBILITY OF SUCH DAMAGE.
 .\"
-.Dd July 22, 2023
+.Dd July 23, 2023
 .Dt MK.CONF 5
 .Os
 .\" turn off hyphenation
@@ -691,6 +691,12 @@ and
 set and installed in
 .Sy DESTDIR Ns Pa /usr/libdata/debug .
 .NODEF NODEBUG
+.Pp
+If
+.Dq yes ,
+acts as
+.Sy MKSTRIPSYM=no .
+.
 .DFLTn
 .
 .It Sy MKDEBUGKERNEL
@@ -1649,6 +1655,7 @@ userland libraries and getting a backtra
 .Xr rumpkernel 7
 kernel
 loading shared libraries.
+.NOVAR MKDEBUG=yes
 .DFLTy
 .
 .It Sy MKTEGRAFIRMWARE

Index: src/share/mk/bsd.own.mk
diff -u src/share/mk/bsd.own.mk:1.1344 src/share/mk/bsd.own.mk:1.1345
--- src/share/mk/bsd.own.mk:1.1344	Sun Jul 23 16:49:29 2023
+++ src/share/mk/bsd.own.mk	Sun Jul 23 16:52:37 2023
@@ -1,4 +1,4 @@
-#	$NetBSD: bsd.own.mk,v 1.1344 2023/07/23 16:49:29 lukem Exp $
+#	$NetBSD: bsd.own.mk,v 1.1345 2023/07/23 16:52:37 lukem Exp $
 
 # This needs to be before bsd.init.mk
 .if defined(BSD_MK_COMPAT_FILE)
@@ -1498,6 +1498,13 @@ MKLIBCXX:=	yes
 .endif
 
 #
+# Disable MKSTRIPSYM if MKDEBUG is enabled.
+#
+.if ${MKDEBUG} != "no"
+MKSTRIPSYM:=	no
+.endif
+
+#
 # install(1) parameters.
 #
 COPY?=		-c



CVS commit: src/share/mk

2023-07-23 Thread Luke Mewburn
Module Name:src
Committed By:   lukem
Date:   Sun Jul 23 16:49:29 UTC 2023

Modified Files:
src/share/mk: bsd.own.mk

Log Message:
bsd.own.mk: style: block comments, move CC_flag vars

Add #{ .. #} block comments to a long conditional.

Move the CC_flag variables closer to other compiler-related
variables instead of being in the middle of some arch-specific
overrides.


To generate a diff of this commit:
cvs rdiff -u -r1.1343 -r1.1344 src/share/mk/bsd.own.mk

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

Modified files:

Index: src/share/mk/bsd.own.mk
diff -u src/share/mk/bsd.own.mk:1.1343 src/share/mk/bsd.own.mk:1.1344
--- src/share/mk/bsd.own.mk:1.1343	Fri Jul 21 20:03:13 2023
+++ src/share/mk/bsd.own.mk	Sun Jul 23 16:49:29 2023
@@ -1,4 +1,4 @@
-#	$NetBSD: bsd.own.mk,v 1.1343 2023/07/21 20:03:13 riastradh Exp $
+#	$NetBSD: bsd.own.mk,v 1.1344 2023/07/23 16:49:29 lukem Exp $
 
 # This needs to be before bsd.init.mk
 .if defined(BSD_MK_COMPAT_FILE)
@@ -70,7 +70,7 @@ TOOLCHAIN_MISSING?=	no
 #
 # GCC Using platforms.
 #
-.if ${MKGCC:Uyes} != "no"
+.if ${MKGCC:Uyes} != "no"		# {
 
 #
 # What GCC is used?
@@ -94,9 +94,10 @@ EXTERNAL_GCC_SUBDIR?=	gcc
 .else
 EXTERNAL_GCC_SUBDIR?=	/does/not/exist
 .endif
-.else
+
+.else	# MKGCC == no			# } {
 MKGCCCMDS?=	no
-.endif
+.endif	# MKGCC == no			# }
 
 #
 # What binutils is used?
@@ -670,6 +671,32 @@ CXX=		${TOOL_CXX.${ACTIVE_CXX}}
 FC=		${TOOL_FC.${ACTIVE_FC}}
 OBJC=		${TOOL_OBJC.${ACTIVE_OBJC}}
 
+#
+# Clang and GCC compiler-specific options, usually to disable warnings.
+# The naming convention is "CC" + the compiler flag converted
+# to upper case, with '-' and '=' changed to '_' a la `tr -=a-z __A-Z`.
+# For variable naming purposes, treat -Werror=FLAG as -WFLAG,
+# and -Wno-error=FLAG as -Wno-FLAG (usually from Clang).
+#
+# E.g., CC_WNO_ADDRESS_OF_PACKED_MEMBER contains
+# both -Wno-error=address-of-packed-member for Clang,
+# and -Wno-address-of-packed-member for GCC 9+.
+#
+# Use these with e.g.
+#	COPTS.foo.c+= ${CC_WNO_ADDRESS_OF_PACKED_MEMBER}
+#
+CC_WNO_ADDRESS_OF_PACKED_MEMBER=${${ACTIVE_CC} == "clang" :? -Wno-error=address-of-packed-member :} \
+${${ACTIVE_CC} == "gcc" && ${HAVE_GCC:U0} >= 9:? -Wno-address-of-packed-member :}
+
+CC_WNO_CAST_FUNCTION_TYPE=	${${ACTIVE_CC} == "gcc" && ${HAVE_GCC:U0} >= 8:? -Wno-cast-function-type :}
+CC_WNO_FORMAT_OVERFLOW=		${${ACTIVE_CC} == "gcc" && ${HAVE_GCC:U0} >= 7:? -Wno-format-overflow :}
+CC_WNO_FORMAT_TRUNCATION=	${${ACTIVE_CC} == "gcc" && ${HAVE_GCC:U0} >= 7:? -Wno-format-truncation :}
+CC_WNO_IMPLICIT_FALLTHROUGH=	${${ACTIVE_CC} == "gcc" && ${HAVE_GCC:U0} >= 7:? -Wno-implicit-fallthrough :}
+CC_WNO_MAYBE_UNINITIALIZED=	${${ACTIVE_CC} == "gcc" && ${HAVE_GCC:U0} >= 10:? -Wno-maybe-uninitialized :}
+CC_WNO_RETURN_LOCAL_ADDR=	${${ACTIVE_CC} == "gcc" && ${HAVE_GCC:U0} >= 10:? -Wno-return-local-addr :}
+CC_WNO_STRINGOP_OVERFLOW=	${${ACTIVE_CC} == "gcc" && ${HAVE_GCC:U0} >= 7:? -Wno-stringop-overflow :}
+CC_WNO_STRINGOP_TRUNCATION=	${${ACTIVE_CC} == "gcc" && ${HAVE_GCC:U0} >= 8:? -Wno-stringop-truncation :}
+
 # For each ${MACHINE_CPU}, list the ports that use it.
 MACHINES.aarch64=	evbarm
 MACHINES.alpha=		alpha
@@ -872,32 +899,6 @@ NOPROFILE=	# defined
 .endif
 
 #
-# Clang and GCC compiler-specific options, usually to disable warnings.
-# The naming convention is "CC" + the compiler flag converted
-# to upper case, with '-' and '=' changed to '_' a la `tr -=a-z __A-Z`.
-# For variable naming purposes, treat -Werror=FLAG as -WFLAG,
-# and -Wno-error=FLAG as -Wno-FLAG (usually from Clang).
-#
-# E.g., CC_WNO_ADDRESS_OF_PACKED_MEMBER contains
-# both -Wno-error=address-of-packed-member for Clang,
-# and -Wno-address-of-packed-member for GCC 9+.
-#
-# Use these with e.g.
-#	COPTS.foo.c+= ${CC_WNO_ADDRESS_OF_PACKED_MEMBER}
-#
-CC_WNO_ADDRESS_OF_PACKED_MEMBER=${${ACTIVE_CC} == "clang" :? -Wno-error=address-of-packed-member :} \
-${${ACTIVE_CC} == "gcc" && ${HAVE_GCC:U0} >= 9:? -Wno-address-of-packed-member :}
-
-CC_WNO_CAST_FUNCTION_TYPE=	${${ACTIVE_CC} == "gcc" && ${HAVE_GCC:U0} >= 8:? -Wno-cast-function-type :}
-CC_WNO_FORMAT_OVERFLOW=		${${ACTIVE_CC} == "gcc" && ${HAVE_GCC:U0} >= 7:? -Wno-format-overflow :}
-CC_WNO_FORMAT_TRUNCATION=	${${ACTIVE_CC} == "gcc" && ${HAVE_GCC:U0} >= 7:? -Wno-format-truncation :}
-CC_WNO_IMPLICIT_FALLTHROUGH=	${${ACTIVE_CC} == "gcc" && ${HAVE_GCC:U0} >= 7:? -Wno-implicit-fallthrough :}
-CC_WNO_MAYBE_UNINITIALIZED=	${${ACTIVE_CC} == "gcc" && ${HAVE_GCC:U0} >= 10:? -Wno-maybe-uninitialized :}
-CC_WNO_RETURN_LOCAL_ADDR=	${${ACTIVE_CC} == "gcc" && ${HAVE_GCC:U0} >= 10:? -Wno-return-local-addr :}
-CC_WNO_STRINGOP_OVERFLOW=	${${ACTIVE_CC} == "gcc" && ${HAVE_GCC:U0} >= 7:? -Wno-stringop-overflow :}
-CC_WNO_STRINGOP_TRUNCATION=	${${ACTIVE_CC} == "gcc" && ${HAVE_GCC:U0} >= 8:? -Wno-stringop-truncation :}
-
-#
 # The ia64 port is incomplete.
 #
 MKGDB.ia64=	no



CVS commit: src/share/mk

2023-07-23 Thread Luke Mewburn
Module Name:src
Committed By:   lukem
Date:   Sun Jul 23 16:49:29 UTC 2023

Modified Files:
src/share/mk: bsd.own.mk

Log Message:
bsd.own.mk: style: block comments, move CC_flag vars

Add #{ .. #} block comments to a long conditional.

Move the CC_flag variables closer to other compiler-related
variables instead of being in the middle of some arch-specific
overrides.


To generate a diff of this commit:
cvs rdiff -u -r1.1343 -r1.1344 src/share/mk/bsd.own.mk

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



CVS commit: src/share/mk

2023-07-22 Thread Luke Mewburn
Module Name:src
Committed By:   lukem
Date:   Sat Jul 22 18:50:31 UTC 2023

Modified Files:
src/share/mk: bsd.README

Log Message:
bsd.README: sync with mk.conf(5), deduping entries

Remove most duplication of variables already documented in mk.conf(5).
Add lists of supported and obsolete mk.conf(5) variables
so that searches in this document at least find them
(as per BUILDING).

Sync text from mk.conf(5) for entries that remain.
Explicitly document DESTDIR and RELEASEDIR.

Replace MKMAN=no antipattern with NOMAN=.

Consistently use "option" versus "flag"; option is more generic,
and may include a flag with an argument.


To generate a diff of this commit:
cvs rdiff -u -r1.444 -r1.445 src/share/mk/bsd.README

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



CVS commit: src/share/mk

2023-07-22 Thread Luke Mewburn
Module Name:src
Committed By:   lukem
Date:   Sat Jul 22 18:50:31 UTC 2023

Modified Files:
src/share/mk: bsd.README

Log Message:
bsd.README: sync with mk.conf(5), deduping entries

Remove most duplication of variables already documented in mk.conf(5).
Add lists of supported and obsolete mk.conf(5) variables
so that searches in this document at least find them
(as per BUILDING).

Sync text from mk.conf(5) for entries that remain.
Explicitly document DESTDIR and RELEASEDIR.

Replace MKMAN=no antipattern with NOMAN=.

Consistently use "option" versus "flag"; option is more generic,
and may include a flag with an argument.


To generate a diff of this commit:
cvs rdiff -u -r1.444 -r1.445 src/share/mk/bsd.README

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

Modified files:

Index: src/share/mk/bsd.README
diff -u src/share/mk/bsd.README:1.444 src/share/mk/bsd.README:1.445
--- src/share/mk/bsd.README:1.444	Mon Jun  5 22:36:58 2023
+++ src/share/mk/bsd.README	Sat Jul 22 18:50:31 2023
@@ -1,4 +1,4 @@
-#	$NetBSD: bsd.README,v 1.444 2023/06/05 22:36:58 lukem Exp $
+#	$NetBSD: bsd.README,v 1.445 2023/07/22 18:50:31 lukem Exp $
 #	@(#)bsd.README	8.2 (Berkeley) 4/2/94
 
 This is the README file for the make "include" files for the NetBSD
@@ -71,7 +71,7 @@ The basic rule for the variable naming s
 
 HOST_	A command that runs on the host machine regardless of
 		whether or not the system is being cross compiled, or
-		flags for such a command.
+		options for such a command.
 
 MK	Can be set to "no" to disable feature ,
 		or "yes" to enable feature .
@@ -100,1100 +100,77 @@ TOOL_	A tool that is provided as p
 		TOOL_ variables should refer to tools that are
 		already installed on the host system.
 
-The following variables control how things are made/installed that
-are not set by default. These should not be set by Makefiles; they're for
-the user to define in MAKECONF (see , below, or mk.conf(5))
-or on the make(1) command line:
-
-BUILD		If defined, 'make install' checks that the targets in the
-		source directories are up-to-date and re-makes them if
-		they are out of date, instead of blindly trying to
-		install out of date or non-existent targets.
+Various mk.conf(5) variables control the NetBSD system build.
+These should not be set by Makefiles; they're for the user to define
+in MAKECONF (see mk.conf(5) or  documented below) or on
+the make(1) command line.
+
+The supported mk.conf(5) make variables are:
+
+	BSDOBJDIR, BSDSRCDIR, BUILD, BUILDID, BUILDINFO, BUILDSEED,
+	CDEXTRA, CONFIGOPTS, COPTS, CPUFLAGS, DESTDIR, EXTERNAL_TOOLCHAIN,
+	INSTALLBOOT_BOARDS, INSTALLWORLDDIR, KERNARCHDIR, KERNCONFDIR,
+	KERNEL_DIR, KERNOBJDIR, KERNSRCDIR, LOCALTIME, MAKEVERBOSE,
+	MKAMDGPUFIRMWARE, MKARGON2, MKARZERO, MKATF, MKBINUTILS, MKBSDGREP,
+	MKBSDTAR, MKCATPAGES, MKCLEANSRC, MKCLEANVERIFY, MKCOMPAT,
+	MKCOMPATMODULES, MKCOMPATTESTS, MKCOMPATX11, MKCOMPLEX, MKCROSSGDB,
+	MKCTF, MKCVS, MKCXX, MKDEBUG, MKDEBUGKERNEL, MKDEBUGLIB,
+	MKDEBUGTOOLS, MKDEPINCLUDES, MKDOC, MKDTB, MKDTC, MKDTRACE,
+	MKDYNAMICROOT, MKFIRMWARE, MKGCC, MKGCCCMDS, MKGDB, MKGROFF,
+	MKGROFFHTMLDOC, MKHESIOD, MKHOSTOBJ, MKHTML, MKIEEEFP, MKINET6,
+	MKINFO, MKIPFILTER, MKISCSI, MKKERBEROS, MKKMOD, MKKYUA, MKLDAP,
+	MKLIBCSANITIZER, MKLIBCXX, MKLIBSTDCXX, MKLINKLIB, MKLINT, MKLLVM,
+	MKLLVMRT, MKLVM, MKMAKEMANDB, MKMAN, MKMANDOC, MKMANZ, MKMDNS,
+	MKNLS, MKNOUVEAUFIRMWARE, MKNPF, MKNSD, MKOBJ, MKOBJDIRS, MKPAM,
+	MKPCC, MKPF, MKPIC, MKPICINSTALL, MKPICLIB, MKPIE, MKPIGZGZIP,
+	MKPOSTFIX, MKPROFILE, MKRADEONFIRMWARE, MKRELRO, MKREPRO,
+	MKREPRO_TIMESTAMP, MKRUMP, MKSANITIZER, MKSHARE, MKSKEY, MKSLJIT,
+	MKSOFTFLOAT, MKSTATICLIB, MKSTATICPIE, MKSTRIPIDENT, MKSTRIPSYM,
+	MKTEGRAFIRMWARE, MKTPM, MKUNBOUND, MKUNPRIVED, MKUPDATE, MKX11,
+	MKX11FONTS, MKX11MOTIF, MKXORG_SERVER, MKYP, MKZFS, NETBSDSRCDIR,
+	NETBSD_OFFICIAL_RELEASE, NOCLEANDIR, NODISTRIBDIRS, NOINCLUDES,
+	OBJMACHINE, RELEASEDIR, RUMPUSER_THREADS, RUMP_CURLWP, RUMP_DEBUG,
+	RUMP_DIAGNOSTIC, RUMP_KTRACE, RUMP_LOCKDEBUG, RUMP_LOCKS_UP,
+	RUMP_NBCOMPAT, RUMP_VIRTIF, RUMP_VNODE_LOCKDEBUG,
+	TOOLCHAIN_MISSING, TOOLDIR, USETOOLS, USE_FORT, USE_HESIOD,
+	USE_INET6, USE_JEMALLOC, USE_KERBEROS, USE_LDAP, USE_LIBCSANITIZER,
+	USE_PAM, USE_PIGZGZIP, USE_SANITIZER, USE_SKEY, USE_SSP,
+	USE_XZ_SETS, USE_YP, X11MOTIFPATH, X11SRCDIR.
+
+The obsolete mk.conf(5) make variables are:
+
+	EXTSRCSRCDIR, MKBFD, MKCRYPTO, MKEXTSRC, MKKDEBUG, MKKERBEROS4,
+	MKLLD, MKLLDB, MKMCLINKER, MKPERFUSE, MKTOOLSDEBUG, NBUILDJOBS,
+	SHAREDSTRINGS, USE_COMBINE, USE_NEW_TOOLCHAIN.
+
+Notable variables documented in mk.conf(5) and duplicated here:
+
+DESTDIR		Directory to contain the built NetBSD system.  If set,
+		special options are passed to the compilation tools to
+		prevent their default use of the host system's
+		/usr/include, /usr/lib, and so forth.  This pathname must
+		be an absolute path, and should not end with a slash (/)
+		

CVS commit: src

2023-07-22 Thread Luke Mewburn
Module Name:src
Committed By:   lukem
Date:   Sat Jul 22 18:50:04 UTC 2023

Modified Files:
src: BUILDING
src/doc: BUILDING.mdoc

Log Message:
BUILDING: list known mk.conf vars. tweak section headers

List known supported and obsolete mk.conf(5) variables,
so that searches in this document at least find them.
This partially reverts my revision 1.144 on 2023-06-12
which completely removed the duplication with mk.conf(5).

Remove quote characters from some section headings;
it makes it harder to search for a section by known name
when rendering in markup variations that use smart quotes.


To generate a diff of this commit:
cvs rdiff -u -r1.159 -r1.160 src/BUILDING
cvs rdiff -u -r1.148 -r1.149 src/doc/BUILDING.mdoc

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

Modified files:

Index: src/BUILDING
diff -u src/BUILDING:1.159 src/BUILDING:1.160
--- src/BUILDING:1.159	Fri Jul 21 22:07:59 2023
+++ src/BUILDING	Sat Jul 22 18:50:04 2023
@@ -169,7 +169,7 @@ CONFIGURATION
 
  Default: "make".
 
- MAKECONFThe name of the make(1) configuration file.  See "make"
+ MAKECONFThe name of the make(1) configuration file.  See make
  variables and mk.conf(5).
 
  Note: Only settable in the process environment.
@@ -229,7 +229,7 @@ CONFIGURATION
 
  Default: "/tmp".
 
-   "make" variables
+   make variables
  Variables that control the behavior of NetBSD builds are documented in
  mk.conf(5) (whose mdoc(7) source is in share/man/man5/mk.conf.5).
 
@@ -246,8 +246,46 @@ CONFIGURATION
 
MAKEVERBOSE?=1
 
+ The supported mk.conf(5) make variables are:
+
+   BSDOBJDIR, BSDSRCDIR, BUILD, BUILDID, BUILDINFO, BUILDSEED,
+   CDEXTRA, CONFIGOPTS, COPTS, CPUFLAGS, DESTDIR, EXTERNAL_TOOLCHAIN,
+   INSTALLBOOT_BOARDS, INSTALLWORLDDIR, KERNARCHDIR, KERNCONFDIR,
+   KERNEL_DIR, KERNOBJDIR, KERNSRCDIR, LOCALTIME, MAKEVERBOSE,
+   MKAMDGPUFIRMWARE, MKARGON2, MKARZERO, MKATF, MKBINUTILS, MKBSDGREP,
+   MKBSDTAR, MKCATPAGES, MKCLEANSRC, MKCLEANVERIFY, MKCOMPAT,
+   MKCOMPATMODULES, MKCOMPATTESTS, MKCOMPATX11, MKCOMPLEX, MKCROSSGDB,
+   MKCTF, MKCVS, MKCXX, MKDEBUG, MKDEBUGKERNEL, MKDEBUGLIB,
+   MKDEBUGTOOLS, MKDEPINCLUDES, MKDOC, MKDTB, MKDTC, MKDTRACE,
+   MKDYNAMICROOT, MKFIRMWARE, MKGCC, MKGCCCMDS, MKGDB, MKGROFF,
+   MKGROFFHTMLDOC, MKHESIOD, MKHOSTOBJ, MKHTML, MKIEEEFP, MKINET6,
+   MKINFO, MKIPFILTER, MKISCSI, MKKERBEROS, MKKMOD, MKKYUA, MKLDAP,
+   MKLIBCSANITIZER, MKLIBCXX, MKLIBSTDCXX, MKLINKLIB, MKLINT, MKLLVM,
+   MKLLVMRT, MKLVM, MKMAKEMANDB, MKMAN, MKMANDOC, MKMANZ, MKMDNS,
+   MKNLS, MKNOUVEAUFIRMWARE, MKNPF, MKNSD, MKOBJ, MKOBJDIRS, MKPAM,
+   MKPCC, MKPF, MKPIC, MKPICINSTALL, MKPICLIB, MKPIE, MKPIGZGZIP,
+   MKPOSTFIX, MKPROFILE, MKRADEONFIRMWARE, MKRELRO, MKREPRO,
+   MKREPRO_TIMESTAMP, MKRUMP, MKSANITIZER, MKSHARE, MKSKEY, MKSLJIT,
+   MKSOFTFLOAT, MKSTATICLIB, MKSTATICPIE, MKSTRIPIDENT, MKSTRIPSYM,
+   MKTEGRAFIRMWARE, MKTPM, MKUNBOUND, MKUNPRIVED, MKUPDATE, MKX11,
+   MKX11FONTS, MKX11MOTIF, MKXORG_SERVER, MKYP, MKZFS, NETBSDSRCDIR,
+   NETBSD_OFFICIAL_RELEASE, NOCLEANDIR, NODISTRIBDIRS, NOINCLUDES,
+   OBJMACHINE, RELEASEDIR, RUMPUSER_THREADS, RUMP_CURLWP, RUMP_DEBUG,
+   RUMP_DIAGNOSTIC, RUMP_KTRACE, RUMP_LOCKDEBUG, RUMP_LOCKS_UP,
+   RUMP_NBCOMPAT, RUMP_VIRTIF, RUMP_VNODE_LOCKDEBUG,
+   TOOLCHAIN_MISSING, TOOLDIR, USETOOLS, USE_FORT, USE_HESIOD,
+   USE_INET6, USE_JEMALLOC, USE_KERBEROS, USE_LDAP, USE_LIBCSANITIZER,
+   USE_PAM, USE_PIGZGZIP, USE_SANITIZER, USE_SKEY, USE_SSP,
+   USE_XZ_SETS, USE_YP, X11MOTIFPATH, X11SRCDIR.
+
+ The obsolete mk.conf(5) make variables are:
+
+   EXTSRCSRCDIR, MKBFD, MKCRYPTO, MKEXTSRC, MKKDEBUG, MKKERBEROS4,
+   MKLLD, MKLLDB, MKMCLINKER, MKPERFUSE, MKTOOLSDEBUG, NBUILDJOBS,
+   SHAREDSTRINGS, USE_COMBINE, USE_NEW_TOOLCHAIN.
+
 BUILDING
-   "make" command line options
+   make command line options
  This is not a summary of all the options available to make(1); only the
  options used most frequently with NetBSD builds are listed here.
 
@@ -273,7 +311,7 @@ BUILDING
 specified by the process environment, the MAKECONF
 configuration file, or the system Makefile segments.
 
-   "make" targets
+   make targets
  These default targets may be built by running make(1) in any subtree of
  the NetBSD source code.  It is recommended that none of these be used
  from the top level Makefile; as a specific exception, "make obj" and
@@ -315,7 +353,7 @@ BUILDING
  tags   Create ctags(1) searchable function lists usable by the ex(1)
 and vi(1) text editors.
 

CVS commit: src

2023-07-22 Thread Luke Mewburn
Module Name:src
Committed By:   lukem
Date:   Sat Jul 22 18:50:04 UTC 2023

Modified Files:
src: BUILDING
src/doc: BUILDING.mdoc

Log Message:
BUILDING: list known mk.conf vars. tweak section headers

List known supported and obsolete mk.conf(5) variables,
so that searches in this document at least find them.
This partially reverts my revision 1.144 on 2023-06-12
which completely removed the duplication with mk.conf(5).

Remove quote characters from some section headings;
it makes it harder to search for a section by known name
when rendering in markup variations that use smart quotes.


To generate a diff of this commit:
cvs rdiff -u -r1.159 -r1.160 src/BUILDING
cvs rdiff -u -r1.148 -r1.149 src/doc/BUILDING.mdoc

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



CVS commit: src/share/man/man5

2023-07-22 Thread Luke Mewburn
Module Name:src
Committed By:   lukem
Date:   Sat Jul 22 18:49:40 UTC 2023

Modified Files:
src/share/man/man5: mk.conf.5

Log Message:
mk.conf(5): tweak BUILDID and option. sort MKKDEBUG

Clarify BUILDID behaviour with OBJMACHINE, and remove unnecessary sentence.
Use option not flag; option may include a flag with an argument.
Sort MKKDEBUG before MKKERBEROS4.


To generate a diff of this commit:
cvs rdiff -u -r1.106 -r1.107 src/share/man/man5/mk.conf.5

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

Modified files:

Index: src/share/man/man5/mk.conf.5
diff -u src/share/man/man5/mk.conf.5:1.106 src/share/man/man5/mk.conf.5:1.107
--- src/share/man/man5/mk.conf.5:1.106	Wed Jul  5 16:40:34 2023
+++ src/share/man/man5/mk.conf.5	Sat Jul 22 18:49:40 2023
@@ -1,4 +1,4 @@
-.\"	$NetBSD: mk.conf.5,v 1.106 2023/07/05 16:40:34 lukem Exp $
+.\"	$NetBSD: mk.conf.5,v 1.107 2023/07/22 18:49:40 lukem Exp $
 .\"
 .\"  Copyright (c) 1999-2023 The NetBSD Foundation, Inc.
 .\"  All rights reserved.
@@ -27,7 +27,7 @@
 .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
 .\" POSSIBILITY OF SUCH DAMAGE.
 .\"
-.Dd July 5, 2023
+.Dd July 22, 2023
 .Dt MK.CONF 5
 .Os
 .\" turn off hyphenation
@@ -134,12 +134,13 @@ targets.
 Identifier for the build.
 If set, this should be a short string that is suitable for use as
 part of a file or directory name.
-The identifier will be appended to
-object directory names, and can be consulted in the
-.Xr make 1
-configuration file in order to set additional build parameters,
-such as compiler flags.
-It will also be used as part of the kernel version string,
+The identifier will be appended to object directory names; if
+.Sy OBJMACHINE
+is also set, then
+.Pa \&. Ns Sy BUILDID
+is appended after
+.Pa \&. Ns Sy MACHINE .
+The identifier will also be used as part of the kernel version string,
 which can be shown by
 .Dq Li uname \-v .
 .DFLTu
@@ -203,7 +204,7 @@ space-separated paths.
 .DFLTu
 .
 .It Sy CONFIGOPTS
-Additional flags to
+Additional options to
 .Xr config 1
 when building kernels.
 .DFLTu
@@ -219,7 +220,7 @@ rather than explicitly set.
 not
 .Sy COPTS ,
 should be used for
-compiler flags that select CPU-related options.
+compiler options that select CPU-related options.
 .Pp
 .Em Note :
 .Sy CFLAGS
@@ -293,7 +294,7 @@ This variable should be used in conjunct
 .Sy HAVE_GCC
 or
 .Sy HAVE_LLVM
-setting to control the compiler flags.
+setting to control the compiler options.
 .Pp
 .Em Note :
 This variable is not yet used in as many places as it should be.
@@ -2422,13 +2423,13 @@ Obsolete.
 .It Sy MKEXTSRC
 Obsolete.
 .
-.It Sy MKKERBEROS4
-Obsolete.
-.
 .It Sy MKKDEBUG
 Use
 .Sy MKDEBUGKERNEL .
 .
+.It Sy MKKERBEROS4
+Obsolete.
+.
 .It Sy MKLLD
 Obsolete.
 .



CVS commit: src/share/man/man5

2023-07-22 Thread Luke Mewburn
Module Name:src
Committed By:   lukem
Date:   Sat Jul 22 18:49:40 UTC 2023

Modified Files:
src/share/man/man5: mk.conf.5

Log Message:
mk.conf(5): tweak BUILDID and option. sort MKKDEBUG

Clarify BUILDID behaviour with OBJMACHINE, and remove unnecessary sentence.
Use option not flag; option may include a flag with an argument.
Sort MKKDEBUG before MKKERBEROS4.


To generate a diff of this commit:
cvs rdiff -u -r1.106 -r1.107 src/share/man/man5/mk.conf.5

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



CVS commit: src

2023-07-21 Thread Luke Mewburn
Module Name:src
Committed By:   lukem
Date:   Fri Jul 21 22:07:59 UTC 2023

Modified Files:
src: BUILDING
src/doc: BUILDING.mdoc

Log Message:
BUILDING: clarify environ vs mk.conf behaviour

Document that variables set in the environment or the
nbmake-MACHINE wrapper script don't override variable
assignments in mk.conf(5), and that using ?= in mk.conf
allows environment / nbmake-MACHINE variables to override
mk.conf.

Consistently refer to "nbmake-MACHINE wrapper script".


To generate a diff of this commit:
cvs rdiff -u -r1.158 -r1.159 src/BUILDING
cvs rdiff -u -r1.147 -r1.148 src/doc/BUILDING.mdoc

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

Modified files:

Index: src/BUILDING
diff -u src/BUILDING:1.158 src/BUILDING:1.159
--- src/BUILDING:1.158	Wed Jul 19 15:40:38 2023
+++ src/BUILDING	Fri Jul 21 22:07:59 2023
@@ -237,6 +237,15 @@ CONFIGURATION
  process environment or the make(1) configuration file mk.conf(5)
  specified by MAKECONF.
 
+ Note: Variables set in the environment, either directly or via build.sh
+ options to set specific values in the nbmake-MACHINE wrapper script do
+ not override variables set in the mk.conf(5) file.  To allow variables in
+ mk.conf(5) to be overridden by the environment or build.sh options,
+ define the variables using the "?=" make(1) variable assignment operator.
+ For example,
+
+   MAKEVERBOSE?=1
+
 BUILDING
"make" command line options
  This is not a summary of all the options available to make(1); only the
@@ -510,8 +519,8 @@ BUILDING
 
  help  Show a help message, and exit.
 
- makewrapper   Create the nbmake-MACHINE wrapper.  This operation is
-   automatically performed for any of the other operations.
+ makewrapper   Create the nbmake-MACHINE wrapper script.  This operation
+   is automatically performed for any of the other operations.
 
  cleandir  Perform "make cleandir".
 
@@ -601,8 +610,8 @@ BUILDING
 
  -B buildid
Set the value of BUILDID to buildid.  This will also append the
-   build identifier to the name of the "make" wrapper script so
-   that the resulting name is of the form
+   build identifier to the name of the nbmake-MACHINE wrapper
+   script so that the resulting name is of the form
"nbmake-MACHINE-BUILDID".
 
  -C cdextras
@@ -749,12 +758,12 @@ BUILDING
 
  -V var=[value]
Set the environment variable var to an optional value.  This is
-   propagated to the nbmake wrapper.
+   propagated to the nbmake-MACHINE wrapper script.
 
  -w wrapper
-   Create the nbmake wrapper script (see below) in a custom
-   location, specified by wrapper.  This allows, for instance, to
-   place the wrapper in PATH automatically.
+   Create the nbmake-MACHINE wrapper script (see below) in a
+   custom location, specified by wrapper.  This allows, for
+   instance, to place the wrapper script in PATH automatically.
 
Note: wrapper is the full name of the file, not just a
directory name.  If a relative path is specified, it will be
@@ -768,23 +777,25 @@ BUILDING
  -xSet MKX11=yes.
 
  -Z varUnset ("zap") the environment variable var.  This is propagated
-   to the nbmake wrapper.
+   to the nbmake-MACHINE wrapper script.
 
  -?Show a help message, and exit.
 
The "nbmake-MACHINE" wrapper script
- If using the build.sh script to build NetBSD, a nbmake-MACHINE script
- will be created in TOOLDIR/bin upon the first build to assist in building
- subtrees on a cross-compile host.
-
- nbmake-MACHINE can be invoked in lieu of make(1), and will instead call
- the up-to-date version of "nbmake" installed into TOOLDIR/bin with
- several key variables pre-set, including MACHINE, MACHINE_ARCH, and
- TOOLDIR.  nbmake-MACHINE will also set variables specified with -V, and
- unset variables specified with -Z.
+ If using the build.sh script to build NetBSD, a nbmake-MACHINE wrapper
+ script will be created in TOOLDIR/bin upon the first build to assist in
+ building subtrees on a cross-compile host.
+
+ The nbmake-MACHINE wrapper script can be invoked in lieu of make(1), and
+ will instead call the up-to-date version of "nbmake" installed into
+ TOOLDIR/bin with several key variables pre-set, including MACHINE,
+ MACHINE_ARCH, and TOOLDIR.  nbmake-MACHINE will also set variables
+ specified with -V, and unset variables specified with -Z.  Note that by
+ default these variables will not override mk.conf(5); see "make"
+ variables for more details.
 
- This script can be symlinked into a directory listed in 

CVS commit: src

2023-07-21 Thread Luke Mewburn
Module Name:src
Committed By:   lukem
Date:   Fri Jul 21 22:07:59 UTC 2023

Modified Files:
src: BUILDING
src/doc: BUILDING.mdoc

Log Message:
BUILDING: clarify environ vs mk.conf behaviour

Document that variables set in the environment or the
nbmake-MACHINE wrapper script don't override variable
assignments in mk.conf(5), and that using ?= in mk.conf
allows environment / nbmake-MACHINE variables to override
mk.conf.

Consistently refer to "nbmake-MACHINE wrapper script".


To generate a diff of this commit:
cvs rdiff -u -r1.158 -r1.159 src/BUILDING
cvs rdiff -u -r1.147 -r1.148 src/doc/BUILDING.mdoc

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



CVS commit: src/tools/compat

2023-07-21 Thread Luke Mewburn
Module Name:src
Committed By:   lukem
Date:   Fri Jul 21 22:05:04 UTC 2023

Modified Files:
src/tools/compat: compat_defs.h

Log Message:
tools/compat/compat_defs.h: improve NAME_MAX compat

Move the NAME_MAX workaround to the  section,
and don't assume that _XOPEN_NAME_MAX is available.


To generate a diff of this commit:
cvs rdiff -u -r1.121 -r1.122 src/tools/compat/compat_defs.h

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

Modified files:

Index: src/tools/compat/compat_defs.h
diff -u src/tools/compat/compat_defs.h:1.121 src/tools/compat/compat_defs.h:1.122
--- src/tools/compat/compat_defs.h:1.121	Sat Jul  8 19:10:00 2023
+++ src/tools/compat/compat_defs.h	Fri Jul 21 22:05:04 2023
@@ -1,4 +1,4 @@
-/*	$NetBSD: compat_defs.h,v 1.121 2023/07/08 19:10:00 palle Exp $	*/
+/*	$NetBSD: compat_defs.h,v 1.122 2023/07/21 22:05:04 lukem Exp $	*/
 
 #ifndef	__NETBSD_COMPAT_DEFS_H__
 #define	__NETBSD_COMPAT_DEFS_H__
@@ -31,17 +31,6 @@
 #endif	/* __linux__ && HAVE_FEATURES_H */
 
 /*
- * Solaris:
- * No NAME_MAX define is available (as documented in the Solaris
- * limits.h file), so use the XOPEN defined constant.
- */
-
-#if defined(__sun__)
-#define NAME_MAX _XOPEN_NAME_MAX
-#endif
-
-
-/*
  * Type substitutes.
  * These are controlled via HAVE_TYPE protections and some of them are needed
  * in other header files (in the build tree not in the host). This is because
@@ -1007,6 +996,15 @@ void *setmode(const char *);
 #ifndef MAXPATHLEN
 #define MAXPATHLEN	4096
 #endif
+
+#ifndef NAME_MAX
+#ifdef _XOPEN_NAME_MAX
+#define NAME_MAX _XOPEN_NAME_MAX
+#else
+#error "Both NAME_MAX and _XOPEN_NAME_MAX are not defined"
+#endif
+#endif
+
 #ifndef PATH_MAX
 #define PATH_MAX	MAXPATHLEN
 #endif



CVS commit: src/tools/compat

2023-07-21 Thread Luke Mewburn
Module Name:src
Committed By:   lukem
Date:   Fri Jul 21 22:05:04 UTC 2023

Modified Files:
src/tools/compat: compat_defs.h

Log Message:
tools/compat/compat_defs.h: improve NAME_MAX compat

Move the NAME_MAX workaround to the  section,
and don't assume that _XOPEN_NAME_MAX is available.


To generate a diff of this commit:
cvs rdiff -u -r1.121 -r1.122 src/tools/compat/compat_defs.h

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



CVS commit: src/usr.bin/xlint/lint1

2023-07-21 Thread Luke Mewburn
Module Name:src
Committed By:   lukem
Date:   Fri Jul 21 15:00:32 UTC 2023

Modified Files:
src/usr.bin/xlint/lint1: Makefile makeman

Log Message:
lint: use TOOL_SED instead of sed

Use ${TOOL_SED} instead of (the host) sed, as the
latter doesn't necessarily support the non-POSIX -E.

PR bin/57533


To generate a diff of this commit:
cvs rdiff -u -r1.99 -r1.100 src/usr.bin/xlint/lint1/Makefile
cvs rdiff -u -r1.6 -r1.7 src/usr.bin/xlint/lint1/makeman

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

Modified files:

Index: src/usr.bin/xlint/lint1/Makefile
diff -u src/usr.bin/xlint/lint1/Makefile:1.99 src/usr.bin/xlint/lint1/Makefile:1.100
--- src/usr.bin/xlint/lint1/Makefile:1.99	Sat Jul 15 13:51:36 2023
+++ src/usr.bin/xlint/lint1/Makefile	Fri Jul 21 15:00:32 2023
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.99 2023/07/15 13:51:36 rillig Exp $
+#	$NetBSD: Makefile,v 1.100 2023/07/21 15:00:32 lukem Exp $
 
 .include 
 
@@ -41,7 +41,8 @@ LINT1=		${TOOLDIR}/libexec/${MACHINE_GNU
 LINT1?=		./${PROG}
 
 ${MAN}.date:	err.c
-	sed -E \
+	${_MKTARGET_CREATE}
+	${TOOL_SED} -E \
 	-e 's,.*()/([0-9]{2})/0?([0-9]+).*,\2 \3\, \1,' \
 	-e 's,^01,January,' \
 	-e 's,^02,February,' \
@@ -67,7 +68,7 @@ cgram.ln: cgram.c
 
 ${MAN}:		makeman err.c Makefile ${MAN}.date
 	${_MKTARGET_CREATE}
-	${HOST_SH} ${.ALLSRC:M*makeman} \
+	SED=${TOOL_SED:Q} ${HOST_SH} ${.ALLSRC:M*makeman} \
 	"$$(cat ${.ALLSRC:M*.date})" ${.ALLSRC:M*err.c} \
 	>${.TARGET}
 

Index: src/usr.bin/xlint/lint1/makeman
diff -u src/usr.bin/xlint/lint1/makeman:1.6 src/usr.bin/xlint/lint1/makeman:1.7
--- src/usr.bin/xlint/lint1/makeman:1.6	Tue Jul  5 22:50:41 2022
+++ src/usr.bin/xlint/lint1/makeman	Fri Jul 21 15:00:32 2023
@@ -1,5 +1,5 @@
 #!/bin/sh
-#	$NetBSD: makeman,v 1.6 2022/07/05 22:50:41 rillig Exp $
+#	$NetBSD: makeman,v 1.7 2023/07/21 15:00:32 lukem Exp $
 #
 # Copyright (c) 2000 The NetBSD Foundation, Inc.
 # All rights reserved.
@@ -28,14 +28,16 @@
 # ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
 # POSSIBILITY OF SUCH DAMAGE.
 
+: ${SED:=sed}
+
 tab='	'
 
 list_messages() {
-	sed -E -n \
+	${SED} -E -n \
 	-e 's|^'"$tab"'"(.+)",.*/\* '"$2"'([0-9]+) \*/$|\2'"$tab"'\1|p' \
 	-e 's|^'"$tab"'"",.*/\* '"$2"'[0-9]+ \*/$|---'"$tab"'(no longer used)|p' \
 	"$1" \
-	| sed -E \
+	| ${SED} -E \
 	-e 's|\\"|"|g' \
 	-e 's||\\e|g' \
 	-e "s|'|\\'|g" \
@@ -43,7 +45,7 @@ list_messages() {
 }
 
 # shellcheck disable=SC2016
-cvsid='$NetBSD: makeman,v 1.6 2022/07/05 22:50:41 rillig Exp $'
+cvsid='$NetBSD: makeman,v 1.7 2023/07/21 15:00:32 lukem Exp $'
 date="$1"
 year="${date##* }"
 messages="$(list_messages "$2" "")"



CVS commit: src/usr.bin/xlint/lint1

2023-07-21 Thread Luke Mewburn
Module Name:src
Committed By:   lukem
Date:   Fri Jul 21 15:00:32 UTC 2023

Modified Files:
src/usr.bin/xlint/lint1: Makefile makeman

Log Message:
lint: use TOOL_SED instead of sed

Use ${TOOL_SED} instead of (the host) sed, as the
latter doesn't necessarily support the non-POSIX -E.

PR bin/57533


To generate a diff of this commit:
cvs rdiff -u -r1.99 -r1.100 src/usr.bin/xlint/lint1/Makefile
cvs rdiff -u -r1.6 -r1.7 src/usr.bin/xlint/lint1/makeman

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



CVS commit: src/bin/pax

2023-07-20 Thread Luke Mewburn
Module Name:src
Committed By:   lukem
Date:   Thu Jul 20 20:10:59 UTC 2023

Modified Files:
src/bin/pax: ar_io.c

Log Message:
pax: fix -Wformat for host tool


To generate a diff of this commit:
cvs rdiff -u -r1.59 -r1.60 src/bin/pax/ar_io.c

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

Modified files:

Index: src/bin/pax/ar_io.c
diff -u src/bin/pax/ar_io.c:1.59 src/bin/pax/ar_io.c:1.60
--- src/bin/pax/ar_io.c:1.59	Mon Feb  4 04:36:41 2019
+++ src/bin/pax/ar_io.c	Thu Jul 20 20:10:59 2023
@@ -1,4 +1,4 @@
-/*	$NetBSD: ar_io.c,v 1.59 2019/02/04 04:36:41 mrg Exp $	*/
+/*	$NetBSD: ar_io.c,v 1.60 2023/07/20 20:10:59 lukem Exp $	*/
 
 /*-
  * Copyright (c) 1992 Keith Muller.
@@ -42,7 +42,7 @@
 #if 0
 static char sccsid[] = "@(#)ar_io.c	8.2 (Berkeley) 4/18/94";
 #else
-__RCSID("$NetBSD: ar_io.c,v 1.59 2019/02/04 04:36:41 mrg Exp $");
+__RCSID("$NetBSD: ar_io.c,v 1.60 2023/07/20 20:10:59 lukem Exp $");
 #endif
 #endif /* not lint */
 
@@ -457,7 +457,7 @@ ar_close(void)
 	/* mimic cpio's block count first */
 	if (frmt && strcmp(NM_CPIO, argv0) == 0) {
 		(void)fprintf(listf, OFFT_F " blocks\n",
-		(rdcnt ? rdcnt : wrcnt) / 5120);
+		(OFFT_T)((rdcnt ? rdcnt : wrcnt) / 5120));
 	}
 
 	ar_summary(0);



CVS commit: src/bin/pax

2023-07-20 Thread Luke Mewburn
Module Name:src
Committed By:   lukem
Date:   Thu Jul 20 20:10:59 UTC 2023

Modified Files:
src/bin/pax: ar_io.c

Log Message:
pax: fix -Wformat for host tool


To generate a diff of this commit:
cvs rdiff -u -r1.59 -r1.60 src/bin/pax/ar_io.c

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



CVS commit: src/bin/pax

2023-07-20 Thread Luke Mewburn
Module Name:src
Committed By:   lukem
Date:   Thu Jul 20 20:09:49 UTC 2023

Modified Files:
src/bin/pax: options.c

Log Message:
pax: need  for ffs()

Fixes warning as host tool on NetBSD 9.99


To generate a diff of this commit:
cvs rdiff -u -r1.119 -r1.120 src/bin/pax/options.c

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

Modified files:

Index: src/bin/pax/options.c
diff -u src/bin/pax/options.c:1.119 src/bin/pax/options.c:1.120
--- src/bin/pax/options.c:1.119	Fri Apr  3 16:13:32 2020
+++ src/bin/pax/options.c	Thu Jul 20 20:09:49 2023
@@ -1,4 +1,4 @@
-/*	$NetBSD: options.c,v 1.119 2020/04/03 16:13:32 joerg Exp $	*/
+/*	$NetBSD: options.c,v 1.120 2023/07/20 20:09:49 lukem Exp $	*/
 
 /*-
  * Copyright (c) 1992 Keith Muller.
@@ -42,7 +42,7 @@
 #if 0
 static char sccsid[] = "@(#)options.c	8.2 (Berkeley) 4/18/94";
 #else
-__RCSID("$NetBSD: options.c,v 1.119 2020/04/03 16:13:32 joerg Exp $");
+__RCSID("$NetBSD: options.c,v 1.120 2023/07/20 20:09:49 lukem Exp $");
 #endif
 #endif /* not lint */
 
@@ -61,6 +61,7 @@ __RCSID("$NetBSD: options.c,v 1.119 2020
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 



  1   2   3   4   5   6   7   8   9   10   >