syslogd/tests: Amend a test to catch leaked process descriptors

This serves to catch the regression fixed by commit
1a669b66dd ("syslogd: reap pipe children on config reload").

Approved by:	so
Security:	FreeBSD-EN-26:23.syslogd
MFC after:	1 week

(cherry picked from commit 231dfc99a0)
(cherry picked from commit 74c5995d2e)
This commit is contained in:
Mark Johnston committed 2026-09-28 13:10:45 +00:00
1 parent c895c72120
commit a64d17f24c
1 file changed
+7
+7
View File
@@ -313,6 +313,7 @@ pipe_action_reload_head()
pipe_action_reload_body()
{
local pipecmd="${PWD}/pipe_cmd.sh"
local pid
cat <<__EOF__ > "${pipecmd}"
#!/bin/sh
@@ -329,15 +330,21 @@ __EOF__
syslogd_start
syslogd_log -p user.debug -t "pipe" -h "${SYSLOGD_LOCAL_SOCKET}" "MSG"
sleep 0.1
pid=$(cat "${SYSLOGD_PIDFILE}")
atf_check pkill -HUP -F "${1:-${SYSLOGD_PIDFILE}}"
sleep 0.1
syslogd_check_log_nopoll "END"
atf_check -o not-match:"[[:space:]]P[[:space:]]" procstat files "${pid}"
}
pipe_action_reload_cleanup()
{
syslogd_stop
}
atf_test_case "jail_noinet" "cleanup"
jail_noinet_head()
{