From nobody Mon Feb 9 18:04:17 2026 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4f8syp2gHNz6RnfL for ; Mon, 09 Feb 2026 18:04:18 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R13" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4f8syn2Mpfz3tMm for ; Mon, 09 Feb 2026 18:04:17 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1770660257; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=8NdQ6sQK6sbuF/3OfxMkSqyFxR7SyIsz/5eOVHbyMFA=; b=pdS5hPN6kj1n0q0kQyEPiGR7o7ZUr3/1z+Bp6EgxdYvFsFf0vgD98WETbhtedJoB9VW00l ZZig8G4moGM/WWTcspImLk5CCFCh9La4RDtRqboVHq843maURr5ZJRJEDe1V4REa/MsAY9 gLke3G1vQjPwiN6Ns2cThHHCwqq5SkPIcEVmBwSv+N3X6OX7CxaFz55cwok+q4zCOQszyY nSpZOpmuYpMzk2QLrMvowlfQ8T6gIMZYqSZtUS59MCOuR5jOU1Ar4AEXAZkw7tGvJ6MFP3 7l308fZROZgxs6dcDhThxh24tudf2+6tnFZDmafPV9nTPfEENHu22+/4mi7vew== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1770660257; a=rsa-sha256; cv=none; b=Ht/eiSvoqbbjcNmYJwAvOSW42B70BUz1X8btKaUsbNvxbuSmj9z47luBAJYLDcB24LZ1bn Nekg4tVFBAVtPCuXQ2Ra+ZxDyKV6wleRRuWf7Tn97GuICEDTV5LlQR8u/5V/bL02RmW8Id WCZVuj3VIWDjbMaaZLSMklNyDLPWi35z3Emz10BHwavmEiXcIosod8mCjJLeGUKAhnH5n6 7eMKhDas3vzM6Ua+2FAlaqKw5eahPecmX/JjTaK32en2A2LAT+A7tOQLvzp9SiQ+hqVeX+ tZhlC6iK7ooOKHQEweaMk8iJic4tuyFEYHlMoMQ2nkQ7JK6pfYTf7j5dSD6Afw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1770660257; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=8NdQ6sQK6sbuF/3OfxMkSqyFxR7SyIsz/5eOVHbyMFA=; b=dm4gSqoUPU74t0WgseuHuUTGHsiKQ6mzeOIaxvylcRURrt+YT7lpS1RTYDzSwnxRDEcLiA +sJ81/nkqJKNUqxZ0yNNTStUw+94cF9ImR/qcq/+aOi/ZHFpz5QESUtr5CC8ydnm7rJCDa OHwORrZYr+D2VXwsCByY1YeOMYEjXl53Cu8jxCh2SjJvJ1URBOs5rAn9K8ckN0GwmZuca5 RXHTrbHJBsrMJay7xb8nCDZm9eKKyi1ytCdI/5EBQa0qNggNufc4R2nTf/sG75M3IfLjqc n1gvM+n54gEO5s1sSCxy2mmfpaor8ADpNSfO9FUGB9JA5vVbk22tiN/zsIFCeQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4f8syn1vg9zkFx for ; Mon, 09 Feb 2026 18:04:17 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 30880 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Mon, 09 Feb 2026 18:04:17 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mark Johnston Subject: git: c55fcf37e52c - stable/15 - syslogd/tests: Use a helper function to log from within a jail List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/stable/15 X-Git-Reftype: branch X-Git-Commit: c55fcf37e52cb4026a3a040ce2a9fb5df96867d2 Auto-Submitted: auto-generated Date: Mon, 09 Feb 2026 18:04:17 +0000 Message-Id: <698a21a1.30880.6bdd5c43@gitrepo.freebsd.org> The branch stable/15 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=c55fcf37e52cb4026a3a040ce2a9fb5df96867d2 commit c55fcf37e52cb4026a3a040ce2a9fb5df96867d2 Author: Mark Johnston AuthorDate: 2026-01-22 15:50:14 +0000 Commit: Mark Johnston CommitDate: 2026-02-09 18:03:41 +0000 syslogd/tests: Use a helper function to log from within a jail This is just for consistency with all other logger(1) invocations, which happen from the syslogd_log() function. No functional change intended. Reviewed by: jlduran MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D54778 (cherry picked from commit ffdbc1bc2170226547fcad036f01f379625886dd) --- usr.sbin/syslogd/tests/syslogd_test.sh | 60 ++++++++++++++------------- usr.sbin/syslogd/tests/syslogd_test_common.sh | 7 ++++ 2 files changed, 38 insertions(+), 29 deletions(-) diff --git a/usr.sbin/syslogd/tests/syslogd_test.sh b/usr.sbin/syslogd/tests/syslogd_test.sh index 5422e78f6831..fbe390d93aae 100644 --- a/usr.sbin/syslogd/tests/syslogd_test.sh +++ b/usr.sbin/syslogd/tests/syslogd_test.sh @@ -419,15 +419,16 @@ allowed_peer_body() syslogd_start -j syslogd_allowed_peer -b 169.254.0.1:514 -a '169.254.0.2/32' # Make sure that a message from 169.254.0.2:514 is logged. - atf_check jexec syslogd_client \ - logger -p user.debug -t test1 -h 169.254.0.1 -S 169.254.0.2:514 "hello, world" + syslogd_log_jail syslogd_client \ + -p user.debug -t test1 -h 169.254.0.1 -S 169.254.0.2:514 "hello, world" atf_check -o match:"test1: hello, world" cat "${logfile}" + # ... but not a message from port 515. - atf_check -o ignore jexec syslogd_client \ - logger -p user.debug -t test2 -h 169.254.0.1 -S 169.254.0.2:515 "hello, world" + syslogd_log_jail syslogd_client \ + -p user.debug -t test2 -h 169.254.0.1 -S 169.254.0.2:515 "hello, world" atf_check -o not-match:"test2: hello, world" cat "${logfile}" - atf_check -o ignore jexec syslogd_client \ - logger -p user.debug -t test2 -h 169.254.0.1 -S 169.254.0.3:515 "hello, world" + syslogd_log_jail syslogd_client \ + -p user.debug -t test2 -h 169.254.0.1 -S 169.254.0.3:515 "hello, world" atf_check -o not-match:"test2: hello, world" cat "${logfile}" syslogd_stop @@ -435,11 +436,11 @@ allowed_peer_body() # Now make sure that we can filter by port. syslogd_start -j syslogd_allowed_peer -b 169.254.0.1:514 -a '169.254.0.2/32:515' - atf_check jexec syslogd_client \ - logger -p user.debug -t test3 -h 169.254.0.1 -S 169.254.0.2:514 "hello, world" + syslogd_log_jail syslogd_client \ + -p user.debug -t test3 -h 169.254.0.1 -S 169.254.0.2:514 "hello, world" atf_check -o not-match:"test3: hello, world" cat "${logfile}" - atf_check jexec syslogd_client \ - logger -p user.debug -t test4 -h 169.254.0.1 -S 169.254.0.2:515 "hello, world" + syslogd_log_jail syslogd_client \ + -p user.debug -t test4 -h 169.254.0.1 -S 169.254.0.2:515 "hello, world" atf_check -o match:"test4: hello, world" cat "${logfile}" syslogd_stop @@ -472,10 +473,10 @@ allowed_peer_forwarding_body() # A message forwarded to 169.254.0.1:514 should be logged, but one # forwarded to 169.254.0.1:515 should not. - atf_check jexec syslogd_client \ - logger -h 169.254.0.2 -p user.debug -t test1 "hello, world" - atf_check jexec syslogd_client \ - logger -h 169.254.0.2 -p mark.debug -t test2 "hello, world" + syslogd_log_jail syslogd_client \ + -h 169.254.0.2 -p user.debug -t test1 "hello, world" + syslogd_log_jail syslogd_client \ + -h 169.254.0.2 -p mark.debug -t test2 "hello, world" atf_check -o match:"test1: hello, world" cat "${logfile}" atf_check -o not-match:"test2: hello, world" cat "${logfile}" @@ -502,19 +503,19 @@ allowed_peer_wildcard_body() syslogd_start -j syslogd_allowed_peer -b 169.254.0.1:514 -a '169.254.0.2/32:*' # Make sure that a message from 169.254.0.2:514 is logged. - atf_check jexec syslogd_client \ - logger -p user.debug -t test1 -h 169.254.0.1 -S 169.254.0.2:514 "hello, world" + syslogd_log_jail syslogd_client \ + -p user.debug -t test1 -h 169.254.0.1 -S 169.254.0.2:514 "hello, world" atf_check -o match:"test1: hello, world" cat "${logfile}" # ... as is a message from 169.254.0.2:515, allowed by the wildcard. - atf_check jexec syslogd_client \ - logger -p user.debug -t test2 -h 169.254.0.1 -S 169.254.0.2:515 "hello, world" + syslogd_log_jail syslogd_client \ + -p user.debug -t test2 -h 169.254.0.1 -S 169.254.0.2:515 "hello, world" atf_check -o match:"test2: hello, world" cat "${logfile}" # ... but not a message from 169.254.0.3. - atf_check -o ignore jexec syslogd_client \ - logger -p user.debug -t test3 -h 169.254.0.1 -S 169.254.0.3:514 "hello, world" + syslogd_log_jail syslogd_client \ + -p user.debug -t test3 -h 169.254.0.1 -S 169.254.0.3:514 "hello, world" atf_check -o not-match:"test3: hello, world" cat "${logfile}" - atf_check -o ignore jexec syslogd_client \ - logger -p user.debug -t test3 -h 169.254.0.1 -S 169.254.0.3:515 "hello, world" + syslogd_log_jail syslogd_client \ + -p user.debug -t test3 -h 169.254.0.1 -S 169.254.0.3:515 "hello, world" atf_check -o not-match:"test3: hello, world" cat "${logfile}" syslogd_stop @@ -567,15 +568,16 @@ __EOF__ syslogd_start -j syslogd_server -f ${PWD}/server_config -b 169.254.0.1 -b 169.254.0.2 syslogd_start -j syslogd_client -f ${PWD}/client_config -P ${SYSLOGD_PIDFILE}.2 - atf_check jexec syslogd_client \ - logger -h 169.254.0.3 -P $SYSLOGD_UDP_PORT -p user.debug -t test1 "hello, world" - atf_check jexec syslogd_client \ - logger -h 169.254.0.3 -P $SYSLOGD_UDP_PORT -p mail.debug -t test2 "you've got mail" - atf_check jexec syslogd_client \ - logger -h 169.254.0.3 -P $SYSLOGD_UDP_PORT -p ftp.debug -t test3 "transfer complete" - + syslogd_log_jail syslogd_client \ + -h 169.254.0.3 -P $SYSLOGD_UDP_PORT -p user.debug -t test1 "hello, world" atf_check -o match:"test1: hello, world" cat "${logfile}" + + syslogd_log_jail syslogd_client \ + -h 169.254.0.3 -P $SYSLOGD_UDP_PORT -p mail.debug -t test2 "you've got mail" atf_check -o match:"test2: you've got mail" cat "${logfile}" + + syslogd_log_jail syslogd_client \ + -h 169.254.0.3 -P $SYSLOGD_UDP_PORT -p ftp.debug -t test3 "transfer complete" atf_check -o match:"test3: transfer complete" cat "${logfile}" } forward_cleanup() diff --git a/usr.sbin/syslogd/tests/syslogd_test_common.sh b/usr.sbin/syslogd/tests/syslogd_test_common.sh index f06eb417d423..87e9080d99ca 100644 --- a/usr.sbin/syslogd/tests/syslogd_test_common.sh +++ b/usr.sbin/syslogd/tests/syslogd_test_common.sh @@ -96,6 +96,13 @@ syslogd_log() atf_check -s exit:0 -o empty -e empty logger $* } +syslogd_log_jail() +{ + local jailname=$1 + shift + atf_check -s exit:0 -o empty -e empty jexec ${jailname} logger $* +} + # Make syslogd reload its configuration file. syslogd_reload() {