Patch for dialupadmin

Stephen Gran steve at lobefin.net
Wed Jun 21 01:17:54 CEST 2006


Hello all,

It looks like I am going to be doing some work with freeradius for Debian.
So, I just wanted to say hello, and send along a patch.  This fixes a bug
when the variable in question is actually NULL, rather than just empty.

Thanks,

--- dialup_admin/bin/clean_radacct
+++ dialup_admin/bin/clean_radacct
@@ -28,7 +28,7 @@
 die "sql_command directive is not set in admin.conf\n" if ($sqlcmd eq '');
 die "Could not find sql binary. Please make sure that the \$sqlcmd variable points to the right location\n" if (! -x $sqlcmd);

-$sql_password = ($sql_password eq '') ? '' : "-p$sql_password";
+$sql_password = (!$sql_password) ? '' : "-p$sql_password";

 ($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) = localtime;
 $date = POSIX::strftime("%Y-%m-%d %T",$sec,$min,$hour,($mday - $back_days),$mon,$year,$wday,$yday,$isdst);
--- dialup_admin/bin/log_badlogins
+++ dialup_admin/bin/log_badlogins
@@ -93,7 +93,7 @@

 $realm_del = '@' if ($realm_del eq '');
 $realm_for = 'suffix' if ($realm_for eq '');
-$pass = ($sql_password ne '') ? "-p$sql_password" : '';
+$pass = (!$sql_password) ? '' : "-p$sql_password";
 die "SQL server not defined\n" if ($sql_server eq '');

 die "sql_command directive is not set in admin.conf\n" if ($sqlcmd eq '');
--- dialup_admin/bin/truncate_radacct
+++ dialup_admin/bin/truncate_radacct
@@ -28,7 +28,7 @@
 die "sql_command directive is not set in admin.conf\n" if ($sqlcmd eq '');
 die "Could not find sql binary. Please make sure that the \$sqlcmd variable points to the right location\n" if (! -x $sqlcmd);

-$sql_password = ($sql_password eq '') ? '' : "-p$sql_password";
+$sql_password = (!$sql_password) ? '' : "-p$sql_password";

 ($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) = localtime;
 $date = POSIX::strftime("%Y-%m-%d %T",$sec,$min,$hour,($mday - $back_days),$mon,$year,$wday,$yday,$isdst);
--- dialup_admin/bin/monthly_tot_stats
+++ dialup_admin/bin/monthly_tot_stats
@@ -29,7 +29,7 @@
 die "sql_command directive is not set in admin.conf\n" if ($sqlcmd eq '');
 die "Could not find sql binary. Please make sure that the \$sqlcmd variable points to the right location\n" if (! -x $sqlcmd);

-$sql_password = ($sql_password == '') ? '' : "-p$sql_password";
+$sql_password = (!$sql_password) ? '' : "-p$sql_password";

 ($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) = localtime;
 if ($mday == 1){

-- 
 --------------------------------------------------------------------------
|  Stephen Gran                  | Why isn't there some cheap and easy way |
|  steve at lobefin.net             | to prove how much she means to me?      |
|  http://www.lobefin.net/~steve |                                         |
 --------------------------------------------------------------------------
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
URL: <http://lists.freeradius.org/pipermail/freeradius-devel/attachments/20060621/a9500e2b/attachment.pgp>


More information about the Freeradius-Devel mailing list