Index: squid/configure.in diff -c squid/configure.in:1.251.2.56 squid/configure.in:1.251.2.57 *** squid/configure.in:1.251.2.56 Tue Jun 1 02:34:19 2004 --- squid/configure.in Tue Jun 8 05:35:22 2004 *************** *** 915,921 **** if test -n "$BASIC_AUTH_HELPERS"; then for helper in $BASIC_AUTH_HELPERS; do if test -f $srcdir/helpers/basic_auth/$helper/Makefile.in; then ! : else echo "ERROR: Basic auth helper $helper does not exists" exit 1 --- 915,923 ---- if test -n "$BASIC_AUTH_HELPERS"; then for helper in $BASIC_AUTH_HELPERS; do if test -f $srcdir/helpers/basic_auth/$helper/Makefile.in; then ! if test "$helper" = "SASL"; then ! require_sasl=yes ! fi else echo "ERROR: Basic auth helper $helper does not exists" exit 1 *************** *** 1058,1063 **** --- 1060,1083 ---- ]) AC_SUBST(SAMBASOURCES) + dnl Check for Cyrus SASL + if test "$require_sasl" = "yes"; then + AC_CHECK_HEADERS(sasl/sasl.h sasl.h) + if test "$ac_cv_header_sasl_sasl_h" = "yes"; then + echo "using SASL2" + LIBSASL="-lsasl2" + else + if test "$ac_cv_header_sasl_h" = "yes"; then + echo "using SASL" + LIBSASL="-lsasl" + else + echo "ERROR: Neither SASL nor SASL2 found" + exit 1 + fi + fi + AC_SUBST(LIBSASL) + fi + dnl Disable "unlinkd" code AC_ARG_ENABLE(unlinkd, [ --disable-unlinkd Do not use unlinkd], Index: squid/helpers/basic_auth/SASL/Makefile.am diff -c squid/helpers/basic_auth/SASL/Makefile.am:1.1.2.3 squid/helpers/basic_auth/SASL/Makefile.am:1.1.2.4 *** squid/helpers/basic_auth/SASL/Makefile.am:1.1.2.3 Sun Aug 11 19:13:41 2002 --- squid/helpers/basic_auth/SASL/Makefile.am Tue Jun 8 05:35:22 2004 *************** *** 9,13 **** INCLUDES = -I$(top_srcdir)/include libexec_PROGRAMS = sasl_auth ! LDADD = -L$(top_builddir)/lib -lmiscutil -lsasl $(XTRA_LIBS) EXTRA_DIST = squid_sasl_auth squid_sasl_auth.conf --- 9,13 ---- INCLUDES = -I$(top_srcdir)/include libexec_PROGRAMS = sasl_auth ! LDADD = -L$(top_builddir)/lib -lmiscutil $(LIBSASL) $(XTRA_LIBS) EXTRA_DIST = squid_sasl_auth squid_sasl_auth.conf Index: squid/helpers/basic_auth/SASL/sasl_auth.c diff -c squid/helpers/basic_auth/SASL/sasl_auth.c:1.1.2.4 squid/helpers/basic_auth/SASL/sasl_auth.c:1.1.2.5 *** squid/helpers/basic_auth/SASL/sasl_auth.c:1.1.2.4 Mon Aug 12 10:58:31 2002 --- squid/helpers/basic_auth/SASL/sasl_auth.c Tue Jun 8 05:35:22 2004 *************** *** 23,31 **** * This program authenticates users against using cyrus-sasl * * Compile this program with: gcc -Wall -o sasl_auth sasl_auth.c -lsasl * */ - #include #include #include #include --- 23,31 ---- * This program authenticates users against using cyrus-sasl * * Compile this program with: gcc -Wall -o sasl_auth sasl_auth.c -lsasl + * or with SASL2: gcc -Wall -o sasl_auth sasl_auth.c -lsasl2 * */ #include #include #include *************** *** 33,38 **** --- 33,44 ---- #include "util.h" + #ifdef HAVE_SASL_SASL_H + #include + #else + #include + #endif + #define APP_NAME_SASL "squid_sasl_auth" int *************** *** 40,46 **** --- 46,54 ---- { char line[8192]; char *username, *password; + #if SASL_VERSION_MAJOR < 2 const char *errstr; + #endif int rc; sasl_conn_t *conn = NULL; *************** *** 56,62 **** --- 64,74 ---- return 1; } + #if SASL_VERSION_MAJOR < 2 rc = sasl_server_new( APP_NAME_SASL, NULL, NULL, NULL, 0, &conn ); + #else + rc = sasl_server_new( APP_NAME_SASL, NULL, NULL, NULL, NULL, NULL, 0, &conn ); + #endif if ( rc != SASL_OK ) { fprintf( stderr, "error %d %s\n", rc, sasl_errstring(rc, NULL, NULL )); *************** *** 84,98 **** --- 96,116 ---- rfc1738_unescape(username); rfc1738_unescape(password); + #if SASL_VERSION_MAJOR < 2 rc = sasl_checkpass(conn, username, strlen(username), password, strlen(password), &errstr); + #else + rc = sasl_checkpass(conn, username, strlen(username), password, strlen(password)); + #endif if ( rc != SASL_OK ) { + #if SASL_VERSION_MAJOR < 2 if ( errstr ) { fprintf( stderr, "errstr %s\n", errstr ); } if ( rc != SASL_BADAUTH ) { fprintf( stderr, "error %d %s\n", rc, sasl_errstring(rc, NULL, NULL )); } + #endif fprintf( stdout, "ERR\n" ); } else { Index: squid/helpers/basic_auth/SASL/Makefile.in diff -c squid/helpers/basic_auth/SASL/Makefile.in:1.1.2.14 squid/helpers/basic_auth/SASL/Makefile.in:1.1.2.15 *** squid/helpers/basic_auth/SASL/Makefile.in:1.1.2.14 Sat Mar 6 18:11:31 2004 --- squid/helpers/basic_auth/SASL/Makefile.in Tue Jun 8 05:37:15 2004 *************** *** 87,92 **** --- 87,93 ---- INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LIBDLMALLOC = @LIBDLMALLOC@ LIBREGEX = @LIBREGEX@ + LIBSASL = @LIBSASL@ LIB_MALLOC = @LIB_MALLOC@ LN = @LN@ LN_S = @LN_S@ *************** *** 124,130 **** INCLUDES = -I$(top_srcdir)/include libexec_PROGRAMS = sasl_auth ! LDADD = -L$(top_builddir)/lib -lmiscutil -lsasl $(XTRA_LIBS) EXTRA_DIST = squid_sasl_auth squid_sasl_auth.conf subdir = helpers/basic_auth/SASL mkinstalldirs = $(SHELL) $(top_srcdir)/cfgaux/mkinstalldirs --- 125,131 ---- INCLUDES = -I$(top_srcdir)/include libexec_PROGRAMS = sasl_auth ! LDADD = -L$(top_builddir)/lib -lmiscutil $(LIBSASL) $(XTRA_LIBS) EXTRA_DIST = squid_sasl_auth squid_sasl_auth.conf subdir = helpers/basic_auth/SASL mkinstalldirs = $(SHELL) $(top_srcdir)/cfgaux/mkinstalldirs Index: squid/configure diff -c squid/configure:1.248.2.58 squid/configure:1.248.2.59 *** squid/configure:1.248.2.58 Tue Jun 1 18:11:29 2004 --- squid/configure Tue Jun 8 05:37:09 2004 *************** *** 2792,2798 **** if test -n "$BASIC_AUTH_HELPERS"; then for helper in $BASIC_AUTH_HELPERS; do if test -f $srcdir/helpers/basic_auth/$helper/Makefile.in; then ! : else echo "ERROR: Basic auth helper $helper does not exists" exit 1 --- 2792,2800 ---- if test -n "$BASIC_AUTH_HELPERS"; then for helper in $BASIC_AUTH_HELPERS; do if test -f $srcdir/helpers/basic_auth/$helper/Makefile.in; then ! if test "$helper" = "SASL"; then ! require_sasl=yes ! fi else echo "ERROR: Basic auth helper $helper does not exists" exit 1 *************** *** 2931,2936 **** --- 2933,3074 ---- + if test "$require_sasl" = "yes"; then + echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6 + echo "configure:2939: checking how to run the C preprocessor">&5 + # On Suns, sometimes $CPP names a directory. + if test -n "$CPP" && test -d "$CPP"; then + CPP= + fi + if test -z "$CPP"; then + if eval "test \"`echo '$''{'ac_cv_prog_CPP'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 + else + # This must be in double quotes, not single quotes, because CPP may get + # substituted into the Makefile and "${CC-cc}" will confuse make. + CPP="${CC-cc} -E" + # On the NeXT, cc -E runs the code through the compiler's parser, + # not just through cpp. + cat> conftest.$ac_ext < + Syntax Error + EOF + ac_try="$ac_cpp conftest.$ac_ext>/dev/null 2>conftest.out" + { (eval echo configure:2960: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } + ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` + if test -z "$ac_err"; then + : + else + echo "$ac_err">&5 + echo "configure: failed program was:">&5 + cat conftest.$ac_ext>&5 + rm -rf conftest* + CPP="${CC-cc} -E -traditional-cpp" + cat> conftest.$ac_ext < + Syntax Error + EOF + ac_try="$ac_cpp conftest.$ac_ext>/dev/null 2>conftest.out" + { (eval echo configure:2977: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } + ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` + if test -z "$ac_err"; then + : + else + echo "$ac_err">&5 + echo "configure: failed program was:">&5 + cat conftest.$ac_ext>&5 + rm -rf conftest* + CPP="${CC-cc} -nologo -E" + cat> conftest.$ac_ext < + Syntax Error + EOF + ac_try="$ac_cpp conftest.$ac_ext>/dev/null 2>conftest.out" + { (eval echo configure:2994: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } + ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` + if test -z "$ac_err"; then + : + else + echo "$ac_err">&5 + echo "configure: failed program was:">&5 + cat conftest.$ac_ext>&5 + rm -rf conftest* + CPP=/lib/cpp + fi + rm -f conftest* + fi + rm -f conftest* + fi + rm -f conftest* + ac_cv_prog_CPP="$CPP" + fi + CPP="$ac_cv_prog_CPP" + else + ac_cv_prog_CPP="$CPP" + fi + echo "$ac_t""$CPP" 1>&6 + + for ac_hdr in sasl/sasl.h sasl.h + do + ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` + echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 + echo "configure:3022: checking for $ac_hdr">&5 + if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 + else + cat> conftest.$ac_ext < + EOF + ac_try="$ac_cpp conftest.$ac_ext>/dev/null 2>conftest.out" + { (eval echo configure:3032: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } + ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` + if test -z "$ac_err"; then + rm -rf conftest* + eval "ac_cv_header_$ac_safe=yes" + else + echo "$ac_err">&5 + echo "configure: failed program was:">&5 + cat conftest.$ac_ext>&5 + rm -rf conftest* + eval "ac_cv_header_$ac_safe=no" + fi + rm -f conftest* + fi + if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then + echo "$ac_t""yes" 1>&6 + ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'` + cat>> confdefs.h <&6 + fi + done + + if test "$ac_cv_header_sasl_sasl_h" = "yes"; then + echo "using SASL2" + LIBSASL="-lsasl2" + else + if test "$ac_cv_header_sasl_h" = "yes"; then + echo "using SASL" + LIBSASL="-lsasl" + else + echo "ERROR: Neither SASL nor SASL2 found" + exit 1 + fi + fi + + fi + # Check whether --enable-unlinkd or --disable-unlinkd was given. if test "${enable_unlinkd+set}" = set; then enableval="$enable_unlinkd" *************** *** 8761,8769 **** s%@DIGEST_AUTH_HELPERS@%$DIGEST_AUTH_HELPERS%g s%@EXTERNAL_ACL_HELPERS@%$EXTERNAL_ACL_HELPERS%g s%@SAMBASOURCES@%$SAMBASOURCES%g s%@ENABLE_UNLINKD_TRUE@%$ENABLE_UNLINKD_TRUE%g s%@ENABLE_UNLINKD_FALSE@%$ENABLE_UNLINKD_FALSE%g - s%@CPP@%$CPP%g s%@RANLIB@%$RANLIB%g s%@LN_S@%$LN_S%g s%@SH@%$SH%g --- 8899,8908 ---- s%@DIGEST_AUTH_HELPERS@%$DIGEST_AUTH_HELPERS%g s%@EXTERNAL_ACL_HELPERS@%$EXTERNAL_ACL_HELPERS%g s%@SAMBASOURCES@%$SAMBASOURCES%g + s%@CPP@%$CPP%g + s%@LIBSASL@%$LIBSASL%g s%@ENABLE_UNLINKD_TRUE@%$ENABLE_UNLINKD_TRUE%g s%@ENABLE_UNLINKD_FALSE@%$ENABLE_UNLINKD_FALSE%g s%@RANLIB@%$RANLIB%g s%@LN_S@%$LN_S%g s%@SH@%$SH%g

AltStyle によって変換されたページ (->オリジナル) /