[Remove entries to the current 2.0 section below, when backported]
+ *) Add version string to provider API. [Justin Erenkrantz]
+
*) Rewrite of aaa modules to an authn/authz model.
[Dirk-Willem van Gulik, Justin Erenkrantz]
-
-
Changes with Apache 2.0.44
*) build: './configure && make' now works without an in-tree
* @param pool The pool to create any storage from
* @param provider_group The group to store the provider in
* @param provider_name The name for this provider
+ * @param provider_version The version for this provider
* @param provider Opaque structure for this provider
* @return APR_SUCCESS if all went well
*/
AP_DECLARE(apr_status_t) ap_register_provider(apr_pool_t *pool,
const char *provider_group,
const char *provider_name,
+ const char *provider_version,
const void *provider);
/**
* provider pool.
* @param provider_group The group to look for this provider in
* @param provider_name The name for the provider
+ * @param provider_version The version for the provider
* @return provider pointer to provider if found, NULL otherwise
*/
AP_DECLARE(void *) ap_lookup_provider(const char *provider_group,
- const char *provider_name);
+ const char *provider_name,
+ const char *provider_version);
#endif
/* lookup and cache the actual provider now */
newp->provider = ap_lookup_provider(AUTHN_PROVIDER_GROUP,
- newp->provider_name);
+ newp->provider_name, "0");
if (newp->provider == NULL) {
/* by the time they use it, the provider should be loaded and
*/
if (!current_provider) {
provider = ap_lookup_provider(AUTHN_PROVIDER_GROUP,
- AUTHN_DEFAULT_PROVIDER);
+ AUTHN_DEFAULT_PROVIDER, "0");
}
else {
provider = current_provider->provider;
/* lookup and cache the actual provider now */
newp->provider = ap_lookup_provider(AUTHN_PROVIDER_GROUP,
- newp->provider_name);
+ newp->provider_name, "0");
if (newp->provider == NULL) {
/* by the time they use it, the provider should be loaded and
*/
if (!current_provider) {
provider = ap_lookup_provider(AUTHN_PROVIDER_GROUP,
- AUTHN_DEFAULT_PROVIDER);
+ AUTHN_DEFAULT_PROVIDER, "0");
}
else {
provider = current_provider->provider;
static void register_hooks(apr_pool_t *p)
{
- ap_register_provider(p, AUTHN_PROVIDER_GROUP, "dbm", &authn_dbm_provider);
+ ap_register_provider(p, AUTHN_PROVIDER_GROUP, "dbm", "0",
+ &authn_dbm_provider);
}
module AP_MODULE_DECLARE_DATA authn_dbm_module =
static void register_hooks(apr_pool_t *p)
{
- ap_register_provider(p, AUTHN_PROVIDER_GROUP, "file", &authn_file_provider);
+ ap_register_provider(p, AUTHN_PROVIDER_GROUP, "file", "0",
+ &authn_file_provider);
}
module AP_MODULE_DECLARE_DATA authn_file_module =
DAV_DECLARE(void) dav_register_provider(apr_pool_t *p, const char *name,
const dav_provider *provider)
{
- ap_register_provider(p, DAV_PROVIDER_GROUP, name, provider);
+ ap_register_provider(p, DAV_PROVIDER_GROUP, name, "0", provider);
}
const dav_provider * dav_lookup_provider(const char *name)
{
- return ap_lookup_provider(DAV_PROVIDER_GROUP, name);
+ return ap_lookup_provider(DAV_PROVIDER_GROUP, name, "0");
}
AP_DECLARE(apr_status_t) ap_register_provider(apr_pool_t *pool,
const char *provider_group,
const char *provider_name,
+ const char *provider_version,
const void *provider)
{
apr_hash_t *provider_group_hash;
+ apr_hash_t *provider_version_hash;
if (global_providers == NULL) {
global_providers = apr_hash_make(pool);
}
+ provider_version_hash = apr_hash_get(provider_group_hash, provider_name,
+ APR_HASH_KEY_STRING);
+
+ if (!provider_version_hash) {
+ provider_version_hash = apr_hash_make(pool);
+ apr_hash_set(provider_group_hash, provider_name, APR_HASH_KEY_STRING,
+ provider_version_hash);
+
+ }
+
/* just set it. no biggy if it was there before. */
- apr_hash_set(provider_group_hash, provider_name, APR_HASH_KEY_STRING,
+ apr_hash_set(provider_version_hash, provider_version, APR_HASH_KEY_STRING,
provider);
return APR_SUCCESS;
}
AP_DECLARE(void *) ap_lookup_provider(const char *provider_group,
- const char *provider_name)
+ const char *provider_name,
+ const char *provider_version)
{
- apr_hash_t *provider_group_hash;
+ apr_hash_t *provider_group_hash, *provider_name_hash;
if (global_providers == NULL) {
return NULL;
return NULL;
}
- return apr_hash_get(provider_group_hash, provider_name,
+ provider_name_hash = apr_hash_get(provider_group_hash, provider_name,
+ APR_HASH_KEY_STRING);
+
+ if (provider_name_hash == NULL) {
+ return NULL;
+ }
+
+ return apr_hash_get(provider_name_hash, provider_version,
APR_HASH_KEY_STRING);
}