[PATCH 1/6] busybox -- SELinux option support for coreutils

Denis Vlasenko vda.linux at googlemail.com
Thu Feb 8 22:29:37 UTC 2007


On Thursday 08 February 2007 07:54, Yuichi Nakamura wrote:
> 
> [1/6] busybox-coreutils-common-01.patch
>  - usage.h for SELinux options
> 
> Signed-off-by: Yuichi Nakamura <ynakam at hitachisoft.jp>


@@ -1299,9 +1301,8 @@
 #define id_full_usage \
        "Print information for USERNAME or the current user" \
        "\n\nOptions:\n" \
-	USE_SELINUX( \
-       "	-c	Prints only the security context\n") \
-       "	-g	Prints only the group ID\n" \
+	   USAGE_SELINUX("	-Z	prints only the security context\n")	\
+	   "	-g	Prints only the group ID\n"						\

Well I can fix occasional problems but this is a bitt too much.
I would prefer more careful formatting, like:



        "	-u	Prints only the user ID\n" \
        "	-n	Print a name instead of a number\n" \
        "	-r	Prints the real user ID instead of the effective ID"
@@ -1519,7 +1520,9 @@
        "	-m	Set permission modes\n" \
        "	-o	Set ownership\n" \
        "	-p	Preserve date\n" \
-       "	-s	Strip symbol tables"
+       "    -s  Strip symbol tables\n" \
+	USAGE_SELINUX("	-P	preserve security context\n") \
+	USAGE_SELINUX("	Z	CONTEXT  set security context of copy to CONTEXT")
 
 #define ip_trivial_usage \
        "[OPTIONS] {address | link | route | tunnel | rule} {COMMAND}"
@@ -1829,7 +1832,9 @@
 	USE_SELINUX( \
        "\n	-k	Print security context") \
 	USE_SELINUX( \
-       "\n	-K	Print security context in long format")
+       "\n	-K	Print security context in long format") \
+	USE_SELINUX( \
+	"\n	-Z	Print security context and permission")
 
 #define lsattr_trivial_usage \
        "[-Radlv] [files...]"
@@ -1974,7 +1979,9 @@
        "Create the DIRECTORY(ies) if they do not already exist" \
        "\n\nOptions:\n" \
        "	-m	Set permission mode (as in chmod), not rwxrwxrwx - umask\n" \
-       "	-p	No error if existing, make parent directories as needed"
+       "	-p	No error if existing, make parent directories as needed\n"	\
+       USAGE_SELINUX("	-Z	set security context")
+
 #define mkdir_example_usage \
        "$ mkdir /tmp/foo\n" \
        "$ mkdir /tmp/foo\n" \
@@ -2019,7 +2026,8 @@
 #define mkfifo_full_usage \
        "Create a named pipe (identical to 'mknod name p')" \
        "\n\nOptions:\n" \
-       "	-m	Create the pipe using the specified mode (default a=rw)"
+       "	-m	Create the pipe using the specified mode (default a=rw)\n" \
+	USAGE_SELINUX("	-Z	set security context")
 
 #define mkfs_minix_trivial_usage \
        "[-c | -l filename] [-nXX] [-iXX] /dev/name [blocks]"
@@ -2041,7 +2049,9 @@
        "\n\nTYPEs include:\n" \
        "	b:	Make a block (buffered) device\n" \
        "	c or u:	Make a character (un-buffered) device\n" \
-       "	p:	Make a named pipe. MAJOR and MINOR are ignored for named pipes"
+       "	p:	Make a named pipe. MAJOR and MINOR are ignored for named pipes\n" \
+	USAGE_SELINUX("	-Z	set security context")
+
 #define mknod_example_usage \
        "$ mknod /dev/fd0 b 2 0\n" \
        "$ mknod -m 644 /tmp/pipe p\n"
@@ -2901,6 +2911,7 @@
        "	-f	Display filesystem status\n" \
        "	-L,-l	Dereference links\n" \
        "	-t	Display info in terse form" \
+	USAGE_SELINUX("	-Z	print security context\n") \
 	USE_FEATURE_STAT_FORMAT( \
        "\n\nValid format sequences for files:\n" \
        " %a	Access rights in octal\n" \
@@ -2935,6 +2946,7 @@
        " %c	Total file nodes in file system\n" \
        " %d	Free file nodes in file system\n" \
        " %f	Free blocks in file system\n" \
+	USAGE_SELINUX("	%C	Security context in SELinux\n")	\
        " %i	File System ID in hex\n" \
        " %l	Maximum length of filenames\n" \
        " %n	File name\n" \



More information about the busybox mailing list