aboutsummaryrefslogtreecommitdiffstats
path: root/www/suphp/files
diff options
context:
space:
mode:
authoredwin <edwin@FreeBSD.org>2003-08-25 20:13:36 +0800
committeredwin <edwin@FreeBSD.org>2003-08-25 20:13:36 +0800
commite04eb58e52ead4c604027524f1fccf9881551c1e (patch)
treeed43df0ff9c77d075d4bd021d75e0d93149858cc /www/suphp/files
parent957e9656dab44e76fd666dd5342523acdaec6f82 (diff)
downloadfreebsd-ports-gnome-e04eb58e52ead4c604027524f1fccf9881551c1e.tar.gz
freebsd-ports-gnome-e04eb58e52ead4c604027524f1fccf9881551c1e.tar.zst
freebsd-ports-gnome-e04eb58e52ead4c604027524f1fccf9881551c1e.zip
[update] www/suphp: update to 0.3 and fix a security leak introduced with previous patch
- update to 0.3 - add a workaround to don't use getpwuid to performs check for apache user (since 4.x doesn't support getpwuid_r). - use %%DOCSDIR%% PR: ports/55952 Submitted by: Clement Laforet <sheepkiller@cultdeadsheep.org>
Diffstat (limited to 'www/suphp/files')
-rw-r--r--www/suphp/files/patch-Makefile33
-rw-r--r--www/suphp/files/patch-config.h9
-rw-r--r--www/suphp/files/patch-src::Makefile.in10
-rw-r--r--www/suphp/files/patch-src::apache::Makefile.in13
-rw-r--r--www/suphp/files/patch-suphp.c34
5 files changed, 23 insertions, 76 deletions
diff --git a/www/suphp/files/patch-Makefile b/www/suphp/files/patch-Makefile
deleted file mode 100644
index a472d9849926..000000000000
--- a/www/suphp/files/patch-Makefile
+++ /dev/null
@@ -1,33 +0,0 @@
---- Makefile.orig Wed Oct 23 22:16:50 2002
-+++ Makefile Tue Nov 12 12:10:58 2002
-@@ -2,9 +2,9 @@
- ## Makefile for suPHP ##
- ##############################################
-
--SUPHP_INSTALL = /usr/sbin/suphp
-+SUPHP_INSTALL = $(PREFIX)/sbin/suphp
-
--CC = gcc
-+#CC = gcc
- CFLAGS = -c -Wall
- LD = gcc
- LDFLAGS = -o
-@@ -31,11 +31,7 @@
- touch suphp.h
-
- install: suphp
-- if [ $$UID = 0 ]; then \
-- cp suphp ${SUPHP_INSTALL}; \
-- else \
-- echo -e "You need to be root to install suPHP."; \
-- fi
-+ $(INSTALL) -o root -g wheel -m 4755 suphp ${SUPHP_INSTALL}
-
- clean:
- rm *.o
-@@ -43,3 +39,5 @@
-
- rmbackups:
- rm *~
-+
-+all: suphp
diff --git a/www/suphp/files/patch-config.h b/www/suphp/files/patch-config.h
deleted file mode 100644
index 310ec652982c..000000000000
--- a/www/suphp/files/patch-config.h
+++ /dev/null
@@ -1,9 +0,0 @@
---- config.h.orig Wed Oct 23 22:16:50 2002
-+++ config.h Wed Nov 13 16:30:35 2002
-@@ -24,5 +24,6 @@
- #define OPT_MIN_UID 100
- #define OPT_MIN_GID 100
- #define OPT_APACHE_USER "wwwrun"
-+#define OPT_APACHE_GROUP "wwwrun"
- #define OPT_PATH_TO_PHP "/usr/bin/php"
- #define OPT_LOGFILE "/opt/apache/var/logs/suphp_log"
diff --git a/www/suphp/files/patch-src::Makefile.in b/www/suphp/files/patch-src::Makefile.in
new file mode 100644
index 000000000000..c3925d8f684f
--- /dev/null
+++ b/www/suphp/files/patch-src::Makefile.in
@@ -0,0 +1,10 @@
+--- src/Makefile.in.orig Mon Aug 25 11:50:48 2003
++++ src/Makefile.in Mon Aug 25 11:50:55 2003
+@@ -39,7 +39,6 @@
+ fi
+
+ install: suphp suphp.mod
+- $(INSTALL_PROGRAM) -d $(DESTDIR)$(sbindir)
+ $(INSTALL_PROGRAM) -m 4755 suphp $(DESTDIR)$(sbindir)/suphp
+ @$(MAKE) $(MAKEDEFS) -C apache install
+
diff --git a/www/suphp/files/patch-src::apache::Makefile.in b/www/suphp/files/patch-src::apache::Makefile.in
new file mode 100644
index 000000000000..86ba22d0e02f
--- /dev/null
+++ b/www/suphp/files/patch-src::apache::Makefile.in
@@ -0,0 +1,13 @@
+--- src/apache/Makefile.in.orig Mon Aug 25 11:40:47 2003
++++ src/apache/Makefile.in Mon Aug 25 11:41:02 2003
+@@ -29,7 +29,9 @@
+ all: suphp.mod
+
+ suphp.mod: mod_suphp.c
+- $(APXS) -c $(DEFS) $(EXTRADEFS) $(INCLUDES) -Wc,"$(CFLAGS)" mod_suphp.c
++ @if [ ! -f mod_suphp.o ]; then \
++ $(APXS) -c $(DEFS) $(EXTRADEFS) $(INCLUDES) -Wc,"$(CFLAGS)" mod_suphp.c ;\
++ fi;
+
+ install: suphp.mod
+ $(APXS) -i -a mod_suphp.so
diff --git a/www/suphp/files/patch-suphp.c b/www/suphp/files/patch-suphp.c
deleted file mode 100644
index 5ea6bf32dcd1..000000000000
--- a/www/suphp/files/patch-suphp.c
+++ /dev/null
@@ -1,34 +0,0 @@
---- suphp.c.orig Wed Dec 25 14:21:27 2002
-+++ suphp.c Sat Jun 28 12:02:12 2003
-@@ -68,6 +68,7 @@
- {
- // Check, if program has been started by Apache
- struct passwd *apacheuser;
-+ struct group *apachegroup;
- struct passwd *calluser;
- struct passwd *targetuser;
- struct group *targetgroup;
-@@ -76,6 +77,7 @@
- path_translated = getenv("SCRIPT_FILENAME");
-
- apacheuser = getpwnam(OPT_APACHE_USER);
-+ apachegroup = getgrnam(OPT_APACHE_GROUP);
- calluser = getpwuid(getuid());
-
- if (calluser->pw_uid!=apacheuser->pw_uid)
-@@ -105,13 +107,13 @@
-
- // Get gid and uid of the file and check it
- targetuser = getpwuid(file_get_uid(path_translated));
-- if (targetuser->pw_uid < OPT_MIN_UID)
-+ if (targetuser->pw_uid < OPT_MIN_UID && targetuser->pw_uid != apacheuser->pw_uid )
- {
- log_error ("UID of %s or its target (%d / %s) < %d", path_translated, targetuser->pw_uid, targetuser->pw_name, OPT_MIN_UID);
- error_exit(ERRCODE_LOW_UID);
- }
- targetgroup = getgrgid(file_get_gid(path_translated));
-- if (targetgroup->gr_gid < OPT_MIN_GID)
-+ if (targetgroup->gr_gid < OPT_MIN_GID && targetgroup->gr_gid != apachegroup->gr_gid )
- {
- log_error ("GID of %s or its target (%d / %s) < %d", path_translated, targetgroup->gr_gid, targetgroup->gr_name, OPT_MIN_GID);
- error_exit(ERRCODE_LOW_GID);