ping: fix breakage from -I fix

passwd: SELinux support by KaiGai Kohei <kaigai@ak.jp.nec.com>
This commit is contained in:
Denis Vlasenko
2007-10-20 02:00:49 +00:00
parent aa7a888e42
commit 2edbc2ab85
4 changed files with 50 additions and 2 deletions

View File

@ -38,3 +38,17 @@ void setfscreatecon_or_die(security_context_t scontext)
"file creation context to %s", scontext);
}
}
void selinux_preserve_fcontext(int fdesc)
{
security_context_t context;
if (fgetfilecon(fdesc, &context) < 0) {
if (errno == ENODATA || errno == ENOTSUP)
return;
bb_perror_msg_and_die("fgetfilecon failed");
}
setfscreatecon_or_die(context);
freecon(context);
}