credentials (that way there can be more than one administrator usernames, each with different privileges
on the sql database).
* Add more error messages when interacting with the SQL database
+* Add sql_connect_timeout and sql_extra_servers configuration directives to be used by the log_badlogins script
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
$realm_strip = $val if ($key eq 'general_strip_realms');
$realm_del = $val if ($key eq 'general_realm_delimiter');
$realm_for = $val if ($key eq 'general_realm_format');
+ $sql_timeout = $val if ($key eq 'sql_connect_timeout');
+ $sql_extra = $val if ($key eq 'sql_extra_servers');
}
close CONF;
$realm_del = '@' if ($realm_del eq '');
$realm_for = 'suffix' if ($realm_for eq '');
$pass = ($sql_password ne '') ? "-p$sql_password" : '';
+$opt = "-O connect_timeout=$sql_timeout" if ($sql_timeout);
+@extras = (split /\s+/,$sql_extra) if ($sql_extra ne '');
+
open LOG, "<$file"
or die "Could not open file $file\n";
or die "Could not open temporary file\n";
print TMP "INSERT INTO $sql_accounting_table (UserName,NASIPAddress,NASPortId,AcctStartTime,AcctStopTime,AcctSessionTime,AcctInputOctets,AcctOutputOctets,CallingStationId,AcctTerminateCause) VALUES ('$user','$addr','$port','$time','$time','0','0','0','$caller','$cause');";
close TMP;
- `$mysql -h$sql_server -u$sql_username $pass $sql_database <$tmpfile`;
+ `$mysql -h$sql_server $opt -u$sql_username $pass $sql_database <$tmpfile`;
+ foreach $extra (@extras){
+ `$mysql -h$extra $opt -u$sql_username $pass $sql_database <$tmpfile`;
+ }
}
}
}
# don't return too many results
#
sql_row_limit: 40
+#
+# These options are used by the log_badlogins script
+#
+# Set the sql connect timeout (secs)
+sql_connect_timeout: 3
+# Give a space separated list of extra mysql servers to connect to when
+# logging bad logins
+#sql_extra_servers: sql2.company.com sql3.company.com
counter_default_daily: 14400
counter_default_weekly: 72000