]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
Allow hints && huntgroup files to be NULL
authorAlan T. DeKok <aland@freeradius.org>
Tue, 11 Jan 2011 08:54:40 +0000 (09:54 +0100)
committerAlan T. DeKok <aland@freeradius.org>
Tue, 11 Jan 2011 08:54:40 +0000 (09:54 +0100)
src/modules/rlm_preprocess/rlm_preprocess.c

index 34acc5620a1858ed5cbfc7b9b5c807c1a331970a..6a866ee5df580192f111dd9c4b45895aa16c7141 100644 (file)
@@ -483,21 +483,26 @@ static int preprocess_instantiate(CONF_SECTION *conf, void **instance)
        /*
         *      Read the huntgroups file.
         */
-       rcode = pairlist_read(data->huntgroup_file, &(data->huntgroups), 0);
-       if (rcode < 0) {
-               radlog(L_ERR|L_CONS, "rlm_preprocess: Error reading %s",
-                      data->huntgroup_file);
-               return -1;
+       if (data->huntgroup_file) {
+               rcode = pairlist_read(data->huntgroup_file,
+                                     &(data->huntgroups), 0);
+               if (rcode < 0) {
+                       radlog(L_ERR|L_CONS, "rlm_preprocess: Error reading %s",
+                              data->huntgroup_file);
+                       return -1;
+               }
        }
 
        /*
         *      Read the hints file.
         */
-       rcode = pairlist_read(data->hints_file, &(data->hints), 0);
-       if (rcode < 0) {
-               radlog(L_ERR|L_CONS, "rlm_preprocess: Error reading %s",
-                      data->hints_file);
-               return -1;
+       if (data->hints_file) {
+               rcode = pairlist_read(data->hints_file, &(data->hints), 0);
+               if (rcode < 0) {
+                       radlog(L_ERR|L_CONS, "rlm_preprocess: Error reading %s",
+                              data->hints_file);
+                       return -1;
+               }
        }
 
        /*