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

(-)Makefile (-61 / +32 lines)
Lines 6-91 Link Here
6
#
6
#
7
7
8
PORTNAME=	suphp
8
PORTNAME=	suphp
9
PORTVERSION=	0.2.3
9
PORTVERSION=	0.3
10
PORTREVISION=	1
11
CATEGORIES=	www
10
CATEGORIES=	www
12
MASTER_SITES=	http://www.suphp.org/download/
11
MASTER_SITES=	http://www.suphp.org/download/
13
12
14
MAINTAINER=	sheepkiller@cultdeadsheep.org
13
MAINTAINER=	sheepkiller@cultdeadsheep.org
15
COMMENT=	suPHP is a combination which provides a wrapper for PHP
14
COMMENT=	A combination which provides a wrapper for PHP
16
15
17
BUILD_DEPENDS=	${LOCALBASE}/sbin/apxs:${PORTSDIR}/www/apache13
16
BUILD_DEPENDS=	${LOCALBASE}/sbin/apxs:${PORTSDIR}/www/apache13
18
RUN_DEPENDS=	${LOCALBASE}/bin/php:${PORTSDIR}/www/php4-cgi
17
RUN_DEPENDS=	${LOCALBASE}/bin/php:${PORTSDIR}/www/php4-cgi
19
18
20
USE_REINPLACE=	yes
19
HAS_CONFIGURE=	yes
20
USE_GMAKE=	yes
21
CONFLICTS=	mod_php4-4*
21
22
22
MAKE_ARGS+=	APXS="${APXS}"
23
APXS?=		${LOCALBASE}/sbin/apxs
23
APXS?=		${LOCALBASE}/sbin/apxs
24
WWW_USER?=	www
25
WWW_GROUP?=	www
26
LOG_PATH?=	/var/log
24
LOG_PATH?=	/var/log
27
PHP_PATH?=	${LOCALBASE}/bin/php
25
PHP_PATH?=	${LOCALBASE}/bin/php
26
APACHE_USER?=	www
28
27
29
.include <bsd.port.pre.mk>
28
CONFIGURE_ARGS+=	--with-php=${PHP_PATH} \
30
29
			--with-logfile=${LOG_PATH}/suphp.log \
31
.if exists(${LOCALBASE}/libexec/apache/libphp4.so)
30
			--with-apache-user=${APACHE_USER} \
32
IGNORE="suPHP conflicts with mod_php4. It works only with php4-cgi"
31
			--with-min-gid=80 \
32
			--with-min-uid=80 \
33
			--with-apxs=${APXS}
34
35
## Available knobs:
36
##   WITHOUT_CHECKPATH: disable check if script resides in DOCUMENT_ROOT
37
.if defined(WITHOUT_CHECKPATH)
38
CONFIGURE_ARGS+=	--disable-checkpath
33
.endif
39
.endif
34
40
##   WITHOUT_CHECKUID: accept UIDs that are not listed in /etc/passwd
35
pre-configure:
41
.if defined(WITHOUT_CHECKUID)
36
	@${ECHO}
42
CONFIGURE_ARGS+=	--disable-checkuid
37
	@${ECHO} "*-------------------------------------------------------------*"
38
	@${ECHO} " Options :"
39
	@${ECHO} "     - WWW_USER = Apache's User (default www)"
40
	@${ECHO} "     - Define CHECK_PATH, to enable suExec-like path checking"
41
	@${ECHO} "       (based on DocumentRoot directive)."
42
	@${ECHO} "     - LOG_PATH=/path/to/your/logs. Default /var/log/."
43
	@${ECHO} "     - PHP_PATH=/path/to/bin/php. Default ${LOCALBASE}/bin/php."
44
	@${ECHO} "*-------------------------------------------------------------*"
45
	@${ECHO}
46
47
do-configure:
48
	@${ECHO} "Setting User to : ${WWW_USER}"
49
	@${REINPLACE_CMD} -e 's!OPT_APACHE_USER "wwwrun"!OPT_APACHE_USER "${WWW_USER}"!' \
50
		${WRKSRC}/config.h
51
	@${ECHO} "Setting Group to : ${WWW_GROUP}"
52
	@${REINPLACE_CMD} -e 's!OPT_APACHE_GROUP "wwwrun"!OPT_APACHE_GROUP "${WWW_USER}"!' \
53
		${WRKSRC}/config.h
54
	@${ECHO} "Setting checkpath. (if enabled)"
