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: delete all users at the end
Date: Fri, 11 Sep 2026 13:19:35 GMT	[thread overview]
Message-ID: <178913277542.1.5127454535215949041.tests-selinux-6f3d0475b223@fedoraproject.org> (raw)

            A new commit has been pushed.

            Repo   : tests/selinux
            Branch : pr775-checkpolicy-revdeps
            Commit : 6f3d0475b223fc0f903803edcad04efe03fd7c5e
            Author : Milos Malik <mmalik@redhat.com>
            Date   : 2022-01-26T20:09:36+01:00
            Stats  : +4/-1 in 1 file(s)
            URL    : https://src.fedoraproject.org/tests/selinux/c/6f3d0475b223fc0f903803edcad04efe03fd7c5e?branch=pr775-checkpolicy-revdeps

            Log:
            delete all users at the end

When the first user is deleted before the second user is created,
they will have the same UID and the systemd processes will be
confused. The confusion leads to incorrect SELinux labels on
subdirectories of /run/user/<UID>/.

By deleting all users at the end, we ensure that each of
them will have a different UID and their directories will be
labeled correctly.

---
diff --git a/selinux-policy/bz481628-send-msg-to-dbus/runtest.sh b/selinux-policy/bz481628-send-msg-to-dbus/runtest.sh
index 1ad9cb7..19e95d7 100755
--- a/selinux-policy/bz481628-send-msg-to-dbus/runtest.sh
+++ b/selinux-policy/bz481628-send-msg-to-dbus/runtest.sh
@@ -134,6 +134,7 @@ rlJournalStart
 
         rlRun "setsebool ssh_sysadm_login on"
         rlRun "setsebool selinuxuser_tcp_server on"
+        CREATED_USERS=""
         # TODO: guest_u, xguest_u cannot successfully run systemctl
         for SELINUX_USER in user_u staff_u sysadm_u unconfined_u ; do
             USER_NAME="user${RANDOM}"
@@ -151,8 +152,10 @@ rlJournalStart
                 rlRun "grep \"${SELINUX_USER}:object_r:session_dbusd_tmp_t:.* services\" files.txt"
             fi
             rlRun "./ssh.exp ${USER_NAME} ${USER_SECRET} localhost /usr/bin/busctl --user --no-pager"
+            CREATED_USERS="${USER_NAME} ${CREATED_USERS}"
+        done
+        for USER_NAME in ${CREATED_USERS} ; do
             rlRun "userdel -rfZ ${USER_NAME}"
-            sleep 10
         done
         rlRun "setsebool selinuxuser_tcp_server off"
         rlRun "setsebool ssh_sysadm_login off"

                 reply	other threads:[~2026-09-11 13:19 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=178913277542.1.5127454535215949041.tests-selinux-6f3d0475b223@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