res_config_ldap: Remove extraneous line numbers from log messages

Extraneous line numbers were being output in many log messages. These
have been removed.

Change-Id: Ice9efa3d252ee87f37fa8f5ea852fda482675431
This commit is contained in:
Sean Bright
2017-02-20 06:49:17 -05:00
parent 011b7be62a
commit b980cae1f7

View File

@@ -192,7 +192,7 @@ static int semicolon_count_var(struct ast_variable *var)
return 0; return 0;
} }
ast_debug(2, "LINE(%d) semicolon_count_var: %s\n", __LINE__, var_value->value); ast_debug(2, "semicolon_count_var: %s\n", var_value->value);
return semicolon_count_str(var_value->value); return semicolon_count_str(var_value->value);
} }
@@ -332,7 +332,7 @@ static struct ast_variable *realtime_ldap_entry_to_var(struct ldap_table_config
for (v = values; *v; v++) { for (v = values; *v; v++) {
value = *v; value = *v;
valptr = value->bv_val; valptr = value->bv_val;
ast_debug(2, "LINE(%d) attribute_name: %s LDAP value: %s\n", __LINE__, attribute_name, valptr); ast_debug(2, "attribute_name: %s LDAP value: %s\n", attribute_name, valptr);
if (is_realmed_password_attribute) { if (is_realmed_password_attribute) {
if (!strncasecmp(valptr, "{md5}", 5)) { if (!strncasecmp(valptr, "{md5}", 5)) {
valptr += 5; valptr += 5;
@@ -469,7 +469,7 @@ static struct ast_variable **realtime_ldap_result_to_vars(struct ldap_table_conf
delim_value = ast_strdup(valptr); delim_value = ast_strdup(valptr);
if ((delim_tot_count = semicolon_count_str(delim_value)) > 0) { if ((delim_tot_count = semicolon_count_str(delim_value)) > 0) {
ast_debug(4, "LINE(%d) is delimited %d times: %s\n", __LINE__, delim_tot_count, delim_value); ast_debug(4, "is delimited %d times: %s\n", delim_tot_count, delim_value);
is_delimited = 1; is_delimited = 1;
} }
} }
@@ -479,11 +479,11 @@ static struct ast_variable **realtime_ldap_result_to_vars(struct ldap_table_conf
/* for non-Static RealTime, first */ /* for non-Static RealTime, first */
for (i = pos; !ast_strlen_zero(valptr + i); i++) { for (i = pos; !ast_strlen_zero(valptr + i); i++) {
ast_debug(4, "LINE(%d) DELIM pos: %d i: %d\n", __LINE__, pos, i); ast_debug(4, "DELIM pos: %d i: %d\n", pos, i);
if (delim_value[i] == ';') { if (delim_value[i] == ';') {
delim_value[i] = '\0'; delim_value[i] = '\0';
ast_debug(2, "LINE(%d) DELIM - attribute_name: %s value: %s pos: %d\n", __LINE__, attribute_name, &delim_value[pos], pos); ast_debug(2, "DELIM - attribute_name: %s value: %s pos: %d\n", attribute_name, &delim_value[pos], pos);
if (prev) { if (prev) {
prev->next = ast_variable_new(attribute_name, &delim_value[pos], table_config->table_name); prev->next = ast_variable_new(attribute_name, &delim_value[pos], table_config->table_name);
@@ -501,9 +501,9 @@ static struct ast_variable **realtime_ldap_result_to_vars(struct ldap_table_conf
} }
} }
if (ast_strlen_zero(valptr + i)) { if (ast_strlen_zero(valptr + i)) {
ast_debug(4, "LINE(%d) DELIM pos: %d i: %d delim_count: %d\n", __LINE__, pos, i, delim_count); ast_debug(4, "DELIM pos: %d i: %d delim_count: %d\n", pos, i, delim_count);
/* Last delimited value */ /* Last delimited value */
ast_debug(4, "LINE(%d) DELIM - attribute_name: %s value: %s pos: %d\n", __LINE__, attribute_name, &delim_value[pos], pos); ast_debug(4, "DELIM - attribute_name: %s value: %s pos: %d\n", attribute_name, &delim_value[pos], pos);
if (prev) { if (prev) {
prev->next = ast_variable_new(attribute_name, &delim_value[pos], table_config->table_name); prev->next = ast_variable_new(attribute_name, &delim_value[pos], table_config->table_name);
if (prev->next) { if (prev->next) {
@@ -519,14 +519,14 @@ static struct ast_variable **realtime_ldap_result_to_vars(struct ldap_table_conf
ast_free(delim_value); ast_free(delim_value);
delim_value = NULL; delim_value = NULL;
ast_debug(4, "LINE(%d) DELIM pos: %d i: %d\n", __LINE__, pos, i); ast_debug(4, "DELIM pos: %d i: %d\n", pos, i);
} else { } else {
/* not delimited */ /* not delimited */
if (delim_value) { if (delim_value) {
ast_free(delim_value); ast_free(delim_value);
delim_value = NULL; delim_value = NULL;
} }
ast_debug(2, "LINE(%d) attribute_name: %s value: %s\n", __LINE__, attribute_name, valptr); ast_debug(2, "attribute_name: %s value: %s\n", attribute_name, valptr);
if (prev) { if (prev) {
prev->next = ast_variable_new(attribute_name, valptr, table_config->table_name); prev->next = ast_variable_new(attribute_name, valptr, table_config->table_name);
@@ -550,7 +550,7 @@ static struct ast_variable **realtime_ldap_result_to_vars(struct ldap_table_conf
const struct ast_variable *tmpdebug = variable_named(var, "variable_name"); const struct ast_variable *tmpdebug = variable_named(var, "variable_name");
const struct ast_variable *tmpdebug2 = variable_named(var, "variable_value"); const struct ast_variable *tmpdebug2 = variable_named(var, "variable_value");
if (tmpdebug && tmpdebug2) { if (tmpdebug && tmpdebug2) {
ast_debug(3, "LINE(%d) Added to vars - %s = %s\n", __LINE__, tmpdebug->value, tmpdebug2->value); ast_debug(3, "Added to vars - %s = %s\n", tmpdebug->value, tmpdebug2->value);
} }
} }
vars[entry_index++] = var; vars[entry_index++] = var;
@@ -561,7 +561,7 @@ static struct ast_variable **realtime_ldap_result_to_vars(struct ldap_table_conf
} while (delim_count <= delim_tot_count && static_table_config == table_config); } while (delim_count <= delim_tot_count && static_table_config == table_config);
if (static_table_config != table_config) { if (static_table_config != table_config) {
ast_debug(3, "LINE(%d) Added to vars - non static\n", __LINE__); ast_debug(3, "Added to vars - non static\n");
vars[entry_index++] = var; vars[entry_index++] = var;
prev = NULL; prev = NULL;
@@ -1246,7 +1246,7 @@ static int update_ldap(const char *basedn, const char *table_name, const char *a
} }
if (!attribute || !lookup) { if (!attribute || !lookup) {
ast_log(LOG_WARNING, "LINE(%d): search parameters are empty.\n", __LINE__); ast_log(LOG_WARNING, "Search parameters are empty.\n");
return -1; return -1;
} }
ast_mutex_lock(&ldap_lock); ast_mutex_lock(&ldap_lock);
@@ -1282,7 +1282,7 @@ static int update_ldap(const char *basedn, const char *table_name, const char *a
* one parameter/value pair and delimit them with a semicolon */ * one parameter/value pair and delimit them with a semicolon */
newparam = convert_attribute_name_to_ldap(table_config, field->name); newparam = convert_attribute_name_to_ldap(table_config, field->name);
if (!newparam) { if (!newparam) {
ast_log(LOG_WARNING, "LINE(%d): need at least one parameter to modify.\n", __LINE__); ast_log(LOG_WARNING, "Need at least one parameter to modify.\n");
return -1; return -1;
} }
@@ -1368,12 +1368,12 @@ static int update_ldap(const char *basedn, const char *table_name, const char *a
} }
/* Ready to update */ /* Ready to update */
if ((num_entries = ldap_count_entries(ldapConn, ldap_result_msg)) > 0) { if ((num_entries = ldap_count_entries(ldapConn, ldap_result_msg)) > 0) {
ast_debug(3, "LINE(%d) Modifying %s=%s hits: %d\n", __LINE__, attribute, lookup, num_entries); ast_debug(3, "Modifying %s=%s hits: %d\n", attribute, lookup, num_entries);
for (i = 0; option_debug > 2 && i < mods_size - 1; i++) { for (i = 0; option_debug > 2 && i < mods_size - 1; i++) {
if (ldap_mods[i]->mod_op != LDAP_MOD_DELETE) { if (ldap_mods[i]->mod_op != LDAP_MOD_DELETE) {
ast_debug(3, "LINE(%d) %s=%s \n", __LINE__, ldap_mods[i]->mod_type, ldap_mods[i]->mod_values[0]); ast_debug(3, "%s=%s\n", ldap_mods[i]->mod_type, ldap_mods[i]->mod_values[0]);
} else { } else {
ast_debug(3, "LINE(%d) deleting %s \n", __LINE__, ldap_mods[i]->mod_type); ast_debug(3, "deleting %s\n", ldap_mods[i]->mod_type);
} }
} }
ldap_entry = ldap_first_entry(ldapConn, ldap_result_msg); ldap_entry = ldap_first_entry(ldapConn, ldap_result_msg);
@@ -1466,7 +1466,7 @@ static int update2_ldap(const char *basedn, const char *table_name, const struct
field = update_fields; field = update_fields;
newparam = convert_attribute_name_to_ldap(table_config, field->name); newparam = convert_attribute_name_to_ldap(table_config, field->name);
if (!newparam) { if (!newparam) {
ast_log(LOG_WARNING, "LINE(%d): need at least one parameter to modify.\n", __LINE__); ast_log(LOG_WARNING, "Need at least one parameter to modify.\n");
ast_free(filter); ast_free(filter);
ast_free(clean_basedn); ast_free(clean_basedn);
return -1; return -1;
@@ -1546,7 +1546,7 @@ static int update2_ldap(const char *basedn, const char *table_name, const struct
/* Ready to update */ /* Ready to update */
if ((num_entries = ldap_count_entries(ldapConn, ldap_result_msg)) > 0) { if ((num_entries = ldap_count_entries(ldapConn, ldap_result_msg)) > 0) {
for (i = 0; option_debug > 2 && i < mods_size - 1; i++) { for (i = 0; option_debug > 2 && i < mods_size - 1; i++) {
ast_debug(3, "LINE(%d) %s=%s \n", __LINE__, ldap_mods[i]->mod_type, ldap_mods[i]->mod_values[0]); ast_debug(3, "%s=%s\n", ldap_mods[i]->mod_type, ldap_mods[i]->mod_values[0]);
} }
ldap_entry = ldap_first_entry(ldapConn, ldap_result_msg); ldap_entry = ldap_first_entry(ldapConn, ldap_result_msg);