[PATCH 8/8] busybox -- SELinux option support for coreutils: ver3

Denis Vlasenko vda.linux at googlemail.com
Sat Feb 24 15:01:13 UTC 2007


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.
--
vda



More information about the busybox mailing list