You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@httpd.apache.org by wr...@apache.org on 2010/09/22 01:49:31 UTC

svn commit: r999690 - in /httpd/sandbox/replacelimit: ./ include/ modules/aaa/ modules/cache/ modules/dav/main/ modules/generators/ modules/http/ modules/ldap/ modules/mappers/ modules/proxy/ server/

Author: wrowe
Date: Tue Sep 21 23:49:29 2010
New Revision: 999690

URL: http://svn.apache.org/viewvc?rev=999690&view=rev
Log:
Eliminate the hobbled <Limit[Except]> directive and associated API noise.

  Replace request_rec allowed with allowed_methods

  ap_init_method_list replaces ap_make_method_list

  OR_LIMIT/limited/limited_methods/xlimited/
  ap_method_is_limited are dropped from the API.
  allowed/allowed_xmethods/allowed_methods are all
  simplified into an ap_method_list_t

Modified:
    httpd/sandbox/replacelimit/ap.d
    httpd/sandbox/replacelimit/include/ap_mmn.h
    httpd/sandbox/replacelimit/include/http_config.h
    httpd/sandbox/replacelimit/include/http_core.h
    httpd/sandbox/replacelimit/include/http_protocol.h
    httpd/sandbox/replacelimit/include/httpd.h
    httpd/sandbox/replacelimit/modules/aaa/mod_access_compat.c
    httpd/sandbox/replacelimit/modules/aaa/mod_authz_core.c
    httpd/sandbox/replacelimit/modules/cache/mod_cache.c
    httpd/sandbox/replacelimit/modules/cache/mod_file_cache.c
    httpd/sandbox/replacelimit/modules/dav/main/mod_dav.c
    httpd/sandbox/replacelimit/modules/generators/mod_asis.c
    httpd/sandbox/replacelimit/modules/generators/mod_autoindex.c
    httpd/sandbox/replacelimit/modules/generators/mod_info.c
    httpd/sandbox/replacelimit/modules/generators/mod_status.c
    httpd/sandbox/replacelimit/modules/http/http_protocol.c
    httpd/sandbox/replacelimit/modules/http/http_request.c
    httpd/sandbox/replacelimit/modules/ldap/util_ldap.c
    httpd/sandbox/replacelimit/modules/mappers/mod_actions.c
    httpd/sandbox/replacelimit/modules/proxy/mod_proxy_balancer.c
    httpd/sandbox/replacelimit/server/config.c
    httpd/sandbox/replacelimit/server/core.c
    httpd/sandbox/replacelimit/server/protocol.c
    httpd/sandbox/replacelimit/server/request.c
    httpd/sandbox/replacelimit/server/util_script.c

