]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
radict should only load the specified protocol
authorArran Cudbard-Bell <a.cudbardb@freeradius.org>
Wed, 27 Oct 2021 15:51:38 +0000 (11:51 -0400)
committerArran Cudbard-Bell <a.cudbardb@freeradius.org>
Wed, 27 Oct 2021 16:16:15 +0000 (12:16 -0400)
src/bin/radict.c

index e694a60ccb7c307b7337e1534a480b7582208272..1d0b439e83921f4900a62c8a8f8d45d4c3f38806 100644 (file)
@@ -62,7 +62,7 @@ static void usage(void)
        fprintf(stderr, "Very simple interface to extract attribute definitions from FreeRADIUS dictionaries\n");
 }
 
-static int load_dicts(char const *dict_dir)
+static int load_dicts(char const *dict_dir, char const *protocol)
 {
        DIR             *dir;
        struct dirent   *dp;
@@ -81,6 +81,11 @@ static int load_dicts(char const *dict_dir)
 
                if (dp->d_name[0] == '.') continue;
 
+               /*
+                *      We only want to load one...
+                */
+               if (protocol && (strcmp(dp->d_name, protocol) != 0)) continue;
+
                /*
                 *      Skip the internal FreeRADIUS dictionary.
                 */
@@ -322,7 +327,7 @@ int main(int argc, char *argv[])
                goto finish;
        }
 
-       if (load_dicts(dict_dir) < 0) {
+       if (load_dicts(dict_dir, protocol) < 0) {
                fr_perror("radict");
                ret = 1;
                goto finish;