Move "authorize", etc. into a default server{} block.
authoraland <aland>
Fri, 29 Jun 2007 09:31:04 +0000 (09:31 +0000)
committeraland <aland>
Fri, 29 Jun 2007 09:31:04 +0000 (09:31 +0000)
raddb/sites-available/default
src/main/listen.c
src/main/modules.c

index d614ecb..23e4a80 100644 (file)
 #
 ######################################################################
 
+#
+#      In 1.x, the "authorize", etc. sections were global in
+#      radiusd.conf.  As of 2.0, they MUST be in a server section.
+#
+#      The server section with no virtual server name is the "default"
+#      section.  It is used when no server name is specified.
+#
+#      We don't indent the rest of this file, because doing so
+#      would make it harder to read.
+#
+server {
+
 #  Authorization. First preprocess (hints and huntgroups files),
 #  then realms, and finally look in the "users" file.
 #
@@ -147,7 +159,6 @@ authorize {
        #
        pap
 
-
        #
        #  If "status_server = yes", then Status-Server messages are passed
        #  through the following section, and ONLY the following section.
@@ -452,3 +463,5 @@ post-proxy {
 #      }
 
 }
+
+} # default server block
index 63a9275..e87457e 100644 (file)
@@ -295,19 +295,17 @@ static int common_socket_parse(CONF_SECTION *cs, rad_listen_t *this)
         *      directive, UNLESS there are no clients in the server.
         */
        client_cs = NULL;
-       if (this->server) {
-               client_cs = cf_section_sub_find_name2(mainconfig.config,
-                                                     "server",
-                                                     this->server);
-
-               /*
-                *      Found a "server foo" section, but there are no
-                *      clients in it.  Don't use this section.
-                */
-               if (client_cs &&
-                   (cf_section_sub_find(client_cs, "client") == NULL)) {
-                       client_cs = NULL;
-               }
+       client_cs = cf_section_sub_find_name2(mainconfig.config,
+                                             "server",
+                                             this->server);
+       
+       /*
+        *      Found a "server foo" section, but there are no
+        *      clients in it.  Don't use this section.
+        */
+       if (client_cs &&
+           (cf_section_sub_find(client_cs, "client") == NULL)) {
+               client_cs = NULL;
        }
 
        /*
index 5dd1252..a123556 100644 (file)
@@ -931,17 +931,17 @@ int setup_modules(int reload, CONF_SECTION *config)
             cs = cf_subsection_find_next(config, cs, "server")) {
                const char *name2 = cf_section_name2(cs);
 
-               DEBUG2("server %s {", name2);
+               if (name2) {
+                       DEBUG2("server %s {", name2);
+               } else {
+                       DEBUG2("server {");
+               }
                if (load_byspace(cs, name2, do_component) < 0) {
                        DEBUG2("}");
                        return -1;
                }
                DEBUG2("}");
        }
-               
-       if (load_byspace(config, NULL, do_component) < 0) {
-               return -1;
-       }
 
        return 0;
 }