[PATCH 8/8] busybox -- SELinux option support for coreutils: ver3
KaiGai Kohei
kaigai at kaigai.gr.jp
Mon Feb 26 09:40:38 PST 2007
Hi, Denis
Thanks for your reviews.
Denis Vlasenko wrote:
> On Friday 23 February 2007 09:49, Yuichi Nakamura wrote:
>> [8/8] busybox-coreutils-08-runcon.v3.patch
>> - runcon - run application with specified security context.
>> runcon provides one of the core facilities to run application with explicitly
>> specified security context. It enables users to run their application under
>> the least privilege set explicitly.
>>
>> Signed-off-by: KaiGai Kohei <kaigai at kaigai.gr.jp>
>
> + char *role = NULL;
> + char *range = NULL;
> + char *user = NULL;
> + char *type = NULL;
> + char *context = NULL;
> + unsigned int opts;
> +
> + selinux_or_die();
> +
> + opts = getopt32(argc, argv, "r:t:u:l:ch", &role, &type, &user, &range);
> +
> + if (!role && !type && !user && !range) {
> + if (optind >= argc)
> + bb_error_msg_and_die("must specify -c, -t, -u, -l, -r, or context");
> + context = argv[optind++];
> + }
>
> Testing if(!(opt & MASK_role_type_user_range)) will result in smaller code.
I'm sorry, it was overlooked.
The attached patch replace the above if-conditions by a single logical
operation as you suggested.
Thanks,
--
KaiGai Kohei <kaigai at kaigai.gr.jp>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: busybox-coreutils-runcon-08.v4.patch
Type: text/x-patch
Size: 4558 bytes
Desc: not available
Url : http://busybox.net/lists/busybox/attachments/20070227/c2c09d76/attachment.bin
More information about the busybox
mailing list