public inbox for git-commits@fedoraproject.org
help / color / mirror / Atom feed
From: Milos Malik <mmalik@redhat.com>
To: git-commits@fedoraproject.org
Subject: [tests/selinux] pr775-checkpolicy-revdeps: enable the root user to log in via SSH
Date: Fri, 11 Sep 2026 13:18:35 GMT [thread overview]
Message-ID: <178913271504.1.11662870673385419142.tests-selinux-12ca54c4097a@fedoraproject.org> (raw)
A new commit has been pushed.
Repo : tests/selinux
Branch : pr775-checkpolicy-revdeps
Commit : 12ca54c4097a0af40236ac9d2930376a635a4680
Author : Milos Malik <mmalik@redhat.com>
Date : 2020-12-14T11:14:32+00:00
Stats : +7/-1 in 2 file(s)
URL : https://src.fedoraproject.org/tests/selinux/c/12ca54c4097a0af40236ac9d2930376a635a4680?branch=pr775-checkpolicy-revdeps
Log:
enable the root user to log in via SSH
If the scenario, where confined root user tries to run the perf tool,
should work, the root user must be able to log in via SSH. This
access is disabled by default. The TC will temporarily enable it.
---
diff --git a/selinux-policy/perf_event-and-related/Makefile b/selinux-policy/perf_event-and-related/Makefile
index 33b31e1..8dd8ac1 100644
--- a/selinux-policy/perf_event-and-related/Makefile
+++ b/selinux-policy/perf_event-and-related/Makefile
@@ -54,7 +54,7 @@ $(METADATA): Makefile
@echo "Type: Regression" >> $(METADATA)
@echo "TestTime: 10m" >> $(METADATA)
@echo "RunFor: selinux-policy" >> $(METADATA)
- @echo "Requires: audit libselinux libselinux-utils policycoreutils selinux-policy selinux-policy-targeted setools-console perf expect openssh-clients" >> $(METADATA)
+ @echo "Requires: audit libselinux libselinux-utils policycoreutils selinux-policy selinux-policy-targeted setools-console perf expect openssh-clients initscripts" >> $(METADATA)
@echo "RhtsRequires: library(selinux-policy/common)" >> $(METADATA)
@echo "Environment: AVC_ERROR=+no_avc_check" >> $(METADATA)
@echo "Priority: Normal" >> $(METADATA)
diff --git a/selinux-policy/perf_event-and-related/runtest.sh b/selinux-policy/perf_event-and-related/runtest.sh
index 7a9577a..3578e39 100755
--- a/selinux-policy/perf_event-and-related/runtest.sh
+++ b/selinux-policy/perf_event-and-related/runtest.sh
@@ -70,6 +70,10 @@ rlJournalStart
rlPhaseEnd
rlPhaseStartTest "real scenario -- confined root sysadm_u"
+ rlRun "grep -i permit /etc/ssh/sshd_config"
+ rlFileBackup /etc/ssh/sshd_config
+ rlRun "sed -i 's/^.*PermitRootLogin.*$/PermitRootLogin yes/' /etc/ssh/sshd_config"
+ rlRun "service sshd restart"
rlRun "setsebool ssh_sysadm_login on"
USER_NAME="toor"
USER_SECRET="S3kr3t${RANDOM}"
@@ -78,6 +82,8 @@ rlJournalStart
rlRun "./ssh.exp ${USER_NAME}/sysadm_r ${USER_SECRET} localhost perf record -o /dev/null echo test"
rlRun "userdel -Z ${USER_NAME}"
rlRun "setsebool ssh_sysadm_login off"
+ rlFileRestore
+ rlRun "service sshd restart"
rlPhaseEnd
rlPhaseStartCleanup
reply other threads:[~2026-09-11 13:18 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=178913271504.1.11662870673385419142.tests-selinux-12ca54c4097a@fedoraproject.org \
--to=mmalik@redhat.com \
--cc=git-commits@fedoraproject.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox