util_ldap_cache.c revision 3a11074e78d5961088e8f5520ba3cec163faed9c
/* Copyright 2001-2004 The Apache Software Foundation
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/*
* util_ldap_cache.c: LDAP cache things
*
* Original code from auth_ldap module for Apache v1.3:
* Copyright 1998, 1999 Enbridge Pipelines Inc.
* Copyright 1999-2001 Dave Carrigan
*/
#include <apr_ldap.h>
#include <apr_strings.h>
#include "util_ldap.h"
#include "util_ldap_cache.h"
#if APR_HAS_LDAP
#define MODLDAP_SHMEM_CACHE "/tmp/mod_ldap_cache"
#endif
/* ------------------------------------------------------------------ */
unsigned long util_ldap_url_node_hash(void *n)
{
}
int util_ldap_url_node_compare(void *a, void *b)
{
}
{
util_url_node_t *n = (util_url_node_t *)c;
if (node) {
return NULL;
}
return node;
}
else {
return NULL;
}
}
{
}
{
char *buf;
const char *type_str;
int x;
for (x=0;x<3;x++) {
switch (x) {
case 0:
type_str = "Searches";
break;
case 1:
type_str = "Compares";
break;
case 2:
default:
type_str = "DN Compares";
break;
}
if (cache_node->marktime) {
}
else
date_str[0] = 0;
"<tr valign='top'>"
"<td nowrap>%s (%s)</td>"
"<td nowrap>%ld</td>"
"<td nowrap>%ld</td>"
"<td nowrap>%ld</td>"
"<td nowrap>%ld</td>"
"<td nowrap>%s</td>"
"<tr>",
date_str);
}
}
/* ------------------------------------------------------------------ */
/* Cache functions for search nodes */
unsigned long util_ldap_search_node_hash(void *n)
{
}
int util_ldap_search_node_compare(void *a, void *b)
{
((util_search_node_t *)b)->username) == 0);
}
{
/* safety check */
if (newnode) {
/* copy vals */
int k = 0;
int i = 0;
return NULL;
}
return NULL;
}
i++;
}
}
else {
}
return NULL;
}
return NULL;
}
} else {
}
}
return (void *)newnode;
}
{
int i = 0;
}
}
}
{
char *buf;
"<tr valign='top'>"
"<td nowrap>%s</td>"
"<td nowrap>%s</td>"
"<td nowrap>%s</td>"
"<tr>",
date_str);
}
/* ------------------------------------------------------------------ */
unsigned long util_ldap_compare_node_hash(void *n)
{
}
int util_ldap_compare_node_compare(void *a, void *b)
{
}
{
util_compare_node_t *n = (util_compare_node_t *)c;
util_compare_node_t *node = (util_compare_node_t *)util_ald_alloc(cache, sizeof(util_compare_node_t));
if (node) {
return NULL;
}
return node;
}
else {
return NULL;
}
}
{
}
{
char *buf, *cmp_result;
cmp_result = "LDAP_COMPARE_TRUE";
}
cmp_result = "LDAP_COMPARE_FALSE";
}
else {
}
"<tr valign='top'>"
"<td nowrap>%s</td>"
"<td nowrap>%s</td>"
"<td nowrap>%s</td>"
"<td nowrap>%s</td>"
"<td nowrap>%s</td>"
"<tr>",
}
/* ------------------------------------------------------------------ */
unsigned long util_ldap_dn_compare_node_hash(void *n)
{
}
int util_ldap_dn_compare_node_compare(void *a, void *b)
{
((util_dn_compare_node_t *)b)->reqdn) == 0);
}
{
util_dn_compare_node_t *n = (util_dn_compare_node_t *)c;
util_dn_compare_node_t *node = (util_dn_compare_node_t *)util_ald_alloc(cache, sizeof(util_dn_compare_node_t));
if (node) {
return NULL;
}
return node;
}
else {
return NULL;
}
}
{
}
{
char *buf;
"<tr valign='top'>"
"<td nowrap>%s</td>"
"<td nowrap>%s</td>"
"<tr>",
}
/* ------------------------------------------------------------------ */
{
}
return result;
}
#endif
return APR_SUCCESS;
}
{
if (result == APR_EEXIST) {
/*
* The cache could have already been created (i.e. we may be a child process). See
* if we can attach to the existing shared memory
*/
}
if (result != APR_SUCCESS) {
return result;
}
/* This will create a rmm "handler" to get into the shared memory area */
apr_rmm_init(&st->cache_rmm, NULL, (void *)apr_shm_baseaddr_get(st->cache_shm), st->cache_bytes, st->pool);
#endif
return APR_SUCCESS;
}
#endif /* APR_HAS_LDAP */