Skip to contentSkip to conversation

Improve usage()

SEMANAGE/utility Ivan Gyurdiev 2 participants 2 messages Feb 14, 2006 SELinux security module

lore
Share & tools
lore
#0 lore raw

Maybe it's just me, but the semanage usage() is still not making sense... Please apply if you consider this an improvement.

1) Document arguments to -ftype
2) Give example of a list of multiple roles (space separated, quoted)
3) Specify which protocols are allowed for ports
4) Abandon alphabetical ordering for more logical ordering.
Specifically, group primary options (-a/d/m/l) together, and then have a section for object-specific options below.

policycoreutils/semanage/semanage +25 -10
diff -Naurp --exclude-from excludes old/policycoreutils/semanage/semanage new/policycoreutils/semanage/semanage
@@ -33,21 +33,36 @@ semanage user -{a|d|m} [-LrR] selinux_na
 semanage port -{a|d|m} [-tr] [ -p protocol ] port | port_range\n\
 semanage interface -{a|d|m} [-tr] interface_spec\n\
 semanage fcontext -{a|d|m} [-frst] file_spec\n\
-semanage translation -{a|d|m} [-T] level\n\
+semanage translation -{a|d|m} [-T] level\n\n\
+\
+Primary Options:\n\
+\
 	-a, --add        Add a OBJECT record NAME\n\
 	-d, --delete     Delete a OBJECT record NAME\n\
+	-m, --modify     Modify a OBJECT record NAME\n\
+	-l, --list       List the OBJECTS\n\n\
+	-h, --help       Display this message\n\
+	-n, --noheading  Do not print heading when listing OBJECTS\n\n\
+\
+Object-specific Options (see above):\n\
 	-f, --ftype      File Type of OBJECT \n\
-	-h, --help       display this message\n\
-	-l, --list       List the OBJECTS\n\
+		"" (all files) \n\
+		-- (regular file) \n\
+		-d (directory) \n\
+		-c (character device) \n\
+		-b (block device) \n\
+		-d (directory) \n\
+		-s (socket) \n\
+		-p (named pipe) \n\n\
+\
+	-p, --proto      Port protocol (tcp or udp)\n\
 	-L, --level      Default SELinux Level\n\
-	-m, --modify     Modify a OBJECT record NAME\n\
-	-n, --noheading  Do not print heading when listing OBJECTS\n\
-	-p, --proto      Port protocol\n\
-	-r, --range      MLS/MCS Security Range\n\
-	-R, --roles      SELinux Roles (Separate by spaces)\n\
-	-s, --seuser     SELinux user name\n\
+	-R, --roles      SELinux Roles (ex: "sysadm_r staff_r")\n\
+	-T, --trans      SELinux Level Translation\n\n\
+\
+	-s, --seuser     SELinux User Name\n\
 	-t, --type       SELinux Type for the object\n\
-	-T, --trans      SELinux Level Translation\n\
+	-r, --range      MLS/MCS Security Range\n\
 '
 		print message
 		sys.exit(1)
#1 lore raw
Quoted 9 lines · Ivan Gyurdiev

Maybe it's just me, but the semanage usage() is still not making sense... Please apply if you consider this an improvement.

1) Document arguments to -ftype
2) Give example of a list of multiple roles (space separated, quoted)
3) Specify which protocols are allowed for ports
4) Abandon alphabetical ordering for more logical ordering. Specifically, group primary options (-a/d/m/l) together, and then have a section for object-specific options below.

Yes, I agree that this is clearer. Need to modify the man page in the same manner, I think.

Signature · 8 lines
Stephen Smalley
National Security Agency


--
This message was distributed to subscribers of the selinux mailing list.
If you no longer wish to subscribe, send mail to [email protected] with
the words "unsubscribe selinux" without quotes as the message.