public inbox for git-commits@fedoraproject.org
help / color / mirror / Atom feed
* [tests/selinux] pr775-checkpolicy-revdeps: disable the pager when running journalctl under root
@ 2026-09-11 13:20 Milos Malik
0 siblings, 0 replies; only message in thread
From: Milos Malik @ 2026-09-11 13:20 UTC (permalink / raw)
To: git-commits
A new commit has been pushed.
Repo : tests/selinux
Branch : pr775-checkpolicy-revdeps
Commit : 23f0ff97146a85fc2c469559a0470c0929532b25
Author : Milos Malik <mmalik@redhat.com>
Date : 2023-08-17T11:29:26+02:00
Stats : +1/-4 in 2 file(s)
URL : https://src.fedoraproject.org/tests/selinux/c/23f0ff97146a85fc2c469559a0470c0929532b25?branch=pr775-checkpolicy-revdeps
Log:
disable the pager when running journalctl under root
The journalctl command usually runs the less command as a pager.
The less command usually saves the performed actions in a history
file called ~/.lesshs*.
This sequence of commands can produce SELinux denials when executed
under the root user, because the less' history file is located in
the /root directory.
We believe that the number of programs (SELinux domains) which have
write access to the /root directory should be kept limited.
In order to avoid SELinux denials related to /root/.lesshs* files,
the journalctl command will be executed with the --no-pager option.
---
diff --git a/selinux-policy/journalctl-and-similar/main.fmf b/selinux-policy/journalctl-and-similar/main.fmf
index 3a1cdcb..a5e9de2 100644
--- a/selinux-policy/journalctl-and-similar/main.fmf
+++ b/selinux-policy/journalctl-and-similar/main.fmf
@@ -30,9 +30,6 @@ tag:
- NoRHEL4
- NoRHEL5
- NoRHEL6
- - TIPfail
- - TIPfail_Security
- - TIPfail_systemd
- failinfedora
- targeted
link:
diff --git a/selinux-policy/journalctl-and-similar/runtest.sh b/selinux-policy/journalctl-and-similar/runtest.sh
index ac96c64..39fde79 100755
--- a/selinux-policy/journalctl-and-similar/runtest.sh
+++ b/selinux-policy/journalctl-and-similar/runtest.sh
@@ -134,7 +134,7 @@ rlJournalStart
USER_SECRET="S3kr3t${RANDOM}"
rlRun "useradd -o -u 0 -g 0 -Z sysadm_u ${USER_NAME}"
rlRun "echo ${USER_SECRET} | passwd --stdin ${USER_NAME}"
- rlRun "./ssh.exp ${USER_NAME} ${USER_SECRET} localhost journalctl -l --pager"
+ rlRun "./ssh.exp ${USER_NAME} ${USER_SECRET} localhost journalctl -l --no-pager"
rlRun "userdel -rfZ ${USER_NAME}"
rlRun "setsebool ssh_sysadm_login off"
rlPhaseEnd
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2026-09-11 13:20 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-09-11 13:20 [tests/selinux] pr775-checkpolicy-revdeps: disable the pager when running journalctl under root Milos Malik
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox