20 |
* |
* |
21 |
*/ |
*/ |
22 |
|
|
|
#include <sys/types.h> |
|
|
#include <sys/stat.h> |
|
|
#include <unistd.h> |
|
23 |
#include "libbb.h" |
#include "libbb.h" |
24 |
#include "coreutils.h" |
#include "coreutils.h" |
25 |
|
|
26 |
mode_t getopt_mk_fifo_nod(int argc, char **argv) |
mode_t FAST_FUNC getopt_mk_fifo_nod(char **argv) |
27 |
{ |
{ |
28 |
mode_t mode = 0666; |
mode_t mode = 0666; |
29 |
char *smode = NULL; |
char *smode = NULL; |
30 |
|
#if ENABLE_SELINUX |
31 |
getopt32(argc, argv, "m:", &smode); |
security_context_t scontext; |
32 |
if(smode) { |
#endif |
33 |
|
int opt; |
34 |
|
opt = getopt32(argv, "m:" USE_SELINUX("Z:"), &smode USE_SELINUX(,&scontext)); |
35 |
|
if (opt & 1) { |
36 |
if (bb_parse_mode(smode, &mode)) |
if (bb_parse_mode(smode, &mode)) |
37 |
umask(0); |
umask(0); |
38 |
} |
} |
39 |
|
|
40 |
|
#if ENABLE_SELINUX |
41 |
|
if (opt & 2) { |
42 |
|
selinux_or_die(); |
43 |
|
setfscreatecon_or_die(scontext); |
44 |
|
} |
45 |
|
#endif |
46 |
|
|
47 |
return mode; |
return mode; |
48 |
} |
} |