summaryrefslogtreecommitdiff
path: root/res/res_config_ldap.c
diff options
context:
space:
mode:
authorzuul <zuul@gerrit.asterisk.org>2017-02-21 17:11:00 -0600
committerGerrit Code Review <gerrit2@gerrit.digium.api>2017-02-21 17:11:00 -0600
commitbed71b051620d6a8ccc6459185589c1fbb320e97 (patch)
tree7e65b8f9b4b2c3241c3ecc9b86a99020d64ba7c1 /res/res_config_ldap.c
parent49c3a3419be5a36c50d3f9bf31a171bc57ee4731 (diff)
parent9efe5d1cb3f95ecf6489eb04a1c36e7e319a5542 (diff)
Merge "res_config_ldap: Fix configuration inheritance from _general" into 14
Diffstat (limited to 'res/res_config_ldap.c')
-rw-r--r--res/res_config_ldap.c19
1 files changed, 18 insertions, 1 deletions
diff --git a/res/res_config_ldap.c b/res/res_config_ldap.c
index bfc959f1c..c7ff9da0f 100644
--- a/res/res_config_ldap.c
+++ b/res/res_config_ldap.c
@@ -1684,6 +1684,21 @@ static int reload(void)
return 0;
}
+static int config_can_be_inherited(const char *key)
+{
+ int i;
+ static const char * const config[] = {
+ "basedn", "host", "pass", "port", "protocol", "url", "user", "version", NULL
+ };
+
+ for (i = 0; config[i]; i++) {
+ if (!strcasecmp(key, config[i])) {
+ return 0;
+ }
+ }
+ return 1;
+}
+
/*! \brief parse the configuration file
*/
static int parse_config(void)
@@ -1774,7 +1789,9 @@ static int parse_config(void)
if (!strcasecmp(var->name, "additionalFilter")) {
table_config->additional_filter = ast_strdup(var->value);
} else {
- ldap_table_config_add_attribute(table_config, var->name, var->value);
+ if (!is_general || config_can_be_inherited(var->name)) {
+ ldap_table_config_add_attribute(table_config, var->name, var->value);
+ }
}
}
}