mirror of
https://github.com/yarrick/iodine.git
synced 2025-10-17 16:51:54 +00:00
Add support for applying SELinux context
This commit is contained in:

committed by
Erik Ekman

parent
17105a26db
commit
d5acb508bc
15
src/common.c
15
src/common.c
@@ -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()
|
||||
{
|
||||
|
Reference in New Issue
Block a user