aboutsummaryrefslogtreecommitdiffstats
path: root/www/suphp/files
diff options
context:
space:
mode:
authordaichi <daichi@FreeBSD.org>2003-06-25 14:50:53 +0800
committerdaichi <daichi@FreeBSD.org>2003-06-25 14:50:53 +0800
commitfe4210785111cadcbe829df2fa63ed772a0ec886 (patch)
tree71cad3f7416cc08113913fca313ec116a8c7eb4b /www/suphp/files
parent6c5a1418eeb11297d31b41925b56659c897e75ea (diff)
downloadfreebsd-ports-gnome-fe4210785111cadcbe829df2fa63ed772a0ec886.tar.gz
freebsd-ports-gnome-fe4210785111cadcbe829df2fa63ed772a0ec886.tar.zst
freebsd-ports-gnome-fe4210785111cadcbe829df2fa63ed772a0ec886.zip
Add suphp 0.2.2,
suPHP is a combination which provides a wrapper for PHP. PR: 42790 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-suphp.c34
3 files changed, 76 insertions, 0 deletions
diff --git a/www/suphp/files/patch-Makefile b/www/suphp/files/patch-Makefile
new file mode 100644
index 000000000000..a472d9849926
--- /dev/null
+++ b/www/suphp/files/patch-Makefile
@@ -0,0 +1,33 @@
+--- 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
new file mode 100644
index 000000000000..310ec652982c
--- /dev/null
+++ b/www/suphp/files/patch-config.h
@@ -0,0 +1,9 @@
+--- 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-suphp.c b/www/suphp/files/patch-suphp.c
new file mode 100644
index 000000000000..832fd84d1868
--- /dev/null
+++ b/www/suphp/files/patch-suphp.c
@@ -0,0 +1,34 @@
+--- suphp.c.orig Wed Oct 23 22:16:50 2002
++++ suphp.c Wed Nov 13 16:26:01 2002
+@@ -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 (%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 (%d / %s) < %d", path_translated, targetgroup->gr_gid, targetgroup->gr_name, OPT_MIN_GID);
+ error_exit(ERRCODE_LOW_GID);