bottleneck testcase based on rubbos
[bottlenecks.git] / rubbos / app / httpd-2.0.64 / srclib / apr-util / ldap / apr_ldap_compat.c
1 /* Copyright 2000-2005 The Apache Software Foundation or its licensors, as
2  * applicable.
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  *     http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16
17 /*
18  * apr_ldap_compat.c: LDAP v2/v3 compatibility things
19  * 
20  * Original code from auth_ldap module for Apache v1.3:
21  * Copyright 1998, 1999 Enbridge Pipelines Inc. 
22  * Copyright 1999-2001 Dave Carrigan
23  */
24
25 #include <apr_ldap.h>
26
27 #ifdef APU_HAS_LDAP
28
29
30 /* 
31  * Compatibility for LDAPv2 libraries. Differences between LDAPv2 and 
32  * LDAPv3, as they affect this module
33  * 
34  *  LDAPv3 uses ldap_search_ext_s; LDAPv2 uses only basic ldap_search_s
35  *
36  *  LDAPv3 uses ldap_memfree; LDAPv2 just uses free().
37  *
38  * In this section, we just implement the LDAPv3 SDK functions that are 
39  * missing in LDAPv2. 
40  * 
41  */
42 #if LDAP_VERSION_MAX == 2
43
44 /*
45  * LDAPv2 doesn't support extended search. Since auth_ldap doesn't use
46  * it anyway, we just translate the extended search into a normal search.
47  */
48 int ldap_search_ext_s(LDAP *ldap, char *base, int scope, char *filter,
49                       char **attrs, int attrsonly, void *servertrls, void *clientctrls,
50                       void *timeout, int sizelimit, LDAPMessage **res)
51 {
52     return ldap_search_s(ldap, base, scope, filter, attrs, attrsonly, res);
53 }
54
55 void ldap_memfree(void *p)
56 {
57     free(p);
58 }
59
60 #endif /* if LDAP_VERSION_MAX */
61
62 #endif /* APU_HAS_LDAP */