Modified: httpd/sandbox/replacelimit/ap.d
URL: http://svn.apache.org/viewvc/httpd/sandbox/replacelimit/ap.d?rev=999690&r1=999689&r2=999690&view=diff
==============================================================================
--- httpd/sandbox/replacelimit/ap.d (original)
+++ httpd/sandbox/replacelimit/ap.d Tue Sep 21 23:49:29 2010
@@ -19,8 +19,6 @@ typedef struct request_rec {
     const char *method;
     int method_number;
     int64_t allowed;
-    uintptr_t allowed_xmethods;
-    uintptr_t allowed_methods;
     offset_t sent_bodyct;
     offset_t bytes_sent;
     int64_t mtime;

Modified: httpd/sandbox/replacelimit/include/ap_mmn.h
URL: http://svn.apache.org/viewvc/httpd/sandbox/replacelimit/include/ap_mmn.h?rev=999690&r1=999689&r2=999690&view=diff
==============================================================================
--- httpd/sandbox/replacelimit/include/ap_mmn.h (original)
+++ httpd/sandbox/replacelimit/include/ap_mmn.h Tue Sep 21 23:49:29 2010
@@ -261,6 +261,12 @@
  * 20100919.1 (2.3.9-dev)  Introduce ap_rxplus util/API
  * 20100921.0 (2.3.9-dev)  Add an apr_bucket_brigade to the create_entity
  *                         provider interface for mod_cache.h.
+ *                         Replace request_rec allowed with allowed_methods,
+ *                         ap_init_method_list replaces ap_make_method_list,
+ *                         OR_LIMIT/limited/limited_methods/xlimited/
+ *                         ap_method_is_limited are dropped from the API.
+ *                         allowed/allowed_xmethods/allowed_methods are all
+ *                         simplified into an ap_method_list_t
  */
 
 #define MODULE_MAGIC_COOKIE 0x41503234UL /* "AP24" */

Modified: httpd/sandbox/replacelimit/include/http_config.h
URL: http://svn.apache.org/viewvc/httpd/sandbox/replacelimit/include/http_config.h?rev=999690&r1=999689&r2=999690&view=diff
==============================================================================
--- httpd/sandbox/replacelimit/include/http_config.h (original)
+++ httpd/sandbox/replacelimit/include/http_config.h Tue Sep 21 23:49:29 2010
@@ -226,8 +226,9 @@ struct command_struct {
  * @{
  */
 #define OR_NONE 0             /**< *.conf is not available anywhere in this override */
-#define OR_LIMIT 1	     /**< *.conf inside &lt;Directory&gt; or &lt;Location&gt;
-				and .htaccess when AllowOverride Limit */
+#define OR_LIMIT 8	     /**< *.conf anywhere
+				and .htaccess when AllowOverride Limit
+                                @deprecated Same as @see OR_AUTHCFG */
 #define OR_OPTIONS 2         /**< *.conf anywhere
                                 and .htaccess when AllowOverride Options */
 #define OR_FILEINFO 4        /**< *.conf anywhere
@@ -243,7 +244,7 @@ struct command_struct {
                 which would modify the configuration (like including another
                 file, or IFModule */
 /** this directive can be placed anywhere */
-#define OR_ALL (OR_LIMIT|OR_OPTIONS|OR_FILEINFO|OR_AUTHCFG|OR_INDEXES)
+#define OR_ALL (OR_OPTIONS|OR_FILEINFO|OR_AUTHCFG|OR_INDEXES)
 
 /** @} */
 
@@ -278,12 +279,6 @@ struct cmd_parms_struct {
     int override;
     /** Which allow-override-opts bits are set */
     int override_opts;
-    /** Which methods are &lt;Limit&gt;ed */
-    apr_int64_t limited;
-    /** methods which are limited */
-    apr_array_header_t *limited_xmethods;
-    /** methods which are xlimited */
-    ap_method_list_t *xlimited;
 
     /** Config file structure. */
     ap_configfile_t *config_file;
@@ -302,7 +297,10 @@ struct cmd_parms_struct {
      * &lt;Location&gt; and regex matching.  Now the only usefulness that can be 
      * derived from this field is whether a command is being called in a 
      * server context (path == NULL) or being called in a dir context 
-     * (path != NULL).  */
+     * (path != NULL).
+     * TODO: indiciate what arbitrary flavor of scope we are in?
+     * E.g. "Files" "Directory" etc etc?
+     */
     char *path;
     /** configuration command */
     const command_rec *cmd;
@@ -617,18 +615,6 @@ AP_DECLARE_NONSTD(const char *) ap_set_i
 AP_DECLARE(const char *) ap_parse_log_level(const char *str, int *val);
 
 /**
- * Return true if the specified method is limited by being listed in
- * a &lt;Limit&gt; container, or by *not* being listed in a &lt;LimitExcept&gt;
- * container.
- *
- * @param   method  Pointer to a string specifying the method to check.
- * @param   cmd     Pointer to the cmd_parms structure passed to the
- *                  directive handler.
- * @return  0 if the method is not limited in the current scope
- */
-AP_DECLARE(int) ap_method_is_limited(cmd_parms *cmd, const char *method);
-
-/**
  * Generic command handling function for strings, always sets the value
  * to a lowercase string
  * @param cmd The command parameters for this directive
@@ -847,14 +833,12 @@ AP_DECLARE(const char *) ap_check_cmd_co
                                               unsigned forbidden);
 
 #define  NOT_IN_VIRTUALHOST     0x01 /**< Forbidden in &lt;VirtualHost&gt; */
-#define  NOT_IN_LIMIT           0x02 /**< Forbidden in &lt;Limit&gt; */
 #define  NOT_IN_DIRECTORY       0x04 /**< Forbidden in &lt;Directory&gt; */
 #define  NOT_IN_LOCATION        0x08 /**< Forbidden in &lt;Location&gt; */
 #define  NOT_IN_FILES           0x10 /**< Forbidden in &lt;Files&gt; */
-/** Forbidden in &lt;Directory&gt;/&lt;Location&gt;/&lt;Files&gt;*/
-#define  NOT_IN_DIR_LOC_FILE    (NOT_IN_DIRECTORY|NOT_IN_LOCATION|NOT_IN_FILES) 
-/** Forbidden in &lt;VirtualHost&gt;/&lt;Limit&gt;/&lt;Directory&gt;/&lt;Location&gt;/&lt;Files&gt; */
-#define  GLOBAL_ONLY            (NOT_IN_VIRTUALHOST|NOT_IN_LIMIT|NOT_IN_DIR_LOC_FILE) 
+#define  NOT_IN_DIR_LOC_FILE    0xFE /**< @see VIRTUALHOST_ONLY */
+#define  VIRTUALHOST_ONLY       0xFE /**< Allowed only in &lt;VirtualHost&gt; */
+#define  GLOBAL_ONLY            0xFF /**< Forbidden in any container */
 
 /** @} */
 

Modified: httpd/sandbox/replacelimit/include/http_core.h
URL: http://svn.apache.org/viewvc/httpd/sandbox/replacelimit/include/http_core.h?rev=999690&r1=999689&r2=999690&view=diff
==============================================================================
--- httpd/sandbox/replacelimit/include/http_core.h (original)
+++ httpd/sandbox/replacelimit/include/http_core.h Tue Sep 21 23:49:29 2010
@@ -265,26 +265,6 @@ AP_DECLARE(int) ap_exists_config_define(
 /* FIXME! See STATUS about how */
 AP_DECLARE_NONSTD(int) ap_core_translate(request_rec *r);
 
-/* Authentication stuff.  This is one of the places where compatibility
- * with the old config files *really* hurts; they don't discriminate at
- * all between different authentication schemes, meaning that we need
- * to maintain common state for all of them in the core, and make it
- * available to the other modules through interfaces.
- */
-
-/** @see require_line */
-typedef struct require_line require_line;
-
-/** 
- * @brief A structure to keep track of authorization requirements 
-*/
-struct require_line {
-    /** Where the require line is in the config file. */
-    apr_int64_t method_mask;
-    /** The complete string from the command line */
-    char *requirement;
-};
-     
 /**
  * Return the type of authorization required for this request
  * @param r The current request
@@ -596,8 +576,8 @@ void ap_core_reorder_directories(apr_poo
 /* for mod_perl */
 AP_CORE_DECLARE(void) ap_add_per_dir_conf(server_rec *s, void *dir_config);
 AP_CORE_DECLARE(void) ap_add_per_url_conf(server_rec *s, void *url_config);
-AP_CORE_DECLARE(void) ap_add_file_conf(core_dir_config *conf, void *url_config);
-AP_CORE_DECLARE_NONSTD(const char *) ap_limit_section(cmd_parms *cmd, void *dummy, const char *arg);
+AP_CORE_DECLARE(void) ap_add_file_conf(core_dir_config *conf,
+                                       void *file_config);
 
 /* Core filters; not exported. */
 int ap_core_input_filter(ap_filter_t *f, apr_bucket_brigade *b,

Modified: httpd/sandbox/replacelimit/include/http_protocol.h
URL: http://svn.apache.org/viewvc/httpd/sandbox/replacelimit/include/http_protocol.h?rev=999690&r1=999689&r2=999690&view=diff
==============================================================================
--- httpd/sandbox/replacelimit/include/http_protocol.h (original)
+++ httpd/sandbox/replacelimit/include/http_protocol.h Tue Sep 21 23:49:29 2010
@@ -240,15 +240,16 @@ AP_DECLARE(void) ap_method_registry_init
     ((mask) & (AP_METHOD_BIT << ap_method_number_of((methname))))
 
 /**
- * Create a new method list with the specified number of preallocated
- * slots for extension methods.
+ * Initialize a preallocated method list and allocate the specified number
+ * of slots for unknown extension methods.
  *
+ * @param   l       Pointer to a previously allocated method list structure.
  * @param   p       Pointer to a pool in which the structure should be
  *                  allocated.
- * @param   nelts   Number of preallocated extension slots
- * @return  Pointer to the newly created structure.
+ * @param   nelts   Number of slots to allocate (beyond 'core' methods)
  */
-AP_DECLARE(ap_method_list_t *) ap_make_method_list(apr_pool_t *p, int nelts);
+AP_DECLARE(void) ap_init_method_list(ap_method_list_t *l,
+                                     apr_pool_t *p, int nelts);
 
 
 /**
@@ -258,7 +259,7 @@ AP_DECLARE(ap_method_list_t *) ap_make_m
  * @param   src  List to copy from
  */
 AP_DECLARE(void) ap_copy_method_list(ap_method_list_t *dest,
-				     ap_method_list_t *src);
+                                     const ap_method_list_t *src);
 
 /**
  * Search for an HTTP method name in an ap_method_list_t structure, and
@@ -288,7 +289,7 @@ AP_DECLARE(void) ap_method_list_add(ap_m
  * @return  None.
  */
 AP_DECLARE(void) ap_method_list_remove(ap_method_list_t *l,
-				       const char *method);
+                       const char *method);
 
 /**
  * Reset a method list to be completely empty.
@@ -361,7 +362,7 @@ AP_DECLARE(int) ap_vrprintf(request_rec 
  * @return The number of bytes sent
  */
 AP_DECLARE_NONSTD(int) ap_rprintf(request_rec *r, const char *fmt,...)
-				__attribute__((format(printf,2,3)));
+                           __attribute__((format(printf,2,3)));
 
 /**
  * Flush all of the data for the current request to the client
@@ -676,5 +677,5 @@ AP_DECLARE(void) ap_send_interim_respons
 }
 #endif
 
-#endif	/* !APACHE_HTTP_PROTOCOL_H */
+#endif /* !APACHE_HTTP_PROTOCOL_H */
 /** @} */

Modified: httpd/sandbox/replacelimit/include/httpd.h
URL: http://svn.apache.org/viewvc/httpd/sandbox/replacelimit/include/httpd.h?rev=999690&r1=999689&r2=999690&view=diff
==============================================================================
--- httpd/sandbox/replacelimit/include/httpd.h (original)
+++ httpd/sandbox/replacelimit/include/httpd.h Tue Sep 21 23:49:29 2010
@@ -810,7 +810,7 @@ struct request_rec {
     const char *method;
 
     /**
-     *  'allowed' is a bitvector of the allowed methods.
+     *  'allowed.method_mask' is a bitvector of the allowed methods.
      *
      *  A handler must ensure that the request method is one that
      *  it is capable of handling.  Generally modules should DECLINE
@@ -829,11 +829,8 @@ struct request_rec {
      *  HTTP_METHOD_NOT_ALLOWED.  Unfortunately this means that a Script GET
      *  handler can't be installed by mod_actions.
      */
-    apr_int64_t allowed;
-    /** Array of extension methods */
-    apr_array_header_t *allowed_xmethods; 
     /** List of allowed methods */
-    ap_method_list_t *allowed_methods; 
+    ap_method_list_t allowed_methods; 
 
     /** byte count in stream is for body */
     apr_off_t sent_bodyct;

Modified: httpd/sandbox/replacelimit/modules/aaa/mod_access_compat.c
URL: http://svn.apache.org/viewvc/httpd/sandbox/replacelimit/modules/aaa/mod_access_compat.c?rev=999690&r1=999689&r2=999690&view=diff
==============================================================================
--- httpd/sandbox/replacelimit/modules/aaa/mod_access_compat.c (original)
+++ httpd/sandbox/replacelimit/modules/aaa/mod_access_compat.c Tue Sep 21 23:49:29 2010
@@ -53,7 +53,6 @@ enum allowdeny_type {
 };
 
 typedef struct {
-    apr_int64_t limited;
     union {
         char *from;
         apr_ipsubnet_t *ip;
@@ -67,29 +66,23 @@ typedef struct {
 #define MUTUAL_FAILURE 2
 
 typedef struct {
-    int order[METHODS];
+    int order;
     apr_array_header_t *allows;
     apr_array_header_t *denys;
-    int *satisfy; /* for every method one */
+    int satisfy;
 } access_compat_dir_conf;
 
 module AP_MODULE_DECLARE_DATA access_compat_module;
 
 static void *create_access_compat_dir_config(apr_pool_t *p, char *dummy)
 {
-    int i;
     access_compat_dir_conf *conf =
         (access_compat_dir_conf *)apr_pcalloc(p, sizeof(access_compat_dir_conf));
 
-    for (i = 0; i < METHODS; ++i) {
-        conf->order[i] = DENY_THEN_ALLOW;
-    }
+    conf->order = DENY_THEN_ALLOW;
     conf->allows = apr_array_make(p, 1, sizeof(allowdeny));
     conf->denys = apr_array_make(p, 1, sizeof(allowdeny));
-    conf->satisfy = apr_palloc(p, sizeof(*conf->satisfy) * METHODS);
-    for (i = 0; i < METHODS; ++i) {
-        conf->satisfy[i] = SATISFY_NOSPEC;
-    }
+    conf->satisfy = SATISFY_NOSPEC;
 
     return (void *)conf;
 }
@@ -97,21 +90,16 @@ static void *create_access_compat_dir_co
 static const char *order(cmd_parms *cmd, void *dv, const char *arg)
 {
     access_compat_dir_conf *d = (access_compat_dir_conf *) dv;
-    int i, o;
 
     if (!strcasecmp(arg, "allow,deny"))
-        o = ALLOW_THEN_DENY;
+        d->order = ALLOW_THEN_DENY;
     else if (!strcasecmp(arg, "deny,allow"))
-        o = DENY_THEN_ALLOW;
+        d->order = DENY_THEN_ALLOW;
     else if (!strcasecmp(arg, "mutual-failure"))
-        o = MUTUAL_FAILURE;
+        d->order = MUTUAL_FAILURE;
     else
         return "unknown order";
 
-    for (i = 0; i < METHODS; ++i)
-        if (cmd->limited & (AP_METHOD_BIT << i))
-            d->order[i] = o;
-
     return NULL;
 }
 
@@ -119,24 +107,17 @@ static const char *satisfy(cmd_parms *cm
 {
     access_compat_dir_conf *d = (access_compat_dir_conf *) dv;
     int satisfy = SATISFY_NOSPEC;
-    int i;
 
     if (!strcasecmp(arg, "all")) {
-        satisfy = SATISFY_ALL;
+        d->satisfy = SATISFY_ALL;
     }
     else if (!strcasecmp(arg, "any")) {
-        satisfy = SATISFY_ANY;
+        d->satisfy = SATISFY_ANY;
     }
     else {
         return "Satisfy either 'any' or 'all'.";
     }
 
-    for (i = 0; i < METHODS; ++i) {
-        if (cmd->limited & (AP_METHOD_BIT << i)) {
-            d->satisfy[i] = satisfy;
-        }
-    }
-
     return NULL;
 }
 
@@ -155,7 +136,6 @@ static const char *allow_cmd(cmd_parms *
 
     a = (allowdeny *) apr_array_push(cmd->info ? d->allows : d->denys);
     a->x.from = where;
-    a->limited = cmd->limited;
 
     if (!strncasecmp(where, "env=!", 5)) {
         a->type = T_NENV;
@@ -202,11 +182,11 @@ static char its_an_allow;
 
 static const command_rec access_compat_cmds[] =
 {
-    AP_INIT_TAKE1("order", order, NULL, OR_LIMIT,
+    AP_INIT_TAKE1("order", order, NULL, OR_AUTHCFG,
                   "'allow,deny', 'deny,allow', or 'mutual-failure'"),
-    AP_INIT_ITERATE2("allow", allow_cmd, &its_an_allow, OR_LIMIT,
+    AP_INIT_ITERATE2("allow", allow_cmd, &its_an_allow, OR_AUTHCFG,
                      "'from' followed by hostnames or IP-address wildcards"),
-    AP_INIT_ITERATE2("deny", allow_cmd, NULL, OR_LIMIT,
+    AP_INIT_ITERATE2("deny", allow_cmd, NULL, OR_AUTHCFG,
                      "'from' followed by hostnames or IP-address wildcards"),
     AP_INIT_TAKE1("Satisfy", satisfy, NULL, OR_AUTHCFG,
                   "access policy if both allow and require used ('all' or 'any')"),
@@ -240,19 +220,15 @@ static int in_domain(const char *domain,
     }
 }
 
-static int find_allowdeny(request_rec *r, apr_array_header_t *a, int method)
+static int find_allowdeny(request_rec *r, apr_array_header_t *a)
 {
 
     allowdeny *ap = (allowdeny *) a->elts;
-    apr_int64_t mmask = (AP_METHOD_BIT << method);
     int i;
     int gothost = 0;
     const char *remotehost = NULL;
 
     for (i = 0; i < a->nelts; ++i) {
-        if (!(mmask & ap[i].limited)) {
-            continue;
-        }
 
         switch (ap[i].type) {
         case T_ENV:
@@ -312,36 +288,35 @@ static int access_compat_ap_satisfies(re
     access_compat_dir_conf *conf = (access_compat_dir_conf *)
         ap_get_module_config(r->per_dir_config, &access_compat_module);
 
-    return conf->satisfy[r->method_number];
+    return conf->satisfy;
 }
 
 static int check_dir_access(request_rec *r)
 {
-    int method = r->method_number;
     int ret = OK;
     access_compat_dir_conf *a = (access_compat_dir_conf *)
         ap_get_module_config(r->per_dir_config, &access_compat_module);
 
-    if (a->order[method] == ALLOW_THEN_DENY) {
+    if (a->order == ALLOW_THEN_DENY) {
         ret = HTTP_FORBIDDEN;
-        if (find_allowdeny(r, a->allows, method)) {
+        if (find_allowdeny(r, a->allows)) {
             ret = OK;
         }
-        if (find_allowdeny(r, a->denys, method)) {
+        if (find_allowdeny(r, a->denys)) {
             ret = HTTP_FORBIDDEN;
         }
     }
-    else if (a->order[method] == DENY_THEN_ALLOW) {
-        if (find_allowdeny(r, a->denys, method)) {
+    else if (a->order == DENY_THEN_ALLOW) {
+        if (find_allowdeny(r, a->denys)) {
             ret = HTTP_FORBIDDEN;
         }
-        if (find_allowdeny(r, a->allows, method)) {
+        if (find_allowdeny(r, a->allows)) {
             ret = OK;
         }
     }
     else {
-        if (find_allowdeny(r, a->allows, method)
-            && !find_allowdeny(r, a->denys, method)) {
+        if (find_allowdeny(r, a->allows)
+            && !find_allowdeny(r, a->denys)) {
             ret = OK;
         }
         else {

Modified: httpd/sandbox/replacelimit/modules/aaa/mod_authz_core.c
URL: http://svn.apache.org/viewvc/httpd/sandbox/replacelimit/modules/aaa/mod_authz_core.c?rev=999690&r1=999689&r2=999690&view=diff
==============================================================================
--- httpd/sandbox/replacelimit/modules/aaa/mod_authz_core.c (original)
+++ httpd/sandbox/replacelimit/modules/aaa/mod_authz_core.c Tue Sep 21 23:49:29 2010
@@ -68,7 +68,6 @@ struct authz_section_conf {
     const char *provider_args;
     const void *provider_parsed_args;
     const authz_provider *provider;
-    apr_int64_t limited;
     authz_logic_op op;
     int negate;
     authz_section_conf *first;
@@ -120,9 +119,6 @@ static void *merge_authz_core_dir_config
             if (new->section) {
                 section = apr_pcalloc(p, sizeof(*section));
 
-                section->limited =
-                    base->section->limited | new->section->limited;
-
                 section->op = new->op;
 
                 section->first = apr_pmemdup(p, base->section,
@@ -373,8 +369,6 @@ static const char *add_authz_provider(cm
                             section->provider_name);
     }
 
-    section->limited = cmd->limited;
-
     if (section->provider->parse_require_line) {
         const char *err = section->provider->parse_require_line(cmd, args,
                                                                 &section->provider_parsed_args);
@@ -393,8 +387,6 @@ static const char *add_authz_provider(cm
                             format_authz_command(cmd->pool, conf->section));
     }
 
-    conf->section->limited |= section->limited;
-
     child = conf->section->first;
 
     if (child) {
@@ -419,7 +411,6 @@ static const char *add_authz_section(cmd
     authz_section_conf *old_section = conf->section;
     authz_section_conf *section;
     int old_overrides = cmd->override;
-    apr_int64_t old_limited = cmd->limited;
     const char *errmsg;
 
     if (endp == NULL) {
@@ -454,15 +445,10 @@ static const char *add_authz_section(cmd
 
     conf->section = section;
 
-    /* trigger NOT_IN_LIMIT errors as if this were a <Limit> directive */
-    cmd->limited &= ~(AP_METHOD_BIT << (METHODS - 1));
-
     cmd->override = OR_AUTHCFG;
     errmsg = ap_walk_config(cmd->directive->first_child, cmd, cmd->context);
     cmd->override = old_overrides;
 
-    cmd->limited = old_limited;
-
     conf->section = old_section;
 
     if (errmsg) {
@@ -483,8 +469,6 @@ static const char *add_authz_section(cmd
                                 format_authz_command(cmd->pool, old_section));
         }
 
-        old_section->limited |= section->limited;
-
         if (!section->negate && section->op == old_section->op) {
             /* be associative */
             section = section->first;
@@ -663,20 +647,6 @@ static authz_status apply_authz_sections
 {
     authz_status auth_result;
 
-    /* check to make sure that the request method requires authorization */
-    if (!(section->limited & (AP_METHOD_BIT << r->method_number))) {
-        auth_result =
-            (parent_op == AUTHZ_LOGIC_AND) ? AUTHZ_GRANTED : AUTHZ_NEUTRAL;
-
-        ap_log_rerror(APLOG_MARK, APLOG_DEBUG, APR_SUCCESS, r,
-                      "authorization result of %s: %s "
-                      "(directive limited to other methods)",
-                      format_authz_command(r->pool, section),
-                      format_authz_result(auth_result));
-
-        return auth_result;
-    }
-
     if (section->provider) {
         apr_table_setn(r->notes, AUTHZ_PROVIDER_NAME_NOTE,
                        section->provider_name);
@@ -855,8 +825,7 @@ static int authz_some_auth_required(requ
 
     conf = ap_get_module_config(r->per_dir_config, &authz_core_module);
 
-    if (conf->section
-        && (conf->section->limited & (AP_METHOD_BIT << r->method_number))) {
+    if (conf->section) {
         return 1;
     }
 

Modified: httpd/sandbox/replacelimit/modules/cache/mod_cache.c
URL: http://svn.apache.org/viewvc/httpd/sandbox/replacelimit/modules/cache/mod_cache.c?rev=999690&r1=999689&r2=999690&view=diff
==============================================================================
--- httpd/sandbox/replacelimit/modules/cache/mod_cache.c (original)
+++ httpd/sandbox/replacelimit/modules/cache/mod_cache.c Tue Sep 21 23:49:29 2010
@@ -1566,7 +1566,7 @@ static const char *add_cache_enable(cmd_
     struct cache_enable *new;
 
     const char *err = ap_check_cmd_context(parms,
-                                           NOT_IN_DIRECTORY|NOT_IN_LIMIT|NOT_IN_FILES);
+                                           NOT_IN_DIRECTORY|NOT_IN_FILES);
     if (err != NULL) {
         return err;
     }
@@ -1613,7 +1613,7 @@ static const char *add_cache_disable(cmd
     struct cache_disable *new;
 
     const char *err = ap_check_cmd_context(parms,
-                                           NOT_IN_DIRECTORY|NOT_IN_LIMIT|NOT_IN_FILES);
+                                           NOT_IN_DIRECTORY|NOT_IN_FILES);
     if (err != NULL) {
         return err;
     }

Modified: httpd/sandbox/replacelimit/modules/cache/mod_file_cache.c
URL: http://svn.apache.org/viewvc/httpd/sandbox/replacelimit/modules/cache/mod_file_cache.c?rev=999690&r1=999689&r2=999690&view=diff
==============================================================================
--- httpd/sandbox/replacelimit/modules/cache/mod_file_cache.c (original)
+++ httpd/sandbox/replacelimit/modules/cache/mod_file_cache.c Tue Sep 21 23:49:29 2010
@@ -330,7 +330,7 @@ static int file_cache_handler(request_re
     }
 
     /* note that we would handle GET on this resource */
-    r->allowed |= (AP_METHOD_BIT << M_GET);
+    r->allowed_methods.method_mask |= (AP_METHOD_BIT << M_GET);
 
     /* This handler has no use for a request body (yet), but we still
      * need to read and discard it if the client sent one.

Modified: httpd/sandbox/replacelimit/modules/dav/main/mod_dav.c
URL: http://svn.apache.org/viewvc/httpd/sandbox/replacelimit/modules/dav/main/mod_dav.c?rev=999690&r1=999689&r2=999690&view=diff
==============================================================================
--- httpd/sandbox/replacelimit/modules/dav/main/mod_dav.c (original)
+++ httpd/sandbox/replacelimit/modules/dav/main/mod_dav.c Tue Sep 21 23:49:29 2010
@@ -4625,12 +4625,12 @@ static int dav_handler(request_rec *r)
      *
      * First, set the mask to the methods we handle directly.  Since by
      * definition we own our managed space, we unconditionally set
-     * the r->allowed field rather than ORing our values with anything
+     * the method_mask field rather than ORing our values with anything
      * any other module may have put in there.
      *
      * These are the HTTP-defined methods that we handle directly.
      */
-    r->allowed = 0
+    r->allowed_methods.method_mask = 0
         | (AP_METHOD_BIT << M_GET)
         | (AP_METHOD_BIT << M_PUT)
         | (AP_METHOD_BIT << M_DELETE)
@@ -4640,7 +4640,7 @@ static int dav_handler(request_rec *r)
     /*
      * These are the DAV methods we handle.
      */
-    r->allowed |= 0
+    r->allowed_methods.method_mask |= 0
         | (AP_METHOD_BIT << M_COPY)
         | (AP_METHOD_BIT << M_LOCK)
         | (AP_METHOD_BIT << M_UNLOCK)
@@ -4653,7 +4653,7 @@ static int dav_handler(request_rec *r)
      * These are methods that we don't handle directly, but let the
      * server's default handler do for us as our agent.
      */
-    r->allowed |= 0
+    r->allowed_methods.method_mask |= 0
         | (AP_METHOD_BIT << M_POST);
 
     /* ### hrm. if we return HTTP_METHOD_NOT_ALLOWED, then an Allow header

Modified: httpd/sandbox/replacelimit/modules/generators/mod_asis.c
URL: http://svn.apache.org/viewvc/httpd/sandbox/replacelimit/modules/generators/mod_asis.c?rev=999690&r1=999689&r2=999690&view=diff
==============================================================================
--- httpd/sandbox/replacelimit/modules/generators/mod_asis.c (original)
+++ httpd/sandbox/replacelimit/modules/generators/mod_asis.c Tue Sep 21 23:49:29 2010
@@ -38,7 +38,7 @@ static int asis_handler(request_rec *r)
     if(strcmp(r->handler,ASIS_MAGIC_TYPE) && strcmp(r->handler,"send-as-is"))
         return DECLINED;
 
-    r->allowed |= (AP_METHOD_BIT << M_GET);
+    r->allowed_methods.method_mask |= (AP_METHOD_BIT << M_GET);
     if (r->method_number != M_GET)
         return DECLINED;
     if (r->finfo.filetype == APR_NOFILE) {

Modified: httpd/sandbox/replacelimit/modules/generators/mod_autoindex.c
URL: http://svn.apache.org/viewvc/httpd/sandbox/replacelimit/modules/generators/mod_autoindex.c?rev=999690&r1=999689&r2=999690&view=diff
==============================================================================
--- httpd/sandbox/replacelimit/modules/generators/mod_autoindex.c (original)
+++ httpd/sandbox/replacelimit/modules/generators/mod_autoindex.c Tue Sep 21 23:49:29 2010
@@ -2281,7 +2281,7 @@ static int handle_autoindex(request_rec 
     d = (autoindex_config_rec *) ap_get_module_config(r->per_dir_config,
                                                       &autoindex_module);
 
-    r->allowed |= (AP_METHOD_BIT << M_GET);
+    r->allowed_methods.method_mask  |= (AP_METHOD_BIT << M_GET);
     if (r->method_number != M_GET) {
         return DECLINED;
     }

Modified: httpd/sandbox/replacelimit/modules/generators/mod_info.c
URL: http://svn.apache.org/viewvc/httpd/sandbox/replacelimit/modules/generators/mod_info.c?rev=999690&r1=999689&r2=999690&view=diff
==============================================================================
--- httpd/sandbox/replacelimit/modules/generators/mod_info.c (original)
+++ httpd/sandbox/replacelimit/modules/generators/mod_info.c Tue Sep 21 23:49:29 2010
@@ -604,7 +604,7 @@ static int display_info(request_rec * r)
     if (strcmp(r->handler, "server-info"))
         return DECLINED;
 
-    r->allowed |= (AP_METHOD_BIT << M_GET);
+    r->allowed_methods.method_mask |= (AP_METHOD_BIT << M_GET);
     if (r->method_number != M_GET)
         return DECLINED;
 

Modified: httpd/sandbox/replacelimit/modules/generators/mod_status.c
URL: http://svn.apache.org/viewvc/httpd/sandbox/replacelimit/modules/generators/mod_status.c?rev=999690&r1=999689&r2=999690&view=diff
==============================================================================
--- httpd/sandbox/replacelimit/modules/generators/mod_status.c (original)
+++ httpd/sandbox/replacelimit/modules/generators/mod_status.c Tue Sep 21 23:49:29 2010
@@ -235,7 +235,7 @@ static int status_handler(request_rec *r
         return HTTP_INTERNAL_SERVER_ERROR;
     }
 
-    r->allowed = (AP_METHOD_BIT << M_GET);
+    r->allowed_methods.method_mask = (AP_METHOD_BIT << M_GET);
     if (r->method_number != M_GET)
         return DECLINED;
 

Modified: httpd/sandbox/replacelimit/modules/http/http_protocol.c
URL: http://svn.apache.org/viewvc/httpd/sandbox/replacelimit/modules/http/http_protocol.c?rev=999690&r1=999689&r2=999690&view=diff
==============================================================================
--- httpd/sandbox/replacelimit/modules/http/http_protocol.c (original)
+++ httpd/sandbox/replacelimit/modules/http/http_protocol.c Tue Sep 21 23:49:29 2010
@@ -783,7 +783,7 @@ static char *make_allow(request_rec *r)
     core_server_config *conf =
         ap_get_module_config(r->server->module_config, &core_module);
 
-    mask = r->allowed_methods->method_mask;
+    mask = r->allowed_methods.method_mask;
 
     for (; hi; hi = apr_hash_next(hi)) {
         const void *key;
@@ -808,15 +808,15 @@ static char *make_allow(request_rec *r)
     /* ### this is rather annoying. we should enforce registration of
        ### these methods */
     if ((mask & (AP_METHOD_BIT << M_INVALID))
-        && (r->allowed_methods->method_list != NULL)
-        && (r->allowed_methods->method_list->nelts != 0)) {
+        && (r->allowed_methods.method_list != NULL)
+        && (r->allowed_methods.method_list->nelts != 0)) {
         int i;
-        char **xmethod = (char **) r->allowed_methods->method_list->elts;
+        char **xmethod = (char **) r->allowed_methods.method_list->elts;
 
         /*
-         * Append all of the elements of r->allowed_methods->method_list
+         * Append all of the elements of r->allowed_methods.method_list
          */
-        for (i = 0; i < r->allowed_methods->method_list->nelts; ++i) {
+        for (i = 0; i < r->allowed_methods.method_list->nelts; ++i) {
             list = apr_pstrcat(r->pool, list, ",", xmethod[i], NULL);
         }
     }
@@ -1293,14 +1293,11 @@ AP_DECLARE(void) ap_send_error_response(
  * Create a new method list with the specified number of preallocated
  * extension slots.
  */
-AP_DECLARE(ap_method_list_t *) ap_make_method_list(apr_pool_t *p, int nelts)
+AP_DECLARE(void) ap_init_method_list(ap_method_list_t *l,
+                                     apr_pool_t *p, int nelts)
 {
-    ap_method_list_t *ml;
-
-    ml = (ap_method_list_t *) apr_palloc(p, sizeof(ap_method_list_t));
-    ml->method_mask = 0;
-    ml->method_list = apr_array_make(p, nelts, sizeof(char *));
-    return ml;
+    l->method_mask = 0;
+    l->method_list = apr_array_make(p, nelts, sizeof(char *));
 }
 
 /*
@@ -1308,7 +1305,7 @@ AP_DECLARE(ap_method_list_t *) ap_make_m
  * subsequently change it; don't want them changing the parent's, too!).
  */
 AP_DECLARE(void) ap_copy_method_list(ap_method_list_t *dest,
-                                     ap_method_list_t *src)
+                                     const ap_method_list_t *src)
 {
     int i;
     char **imethods;

Modified: httpd/sandbox/replacelimit/modules/http/http_request.c
URL: http://svn.apache.org/viewvc/httpd/sandbox/replacelimit/modules/http/http_request.c?rev=999690&r1=999689&r2=999690&view=diff
==============================================================================
--- httpd/sandbox/replacelimit/modules/http/http_request.c (original)
+++ httpd/sandbox/replacelimit/modules/http/http_request.c Tue Sep 21 23:49:29 2010
@@ -425,7 +425,7 @@ static request_rec *internal_internal_re
 
     new->method          = r->method;
     new->method_number   = r->method_number;
-    new->allowed_methods = ap_make_method_list(new->pool, 2);
+    ap_init_method_list(&new->allowed_methods, new->pool, 2);
     ap_parse_uri(new, new_uri);
     new->parsed_uri.port_str = r->parsed_uri.port_str;
     new->parsed_uri.port = r->parsed_uri.port;
@@ -446,8 +446,6 @@ static request_rec *internal_internal_re
 
     new->the_request = r->the_request;
 
-    new->allowed         = r->allowed;
-
     new->status          = r->status;
     new->assbackwards    = r->assbackwards;
     new->header_only     = r->header_only;
@@ -672,12 +670,12 @@ AP_DECLARE(void) ap_allow_methods(reques
      * well-known methods but any extensions as well.
      */
     if (reset) {
-        ap_clear_method_list(r->allowed_methods);
+        ap_clear_method_list(&r->allowed_methods);
     }
 
     va_start(methods, reset);
     while ((method = va_arg(methods, const char *)) != NULL) {
-        ap_method_list_add(r->allowed_methods, method);
+        ap_method_list_add(&r->allowed_methods, method);
     }
     va_end(methods);
 }
@@ -693,7 +691,7 @@ AP_DECLARE(void) ap_allow_standard_metho
      * well-known methods but any extensions as well.
      */
     if (reset) {
-        ap_clear_method_list(r->allowed_methods);
+        ap_clear_method_list(&r->allowed_methods);
     }
 
     mask = 0;
@@ -703,5 +701,5 @@ AP_DECLARE(void) ap_allow_standard_metho
     }
     va_end(methods);
 
-    r->allowed_methods->method_mask |= mask;
+    r->allowed_methods.method_mask |= mask;
 }

Modified: httpd/sandbox/replacelimit/modules/ldap/util_ldap.c
URL: http://svn.apache.org/viewvc/httpd/sandbox/replacelimit/modules/ldap/util_ldap.c?rev=999690&r1=999689&r2=999690&view=diff
==============================================================================
--- httpd/sandbox/replacelimit/modules/ldap/util_ldap.c (original)
+++ httpd/sandbox/replacelimit/modules/ldap/util_ldap.c Tue Sep 21 23:49:29 2010
@@ -108,7 +108,7 @@ static int util_ldap_handler(request_rec
                             ap_get_module_config(r->server->module_config,
                                                  &ldap_module);
 
-    r->allowed |= (1 << M_GET);
+    r->allowed_methods.method_mask |= (1 << M_GET);
     if (r->method_number != M_GET)
         return DECLINED;
 

Modified: httpd/sandbox/replacelimit/modules/mappers/mod_actions.c
URL: http://svn.apache.org/viewvc/httpd/sandbox/replacelimit/modules/mappers/mod_actions.c?rev=999690&r1=999689&r2=999690&view=diff
==============================================================================
--- httpd/sandbox/replacelimit/modules/mappers/mod_actions.c (original)
+++ httpd/sandbox/replacelimit/modules/mappers/mod_actions.c Tue Sep 21 23:49:29 2010
@@ -154,10 +154,12 @@ static int action_handler(request_rec *r
 
     /* Note that this handler handles _all_ types, so handler is unchecked */
 
-    /* Set allowed stuff */
+    /* Set allowed stuff
+     * XXX: Bollocks
+     */
     for (i = 0; i < METHODS; ++i) {
         if (conf->scripted[i])
-            r->allowed |= (AP_METHOD_BIT << i);
+            r->allowed_methods.method_mask |= (AP_METHOD_BIT << i);
     }
 
     /* First, check for the method-handling scripts */

Modified: httpd/sandbox/replacelimit/modules/proxy/mod_proxy_balancer.c
URL: http://svn.apache.org/viewvc/httpd/sandbox/replacelimit/modules/proxy/mod_proxy_balancer.c?rev=999690&r1=999689&r2=999690&view=diff
==============================================================================
--- httpd/sandbox/replacelimit/modules/proxy/mod_proxy_balancer.c (original)
+++ httpd/sandbox/replacelimit/modules/proxy/mod_proxy_balancer.c Tue Sep 21 23:49:29 2010
@@ -713,7 +713,7 @@ static int balancer_handler(request_rec 
     /* is this for us? */
     if (strcmp(r->handler, "balancer-manager"))
         return DECLINED;
-    r->allowed = (AP_METHOD_BIT << M_GET);
+    r->allowed_methods.method_mask = (AP_METHOD_BIT << M_GET);
     if (r->method_number != M_GET)
         return DECLINED;
 

Modified: httpd/sandbox/replacelimit/server/config.c
URL: http://svn.apache.org/viewvc/httpd/sandbox/replacelimit/server/config.c?rev=999690&r1=999689&r2=999690&view=diff
==============================================================================
--- httpd/sandbox/replacelimit/server/config.c (original)
+++ httpd/sandbox/replacelimit/server/config.c Tue Sep 21 23:49:29 2010
@@ -432,23 +432,6 @@ AP_CORE_DECLARE(int) ap_invoke_handler(r
     return result == DECLINED ? HTTP_INTERNAL_SERVER_ERROR : result;
 }
 
-AP_DECLARE(int) ap_method_is_limited(cmd_parms *cmd, const char *method)
-{
-    int methnum;
-
-    methnum = ap_method_number_of(method);
-
-    /*
-     * A method number either hardcoded into apache or
-     * added by a module and registered.
-     */
-    if (methnum != M_INVALID) {
-        return (cmd->limited & (AP_METHOD_BIT << methnum)) ? 1 : 0;
-    }
-
-    return 0; /* not found */
-}
-
 AP_DECLARE(void) ap_register_hooks(module *m, apr_pool_t *p)
 {
     if (m->register_hooks) {
@@ -1442,7 +1425,7 @@ AP_DECLARE(void) ap_set_module_loglevel(
  */
 
 static cmd_parms default_parms =
-{NULL, 0, 0, -1, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL};
+{NULL, 0, 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL};
 
 AP_DECLARE(char *) ap_server_root_relative(apr_pool_t *p, const char *file)
 {
@@ -1918,7 +1901,6 @@ AP_DECLARE(int) ap_process_config_tree(s
     parms.server = s;
     parms.override = (RSRC_CONF | OR_ALL) & ~(OR_AUTHCFG | OR_LIMIT);
     parms.override_opts = OPT_ALL | OPT_SYM_OWNER | OPT_MULTI;
-    parms.limited = -1;
 
     errmsg = ap_walk_config(conftree, &parms, s->lookup_defaults);
     if (errmsg) {

Modified: httpd/sandbox/replacelimit/server/core.c
URL: http://svn.apache.org/viewvc/httpd/sandbox/replacelimit/server/core.c?rev=999690&r1=999689&r2=999690&view=diff
==============================================================================
--- httpd/sandbox/replacelimit/server/core.c (original)
+++ httpd/sandbox/replacelimit/server/core.c Tue Sep 21 23:49:29 2010
@@ -498,11 +498,11 @@ AP_CORE_DECLARE(void) ap_add_per_url_con
     *new_space = url_config;
 }
 
-AP_CORE_DECLARE(void) ap_add_file_conf(core_dir_config *conf, void *url_config)
+AP_CORE_DECLARE(void) ap_add_file_conf(core_dir_config *conf, void *file_config)
 {
     void **new_space = (void **)apr_array_push(conf->sec_file);
 
-    *new_space = url_config;
+    *new_space = file_config;
 }
 
 /* We need to do a stable sort, qsort isn't stable.  So to make it stable
@@ -1001,13 +1001,6 @@ AP_DECLARE(const char *) ap_check_cmd_co
                            " cannot occur within <VirtualHost> section", NULL);
     }
 
-    if ((forbidden & (NOT_IN_LIMIT | NOT_IN_DIR_LOC_FILE))
-        && cmd->limited != -1) {
-        return apr_pstrcat(cmd->pool, cmd->cmd->name, gt,
-                           " cannot occur within <Limit> or <LimitExcept> "
-                           "section", NULL);
-    }
-
     if ((forbidden & NOT_IN_DIR_LOC_FILE) == NOT_IN_DIR_LOC_FILE) {
         if (cmd->path != NULL) {
             return apr_pstrcat(cmd->pool, cmd->cmd->name, gt,
@@ -1324,8 +1317,8 @@ static const char *set_override(cmd_parm
 
     /* Throw a warning if we're in <Location> or <Files> */
     if (ap_check_cmd_context(cmd, NOT_IN_LOCATION | NOT_IN_FILES)) {
-        ap_log_error(APLOG_MARK, APLOG_WARNING, 0, cmd->server,
-                     "Useless use of AllowOverride in line %d of %s.",
+        return apr_psprintf(cmd->pool,
+                     "Invalid use of AllowOverride in line %d of %s.",
                      cmd->directive->line_num, cmd->directive->filename);
     }
 
@@ -1340,7 +1333,10 @@ static const char *set_override(cmd_parm
         }
 
         if (!strcasecmp(w, "Limit")) {
-            d->override |= OR_LIMIT;
+            ap_log_error(APLOG_MARK, APLOG_WARNING, 0, cmd->server,
+                         "Ignoring deprecated use of AllowOverrides Limit "
+                         " at line %d of %s.", cmd->directive->line_num,
+                         cmd->directive->filename);
         }
         else if (!strcasecmp(k, "Options")) {
             d->override |= OR_OPTIONS;
@@ -1649,71 +1645,6 @@ static char *missing_container_arg(cmd_p
                        "> directive requires additional arguments", NULL);
 }
 
-AP_CORE_DECLARE_NONSTD(const char *) ap_limit_section(cmd_parms *cmd,
-                                                      void *dummy,
-                                                      const char *arg)
-{
-    const char *endp = ap_strrchr_c(arg, '>');
-    const char *limited_methods;
-    void *tog = cmd->cmd->cmd_data;
-    apr_int64_t limited = 0;
-    apr_int64_t old_limited = cmd->limited;
-    const char *errmsg;
-
-    if (endp == NULL) {
-        return unclosed_directive(cmd);
-    }
-
-    limited_methods = apr_pstrndup(cmd->pool, arg, endp - arg);
-
-    if (!limited_methods[0]) {
-        return missing_container_arg(cmd);
-    }
-
-    while (limited_methods[0]) {
-        char *method = ap_getword_conf(cmd->pool, &limited_methods);
-        int methnum;
-
-        /* check for builtin or module registered method number */
-        methnum = ap_method_number_of(method);
-
-        if (methnum == M_TRACE && !tog) {
-            return "TRACE cannot be controlled by <Limit>, see TraceEnable";
-        }
-        else if (methnum == M_INVALID) {
-            /* method has not been registered yet, but resorce restriction
-             * is always checked before method handling, so register it.
-             */
-            methnum = ap_method_register(cmd->pool, method);
-        }
-
-        limited |= (AP_METHOD_BIT << methnum);
-    }
-
-    /* Killing two features with one function,
-     * if (tog == NULL) <Limit>, else <LimitExcept>
-     */
-    limited = tog ? ~limited : limited;
-
-    if (!(old_limited & limited)) {
-        return apr_pstrcat(cmd->pool, cmd->cmd->name,
-                           "> directive excludes all methods", NULL);
-    }
-    else if ((old_limited & limited) == old_limited) {
-        return apr_pstrcat(cmd->pool, cmd->cmd->name,
-                           "> directive specifies methods already excluded",
-                           NULL);
-    }
-
-    cmd->limited &= limited;
-
-    errmsg = ap_walk_config(cmd->directive->first_child, cmd, cmd->context);
-
-    cmd->limited = old_limited;
-
-    return errmsg;
-}
-
 /* XXX: Bogus - need to do this differently (at least OS2/Netware suffer
  * the same problem!!!
  * We use this in <DirectoryMatch> and <FilesMatch>, to ensure that
@@ -1902,7 +1833,7 @@ static const char *filesection(cmd_parms
     core_dir_config *c = mconfig;
     ap_conf_vector_t *new_file_conf = ap_create_per_dir_config(cmd->pool);
     const char *err = ap_check_cmd_context(cmd,
-                                           NOT_IN_LOCATION | NOT_IN_LIMIT);
+                                           NOT_IN_LOCATION);
 
     if (err != NULL) {
         return err;
@@ -1982,8 +1913,9 @@ static const char *ifsection(cmd_parms *
     const command_rec *thiscmd = cmd->cmd;
     core_dir_config *c = mconfig;
     ap_conf_vector_t *new_file_conf = ap_create_per_dir_config(cmd->pool);
+    /* XXX nonsensical; */
     const char *err = ap_check_cmd_context(cmd,
-                                           NOT_IN_LOCATION | NOT_IN_LIMIT);
+                                           NOT_IN_LOCATION);
     const char *condition;
     int expr_err = 0;
 
@@ -3359,13 +3291,6 @@ AP_INIT_RAW_ARGS("<VirtualHost", virtual
   "more host addresses"),
 AP_INIT_RAW_ARGS("<Files", filesection, NULL, OR_ALL,
   "Container for directives affecting files matching specified patterns"),
-AP_INIT_RAW_ARGS("<Limit", ap_limit_section, NULL, OR_LIMIT | OR_AUTHCFG,
-  "Container for authentication directives when accessed using specified HTTP "
-  "methods"),
-AP_INIT_RAW_ARGS("<LimitExcept", ap_limit_section, (void*)1,
-                 OR_LIMIT | OR_AUTHCFG,
-  "Container for authentication directives to be applied when any HTTP "
-  "method other than those specified is used to access the resource"),
 AP_INIT_TAKE1("<IfModule", start_ifmod, NULL, EXEC_ON_READ | OR_ALL,
   "Container for directives based on existence of specified modules"),
 AP_INIT_TAKE1("<IfDefine", start_ifdefine, NULL, EXEC_ON_READ | OR_ALL,

Modified: httpd/sandbox/replacelimit/server/protocol.c
URL: http://svn.apache.org/viewvc/httpd/sandbox/replacelimit/server/protocol.c?rev=999690&r1=999689&r2=999690&view=diff
==============================================================================
--- httpd/sandbox/replacelimit/server/protocol.c (original)
+++ httpd/sandbox/replacelimit/server/protocol.c Tue Sep 21 23:49:29 2010
@@ -867,7 +867,6 @@ request_rec *ap_read_request(conn_rec *c
     apr_socket_t *csd;
     apr_interval_time_t cur_timeout;
 
-
     apr_pool_create(&p, conn->pool);
     apr_pool_tag(p, "request");
     r = apr_pcalloc(p, sizeof(request_rec));
@@ -876,10 +875,11 @@ request_rec *ap_read_request(conn_rec *c
     r->connection      = conn;
     r->server          = conn->base_server;
 
-    r->user            = NULL;
-    r->ap_auth_type    = NULL;
-
-    r->allowed_methods = ap_make_method_list(p, 2);
+ /* pcalloc'ed
+  * r->user            = NULL;
+  * r->ap_auth_type    = NULL;
+  */
+    ap_init_method_list(&r->allowed_methods, p, 2);
 
     r->headers_in      = apr_table_make(r->pool, 25);
     r->subprocess_env  = apr_table_make(r->pool, 25);
@@ -897,13 +897,16 @@ request_rec *ap_read_request(conn_rec *c
     ap_run_create_request(r);
     r->per_dir_config  = r->server->lookup_defaults;
 
-    r->sent_bodyct     = 0;                      /* bytect isn't for body */
+ /* pcalloc'ed
+  * r->sent_bodyct     = 0;
+
+  * r->read_length     = 0;
+  * r->read_body       = REQUEST_NO_BODY;
 
-    r->read_length     = 0;
-    r->read_body       = REQUEST_NO_BODY;
+  * r->the_request     = NULL;
+  */
 
     r->status          = HTTP_OK;  /* Until further notice */
-    r->the_request     = NULL;
 
     /* Begin by presuming any module can make its own path_info assumptions,
      * until some module interjects and changes the value.

Modified: httpd/sandbox/replacelimit/server/request.c
URL: http://svn.apache.org/viewvc/httpd/sandbox/replacelimit/server/request.c?rev=999690&r1=999689&r2=999690&view=diff
==============================================================================
--- httpd/sandbox/replacelimit/server/request.c (original)
+++ httpd/sandbox/replacelimit/server/request.c Tue Sep 21 23:49:29 2010
@@ -1658,10 +1658,10 @@ static request_rec *make_sub_request(con
     rnew->per_dir_config = r->server->lookup_defaults;
 
     rnew->htaccess = r->htaccess;
-    rnew->allowed_methods = ap_make_method_list(rnew->pool, 2);
+    ap_init_method_list(&rnew->allowed_methods, rnew->pool, 2);
 
-    /* make a copy of the allowed-methods list */
-    ap_copy_method_list(rnew->allowed_methods, r->allowed_methods);
+    /* copy the allowed-methods list into the newly created list */
+    ap_copy_method_list(&rnew->allowed_methods, &r->allowed_methods);
 
     /* start with the same set of output filters */
     if (next_filter) {

Modified: httpd/sandbox/replacelimit/server/util_script.c
URL: http://svn.apache.org/viewvc/httpd/sandbox/replacelimit/server/util_script.c?rev=999690&r1=999689&r2=999690&view=diff
==============================================================================
--- httpd/sandbox/replacelimit/server/util_script.c (original)
+++ httpd/sandbox/replacelimit/server/util_script.c Tue Sep 21 23:49:29 2010
@@ -124,9 +124,7 @@ AP_DECLARE(void) ap_add_common_vars(requ
     conn_rec *c = r->connection;
     const char *rem_logname;
     const char *env_path;
-#if defined(WIN32) || defined(OS2)
     const char *env_temp;
-#endif
     const char *host;
     const apr_array_header_t *hdrs_arr = apr_table_elts(r->headers_in);
     const apr_table_entry_t *hdrs = (const apr_table_entry_t *) hdrs_arr->elts;
@@ -191,7 +189,7 @@ AP_DECLARE(void) ap_add_common_vars(requ
     }
     apr_table_addn(e, "PATH", apr_pstrdup(r->pool, env_path));
 
-#ifdef WIN32
+#if defined(WIN32)
     if (env_temp = getenv("SystemRoot")) {
         apr_table_addn(e, "SystemRoot", env_temp);
     }
@@ -204,6 +202,43 @@ AP_DECLARE(void) ap_add_common_vars(requ
     if (env_temp = getenv("WINDIR")) {
         apr_table_addn(e, "WINDIR", env_temp);
     }
+#elif defined(OS2)
+    if ((env_temp = getenv("COMSPEC")) != NULL) {
+        apr_table_addn(e, "COMSPEC", env_temp);
+    }
+    if ((env_temp = getenv("ETC")) != NULL) {
+        apr_table_addn(e, "ETC", env_temp);
+    }
+    if ((env_temp = getenv("DPATH")) != NULL) {
+        apr_table_addn(e, "DPATH", env_temp);
+    }
+    if ((env_temp = getenv("PERLLIB_PREFIX")) != NULL) {
+        apr_table_addn(e, "PERLLIB_PREFIX", env_temp);
+    }
+#elif defined(BEOS)
+    if ((env_temp = getenv("LIBRARY_PATH")) != NULL) {
+        apr_table_addn(e, "LIBRARY_PATH", env_temp);
+    }
+#elif defined(DARWIN)
+    if ((env_temp = getenv("DYLD_LIBRARY_PATH")) != NULL) {
+        apr_table_addn(e, "DYLD_LIBRARY_PATH", env_temp);
+    }
+#elif defined(_AIX)
+    if ((env_temp = getenv("LIBPATH")) != NULL) {
+        apr_table_addn(e, "LIBPATH", env_temp);
+    }
+#elif defined(__HPUX__)
+    /* HPUX PARISC 2.0W knows both, otherwise redundancy is harmless */
+    if ((env_temp = getenv("SHLIB_PATH")) != NULL) {
+        apr_table_addn(e, "SHLIB_PATH", env_temp);
+    }
+    if ((env_temp = getenv("LD_LIBRARY_PATH")) != NULL) {
+        apr_table_addn(e, "LD_LIBRARY_PATH", env_temp);
+    }
+#else /* Some Unix */
+    if ((env_temp = getenv("LD_LIBRARY_PATH")) != NULL) {
+        apr_table_addn(e, "LD_LIBRARY_PATH", env_temp);
+    }
 #endif
 
 #ifdef OS2



Re: svn commit: r999690 - in /httpd/sandbox/replacelimit: ./ include/ modules/aaa/ modules/cache/ modules/dav/main/ modules/generators/ modules/http/ modules/ldap/ modules/mappers/ modules/proxy/ server/

Posted by "William A. Rowe Jr." <wr...@rowe-clan.net>.
On 9/23/2010 12:20 AM, Ruediger Pluem wrote:
> 
>> --- httpd/sandbox/replacelimit/server/util_script.c (original)
>> +++ httpd/sandbox/replacelimit/server/util_script.c Tue Sep 21 23:49:29 2010
> 
> Are these changes really related to <Limit?

No - this was cruft in the tree I forked, I'll revert it for purposes of
considering the sandbox.  This should just be proposed and committed
separately to trunk, if accepted, which I'll deal with in a day or few.

Thanks for noting this, and reviewing the proposal.


Re: svn commit: r999690 - in /httpd/sandbox/replacelimit: ./ include/ modules/aaa/ modules/cache/ modules/dav/main/ modules/generators/ modules/http/ modules/ldap/ modules/mappers/ modules/proxy/ server/

Posted by Ruediger Pluem <rp...@apache.org>.

On 09/22/2010 01:49 AM, wrowe@apache.org wrote:
> Author: wrowe
> Date: Tue Sep 21 23:49:29 2010
> New Revision: 999690
> 
> URL: http://svn.apache.org/viewvc?rev=999690&view=rev
> Log:
> Eliminate the hobbled <Limit[Except]> directive and associated API noise.
> 
>   Replace request_rec allowed with allowed_methods
> 
>   ap_init_method_list replaces ap_make_method_list
> 
>   OR_LIMIT/limited/limited_methods/xlimited/
>   ap_method_is_limited are dropped from the API.
>   allowed/allowed_xmethods/allowed_methods are all
>   simplified into an ap_method_list_t
> 
> Modified:
>     httpd/sandbox/replacelimit/ap.d
>     httpd/sandbox/replacelimit/include/ap_mmn.h
>     httpd/sandbox/replacelimit/include/http_config.h
>     httpd/sandbox/replacelimit/include/http_core.h
>     httpd/sandbox/replacelimit/include/http_protocol.h
>     httpd/sandbox/replacelimit/include/httpd.h
>     httpd/sandbox/replacelimit/modules/aaa/mod_access_compat.c
>     httpd/sandbox/replacelimit/modules/aaa/mod_authz_core.c
>     httpd/sandbox/replacelimit/modules/cache/mod_cache.c
>     httpd/sandbox/replacelimit/modules/cache/mod_file_cache.c
>     httpd/sandbox/replacelimit/modules/dav/main/mod_dav.c
>     httpd/sandbox/replacelimit/modules/generators/mod_asis.c
>     httpd/sandbox/replacelimit/modules/generators/mod_autoindex.c
>     httpd/sandbox/replacelimit/modules/generators/mod_info.c
>     httpd/sandbox/replacelimit/modules/generators/mod_status.c
>     httpd/sandbox/replacelimit/modules/http/http_protocol.c
>     httpd/sandbox/replacelimit/modules/http/http_request.c
>     httpd/sandbox/replacelimit/modules/ldap/util_ldap.c
>     httpd/sandbox/replacelimit/modules/mappers/mod_actions.c
>     httpd/sandbox/replacelimit/modules/proxy/mod_proxy_balancer.c
>     httpd/sandbox/replacelimit/server/config.c
>     httpd/sandbox/replacelimit/server/core.c
>     httpd/sandbox/replacelimit/server/protocol.c
>     httpd/sandbox/replacelimit/server/request.c
>     httpd/sandbox/replacelimit/server/util_script.c
> 
> Modified: httpd/sandbox/replacelimit/server/util_script.c
> URL: http://svn.apache.org/viewvc/httpd/sandbox/replacelimit/server/util_script.c?rev=999690&r1=999689&r2=999690&view=diff
> ==============================================================================
> --- httpd/sandbox/replacelimit/server/util_script.c (original)
> +++ httpd/sandbox/replacelimit/server/util_script.c Tue Sep 21 23:49:29 2010
> @@ -124,9 +124,7 @@ AP_DECLARE(void) ap_add_common_vars(requ
>      conn_rec *c = r->connection;
>      const char *rem_logname;
>      const char *env_path;
> -#if defined(WIN32) || defined(OS2)
>      const char *env_temp;
> -#endif
>      const char *host;
>      const apr_array_header_t *hdrs_arr = apr_table_elts(r->headers_in);
>      const apr_table_entry_t *hdrs = (const apr_table_entry_t *) hdrs_arr->elts;
> @@ -191,7 +189,7 @@ AP_DECLARE(void) ap_add_common_vars(requ
>      }
>      apr_table_addn(e, "PATH", apr_pstrdup(r->pool, env_path));
>  
> -#ifdef WIN32
> +#if defined(WIN32)
>      if (env_temp = getenv("SystemRoot")) {
>          apr_table_addn(e, "SystemRoot", env_temp);
>      }
> @@ -204,6 +202,43 @@ AP_DECLARE(void) ap_add_common_vars(requ
>      if (env_temp = getenv("WINDIR")) {
>          apr_table_addn(e, "WINDIR", env_temp);
>      }
> +#elif defined(OS2)
> +    if ((env_temp = getenv("COMSPEC")) != NULL) {
> +        apr_table_addn(e, "COMSPEC", env_temp);
> +    }
> +    if ((env_temp = getenv("ETC")) != NULL) {
> +        apr_table_addn(e, "ETC", env_temp);
> +    }
> +    if ((env_temp = getenv("DPATH")) != NULL) {
> +        apr_table_addn(e, "DPATH", env_temp);
> +    }
> +    if ((env_temp = getenv("PERLLIB_PREFIX")) != NULL) {
> +        apr_table_addn(e, "PERLLIB_PREFIX", env_temp);
> +    }
> +#elif defined(BEOS)
> +    if ((env_temp = getenv("LIBRARY_PATH")) != NULL) {
> +        apr_table_addn(e, "LIBRARY_PATH", env_temp);
> +    }
> +#elif defined(DARWIN)
> +    if ((env_temp = getenv("DYLD_LIBRARY_PATH")) != NULL) {
> +        apr_table_addn(e, "DYLD_LIBRARY_PATH", env_temp);
> +    }
> +#elif defined(_AIX)
> +    if ((env_temp = getenv("LIBPATH")) != NULL) {
> +        apr_table_addn(e, "LIBPATH", env_temp);
> +    }
> +#elif defined(__HPUX__)
> +    /* HPUX PARISC 2.0W knows both, otherwise redundancy is harmless */
> +    if ((env_temp = getenv("SHLIB_PATH")) != NULL) {
> +        apr_table_addn(e, "SHLIB_PATH", env_temp);
> +    }
> +    if ((env_temp = getenv("LD_LIBRARY_PATH")) != NULL) {
> +        apr_table_addn(e, "LD_LIBRARY_PATH", env_temp);
> +    }
> +#else /* Some Unix */
> +    if ((env_temp = getenv("LD_LIBRARY_PATH")) != NULL) {
> +        apr_table_addn(e, "LD_LIBRARY_PATH", env_temp);
> +    }
>  #endif
>  
>  #ifdef OS2
> 

Are these changes really related to <Limit?

Regards

RĂ¼diger