From: Arran Cudbard-Bell Date: Wed, 27 Oct 2021 15:51:38 +0000 (-0400) Subject: radict should only load the specified protocol X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=fdc93c9ad6fa23774feb9718201154647ba2f5c9;p=thirdparty%2Ffreeradius-server.git radict should only load the specified protocol --- diff --git a/src/bin/radict.c b/src/bin/radict.c index e694a60ccb7..1d0b439e839 100644 --- a/src/bin/radict.c +++ b/src/bin/radict.c @@ -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;