From f62571c121ce2874858b5e7dd33642755ee9309c Mon Sep 17 00:00:00 2001 From: Nikita Popov Date: Mon, 20 Apr 2020 10:46:20 +0200 Subject: Apply doc root fix for FPM This is the change from GH-5417 but for FPM. This was stripping the last character from the doc_root. Given how it is used, this should be harmless, but let's make it less confusing... --- sapi/fpm/fpm/fpm_main.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/sapi/fpm/fpm/fpm_main.c b/sapi/fpm/fpm/fpm_main.c index 65890f9fdf..85d83593f3 100644 --- a/sapi/fpm/fpm/fpm_main.c +++ b/sapi/fpm/fpm/fpm_main.c @@ -627,7 +627,7 @@ static void sapi_cgi_log_message(char *message, int syslog_type_int) /* {{{ php_cgi_ini_activate_user_config */ -static void php_cgi_ini_activate_user_config(char *path, int path_len, const char *doc_root, int doc_root_len, int start) +static void php_cgi_ini_activate_user_config(char *path, int path_len, const char *doc_root, int doc_root_len) { char *ptr; time_t request_time = sapi_get_request_time(); @@ -677,7 +677,7 @@ static void php_cgi_ini_activate_user_config(char *path, int path_len, const cha to find more user.ini, if not we only scan the current path. */ if (strncmp(s1, s2, s_len) == 0) { - ptr = s2 + start; /* start is the point where doc_root ends! */ + ptr = s2 + doc_root_len; while ((ptr = strchr(ptr, DEFAULT_SLASH)) != NULL) { *ptr = 0; php_parse_user_ini_file(path, PG(user_ini_filename), entry->user_config); @@ -751,7 +751,7 @@ static int sapi_cgi_activate(void) /* {{{ */ --doc_root_len; } - php_cgi_ini_activate_user_config(path, path_len, doc_root, doc_root_len, doc_root_len - 1); + php_cgi_ini_activate_user_config(path, path_len, doc_root, doc_root_len); } } -- cgit v1.2.1