]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Helpers: Upgrade Basic Auth NCSA helper
authorAmos Jeffries <squid3@treenet.co.nz>
Sat, 3 Oct 2009 01:40:29 +0000 (14:40 +1300)
committerAmos Jeffries <squid3@treenet.co.nz>
Sat, 3 Oct 2009 01:40:29 +0000 (14:40 +1300)
- 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

configure.in
doc/release-notes/release-3.2.sgml
helpers/basic_auth/NCSA/Makefile.am
helpers/basic_auth/NCSA/basic_ncsa_auth.8 [moved from helpers/basic_auth/NCSA/ncsa_auth.8 with 63% similarity]
helpers/basic_auth/NCSA/basic_ncsa_auth.cc [moved from helpers/basic_auth/NCSA/ncsa_auth.c with 100% similarity]
helpers/basic_auth/NCSA/crypt_md5.cc [moved from helpers/basic_auth/NCSA/crypt_md5.c with 100% similarity]
helpers/basic_auth/NCSA/crypt_md5.h

index 9eaa5deba1113ab196aa35ab3f6eb75c82953053..85f0c52d985baeb09098e4262322506583b90276 100644 (file)
@@ -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
  
index f5f13606ae9a1b143559369ec9a0f03471dfec2f..f6b81967e326a56b14804d0644c339349fb81eb7 100644 (file)
@@ -55,6 +55,7 @@ Most user-facing changes are reflected in squid.conf (see below).
        <item>squid_db_auth - basic_db_auth - Retrieve authentication details from a simple SQL database table.
        <item>getpwnam_auth - basic_getpwname_auth - Authenticate with local system user accounts.
        <item>squid_ldap_auth - basic_ldap_auth - Authenticate with LDAP user accounts.
+       <item>ncsa_auth - basic_ncsa_auth - Authenticate with NCSA httpd-style password file.
 </itemize>
 
 <sect2>Digest Authentication protocol helpers
index 08ef3d72de6f9ea3a3a8879449ec79d6a49327ee..ba5db5116f6a6ef61dfe818f85d95699e925a86f 100644 (file)
@@ -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)
 
similarity index 63%
rename from helpers/basic_auth/NCSA/ncsa_auth.8
rename to helpers/basic_auth/NCSA/basic_ncsa_auth.8
index 85da640986a3fab1d37e4b64b3aa503310f3a8ef..7cf7ff6931c7fee2bf176d83feebfa8997b017df 100644 (file)
 .\"
 .\" HISTORY:
 .\" 2006-05-16, created by Rodrigo Rubira Branco <rrbranco@br.ibm.com>
-.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 <rrbranco@br.ibm.com>
+.SH SEE ALSO
+\fBhtpasswd\fP(1), \fBsquid\fP(8)
index 47c4e7787fa6433f02c70f44afd184dea40b10fb..fa44d3d38e949b3015892b232294a3639b38956d 100644 (file)
  *    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 */