aboutsummaryrefslogtreecommitdiffstats
path: root/res
diff options
context:
space:
mode:
authorrussell <russell@f38db490-d61c-443f-a65b-d21fe96a405b>2008-05-07 18:35:52 +0000
committerrussell <russell@f38db490-d61c-443f-a65b-d21fe96a405b>2008-05-07 18:35:52 +0000
commitce066688b52f871e08268dbc29dccb31ba4f796f (patch)
tree098becffa85120684dac46339211af4be26e64d1 /res
parenta11b2db3a8af83124f1f3b714009e8536a437246 (diff)
Merged revisions 115523 via svnmerge from
https://origsvn.digium.com/svn/asterisk/trunk ........ r115523 | russell | 2008-05-07 13:33:50 -0500 (Wed, 07 May 2008) | 6 lines Only save a password if a username exists. (closes issue #12600) Reported By: suretec Patch by me ........ git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.6.0@115524 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'res')
-rw-r--r--res/res_config_ldap.c13
1 files changed, 8 insertions, 5 deletions
diff --git a/res/res_config_ldap.c b/res/res_config_ldap.c
index 52855fdec..33ed247b7 100644
--- a/res/res_config_ldap.c
+++ b/res/res_config_ldap.c
@@ -1401,11 +1401,14 @@ int parse_config(void)
} else
ast_copy_string(user, s, sizeof(user));
- if (!(s = ast_variable_retrieve(config, "_general", "pass"))) {
- ast_log(LOG_WARNING, "No directory password found, using 'asterisk' as default.\n");
- ast_copy_string(pass, "asterisk", sizeof(pass) - 1);
- } else
- ast_copy_string(pass, s, sizeof(pass));
+ if (!ast_strlen_zero(user)) {
+ if (!(s = ast_variable_retrieve(config, "_general", "pass"))) {
+ ast_log(LOG_WARNING, "No directory password found, using 'asterisk' as default.\n");
+ ast_copy_string(pass, "asterisk", sizeof(pass));
+ } else {
+ ast_copy_string(pass, s, sizeof(pass));
+ }
+ }
/* URL is preferred, use host and port if not found */
if ((s = ast_variable_retrieve(config, "_general", "url"))) {