freebsd-src/libexec
Kyle Evans 5138a20765 tftpd: explicitly set egid after dropping supplemental groups
tftpd seems to be the last program in base that implicitly relies on
setgroups() to set the egid.  This is a security landmine in portable
software as most operating systems don't behave this way, so do an
explicit setgid() in case the kernel doesn't set it already.

While we're here, FreeBSD's setgroups() has supported nominally clearing
all supplemental groups since 1997.  It still leaves the egid in our
cr_groups[0] because we don't have an out-of-band way to store the egid,
and on other systems it'll clear the supplemental group entirely as one
would want.

Reviewed by:	allanjude (previous version), des, olce
Differential Revision:	https://reviews.freebsd.org/D51149
2025-07-24 09:59:07 -05:00
..
atf atf, kyua: Implement require.kmods. 2025-05-31 14:27:30 +02:00
atrun Remove residual blank line at start of Makefile 2024-07-15 16:43:39 -06:00
blacklistd-helper Remove residual blank line at start of Makefile 2024-07-15 16:43:39 -06:00
bootpd bootptest: Fix a typo in a source code comment 2025-01-26 13:06:55 +01:00
comsat comsat: move uid/gid setting earlier 2024-12-02 14:57:13 -05:00
dma Remove residual blank line at start of Makefile 2024-07-15 16:43:39 -06:00
fingerd Remove residual blank line at start of Makefile 2024-07-15 16:43:39 -06:00
flua flua: fbsd: allow stdout to be captured for exec() processes 2025-07-09 00:12:32 -05:00
ftpd ftpd: Provide an option to turn off FTP anonymous usage 2025-06-26 14:10:14 +02:00
getty Remove residual blank line at start of Makefile 2024-07-15 16:43:39 -06:00
hyperv Remove residual blank line at start of Makefile 2024-07-15 16:43:39 -06:00
kgdb crashinfo: Print stack traces for all on-CPU threads 2024-01-15 16:36:40 -05:00
mail.local Remove residual blank line at start of Makefile 2024-07-15 16:43:39 -06:00
makewhatis.local Remove residual blank line at start of Makefile 2024-07-15 16:43:39 -06:00
mknetid Remove residual blank line at start of Makefile 2024-07-15 16:43:39 -06:00
nuageinit nuageinit: Add wrappers for chmod and chown 2025-07-05 14:54:07 +00:00
phttpget Remove residual blank line at start of Makefile 2024-07-15 16:43:39 -06:00
pppoed Remove residual blank line at start of Makefile 2024-07-15 16:43:39 -06:00
rbootd Remove residual blank line at start of Makefile 2024-07-15 16:43:39 -06:00
rc rc.d: Fix mountd service script. 2025-07-24 15:00:47 +02:00
revnetgroup Remove residual blank line at start of Makefile 2024-07-15 16:43:39 -06:00
rpc.rquotad Remove residual blank line at start of Makefile 2024-07-15 16:43:39 -06:00
rpc.rstatd move the SunOS r-commands into the rcmds package 2025-05-05 16:39:25 +01:00
rpc.rusersd move the SunOS r-commands into the rcmds package 2025-05-05 16:39:25 +01:00
rpc.rwalld move the SunOS r-commands into the rcmds package 2025-05-05 16:39:25 +01:00
rpc.sprayd Remove residual blank line at start of Makefile 2024-07-15 16:43:39 -06:00
rtld-elf rtld: do not relocate tlsinit address twice 2025-07-21 08:29:05 +03:00
rtld-elf32 Remove residual blank line at start of Makefile 2024-07-15 16:43:39 -06:00
save-entropy Remove residual blank line at start of Makefile 2024-07-15 16:43:39 -06:00
smrsh Remove residual blank line at start of Makefile 2024-07-15 16:43:39 -06:00
talkd Remove residual blank line at start of Makefile 2024-07-15 16:43:39 -06:00
tcpd tcp_wrappers: Use default C standard version 2025-01-09 13:07:51 -05:00
tests Remove residual blank line at start of Makefile 2024-07-15 16:43:39 -06:00
tftp-proxy tftp-proxy: move to the pf package 2025-05-05 16:39:25 +01:00
tftpd tftpd: explicitly set egid after dropping supplemental groups 2025-07-24 09:59:07 -05:00
ulog-helper Remove residual blank line at start of Makefile 2024-07-15 16:43:39 -06:00
ypxfr Remove residual blank line at start of Makefile 2024-07-15 16:43:39 -06:00
Makefile atf: Guard libexec/atf with WITH_TESTS_SUPPORT 2024-11-18 18:36:46 +00:00
Makefile.inc Remove residual blank line at start of Makefile 2024-07-15 16:43:39 -06:00