Lines 1-5
Link Here
|
1 |
--- sources/handlers.c.orig Mon May 16 23:03:16 2005 |
1 |
--- sources/handlers.c.orig Tue May 17 00:03:16 2005 |
2 |
+++ sources/handlers.c Sat May 28 10:38:18 2005 |
2 |
+++ sources/handlers.c Mon May 30 11:44:23 2005 |
3 |
@@ -25,6 +25,7 @@ |
3 |
@@ -25,6 +25,7 @@ |
4 |
#endif |
4 |
#endif |
5 |
|
5 |
|
Lines 23-29
Link Here
|
23 |
strcpy(newEnvp[i], "SERVER_SOFTWARE="); |
23 |
strcpy(newEnvp[i], "SERVER_SOFTWARE="); |
24 |
strcat(newEnvp[i], SERVER_SOFTWARE_STR); |
24 |
strcat(newEnvp[i], SERVER_SOFTWARE_STR); |
25 |
strcat(newEnvp[i], "/"); |
25 |
strcat(newEnvp[i], "/"); |
26 |
@@ -326,8 +335,237 @@ |
26 |
@@ -326,8 +335,233 @@ |
27 |
} |
27 |
} |
28 |
#endif /* ENABLE_CGI */ |
28 |
#endif /* ENABLE_CGI */ |
29 |
|
29 |
|
Lines 36-42
Link Here
|
36 |
+struct request req; |
36 |
+struct request req; |
37 |
+char *postStr; |
37 |
+char *postStr; |
38 |
+{ |
38 |
+{ |
39 |
+ char envPath[MAX_PATH_LEN+1]; /* where to hold the envrion PATH parameter */ |
39 |
+ char *envPath; /* pointer to the envrionment PATH variable */ |
40 |
+ char *relativePath; |
40 |
+ char *relativePath; |
41 |
+ char scriptWorkingDir[MAX_PATH_LEN+1]; |
41 |
+ char scriptWorkingDir[MAX_PATH_LEN+1]; |
42 |
+ char **newArgv; |
42 |
+ char **newArgv; |
Lines 137-152
Link Here
|
137 |
+ newEnvp[i] = calloc(MAX_PATH_LEN, sizeof(char)); |
137 |
+ newEnvp[i] = calloc(MAX_PATH_LEN, sizeof(char)); |
138 |
+ } |
138 |
+ } |
139 |
+ |
139 |
+ |
140 |
+ |
140 |
+ /* extract PATH env variable */ |
141 |
+ |
141 |
+ envPath = getenv("PATH"); |
142 |
+ /* extracting PATH env variable */ |
|
|
143 |
+ i = 0; |
144 |
+ while (environ && strncmp(environ[i], PATH_MATCH_STRING, strlen(PATH_MATCH_STRING))) |
145 |
+ i++; |
146 |
+ if(environ[i]) |
147 |
+ strcpy(envPath, environ[i]); |
148 |
+ else |
149 |
+ envPath[0] = '\0'; /* maybe we should set some default? */ |
150 |
+ |
142 |
+ |
151 |
+ i = 0; |
143 |
+ i = 0; |
152 |
+ strcpy(newArgv[i++], phpFileName); /* here we should pass the phppath */ |
144 |
+ strcpy(newArgv[i++], phpFileName); /* here we should pass the phppath */ |
Lines 205-211
Link Here
|
205 |
+ strcpy(newEnvp[i], "GATEWAY_INTERFACE="); |
197 |
+ strcpy(newEnvp[i], "GATEWAY_INTERFACE="); |
206 |
+ strcat(newEnvp[i++], CGI_VERSION); |
198 |
+ strcat(newEnvp[i++], CGI_VERSION); |
207 |
+ sprintf(newEnvp[i++], "SERVER_PORT=%d", port); |
199 |
+ sprintf(newEnvp[i++], "SERVER_PORT=%d", port); |
208 |
+ strcpy(newEnvp[i++], envPath); |
|
|
209 |
+ strcpy(newEnvp[i], "QUERY_STRING="); |
200 |
+ strcpy(newEnvp[i], "QUERY_STRING="); |
210 |
+ strcat(newEnvp[i++], req.queryString); |
201 |
+ strcat(newEnvp[i++], req.queryString); |
211 |
+ strcpy(newEnvp[i], "SERVER_PROTOCOL="); |
202 |
+ strcpy(newEnvp[i], "SERVER_PROTOCOL="); |
Lines 220-225
Link Here
|
220 |
+ { |
211 |
+ { |
221 |
+ strcpy(newEnvp[i], "HTTP_COOKIE="); |
212 |
+ strcpy(newEnvp[i], "HTTP_COOKIE="); |
222 |
+ strcat(newEnvp[i++], req.cookie); |
213 |
+ strcat(newEnvp[i++], req.cookie); |
|
|
214 |
+ } |
215 |
+ if (envPath != NULL) |
216 |
+ { |
217 |
+ strcpy(newEnvp[i], "PATH="); |
218 |
+ strcat(newEnvp[i++], envPath); |
223 |
+ } |
219 |
+ } |
224 |
+ newEnvp[i] = NULL; |
220 |
+ newEnvp[i] = NULL; |
225 |
+ |
221 |
+ |