Test for unset variable, rather than empty variable in
authornbk <nbk>
Thu, 22 Jun 2006 08:46:00 +0000 (08:46 +0000)
committernbk <nbk>
Thu, 22 Jun 2006 08:46:00 +0000 (08:46 +0000)
clean_radacct, monthly_tot_stats and truncate_radacct.
http://bugs.debian.org/374053

Thanks to Rudy Godoy <rudy@kernel-panik.org> and Stephen
Gran <sgran@debian.org>.

dialup_admin/Changelog
dialup_admin/bin/clean_radacct
dialup_admin/bin/log_badlogins
dialup_admin/bin/monthly_tot_stats
dialup_admin/bin/truncate_radacct

index af8c585..fef9d88 100644 (file)
@@ -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.
index 2dbd117..a2a1ef3 100755 (executable)
@@ -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);
index c88a400..b3bfbb4 100755 (executable)
@@ -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 '');
index 533cc98..79f1cba 100755 (executable)
@@ -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){
index 6df9e49..278b910 100755 (executable)
@@ -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);