Skip to contentSkip to conversation

semanage-fcontext(8): improve -e documentation

PATCH In review Petr Lautrbach 2 participants 3 messages Mar 9 – May 12 SELinux security module

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 semanage-fcontext(8): improve -e documentation

Document that substitution based on another substitution does not work in semanage-fcontext(8) man page

---
 python/semanage/semanage-fcontext.8 | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)
python/semanage/semanage-fcontext.8 +5 -1
index a29b74994763..b037491e3394 100644
@@ -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"
Signature · 1 line
2.53.0
Acked-by on v2 1/1
#1 lore raw
Quoted 5 lines · Petr Lautrbach

Document that substitution based on another substitution does not work in semanage-fcontext(8) man page

Quoted 32 lines
---
 python/semanage/semanage-fcontext.8 | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)
python/semanage/semanage-fcontext.8 +5 -2
index a29b74994763..b037491e3394 100644
@@ -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

#2 lore raw
Quoted 10 lines · James Carter
Quoted 5 lines · Petr Lautrbach

Document that substitution based on another substitution does not work in semanage-fcontext(8) man page

Merged.
Thanks,
Jim

Quoted 32 lines
Quoted 32 lines
---
 python/semanage/semanage-fcontext.8 | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)
python/semanage/semanage-fcontext.8 +5 -2
index a29b74994763..b037491e3394 100644
@@ -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