|
|
008793 |
Index: modules/aaa/mod_authz_owner.c
|
|
|
008793 |
===================================================================
|
|
|
008793 |
--- a/modules/aaa/mod_authz_owner.c (revision 1420183)
|
|
|
008793 |
+++ b/modules/aaa/mod_authz_owner.c (revision 1420184)
|
|
|
008793 |
@@ -28,9 +28,8 @@
|
|
|
008793 |
#include "http_request.h"
|
|
|
008793 |
|
|
|
008793 |
#include "mod_auth.h"
|
|
|
008793 |
+#include "mod_authz_owner.h"
|
|
|
008793 |
|
|
|
008793 |
-APR_DECLARE_OPTIONAL_FN(char*, authz_owner_get_file_group, (request_rec *r));
|
|
|
008793 |
-
|
|
|
008793 |
static const command_rec authz_owner_cmds[] =
|
|
|
008793 |
{
|
|
|
008793 |
{NULL}
|
|
|
008793 |
Index: modules/aaa/mod_authz_owner.h
|
|
|
008793 |
===================================================================
|
|
|
008793 |
--- a/modules/aaa/mod_authz_owner.h (revision 0)
|
|
|
008793 |
+++ b/modules/aaa/mod_authz_owner.h (revision 1420184)
|
|
|
008793 |
@@ -0,0 +1,27 @@
|
|
|
008793 |
+/* Licensed to the Apache Software Foundation (ASF) under one or more
|
|
|
008793 |
+ * contributor license agreements. See the NOTICE file distributed with
|
|
|
008793 |
+ * this work for additional information regarding copyright ownership.
|
|
|
008793 |
+ * The ASF licenses this file to You under the Apache License, Version 2.0
|
|
|
008793 |
+ * (the "License"); you may not use this file except in compliance with
|
|
|
008793 |
+ * the License. You may obtain a copy of the License at
|
|
|
008793 |
+ *
|
|
|
008793 |
+ * http://www.apache.org/licenses/LICENSE-2.0
|
|
|
008793 |
+ *
|
|
|
008793 |
+ * Unless required by applicable law or agreed to in writing, software
|
|
|
008793 |
+ * distributed under the License is distributed on an "AS IS" BASIS,
|
|
|
008793 |
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
|
008793 |
+ * See the License for the specific language governing permissions and
|
|
|
008793 |
+ * limitations under the License.
|
|
|
008793 |
+ */
|
|
|
008793 |
+
|
|
|
008793 |
+#ifndef MOD_AUTHZ_OWNER_H
|
|
|
008793 |
+#define MOD_AUTHZ_OWNER_H
|
|
|
008793 |
+
|
|
|
008793 |
+#include "http_request.h"
|
|
|
008793 |
+
|
|
|
008793 |
+/* mod_authz_owner exports an optional function which retrieves the
|
|
|
008793 |
+ * group name of the file identified by r->filename, if available, or
|
|
|
008793 |
+ * else returns NULL. */
|
|
|
008793 |
+APR_DECLARE_OPTIONAL_FN(char*, authz_owner_get_file_group, (request_rec *r));
|
|
|
008793 |
+
|
|
|
008793 |
+#endif /* MOD_AUTHZ_OWNER_H */
|
|
|
008793 |
Index: modules/aaa/mod_authz_groupfile.c
|
|
|
008793 |
===================================================================
|
|
|
008793 |
--- a/modules/aaa/mod_authz_groupfile.c (revision 1420183)
|
|
|
008793 |
+++ b/modules/aaa/mod_authz_groupfile.c (revision 1420184)
|
|
|
008793 |
@@ -55,13 +55,12 @@
|
|
|
008793 |
#include "util_varbuf.h"
|
|
|
008793 |
|
|
|
008793 |
#include "mod_auth.h"
|
|
|
008793 |
+#include "mod_authz_owner.h"
|
|
|
008793 |
|
|
|
008793 |
typedef struct {
|
|
|
008793 |
char *groupfile;
|
|
|
008793 |
} authz_groupfile_config_rec;
|
|
|
008793 |
|
|
|
008793 |
-APR_DECLARE_OPTIONAL_FN(char*, authz_owner_get_file_group, (request_rec *r));
|
|
|
008793 |
-
|
|
|
008793 |
static void *create_authz_groupfile_dir_config(apr_pool_t *p, char *d)
|
|
|
008793 |
{
|
|
|
008793 |
authz_groupfile_config_rec *conf = apr_palloc(p, sizeof(*conf));
|
|
|
008793 |
@@ -200,7 +199,7 @@
|
|
|
008793 |
return AUTHZ_DENIED;
|
|
|
008793 |
}
|
|
|
008793 |
|
|
|
008793 |
-APR_OPTIONAL_FN_TYPE(authz_owner_get_file_group) *authz_owner_get_file_group;
|
|
|
008793 |
+static APR_OPTIONAL_FN_TYPE(authz_owner_get_file_group) *authz_owner_get_file_group;
|
|
|
008793 |
|
|
|
008793 |
static authz_status filegroup_check_authorization(request_rec *r,
|
|
|
008793 |
const char *require_args,
|
|
|
008793 |
@@ -279,10 +278,14 @@
|
|
|
008793 |
NULL,
|
|
|
008793 |
};
|
|
|
008793 |
|
|
|
008793 |
-static void register_hooks(apr_pool_t *p)
|
|
|
008793 |
+
|
|
|
008793 |
+static void authz_groupfile_getfns(void)
|
|
|
008793 |
{
|
|
|
008793 |
authz_owner_get_file_group = APR_RETRIEVE_OPTIONAL_FN(authz_owner_get_file_group);
|
|
|
008793 |
+}
|
|
|
008793 |
|
|
|
008793 |
+static void register_hooks(apr_pool_t *p)
|
|
|
008793 |
+{
|
|
|
008793 |
ap_register_auth_provider(p, AUTHZ_PROVIDER_GROUP, "group",
|
|
|
008793 |
AUTHZ_PROVIDER_VERSION,
|
|
|
008793 |
&authz_group_provider,
|
|
|
008793 |
@@ -291,6 +294,7 @@
|
|
|
008793 |
AUTHZ_PROVIDER_VERSION,
|
|
|
008793 |
&authz_filegroup_provider,
|
|
|
008793 |
AP_AUTH_INTERNAL_PER_CONF);
|
|
|
008793 |
+ ap_hook_optional_fn_retrieve(authz_groupfile_getfns, NULL, NULL, APR_HOOK_MIDDLE);
|
|
|
008793 |
}
|
|
|
008793 |
|
|
|
008793 |
AP_DECLARE_MODULE(authz_groupfile) =
|
|
|
008793 |
Index: modules/aaa/mod_authz_dbm.c
|
|
|
008793 |
===================================================================
|
|
|
008793 |
--- a/modules/aaa/mod_authz_dbm.c (revision 1420183)
|
|
|
008793 |
+++ b/modules/aaa/mod_authz_dbm.c (revision 1420184)
|
|
|
008793 |
@@ -29,6 +29,7 @@
|
|
|
008793 |
#include "http_request.h" /* for ap_hook_(check_user_id | auth_checker)*/
|
|
|
008793 |
|
|
|
008793 |
#include "mod_auth.h"
|
|
|
008793 |
+#include "mod_authz_owner.h"
|
|
|
008793 |
|
|
|
008793 |
typedef struct {
|
|
|
008793 |
const char *grpfile;
|
|
|
008793 |
@@ -35,9 +36,7 @@
|
|
|
008793 |
const char *dbmtype;
|
|
|
008793 |
} authz_dbm_config_rec;
|
|
|
008793 |
|
|
|
008793 |
-APR_DECLARE_OPTIONAL_FN(char*, authz_owner_get_file_group, (request_rec *r));
|
|
|
008793 |
|
|
|
008793 |
-
|
|
|
008793 |
/* This should go into APR; perhaps with some nice
|
|
|
008793 |
* caching/locking/flocking of the open dbm file.
|
|
|
008793 |
*/
|
|
|
008793 |
@@ -199,7 +198,7 @@
|
|
|
008793 |
return AUTHZ_DENIED;
|
|
|
008793 |
}
|
|
|
008793 |
|
|
|
008793 |
-APR_OPTIONAL_FN_TYPE(authz_owner_get_file_group) *authz_owner_get_file_group;
|
|
|
008793 |
+static APR_OPTIONAL_FN_TYPE(authz_owner_get_file_group) *authz_owner_get_file_group;
|
|
|
008793 |
|
|
|
008793 |
static authz_status dbmfilegroup_check_authorization(request_rec *r,
|
|
|
008793 |
const char *require_args,
|
|
|
008793 |
@@ -279,11 +278,13 @@
|
|
|
008793 |
NULL,
|
|
|
008793 |
};
|
|
|
008793 |
|
|
|
008793 |
+static void authz_dbm_getfns(void)
|
|
|
008793 |
+{
|
|
|
008793 |
+ authz_owner_get_file_group = APR_RETRIEVE_OPTIONAL_FN(authz_owner_get_file_group);
|
|
|
008793 |
+}
|
|
|
008793 |
|
|
|
008793 |
static void register_hooks(apr_pool_t *p)
|
|
|
008793 |
{
|
|
|
008793 |
- authz_owner_get_file_group = APR_RETRIEVE_OPTIONAL_FN(authz_owner_get_file_group);
|
|
|
008793 |
-
|
|
|
008793 |
ap_register_auth_provider(p, AUTHZ_PROVIDER_GROUP, "dbm-group",
|
|
|
008793 |
AUTHZ_PROVIDER_VERSION,
|
|
|
008793 |
&authz_dbmgroup_provider,
|
|
|
008793 |
@@ -292,6 +293,7 @@
|
|
|
008793 |
AUTHZ_PROVIDER_VERSION,
|
|
|
008793 |
&authz_dbmfilegroup_provider,
|
|
|
008793 |
AP_AUTH_INTERNAL_PER_CONF);
|
|
|
008793 |
+ ap_hook_optional_fn_retrieve(authz_dbm_getfns, NULL, NULL, APR_HOOK_MIDDLE);
|
|
|
008793 |
}
|
|
|
008793 |
|
|
|
008793 |
AP_DECLARE_MODULE(authz_dbm) =
|