Commit Graph

431 Commits

Author SHA1 Message Date
jkoshy 548a68cebb Remove obsolete code.
Per src/doc/CHANGES.prev support for the NI_WITHSCOPEID flag was removed
in NetBSD 1.6.
2024-02-16 19:32:38 +00:00
prlw1 36095fdf28 ftpd: deduplicate gcc warning avoidance
OK lukem@
2023-11-25 15:39:51 +00:00
shm 38db8e4650 NetBSD-ftpd 20230930
Update version to "NetBSD-ftpd 20230930" for changes:
- fix uninitialized memory usage in count_users()
- fix pam_set_item call with proper struct passed as PAM_SOCKADDR
2023-09-30 18:10:55 +00:00
shm c21a14cb31 pam_set_item PAM_SOCKADDR expects sockaddr_storage structure
Instead, internal struct sockinet was used. Because it's length is shorter
than sockaddr_storage, libpam was copying also memory outside of sockinet
struct.
2023-09-30 18:06:24 +00:00
shm cb93dc6375 Fix uninitialized memory usage in count_users()
If the file was previously empty, pids table is not set, the code however used
pids[0] which is uninitialized in this case. In some scenarios it may lead to
propagate garbage value from pids[0] to the file and cause writing outside of
allocated memory.

OK lukem@
2023-09-29 14:49:03 +00:00
lukem b92ca11e10 version NetBSD-ftpd 20230922 for MLSD/MLST fix 2023-09-22 21:57:55 +00:00
shm c6bc4b17bd Add missing check_login checks for MLST and MLSD 2023-09-22 11:23:28 +00:00
lukem 566ae232e2 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.
2023-09-02 12:16:29 +00:00
lukem c4b7a9e794 bsd.own.mk: rename GCC_NO_* to CC_WNO_*
Rename compiler-warning-disable variables from
	GCC_NO_warning
to
	CC_WNO_warning
where warning is the full warning name as used by the compiler.

GCC_NO_IMPLICIT_FALLTHRU is CC_WNO_IMPLICIT_FALLTHROUGH

