From: Amos Jeffries Date: Sat, 2 Jan 2010 12:06:08 +0000 (+1300) Subject: Basic Authentication Helper name upgrades X-Git-Tag: SQUID_3_2_0_1~479 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=5a48ed18b5610e3e2d3d5250797375f4fb93dc1e;p=thirdparty%2Fsquid.git Basic Authentication Helper name upgrades This nearly completes renaming and C++ compiling of the basic auth helpers. MSNT is still pending cleanup in it's smb library code. TODO: other helper types updated. --- diff --git a/configure.in b/configure.in index cdde491f5e..303f458635 100644 --- a/configure.in +++ b/configure.in @@ -4284,19 +4284,19 @@ AC_CONFIG_FILES([\ doc/manuals/Makefile \ helpers/Makefile \ helpers/basic_auth/Makefile \ + helpers/basic_auth/DB/Makefile \ + helpers/basic_auth/getpwnam/Makefile \ helpers/basic_auth/LDAP/Makefile \ helpers/basic_auth/MSNT/Makefile \ + helpers/basic_auth/MSNT-multi-domain/Makefile \ helpers/basic_auth/NCSA/Makefile \ + helpers/basic_auth/NIS/Makefile \ helpers/basic_auth/PAM/Makefile \ - helpers/basic_auth/SMB/Makefile \ - helpers/basic_auth/mswin_sspi/Makefile \ - helpers/basic_auth/YP/Makefile \ - helpers/basic_auth/getpwnam/Makefile \ - helpers/basic_auth/multi-domain-NTLM/Makefile \ - helpers/basic_auth/SASL/Makefile \ helpers/basic_auth/POP3/Makefile \ - helpers/basic_auth/DB/Makefile \ - helpers/basic_auth/squid_radius_auth/Makefile \ + helpers/basic_auth/RADIUS/Makefile \ + helpers/basic_auth/SASL/Makefile \ + helpers/basic_auth/SMB/Makefile \ + helpers/basic_auth/SSPI/Makefile \ helpers/digest_auth/Makefile \ helpers/digest_auth/password/Makefile \ helpers/digest_auth/ldap/Makefile \ diff --git a/doc/release-notes/release-3.2.html b/doc/release-notes/release-3.2.html index f6cc73d6f8..f1c7e741bc 100644 --- a/doc/release-notes/release-3.2.html +++ b/doc/release-notes/release-3.2.html @@ -151,7 +151,8 @@ the reduction in direct helper spawned by Squid can result in a great reduction

To improve the understanding of what each helper does and where it should be used the helper binaries which are bundled with Squid have undergone a naming change in this release.

-

Below is a list of the old helper names and what their names have changed to.

+

Below is a list of the old helper names and what their names have changed to. +For several helpers the directory name used in --enable-X-helpers configure option has also changed.

Basic Authentication protocol helpers

