aboutsummaryrefslogtreecommitdiff
path: root/coreutils/libcoreutils
diff options
context:
space:
mode:
Diffstat (limited to 'coreutils/libcoreutils')
-rw-r--r--coreutils/libcoreutils/getopt_mk_fifo_nod.c20
1 files changed, 17 insertions, 3 deletions
diff --git a/coreutils/libcoreutils/getopt_mk_fifo_nod.c b/coreutils/libcoreutils/getopt_mk_fifo_nod.c
index 3a3d34118..2e0c27439 100644
--- a/coreutils/libcoreutils/getopt_mk_fifo_nod.c
+++ b/coreutils/libcoreutils/getopt_mk_fifo_nod.c
@@ -30,11 +30,25 @@ mode_t getopt_mk_fifo_nod(int argc, char **argv)
30{ 30{
31 mode_t mode = 0666; 31 mode_t mode = 0666;
32 char *smode = NULL; 32 char *smode = NULL;
33 33#if ENABLE_SELINUX
34 getopt32(argc, argv, "m:", &smode); 34 security_context_t scontext;
35 if(smode) { 35#endif
36 int opt;
37 opt = getopt32(argc, argv, "m:" USE_SELINUX("Z:"), &smode USE_SELINUX(,&scontext));
38 if (opt & 1) {
36 if (bb_parse_mode(smode, &mode)) 39 if (bb_parse_mode(smode, &mode))
37 umask(0); 40 umask(0);
38 } 41 }
42
43#if ENABLE_SELINUX
44 if (opt & 2) {
45 selinux_or_die();
46 if (setfscreatecon(scontext)) {
47 bb_error_msg_and_die("cannot set default file creation context "
48 "to %s", scontext);
49 }
50 }
51#endif
52
39 return mode; 53 return mode;
40} 54}