Using the convention CC_compilerflag, where compilerflag
is based on the full compiler flag name.
2023-06-03 09:09:01 +00:00
andvar e2710f6fc4 fix various typos in comments. 2022-04-17 21:24:52 +00:00
christos 208ba1ff3b 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.
2021-07-03 14:59:49 +00:00
lukem 167898024d ftpd.conf(5): remove duplicate "be"
Two be or not two be.
Noted by SAITOH Masanobu in private mail.
2020-08-22 08:08:47 +00:00
lukem 564e323839 add missing RCSIDs
(copyrights could be added too - that's up to christos@)
2020-07-04 05:18:37 +00:00
lukem 95fccb75a2 NetBSD-ftpd 20200615
Update version to "NetBSD-ftpd 20200615" for changes:
- Increase some buffer sizes.
- Rename blacklist to blocklist.
2020-07-04 01:20:42 +00:00
christos 2f0bfbf344 Rename blacklist -> blocklist 2020-06-15 01:57:29 +00:00
christos 3a70c5972e bump sizes 2019-10-15 18:29:32 +00:00
christos 384c9fdd8d use strncpy... 2019-10-15 18:29:21 +00:00
mrg de11d87641 introduce some common variables for use in GCC warning disables:
GCC_NO_FORMAT_TRUNCATION    -Wno-format-truncation (GCC 7/8)
GCC_NO_STRINGOP_TRUNCATION  -Wno-stringop-truncation (GCC 8)
GCC_NO_STRINGOP_OVERFLOW    -Wno-stringop-overflow (GCC 8)
GCC_NO_CAST_FUNCTION_TYPE   -Wno-cast-function-type (GCC 8)

use these to turn off warnings for most GCC-8 complaints.  many
of these are false positives, most of the real bugs are already
commited, or are yet to come.


we plan to introduce versions of (some?) of these that use the
"-Wno-error=" form, which still displays the warnings but does
not make it an error, and all of the above will be re-considered
as either being "fix me" (warning still displayed) or "warning
is wrong."
2019-10-13 07:28:04 +00:00
lukem fc9234654d clarify the fd used for blacklisting.
Use STDIN_FILENO instead of 0 as the fd to blacklist_r(),
since we use the former in ftpd.c
2019-01-29 23:19:30 +00:00
lukem 086f834b20 NetBSD-ftpd 20180428
Update version to "NetBSD-ftpd 20180428" for changes:
- Fix violations of the sequence point rule.
- 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.
2019-01-29 11:51:05 +00:00
gson 4828bdca7d No semicolon after macro do ... while (0) wrapper. 2018-06-23 07:21:00 +00:00
riastradh 7bc66ed4ff Add -f option to ftpd to stay in foreground with -D.
From nia in PR bin/53221.
2018-04-28 13:38:00 +00:00
mrg 2e19323388 add LIBKRB5_LDADD/LIBKRB5_DPADD and their static counterparts
to bsd.prog.mk.  use them instead of hard coding various lists
of libraries for krb5.

this fixes static builds.
2018-02-25 00:16:48 +00:00
wiz 01869ca4d2 Remove workaround for ancient HTML generation code. 2017-07-03 21:28:48 +00:00
shm 31d615acc3 CID 603440: ensure that closing socket exists 2016-07-19 21:25:38 +00:00
christos f2192299b9 volatile for gcc 5 2016-03-17 00:17:58 +00:00
christos 8d60259f07 PR/50665: David Binderman: move "dir" to the outer scope so it stays alive
when the pointer is used later.
2016-01-17 14:46:07 +00:00
shm c766c3d3c2 Use explicit_memset(3) instead of memset(3) to clear password 2015-08-10 07:45:50 +00:00
shm 92a992f213 Fix directory stream leaks 2015-08-10 07:32:49 +00:00
shm c09e755be0 Removed unnecessary memset(3) call 2015-08-09 20:34:24 +00:00
shm 0c7f5afe2e Clear utmpx struct before writing it to wtmpx files 2015-08-09 12:17:30 +00:00
christos 068e5a5145 blacklist hooks 2015-01-25 15:52:44 +00:00
christos 5a45295fbd fstat returns -1 on error (Maxime Villard)
also while (1) -> for (;;)
2013-07-31 19:50:47 +00:00
christos 304ddee50c remove unneeded initialization. 2013-07-03 14:16:01 +00:00
christos 9c7eb973a4 check that stat succeeded before testing the guts of struct stat
(Manime Villard)
2013-07-03 14:15:47 +00:00
joerg 9e69720425 Fix violations of the sequence point rule. 2013-06-28 15:04:35 +00:00
lukem 1baf19f383 Convert from __attribute__(foo) to the __foo equiv in <sys/cdefs.h> 2013-03-21 05:53:01 +00:00
lukem f4ec715007 Update version to 20110904 for the user-visible change I made back then:
Reduce priority of syslog message if getpeername returns ENOTCONN.
   PR bin/18934 by Greg A. Woods (with supplied fix).
2013-03-21 00:17:26 +00:00
christos bef47ea987 include pwd.h for password stuff 2012-11-04 20:46:46 +00:00
dholland c5642eeaf7 Pass WARNS=5 2012-06-19 06:06:34 +00:00
plunky 2b8aaed8cd NULL does not need a cast, here 2011-09-16 16:13:16 +00:00
lukem 30781daf0c Reduce priority of syslog message if getpeername returns ENOTCONN.
PR bin/18934 by Greg A. Woods (with supplied fix).
2011-09-04 23:16:41 +00:00
joerg 9eba1e423c Use __dead 2011-08-29 20:41:06 +00:00
christos 41592955fd remove gcc-4.5 hack 2011-08-14 11:46:28 +00:00
joerg 30dc9201bb Fix memcpy usage. 2011-07-01 02:46:15 +00:00
mrg c111245a78 apply some -Wno-error and/or -fno-strict-aliasing.
all of this should be looked at closer, but some of them are not
very trivial.
2011-06-22 02:49:41 +00:00
elric 07b0c75a48 We no longer need -I/usr/include/krb5. 2011-04-24 21:42:06 +00:00
christos bfd4da8575 PR/44390: Paul Koning: make code gcc-4.5.1 friendly. 2011-01-14 23:56:13 +00:00
lukem f009f7a2e4 Update version to 20100320 for Christos' commit to popen.c 1.37 for:
PR/43023: Bruce Cran: FTPD bug remote crash
2010-03-21 20:27:26 +00:00
christos 692b0132a0 PR/43023: Bruce Cran: FTPD bug remote crash
Since we specify NOCHECK, in the NOMATCH case gl_pathv can be NULL.
(From FreeBSD)
2010-03-20 18:23:30 +00:00