------------------------------------------------------------ revno: 13677 revision-id: squid3@treenet.co.nz-20141208083034-pweekwpa10iczrj6 parent: squid3@treenet.co.nz-20141208082930-ly0aovw3hjd5z78y committer: Amos Jeffries branch nick: 3.5 timestamp: Mon 2014-12-08 00:30:34 -0800 message: basic_db_auth: update man(8) documentation ------------------------------------------------------------ # Bazaar merge directive format 2 (Bazaar 0.90) # revision_id: squid3@treenet.co.nz-20141208083034-pweekwpa10iczrj6 # target_branch: http://bzr.squid-cache.org/bzr/squid3/3.5 # testament_sha1: daf2f43d58f26881ea96870229d66c15d75470cb # timestamp: 2014-12-08 08:51:09 +0000 # source_branch: http://bzr.squid-cache.org/bzr/squid3/3.5 # base_revision_id: squid3@treenet.co.nz-20141208082930-\ # ly0aovw3hjd5z78y # # Begin patch === modified file 'helpers/basic_auth/DB/Makefile.am' --- helpers/basic_auth/DB/Makefile.am 2014-09-02 01:08:58 +0000 +++ helpers/basic_auth/DB/Makefile.am 2014-12-08 08:30:34 +0000 @@ -7,7 +7,6 @@ include $(top_srcdir)/src/Common.am libexec_SCRIPTS = basic_db_auth -CLEANFILES += basic_db_auth basic_db_auth.8 man_MANS = basic_db_auth.8 EXTRA_DIST= \ basic_db_auth.8 \ @@ -20,3 +19,5 @@ basic_db_auth: basic_db_auth.pl.in $(subst_perlshell) + +CLEANFILES += basic_db_auth basic_db_auth.8 === modified file 'helpers/basic_auth/DB/basic_db_auth.pl.in' --- helpers/basic_auth/DB/basic_db_auth.pl.in 2014-09-02 01:08:58 +0000 +++ helpers/basic_auth/DB/basic_db_auth.pl.in 2014-12-08 08:30:34 +0000 @@ -1,99 +1,147 @@ #!@PERL@ + use strict; -use DBI; +use Pod::Usage; use Getopt::Long; -use Pod::Usage; -use Digest::MD5 qw(md5 md5_hex md5_base64); -$|=1; =pod =head1 NAME -basic_db_auth - Database auth helper for Squid - -=cut - -my $dsn = "DBI:mysql:database=squid"; -my $db_user = undef; -my $db_passwd = undef; -my $db_table = "passwd"; -my $db_usercol = "user"; -my $db_passwdcol = "password"; -my $db_cond = "enabled = 1"; -my $plaintext = 0; -my $md5 = 0; -my $persist = 0; -my $isjoomla = 0; -my $debug = 0; -my $hashsalt = undef; - -=pod + basic_db_auth - Database auth helper for Squid =head1 SYNOPSIS -basic_db_auth [options] + basic_db_auth [options] =head1 DESCRIPTOIN This program verifies username & password to a database -=over 8 - -=item B<--dsn> +=head1 OPTIONS + +=over 12 + +=item B<--debug> + +Write debug info to stderr. + +=item B<--dsn> Database DSN. Default "DBI:mysql:database=squid" -=item B<--user> +=item B<--user> Database User -=item B<--password> +=item B<--password> Database password -=item B<--table> +=item B<--table> Database table. Default "passwd". -=item B<--usercol> +=item B<--usercol> Username column. Default "user". -=item B<--passwdcol> +=item B<--passwdcol> Password column. Default "password". -=item B<--cond> +=item B<--cond> Condition, defaults to enabled=1. Specify 1 or "" for no condition If you use --joomla flag, this condition will be changed to block=0 -=item B<--plaintext> +=item B<--plaintext> Database contains plain-text passwords -=item B<--md5> +=item B<--md5> Database contains unsalted md5 passwords -=item B<--salt> +=item B<--salt> Selects the correct salt to evaluate passwords -=item B<--persist> +=item B<--persist> Keep a persistent database connection open between queries. -=item B<--joomla> +=item B<--joomla> Tells helper that user database is Joomla DB. So their unusual salt hashing is understood. =back +=head1 AUTHOR + +This program was written by +I> and +I> + +This manual was written by I> + +=head1 COPYRIGHT + + * Copyright (C) 1996-2014 The Squid Software Foundation and contributors + * + * Squid software is distributed under GPLv2+ license and includes + * contributions from numerous individuals and organizations. + * Please see the COPYING and CONTRIBUTORS files for details. + +Copyright (C) 2007 Henrik Nordstrom +Copyright (C) 2010 Luis Daniel Lucio Quiroz (Joomla support) +This program is free software. You may redistribute copies of it under the +terms of the GNU General Public License version 2, or (at youropinion) any +later version. + +=head1 QUESTIONS + +Questions on the usage of this program can be sent to the I> + +=head1 REPORTING BUGS + +Bug reports need to be made in English. +See http://wiki.squid-cache.org/SquidFaq/BugReporting for details of what you need to include with your bug report. + +Report bugs or bug fixes using http://bugs.squid-cache.org/ + +Report serious security bugs to I> + +Report ideas for new improvements to the I> + +=head1 SEE ALSO + +squid (8), GPL (7), + +The Squid FAQ wiki http://wiki.squid-cache.org/SquidFaq + +The Squid Configuration Manual http://www.squid-cache.org/Doc/config/ + =cut +use DBI; +use Digest::MD5 qw(md5 md5_hex md5_base64); + +my $dsn = "DBI:mysql:database=squid"; +my $db_user = undef; +my $db_passwd = undef; +my $db_table = "passwd"; +my $db_usercol = "user"; +my $db_passwdcol = "password"; +my $db_cond = "enabled = 1"; +my $plaintext = 0; +my $md5 = 0; +my $persist = 0; +my $isjoomla = 0; +my $debug = 0; +my $hashsalt = undef; + GetOptions( 'dsn=s' => \$dsn, 'user=s' => \$db_user, @@ -173,6 +221,7 @@ } my $status; +$|=1; while (<>) { my ($user, $password) = split; $status = "ERR"; @@ -190,21 +239,3 @@ close_db() if (!$persist); print $status . "\n"; } - -=pod - -=head1 COPYRIGHT - - * Copyright (C) 1996-2014 The Squid Software Foundation and contributors - * - * Squid software is distributed under GPLv2+ license and includes - * contributions from numerous individuals and organizations. - * Please see the COPYING and CONTRIBUTORS files for details. - -Copyright (C) 2007 Henrik Nordstrom -Copyright (C) 2010 Luis Daniel Lucio Quiroz (Joomla support) -This program is free software. You may redistribute copies of it under the -terms of the GNU General Public License version 2, or (at youropinion) any -later version. - -=cut