Make the ldap version setting work without having both version and protocol set.
authorJoshua Colp <jcolp@digium.com>
Wed, 14 May 2008 18:25:54 +0000 (18:25 +0000)
committerJoshua Colp <jcolp@digium.com>
Wed, 14 May 2008 18:25:54 +0000 (18:25 +0000)
(closes issue #12613)
Reported by: suretec

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@116350 65c4cc65-6c06-0410-ace0-fbb531ad65f3

res/res_config_ldap.c

index 33ed247..b8816b9 100644 (file)
@@ -1432,7 +1432,7 @@ int parse_config(void)
        } else 
                ast_copy_string(basedn, s, sizeof(basedn));
 
-       if (!(s = ast_variable_retrieve(config, "_general", "version")) || !(s = ast_variable_retrieve(config, "_general", "protocol"))) {
+       if (!(s = ast_variable_retrieve(config, "_general", "version")) && !(s = ast_variable_retrieve(config, "_general", "protocol"))) {
                ast_log(LOG_NOTICE, "No explicit LDAP version found, using 3 as default.\n");
                version = 3;
        } else if (sscanf(s, "%d", &version) != 1 || version < 1 || version > 6) {