]> granicus.if.org Git - php/commitdiff
Apply doc root fix for FPM
authorNikita Popov <nikita.ppv@gmail.com>
Mon, 20 Apr 2020 08:46:20 +0000 (10:46 +0200)
committerNikita Popov <nikita.ppv@gmail.com>
Mon, 20 Apr 2020 08:47:54 +0000 (10:47 +0200)
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

index 65890f9fdfb44aa7b803a5e5b4409e13b6fb5e13..85d83593f33d4e92d35410a99c0ad3a18fbfd504 100644 (file)
@@ -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);
                        }
                }