From: kkalev Date: Wed, 12 Mar 2003 16:26:15 +0000 (+0000) Subject: Also add support for @ in usernames in log_badlogins X-Git-Url: https://git.entuzijast.net/?a=commitdiff_plain;h=bd0a7348d0698d0d20846577b7b363bcc3ba78ec;p=freeradius-dialup-admin.git Also add support for @ in usernames in log_badlogins --- diff --git a/Changelog b/Changelog index d6bfcba..5d022ae 100644 --- a/Changelog +++ b/Changelog @@ -59,6 +59,7 @@ Ver 1.62: * Add a few comments in the tot_stats and monthly_tot_stats scripts * Add support for ! in usernames in log_badlogins * Call gethostbyaddr with an @ in front to suppress error messages +* Also add support for @ in usernames in log_badlogins Ver 1.61: * Add a string encoder for greek * If general_decode_normal_attributes is set then encode attributes in lib/ldap/change_info. In the near future diff --git a/bin/log_badlogins b/bin/log_badlogins index 6629669..3f69158 100755 --- a/bin/log_badlogins +++ b/bin/log_badlogins @@ -95,16 +95,16 @@ for(;;){ ($year,$mon,$mday,$hour,$min,$sec)=UnixDate($date2,'%Y','%m','%d','%H','%M','%S'); } $time = "$year-$mon-$mday $hour:$min:$sec"; - if (/\[([\w\-\.\!]+?)\]\s+\(from (.+?)\)/){ + if (/\[([\w\-\.\!\@]+?)\]\s+\(from (.+?)\)/){ $user = $1; ($nas,$port,$caller) = (split /\s+/,$2)[1,3,5]; } - elsif (/\[([\w\-\.\!]+?)\/.+?\]\s+\(from (.+?)\)/){ + elsif (/\[([\w\-\.\!\@]+?)\/.+?\]\s+\(from (.+?)\)/){ $user = $1; ($nas,$port,$caller) = (split /\s+/,$2)[1,3,5]; } $caller='' if (!defined($caller)); - $user =~s/[^\w\-\.\d\!]//g; + $user =~s/[^\w\-\.\d\!\@]//g; $nas =~s/[^\w\.]//g; if ($nas ne 'localhost' && $nas !~ /\.$domain$/){ $nas .= ".$domain";