From 997cda9b7cdffcacba134f974d2b0059334fe215 Mon Sep 17 00:00:00 2001 From: John Safranek Date: Wed, 16 Sep 2026 15:49:05 -0700 Subject: [PATCH] wolfsshd: remove the temp config dir on exit The exit teardown stops the shared daemon before sweeping the registry. stop_wolfsshd is what removes the per-daemon temp directory, which holds the rewritten config and root-owned copies of the trust anchors, and it is idempotent, so a run that stopped already is unaffected. - a run that exits early, on a daemon that will not start or on a failed test, reaches no stop of its own and left the directory in /tmp with a copy of the host key in it --- apps/wolfsshd/test/run_all_sshd_tests.sh | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/apps/wolfsshd/test/run_all_sshd_tests.sh b/apps/wolfsshd/test/run_all_sshd_tests.sh index 2218ef28..7f7afe2a 100755 --- a/apps/wolfsshd/test/run_all_sshd_tests.sh +++ b/apps/wolfsshd/test/run_all_sshd_tests.sh @@ -142,6 +142,11 @@ export WOLFSSHD_TEST_PIDFILE # script's exit status, which would turn a passing run red. run_teardown() { if [ "$USING_LOCAL_HOST" == 1 ]; then + # Before the sweep, and idempotent: this is what removes $SSHD_KEYDIR, + # the temp dir holding the rewritten config and the root-owned copies + # of the trust anchors. The early exits -- a daemon that will not + # start, a failed test -- never reach a stop of their own. + stop_wolfsshd || true stop_all_wolfsshd || true fi rm -f "$WOLFSSHD_TEST_PIDFILE" || true