Ignore:
Timestamp:
Jun 3, 2009, 6:46:03 AM (13 years ago)
Author:
mitchb
Message:
Version, context, etc. fixups to build Apache on Fedora 11
File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/fc11-dev/server/common/patches/httpd-suexec-scripts.patch

    r944 r1146  
    4545 APACHE_HELP_STRING(--with-suexec-docroot,SuExec root directory),[
    4646   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 -0400
    48 +++ httpd-2.2.2/support/suexec.c        2007-05-22 10:32:04.000000000 -0400
     47--- 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
    4949@@ -30,6 +30,9 @@
    5050  *
     
    5757 #include "ap_config.h"
    5858 #include "suexec.h"
    59 @@ -46,6 +48,7 @@
     59@@ -46,6 +49,7 @@
    6060 #include <stdio.h>
    6161 #include <stdarg.h>
     
    6565 #ifdef HAVE_PWD_H
    6666 #include <pwd.h>
    67 @@ -95,6 +98,7 @@
     67@@ -95,6 +99,7 @@
    6868 {
    6969     /* variable name starts with */
     
    141141     gid_t gid;              /* target group placeholder  */
    142142     char *target_uname;     /* target user name          */
    143 @@ -350,6 +406,20 @@
     143@@ -350,6 +413,20 @@
    144144 #endif /*_OSD_POSIX*/
    145145 
     
    162162      * or attempts to back up out of the current directory,
    163163      * to protect against attacks.  If any are
    164 @@ -371,6 +441,7 @@
     164@@ -371,6 +448,7 @@
    165165         userdir = 1;
    166166     }
     
    170170      * Error out if the target username is invalid.
    171171      */
    172 @@ -450,7 +521,7 @@
     172@@ -452,7 +530,7 @@
    173173      * Error out if attempt is made to execute as root or as
    174174      * a UID less than AP_UID_MIN.  Tsk tsk.
     
    179179         exit(107);
    180180     }
    181 @@ -482,6 +553,21 @@
     181@@ -484,6 +562,21 @@
    182182         log_err("failed to setuid (%ld: %s)\n", uid, cmd);
    183183         exit(110);
     
    201201     /*
    202202      * Get the current working directory, as well as the proper
    203 @@ -504,6 +588,21 @@
     203@@ -506,6 +599,21 @@
    204204             log_err("cannot get docroot information (%s)\n", target_homedir);
    205205             exit(112);
     
    223223     else {
    224224         if (((chdir(AP_DOC_ROOT)) != 0) ||
    225 @@ -530,15 +629,17 @@
     225@@ -532,15 +640,17 @@
    226226     /*
    227227      * Error out if cwd is writable by others.
     
    242242         exit(117);
    243243     }
    244 @@ -546,10 +647,12 @@
     244@@ -548,10 +658,12 @@
    245245     /*
    246246      * Error out if the program is writable by others.
     
    255255     /*
    256256      * Error out if the file is setuid or setgid.
    257 @@ -563,6 +666,7 @@
     257@@ -565,6 +677,7 @@
    258258      * Error out if the target name/group is different from
    259259      * the name/group of the cwd or the program.
     
    263263         (gid != dir_info.st_gid) ||
    264264         (uid != prg_info.st_uid) ||
    265 @@ -574,12 +678,14 @@
     265@@ -576,16 +689,33 @@
    266266                 prg_info.st_uid, prg_info.st_gid);
    267267         exit(120);
     
    279279         exit(121);
    280280     }
    281 @@ -606,6 +711,21 @@
    282        exit(122);
    283      }
    284281 
    285282+    if (is_static_extension(cmd)) {
    286283+        argv[2] = STATIC_CAT_PATH;
    287284+        execv(STATIC_CAT_PATH, &argv[2]);
    288 +       log_err("(%d)%s: static_cat exec failed (%s)\n", errno, strerror(errno), argv[2]);
    289 +       exit(255);
     285+        log_err("(%d)%s: static_cat exec failed (%s)\n", errno, strerror(errno), argv[2]);
     286+        exit(255);
    290287+    }
    291288+    if (is_php_extension(cmd)) {
     
    294291+        argv[2] = "-f";
    295292+        execv(PHP_PATH, &argv[1]);
    296 +       log_err("(%d)%s: php exec failed (%s)\n", errno, strerror(errno), argv[2]);
    297 +       exit(255);
    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.