From: nbk Date: Thu, 22 Jun 2006 08:46:00 +0000 (+0000) Subject: Test for unset variable, rather than empty variable in X-Git-Tag: release_1_1_3~62 X-Git-Url: http://www.project-moonshot.org/gitweb/?p=freeradius.git;a=commitdiff_plain;h=c99e6e3baa153005b50fa1c931bb27fcfe1b33a5 Test for unset variable, rather than empty variable in clean_radacct, monthly_tot_stats and truncate_radacct. http://bugs.debian.org/374053 Thanks to Rudy Godoy and Stephen Gran . --- diff --git a/dialup_admin/Changelog b/dialup_admin/Changelog index af8c585..fef9d88 100644 --- a/dialup_admin/Changelog +++ b/dialup_admin/Changelog @@ -1,3 +1,7 @@ +Ver 1.70.3: +* Test for unset variable, rather than empty variable in clean_radacct, + monthly_tot_stats and truncate_radacct. + Ver 1.70.2: * Fix redirects in dialup-admin pages on servers with register_globals turned off. diff --git a/dialup_admin/bin/clean_radacct b/dialup_admin/bin/clean_radacct index 2dbd117..a2a1ef3 100755 --- a/dialup_admin/bin/clean_radacct +++ b/dialup_admin/bin/clean_radacct @@ -28,7 +28,7 @@ close CONF; 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); diff --git a/dialup_admin/bin/log_badlogins b/dialup_admin/bin/log_badlogins index c88a400..b3bfbb4 100755 --- a/dialup_admin/bin/log_badlogins +++ b/dialup_admin/bin/log_badlogins @@ -93,7 +93,7 @@ close CLIENTS; $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 ''); diff --git a/dialup_admin/bin/monthly_tot_stats b/dialup_admin/bin/monthly_tot_stats index 533cc98..79f1cba 100755 --- a/dialup_admin/bin/monthly_tot_stats +++ b/dialup_admin/bin/monthly_tot_stats @@ -29,7 +29,7 @@ close CONF; 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){ diff --git a/dialup_admin/bin/truncate_radacct b/dialup_admin/bin/truncate_radacct index 6df9e49..278b910 100755 --- a/dialup_admin/bin/truncate_radacct +++ b/dialup_admin/bin/truncate_radacct @@ -28,7 +28,7 @@ close CONF; 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);