Better logging for clone failure

This commit is contained in:
Jagger 2015-08-12 04:32:34 +02:00
parent 292a8af67f
commit 5dc0fe193a
2 changed files with 3 additions and 2 deletions

View File

@ -164,7 +164,7 @@ int main(int argc, char *argv[])
exit(1); exit(1);
} }
if (nsjconf.clone_newuser == false && geteuid() != 0) { if (nsjconf.clone_newuser == false && geteuid() != 0) {
LOG_E("--disable_clone_newuser requires root() privs"); LOG_W("--disable_clone_newuser requires root() privs");
} }
if (nsjconf.daemonize && (daemon(0, 0) == -1)) { if (nsjconf.daemonize && (daemon(0, 0) == -1)) {
PLOG_F("daemon"); PLOG_F("daemon");

View File

@ -227,7 +227,8 @@ void subprocRunChild(struct nsjconf_t *nsjconf, int fd_in, int fd_out, int fd_er
if (pid == -1) { if (pid == -1) {
PLOG_E("clone(flags=%#x) failed. You probably need root privileges if your system " PLOG_E("clone(flags=%#x) failed. You probably need root privileges if your system "
"doesn't support CLONE_NEWUSER. Alternatively, you might want to recompile your " "doesn't support CLONE_NEWUSER. Alternatively, you might want to recompile your "
"kernel with support for namespaces", flags); "kernel with support for namespaces or check the setting of the "
"kernel.unprivileged_userns_clone sysctl", flags);
return; return;
} }