[asterisk-bugs] [Asterisk 0005768]: [branch][post 1.4] LDAP Realtime driver

noreply at bugs.digium.com noreply at bugs.digium.com
Wed Aug 1 13:20:51 CDT 2007


A NOTE has been added to this issue. 
====================================================================== 
http://bugs.digium.com/view.php?id=5768 
====================================================================== 
Reported By:                mguesdon
Assigned To:                
====================================================================== 
Project:                    Asterisk
Issue ID:                   5768
Category:                   Resources/NewFeature
Reproducibility:            N/A
Severity:                   feature
Priority:                   normal
Status:                     ready for testing
Asterisk Version:            SVN 
SVN Branch (only for SVN checkouts, not tarball releases):  trunk 
SVN Revision (number only!): 48570 
Disclaimer on File?:        Yes 
Request Review:              
====================================================================== 
Date Submitted:             11-16-2005 11:11 CST
Last Modified:              08-01-2007 13:20 CDT
====================================================================== 
Summary:                    [branch][post 1.4] LDAP Realtime driver
Description: 
Here is a ldap realtime driver.
res_config_ldap.c: code
res_ldap.conf.sample: res_ldap.conf sample
asterisk.ldap-schema: example of ldap schema
ldap-patch.diff: Makefile patch
====================================================================== 

---------------------------------------------------------------------- 
 nito - 08-01-07 13:20  
---------------------------------------------------------------------- 
Well, I think it is a matter of opinions, but at the current state if the
LDAP server restarts asterisk does not reestablish the connection (for
openldap, I think you need to stop the database to have a consistent
backup).

In any case the testing code (and rebind) is already implemented. See
below:

result = ldap_search_ext_s(...);
if (result < 0 && is_ldap_connect_error(result)) {

But the error checking is wrong the correct ldap check is 

if (result != 0 && is_ldap_connect_error(result)) {

(or sjmilarly correctly)

if (result != LDAP_SUCCESS && is_ldap_connect_error(result)) {

please see the return for ldap_search(3) that is documented in
ldap_error(3) (man pages) and the relevant LDAP_SUCCESS and other errors in
/usr/include/ldap.h (for example the error LDAP_OPERATIONS_ERROR has a
value of 1 and would not be included in the first check).

(all this for the openldap version, although the ldap codes come from the
RFC 2251, http://tools.ietf.org/html/rfc2251#section-4.1.10) 

Issue History 
Date Modified   Username       Field                    Change               
====================================================================== 
08-01-07 13:20  nito           Note Added: 0068223                          
======================================================================




More information about the asterisk-bugs mailing list