return r;
}
-#endif // 0
static int userns_has_mapping(const char *name) {
_cleanup_fclose_ FILE *f = NULL;
f = fopen(name, "re");
if (!f) {
log_debug_errno(errno, "Failed to open %s: %m", name);
- return errno == -ENOENT ? false : -errno;
+ return errno == ENOENT ? false : -errno;
}
n = getline(&buf, &n_allocated, f);
log_debug("/proc/self/setgroups contains \"%s\", %s user namespace", line, r ? "in" : "not in");
return r;
}
+#endif // 0
int running_in_chroot(void) {
int ret;
+#if 0 /// elogind does not allow to ignore chroots, we are never init!
if (getenv_bool("SYSTEMD_IGNORE_CHROOT") > 0)
return 0;
+#endif // 0
ret = files_same("/proc/1/root", "/");
if (ret < 0)