@@ -161,6 +162,14 @@ which are bundled with Squid have undergone a naming change in this release.

  • getpwnam_auth - basic_getpwname_auth - Authenticate with local system user accounts.
  • squid_ldap_auth - basic_ldap_auth - Authenticate with LDAP user accounts.
  • ncsa_auth - basic_ncsa_auth - Authenticate with NCSA httpd-style password file.
  • +
  • pam_auth - basic_pam_auth - Authenticate with the system PAM infrastructure.
  • +
  • pop3.pl - basic_pop3_auth.pl - Authenticate with a mail server POP3/SMTP credentials
  • +
  • squid_sasl_auth - basic_sasl_auth - Authenticate with SASL ???
  • +
  • smb_auth - basic_smb_auth - Authenticate with Samba SMB ???
  • +
  • yp_auth - basic_nis_auth - Authenticate with NIS security system.
  • +
  • mswin_sspi - basic_sspi_auth - Authenticate with a Windows Domain Controller using SSPI.
  • +
  • MSNT-muti-domain - basic_msnt_multi_domain_auth.pl - Authenticate with any one of multiple Windows Domain Controllers.
  • +
  • squid_radius_auth - basic_radius_auth - Authenticate with RADIUS.
  • @@ -238,7 +247,6 @@ This move begins the Localization of the internal administrator facing manuals.<

    -

    3.1 New tags

    diff --git a/doc/release-notes/release-3.2.sgml b/doc/release-notes/release-3.2.sgml index c136476dfa..443c203342 100644 --- a/doc/release-notes/release-3.2.sgml +++ b/doc/release-notes/release-3.2.sgml @@ -88,6 +88,7 @@ Most user-facing changes are reflected in squid.conf (see below). which are bundled with Squid have undergone a naming change in this release.

    Below is a list of the old helper names and what their names have changed to. + For several helpers the directory name used in --enable-X-helpers configure option has also changed. Basic Authentication protocol helpers

    @@ -95,6 +96,14 @@ Most user-facing changes are reflected in squid.conf (see below). getpwnam_auth - basic_getpwname_auth - Authenticate with local system user accounts. squid_ldap_auth - basic_ldap_auth - Authenticate with LDAP user accounts. ncsa_auth - basic_ncsa_auth - Authenticate with NCSA httpd-style password file. + pam_auth - basic_pam_auth - Authenticate with the system PAM infrastructure. + pop3.pl - basic_pop3_auth.pl - Authenticate with a mail server POP3/SMTP credentials + squid_sasl_auth - basic_sasl_auth - Authenticate with SASL. + smb_auth - basic_smb_auth - Authenticate with Samba SMB. + yp_auth - basic_nis_auth - Authenticate with NIS security system. + mswin_sspi - basic_sspi_auth - Authenticate with a Windows Domain Controller using SSPI. + MSNT-multi-domain - basic_msnt_multi_domain_auth.pl - Authenticate with any one of multiple Windows Domain Controllers. + squid_radius_auth - basic_radius_auth - Authenticate with RADIUS. Digest Authentication protocol helpers @@ -151,7 +160,6 @@ This section gives a thorough account of those changes in three categories:

    - New tags

    diff --git a/helpers/basic_auth/MSNT-multi-domain/Makefile.am b/helpers/basic_auth/MSNT-multi-domain/Makefile.am new file mode 100644 index 0000000000..2d5aa7d979 --- /dev/null +++ b/helpers/basic_auth/MSNT-multi-domain/Makefile.am @@ -0,0 +1,3 @@ + +libexec_SCRIPTS = basic_msnt_multi_domain_auth.pl +EXTRA_DIST = basic_msnt_multi_domain_auth.pl README.txt diff --git a/helpers/basic_auth/multi-domain-NTLM/README.txt b/helpers/basic_auth/MSNT-multi-domain/README.txt similarity index 100% rename from helpers/basic_auth/multi-domain-NTLM/README.txt rename to helpers/basic_auth/MSNT-multi-domain/README.txt diff --git a/helpers/basic_auth/multi-domain-NTLM/smb_auth.pl b/helpers/basic_auth/MSNT-multi-domain/basic_msnt_multi_domain_auth.pl similarity index 98% rename from helpers/basic_auth/multi-domain-NTLM/smb_auth.pl rename to helpers/basic_auth/MSNT-multi-domain/basic_msnt_multi_domain_auth.pl index bc5790593c..911d34315f 100755 --- a/helpers/basic_auth/multi-domain-NTLM/smb_auth.pl +++ b/helpers/basic_auth/MSNT-multi-domain/basic_msnt_multi_domain_auth.pl @@ -24,7 +24,7 @@ # fall back to the %controllers hack. $try_reverse_dns=1; -# Soem servers (at least mine) don't like to be called by their fully +# Some servers (at least mine) don't like to be called by their fully # qualified name. define this if you wish to call them ONLY by their # hostname. $dont_use_fqdn=1; @@ -134,4 +134,3 @@ sub discover_dc { return ($pdc,$bdc) if ($pdc); return 0; } - diff --git a/helpers/basic_auth/multi-domain-NTLM/config.test b/helpers/basic_auth/MSNT-multi-domain/config.test similarity index 100% rename from helpers/basic_auth/multi-domain-NTLM/config.test rename to helpers/basic_auth/MSNT-multi-domain/config.test diff --git a/helpers/basic_auth/Makefile.am b/helpers/basic_auth/Makefile.am index 939df4b1fb..a113d8559c 100644 --- a/helpers/basic_auth/Makefile.am +++ b/helpers/basic_auth/Makefile.am @@ -4,14 +4,14 @@ DIST_SUBDIRS = \ getpwnam \ LDAP \ MSNT \ - mswin_sspi \ - multi-domain-NTLM \ + MSNT-multi-domain \ NCSA \ + NIS \ PAM \ POP3 \ - squid_radius_auth \ + RADIUS \ SASL \ SMB \ - YP + SSPI SUBDIRS = $(BASIC_AUTH_HELPERS) diff --git a/helpers/basic_auth/NIS/Makefile.am b/helpers/basic_auth/NIS/Makefile.am new file mode 100644 index 0000000000..98fd46c515 --- /dev/null +++ b/helpers/basic_auth/NIS/Makefile.am @@ -0,0 +1,16 @@ +include $(top_srcdir)/src/Common.am + +## we need our local files too (but avoid -I. at all costs) +INCLUDES += -I$(srcdir) + +libexec_PROGRAMS = basic_nis_auth + +basic_nis_auth_SOURCES = \ + basic_nis_auth.cc \ + nis_support.h \ + nis_support.cc + +basic_nis_auth_LDADD = \ + $(COMPAT_LIB) \ + $(CRYPTLIB) \ + $(XTRA_LIBS) diff --git a/helpers/basic_auth/YP/yp_auth.c b/helpers/basic_auth/NIS/basic_nis_auth.cc similarity index 91% rename from helpers/basic_auth/YP/yp_auth.c rename to helpers/basic_auth/NIS/basic_nis_auth.cc index 379adabe04..75166726c7 100644 --- a/helpers/basic_auth/YP/yp_auth.c +++ b/helpers/basic_auth/NIS/basic_nis_auth.cc @@ -4,7 +4,10 @@ */ #include "config.h" +#include "hash.h" +#include "nis_support.h" #include "rfc1738.h" +#include "util.h" #if HAVE_STDIO_H #include @@ -28,11 +31,6 @@ #include #endif -#include "util.h" -#include "hash.h" - -#include "nis_support.h" - int main(int argc, char **argv) { @@ -45,9 +43,9 @@ main(int argc, char **argv) setbuf(stdout, NULL); if (argc != 3) { - fprintf(stderr, "Usage: yp_auth \n"); + fprintf(stderr, "Usage: basic_yp_auth \n"); fprintf(stderr, "\n"); - fprintf(stderr, "Example yp_auth mydomain.com passwd.byname\n"); + fprintf(stderr, "Example basic_yp_auth mydomain.com passwd.byname\n"); exit(1); } nisdomain = argv[1]; diff --git a/helpers/basic_auth/YP/config.test b/helpers/basic_auth/NIS/config.test similarity index 100% rename from helpers/basic_auth/YP/config.test rename to helpers/basic_auth/NIS/config.test diff --git a/helpers/basic_auth/YP/nis_support.c b/helpers/basic_auth/NIS/nis_support.cc similarity index 100% rename from helpers/basic_auth/YP/nis_support.c rename to helpers/basic_auth/NIS/nis_support.cc diff --git a/helpers/basic_auth/YP/nis_support.h b/helpers/basic_auth/NIS/nis_support.h similarity index 100% rename from helpers/basic_auth/YP/nis_support.h rename to helpers/basic_auth/NIS/nis_support.h diff --git a/helpers/basic_auth/PAM/Makefile.am b/helpers/basic_auth/PAM/Makefile.am index c6a65aec56..ff3f90fccb 100644 --- a/helpers/basic_auth/PAM/Makefile.am +++ b/helpers/basic_auth/PAM/Makefile.am @@ -1,22 +1,11 @@ -# -# Makefile for the Squid PAM authentication helper -# -# $Id$ -# -# Uncomment and customize the following to suit your needs: -# - include $(top_srcdir)/src/Common.am -man_MANS = pam_auth.8 -EXTRA_DIST = pam_auth.8 -libexec_PROGRAMS = pam_auth - -## we need our local files too (but avoid -I. at all costs) -INCLUDES += -I$(srcdir) +man_MANS = basic_pam_auth.8 +EXTRA_DIST = basic_pam_auth.8 +libexec_PROGRAMS = basic_pam_auth +basic_pam_auth_SOURCES = basic_pam_auth.cc -LDADD = \ - $(top_builddir)/compat/libcompat.la \ - -L$(top_builddir)/lib -lmiscutil \ +basic_pam_auth_LDADD = \ + $(COMPAT_LIB) \ -lpam \ - $(XTRA_LIBS) + @XTRA_LIBS@ diff --git a/helpers/basic_auth/PAM/pam_auth.8 b/helpers/basic_auth/PAM/basic_pam_auth.8 similarity index 89% rename from helpers/basic_auth/PAM/pam_auth.8 rename to helpers/basic_auth/PAM/basic_pam_auth.8 index 14108900b0..4227656278 100644 --- a/helpers/basic_auth/PAM/pam_auth.8 +++ b/helpers/basic_auth/PAM/basic_pam_auth.8 @@ -1,10 +1,10 @@ -.TH pam_auth 8 "5 Sep 2003" "Squid PAM Auth" +.TH basic_pam_auth 8 "5 Sep 2003" "Squid PAM Basic Auth" . .SH NAME -pam_auth - Squid PAM authentication helper +pam_auth - Squid PAM Basic authentication helper . .SH SYNOPSIS -squid_pam_auth [-n "service name"] [-t TTL] [-o] [-1] +basic_pam_auth [-n "service name"] [-t TTL] [-o] [-1] . .SH DESCRIPTION This helper allows Squid to connect to a mostly any available PAM @@ -68,11 +68,11 @@ fully audited and the author cannot be held responsible for any security issues due to such installations. . .SH AUTHOR -Squid pam_auth and this manual is written by +Squid basic_pam_auth and this manual is written by .I Henrik Nordstrom . .SH COPYRIGHT -Squid pam_auth and this manual is Copyright 1999,2002,2003 +Squid basic_pam_auth and this manual is Copyright 1999,2002,2003 Henrik Nordstrom . .SH QUESTIONS diff --git a/helpers/basic_auth/PAM/pam_auth.c b/helpers/basic_auth/PAM/basic_pam_auth.cc similarity index 95% rename from helpers/basic_auth/PAM/pam_auth.c rename to helpers/basic_auth/PAM/basic_pam_auth.cc index a80ac1d513..0802a1fd02 100644 --- a/helpers/basic_auth/PAM/pam_auth.c +++ b/helpers/basic_auth/PAM/basic_pam_auth.cc @@ -37,6 +37,9 @@ * * Change Log: * + * Version 2.3, 2009-11-06 + * Converted to C++. Brought into line with Squid-3 code styles. + * * Version 2.2, 2003-11-05 * One shot mode is now the default mode of operation * with persistent PAM connections enabled by -t option. @@ -60,21 +63,37 @@ * Version 1.1, 1999-05-11 * Initial version * - * Compile this program with: gcc -o pam_auth pam_auth.c -lpam -ldl + * Compile this program with: gcc -o basic_pam_auth basic_pam_auth.cc -lpam -ldl */ +#include "config.h" #include "rfc1738.h" #include "util.h" +#if HAVE_STDIO_H #include +#endif +#if HAVE_ASSERT_H #include +#endif +#if HAVE_STDLIB_H #include +#endif +#if HAVE_STRING_H #include +#endif +#if HAVE_SIGNAL_H #include +#endif +#if HAVE_TIME_H #include +#endif +#if HAVE_UNISTD_H #include - +#endif +#if HAVE_SECURITY_PAM_APPL_H #include +#endif #define BUFSIZE 8192 @@ -89,9 +108,11 @@ #define DEFAULT_SQUID_PAM_TTL 0 #endif +#if _SQUID_SOLARIS_ static char *password = NULL; /* Workaround for Solaris 2.6 brokenness */ +#endif -/* +/** * A simple "conversation" function returning the supplied password. * Has a bit to much error control, but this is my first PAM application * so I'd rather check everything than make any mistakes. The function @@ -250,7 +271,7 @@ error: } /* cleanup */ retval = PAM_SUCCESS; -#ifdef PAM_AUTHTOK +#if defined(PAM_AUTHTOK) if (ttl != 0) { if (retval == PAM_SUCCESS) retval = pam_set_item(pamh, PAM_AUTHTOK, NULL); diff --git a/helpers/basic_auth/POP3/Makefile.am b/helpers/basic_auth/POP3/Makefile.am index a41a181286..36ab1df47a 100644 --- a/helpers/basic_auth/POP3/Makefile.am +++ b/helpers/basic_auth/POP3/Makefile.am @@ -1,13 +1,2 @@ -# -# Makefile for the Squid Object Cache server -# -# $Id$ -# -# Uncomment and customize the following to suit your needs: -# - -libexec_SCRIPTS = \ - pop3.pl - -EXTRA_DIST = \ - pop3.pl +libexec_SCRIPTS = basic_pop3_auth.pl +EXTRA_DIST = basic_pop3_auth.pl diff --git a/helpers/basic_auth/POP3/pop3.pl b/helpers/basic_auth/POP3/basic_pop3_auth.pl similarity index 100% rename from helpers/basic_auth/POP3/pop3.pl rename to helpers/basic_auth/POP3/basic_pop3_auth.pl diff --git a/helpers/basic_auth/squid_radius_auth/COPYRIGHT b/helpers/basic_auth/RADIUS/COPYRIGHT similarity index 100% rename from helpers/basic_auth/squid_radius_auth/COPYRIGHT rename to helpers/basic_auth/RADIUS/COPYRIGHT diff --git a/helpers/basic_auth/squid_radius_auth/Changelog b/helpers/basic_auth/RADIUS/Changelog similarity index 100% rename from helpers/basic_auth/squid_radius_auth/Changelog rename to helpers/basic_auth/RADIUS/Changelog diff --git a/helpers/basic_auth/squid_radius_auth/Make.inc b/helpers/basic_auth/RADIUS/Make.inc similarity index 100% rename from helpers/basic_auth/squid_radius_auth/Make.inc rename to helpers/basic_auth/RADIUS/Make.inc diff --git a/helpers/basic_auth/RADIUS/Makefile.am b/helpers/basic_auth/RADIUS/Makefile.am new file mode 100644 index 0000000000..bfd160f937 --- /dev/null +++ b/helpers/basic_auth/RADIUS/Makefile.am @@ -0,0 +1,18 @@ +include $(top_srcdir)/src/Common.am + +## we need our local files too (but avoid -I. at all costs) +INCLUDES += -I$(srcdir) + +libexec_PROGRAMS = basic_radius_auth +man_MANS = basic_radius_auth.8 +EXTRA_DIST = basic_radius_auth.8 +basic_radius_auth_SOURCES = \ + basic_radius_auth.cc \ + radius.h \ + radius-util.cc \ + radius-util.h + +basic_radius_auth_LDADD = \ + $(COMPAT_LIB) \ + $(SSLLIB) \ + $(XTRA_LIBS) diff --git a/helpers/basic_auth/squid_radius_auth/Makefile.default b/helpers/basic_auth/RADIUS/Makefile.default similarity index 100% rename from helpers/basic_auth/squid_radius_auth/Makefile.default rename to helpers/basic_auth/RADIUS/Makefile.default diff --git a/helpers/basic_auth/squid_radius_auth/Makefile.solaris b/helpers/basic_auth/RADIUS/Makefile.solaris similarity index 100% rename from helpers/basic_auth/squid_radius_auth/Makefile.solaris rename to helpers/basic_auth/RADIUS/Makefile.solaris diff --git a/helpers/basic_auth/squid_radius_auth/README b/helpers/basic_auth/RADIUS/README similarity index 85% rename from helpers/basic_auth/squid_radius_auth/README rename to helpers/basic_auth/RADIUS/README index 2c62542368..6ed4fef04f 100644 --- a/helpers/basic_auth/squid_radius_auth/README +++ b/helpers/basic_auth/RADIUS/README @@ -1,4 +1,4 @@ -Squid_radius_auth V1.09 +basic_radius_auth V1.09 This kit is loosely based on radtest from the Cistron-radiusd which again is based on Livingston sources. See COPYRIGHT for details. @@ -16,7 +16,7 @@ make clean make install or if you want the helper installed elsewhere than /usr/local/squid -(the default installation path of Squid-2.5) use something like: +(the default installation path of Squid) use something like: make CONFDIR=/etc PREFIX=/usr BINDIR='${PREFIX}/libexec/squid' install @@ -35,12 +35,12 @@ Configuration: The RADIUS authenticator is configured using a small configuration file. The configuration file should look like this: -# squid_rad_auth configuration file +# basic_radius_auth configuration file # MvS: 28-10-1998 server suncone.cistron.nl secret testje -An example can be found in etc/squid_rad_auth.conf +An example can be found in etc/basic_radius_auth.conf /etc/services: @@ -53,12 +53,12 @@ Adding this is not mandatory because it used the default port 1812 anyway. Note: Some old RADIUS servers uses the unofficial port 1645, and you may need to override the service port used either by editing /etc/services or by specifying the port using the -p command line option or the port -tag in squid_rad_auth.conf +tag in basic_radius_auth.conf Test it: -Start squid_rad_auth and type a username and a username. The authenticator +Start basic_radius_auth and type a username and a username. The authenticator returns OK if the radiusd accepted your password. In any other case you'll get ERR. diff --git a/helpers/basic_auth/squid_radius_auth/squid_radius_auth.8 b/helpers/basic_auth/RADIUS/basic_radius_auth.8 similarity index 89% rename from helpers/basic_auth/squid_radius_auth/squid_radius_auth.8 rename to helpers/basic_auth/RADIUS/basic_radius_auth.8 index c381873ae7..454616d713 100644 --- a/helpers/basic_auth/squid_radius_auth/squid_radius_auth.8 +++ b/helpers/basic_auth/RADIUS/basic_radius_auth.8 @@ -1,13 +1,13 @@ -.TH squid_radius_auth 8 "7 August 2004" "Squid RADIUS Auth" +.TH basic_radius_auth 8 "7 August 2004" "Squid RADIUS Auth" . .SH NAME -squid_radius_auth - Squid RADIUS authentication helper +basic_radius_auth - Squid RADIUS authentication helper . .SH SYNOPSIS -.B squid_radius_auth +.B basic_radius_auth -f configfile .br -.B squid_radius_auth +.B basic_radius_auth -h "server" [-p port] [-i identifier] -w secret . .SH DESCRIPTION @@ -56,7 +56,7 @@ specifies the shared RADIUS secret. . .TP .BI "identifier " nameofserver -specifies what the proxy should identify itsels as to the RADIUS server. +specifies what the proxy should identify itself as to the RADIUS server. This directive is optional. . .TP @@ -66,7 +66,7 @@ Specifies the port number or service name where the helper should connect. This manual page was written by .I Henrik Nordstrom .P -squid_radius_auth is written by +basic_radius_auth is written by .I Marc van Selm with contributions from .I Henrik Nordstrom diff --git a/helpers/basic_auth/squid_radius_auth/squid_rad_auth.c b/helpers/basic_auth/RADIUS/basic_radius_auth.cc similarity index 95% rename from helpers/basic_auth/squid_radius_auth/squid_rad_auth.c rename to helpers/basic_auth/RADIUS/basic_radius_auth.cc index 8e59ba464d..0320c9321d 100644 --- a/helpers/basic_auth/squid_radius_auth/squid_rad_auth.c +++ b/helpers/basic_auth/RADIUS/basic_radius_auth.cc @@ -28,11 +28,11 @@ * Copyright (C) 2006 Henrik Nordstrom */ -/* Squid_rad_auth is a RADIUS authenticator for Squid-2.5 and later. +/* basic_radius_auth is a RADIUS authenticator for Squid-2.5 and later. * The authenticator reads a line with a user and password combination. * If access is granted OK is returned. Else ERR. * - * Squid_rad_auth-1.0 is based on modules from the Cistron-radiusd-1.5.4. + * basic_radius_auth-1.0 is based on modules from the Cistron-radiusd-1.5.4. * * Currently you should only start 1 authentificator at a time because the * the ID's of the different programs can start to conflict. I'm not sure it @@ -46,52 +46,54 @@ */ #include "config.h" +#include "md5.h" +#include "radius.h" +#include "radius-util.h" #if HAVE_SYS_TYPES_H -#include +#include #endif #if HAVE_SYS_SOCKET_H -#include +#include #endif #if HAVE_NETINET_IN_H -#include +#include #endif #if HAVE_SYS_TIME_H -#include +#include #endif #if HAVE_UNISTD_H -#include +#include #endif #if HAVE_FCNTL_H -#include +#include #endif #ifdef _SQUID_WIN32_ #include #endif - #if HAVE_CTYPE_H -#include +#include #endif #if HAVE_STDIO_H -#include +#include #endif #if HAVE_UNISTD_H -#include +#include #endif #if HAVE_NETDB_H -#include +#include #endif #if HAVE_PWD_H -#include +#include #endif #if HAVE_STDLIB_H -#include +#include #endif #if HAVE_TIME_H -#include +#include #endif #if HAVE_STRING_H -#include +#include #endif #if HAVE_GETOPT_H #include @@ -100,10 +102,6 @@ #include #endif -#include "md5.h" -#include "radius.h" -#include "radius-util.h" - #define MAXPWNAM 254 #define MAXPASS 254 #define MAXLINE 254 @@ -127,7 +125,7 @@ static u_int32_t nas_ipaddr; static u_int32_t auth_ipaddr; static int retries = 30; -char progname[] = "squid_rad_auth"; +char progname[] = "basic_radius_auth"; int debug_flag = 0; #ifdef _SQUID_MSWIN_ @@ -189,7 +187,7 @@ result_recv(u_int32_t host, u_short udp_port, char *buffer, int length) if (totallen != length) { fprintf(stderr, - "Squid_rad_auth: Received invalid reply length from server (want %d/ got %d)\n", + "basic_radius_auth: Received invalid reply length from server (want %d/ got %d)\n", totallen, length); return -1; } @@ -235,7 +233,7 @@ random_vector(char *aVector) /* read the config file * The format should be something like: - * # squid_rad_auth configuration file + * # basic_radius_auth configuration file * # MvS: 28-10-1998 * server suncone.cistron.nl * secret testje diff --git a/helpers/basic_auth/squid_radius_auth/config.test b/helpers/basic_auth/RADIUS/config.test similarity index 100% rename from helpers/basic_auth/squid_radius_auth/config.test rename to helpers/basic_auth/RADIUS/config.test diff --git a/helpers/basic_auth/squid_radius_auth/radius-util.c b/helpers/basic_auth/RADIUS/radius-util.cc similarity index 100% rename from helpers/basic_auth/squid_radius_auth/radius-util.c rename to helpers/basic_auth/RADIUS/radius-util.cc diff --git a/helpers/basic_auth/squid_radius_auth/radius-util.h b/helpers/basic_auth/RADIUS/radius-util.h similarity index 100% rename from helpers/basic_auth/squid_radius_auth/radius-util.h rename to helpers/basic_auth/RADIUS/radius-util.h diff --git a/helpers/basic_auth/squid_radius_auth/radius.h b/helpers/basic_auth/RADIUS/radius.h similarity index 100% rename from helpers/basic_auth/squid_radius_auth/radius.h rename to helpers/basic_auth/RADIUS/radius.h diff --git a/helpers/basic_auth/SASL/Makefile.am b/helpers/basic_auth/SASL/Makefile.am index d30bf67182..1fca0b49cc 100644 --- a/helpers/basic_auth/SASL/Makefile.am +++ b/helpers/basic_auth/SASL/Makefile.am @@ -1,22 +1,10 @@ -# -# Makefile for the Squid SASL authentication helper -# -# $Id$ -# -# Uncomment and customize the following to suit your needs: -# - include $(top_srcdir)/src/Common.am -libexec_PROGRAMS = sasl_auth - -## we need our local files too (but avoid -I. at all costs) -INCLUDES += -I$(srcdir) - -LDADD = \ - $(top_builddir)/compat/libcompat.la \ - -L$(top_builddir)/lib -lmiscutil \ +libexec_PROGRAMS = basic_sasl_auth +basic_sasl_auth_SOURCES = basic_sasl_auth.cc +basic_sasl_auth_LDADD = \ + $(COMPAT_LIB) \ $(LIBSASL) \ $(XTRA_LIBS) -EXTRA_DIST = squid_sasl_auth squid_sasl_auth.conf +EXTRA_DIST = basic_sasl_auth.pam basic_sasl_auth.conf diff --git a/helpers/basic_auth/SASL/README b/helpers/basic_auth/SASL/README index 286bda4776..33a36e40d2 100644 --- a/helpers/basic_auth/SASL/README +++ b/helpers/basic_auth/SASL/README @@ -7,9 +7,9 @@ against SASL identifies itself with an application name. Each For this authenticator, the SASL application name is, by default, - squid_sasl_auth + basic_sasl_auth -To configure the authentication method used the file "squid_sasl_auth.conf" +To configure the authentication method used the file "basic_sasl_auth.conf" can be placed in the appropriate location, usually "/usr/lib/sasl". The authentication database is defined by the "pwcheck_method" parameter. @@ -39,9 +39,9 @@ will typically fail with "-1, generic error". chown root.mail sasl_auth chmod ug+s sasl_auth -If the application name ("squid_sasl_auth") will also be used for the +If the application name ("basic_sasl_auth") will also be used for the pam service name if pwcheck_method:pam is chosen. And example pam -configuration file "squid_sasl_auth" is also included. +configuration file "basic_sasl_auth.pam" is also included. Ian Castle diff --git a/helpers/basic_auth/SASL/sasl_auth.c b/helpers/basic_auth/SASL/basic_sasl_auth.cc similarity index 95% rename from helpers/basic_auth/SASL/sasl_auth.c rename to helpers/basic_auth/SASL/basic_sasl_auth.cc index 6efa30dfea..620a1554a2 100644 --- a/helpers/basic_auth/SASL/sasl_auth.c +++ b/helpers/basic_auth/SASL/basic_sasl_auth.cc @@ -26,21 +26,29 @@ * or with SASL2: gcc -Wall -o sasl_auth sasl_auth.c -lsasl2 * */ +#include "config.h" +#include "rfc1738.h" +#include "util.h" + +#if HAVE_STDIO_H #include +#endif +#if HAVE_ERRNO_H #include +#endif +#if HAVE_STDLIB_H #include +#endif +#if HAVE_STRING_H #include - -#include "rfc1738.h" -#include "util.h" - +#endif #ifdef HAVE_SASL_SASL_H #include #else #include #endif -#define APP_NAME_SASL "squid_sasl_auth" +#define APP_NAME_SASL "basic_sasl_auth" int main(int argc, char *argv[]) diff --git a/helpers/basic_auth/SASL/squid_sasl_auth.conf b/helpers/basic_auth/SASL/basic_sasl_auth.conf similarity index 100% rename from helpers/basic_auth/SASL/squid_sasl_auth.conf rename to helpers/basic_auth/SASL/basic_sasl_auth.conf diff --git a/helpers/basic_auth/SASL/squid_sasl_auth b/helpers/basic_auth/SASL/basic_sasl_auth.pam similarity index 100% rename from helpers/basic_auth/SASL/squid_sasl_auth rename to helpers/basic_auth/SASL/basic_sasl_auth.pam diff --git a/helpers/basic_auth/SMB/ChangeLog b/helpers/basic_auth/SMB/ChangeLog index 21d35355c9..6c136ca523 100644 --- a/helpers/basic_auth/SMB/ChangeLog +++ b/helpers/basic_auth/SMB/ChangeLog @@ -1,3 +1,7 @@ +7 November 2009, version 0.05 + +- Naming change for helpers in Squid-3. + 28 September 1999, version 0.05 - Easier debugging: added the -d option to smb_auth. diff --git a/helpers/basic_auth/SMB/Makefile.am b/helpers/basic_auth/SMB/Makefile.am index 82aa4b42ea..e8f8685649 100644 --- a/helpers/basic_auth/SMB/Makefile.am +++ b/helpers/basic_auth/SMB/Makefile.am @@ -1,11 +1,3 @@ -# -# Makefile for the Squid Object Cache server -# -# $Id$ -# -# Uncomment and customize the following to suit your needs: -# - include $(top_srcdir)/src/Common.am # SAMBAPREFIX must point to the directory where Samba has been installed. @@ -15,19 +7,15 @@ include $(top_srcdir)/src/Common.am ## FIXME: autoconf should test for the samba path. -SMB_AUTH_HELPER = smb_auth.sh +SMB_AUTH_HELPER = basic_smb_auth.sh SAMBAPREFIX=/usr/local/samba SMB_AUTH_HELPER_PATH = $(libexecdir)/$(SMB_AUTH_HELPER) libexec_SCRIPTS = $(SMB_AUTH_HELPER) -libexec_PROGRAMS = smb_auth -smb_auth_CFLAGS = -DSAMBAPREFIX=\"$(SAMBAPREFIX)\" -DHELPERSCRIPT=\"$(SMB_AUTH_HELPER_PATH)\" -EXTRA_DIST = smb_auth.sh COPYING-2.0 -## we need our local files too (but avoid -I. at all costs) -INCLUDES += -I$(srcdir) +libexec_PROGRAMS = basic_smb_auth +basic_smb_auth_SOURCES= basic_smb_auth.cc +basic_smb_auth_CFLAGS = -DSAMBAPREFIX=\"$(SAMBAPREFIX)\" -DHELPERSCRIPT=\"$(SMB_AUTH_HELPER_PATH)\" +basic_smb_auth_LDADD = $(COMPAT_LIB) $(XTRA_LIBS) -LDADD = \ - $(top_builddir)/compat/libcompat.la \ - -L$(top_builddir)/lib -lmiscutil \ - $(XTRA_LIBS) +EXTRA_DIST = basic_smb_auth.sh COPYING-2.0 diff --git a/helpers/basic_auth/SMB/README b/helpers/basic_auth/SMB/README deleted file mode 100644 index f550dc386a..0000000000 --- a/helpers/basic_auth/SMB/README +++ /dev/null @@ -1,3 +0,0 @@ -For documentation, please refer to - - http://www.hacom.nl/~richard/software/smb_auth.html diff --git a/helpers/basic_auth/SMB/smb_auth.c b/helpers/basic_auth/SMB/basic_smb_auth.cc similarity index 98% rename from helpers/basic_auth/SMB/smb_auth.c rename to helpers/basic_auth/SMB/basic_smb_auth.cc index e81eb2f120..4ea3a3daeb 100644 --- a/helpers/basic_auth/SMB/smb_auth.c +++ b/helpers/basic_auth/SMB/basic_smb_auth.cc @@ -1,5 +1,5 @@ /* - * smb_auth - SMB proxy authentication module + * basic_smb_auth - SMB proxy authentication module * Copyright (C) 1998 Richard Huveneers * * This program is free software; you can redistribute it and/or modify @@ -40,13 +40,20 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111, USA. */ +#include "config.h" +#include "rfc1738.h" +#include "util.h" +#if HAVE_STDIO_H #include +#endif +#if HAVE_STDLIB_H #include +#endif +#if HAVE_STRING_H #include +#endif -#include "util.h" -#include "rfc1738.h" #define BUFSIZE 256 #define NMB_UNICAST 1 diff --git a/helpers/basic_auth/SMB/smb_auth.sh b/helpers/basic_auth/SMB/basic_smb_auth.sh similarity index 100% rename from helpers/basic_auth/SMB/smb_auth.sh rename to helpers/basic_auth/SMB/basic_smb_auth.sh diff --git a/helpers/basic_auth/SSPI/Makefile.am b/helpers/basic_auth/SSPI/Makefile.am new file mode 100644 index 0000000000..f7cec10f26 --- /dev/null +++ b/helpers/basic_auth/SSPI/Makefile.am @@ -0,0 +1,14 @@ +include $(top_srcdir)/src/Common.am + +## we need our local files too (but avoid -I. at all costs) +INCLUDES += -I$(srcdir) + +libexec_PROGRAMS = basic_sspi_auth + +basic_sspi_auth_SOURCES = basic_sspi_auth.cc valid.cc valid.h +basic_sspi_auth_LDADD = \ + $(COMPAT_LIB) \ + -lnetapi32 -ladvapi32 -lsspwin32 \ + $(XTRA_LIBS) + +EXTRA_DIST = readme.txt diff --git a/helpers/basic_auth/mswin_sspi/mswin_auth.c b/helpers/basic_auth/SSPI/basic_sspi_auth.cc similarity index 99% rename from helpers/basic_auth/mswin_sspi/mswin_auth.c rename to helpers/basic_auth/SSPI/basic_sspi_auth.cc index 08a45abd4a..adcefe9b3a 100644 --- a/helpers/basic_auth/mswin_sspi/mswin_auth.c +++ b/helpers/basic_auth/SSPI/basic_sspi_auth.cc @@ -25,9 +25,14 @@ */ #include "config.h" +#include "util.h" + +#if HAVE_STDIO_H #include +#endif +#if GETOPT_H #include -#include "util.h" +#endif /* Check if we try to compile on a Windows Platform */ #if defined(_SQUID_CYGWIN_) || defined(_SQUID_MSWIN_) diff --git a/helpers/basic_auth/mswin_sspi/config.test b/helpers/basic_auth/SSPI/config.test similarity index 100% rename from helpers/basic_auth/mswin_sspi/config.test rename to helpers/basic_auth/SSPI/config.test diff --git a/helpers/basic_auth/mswin_sspi/readme.txt b/helpers/basic_auth/SSPI/readme.txt similarity index 100% rename from helpers/basic_auth/mswin_sspi/readme.txt rename to helpers/basic_auth/SSPI/readme.txt diff --git a/helpers/basic_auth/mswin_sspi/valid.c b/helpers/basic_auth/SSPI/valid.cc similarity index 99% rename from helpers/basic_auth/mswin_sspi/valid.c rename to helpers/basic_auth/SSPI/valid.cc index 42c1747f85..9e7d901c07 100644 --- a/helpers/basic_auth/mswin_sspi/valid.c +++ b/helpers/basic_auth/SSPI/valid.cc @@ -26,6 +26,7 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111, USA. */ +#include "config.h" #include "util.h" /* Check if we try to compile on a Windows Platform */ diff --git a/helpers/basic_auth/mswin_sspi/valid.h b/helpers/basic_auth/SSPI/valid.h similarity index 100% rename from helpers/basic_auth/mswin_sspi/valid.h rename to helpers/basic_auth/SSPI/valid.h diff --git a/helpers/basic_auth/YP/Makefile.am b/helpers/basic_auth/YP/Makefile.am deleted file mode 100644 index 79f5561a69..0000000000 --- a/helpers/basic_auth/YP/Makefile.am +++ /dev/null @@ -1,20 +0,0 @@ -# -# Makefile for the Squid Object Cache server -# -# $Id$ -# -# - -include $(top_srcdir)/src/Common.am - -libexec_PROGRAMS = yp_auth -yp_auth_SOURCES = yp_auth.c nis_support.h nis_support.c - -## we need our local files too (but avoid -I. at all costs) -INCLUDES += -I$(srcdir) - -LDADD = \ - $(top_builddir)/compat/libcompat.la \ - -L$(top_builddir)/lib -lmiscutil \ - $(CRYPTLIB) \ - $(XTRA_LIBS) diff --git a/helpers/basic_auth/mswin_sspi/Makefile.am b/helpers/basic_auth/mswin_sspi/Makefile.am deleted file mode 100644 index 4d915d5449..0000000000 --- a/helpers/basic_auth/mswin_sspi/Makefile.am +++ /dev/null @@ -1,24 +0,0 @@ -# -# Makefile for the Squid Object Cache server -# -# $Id$ -# -# Uncomment and customize the following to suit your needs: -# - -include $(top_srcdir)/src/Common.am - -libexec_PROGRAMS = mswin_auth - -mswin_auth_SOURCES = mswin_auth.c valid.c valid.h - -LDADD = \ - $(top_builddir)/compat/libcompat.la \ - -L$(top_builddir)/lib -lmiscutil \ - -lnetapi32 -ladvapi32 -lsspwin32 \ - $(XTRA_LIBS) - -## we need our local files too (but avoid -I. at all costs) -INCLUDES += -I$(srcdir) - -EXTRA_DIST = readme.txt diff --git a/helpers/basic_auth/multi-domain-NTLM/Makefile.am b/helpers/basic_auth/multi-domain-NTLM/Makefile.am deleted file mode 100644 index 364248f0bb..0000000000 --- a/helpers/basic_auth/multi-domain-NTLM/Makefile.am +++ /dev/null @@ -1,14 +0,0 @@ -# -# Makefile for the Squid Object Cache server -# -# $Id$ -# -# Uncomment and customize the following to suit your needs: -# - -libexec_SCRIPTS = \ - smb_auth.pl - -EXTRA_DIST = \ - smb_auth.pl \ - README.txt diff --git a/helpers/basic_auth/squid_radius_auth/Makefile.am b/helpers/basic_auth/squid_radius_auth/Makefile.am deleted file mode 100644 index 34be3078ad..0000000000 --- a/helpers/basic_auth/squid_radius_auth/Makefile.am +++ /dev/null @@ -1,27 +0,0 @@ -# -# Makefile for the Squid LDAP authentication helper -# -# $Id$ -# -# Uncomment and customize the following to suit your needs: -# - -include $(top_srcdir)/src/Common.am - -libexec_PROGRAMS = squid_radius_auth -man_MANS = squid_radius_auth.8 -EXTRA_DIST = squid_radius_auth.8 -squid_radius_auth_SOURCES = \ - squid_rad_auth.c \ - radius.h \ - radius-util.c \ - radius-util.h - -## we need our local files too (but avoid -I. at all costs) -INCLUDES += -I$(srcdir) - -LDADD = \ - $(top_builddir)/compat/libcompat.la \ - -L$(top_builddir)/lib -lmiscutil \ - $(SSLLIB) \ - $(XTRA_LIBS)