From 70e8dc3761cef4b9de4a19f2f21d6d337f02e838 Mon Sep 17 00:00:00 2001 From: Tatsuhiro Tsujikawa Date: Mon, 2 May 2016 23:39:14 +0900 Subject: [PATCH] ngttpx: Pass environ to execve --- src/shrpx_connection_handler.cc | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/shrpx_connection_handler.cc b/src/shrpx_connection_handler.cc index 4da62790..a655eced 100644 --- a/src/shrpx_connection_handler.cc +++ b/src/shrpx_connection_handler.cc @@ -49,6 +49,8 @@ using namespace nghttp2; +extern char **environ; + namespace shrpx { namespace { @@ -464,7 +466,6 @@ int ConnectionHandler::start_ocsp_update(const char *cert_file) { const_cast( get_config()->tls.ocsp.fetch_ocsp_response_file.c_str()), const_cast(cert_file), nullptr}; - char *const envp[] = {nullptr}; #ifdef O_CLOEXEC if (pipe2(pfd, O_CLOEXEC) == -1) { @@ -515,7 +516,7 @@ int ConnectionHandler::start_ocsp_update(const char *cert_file) { dup2(pfd[1], 1); close(pfd[0]); - rv = execve(argv[0], argv, envp); + rv = execve(argv[0], argv, environ); if (rv == -1) { auto error = errno; LOG(ERROR) << "Could not execute ocsp query command: " << argv[0]