policycoreutils/SOURCES/0028-semanage-fcontext-8-improve-e-documentation.patch
2026-08-24 09:32:59 -04:00

42 lines
2.4 KiB
Diff

From fb10d6d66a4c93dda660f4c221646fbd0a0dca3f Mon Sep 17 00:00:00 2001
From: Petr Lautrbach <lautrbach@redhat.com>
Date: Tue, 24 Feb 2026 11:36:41 +0100
Subject: [PATCH] semanage-fcontext(8): improve -e documentation
Content-type: text/plain
Document that substitution based on another substitution does not work
in semanage-fcontext(8) man page
Signed-off-by: Petr Lautrbach <lautrbach@redhat.com>
---
python/semanage/semanage-fcontext.8 | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/python/semanage/semanage-fcontext.8 b/python/semanage/semanage-fcontext.8
index a29b74994763..b037491e3394 100644
--- a/python/semanage/semanage-fcontext.8
+++ b/python/semanage/semanage-fcontext.8
@@ -67,7 +67,7 @@ Extract customizable commands, for use within a transaction
Remove all local customizations
.TP
.I \-e TARGET_PATH, \-\-equal TARGET_PATH
-Substitute FILE_SPEC with TARGET_PATH for file label lookup. This is used with fcontext. Requires source and target path arguments to be path prefixes and does not support regular expressions. The context labeling for the target subtree is made equivalent to that defined for the source.
+Substitute FILE_SPEC with TARGET_PATH for file label lookup. This is used with fcontext. Requires source and target path arguments to be path prefixes and does not support regular expressions. The context labeling for the target subtree is made equivalent to that defined for the source. Note that substitution based on another substitution does not work.
.TP
.I \-f [{a,f,d,c,b,s,l,p}], \-\-ftype [{a,f,d,c,b,s,l,p}]
File Type. This is used with fcontext. Requires a file type as shown in the mode field by ls, e.g. use 'd' to match only directories or 'f' to match only regular files. The following file type options can be passed: f (regular file),d (directory),c (character device), b (block device),s (socket),l (symbolic link),p (named pipe). If you do not specify a file type, the file type will default to "all files".
@@ -94,6 +94,10 @@ i.e. label everything under /home1 the same way /home is labeled
# semanage fcontext \-a \-e /home /home1
# restorecon \-R \-v /home1
+If you substitute /home2 with /home1 from the example above it will not work. You must use direct substitution
+# semanage fcontext \-a \-e /home /home2
+# restorecon \-R \-v /home2
+
For home directories under top level directory, for example /disk6/home,
execute the following commands.
# semanage fcontext \-a \-t home_root_t "/disk6"
--
2.53.0