ports/81671: www/pserv does not compile after update to 3.3
Vasil Dimov
vd at datamax.bg
Mon May 30 14:20:02 UTC 2005
>Number: 81671
>Category: ports
>Synopsis: www/pserv does not compile after update to 3.3
>Confidential: no
>Severity: serious
>Priority: high
>Responsible: freebsd-ports-bugs
>State: open
>Quarter:
>Keywords:
>Date-Required:
>Class: sw-bug
>Submitter-Id: current-users
>Arrival-Date: Mon May 30 14:20:01 GMT 2005
>Closed-Date:
>Last-Modified:
>Originator: Vasil Dimov
>Release: FreeBSD 5.4-STABLE i386
>Organization:
DataMax
>Environment:
System: FreeBSD sinanica.bg.datamax 5.4-STABLE FreeBSD 5.4-STABLE #6: Tue May 10 12:46:25 EEST 2005 root at sinanica.bg.datamax:/usr/obj/usr/src/sys/SINANICA-SMP i386
>Description:
www/pserv does not compile after being updated to 3.3.
handlers.c: In function `phpHandler':
handlers.c:452: error: `environ' undeclared (first use in this function)
handlers.c:452: error: (Each undeclared identifier is reported only once
handlers.c:452: error: for each function it appears in.)
handlers.c:452: error: `PATH_MATCH_STRING' undeclared (first use in this function)
This is quite obvious and is not environment-dependent.
Other errors that come with this update are that port was not
synchronized with new pserv.conf's location, resuling in
"config file not found" error at startup.
Related:
http://www.FreeBSD.org/cgi/query-pr.cgi?pr=80726
>How-To-Repeat:
>Fix:
--- pserv_fix.diff begins here ---
diff -urN pserv.orig/Makefile pserv/Makefile
--- pserv.orig/Makefile Mon May 30 02:24:45 2005
+++ pserv/Makefile Mon May 30 15:32:21 2005
@@ -37,7 +37,8 @@
do-install:
${INSTALL_PROGRAM} ${WRKSRC}/sources/pserv ${PREFIX}/sbin/
${INSTALL_DATA} ${WRKSRC}/defaults/mime_types.dat ${PREFIX}/etc/mime.types.pserv
- ${INSTALL_DATA} ${WRKSRC}/defaults/pserv.conf ${PREFIX}/etc/
+ ${MKDIR} ${PREFIX}/etc/pserv/
+ ${INSTALL_DATA} ${WRKSRC}/defaults/pserv.conf ${PREFIX}/etc/pserv/
${INSTALL_SCRIPT} ${FILESDIR}/pserv.sh ${PREFIX}/etc/rc.d/
.include <bsd.port.post.mk>
diff -urN pserv.orig/files/patch-handlers.c pserv/files/patch-handlers.c
--- pserv.orig/files/patch-handlers.c Mon May 30 02:24:45 2005
+++ pserv/files/patch-handlers.c Mon May 30 15:14:57 2005
@@ -1,5 +1,5 @@
---- sources/handlers.c.orig Mon May 16 23:03:16 2005
-+++ sources/handlers.c Sat May 28 10:38:18 2005
+--- sources/handlers.c.orig Tue May 17 00:03:16 2005
++++ sources/handlers.c Mon May 30 11:44:23 2005
@@ -25,6 +25,7 @@
#endif
@@ -23,7 +23,7 @@
strcpy(newEnvp[i], "SERVER_SOFTWARE=");
strcat(newEnvp[i], SERVER_SOFTWARE_STR);
strcat(newEnvp[i], "/");
-@@ -326,8 +335,237 @@
+@@ -326,8 +335,233 @@
}
#endif /* ENABLE_CGI */
@@ -36,7 +36,7 @@
+struct request req;
+char *postStr;
+{
-+ char envPath[MAX_PATH_LEN+1]; /* where to hold the envrion PATH parameter */
++ char *envPath; /* pointer to the envrionment PATH variable */
+ char *relativePath;
+ char scriptWorkingDir[MAX_PATH_LEN+1];
+ char **newArgv;
@@ -137,16 +137,8 @@
+ newEnvp[i] = calloc(MAX_PATH_LEN, sizeof(char));
+ }
+
-+
-+
-+ /* extracting PATH env variable */
-+ i = 0;
-+ while (environ && strncmp(environ[i], PATH_MATCH_STRING, strlen(PATH_MATCH_STRING)))
-+ i++;
-+ if(environ[i])
-+ strcpy(envPath, environ[i]);
-+ else
-+ envPath[0] = '\0'; /* maybe we should set some default? */
++ /* extract PATH env variable */
++ envPath = getenv("PATH");
+
+ i = 0;
+ strcpy(newArgv[i++], phpFileName); /* here we should pass the phppath */
@@ -205,7 +197,6 @@
+ strcpy(newEnvp[i], "GATEWAY_INTERFACE=");
+ strcat(newEnvp[i++], CGI_VERSION);
+ sprintf(newEnvp[i++], "SERVER_PORT=%d", port);
-+ strcpy(newEnvp[i++], envPath);
+ strcpy(newEnvp[i], "QUERY_STRING=");
+ strcat(newEnvp[i++], req.queryString);
+ strcpy(newEnvp[i], "SERVER_PROTOCOL=");
@@ -220,6 +211,11 @@
+ {
+ strcpy(newEnvp[i], "HTTP_COOKIE=");
+ strcat(newEnvp[i++], req.cookie);
++ }
++ if (envPath != NULL)
++ {
++ strcpy(newEnvp[i], "PATH=");
++ strcat(newEnvp[i++], envPath);
+ }
+ newEnvp[i] = NULL;
+
diff -urN pserv.orig/pkg-plist pserv/pkg-plist
--- pserv.orig/pkg-plist Mon May 30 02:24:45 2005
+++ pserv/pkg-plist Mon May 30 15:59:07 2005
@@ -1,4 +1,5 @@
sbin/pserv
etc/mime.types.pserv
-etc/pserv.conf
+etc/pserv/pserv.conf
etc/rc.d/pserv.sh
+ at dirrm etc/pserv
--- pserv_fix.diff ends here ---
>Release-Note:
>Audit-Trail:
>Unformatted:
More information about the freebsd-ports-bugs
mailing list