]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
Minor fixes
authorArran Cudbard-Bell <a.cudbardb@freeradius.org>
Tue, 13 Jun 2017 14:26:17 +0000 (10:26 -0400)
committerArran Cudbard-Bell <a.cudbardb@freeradius.org>
Tue, 13 Jun 2017 14:26:17 +0000 (10:26 -0400)
src/main/client.c
src/main/conf_file.c
src/modules/proto_ldap_sync/proto_ldap_sync.c

index 6a9cdb2a095575784df7a5baa93e0c06ef2a1824..20f13dfa320fe4efc116f81b1857da6850defd44 100644 (file)
@@ -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;
index cdb5af6a37308e114cb332b68642f2fbfb4154e6..73ba5faf5a951aec5afee4721fca73249713893d 100644 (file)
@@ -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
index 12d7e98193d9f41ac61b24c46174986087ad456b..b0c450aa96766469b2d1147145b6275dc5aebf0f 100644 (file)
@@ -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;