httpd-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bnicho...@apache.org
Subject svn commit: r351547 - in /httpd/httpd/branches/authz-dev: include/http_core.h modules/aaa/mod_authz_host.c server/core.c server/request.c
Date Fri, 02 Dec 2005 01:19:11 GMT
Author: bnicholes
Date: Thu Dec  1 17:19:07 2005
New Revision: 351547

URL: http://svn.apache.org/viewcvs?rev=351547&view=rev
Log:
Reimplement ap_some_auth_required as an optional function since the data has moved to mod_authz_host
yet it is still needed by the request handler

Modified:
    httpd/httpd/branches/authz-dev/include/http_core.h
    httpd/httpd/branches/authz-dev/modules/aaa/mod_authz_host.c
    httpd/httpd/branches/authz-dev/server/core.c
    httpd/httpd/branches/authz-dev/server/request.c

Modified: httpd/httpd/branches/authz-dev/include/http_core.h
URL: http://svn.apache.org/viewcvs/httpd/httpd/branches/authz-dev/include/http_core.h?rev=351547&r1=351546&r2=351547&view=diff
==============================================================================
--- httpd/httpd/branches/authz-dev/include/http_core.h (original)
+++ httpd/httpd/branches/authz-dev/include/http_core.h Thu Dec  1 17:19:07 2005
@@ -687,6 +687,7 @@
 
 APR_DECLARE_OPTIONAL_FN(const apr_array_header_t *, authz_host_ap_requires,
                         (request_rec *r));
+APR_DECLARE_OPTIONAL_FN(int, authz_some_auth_required, (request_rec *r));
 /*
 APR_DECLARE_OPTIONAL_FN(const char *, authz_host_ap_auth_type, (request_rec *r));
 APR_DECLARE_OPTIONAL_FN(const char *, authz_host_ap_auth_name, (request_rec *r));

Modified: httpd/httpd/branches/authz-dev/modules/aaa/mod_authz_host.c
URL: http://svn.apache.org/viewcvs/httpd/httpd/branches/authz-dev/modules/aaa/mod_authz_host.c?rev=351547&r1=351546&r2=351547&view=diff
==============================================================================
--- httpd/httpd/branches/authz-dev/modules/aaa/mod_authz_host.c (original)
+++ httpd/httpd/branches/authz-dev/modules/aaa/mod_authz_host.c Thu Dec  1 17:19:07 2005
@@ -520,6 +520,46 @@
     return conf->ap_requires;
 }
 
+static int authz_some_auth_required(request_rec *r)
+{
+    authz_host_dir_conf *conf = ap_get_module_config(r->per_dir_config,
+            &authz_host_module);
+    authz_provider_list *current_provider;
+    int req_authz = 1;
+
+    current_provider = conf->providers;
+    do {
+        const authz_provider *provider;
+
+        /* For now, if a provider isn't set, we'll be nice and use the file
+        * provider.
+        */
+        if (!current_provider) {
+            provider = ap_lookup_provider(AUTHZ_PROVIDER_GROUP,
+                                          AUTHZ_DEFAULT_PROVIDER, "0");
+
+            if (!provider || !provider->check_authorization) {
+                ap_log_rerror(APLOG_MARK, APLOG_ERR, 0, r,
+                              "No Authz providers configured.  Assmuming no authorization
required.");
+                req_authz = 0;
+                break;
+            }
+        }
+        else {
+            provider = current_provider->provider;
+        }
+
+        if (current_provider->method_mask & (AP_METHOD_BIT << r->method_number))
{
+            req_authz = 1;
+            break;
+        }
+    
+        current_provider = current_provider->next;
+    } while (current_provider);
+
+    return req_authz;
+}
+
 /*
 static const char *authz_host_ap_auth_type(request_rec *r)
 {
@@ -545,6 +585,7 @@
 static void register_hooks(apr_pool_t *p)
 {
     APR_REGISTER_OPTIONAL_FN(authz_host_ap_requires);
+    APR_REGISTER_OPTIONAL_FN(authz_some_auth_required);
     /*
     APR_REGISTER_OPTIONAL_FN(authz_host_ap_auth_type);
     APR_REGISTER_OPTIONAL_FN(authz_host_ap_auth_name);

Modified: httpd/httpd/branches/authz-dev/server/core.c
URL: http://svn.apache.org/viewcvs/httpd/httpd/branches/authz-dev/server/core.c?rev=351547&r1=351546&r2=351547&view=diff
==============================================================================
--- httpd/httpd/branches/authz-dev/server/core.c (original)
+++ httpd/httpd/branches/authz-dev/server/core.c Thu Dec  1 17:19:07 2005
@@ -3721,12 +3721,14 @@
  * traffic
  */
 APR_OPTIONAL_FN_TYPE(ap_logio_add_bytes_out) *logio_add_bytes_out;
+APR_OPTIONAL_FN_TYPE(authz_some_auth_required) *azh_ap_some_auth_required;
 
 static int core_post_config(apr_pool_t *pconf, apr_pool_t *plog, apr_pool_t *ptemp, server_rec
*s)
 {
     logio_add_bytes_out = APR_RETRIEVE_OPTIONAL_FN(ap_logio_add_bytes_out);
     ident_lookup = APR_RETRIEVE_OPTIONAL_FN(ap_ident_lookup);
     azh_ap_requires = APR_RETRIEVE_OPTIONAL_FN(authz_host_ap_requires);
+    azh_ap_some_auth_required = APR_RETRIEVE_OPTIONAL_FN(authz_some_auth_required);
     /*
     azh_ap_auth_type = APR_RETRIEVE_OPTIONAL_FN(authz_host_ap_auth_type);
     azh_ap_auth_name = APR_RETRIEVE_OPTIONAL_FN(authz_host_ap_auth_name);

Modified: httpd/httpd/branches/authz-dev/server/request.c
URL: http://svn.apache.org/viewcvs/httpd/httpd/branches/authz-dev/server/request.c?rev=351547&r1=351546&r2=351547&view=diff
==============================================================================
--- httpd/httpd/branches/authz-dev/server/request.c (original)
+++ httpd/httpd/branches/authz-dev/server/request.c Thu Dec  1 17:19:07 2005
@@ -1555,11 +1555,12 @@
     return APR_SUCCESS;
 }
 
+extern APR_OPTIONAL_FN_TYPE(authz_some_auth_required) *azh_ap_some_auth_required;
 
 AP_DECLARE(int) ap_some_auth_required(request_rec *r)
 {
     /* Is there a require line configured for the type of *this* req? */
-
+/*
     const apr_array_header_t *reqs_arr = ap_requires(r);
     require_line *reqs;
     int i;
@@ -1577,6 +1578,12 @@
     }
 
     return 0;
+*/
+    if (azh_ap_some_auth_required) {
+        return azh_ap_some_auth_required(r);
+    }
+    else
+        return 0;
 }
 
 



Mime
View raw message