55
.if !defined(CHECK_PATH)
56
	@${REINPLACE_CMD} -e 's!#define OPT_CHECKPATH!/*#define OPT_CHECKPATH*/!' \
57
		${WRKSRC}/config.h
58
.endif
43
.endif
59
	@${ECHO} "Setting logs path"
44
##   WITHOUT_CHECKGID: accept GIDs that are not listed in /etc/group
60
	@${REINPLACE_CMD} -e 's,OPT_LOGFILE "/opt/apache/var/logs/suphp_log",OPT_LOGFILE "${LOG_PATH}/suphp_log",' \
45
.if defined(WITHOUT_CHECKGID)
61
		${WRKSRC}/config.h
46
CONFIGURE_ARGS+=	--disable-checkgid
62
	 @${ECHO} "Setting php path"
47
.endif
63
	@${REINPLACE_CMD} -e 's,OPT_PATH_TO_PHP "/usr/bin/php",OPT_PATH_TO_PHP "${PHP_PATH}",' \
48
64
		${WRKSRC}/config.h
49
show-options:
65
	@${ECHO} "Setting suphp path in mod_suphp"
50
	@${EGREP} '^##' ${.CURDIR}/Makefile | ${SED} 's/##//'
66
	@${REINPLACE_CMD} -e "s,/usr/sbin/suphp,${PREFIX}/sbin/suphp," ${WRKSRC}/apache/mod_suphp.c
67
51
68
post-build:
52
pre-everything::
69
	@(cd ${WRKSRC}/apache && ${APXS} -c mod_suphp.c) 
53
	@${MAKE} show-options
70
54
71
post-install:
55
post-install:
72
	@(cd ${WRKSRC}/apache && ${APXS} -i -a -n suphp ${WRKSRC}/apache/mod_suphp.so)
73
.if !defined(NOPORTDOCS)
56
.if !defined(NOPORTDOCS)
74
	@${MKDIR} ${DOCSDIR} ${DOCSDIR}/apache ${DOCSDIR}/de-doc ${DOCSDIR}/de-doc/apache
57
	@${MKDIR} ${DOCSDIR}
75
	${INSTALL_DATA} ${WRKSRC}/README ${DOCSDIR}
