mirror of
https://github.com/google/sandboxed-api.git
synced 2024-03-22 13:11:30 +08:00
Add missing chdir() in the init process
PiperOrigin-RevId: 239425921 Change-Id: Ia1b02ae0a2f319faa601d6098a9f94a3043656a8
This commit is contained in:
parent
52f4c1f927
commit
1dd0428713
|
@ -158,6 +158,7 @@ static void RunInitProcess(int signaling_fd, std::set<int> open_fds) {
|
||||||
} else if (child > 0) {
|
} else if (child > 0) {
|
||||||
// Perform some sanitization (basically equals to SanitizeEnvironment
|
// Perform some sanitization (basically equals to SanitizeEnvironment
|
||||||
// except that it does not require /proc to be available).
|
// except that it does not require /proc to be available).
|
||||||
|
SAPI_RAW_CHECK(chdir("/") == 0, "changing init cwd failed");
|
||||||
setsid();
|
setsid();
|
||||||
if (prctl(PR_SET_PDEATHSIG, SIGKILL, 0, 0, 0) != 0) {
|
if (prctl(PR_SET_PDEATHSIG, SIGKILL, 0, 0, 0) != 0) {
|
||||||
SAPI_RAW_PLOG(ERROR, "prctl(PR_SET_PDEATHSIG, SIGKILL) failed");
|
SAPI_RAW_PLOG(ERROR, "prctl(PR_SET_PDEATHSIG, SIGKILL) failed");
|
||||||
|
|
Loading…
Reference in New Issue
Block a user