Up to [cvs.NetBSD.org] / othersrc / libexec / tnftpd / src
Request diff between arbitrary revisions
Keyword substitution: kv
Default branch: MAIN
merge from NetBSD-20130321 to NetBSD-20190129
Import NetBSD ftpd as at 20190129 Notable changes: - Fix violations of the sequence point rule. - Add volatile for gcc 5. - Check that stat and fstat succeed. - Support blacklistd(8) hooks. - Clear utmpx struct before writing it to wtmpx files. - Fix directory stream leaks. - Use explicit_memset(3) instead of memset(3) to clear password. - Fix scope of variable. PR misc/50665. - Ensure that closing socket exists. CID 603440. - Add -f option to ftpd to stay in foreground with -D. PR bin/53221. - Update version to "NetBSD-ftpd 20180428".
Merge NetBSD-20130321
Import NetBSD-ftpd 20100320: - Fix warnings and build issues - Fix memcpy usage - Fix remote crash (fix was already pulled up manually to tnftpd). PR/43023 - Reduce priority of syslog message if getpeername returns ENOTCONN. PR/18934
revert 1.14 cmds.c 1.14 extern.h 1.16 ftpcmd.y 1.32 ftpd.c because it wasn't necessary in tnftpd as these files have been modified to use "tnftpd.h" instead of the various NetBSD system headers.
merge tzfile.h in one place, and deal with not having it.
Merge NetBSD-ftpd 20091107
reimport; this time after munging the RCSIDs...
Sync to NetBSD-ftpd 20091107: * Fix WARNS=4 issues (const & sign mismatches, etc) * Ensure various ftpd.conf values can't exceed their underlying types. * Fix for 64 bit time_t and dev_t * Rename internal getline() function to get_line() so it does conflict with the getline(3) libc function. * Log both the hostname and numeric address. * Improve man page mdoc formatting
Merge NetBSD-20080921
Sync to NetBSD-ftpd 20080921:
* Don't split large commands into multiple commands; just fail on them.
This prevents CSRF-like attacks, when a web browser is used to access
an ftp server.
Reported by Maksymilian Arciemowicz <cxib@securityreason.com>.
Fix mostly derived from OpenBSD, written by Moritz Jodeit
<moritz@OpenBSD.org>
* Enhance -C to support an optional @host ('-C user[@host]'):
checks whether user as connecting from host would be granted
access by ftpusers(5).
Support IPv6 in the host directive of ftpusers(5).
Both features from Rudolf Cejka <cejkar@fit.vutbr.cz>
(FreeBSD's tnftpd port maintainer).
Merge NetBSD-20080609
Import NetBSD ftpd 20080609: - Don't use non-standard "u_<foo>" types. - Strip trailing whitespace (as well as ':'s) off PAM password prompts. - Improve some debug logging related to PAM.
merge NetBSD-ftpd 20080504
Import NetBSD-ftpd from 20080504. Changes include:
* Reorganize USE_PAM so that the PAM conversation has a chance to
display a custom message in the 331 reply to USER.
* Remove clause 3 and 4 from TNF licenses
* Switch from lockf() to (more portable) fcntl() locking
* Rename HAVE_SOCKADDR_SA_LEN to HAVE_STRUCT_SOCKADDR_SA_LEN.
* Use defined(HAVE_foo) instead of just testing HAVE_foo.
* Replace references from draft-ietf-ftpext-mlst-NN to RFC 3659.
* Explicitly note the unsupported requests from RFC 2228.
* Improvements from FreeBSD:
- Document `ftp-chroot' from login.conf(5).
- Document that SIZE is prevented for files > 10240 bytes via ASCII transfers.
* Add -n option to display addresses in logs.
* Rename cred_t to ftpd_cred_t; the former causes a nameclash on Solaris.
* Expand documentation on numeric argument suffix parsing, and convert
to IEC 60027-2 prefixes for 2^n multiples ("KiB" instead of "KB", etc.)
Move to new 2 clause license
Import NetBSD-ftpd from 20080504. Changes include:
* Reorganize USE_PAM so that the PAM conversation has a chance to
display a custom message in the 331 reply to USER.
* Remove clause 3 and 4 from TNF licenses
* Switch from lockf() to (more portable) fcntl() locking
* Rename HAVE_SOCKADDR_SA_LEN to HAVE_STRUCT_SOCKADDR_SA_LEN.
* Use defined(HAVE_foo) instead of just testing HAVE_foo.
* Replace references from draft-ietf-ftpext-mlst-NN to RFC 3659.
* Explicitly note the unsupported requests from RFC 2228.
* Improvements from FreeBSD:
- Document `ftp-chroot' from login.conf(5).
- Document that SIZE is prevented for files > 10240 bytes via ASCII transfers.
* Add -n option to display addresses in logs.
* Rename cred_t to ftpd_cred_t; the former causes a nameclash on Solaris.
* Expand documentation on numeric argument suffix parsing, and convert
to IEC 60027-2 prefixes for 2^n multiples ("KiB" instead of "KB", etc.)
Overhaul to use autoconf 2.61 instead of autoconf 2.13. Notable differences: * --with-pam to enable PAM. * --with-skey improved. * build-related auxiliary files now in ./build-aux/ * large-file support should be better detected * use autoconf 2.61 macros to detect struct members, declarations, types (etc). * remove support for SOCKS for now (until test systems are available) * use #if defined(foo) rather that just #if foo. * always use our arpa_ftp.h rather than trying to detect if FTP_NAMES works.
Merge NetBSD-20060923
Import NetBSD-ftpd 20060923: * Rename debug -> ftpd_debug, xstrdup -> ftpd_strdup * Fix comment about DEFAULT_UMASK. Pointed out in private mail by Tetsuya Isaki and Dmitry Sivachenko. * Add recvbufsize configuration option. This allows for setting the passive socket's SO_RCVBUF. Option works similarly to the current sendbufsize configuration option. * Change how recveive_data() works. When reading data from the socket for passive transfers to the server, receive_data() now works very similar to send_data_with_read(). Reads from the network are now done using either the filesystem block size or the configuration option readsize chunks. * Add hidesymlinks configuration option. This adds a -L to all ls command arguments so that the file or directory the link references is listed rather than the link itself. This was inspired by IRIX ftpd's -S option. * Change _PATH_FOO to _NAME_FOO where FOO is not a path. * Reorder some declarations so that parsers generated by bison can compile. Fix from Michael Richardson. * Implement option "-D", for running ftpd in standalone mode (daemon). ftpd will listen on the default FTP port for incoming connections and fork a child for each connection. This is lower overhead than starting ftpd from inetd(8) and thus might be useful on busy servers to reduce load. Inspired by FreeBSD. * Change (mostly) int to socklen_t. GCC 4 doesn't like that int and socklen_t are different signness. * Remove unreachable code (res could never be NULL here). Fixes Coverity CID 712. * Set file to NULL after calling fclose(). Fixes Coverity CID 2669. * Make sure that "su" is initialized before dereferencing it. Fixes Coverity CID 1075. * Fix some typos. * NLST should return 450 instead of 550 upon error, per RFC 959. * logxfer(): don't use the same buffer to store the results of two separate concurrent realpath(3)s, otherwise we'll log the wrong information for a rename. Noted by Dmitry Sivachenko in private mail. * s/getpwnam/sgetpwnam/ Found by John Nemeth. * Add PAM and LOGIN_CAP support. Mostly from FreeBSD. If pam is defined, then we don't fall back to other authentications even if PAM fails due to a system error (e.g. configuration problem). * Fix inverted test for expired passwords. * Cleanup utmp and utmpx support. - make them symmetric - add a function to open the wtmp file explicitly very early in the game * Apply patch from PR bin/33261 sent by FUKAOMI Naoki: "ftpd does not update wtmpx".
Merge (RCSID) conflicts.
Sync to NetBSD ftpd 2004-08-09. Fixes from (or inspired by) OpenBSD: * Fix yacc parser error recovery so that setjmp(3)/longjmp(3) is unnecessary. * Fix SIGURG handler to set an urgflag that's later tested, rather than abusing setjmp(3)/longjmp(3). * Use "volatile sig_atomic_t" as the type of variables modified by sig handlers. * Use sigaction(3) instead of signal(3) to set the signal handlers. * Only set the main SIGALRM handler once. If we need to change it, cache the old handler and restore appropriately... * Remove a bunch of signal races by improving the signal handlers. * Fix memory leak with 'ESPV ALL'. * Correctly clamp illegal "SITE CHMOD" mode values. * Fix minor memory leak with fromname. My stuff: * Clean up the debug message in reply(); use vsnprintf(3) instead of vsyslog(3). * Rework parsing of OOB commands to _not_ use the yacc parser, since the latter isn't reentrant and the hacks to work around that are ugly. We now examine urgflag at appropriate locations and call handleoobcmd() if it's set. Since the only OOB commands we currently implement are ABOR and STAT, this isn't an issue. (I also can't find the reference in RFC2228 where MIC, CONF & ENC are OOB-only commands. Go figure.) I could clean up the is_oob stuff some more, but the remaining stuff in ftpcmd.y is harmless and it's unnecessary churn right this moment.
resolve conflicts (mainly RCSIDs)
Sync to NetBSD ftpd 20031210. Notable changes:
* Move UCB-licensed code from 4-clause to 3-clause licence.
Patches provided by Joel Baker in PR 22284
* Add ftpd_loginx() and ftpd_logwtmpx() and use them to hold wtmpx file
open while a session. Close bin/21692 by bqt@Krille.Update.UU.SE.
* Fix typos accidentally introduced in rev 1.70 as part of the large
number support. (NetBSD yacc didn't barf on these, although Solaris
and HP/UX's did...)
* Don't declare "yylex()" static; AFAICT it shouldn't be, and it causes
build problems with the output of some versions of yacc.
* Use sysconf(_SC_LOGIN_NAME_MAX) to determine the length of login
names, rather than assuming LOGIN_NAME_MAX. Based on patch from
Garrett Wollman via David O'Brien (both at FreeBSD.org)
* netbsd.org->NetBSD.org
* Move Jason Downs's code from a 4-clause to a 3-clause licence by
removing the advertising clause. Diffs provided in PR 22410 by Joel
Baker, confirmed to the board by Jason Downs.
With additional thanks to Jason Thorpe.
merge changes from NetBSD-20030226
update to 20030226
merge conflicts
ftpd from 20030223
- convert to using tnftpd.h - generate the man pages - crank the version back to 2.0 beta 1 - remove now unnecessary files
NetBSD's libexec/ftpd from 20021026
Initial revision