#endif
#include "selinux-setup.h"
+#include "mount-setup.h"
#include "macro.h"
#include "util.h"
#include "log.h"
assert(loaded_policy);
+ /* Make sure getcon() works, which needs /proc and /sys */
+ mount_setup_early();
+
/* Already initialized by somebody else? */
r = getcon_raw(&con);
if (r == 0) {
char timespan[FORMAT_TIMESPAN_MAX];
char *label;
+ label_retest_selinux();
+
/* Transition to the new context */
r = label_get_create_label_from_exe(SYSTEMD_BINARY_PATH, &label);
- if (r < 0) {
+ if (r < 0 || label == NULL) {
log_open();
log_error("Failed to compute init label, ignoring.");
} else {
*loaded_policy = true;
} else {
+ log_open();
+
if (enforce > 0) {
- log_error("Failed to load SELinux policy.");
+ log_error("Failed to load SELinux policy. Freezing.");
return -EIO;
} else
- log_debug("Unable to load SELinux policy.");
+ log_debug("Unable to load SELinux policy. Ignoring.");
}
#endif