summaryrefslogtreecommitdiff
path: root/tests/mkdir/restorecon.sh
diff options
context:
space:
mode:
Diffstat (limited to 'tests/mkdir/restorecon.sh')
-rwxr-xr-xtests/mkdir/restorecon.sh7
1 files changed, 3 insertions, 4 deletions
diff --git a/tests/mkdir/restorecon.sh b/tests/mkdir/restorecon.sh
index 0e7f03bc9..49e72196f 100755
--- a/tests/mkdir/restorecon.sh
+++ b/tests/mkdir/restorecon.sh
@@ -20,11 +20,10 @@
print_ver_ mkdir mknod mkfifo
require_selinux_
-
-get_selinux_type() { ls -Zd "$1" | sed -n 's/.*:\(.*_t\):.*/\1/p'; }
-
mkdir subdir || framework_failure_
-chcon 'root:object_r:tmp_t:s0' subdir || framework_failure_
+ctx='root:object_r:tmp_t'
+mls_enabled_ && ctx="$ctx:s0"
+chcon "$ctx" subdir || framework_failure_
cd subdir
# --- mkdir -Z ---