ver6(Re: [PATCH 6/8] busybox -- SELinux option support for coreutils: ver3
Yuichi Nakamura
himainu-ynakam at miomio.jp
Fri Mar 9 16:30:55 UTC 2007
On Thu, 8 Mar 2007 13:54:50 +0100
Bernhard Fischer wrote:
> On Fri, Feb 23, 2007 at 05:48:17PM +0900, Yuichi Nakamura wrote:
> >[6/8] busybox-coreutils-06-id.v3.patch
> > - -Z option support for id. Security context of process is shown by -Z option.
> >
> >Signed-off-by: Yuichi Nakamura <ynakam at hitachisoft.jp>
> Index: coreutils/id.c
> ===================================================================
> --- coreutils/id.c (revision 17961)
> +++ coreutils/id.c (working copy)
> ...
> } else {
> - printf("%u\n", (flags & JUST_USER) ? uid : gid);
> - }
> + if (flags & JUST_USER){
> + printf("%u\n",uid);
> + }
> + if (flags & JUST_GROUP){
> + printf("%u\n",gid);
> + }
> Why exactly did you need to change this, is it smaller?
This is because, original code does not work when SELinux is enabled.
When flags is "JUST_CONTEXT", then gid will be printed, it is unexpected behavior.
> + }
> +
> +#if ENABLE_SELINUX
> + if(flags & JUST_CONTEXT){
>
> Missing space.
Fixed.
>
> + selinux_or_die();
> + if (argc - optind == 1){
> + bb_error_msg_and_die("cannot print security cont ext when user specified");
> + }
> +
> + if (getcon(&scontext)){
> + bb_error_msg_and_die("can't get process context");
>
> Inconsistent use of "cannot" vs. "can't". The latter is smaller, so..
Fixed, using can't.
>
> + }
> + printf("%s\n", scontext);
> + }
> +#endif
>
>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: busybox-coreutils-id-06.v6.patch
Type: application/octet-stream
Size: 2837 bytes
Desc: not available
Url : http://lists.busybox.net/pipermail/busybox/attachments/20070309/b41552e6/attachment-0001.obj
More information about the busybox
mailing list