From 40a7b94056b46e46962529ae2dd2bec909ef7d5c Mon Sep 17 00:00:00 2001 From: kkalev Date: Wed, 10 Mar 2004 14:29:32 +0000 Subject: [PATCH] Add a force directive in log_badlogins. If uncommented it will force inserts even if there are sql errors. That can help in case there is one sql query which stops the whole failed logins logging system from working --- dialup_admin/Changelog | 3 +++ dialup_admin/bin/log_badlogins | 7 +++++++ 2 files changed, 10 insertions(+) diff --git a/dialup_admin/Changelog b/dialup_admin/Changelog index 9479c2f..9f282a5 100644 --- a/dialup_admin/Changelog +++ b/dialup_admin/Changelog @@ -9,6 +9,9 @@ Ver 1.68: * Add a patch from Neil McCalden to not put spaces in the -p argument to the mysql binary. * Fix a bug in conf/config.php3. Patch from Neil McCalden * In log_badlogins add a newline after every sql query so that the resulting file can be editable +* Add a force directive in log_badlogins. If uncommented it will force inserts even if there are + sql errors. That can help in case there is one sql query which stops the whole failed logins + logging system from working Ver 1.65: * Add a captions.conf file with a few configurable captions for now * Move the nas list to a separate file called naslist.conf diff --git a/dialup_admin/bin/log_badlogins b/dialup_admin/bin/log_badlogins index 648b085..5301e12 100755 --- a/dialup_admin/bin/log_badlogins +++ b/dialup_admin/bin/log_badlogins @@ -20,6 +20,11 @@ $file=shift||'none'; $conf=shift||'/usr/local/dialup_admin/conf/admin.conf'; $all_file=shift||'no'; # +# Uncomment to force inserts even if there are sql errors. That can +# help in case there is one sql query which stops the whole failed +# logins logging system from working +#$force=1; +# # # CHANGE THESE TO MATCH YOUR SETUP # @@ -55,7 +60,9 @@ die "SQL server not defined\n" if ($sql_server eq ''); die "sql_command directive is not set in admin.conf\n" if ($mysql eq ''); die "Could not find mysql binary. Please make sure that the \$mysql variable points to the right location\n" if (! -x $mysql); +$opt = ""; $opt = "-O connect_timeout=$sql_timeout" if ($sql_timeout); +$opt .= " -f" if ($force); @servers = (split /\s+/,$sql_extra) if ($sql_extra ne ''); unshift @servers, $sql_server; -- 2.1.4