public inbox for git-commits@fedoraproject.org
help / color / mirror / Atom feed
From: Ondrej Mosnacek <omosnace@redhat.com>
To: git-commits@fedoraproject.org
Subject: [tests/selinux] pr775-checkpolicy-revdeps: kernel/labeled-cephfs: test also special file types
Date: Fri, 11 Sep 2026 13:18:04 GMT [thread overview]
Message-ID: <178913268451.1.4555506272580255469.tests-selinux-c63ac79b2e0c@fedoraproject.org> (raw)
A new commit has been pushed.
Repo : tests/selinux
Branch : pr775-checkpolicy-revdeps
Commit : c63ac79b2e0c66a9df05f1e13d30ea9c6ddaf014
Author : Ondrej Mosnacek <omosnace@redhat.com>
Date : 2020-08-05T09:15:32+02:00
Stats : +37/-1 in 1 file(s)
URL : https://src.fedoraproject.org/tests/selinux/c/c63ac79b2e0c66a9df05f1e13d30ea9c6ddaf014?branch=pr775-checkpolicy-revdeps
Log:
kernel/labeled-cephfs: test also special file types
An issue was found in CephFS that caused symlinks to be left unlabeled
upon creation. Extend the test to cover also symlinks, special file
types, and directories.
Upstream fix: https://marc.info/?l=ceph-devel&m=159596407215153&w=2
Signed-off-by: Ondrej Mosnacek <omosnace@redhat.com>
---
diff --git a/kernel/labeled-cephfs/runtest.sh b/kernel/labeled-cephfs/runtest.sh
index 83c92f9..7acdb6e 100755
--- a/kernel/labeled-cephfs/runtest.sh
+++ b/kernel/labeled-cephfs/runtest.sh
@@ -14,7 +14,7 @@ function check_config() {
}
function get_file_con() {
- getfattr --absolute-names --only-values -n security.selinux "$1" | tr -d '\000'
+ getfattr -h --absolute-names --only-values -n security.selinux "$1" | tr -d '\000'
}
function strip_mls() {
@@ -109,8 +109,20 @@ rlJournalStart
check_file_con "/mnt/myceph/test" "$SEUSER:object_r:unlabeled_t:s0"
rlRun "chcon system_u:object_r:usr_t:s0 /mnt/myceph/test"
check_file_con "/mnt/myceph/test" "system_u:object_r:usr_t:s0"
+
rlRun "touch /mnt/myceph/test/file"
+ rlRun "mkdir /mnt/myceph/test/dir"
+ rlRun "ln -s /etc /mnt/myceph/test/symlink"
+ rlRun "mknod /mnt/myceph/test/fifo p"
+ rlRun "mknod /mnt/myceph/test/block b 1 3"
+ rlRun "mknod /mnt/myceph/test/char c 1 3"
+
check_file_con "/mnt/myceph/test/file" "$SEUSER:object_r:usr_t:s0"
+ check_file_con "/mnt/myceph/test/dir" "$SEUSER:object_r:usr_t:s0"
+ check_file_con "/mnt/myceph/test/symlink" "$SEUSER:object_r:usr_t:s0"
+ check_file_con "/mnt/myceph/test/fifo" "$SEUSER:object_r:usr_t:s0"
+ check_file_con "/mnt/myceph/test/block" "$SEUSER:object_r:usr_t:s0"
+ check_file_con "/mnt/myceph/test/char" "$SEUSER:object_r:usr_t:s0"
elif rlIsEL '>=8.3'; then
# RHEL-8 - genfscon + xattr handling
# See: https://bugzilla.redhat.com/show_bug.cgi?id=1823764
@@ -121,8 +133,20 @@ rlJournalStart
check_file_con "/mnt/myceph/test" "$SEUSER:object_r:cephfs_t:s0"
rlRun "chcon system_u:object_r:usr_t:s0 /mnt/myceph/test"
check_file_con "/mnt/myceph/test" "system_u:object_r:usr_t:s0"
+
rlRun "touch /mnt/myceph/test/file"
+ rlRun "mkdir /mnt/myceph/test/dir"
+ rlRun "ln -s /etc /mnt/myceph/test/symlink"
+ rlRun "mknod /mnt/myceph/test/fifo p"
+ rlRun "mknod /mnt/myceph/test/block b 1 3"
+ rlRun "mknod /mnt/myceph/test/char c 1 3"
+
check_file_con "/mnt/myceph/test/file" "$SEUSER:object_r:usr_t:s0"
+ check_file_con "/mnt/myceph/test/dir" "$SEUSER:object_r:usr_t:s0"
+ check_file_con "/mnt/myceph/test/symlink" "$SEUSER:object_r:usr_t:s0"
+ check_file_con "/mnt/myceph/test/fifo" "$SEUSER:object_r:usr_t:s0"
+ check_file_con "/mnt/myceph/test/block" "$SEUSER:object_r:usr_t:s0"
+ check_file_con "/mnt/myceph/test/char" "$SEUSER:object_r:usr_t:s0"
else
# F31 and below - just genfscon
check_file_con "/mnt/myceph" "system_u:object_r:cephfs_t:s0"
@@ -130,8 +154,20 @@ rlJournalStart
check_file_con "/mnt/myceph/test" "system_u:object_r:cephfs_t:s0"
rlRun "chcon system_u:object_r:usr_t:s0 /mnt/myceph/test" 1
check_file_con "/mnt/myceph/test" "system_u:object_r:cephfs_t:s0"
+
rlRun "touch /mnt/myceph/test/file"
+ rlRun "mkdir /mnt/myceph/test/dir"
+ rlRun "ln -s /etc /mnt/myceph/test/symlink"
+ rlRun "mknod /mnt/myceph/test/fifo p"
+ rlRun "mknod /mnt/myceph/test/block b 1 3"
+ rlRun "mknod /mnt/myceph/test/char c 1 3"
+
check_file_con "/mnt/myceph/test/file" "system_u:object_r:cephfs_t:s0"
+ check_file_con "/mnt/myceph/test/dir" "system_u:object_r:cephfs_t:s0"
+ check_file_con "/mnt/myceph/test/symlink" "system_u:object_r:cephfs_t:s0"
+ check_file_con "/mnt/myceph/test/fifo" "system_u:object_r:cephfs_t:s0"
+ check_file_con "/mnt/myceph/test/block" "system_u:object_r:cephfs_t:s0"
+ check_file_con "/mnt/myceph/test/char" "system_u:object_r:cephfs_t:s0"
fi
rlPhaseEnd
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=178913268451.1.4555506272580255469.tests-selinux-c63ac79b2e0c@fedoraproject.org \
--to=omosnace@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