]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
Initialize xlats before reading the config
authorAlan T. DeKok <aland@freeradius.org>
Mon, 5 Jan 2015 16:56:22 +0000 (11:56 -0500)
committerAlan T. DeKok <aland@freeradius.org>
Mon, 5 Jan 2015 16:56:42 +0000 (11:56 -0500)
src/main/unittest.c

index 906ac6d2f2546a9b98a4fda84725b5886734c11c..486bc5e44f27ae536a422f2cb0822afadb29cc2f 100644 (file)
@@ -388,7 +388,6 @@ static void print_packet(FILE *fp, RADIUS_PACKET *packet)
 
 #include <freeradius-devel/modpriv.h>
 
-
 /*
  *     %{poke:sql.foo=bar}
  */
@@ -623,6 +622,11 @@ int main(int argc, char *argv[])
                exit(EXIT_FAILURE);
        }
 
+       if (xlat_register("poke", xlat_poke, NULL, NULL) < 0) {
+               rcode = EXIT_FAILURE;
+               goto finish;
+       }
+
        /*  Read the configuration files, BEFORE doing anything else.  */
        if (main_config_init() < 0) {
                rcode = EXIT_FAILURE;
@@ -637,11 +641,6 @@ int main(int argc, char *argv[])
                goto finish;
        }
 
-       if (xlat_register("poke", xlat_poke, NULL, NULL) < 0) {
-               rcode = EXIT_FAILURE;
-               goto finish;
-       }
-
        fr_state_init();
 
        /* Set the panic action (if required) */