View | Details | Raw Unified | Return to bug 81671
Collapse All | Expand All

(-)pserv/Makefile (-1 / +2 lines)
Lines 37-43 Link Here
37
do-install:
37
do-install:
38
	${INSTALL_PROGRAM} ${WRKSRC}/sources/pserv ${PREFIX}/sbin/
38
	${INSTALL_PROGRAM} ${WRKSRC}/sources/pserv ${PREFIX}/sbin/
39
	${INSTALL_DATA} ${WRKSRC}/defaults/mime_types.dat ${PREFIX}/etc/mime.types.pserv
39
	${INSTALL_DATA} ${WRKSRC}/defaults/mime_types.dat ${PREFIX}/etc/mime.types.pserv
40
	${INSTALL_DATA} ${WRKSRC}/defaults/pserv.conf ${PREFIX}/etc/
40
	${MKDIR} ${PREFIX}/etc/pserv/
41
	${INSTALL_DATA} ${WRKSRC}/defaults/pserv.conf ${PREFIX}/etc/pserv/
41
	${INSTALL_SCRIPT} ${FILESDIR}/pserv.sh ${PREFIX}/etc/rc.d/
42
	${INSTALL_SCRIPT} ${FILESDIR}/pserv.sh ${PREFIX}/etc/rc.d/
42
43
43
.include <bsd.port.post.mk>
44
.include <bsd.port.post.mk>
(-)pserv/files/patch-handlers.c (-15 / +11 lines)
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
+
(-)pserv/pkg-plist (-1 / +2 lines)
Lines 1-4 Link Here
1
sbin/pserv
1
sbin/pserv
2
etc/mime.types.pserv
2
etc/mime.types.pserv
3
etc/pserv.conf
3
etc/pserv/pserv.conf
4
etc/rc.d/pserv.sh
4
etc/rc.d/pserv.sh
5
@dirrm etc/pserv

Return to bug 81671