Ignore:
Timestamp:
Jun 21, 2013, 12:36:29 AM (11 years ago)
Author:
achernya
Message:
Fix mod_status-security to actually work

Upstream changed the semantics of this module, and the initial rebase
mistakenly included too much upstream code.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/fc19-dev/server/common/patches/httpd-mod_status-security.patch

    r2422 r2439  
    1 From 0c2aac95f8df4e7c243ea00d54d4050e32f7868b Mon Sep 17 00:00:00 2001
     1From 6fc43320aab74560a5aad10f6602309f9de9b762 Mon Sep 17 00:00:00 2001
    22From: Alexander Chernyakhovsky <achernya@mit.edu>
    33Date: Fri, 3 May 2013 21:39:17 -0400
     
    1111Signed-off-by: Geoffrey Thomas <geofft@mit.edu>
    1212---
    13  modules/generators/mod_status.c |   60 +++++++++++++++++++++++++++++++++++++--
    14  1 file changed, 57 insertions(+), 3 deletions(-)
     13 modules/generators/mod_status.c |   33 +++++++++++++++++++++++++++++----
     14 1 file changed, 29 insertions(+), 4 deletions(-)
    1515
    1616diff --git a/modules/generators/mod_status.c b/modules/generators/mod_status.c
    17 index 0237f1d..c7fd0e0 100644
     17index 0237f1d..5a9ea7b 100644
    1818--- a/modules/generators/mod_status.c
    1919+++ b/modules/generators/mod_status.c
    20 @@ -103,6 +103,56 @@ APR_IMPLEMENT_OPTIONAL_HOOK_RUN_ALL(ap, STATUS, int, status_hook,
     20@@ -103,6 +103,27 @@ APR_IMPLEMENT_OPTIONAL_HOOK_RUN_ALL(ap, STATUS, int, status_hook,
    2121 static pid_t child_pid;
    2222 #endif
     
    2525+  int permit_status_handler;
    2626+} status_config_rec;
    27 +
    28 +/*
    29 + * command-related code. This is here to prevent use of ExtendedStatus
    30 + * without status_module included.
    31 + */
    32 +static const char *set_extended_status(cmd_parms *cmd, void *dummy, int arg)
    33 +{
    34 +    const char *err = ap_check_cmd_context(cmd, GLOBAL_ONLY);
    35 +    if (err != NULL) {
    36 +        return err;
    37 +    }
    38 +    ap_extended_status = arg;
    39 +    return NULL;
    40 +}
    41 +
    42 +static const char *set_reqtail(cmd_parms *cmd, void *dummy, int arg)
    43 +{
    44 +    const char *err = ap_check_cmd_context(cmd, GLOBAL_ONLY);
    45 +    if (err != NULL) {
    46 +        return err;
    47 +    }
    48 +    ap_mod_status_reqtail = arg;
    49 +    return NULL;
    50 +}
    5127+
    5228+static void *create_status_dir_config(apr_pool_t *p, char *d)
     
    5935+static const command_rec status_module_cmds[] =
    6036+{
    61 +    AP_INIT_FLAG("ExtendedStatus", set_extended_status, NULL, RSRC_CONF,
    62 +      "\"On\" to enable extended status information, \"Off\" to disable"),
    63 +    AP_INIT_FLAG("SeeRequestTail", set_reqtail, NULL, RSRC_CONF,
    64 +      "For verbose requests, \"On\" to see the last 63 chars of the request, "
    65 +      "\"Off\" (default) to see the first 63 in extended status display"),
    6637+    AP_INIT_FLAG("PermitStatusHandler", ap_set_flag_slot,
    6738+                (void *)APR_OFFSETOF(status_config_rec, permit_status_handler),
     
    7546 static void format_byte_out(request_rec *r, apr_off_t bytes)
    7647 {
    77 @@ -207,8 +257,12 @@ static int status_handler(request_rec *r)
     48@@ -207,8 +228,12 @@ static int status_handler(request_rec *r)
    7849     int times_per_thread;
    7950 #endif
     
    9061     }
    9162 
    92 @@ -974,7 +1028,7 @@ static void register_hooks(apr_pool_t *p)
     63@@ -974,11 +999,11 @@ static void register_hooks(apr_pool_t *p)
    9364 AP_DECLARE_MODULE(status) =
    9465 {
     
    9970     NULL,                       /* server config */
    10071     NULL,                       /* merge server config */
     72-    NULL,                       /* command table */
     73+    status_module_cmds,         /* command table */
     74     register_hooks              /* register_hooks */
     75 };
     76 
    10177--
    102781.7.9.6 (Apple Git-31.1)
Note: See TracChangeset for help on using the changeset viewer.