Add support for applying SELinux context

This commit is contained in:
Sebastien Raveau
2009-06-24 17:28:13 +00:00
committed by Erik Ekman
parent 17105a26db
commit d5acb508bc
8 changed files with 80 additions and 6 deletions

View File

@@ -41,6 +41,10 @@
#include <netinet/in.h>
#endif
#ifdef HAVE_SETCON
# include <selinux/selinux.h>
#endif
#include "common.h"
/* The raw header used when not using DNS protocol */
@@ -167,6 +171,17 @@ do_chroot(char *newroot)
#endif
}
void
do_setcon(char *context)
{
#ifdef HAVE_SETCON
if (-1 == setcon(context))
err(1, "%s", context);
#else
warnx("No SELinux support built in");
#endif
}
void
do_detach()
{