workaround FreeBSD <fts.h> 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 <fts.h>.
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.
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.
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
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.
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
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
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.
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.