[asterisk-bugs] [Asterisk 0018478]: Ldap Can't modify unknown attribute

Asterisk Bug Tracker noreply at bugs.digium.com
Wed Dec 15 18:49:19 UTC 2010


A NOTE has been added to this issue. 
====================================================================== 
https://issues.asterisk.org/view.php?id=18478 
====================================================================== 
Reported By:                moos3
Assigned To:                
====================================================================== 
Project:                    Asterisk
Issue ID:                   18478
Category:                   Resources/res_config_ldap
Reproducibility:            always
Severity:                   tweak
Priority:                   normal
Status:                     new
Asterisk Version:           1.6.2.14 
JIRA:                        
Regression:                 No 
Reviewboard Link:            
SVN Branch (only for SVN checkouts, not tarball releases): 1.6.2 
SVN Revision (number only!): 288822 
Request Review:              
====================================================================== 
Date Submitted:             2010-12-15 12:10 CST
Last Modified:              2010-12-15 12:49 CST
====================================================================== 
Summary:                    Ldap Can't modify unknown attribute
Description: 
With a ldap as the realtime source it will when it can't modify anything it
returns:
res_config_ldap.c:1317 update_ldap: Couldn't modify
dn:uid=rgenthner,ou=People,dc=example,dc=com because Undefined attribute
type

Which doesn't give you any insight on what attribute its trying to modify
====================================================================== 

---------------------------------------------------------------------- 
 (0129616) moos3 (reporter) - 2010-12-15 12:49
 https://issues.asterisk.org/view.php?id=18478#c129616 
---------------------------------------------------------------------- 
Heres a better patch, fixes the error lines from running together


Index: res/res_config_ldap.c
===================================================================
--- res/res_config_ldap.c	(revision 288822)
+++ res/res_config_ldap.c	(working copy)
@@ -1314,8 +1314,8 @@
 		for (i = 0; ldap_entry; i++) { 
 			dn = ldap_get_dn(ldapConn, ldap_entry);
 			if ((error = ldap_modify_ext_s(ldapConn, dn, ldap_mods, NULL, NULL))
!= LDAP_SUCCESS) 
-				ast_log(LOG_ERROR, "Couldn't modify dn:%s because %s", dn,
ldap_err2string(error));
-
+				ast_log(LOG_ERROR, "Couldn't modify dn:%s because %s \n", dn,
ldap_err2string(error));
+				ast_log(LOG_ERROR, "Tried to modify %s when looking up %s \n",
attribute,lookup);
 			ldap_entry = ldap_next_entry(ldapConn, ldap_entry);
 		}
 	}
@@ -1497,7 +1497,6 @@
 			dn = ldap_get_dn(ldapConn, ldap_entry);
 			if ((error = ldap_modify_ext_s(ldapConn, dn, ldap_mods, NULL, NULL))
!= LDAP_SUCCESS) 
 				ast_log(LOG_ERROR, "Couldn't modify dn:%s because %s", dn,
ldap_err2string(error));
-
 			ldap_entry = ldap_next_entry(ldapConn, ldap_entry);
 		}
 	} 

Issue History 
Date Modified    Username       Field                    Change               
====================================================================== 
2010-12-15 12:49 moos3          Note Added: 0129616                          
======================================================================




More information about the asterisk-bugs mailing list