diff --git a/src/lcrcontainer.c b/src/lcrcontainer.c index 547830a9477051093964d2f2251575eab146fad7..ed9a4f78acccde548d47ec2f718fd5dcca7857e8 100644 --- a/src/lcrcontainer.c +++ b/src/lcrcontainer.c @@ -430,7 +430,7 @@ bool lcr_start(const struct lcr_start_request *request) } pid = fork(); - if (pid == (pid_t) - 1) { + if (pid == (pid_t) -1) { ERROR("Failed to fork()\n"); close(pipefd[0]); close(pipefd[1]); @@ -438,6 +438,7 @@ bool lcr_start(const struct lcr_start_request *request) } if (pid == (pid_t)0) { + (void)unsetenv("NOTIFY_SOCKET"); // child process, dup2 pipefd[1] to stderr close(pipefd[0]); dup2(pipefd[1], 2); diff --git a/src/lcrcontainer_execute.c b/src/lcrcontainer_execute.c index 1486d2aaeae802ce4d0d361057606b6c99afcb9a..3a9e2def7d57ddb2e226362ff71209240a1bb16c 100644 --- a/src/lcrcontainer_execute.c +++ b/src/lcrcontainer_execute.c @@ -665,7 +665,7 @@ bool do_attach(const char *name, const char *path, const struct lcr_exec_request } pid = fork(); - if (pid == (pid_t) - 1) { + if (pid == (pid_t) -1) { ERROR("Failed to fork()\n"); close(pipefd[0]); close(pipefd[1]); @@ -673,6 +673,7 @@ bool do_attach(const char *name, const char *path, const struct lcr_exec_request } if (pid == (pid_t)0) { + (void)unsetenv("NOTIFY_SOCKET"); if (lcr_util_null_stdfds() < 0) { COMMAND_ERROR("Failed to close fds"); exit(EXIT_FAILURE); diff --git a/tests/fuzz/log_fuzz.cc b/tests/fuzz/log_fuzz.cc index 9dc02bb3c0900c915c936e60ff06bd69db59cd53..a8f80d49275344266828234eba65ecfca94dd7b2 100644 --- a/tests/fuzz/log_fuzz.cc +++ b/tests/fuzz/log_fuzz.cc @@ -46,7 +46,7 @@ extern "C" int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) std::vector ret_vec; std::string tmpstr; std::istringstream istr(testData); - while(std::getline(istr, tmpstr, ',')) { + while (std::getline(istr, tmpstr, ',')) { ret_vec.push_back(tmpstr); }