All of lore.kernel.org
 help / color / mirror / Atom feed
From: Yuichi Nakamura <ynakam@hitachisoft.jp>
To: busybox@busybox.net, busybox@kaigai.gr.jp
Cc: ynakam@hitachisoft.jp, Denis Vlasenko <vda.linux@googlemail.com>,
	selinux@tycho.nsa.gov, russell@coker.com.au, rob@landley.net
Subject: Re: [busybox:00365] Re: [PATCH 1/6] busybox -- SELinux option support for coreutils
Date: Fri, 9 Feb 2007 18:47:41 +0900	[thread overview]
Message-ID: <20070209184741.dcbef9a9.ynakam@hitachisoft.jp> (raw)
In-Reply-To: <200702082332.43175.vda.linux@googlemail.com>

[-- Attachment #1: Type: text/plain, Size: 1550 bytes --]

Thank you for comments.

On Thu, 8 Feb 2007 23:32:43 +0100
Denis Vlasenko  wrote:
> 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@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
> 
> 	USAGE_SELINUX( \
>        "	-Z	prints only the security context\n" \
> 	) \
>        "	-g	Prints only the group ID\n" \
> 
> This helps to avoid misformatting in help texts.
> 
> The rest of this patch needs similar reformatting.
Fixed.

> --
> vda
> 

We were porting SELinux option based on coreutils in Fedora Core6, 
but Stephen recommended to check upstream coreutils.
So I have checked upstream coreutils and found some SELinux option has been changed.
I have changed following:
* Removed -Z option from cp
* Added -Z and --preserve-context option to install

About cp,  -c option is dropped in upstream and "--preserve=context" is used instead.
However, cp in BusyBox does not have long options, so our patch still has -c option.

Yuichi Nakamura



[-- Attachment #2: busybox-coreutils-common-01.v2.patch --]
[-- Type: application/octet-stream, Size: 4171 bytes --]

Index: include/usage.h
===================================================================
--- include/usage.h	(revision 17803)
+++ include/usage.h	(working copy)
@@ -388,13 +388,16 @@
        "Copy SOURCE to DEST, or multiple SOURCE(s) to DIRECTORY" \
        "\n\nOptions:\n" \
        "	-a	Same as -dpR\n" \
+	USAGE_SELINUX( \
+       "	-c	Preserves security context\n" \
+	) \
        "	-d,-P	Preserve links\n" \
        "	-H,-L	Dereference all symlinks (implied by default)\n" \
        "	-p	Preserve file attributes if possible\n" \
        "	-f	Force, overwrite\n" \
        "	-i	Interactive, prompt before overwrite\n" \
        "	-R,-r	Copy directories recursively\n" \
-       "	-l,-s	Create (sym)links"
+       "	-l,-s	Create (sym)links\n"
 
 #define cpio_trivial_usage \
        "-[dimtuv][F cpiofile]"
@@ -1299,9 +1302,10 @@
 #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"						\
        "	-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 +1523,10 @@
        "	-m	Set permission modes\n" \
        "	-o	Set ownership\n" \
        "	-p	Preserve date\n" \
-       "	-s	Strip symbol tables"
+       "    -s  Strip symbol tables\n" \
+	USAGE_SELINUX( \
+       "	Z	Set security context of copy" \
+	)
 
 #define ip_trivial_usage \
        "[OPTIONS] {address | link | route | tunnel | rule} {COMMAND}"
@@ -1829,7 +1836,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 +1983,11 @@
        "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 +2032,10 @@
 #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 +2057,11 @@
        "\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 +2921,9 @@
        "	-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 +2958,9 @@
        " %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" \

      parent reply	other threads:[~2007-02-09  9:46 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-02-08  6:54 [PATCH 1/6] busybox -- SELinux option support for coreutils Yuichi Nakamura
     [not found] ` <200702082332.43175.vda.linux@googlemail.com>
2007-02-09  9:47   ` Yuichi Nakamura [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20070209184741.dcbef9a9.ynakam@hitachisoft.jp \
    --to=ynakam@hitachisoft.jp \
    --cc=busybox@busybox.net \
    --cc=busybox@kaigai.gr.jp \
    --cc=rob@landley.net \
    --cc=russell@coker.com.au \
    --cc=selinux@tycho.nsa.gov \
    --cc=vda.linux@googlemail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.