From: Amos Jeffries Date: Sat, 3 Oct 2009 01:40:29 +0000 (+1300) Subject: Helpers: Upgrade Basic Auth NCSA helper X-Git-Tag: SQUID_3_2_0_1~671 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=0d8565acd8b86e0d116e6db299f8a2a27b37243a;p=thirdparty%2Fsquid.git Helpers: Upgrade Basic Auth NCSA helper - C++ Build with libcompat - Rename basic_ncsa_auth - Update CRYPTLIB definition. TODO: there is some cleanup still needed relating to CRYPTLIB the current definition may include -lmd5 as well and Kerberos library define may duplicate both -lcrypt and -lmd5 in the guise of SSLLIB --- diff --git a/configure.in b/configure.in index 9eaa5deba1..85f0c52d98 100644 --- a/configure.in +++ b/configure.in @@ -84,7 +84,6 @@ fi AC_PROG_RANLIB -CRYPTLIB='' REGEXLIB='' # -lregex # LIBREGEX='' # libregex.a @@ -3009,6 +3008,7 @@ else fi dnl Check for libcrypt +CRYPTLIB= dnl Some of our helpers use crypt(3) which may be in libc, or in dnl libcrypt (eg FreeBSD) AC_CHECK_LIB(crypt, crypt, [CRYPTLIB="-lcrypt"]) @@ -3016,6 +3016,13 @@ dnl Solaris10 provides MD5 natively through libmd5 AC_CHECK_LIB(md5, MD5Init, [CRYPTLIB="$CRYPTLIB -lmd5"]) AC_SUBST(CRYPTLIB) +# check for crypt, may require -lcrypt +SAVED_LIBS="$LIBS" +LIBS="$LIBS $CRYPTLIB" +AC_CHECK_FUNCS(crypt) +LIBS="$SAVED_LIBS" + + dnl Check for libdl, used by auth_modules/PAM if test "$with_dl" = "yes"; then AC_CHECK_LIB(dl, dlopen) @@ -3252,12 +3259,6 @@ AC_REPLACE_FUNCS(\ tempnam \ ) -# check for crypt, may require -lcrypt -SAVED_LIBS="$LIBS" -LIBS="$LIBS $CRYPTLIB" -AC_CHECK_FUNCS(crypt) -LIBS="$SAVED_LIBS" - dnl Magic which checks whether we are forcing a type of comm loop we dnl are actually going to (ab)use diff --git a/doc/release-notes/release-3.2.sgml b/doc/release-notes/release-3.2.sgml index f5f13606ae..f6b81967e3 100644 --- a/doc/release-notes/release-3.2.sgml +++ b/doc/release-notes/release-3.2.sgml @@ -55,6 +55,7 @@ Most user-facing changes are reflected in squid.conf (see below). squid_db_auth - basic_db_auth - Retrieve authentication details from a simple SQL database table. 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. Digest Authentication protocol helpers diff --git a/helpers/basic_auth/NCSA/Makefile.am b/helpers/basic_auth/NCSA/Makefile.am index 08ef3d72de..ba5db5116f 100644 --- a/helpers/basic_auth/NCSA/Makefile.am +++ b/helpers/basic_auth/NCSA/Makefile.am @@ -1,21 +1,12 @@ -# -# 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 = ncsa_auth -ncsa_auth_SOURCES = ncsa_auth.c crypt_md5.c crypt_md5.h -man_MANS = ncsa_auth.8 -EXTRA_DIST = ncsa_auth.8 +libexec_PROGRAMS = basic_ncsa_auth +basic_ncsa_auth_SOURCES = basic_ncsa_auth.cc crypt_md5.cc crypt_md5.h +man_MANS = basic_ncsa_auth.8 +EXTRA_DIST = basic_ncsa_auth.8 LDADD = \ - $(top_builddir)/compat/libcompat.la \ - -L$(top_builddir)/lib -lmiscutil \ - $(CRYPTLIB) \ + $(COMPAT_LIB) \ + @CRYPTLIB@ \ $(XTRA_LIBS) \ $(SSLLIB) diff --git a/helpers/basic_auth/NCSA/ncsa_auth.8 b/helpers/basic_auth/NCSA/basic_ncsa_auth.8 similarity index 63% rename from helpers/basic_auth/NCSA/ncsa_auth.8 rename to helpers/basic_auth/NCSA/basic_ncsa_auth.8 index 85da640986..7cf7ff6931 100644 --- a/helpers/basic_auth/NCSA/ncsa_auth.8 +++ b/helpers/basic_auth/NCSA/basic_ncsa_auth.8 @@ -10,29 +10,29 @@ .\" .\" HISTORY: .\" 2006-05-16, created by Rodrigo Rubira Branco -.TH ncsa_auth 8 "May 16, 2006" "Squid NCSA Auth helper" +.TH basic_ncsa_auth 8 "May 16, 2006" "Squid NCSA Auth helper" .SH NAME -ncsa_auth \- NCSA httpd-style password file authentication helper for Squid +basic_ncsa_auth \- NCSA httpd-style password file authentication helper for Squid \fB .SH SYNOPSIS .nf .fam C -\fBncsa_auth\fP \fIpasswdfile\fP +\fBbasic_ncsa_auth\fP \fIpasswdfile\fP .fam T .fi .SH DESCRIPTION -\fBncsa_auth\fP allows Squid to read and authenticate user and password information from an NCSA/Apache httpd-style password file when using basic HTTP authentication. +\fBbasic_ncsa_auth\fP allows Squid to read and authenticate user and password information from an NCSA/Apache httpd-style password file when using basic HTTP authentication. .PP -The only parameter is the password file. It must have permissions to be read by the user that Squid is running as (cache_effective_user in squid.conf). +The only parameter is the password file. It must have permissions to be read by the user that Squid is running as. .PP This password file can be manipulated using htpasswd. .SH OPTIONS Only specify the password file name. .SH EXAMPLE -\fBncsa_auth\fP /etc/squid/squid.pass +\fBbasic_ncsa_auth\fP /etc/squid/squid.pass .SH SECURITY -\fBncsa_auth\fP must have access to the password file to be executed. -.SH SEE ALSO -\fBhtpasswd\fP(1), \fBsquid\fP(8) +\fBbasic_ncsa_auth\fP must have access to the password file to be executed. .SH AUTHOR Manpage written by Rodrigo Rubira Branco +.SH SEE ALSO +\fBhtpasswd\fP(1), \fBsquid\fP(8) diff --git a/helpers/basic_auth/NCSA/ncsa_auth.c b/helpers/basic_auth/NCSA/basic_ncsa_auth.cc similarity index 100% rename from helpers/basic_auth/NCSA/ncsa_auth.c rename to helpers/basic_auth/NCSA/basic_ncsa_auth.cc diff --git a/helpers/basic_auth/NCSA/crypt_md5.c b/helpers/basic_auth/NCSA/crypt_md5.cc similarity index 100% rename from helpers/basic_auth/NCSA/crypt_md5.c rename to helpers/basic_auth/NCSA/crypt_md5.cc diff --git a/helpers/basic_auth/NCSA/crypt_md5.h b/helpers/basic_auth/NCSA/crypt_md5.h index 47c4e7787f..fa44d3d38e 100644 --- a/helpers/basic_auth/NCSA/crypt_md5.h +++ b/helpers/basic_auth/NCSA/crypt_md5.h @@ -12,7 +12,12 @@ * to64(salt+4, rand(), 4); * salt[0] = '\0'; */ +#ifndef _CRYPT_MD5_H +#define _CRYPT_MD5_H + char *crypt_md5(const char *pw, const char *salt); /* MD5 hash without salt */ char *md5sum(const char *s); + +#endif /* _CRYPT_MD5_H */