diff options
author | ivan <ivan> | 2003-10-02 08:56:54 +0000 |
---|---|---|
committer | ivan <ivan> | 2003-10-02 08:56:54 +0000 |
commit | 3a24db8efd975633e5c4146fe1e90e6eda7c0d5f (patch) | |
tree | 4aaebb796c5ded6d0f54c6bd440cf50b599eb324 /bin/generate-raddb | |
parent | c1dfeada58be61ec33bb1cfb80a2cff73f7c9a3c (diff) |
update with dictionaries from freeradius 0.9.1, and fix generate-raddb
to avoid duplicates
Diffstat (limited to 'bin/generate-raddb')
-rwxr-xr-x | bin/generate-raddb | 18 |
1 files changed, 14 insertions, 4 deletions
diff --git a/bin/generate-raddb b/bin/generate-raddb index 1d0053a2b..f946b05b3 100755 --- a/bin/generate-raddb +++ b/bin/generate-raddb @@ -13,10 +13,18 @@ END while (<>) { next if /^(#|\s*$|\$INCLUDE\s+)/; next if /^(VALUE|VENDOR|BEGIN\-VENDOR|END\-VENDOR)\s+/; - /^(ATTRIBUTE|ATTRIB_NMC)\s+([\w\-]+)\s+/ or die $_; + /^(ATTRIBUTE|ATTRIB_NMC)\s+([\w\-\/]+)\s+/ or die $_; $attrib = $2; $dbname = lc($2); - $dbname =~ s/\-/_/g; + $dbname =~ s/[\-\/]/_/g; + $dbname = substr($dbname,0,24); + while ( exists $hash{$dbname} ) { + #warn $dbname; + $dbname =~ s/(.)$//; + my $w = $1; + $w =~ tr/_a-z0-9/a-z0-9_/; + $dbname = "$dbname$w"; + } $hash{$dbname} = $attrib; #print "$2\n"; } @@ -25,8 +33,10 @@ foreach ( keys %hash ) { # print "$_\n" if length($_)>24; # print substr($_,0,24),"\n" if length($_)>24; # $max = length($_) if length($_)>$max; -#everything >24 is still unique, at least with freeradius comprehensive dataset - print " '". substr($_,0,24). "' => '$hash{$_}',\n"; +# have to fudge things since everything >24 is *not* unique + + #print " '". substr($_,0,24). "' => '$hash{$_}',\n"; + print " '$_' => '$hash{$_}',\n"; } print <<END; |