selinux support by Yuichi Nakamura <ynakam@hitachisoft.jp> (HitachiSoft)

This commit is contained in:
Denis Vlasenko
2007-03-10 16:58:49 +00:00
parent 4eb8b936cb
commit 49622d7846
14 changed files with 452 additions and 47 deletions

View File

@ -30,11 +30,25 @@ mode_t getopt_mk_fifo_nod(int argc, char **argv)
{
mode_t mode = 0666;
char *smode = NULL;
getopt32(argc, argv, "m:", &smode);
if(smode) {
#if ENABLE_SELINUX
security_context_t scontext;
#endif
int opt;
opt = getopt32(argc, argv, "m:" USE_SELINUX("Z:"), &smode USE_SELINUX(,&scontext));
if (opt & 1) {
if (bb_parse_mode(smode, &mode))
umask(0);
}
#if ENABLE_SELINUX
if (opt & 2) {
selinux_or_die();
if (setfscreatecon(scontext)) {
bb_error_msg_and_die("cannot set default file creation context "
"to %s", scontext);
}
}
#endif
return mode;
}