diff -Naurp squid-3.5.5/src/auth/basic_auth/DB/basic_db_auth.pl.in squid-3.5.5.dlucio/src/auth/basic_auth/DB/basic_db_auth.pl.in --- squid-3.5.5/src/auth/basic/DB/basic_db_auth.pl.in 2015-05-28 07:06:38.000000000 -0400 +++ squid-3.5.5.dlucio/src/auth/basic/DB/basic_db_auth.pl.in 2015-06-21 15:13:11.263044021 -0400 @@ -1,6 +1,6 @@ #!@PERL@ -use strict; +#use strict; use Pod::Usage; use Getopt::Long; @@ -76,6 +76,11 @@ Keep a persistent database connection op Tells helper that user database is Joomla DB. So their unusual salt hashing is understood. +=item B<--sql> + +Tells the helper that this query will be used. Remember to use ? +(question mark) in a sentence search username like: "WHERE user = ?" + =back =head1 AUTHOR @@ -141,6 +146,7 @@ my $persist = 0; my $isjoomla = 0; my $debug = 0; my $hashsalt = undef; +my $sql = undef; GetOptions( 'dsn=s' => \$dsn, @@ -156,6 +162,7 @@ GetOptions( 'joomla' => \$isjoomla, 'debug' => \$debug, 'salt=s' => \$hashsalt, + 'sql=s' => \$sql, ); my ($_dbh, $_sth); @@ -184,8 +191,15 @@ sub open_db() return undef; } my $sql_query; - $sql_query = "SELECT $db_passwdcol FROM $db_table WHERE $db_usercol = ?" . ($db_cond ne "" ? " AND $db_cond" : ""); + if (!defined $sql) { + $sql_query = "SELECT $db_passwdcol FROM $db_table WHERE $db_usercol = ?" . ($db_cond ne "" ? " AND $db_cond" : ""); + } + else{ + $sql_query = $sql; + } + $_sth = $_dbh->prepare($sql_query) || die; + return $_sth; }