- Timestamp:
- Jun 3, 2009, 6:46:03 AM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/fc11-dev/server/common/patches/httpd-suexec-scripts.patch
r944 r1146 45 45 APACHE_HELP_STRING(--with-suexec-docroot,SuExec root directory),[ 46 46 AC_DEFINE_UNQUOTED(AP_DOC_ROOT, "$withval", [SuExec root directory] ) ] ) 47 --- httpd-2.2. 2/support/suexec.c.old 2006-04-21 21:53:06.000000000 -040048 +++ httpd-2.2. 2/support/suexec.c 2007-05-22 10:32:04.000000000 -040047 --- httpd-2.2.11/support/suexec.c.old 2008-11-30 10:47:31.000000000 -0500 48 +++ httpd-2.2.11/support/suexec.c 2009-06-03 05:16:45.000000000 -0400 49 49 @@ -30,6 +30,9 @@ 50 50 * … … 57 57 #include "ap_config.h" 58 58 #include "suexec.h" 59 @@ -46,6 +4 8,7 @@59 @@ -46,6 +49,7 @@ 60 60 #include <stdio.h> 61 61 #include <stdarg.h> … … 65 65 #ifdef HAVE_PWD_H 66 66 #include <pwd.h> 67 @@ -95,6 +9 8,7 @@67 @@ -95,6 +99,7 @@ 68 68 { 69 69 /* variable name starts with */ … … 141 141 gid_t gid; /* target group placeholder */ 142 142 char *target_uname; /* target user name */ 143 @@ -350,6 +4 06,20 @@143 @@ -350,6 +413,20 @@ 144 144 #endif /*_OSD_POSIX*/ 145 145 … … 162 162 * or attempts to back up out of the current directory, 163 163 * to protect against attacks. If any are 164 @@ -371,6 +44 1,7 @@164 @@ -371,6 +448,7 @@ 165 165 userdir = 1; 166 166 } … … 170 170 * Error out if the target username is invalid. 171 171 */ 172 @@ -45 0,7 +521,7 @@172 @@ -452,7 +530,7 @@ 173 173 * Error out if attempt is made to execute as root or as 174 174 * a UID less than AP_UID_MIN. Tsk tsk. … … 179 179 exit(107); 180 180 } 181 @@ -48 2,6 +553,21 @@181 @@ -484,6 +562,21 @@ 182 182 log_err("failed to setuid (%ld: %s)\n", uid, cmd); 183 183 exit(110); … … 201 201 /* 202 202 * Get the current working directory, as well as the proper 203 @@ -50 4,6 +588,21 @@203 @@ -506,6 +599,21 @@ 204 204 log_err("cannot get docroot information (%s)\n", target_homedir); 205 205 exit(112); … … 223 223 else { 224 224 if (((chdir(AP_DOC_ROOT)) != 0) || 225 @@ -53 0,15 +629,17 @@225 @@ -532,15 +640,17 @@ 226 226 /* 227 227 * Error out if cwd is writable by others. … … 242 242 exit(117); 243 243 } 244 @@ -54 6,10 +647,12 @@244 @@ -548,10 +658,12 @@ 245 245 /* 246 246 * Error out if the program is writable by others. … … 255 255 /* 256 256 * Error out if the file is setuid or setgid. 257 @@ -56 3,6 +666,7 @@257 @@ -565,6 +677,7 @@ 258 258 * Error out if the target name/group is different from 259 259 * the name/group of the cwd or the program. … … 263 263 (gid != dir_info.st_gid) || 264 264 (uid != prg_info.st_uid) || 265 @@ -57 4,12 +678,14@@265 @@ -576,16 +689,33 @@ 266 266 prg_info.st_uid, prg_info.st_gid); 267 267 exit(120); … … 279 279 exit(121); 280 280 } 281 @@ -606,6 +711,21 @@282 exit(122);283 }284 281 285 282 + if (is_static_extension(cmd)) { 286 283 + argv[2] = STATIC_CAT_PATH; 287 284 + execv(STATIC_CAT_PATH, &argv[2]); 288 + 289 + 285 + log_err("(%d)%s: static_cat exec failed (%s)\n", errno, strerror(errno), argv[2]); 286 + exit(255); 290 287 + } 291 288 + if (is_php_extension(cmd)) { … … 294 291 + argv[2] = "-f"; 295 292 + execv(PHP_PATH, &argv[1]); 296 + 297 + 298 + } 299 + 300 /*301 * Execute the command, replacing our image with its own.302 * /293 + log_err("(%d)%s: php exec failed (%s)\n", errno, strerror(errno), argv[2]); 294 + exit(255); 295 + } 296 + 297 #ifdef AP_SUEXEC_UMASK 298 /* 299 * umask() uses inverse logic; bits are CLEAR for allowed access.
Note: See TracChangeset
for help on using the changeset viewer.