You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@httpd.apache.org by gs...@locus.apache.org on 2000/05/27 02:48:50 UTC
cvs commit: apache-2.0/src/modules/standard mod_cgid.c
gstein 00/05/26 17:48:50
Modified: src/modules/standard mod_cgid.c
Log:
fixes some compilation errors (macros, function params, etc). also shifts
the time when ap_destroy_pool() is called. it used to be called too
soon, which caused a core dump on the second CGI request.
Submitted by: Paul J. Reder <re...@raleigh.ibm.com>
Reviewed by: Greg Stein
Revision Changes Path
1.10 +15 -14 apache-2.0/src/modules/standard/mod_cgid.c
Index: mod_cgid.c
===================================================================
RCS file: /home/cvs/apache-2.0/src/modules/standard/mod_cgid.c,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -r1.9 -r1.10
--- mod_cgid.c 2000/05/04 04:02:36 1.9
+++ mod_cgid.c 2000/05/27 00:48:49 1.10
@@ -127,6 +127,8 @@
#define DEFAULT_BUFBYTES 1024
#define DEFAULT_SOCKET "logs/cgisock"
+#define SHELL_PATH "/bin/sh"
+
typedef struct {
const char *sockname;
char *logname;
@@ -302,14 +304,16 @@
#ifdef APR_HAS_OTHER_CHILD
int *sd = data;
switch (reason) {
- case OC_REASON_DEATH:
- case OC_REASON_LOST:
+ case APR_OC_REASON_DEATH:
+ case APR_OC_REASON_LOST:
/* stop gap to make sure everything else works. In the end,
- * we'll just restart the cgid server. */
+ * we'll just restart the cgid server. */
+ ap_destroy_pool(pcgi);
kill(getppid(), SIGWINCH);
break;
- case OC_REASON_RESTART:
- case OC_REASON_UNREGISTER:
+ case APR_OC_REASON_RESTART:
+ case APR_OC_REASON_UNREGISTER:
+ ap_destroy_pool(pcgi);
kill(*sd, SIGHUP);
break;
}
@@ -321,7 +325,6 @@
int i, len, j;
unsigned char *data;
char **environ;
- char temp[MAX_STRING_LEN];
core_dir_config *temp_core;
void **dconf;
@@ -397,11 +400,8 @@
static void send_req(int fd, request_rec *r, char *argv0, char **env)
{
int len;
- int rv;
int i = 0;
char *data;
- core_dir_config *conf = ap_get_module_config(r->per_dir_config,
- &core_module);
data = ap_pstrcat(r->pool, r->filename, "\n", argv0, "\n", r->uri, "\n",
NULL);
@@ -566,6 +566,7 @@
static void cgid_init(ap_pool_t *p, ap_pool_t *plog, ap_pool_t *ptemp, server_rec *main_server)
{
int pid;
+ ap_proc_t ap_pid;
int tempfd;
cgid_server_conf *sconf = (cgid_server_conf *)ap_get_module_config(
@@ -585,7 +586,9 @@
exit(-1);
}
#ifdef APR_HAS_OTHER_CHILD
- ap_register_other_child(pid, cgid_maint, &pid, -1);
+ ap_pid.pid = pid;
+ ap_pid.err = ap_pid.in = ap_pid.out = NULL;
+ ap_register_other_child(&ap_pid, cgid_maint, NULL, NULL, p);
#endif
}
else once_through++;
@@ -838,11 +841,11 @@
}
}
#else
- if (r->finfo.st_mode == 0)
+ if (r->finfo.protection == 0)
return log_scripterror(r, conf, NOT_FOUND, APLOG_NOERRNO,
"script not found or unable to stat");
#endif
- if (S_ISDIR(r->finfo.st_mode))
+ if (r->finfo.filetype == APR_DIR)
return log_scripterror(r, conf, FORBIDDEN, APLOG_NOERRNO,
"attempt to invoke directory as script");
/*
@@ -980,8 +983,6 @@
if (script && nph) {
ap_send_fb(script, r);
}
-
-ap_destroy_pool(pcgi);
return OK; /* NOT r->status, even if it has changed. */
}