aboutsummaryrefslogtreecommitdiff
path: root/coreutils/libcoreutils
diff options
context:
space:
mode:
authorDenis Vlasenko <vda.linux@googlemail.com>2007-03-10 16:58:49 +0000
committerDenis Vlasenko <vda.linux@googlemail.com>2007-03-10 16:58:49 +0000
commit49622d784672bf2f7b2fe80589714cdef5adde0c (patch)
tree892bb79b0ef031d729e688d6be4950f6d17f13b9 /coreutils/libcoreutils
parent4eb8b936cb0aeb27c3e12f9a93fc43aa1e9668f5 (diff)
downloadbusybox-w32-49622d784672bf2f7b2fe80589714cdef5adde0c.tar.gz
busybox-w32-49622d784672bf2f7b2fe80589714cdef5adde0c.tar.bz2
busybox-w32-49622d784672bf2f7b2fe80589714cdef5adde0c.zip
selinux support by Yuichi Nakamura <ynakam@hitachisoft.jp> (HitachiSoft)
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}