summaryrefslogtreecommitdiff
path: root/debian/patches/suexec-custom.patch
diff options
context:
space:
mode:
authorIgor Pashev <pashev.igor@gmail.com>2016-12-05 22:19:16 +0300
committerIgor Pashev <pashev.igor@gmail.com>2016-12-05 22:19:16 +0300
commit89e9332e2bacdba1cf44aabfcfc082c0de62871c (patch)
tree156ad5e5b00e6966642b2d600dafa5f0cc1d43ac /debian/patches/suexec-custom.patch
parentf51547f19e44fc1f511837443cb92ba28c189b9c (diff)
parentadb6f181257af28ee67af15fc49d2699a0080d4c (diff)
downloadapache2-89e9332e2bacdba1cf44aabfcfc082c0de62871c.tar.gz
Merge branch 'master' of git://anonscm.debian.org/pkg-apache/apache2
Diffstat (limited to 'debian/patches/suexec-custom.patch')
-rw-r--r--debian/patches/suexec-custom.patch30
1 files changed, 13 insertions, 17 deletions
diff --git a/debian/patches/suexec-custom.patch b/debian/patches/suexec-custom.patch
index e25842e3..532f99a3 100644
--- a/debian/patches/suexec-custom.patch
+++ b/debian/patches/suexec-custom.patch
@@ -1,9 +1,9 @@
Description: the actual patch to make suexec-custom read a config file
Forwarded: not-needed
Author: Stefan Fritsch <sf@debian.org>
-Last-Update: 2012-02-25
---- a/support/suexec-custom.c
-+++ b/support/suexec-custom.c
+Last-Update: 2014-05-29
+--- apache2.orig/support/suexec-custom.c
++++ apache2/support/suexec-custom.c
@@ -29,6 +29,7 @@
*
*
@@ -20,7 +20,7 @@ Last-Update: 2012-02-25
#if APR_HAVE_UNISTD_H
#include <unistd.h>
#endif
-@@ -197,6 +199,26 @@
+@@ -197,6 +199,26 @@ static void log_no_err(const char *fmt,.
return;
}
@@ -47,7 +47,7 @@ Last-Update: 2012-02-25
static void clean_env(void)
{
char pathbuf[512];
-@@ -263,6 +285,11 @@
+@@ -263,6 +285,11 @@ int main(int argc, char *argv[])
struct stat dir_info; /* directory info holder */
struct stat prg_info; /* program info holder */
int cwdh; /* handle to cwd */
@@ -59,7 +59,7 @@ Last-Update: 2012-02-25
/*
* Start with a "clean" environment
-@@ -292,15 +319,10 @@
+@@ -292,15 +319,10 @@ int main(int argc, char *argv[])
|| (! strcmp(AP_HTTPD_USER, pw->pw_name)))
#endif /* _OSD_POSIX */
) {
@@ -76,7 +76,7 @@ Last-Update: 2012-02-25
#ifdef AP_LOG_EXEC
fprintf(stderr, " -D AP_LOG_EXEC=\"%s\"\n", AP_LOG_EXEC);
#endif
-@@ -313,9 +335,6 @@
+@@ -313,9 +335,6 @@ int main(int argc, char *argv[])
#ifdef AP_UID_MIN
fprintf(stderr, " -D AP_UID_MIN=%d\n", AP_UID_MIN);
#endif
@@ -86,7 +86,7 @@ Last-Update: 2012-02-25
exit(0);
}
/*
-@@ -330,23 +349,6 @@
+@@ -330,23 +349,6 @@ int main(int argc, char *argv[])
target_gname = argv[2];
cmd = argv[3];
@@ -110,7 +110,7 @@ Last-Update: 2012-02-25
/*
* Check for a leading '/' (absolute path) in the command to be executed,
-@@ -371,6 +373,63 @@
+@@ -371,6 +373,59 @@ int main(int argc, char *argv[])
}
/*
@@ -119,18 +119,14 @@ Last-Update: 2012-02-25
+ * SUEXEC_CONFIG_DIR/username
+ * If not, error out.
+ */
-+ filename = malloc(AP_MAXPATH+1);
+ suexec_docroot = malloc(AP_MAXPATH+1);
+ suexec_userdir_suffix = malloc(AP_MAXPATH+1);
-+ if (!filename || !suexec_docroot || !suexec_userdir_suffix) {
++ if (!suexec_docroot || !suexec_userdir_suffix ||
++ asprintf(&filename, SUEXEC_CONFIG_DIR "%s", pw->pw_name) == -1) {
+ log_err("malloc failed\n");
+ exit(120);
+ }
+
-+ strncpy(filename, SUEXEC_CONFIG_DIR, AP_MAXPATH);
-+ strncat(filename, pw->pw_name, AP_MAXPATH);
-+ filename[AP_MAXPATH] = '\0';
-+
+ configfile = fopen(filename, "r");
+ if (!configfile) {
+ log_err("User %s not allowed: Could not open config file %s\n", pw->pw_name, filename);
@@ -174,7 +170,7 @@ Last-Update: 2012-02-25
* Error out if the target username is invalid.
*/
if (strspn(target_uname, "1234567890") != strlen(target_uname)) {
-@@ -511,7 +570,7 @@
+@@ -511,7 +566,7 @@ int main(int argc, char *argv[])
if (userdir) {
if (((chdir(target_homedir)) != 0) ||
@@ -183,7 +179,7 @@ Last-Update: 2012-02-25
((getcwd(dwd, AP_MAXPATH)) == NULL) ||
((fchdir(cwdh)) != 0)) {
log_err("cannot get docroot information (%s)\n", target_homedir);
-@@ -519,7 +578,7 @@
+@@ -519,7 +574,7 @@ int main(int argc, char *argv[])
}
}
else {