httpd-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From wr...@apache.org
Subject svn commit: r1410528 - in /httpd/mod_fcgid/trunk: CHANGES-FCGID modules/fcgid/fcgid_conf.c modules/fcgid/fcgid_proc_unix.c modules/fcgid/fcgid_proc_win.c
Date Fri, 16 Nov 2012 18:33:16 GMT
Author: wrowe
Date: Fri Nov 16 18:33:14 2012
New Revision: 1410528

URL: http://svn.apache.org/viewvc?rev=1410528&view=rev
Log:
Correctly parse quotation and escaped spaces in FcgidWrapper command line 
argument, as currently documented.

PR: 51194


Modified:
    httpd/mod_fcgid/trunk/CHANGES-FCGID
    httpd/mod_fcgid/trunk/modules/fcgid/fcgid_conf.c
    httpd/mod_fcgid/trunk/modules/fcgid/fcgid_proc_unix.c
    httpd/mod_fcgid/trunk/modules/fcgid/fcgid_proc_win.c

Modified: httpd/mod_fcgid/trunk/CHANGES-FCGID
URL: http://svn.apache.org/viewvc/httpd/mod_fcgid/trunk/CHANGES-FCGID?rev=1410528&r1=1410527&r2=1410528&view=diff
==============================================================================
--- httpd/mod_fcgid/trunk/CHANGES-FCGID [utf8] (original)
+++ httpd/mod_fcgid/trunk/CHANGES-FCGID [utf8] Fri Nov 16 18:33:14 2012
@@ -1,6 +1,9 @@
                                                          -*- coding: utf-8 -*-
 Changes with mod_fcgid 2.3.8
 
+  *) Correctly parse quotation and escaped spaces in FcgidWrapper command
+     line argument, as currently documented.  PR 51194  [William Rowe]
+
   *) Honor quoted FcgidCmdOptions arguments (notably for InitialEnv
      assignments).  PR 51657  [William Rowe]
 

Modified: httpd/mod_fcgid/trunk/modules/fcgid/fcgid_conf.c
URL: http://svn.apache.org/viewvc/httpd/mod_fcgid/trunk/modules/fcgid/fcgid_conf.c?rev=1410528&r1=1410527&r2=1410528&view=diff
==============================================================================
--- httpd/mod_fcgid/trunk/modules/fcgid/fcgid_conf.c (original)
+++ httpd/mod_fcgid/trunk/modules/fcgid/fcgid_conf.c Fri Nov 16 18:33:14 2012
@@ -831,11 +831,12 @@ const char *set_wrapper_config(cmd_parms
                                const char *extension,
                                const char *virtual)
 {
-    const char *path, *tmp;
+    const char *path;
     apr_status_t rv;
     apr_finfo_t finfo;
     fcgid_cmd_conf *wrapper = NULL;
     fcgid_dir_conf *config = (fcgid_dir_conf *) dirconfig;
+    char **args;
 
     /* Sanity checks */
 
@@ -854,8 +855,9 @@ const char *set_wrapper_config(cmd_parms
         return "Invalid wrapper file extension";
 
     /* Get wrapper path */
-    tmp = wrapper_cmdline;
-    path = ap_getword_white(cmd->temp_pool, &tmp);
+    apr_tokenize_to_argv(wrapper_cmdline, &args, cmd->temp_pool);
+    path = apr_pstrdup(cmd->pool, args[0]);
+
     if (path == NULL || *path == '\0')
         return "Invalid wrapper config";
 

Modified: httpd/mod_fcgid/trunk/modules/fcgid/fcgid_proc_unix.c
URL: http://svn.apache.org/viewvc/httpd/mod_fcgid/trunk/modules/fcgid/fcgid_proc_unix.c?rev=1410528&r1=1410527&r2=1410528&view=diff
==============================================================================
--- httpd/mod_fcgid/trunk/modules/fcgid/fcgid_proc_unix.c (original)
+++ httpd/mod_fcgid/trunk/modules/fcgid/fcgid_proc_unix.c Fri Nov 16 18:33:14 2012
@@ -204,23 +204,11 @@ apr_status_t proc_spawn_process(const ch
     char **proc_environ;
     struct sockaddr_un unix_addr;
     apr_procattr_t *procattr = NULL;
-    int argc, len;
-    const char *wargv[APACHE_ARG_MAX + 1];
-    const char *word; /* For wrapper */
-    const char *tmp;
+    int len;
+    const char **wargv;
 
     /* Build wrapper args */
-    argc = 0;
-    tmp = cmdline;
-    while (1) {
-        word = ap_getword_white(procnode->proc_pool, &tmp);
-        if (word == NULL || *word == '\0')
-            break;
-        if (argc >= APACHE_ARG_MAX)
-            break;
-        wargv[argc++] = word;
-    }
-    wargv[argc] = NULL;
+    apr_tokenize_to_argv(cmdline, (char ***)&wargv, procnode->proc_pool);
 
     /*
        Create UNIX domain socket before spawn

Modified: httpd/mod_fcgid/trunk/modules/fcgid/fcgid_proc_win.c
URL: http://svn.apache.org/viewvc/httpd/mod_fcgid/trunk/modules/fcgid/fcgid_proc_win.c?rev=1410528&r1=1410527&r2=1410528&view=diff
==============================================================================
--- httpd/mod_fcgid/trunk/modules/fcgid/fcgid_proc_win.c (original)
+++ httpd/mod_fcgid/trunk/modules/fcgid/fcgid_proc_win.c Fri Nov 16 18:33:14 2012
@@ -69,22 +69,10 @@ apr_status_t proc_spawn_process(const ch
     apr_file_t *file;
     const char * const *proc_environ;
     char sock_path[FCGID_PATH_MAX];
-    int argc;
-    char const * wargv[APACHE_ARG_MAX + 1], *word; /* For wrapper */
-    const char *tmp;
+    const char **wargv;
 
     /* Build wrapper args */
-    argc = 0;
-    tmp = cmdline;
-    while (1) {
-        word = ap_getword_white(procnode->proc_pool, &tmp);
-        if (word == NULL || *word == '\0')
-            break;
-        if (argc >= APACHE_ARG_MAX)
-            break;
-        wargv[argc++] = word;
-    }
-    wargv[argc] = NULL;
+    apr_tokenize_to_argv(cmdline, (char ***)&wargv, procnode->proc_pool);
 
     memset(&SecurityAttributes, 0, sizeof(SecurityAttributes));
 



Mime
View raw message