public inbox for git-commits@fedoraproject.org
help / color / mirror / Atom feed
From: Zdenek Pytela <zpytela@redhat.com>
To: git-commits@fedoraproject.org
Subject: [tests/selinux] pr775-checkpolicy-revdeps: selinux-policy: Adjust fapolicyd test for /etc/resolv.conf symlink
Date: Fri, 11 Sep 2026 13:18:33 GMT	[thread overview]
Message-ID: <178913271314.1.15492844809179026394.tests-selinux-9caf81bf10c1@fedoraproject.org> (raw)

            A new commit has been pushed.

            Repo   : tests/selinux
            Branch : pr775-checkpolicy-revdeps
            Commit : 9caf81bf10c16872aba54bc72f4c085de56a7174
            Author : Zdenek Pytela <zpytela@redhat.com>
            Date   : 2020-12-09T09:01:28+00:00
            Stats  : +10/-2 in 1 file(s)
            URL    : https://src.fedoraproject.org/tests/selinux/c/9caf81bf10c16872aba54bc72f4c085de56a7174?branch=pr775-checkpolicy-revdeps

            Log:
            selinux-policy: Adjust fapolicyd test for /etc/resolv.conf symlink

Adjust the fapolicyd test to branch conditionally if /etc/resolv.conf
is a symlink labeled etc_t or a plain file labeled net_conf_t.

---
diff --git a/selinux-policy/fapolicyd-and-similar/runtest.sh b/selinux-policy/fapolicyd-and-similar/runtest.sh
index 6c48848..720f008 100755
--- a/selinux-policy/fapolicyd-and-similar/runtest.sh
+++ b/selinux-policy/fapolicyd-and-similar/runtest.sh
@@ -59,8 +59,16 @@ rlJournalStart
 
     rlPhaseStartTest "bz#1865818"
         rlSEMatchPathCon "/usr/sbin/fapolicyd" ${FILE_CONTEXT}
-        rlSEMatchPathCon "/etc/resolv.conf" "net_conf_t"
-        rlSESearchRule "allow ${PROCESS_CONTEXT} net_conf_t : lnk_file { getattr read } [ ]"
+        if [ -L "/etc/resolv.conf" ]; then
+          rlSEMatchPathCon "/etc/resolv.conf" "etc_t"
+          LINK_PATH=`readlink -f "/etc/resolv.conf"`
+          rlSEMatchPathCon "$LINK_PATH" "net_conf_t"
+          rlSESearchRule "allow ${PROCESS_CONTEXT} etc_t : lnk_file { getattr read } [ ]"
+          rlSESearchRule "allow ${PROCESS_CONTEXT} net_conf_t : file { getattr read } [ ]"
+        else
+          rlSEMatchPathCon "/etc/resolv.conf" "net_conf_t"
+          rlSESearchRule "allow ${PROCESS_CONTEXT} net_conf_t : file { getattr read } [ ]"
+        fi
     rlPhaseEnd
 
     rlPhaseStartTest "bz#1874491"

                 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=178913271314.1.15492844809179026394.tests-selinux-9caf81bf10c1@fedoraproject.org \
    --to=zpytela@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