]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
Allow the same config file to be read twice
authorAlan T. DeKok <aland@freeradius.org>
Fri, 5 Jun 2015 18:28:58 +0000 (14:28 -0400)
committerAlan T. DeKok <aland@freeradius.org>
Fri, 5 Jun 2015 18:41:20 +0000 (14:41 -0400)
Because it's sometimes useful, and as an error, it rarely happens

src/main/conffile.c

index 08e69554a3fab2c9f53710e06baa6f7d92a6e671..4f7df2c389df5dab315bb1498ffb937ca54eb894 100644 (file)
@@ -339,11 +339,14 @@ static FILE *cf_file_open(CONF_SECTION *cs, char const *filename)
 #endif
        }
 
+       /*
+        *      We can include the same file twice.  e.g. when it
+        *      contains common definitions, such as for SQL.
+        *
+        *      Though the admin should really use templates for that.
+        */
        if (!rbtree_insert(tree, file)) {
-               ERROR("Cannot include the same file twice: \"%s\"", filename);
                talloc_free(file);
-               fclose(fp);
-               return NULL;
        }
 
        return fp;