1 /* Copyright 2000-2005 The Apache Software Foundation or its licensors, as
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
8 * http://www.apache.org/licenses/LICENSE-2.0
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.
18 * apr_ldap_compat.c: LDAP v2/v3 compatibility things
20 * Original code from auth_ldap module for Apache v1.3:
21 * Copyright 1998, 1999 Enbridge Pipelines Inc.
22 * Copyright 1999-2001 Dave Carrigan
31 * Compatibility for LDAPv2 libraries. Differences between LDAPv2 and
32 * LDAPv3, as they affect this module
34 * LDAPv3 uses ldap_search_ext_s; LDAPv2 uses only basic ldap_search_s
36 * LDAPv3 uses ldap_memfree; LDAPv2 just uses free().
38 * In this section, we just implement the LDAPv3 SDK functions that are
42 #if LDAP_VERSION_MAX == 2
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.
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)
52 return ldap_search_s(ldap, base, scope, filter, attrs, attrsonly, res);
55 void ldap_memfree(void *p)
60 #endif /* if LDAP_VERSION_MAX */
62 #endif /* APU_HAS_LDAP */