From 145822c1d27a033402ec05b67c04ad11428df9ec Mon Sep 17 00:00:00 2001 From: Milos Malik Date: Jan 29 2021 13:22:20 +0000 Subject: enable the logging_syslogd_append_public_content boolean The test reproduces scenarios described in 2 different bugs. One of them is BZ#1823672. If this scenario should succeed, a newly introduced boolean called logging_syslogd_append_public_content needs to be enabled. The scenario also requires that the target log file exists before the rsyslogd process tries to append to it. --- diff --git a/selinux-policy/rsyslog-and-similar/runtest.sh b/selinux-policy/rsyslog-and-similar/runtest.sh index 6fefc7a..24f0b0e 100755 --- a/selinux-policy/rsyslog-and-similar/runtest.sh +++ b/selinux-policy/rsyslog-and-similar/runtest.sh @@ -93,9 +93,11 @@ rlJournalStart rlPhaseEnd rlPhaseStartTest "rsyslog omfile cannot append to custom file locations bz#1823672" + rlRun "setsebool logging_syslogd_append_public_content on" rlRun "cp -rv /etc/rsyslog.conf /etc/rsyslog.conf-orig" tst_Time="$(date '+%T')" rlRun "mkdir -p /my/custom/log" + rlRun "touch /my/custom/log/file" rlRun 'semanage fcontext -a -t public_content_rw_t "/my/custom(/.*)?"' rlRun "restorecon -Frv /my" rlRun "echo ' ' >> /etc/rsyslog.conf" @@ -106,8 +108,9 @@ rlJournalStart rlRun "ausearch -m AVC --start $tst_Time" 1 rlRun 'semanage fcontext -d -t public_content_rw_t "/my/custom(/.*)?"' rlRun "semodule -r rsyslog_imfile_policy" - rlRun "cp -rv /etc/rsyslog.conf-orig /etc/rsyslog.conf" + rlRun "cp -rv /etc/rsyslog.conf-orig /etc/rsyslog.conf" rlRun "systemctl restart rsyslog" + rlRun "setsebool logging_syslogd_append_public_content off" rlPhaseEnd rlPhaseStartCleanup