58
	@${CP} -Rfp ${WRKSRC}/doc/* ${DOCSDIR}
76
	${INSTALL_DATA} ${WRKSRC}/INSTALL ${DOCSDIR}
77
	${INSTALL_DATA} ${WRKSRC}/LICENSE ${DOCSDIR}
78
	${INSTALL_DATA} ${WRKSRC}/apache/CONFIG ${DOCSDIR}/apache
79
	${INSTALL_DATA} ${WRKSRC}/apache/README ${DOCSDIR}/apache
80
	${INSTALL_DATA} ${WRKSRC}/apache/INSTALL ${DOCSDIR}/apache
81
	${INSTALL_DATA} ${WRKSRC}/apache/LICENSE ${DOCSDIR}/apache
82
	${INSTALL_DATA} -d ${WRKSRC}/de-doc/ ${DOCSDIR}
83
	${INSTALL_DATA} ${WRKSRC}/de-doc/README.de ${DOCSDIR}/de-doc/
84
	${INSTALL_DATA} ${WRKSRC}/de-doc/INSTALL.de ${DOCSDIR}/de-doc/
85
	${INSTALL_DATA} ${WRKSRC}/de-doc/apache/README.de ${DOCSDIR}/de-doc/apache
86
	${INSTALL_DATA} ${WRKSRC}/de-doc/apache/INSTALL.de ${DOCSDIR}/de-doc/apache
87
	${INSTALL_DATA} ${WRKSRC}/de-doc/apache/CONFIG.de ${DOCSDIR}/de-doc/apache
88
.endif
59
.endif
89
	@${CAT} ${PKGMESSAGE}
60
	@${CAT} ${PKGMESSAGE}
90
61
91
.include <bsd.port.post.mk>
62
.include <bsd.port.mk>
(-)distinfo (-1 / +1 lines)
Line 1 Link Here
1
MD5 (suphp-0.2.3.tar.gz) = a540fa3ac0af43a46afc33cf8401ee89
1
MD5 (suphp-0.3.tar.gz) = f80d54de6aff5db4ab76670f1c5b3c6d
(-)pkg-plist (-16 / +19 lines)
Lines 2-20 Link Here
2
libexec/apache/mod_suphp.so
2
libexec/apache/mod_suphp.so
3
@exec %D/sbin/apxs -e -a -n suphp %D/%f
3
@exec %D/sbin/apxs -e -a -n suphp %D/%f
4
@unexec echo "===>  If you do not plan on reinstalling suphp, you must manually remove"; echo "===>  references to it in httpd.conf."
4
@unexec echo "===>  If you do not plan on reinstalling suphp, you must manually remove"; echo "===>  references to it in httpd.conf."
5
%%PORTDOCS%%share/doc/suphp/apache/CONFIG
5
%%PORTDOCS%%%%DOCSDIR%%/en/INSTALL
6
%%PORTDOCS%%share/doc/suphp/apache/README
6
%%PORTDOCS%%%%DOCSDIR%%/en/LICENSE
7
%%PORTDOCS%%share/doc/suphp/apache/INSTALL
7
%%PORTDOCS%%%%DOCSDIR%%/en/README
8
%%PORTDOCS%%share/doc/suphp/apache/LICENSE
8
%%PORTDOCS%%%%DOCSDIR%%/en/apache/CONFIG
9
%%PORTDOCS%%share/doc/suphp/de-doc/apache/README.de
9
%%PORTDOCS%%%%DOCSDIR%%/en/apache/INSTALL
10
%%PORTDOCS%%share/doc/suphp/de-doc/apache/INSTALL.de
10
%%PORTDOCS%%%%DOCSDIR%%/en/apache/LICENSE
11
%%PORTDOCS%%share/doc/suphp/de-doc/apache/CONFIG.de
11
%%PORTDOCS%%%%DOCSDIR%%/en/apache/README
12
%%PORTDOCS%%share/doc/suphp/de-doc/README.de
12
%%PORTDOCS%%%%DOCSDIR%%/de/INSTALL
13
%%PORTDOCS%%share/doc/suphp/de-doc/INSTALL.de
13
%%PORTDOCS%%%%DOCSDIR%%/de/LICENSE
14
%%PORTDOCS%%share/doc/suphp/README
14
%%PORTDOCS%%%%DOCSDIR%%/de/README
15
%%PORTDOCS%%share/doc/suphp/INSTALL
15
%%PORTDOCS%%%%DOCSDIR%%/de/apache/CONFIG
16
%%PORTDOCS%%share/doc/suphp/LICENSE
16
%%PORTDOCS%%%%DOCSDIR%%/de/apache/INSTALL
17
%%PORTDOCS%%@dirrm share/doc/suphp/de-doc/apache
17
%%PORTDOCS%%%%DOCSDIR%%/de/apache/LICENSE
18
%%PORTDOCS%%@dirrm share/doc/suphp/de-doc
18
%%PORTDOCS%%%%DOCSDIR%%/de/apache/README
19
%%PORTDOCS%%@dirrm share/doc/suphp/apache
19
%%PORTDOCS%%@dirrm %%DOCSDIR%%/de/apache
20
%%PORTDOCS%%@dirrm share/doc/suphp/
20
%%PORTDOCS%%@dirrm %%DOCSDIR%%/en/apache
21
%%PORTDOCS%%@dirrm %%DOCSDIR%%/de
22
%%PORTDOCS%%@dirrm %%DOCSDIR%%/en
23
%%PORTDOCS%%@dirrm %%DOCSDIR%%
(-)files/patch-Makefile (-33 lines)
Removed Link Here
1
--- Makefile.orig	Wed Oct 23 22:16:50 2002
2
+++ Makefile	Tue Nov 12 12:10:58 2002
3
@@ -2,9 +2,9 @@
4
 ## Makefile for suPHP                       ##
5
 ##############################################
6
 
7
-SUPHP_INSTALL = /usr/sbin/suphp
8
+SUPHP_INSTALL = $(PREFIX)/sbin/suphp
9
 
10
-CC = gcc
11
+#CC = gcc
12
 CFLAGS = -c -Wall
13
 LD = gcc
14
 LDFLAGS = -o
15
@@ -31,11 +31,7 @@
16
 	touch suphp.h
17
 
18
 install: suphp
19
-	if [ $$UID = 0 ]; then \
20
-	 cp suphp ${SUPHP_INSTALL}; \
21
-	else \
22
-	 echo -e "You need to be root to install suPHP."; \
23
-	fi
24
+	$(INSTALL) -o root -g wheel -m 4755 suphp ${SUPHP_INSTALL}
25
 
26
 clean:
27
 	rm *.o
28
@@ -43,3 +39,5 @@
29
 
30
 rmbackups:
31
 	rm *~
32
+
33
+all: suphp
(-)files/patch-config.h (-9 lines)
Removed Link Here
1
--- config.h.orig	Wed Oct 23 22:16:50 2002
2
+++ config.h	Wed Nov 13 16:30:35 2002
3
@@ -24,5 +24,6 @@
4
 #define OPT_MIN_UID 100
5
 #define OPT_MIN_GID 100
6
 #define OPT_APACHE_USER "wwwrun"
7
+#define OPT_APACHE_GROUP "wwwrun"
8
 #define OPT_PATH_TO_PHP "/usr/bin/php"
9
 #define OPT_LOGFILE "/opt/apache/var/logs/suphp_log"
(-)files/patch-src::Makefile.in (+10 lines)
Added Link Here
1
--- src/Makefile.in.orig	Mon Aug 25 11:50:48 2003
2
+++ src/Makefile.in	Mon Aug 25 11:50:55 2003
3
@@ -39,7 +39,6 @@
4
 	fi
5
 
6
 install: suphp suphp.mod
7
-	$(INSTALL_PROGRAM) -d $(DESTDIR)$(sbindir)
8
 	$(INSTALL_PROGRAM) -m 4755 suphp $(DESTDIR)$(sbindir)/suphp
9
 	@$(MAKE) $(MAKEDEFS) -C apache install
10
 
(-)files/patch-src::apache::Makefile.in (+13 lines)
Added Link Here
1
--- src/apache/Makefile.in.orig	Mon Aug 25 11:40:47 2003
2
+++ src/apache/Makefile.in	Mon Aug 25 11:41:02 2003
3
@@ -29,7 +29,9 @@
4
 all: suphp.mod
5
 
6
 suphp.mod: mod_suphp.c
7
-	$(APXS) -c $(DEFS) $(EXTRADEFS) $(INCLUDES) -Wc,"$(CFLAGS)" mod_suphp.c
8
+	@if [ ! -f mod_suphp.o ]; then \
9
+	$(APXS) -c $(DEFS) $(EXTRADEFS) $(INCLUDES) -Wc,"$(CFLAGS)" mod_suphp.c ;\
10
+	fi;
11
 
12
 install: suphp.mod
13
 	$(APXS) -i -a mod_suphp.so
(-)files/patch-suphp.c (-34 lines)
Removed Link Here
1
--- suphp.c.orig	Wed Dec 25 14:21:27 2002
2
+++ suphp.c	Sat Jun 28 12:02:12 2003
3
@@ -68,6 +68,7 @@
4
 {
5
  // Check, if program has been started by Apache
6
  struct passwd *apacheuser;
7
+ struct group *apachegroup;
8
  struct passwd *calluser;
9
  struct passwd *targetuser;
10
  struct group *targetgroup;
11
@@ -76,6 +77,7 @@
12
  path_translated = getenv("SCRIPT_FILENAME");
13
   
14
  apacheuser = getpwnam(OPT_APACHE_USER);
15
+ apachegroup = getgrnam(OPT_APACHE_GROUP);
16
  calluser = getpwuid(getuid());
17
  
18
  if (calluser->pw_uid!=apacheuser->pw_uid)
19
@@ -105,13 +107,13 @@
20
  
21
  // Get gid and uid of the file and check it
22
  targetuser = getpwuid(file_get_uid(path_translated));
23
- if (targetuser->pw_uid < OPT_MIN_UID)
24
+ if (targetuser->pw_uid < OPT_MIN_UID && targetuser->pw_uid != apacheuser->pw_uid )
25
  {
26
   log_error ("UID of %s or its target (%d / %s) < %d", path_translated, targetuser->pw_uid, targetuser->pw_name, OPT_MIN_UID);
27
   error_exit(ERRCODE_LOW_UID);
28
  }
29
  targetgroup = getgrgid(file_get_gid(path_translated));
30
- if (targetgroup->gr_gid < OPT_MIN_GID)
31
+ if (targetgroup->gr_gid < OPT_MIN_GID && targetgroup->gr_gid != apachegroup->gr_gid )
32
  {
33
   log_error ("GID of %s or its target (%d / %s) < %d", path_translated, targetgroup->gr_gid, targetgroup->gr_name, OPT_MIN_GID);
34
   error_exit(ERRCODE_LOW_GID);

Return to bug 55952