mirror of
https://github.com/freebsd/freebsd-src.git
synced 2026-11-07 04:36:52 -10:00
syslogd/tests: Amend a test to catch leaked process descriptors
This serves to catch the regression fixed by commit1a669b66dd("syslogd: reap pipe children on config reload"). Approved by: so Security: FreeBSD-EN-26:23.syslogd MFC after: 1 week (cherry picked from commit231dfc99a0) (cherry picked from commit74c5995d2e)
This commit is contained in:
1 parent
c895c72120
commit
a64d17f24c
1 file changed
+7
@@ -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()
|
||||
{
|
||||
|
||||
Reference in new issue
Block a user