mirror of
https://github.com/systemd/systemd.git
synced 2025-03-21 02:50:18 +03:00
nspawn: reset supplementary and main group id before entering nspawn
This commit is contained in:
parent
ba9904e9ce
commit
3c957acf86
2
TODO
2
TODO
@ -180,8 +180,6 @@ Features:
|
||||
|
||||
* nspawn: implement personality changes a la linux32(8)
|
||||
|
||||
* nspawn: reset all aux groups
|
||||
|
||||
* cryptsetup-generator: warn if the password files are world-readable
|
||||
|
||||
* cryptsetup-generator: add RequiresMountsFor= to cryptseup service files referencing a file, similar for devices
|
||||
|
@ -1327,6 +1327,23 @@ int main(int argc, char *argv[]) {
|
||||
log_error("setreuid() failed: %m");
|
||||
goto child_fail;
|
||||
}
|
||||
} else {
|
||||
/* Reset everything fully to 0, just in case */
|
||||
|
||||
if (setgroups(0, NULL) < 0) {
|
||||
log_error("setgroups() failed: %m");
|
||||
goto child_fail;
|
||||
}
|
||||
|
||||
if (setresgid(0, 0, 0) < 0) {
|
||||
log_error("setregid() failed: %m");
|
||||
goto child_fail;
|
||||
}
|
||||
|
||||
if (setresuid(0, 0, 0) < 0) {
|
||||
log_error("setreuid() failed: %m");
|
||||
goto child_fail;
|
||||
}
|
||||
}
|
||||
|
||||
if ((asprintf((char**)(envp + 3), "HOME=%s", home ? home: "/root") < 0) ||
|
||||
|
Loading…
x
Reference in New Issue
Block a user