From b88236b45ef5afcdc78a4981a19422b12ca70ff4 Mon Sep 17 00:00:00 2001 From: Pav Lucistnik Date: Wed, 10 May 2006 22:23:14 +0000 Subject: - Fix for recent PHP changes, correct path to php-cgi binary - Add user-overridable variable SUPHP_PATH - Cosmetics PR: ports/97047 Submitted by: Jeremy Chadwick (maintainer) --- www/suphp/Makefile | 18 +++++++++++++++--- www/suphp/files/patch-src-suphp.c | 11 +++++++++++ www/suphp/pkg-descr | 13 +++++++------ www/suphp/pkg-message | 3 ++- 4 files changed, 35 insertions(+), 10 deletions(-) create mode 100644 www/suphp/files/patch-src-suphp.c diff --git a/www/suphp/Makefile b/www/suphp/Makefile index c56b81f4bdab..8a7a70f6ac84 100644 --- a/www/suphp/Makefile +++ b/www/suphp/Makefile @@ -7,12 +7,12 @@ PORTNAME= suphp PORTVERSION= 0.5.2 -PORTREVISION= 1 +PORTREVISION= 2 CATEGORIES= www MASTER_SITES= http://www.suphp.org/download/ MAINTAINER= freebsd@jdc.parodius.com -COMMENT= Securely execute ~user PHP scripts +COMMENT= Securely execute PHP scripts GNU_CONFIGURE= yes USE_PHP= yes @@ -20,7 +20,7 @@ USE_APACHE= 1.3+ WANT_PHP_CGI= yes WITH_LOGFILE?= /var/log/suphp.log -PHP_PATH?= ${LOCALBASE}/bin/php +PHP_PATH?= ${LOCALBASE}/bin/php-cgi MIN_UID?= 80 MIN_GID?= 80 WITH_SETID_MODE?= owner @@ -34,6 +34,14 @@ CONFIGURE_ARGS+= --with-php=${PHP_PATH} \ --with-min-uid=${MIN_GID} \ --with-apxs=${APXS} +# This is the default of the PATH environment variable when scripts +# are run under suphp. This path is normally hard-coded into suphp.c. +# Many people prefer to have /usr/local and other utilities available +# to php scripts. +# Make sure the path is colon-delimited! +# +SUPHP_PATH?= /bin:/usr/bin + ## Available knobs: ## WITHOUT_CHECKPATH: disable check if script resides in DOCUMENT_ROOT .if defined(WITHOUT_CHECKPATH) @@ -58,6 +66,10 @@ show-options: pre-everything:: show-options @${DO_NADA} +post-patch: + @${REINPLACE_CMD} -e 's|%%SUPHP_PATH%%|${SUPHP_PATH}|g' \ + ${WRKSRC}/src/suphp.c + post-install: .if !defined(NOPORTDOCS) @${MKDIR} ${DOCSDIR} diff --git a/www/suphp/files/patch-src-suphp.c b/www/suphp/files/patch-src-suphp.c new file mode 100644 index 000000000000..0c245c7c5fe4 --- /dev/null +++ b/www/suphp/files/patch-src-suphp.c @@ -0,0 +1,11 @@ +--- src/suphp.c.orig Tue Jul 13 02:43:41 2004 ++++ src/suphp.c Tue May 9 08:59:46 2006 +@@ -55,7 +55,7 @@ + + // Set secure PATH + +- suphp_setenv("PATH", "/bin:/usr/bin", 1); ++ suphp_setenv("PATH", "%%SUPHP_PATH%%", 1); + + // Check for PHP_CONFIG environment variable + diff --git a/www/suphp/pkg-descr b/www/suphp/pkg-descr index 04e588bb5945..e750c438988a 100644 --- a/www/suphp/pkg-descr +++ b/www/suphp/pkg-descr @@ -1,8 +1,9 @@ -suPHP is a combination of an Apache module (mod_suphp) and an executable -which provides a wrapper for PHP. With both together, it is possible to -execute PHP scripts with the permissions of their owner without having -to place a PHP binary in each user's cgi-bin directory. suPHP doesn't -need Apache's suExec, provides a logging function and support for +suPHP is a combination of an Apache module (mod_suphp) and an +executable which provides a wrapper for PHP. With both +together, it is possible to execute PHP scripts with the +permissions of their owner without having to place a PHP +binary in each user's cgi-bin directory. suPHP doesn't need +Apache's suExec, provides a logging function and support for different php.ini's. -WWW: http://www.suphp.org +WWW: http://www.suphp.org/ diff --git a/www/suphp/pkg-message b/www/suphp/pkg-message index 9c723ef6a0eb..e7187ad3eb00 100644 --- a/www/suphp/pkg-message +++ b/www/suphp/pkg-message @@ -3,7 +3,8 @@ You have installed mod_suphp, a module that provides a wrapper for PHP for Apache. For help on using this module, please see the suPHP homepage: - http://www.suphp.org + + http://www.suphp.org/ Important hints: Using suPHP can break some PHP-scripts, because of Apache's CGI -- cgit v1.2.3