mirror of
https://github.com/asterisk/asterisk.git
synced 2025-11-01 11:32:25 +00:00
Only save a password if a username exists.
(closes issue #12600) Reported By: suretec Patch by me git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@115523 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
@@ -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"))) {
|
||||
|
||||
Reference in New Issue
Block a user