You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@httpd.apache.org by tr...@apache.org on 2009/10/09 20:40:43 UTC

svn commit: r823657 - in /httpd/mod_fcgid/trunk: CHANGES-FCGID modules/fcgid/fcgid_conf.c modules/fcgid/fcgid_conf.h modules/fcgid/fcgid_pm_unix.c modules/fcgid/fcgid_pm_win.c

Author: trawick
Date: Fri Oct  9 18:40:43 2009
New Revision: 823657

URL: http://svn.apache.org/viewvc?rev=823657&view=rev
Log:
FcgidCmdOptions didn't work when a wrapper was defined with cmd-line arguments
(e.g., FcgidWrapper "/path/to/php -c /path/to/ini" .php) as it tried to look
up the entire command-line in the cmd options hash.

Change FcgidWrapper to save the executable file name it already computes
for use later when looking up the wrapper in the cmd options hash.

(fallout of confusion over "wrapperpath" vs. "wrapper cmd-line")

Modified:
    httpd/mod_fcgid/trunk/CHANGES-FCGID
    httpd/mod_fcgid/trunk/modules/fcgid/fcgid_conf.c
    httpd/mod_fcgid/trunk/modules/fcgid/fcgid_conf.h
    httpd/mod_fcgid/trunk/modules/fcgid/fcgid_pm_unix.c
    httpd/mod_fcgid/trunk/modules/fcgid/fcgid_pm_win.c

Modified: httpd/mod_fcgid/trunk/CHANGES-FCGID
URL: http://svn.apache.org/viewvc/httpd/mod_fcgid/trunk/CHANGES-FCGID?rev=823657&r1=823656&r2=823657&view=diff
==============================================================================
--- httpd/mod_fcgid/trunk/CHANGES-FCGID [utf8] (original)
+++ httpd/mod_fcgid/trunk/CHANGES-FCGID [utf8] Fri Oct  9 18:40:43 2009
@@ -1,7 +1,9 @@
                                                          -*- coding: utf-8 -*-
 Changes with mod_fcgid 2.3.5
 
-
+  *) Fix handling of FcgidCmdOptions so that it can apply to wrapper scripts
+     which were defined with command-line arguments on the FcgidWrapper
+     directive.  [Jeff Trawick]
 
 Changes with mod_fcgid 2.3.4
 

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=823657&r1=823656&r2=823657&view=diff
==============================================================================
--- httpd/mod_fcgid/trunk/modules/fcgid/fcgid_conf.c (original)
+++ httpd/mod_fcgid/trunk/modules/fcgid/fcgid_conf.c Fri Oct  9 18:40:43 2009
@@ -763,6 +763,7 @@
     wrapper_id_info *id_info;
     apr_size_t *wrapper_id;
     fcgid_wrapper_conf *wrapper = NULL;
+    apr_pool_t *wrapper_conf_pool = cmd->server->process->pconf; /* bad */
     fcgid_dir_conf *config = (fcgid_dir_conf *) dirconfig;
 
     /* Sanity checks */
@@ -809,7 +810,7 @@
                      strlen(wrapper_cmdline), wrapper_id);
     }
 
-    wrapper = apr_pcalloc(cmd->server->process->pconf, sizeof(*wrapper));
+    wrapper = apr_pcalloc(wrapper_conf_pool, sizeof(*wrapper));
 
     /* Get wrapper path */
     tmp = wrapper_cmdline;
@@ -823,6 +824,7 @@
         return missing_file_msg(cmd->pool, "Wrapper", path, rv);
     }
 
+    wrapper->exe = apr_pstrdup(wrapper_conf_pool, path);
     /* FIXME no need to embed in structure (subject to correct pool usage) */
     apr_cpystrn(wrapper->args, wrapper_cmdline, _POSIX_PATH_MAX);
     wrapper->inode = finfo.inode;

Modified: httpd/mod_fcgid/trunk/modules/fcgid/fcgid_conf.h
URL: http://svn.apache.org/viewvc/httpd/mod_fcgid/trunk/modules/fcgid/fcgid_conf.h?rev=823657&r1=823656&r2=823657&view=diff
==============================================================================
--- httpd/mod_fcgid/trunk/modules/fcgid/fcgid_conf.h (original)
+++ httpd/mod_fcgid/trunk/modules/fcgid/fcgid_conf.h Fri Oct  9 18:40:43 2009
@@ -54,7 +54,8 @@
 } auth_conf;
 
 typedef struct {
-    char args[_POSIX_PATH_MAX];
+    const char *exe;            /* executable file path */
+    char args[_POSIX_PATH_MAX]; /* entire command line */
     apr_ino_t inode;
     apr_dev_t deviceid;
     apr_size_t share_group_id;

Modified: httpd/mod_fcgid/trunk/modules/fcgid/fcgid_pm_unix.c
URL: http://svn.apache.org/viewvc/httpd/mod_fcgid/trunk/modules/fcgid/fcgid_pm_unix.c?rev=823657&r1=823656&r2=823657&view=diff
==============================================================================
--- httpd/mod_fcgid/trunk/modules/fcgid/fcgid_pm_unix.c (original)
+++ httpd/mod_fcgid/trunk/modules/fcgid/fcgid_pm_unix.c Fri Oct  9 18:40:43 2009
@@ -417,7 +417,7 @@
         command->deviceid = wrapperconf->deviceid;
         command->inode = wrapperconf->inode;
         command->share_grp_id = wrapperconf->share_group_id;
-        cmd_to_spawn = command->wrapper_cmdline;
+        cmd_to_spawn = wrapperconf->exe;
     }
     else {
         cmd_to_spawn = command->cgipath;

Modified: httpd/mod_fcgid/trunk/modules/fcgid/fcgid_pm_win.c
URL: http://svn.apache.org/viewvc/httpd/mod_fcgid/trunk/modules/fcgid/fcgid_pm_win.c?rev=823657&r1=823656&r2=823657&view=diff
==============================================================================
--- httpd/mod_fcgid/trunk/modules/fcgid/fcgid_pm_win.c (original)
+++ httpd/mod_fcgid/trunk/modules/fcgid/fcgid_pm_win.c Fri Oct  9 18:40:43 2009
@@ -146,7 +146,7 @@
         command->deviceid = wrapperconf->deviceid;
         command->inode = wrapperconf->inode;
         command->share_grp_id = wrapperconf->share_group_id;
-        cmd_to_spawn = command->wrapper_cmdline;
+        cmd_to_spawn = wrapperconf->exe;
     }
     else {
         cmd_to_spawn = command->cgipath;