From: Arran Cudbard-Bell Date: Tue, 13 Jun 2017 14:26:17 +0000 (-0400) Subject: Minor fixes X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b59ddc7998ee9c547adffc527945803cc4effbd2;p=thirdparty%2Ffreeradius-server.git Minor fixes --- diff --git a/src/main/client.c b/src/main/client.c index 6a9cdb2a095..20f13dfa320 100644 --- a/src/main/client.c +++ b/src/main/client.c @@ -244,7 +244,7 @@ bool client_add(RADCLIENT_LIST *clients, RADCLIENT *client) return false; } - if (cf_data_add(cs, clients, NULL, true) < 0) { + if (!cf_data_add(cs, clients, NULL, true)) { ERROR("Failed to associate clients with virtual server %s", client->server); talloc_free(clients); return false; @@ -662,7 +662,7 @@ RADCLIENT_LIST *client_list_parse_section(CONF_SECTION *section, UNUSED bool tls /* * Associate the clients structure with the section. */ - if (cf_data_add(section, clients, NULL, false) < 0) { + if (!cf_data_add(section, clients, NULL, false)) { cf_log_err(section, "Failed to associate clients with section %s", cf_section_name1(section)); talloc_free(clients); return NULL; @@ -1490,7 +1490,7 @@ RADCLIENT *client_read(char const *filename, CONF_SECTION *server_cs, bool check return NULL; } - cs = cf_section_find(cs, "client", NULL); + cs = cf_section_find(cs, "client", CF_IDENT_ANY); if (!cs) { ERROR("No \"client\" section found in client file"); return NULL; diff --git a/src/main/conf_file.c b/src/main/conf_file.c index cdb5af6a373..73ba5faf5a9 100644 --- a/src/main/conf_file.c +++ b/src/main/conf_file.c @@ -2123,8 +2123,6 @@ static inline int fr_item_validate_ipaddr(CONF_SECTION *cs, char const *name, fr } } - - /** Parses a #CONF_PAIR into a C data type * * @copybrief cf_pair_value @@ -3516,6 +3514,7 @@ static CONF_ITEM *cf_find(CONF_ITEM const *parent, CONF_ITEM_TYPE type, char con /** Return the next child that's of the specified type with the specified identifiers * * @param[in] parent The section we're searching in. + * @param[in] prev item we found, or NULL to start from the beginning. * @param[in] type of #CONF_ITEM we're searching for. * @param[in] ident1 The first identifier. * @param[in] ident2 The second identifier. Special value CF_IDENT_ANY diff --git a/src/modules/proto_ldap_sync/proto_ldap_sync.c b/src/modules/proto_ldap_sync/proto_ldap_sync.c index 12d7e98193d..b0c450aa967 100644 --- a/src/modules/proto_ldap_sync/proto_ldap_sync.c +++ b/src/modules/proto_ldap_sync/proto_ldap_sync.c @@ -1084,13 +1084,14 @@ static int proto_ldap_socket_parse(CONF_SECTION *cs, rad_listen_t *listen) scope = fr_str2int(fr_ldap_scope, inst->sync_config[i]->scope_str, -1); if (scope < 0) { - cf_log_err(cs, "Invalid 'user.scope' value \"%s\", expected 'sub', 'one'" #ifdef LDAP_SCOPE_CHILDREN - ", 'base' or 'children'" + cf_log_err(cs, "Invalid 'user.scope' value \"%s\", expected 'sub', 'one'" + ", 'base' or 'children'", inst->sync_config[i]->scope_str); #else - " or 'base'" + cf_log_err(cs, "Invalid 'user.scope' value \"%s\", expected 'sub', 'one'" + " or 'base'", inst->sync_config[i]->scope_str) #endif - , inst->sync_config[i]->scope_str); + ); return -1; } inst->sync_config[i]->scope = scope;