continue;
}
if ((idx + 4) >= ARRAYSIZE(argv)) {
- LOG_W("Number of arguments to '/usr/bin/newgidmap' too big");
+ LOG_W("Too many arguments for '/usr/bin/newgidmap'");
return false;
}
use = true;
continue;
}
if ((idx + 4) >= ARRAYSIZE(argv)) {
- LOG_W("Number of arguments to '/usr/bin/newuidmap' too big");
+ LOG_W("Too many arguments for '/usr/bin/newuidmap'");
return false;
}
use = true;
PLOG_D("setgroups(NULL) failed");
}
- /* Make sure all capabilities are retained after the subsequent setuid/setgid */
+ /*
+ * Make sure all capabilities are retained after the subsequent setuid/setgid, as they will be
+ * needed for privileged operations: mounts, uts change etc.
+ */
if (prctl(PR_SET_SECUREBITS, SECBIT_KEEP_CAPS | SECBIT_NO_SETUID_FIXUP, 0UL, 0UL, 0UL) ==
-1) {
- PLOG_W("prctl(PR_SET_SECUREBITS, SECBIT_KEEP_CAPS | SECBIT_NO_SETUID_FIXUP)");
+ PLOG_E("prctl(PR_SET_SECUREBITS, SECBIT_KEEP_CAPS | SECBIT_NO_SETUID_FIXUP)");
return false;
}