Hi,
In our environment we use a modified version of suexec for fastcgi (to avoid
having a copy of php or a wrapper for every vhost on the system), this patch
adds a new directive "FastCgiSuExecCmd" to mod_fcgid which allows you to
specify the path for the suexec binary so that an alternate command can be
used without messing with the base apache install.
Regards,
Travers
diff -Naurb mod_fcgid.2.2-clean/arch/unix/fcgid_proc_unix.c mod_fcgid.2.2/arch/unix/fcgid_proc_unix.c
--- mod_fcgid.2.2-clean/arch/unix/fcgid_proc_unix.c 2007-07-31 19:09:19.000000000 +1000
+++ mod_fcgid.2.2/arch/unix/fcgid_proc_unix.c 2007-11-11 12:39:24.000000000 +1100
@@ -30,6 +30,7 @@
static int g_process_counter = 0;
static apr_pool_t *g_inode_cginame_map = NULL;
static const char *g_socket_dir = NULL;
+static const char *g_suexec_cmd = NULL;
static apr_status_t ap_unix_create_privileged_process(apr_proc_t * newproc,
const char *progname,
@@ -79,8 +80,8 @@
}
/* allocate space for 4 new args, the input args, and a null terminator */
newargs = apr_palloc(p, sizeof(char *) * (i + 4));
- newprogname = SUEXEC_BIN;
- newargs[0] = SUEXEC_BIN;
+ newprogname = g_suexec_cmd;
+ newargs[0] = g_suexec_cmd;
newargs[1] = execuser;
newargs[2] = execgroup;
newargs[3] = apr_pstrdup(p, argv0);
@@ -179,6 +180,8 @@
procinfo->main_server->process->pconf);
}
+ if (!g_suexec_cmd)
+ g_suexec_cmd = get_suexeccmd(procinfo->main_server);
if (!g_socket_dir)
g_socket_dir = get_socketpath(procinfo->main_server);
if (!g_inode_cginame_map || !g_socket_dir) {
diff -Naurb mod_fcgid.2.2-clean/fcgid_conf.c mod_fcgid.2.2/fcgid_conf.c
--- mod_fcgid.2.2-clean/fcgid_conf.c 2007-07-31 19:09:20.000000000 +1000
+++ mod_fcgid.2.2/fcgid_conf.c 2007-11-11 12:51:51.000000000 +1100
@@ -61,6 +61,7 @@
config->max_requests_per_process = DEFAULT_MAX_REQUESTS_PER_PROCESS;
config->max_request_len = DEFAULT_MAX_REQUEST_LEN;
config->max_mem_request_len = DEFAULT_MAX_MEM_REQUEST_LEN;
+ config->suexec_cmd = SUEXEC_BIN;
}
void *create_fcgid_server_config(apr_pool_t * p, server_rec * s)
@@ -846,3 +847,23 @@
return NULL;
}
+
+const char *set_suexeccmd(cmd_parms * cmd, void *dummy, const char *arg)
+{
+ server_rec *s = cmd->server;
+ fcgid_server_conf *config =
+ ap_get_module_config(s->module_config, &fcgid_module);
+ config->suexec_cmd = ap_server_root_relative(cmd->pool, arg);
+ if (!config->suexec_cmd)
+ return "Invalid SuEXEC command";
+
+ return NULL;
+}
+
+const char *get_suexeccmd(server_rec * s)
+{
+ fcgid_server_conf *config =
+ ap_get_module_config(s->module_config, &fcgid_module);
+ return config->suexec_cmd;
+}
+
diff -Naurb mod_fcgid.2.2-clean/fcgid_conf.h mod_fcgid.2.2/fcgid_conf.h
--- mod_fcgid.2.2-clean/fcgid_conf.h 2007-07-31 19:09:22.000000000 +1000
+++ mod_fcgid.2.2/fcgid_conf.h 2007-11-11 12:51:08.000000000 +1100
@@ -43,6 +43,7 @@
int ipc_comm_timeout;
int busy_timeout;
int php_fix_pathinfo_enable;
+ char *suexec_cmd;
} fcgid_server_conf;
typedef struct {
@@ -186,4 +187,7 @@
const char *arg);
int get_max_requests_per_process(server_rec * s);
+const char *set_suexeccmd(cmd_parms * cmd, void *dummy, const char *arg);
+const char *get_suexeccmd(server_rec * s);
+
#endif
diff -Naurb mod_fcgid.2.2-clean/mod_fcgid.c mod_fcgid.2.2/mod_fcgid.c
--- mod_fcgid.2.2-clean/mod_fcgid.c 2007-07-31 19:09:22.000000000 +1000
+++ mod_fcgid.2.2/mod_fcgid.c 2007-11-11 12:39:24.000000000 +1100
@@ -621,6 +621,7 @@
AP_INIT_FLAG("FastCgiAccessCheckerAuthoritative",
set_access_authoritative, NULL, ACCESS_CONF | OR_FILEINFO,
"Set to 'off' to allow access control to be passed along to lower modules upon failure"),
+ AP_INIT_TAKE1("FastCgiSuExecCmd", set_suexeccmd, NULL, RSRC_CONF, "Path to the fastcgi SuEXEC command"),
{NULL}
};
-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems? Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >> http://get.splunk.com/
_______________________________________________
Mod-fcgid-users mailing list
Mod-fcgid-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mod-fcgid-users