From 51de62c186d77fa421af026a8cd95a1e1f86c9e5 Mon Sep 17 00:00:00 2001 From: Micah Andersen Date: Wed, 16 May 2018 12:28:13 -0400 Subject: [PATCH] Fix launch of external process on Windows - SystemRoot environment variable is needed for various random things - standard Windows file open dialog - ping command's DNS resolution - php mysqli remote database access - etc. --- mod_authnz_external/mod_authnz_external.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/mod_authnz_external/mod_authnz_external.c b/mod_authnz_external/mod_authnz_external.c index f03079f..a602d7a 100644 --- a/mod_authnz_external/mod_authnz_external.c +++ b/mod_authnz_external/mod_authnz_external.c @@ -409,7 +409,7 @@ static int exec_external(const char *extpath, const char *extmethod, apr_procattr_t *procattr; apr_proc_t proc; apr_status_t rc= APR_SUCCESS; - char *child_env[12]; + char *child_env[13]; char *child_arg[MAX_ARG+2]; const char *t; int i, status= -4; @@ -471,6 +471,10 @@ static int exec_external(const char *extpath, const char *extmethod, if ((cookie= apr_table_get(r->headers_in, "Cookie")) != NULL) child_env[i++]= apr_pstrcat(p, ENV_COOKIE"=", cookie, NULL); #endif + +#ifdef _WINDOWS + child_env[i++]= apr_pstrcat(r->pool, "SystemRoot=", getenv("SystemRoot"), NULL); +#endif /* NOTE: If you add environment variables, * remember to increase the size of the child_env[] array */ -- 2.50.1