X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=blobdiff_plain;f=src%2Fselinux-setup.c;h=620c49e686a56646ba25cc01b0d69bee9b842908;hb=6c7506dca32f8add56cd03bf263f417305de74a0;hp=f400f416da3872952f0495e5bf589f038921dcfb;hpb=871e580949b1417058da7f7e9fa0380d308ef708;p=elogind.git diff --git a/src/selinux-setup.c b/src/selinux-setup.c index f400f416d..620c49e68 100644 --- a/src/selinux-setup.c +++ b/src/selinux-setup.c @@ -38,11 +38,18 @@ int selinux_setup(char *const argv[]) { #ifdef HAVE_SELINUX int enforce = 0; usec_t n; + security_context_t con; /* Already initialized? */ - if (path_is_mount_point("/sys/fs/selinux") > 0 || - path_is_mount_point("/selinux") > 0) - return 0; + if (getcon_raw(&con) == 0) { + bool initialized; + + initialized = !streq(con, "kernel"); + freecon(con); + + if (initialized) + return 0; + } /* Before we load the policy we create a flag file to ensure * that after the reexec we iterate through /run and /dev to