Ignore:
Timestamp:
Sep 22, 2013, 7:05:37 PM (11 years ago)
Author:
glasgall
Message:
update httpd patches for 2.4.6
File:
1 edited

Legend:

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

    r2422 r2469  
    1 From 8445788d68230b2e18739166f4c3ae6434038421 Mon Sep 17 00:00:00 2001
     1From 427d432a56df94d69a11cc438b08adb070615005 Mon Sep 17 00:00:00 2001
    22From: Alexander Chernyakhovsky <achernya@mit.edu>
    33Date: Fri, 3 May 2013 21:38:58 -0400
    4 Subject: [PATCH 1/4] Add scripts-specific support to suexec
     4Subject: [PATCH] Add scripts-specific support to suexec
    55
    66This patch make suexec aware of static-cat, Scripts' tool to serve
     
    1919manner that will strip arguments passed by Apache to php-cgi.
    2020---
    21  configure.in     |    4 ++
    22  support/suexec.c |  172 +++++++++++++++++++++++++++++++++++++++++++++++++++++-
     21 configure.in     |   4 ++
     22 support/suexec.c | 172 ++++++++++++++++++++++++++++++++++++++++++++++++++++++-
    2323 2 files changed, 173 insertions(+), 3 deletions(-)
    2424
    2525diff --git a/configure.in b/configure.in
    26 index d93f78c..14faccf 100644
     26index 811aace..a95349f 100644
    2727--- a/configure.in
    2828+++ b/configure.in
    29 @@ -720,6 +720,10 @@ AC_ARG_WITH(suexec-userdir,
     29@@ -721,6 +721,10 @@ AC_ARG_WITH(suexec-userdir,
    3030 APACHE_HELP_STRING(--with-suexec-userdir,User subdirectory),[
    3131   AC_DEFINE_UNQUOTED(AP_USERDIR_SUFFIX, "$withval", [User subdirectory] ) ] )
     
    3939   AC_DEFINE_UNQUOTED(AP_DOC_ROOT, "$withval", [SuExec root directory] ) ] )
    4040diff --git a/support/suexec.c b/support/suexec.c
    41 index 5b6b254..e377042 100644
     41index 32e7320..3a4d802 100644
    4242--- a/support/suexec.c
    4343+++ b/support/suexec.c
     
    6060 
    6161     /* variable name is */
    62 @@ -264,9 +268,108 @@ static void clean_env(void)
     62@@ -268,9 +272,108 @@ static void clean_env(void)
    6363     environ = cleanenv;
    6464 }
     
    169169     gid_t gid;              /* target group placeholder  */
    170170     char *target_uname;     /* target user name          */
    171 @@ -286,6 +389,7 @@ int main(int argc, char *argv[])
     171@@ -290,6 +393,7 @@ int main(int argc, char *argv[])
    172172      * Start with a "clean" environment
    173173      */
     
    177177     /*
    178178      * Check existence/validity of the UID of the user
    179 @@ -369,6 +473,20 @@ int main(int argc, char *argv[])
     179@@ -373,6 +477,20 @@ int main(int argc, char *argv[])
    180180 #endif /*_OSD_POSIX*/
    181181 
     
    198198      * or attempts to back up out of the current directory,
    199199      * to protect against attacks.  If any are
    200 @@ -390,6 +508,7 @@ int main(int argc, char *argv[])
     200@@ -394,6 +512,7 @@ int main(int argc, char *argv[])
    201201         userdir = 1;
    202202     }
     
    206206      * Error out if the target username is invalid.
    207207      */
    208 @@ -471,7 +590,7 @@ int main(int argc, char *argv[])
     208@@ -482,7 +601,7 @@ int main(int argc, char *argv[])
    209209      * Error out if attempt is made to execute as root or as
    210210      * a UID less than AP_UID_MIN.  Tsk tsk.
     
    215215         exit(107);
    216216     }
    217 @@ -503,6 +622,7 @@ int main(int argc, char *argv[])
     217@@ -514,6 +633,7 @@ int main(int argc, char *argv[])
    218218         log_err("failed to setuid (%lu: %s)\n", (unsigned long)uid, cmd);
    219219         exit(110);
     
    223223     /*
    224224      * Get the current working directory, as well as the proper
    225 @@ -525,6 +645,21 @@ int main(int argc, char *argv[])
     225@@ -536,6 +656,21 @@ int main(int argc, char *argv[])
    226226             log_err("cannot get docroot information (%s)\n", target_homedir);
    227227             exit(112);
     
    245245     else {
    246246         if (((chdir(AP_DOC_ROOT)) != 0) ||
    247 @@ -551,15 +686,17 @@ int main(int argc, char *argv[])
     247@@ -562,15 +697,17 @@ int main(int argc, char *argv[])
    248248     /*
    249249      * Error out if cwd is writable by others.
     
    264264         exit(117);
    265265     }
    266 @@ -567,10 +704,12 @@ int main(int argc, char *argv[])
     266@@ -578,10 +715,12 @@ int main(int argc, char *argv[])
    267267     /*
    268268      * Error out if the program is writable by others.
     
    277277     /*
    278278      * Error out if the file is setuid or setgid.
    279 @@ -584,6 +723,7 @@ int main(int argc, char *argv[])
     279@@ -595,6 +734,7 @@ int main(int argc, char *argv[])
    280280      * Error out if the target name/group is different from
    281281      * the name/group of the cwd or the program.
     
    285285         (gid != dir_info.st_gid) ||
    286286         (uid != prg_info.st_uid) ||
    287 @@ -595,12 +735,14 @@ int main(int argc, char *argv[])
     287@@ -606,12 +746,14 @@ int main(int argc, char *argv[])
    288288                 (unsigned long)prg_info.st_uid, (unsigned long)prg_info.st_gid);
    289289         exit(120);
     
    301301         exit(121);
    302302     }
    303 @@ -649,6 +791,30 @@ int main(int argc, char *argv[])
     303@@ -660,6 +802,30 @@ int main(int argc, char *argv[])
    304304     /*
    305305      * Execute the command, replacing our image with its own.
     
    333333     {
    334334--
    335 1.7.9.6 (Apple Git-31.1)
    336 
     3351.8.1.2
     336
Note: See TracChangeset for help on using the changeset viewer.