dnl
dnl Duane Wessels, wessels@nlanr.net, February 1996 (autoconf v2.9)
dnl
-dnl $Id: configure.in,v 1.376 2005/06/06 00:38:59 hno Exp $
+dnl $Id: configure.in,v 1.377 2005/07/01 22:34:50 hno Exp $
dnl
dnl
dnl
AC_CONFIG_AUX_DIR(cfgaux)
AM_INIT_AUTOMAKE(squid, 3.0-PRE3-CVS)
AM_CONFIG_HEADER(include/autoconf.h)
-AC_REVISION($Revision: 1.376 $)dnl
+AC_REVISION($Revision: 1.377 $)dnl
AC_PREFIX_DEFAULT(/usr/local/squid)
AM_MAINTAINER_MODE
])
-SAMBASOURCES='$(top_srcdir)/include/samba'
-AC_ARG_WITH(samba-sources,
-[ --with-samba-sources=/path/to/samba-source-tree
- Path where the correct Samba source files can be
- found while building winbind helpers. (defaults to
- use internal copies of the headers from Samba-2.2.7)
- ],
-[ if test -f $withval/source/nsswitch/winbind_nss_config.h; then
- echo "Using Samba sources from $withval"
- SAMBASOURCES="$withval/source"
- else
- echo "ERROR: Cannot find Samba sources at $withval"
- exit 1
- fi
-])
-AC_SUBST(SAMBASOURCES)
-
dnl Check for Cyrus SASL
if test "$require_sasl" = "yes"; then
AC_CHECK_HEADERS(sasl/sasl.h sasl.h)
helpers/basic_auth/getpwnam/Makefile \
helpers/basic_auth/multi-domain-NTLM/Makefile \
helpers/basic_auth/SASL/Makefile \
- helpers/basic_auth/winbind/Makefile \
helpers/digest_auth/Makefile \
helpers/digest_auth/password/Makefile \
helpers/ntlm_auth/Makefile \
helpers/ntlm_auth/no_check/Makefile \
helpers/ntlm_auth/SMB/Makefile \
helpers/ntlm_auth/SMB/smbval/Makefile \
- helpers/ntlm_auth/winbind/Makefile \
helpers/external_acl/Makefile \
helpers/external_acl/ip_user/Makefile \
helpers/external_acl/ldap_group/Makefile \
helpers/external_acl/unix_group/Makefile \
- helpers/external_acl/wbinfo_group/Makefile \
- helpers/external_acl/winbind_group/Makefile
+ helpers/external_acl/wbinfo_group/Makefile
])
AC_CONFIG_SUBDIRS(lib/libTrie)
# Makefile for storage modules in the Squid Object Cache server
#
-# $Id: Makefile.am,v 1.4 2003/01/23 00:35:16 robertc Exp $
+# $Id: Makefile.am,v 1.5 2005/07/01 22:34:50 hno Exp $
#
-DIST_SUBDIRS = getpwnam LDAP MSNT multi-domain-NTLM NCSA PAM SMB YP SASL winbind
+DIST_SUBDIRS = getpwnam LDAP MSNT multi-domain-NTLM NCSA PAM SMB YP SASL
SUBDIRS = @BASIC_AUTH_HELPERS@
+++ /dev/null
-#
-# Makefile for the Squid Object Cache server
-#
-# $Id: Makefile.am,v 1.7 2003/02/11 14:34:31 hno Exp $
-#
-
-libexec_PROGRAMS = wb_auth
-wb_auth_SOURCES = wb_basic_auth.c wb_common.c wbntlm.h
-INCLUDES = -I$(top_srcdir)/include -I@SAMBASOURCES@
-LDADD = -L$(top_builddir)/lib -lmiscutil -lntlmauth $(XTRA_LIBS)
+++ /dev/null
-# Makefile.in generated by automake 1.9.5 from Makefile.am.
-# @configure_input@
-
-# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
-# 2003, 2004, 2005 Free Software Foundation, Inc.
-# This Makefile.in is free software; the Free Software Foundation
-# gives unlimited permission to copy and/or distribute it,
-# with or without modifications, as long as this notice is preserved.
-
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
-# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
-# PARTICULAR PURPOSE.
-
-@SET_MAKE@
-
-#
-# Makefile for the Squid Object Cache server
-#
-# $Id: Makefile.in,v 1.46 2005/06/06 00:39:56 hno Exp $
-#
-
-SOURCES = $(wb_auth_SOURCES)
-
-srcdir = @srcdir@
-top_srcdir = @top_srcdir@
-VPATH = @srcdir@
-pkgdatadir = $(datadir)/@PACKAGE@
-pkglibdir = $(libdir)/@PACKAGE@
-pkgincludedir = $(includedir)/@PACKAGE@
-top_builddir = ../../..
-am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
-INSTALL = @INSTALL@
-install_sh_DATA = $(install_sh) -c -m 644
-install_sh_PROGRAM = $(install_sh) -c
-install_sh_SCRIPT = $(install_sh) -c
-INSTALL_HEADER = $(INSTALL_DATA)
-transform = $(program_transform_name)
-NORMAL_INSTALL = :
-PRE_INSTALL = :
-POST_INSTALL = :
-NORMAL_UNINSTALL = :
-PRE_UNINSTALL = :
-POST_UNINSTALL = :
-build_triplet = @build@
-host_triplet = @host@
-libexec_PROGRAMS = wb_auth$(EXEEXT)
-subdir = helpers/basic_auth/winbind
-DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
-ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/acinclude.m4 \
- $(top_srcdir)/configure.in
-am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
- $(ACLOCAL_M4)
-mkinstalldirs = $(SHELL) $(top_srcdir)/cfgaux/mkinstalldirs
-CONFIG_HEADER = $(top_builddir)/include/autoconf.h
-CONFIG_CLEAN_FILES =
-am__installdirs = "$(DESTDIR)$(libexecdir)"
-libexecPROGRAMS_INSTALL = $(INSTALL_PROGRAM)
-PROGRAMS = $(libexec_PROGRAMS)
-am_wb_auth_OBJECTS = wb_basic_auth.$(OBJEXT) wb_common.$(OBJEXT)
-wb_auth_OBJECTS = $(am_wb_auth_OBJECTS)
-wb_auth_LDADD = $(LDADD)
-am__DEPENDENCIES_1 =
-wb_auth_DEPENDENCIES = $(am__DEPENDENCIES_1)
-DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir)/include
-depcomp = $(SHELL) $(top_srcdir)/cfgaux/depcomp
-am__depfiles_maybe = depfiles
-COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
- $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
-LTCOMPILE = $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) \
- $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \
- $(AM_CFLAGS) $(CFLAGS)
-CCLD = $(CC)
-LINK = $(LIBTOOL) --tag=CC --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
- $(AM_LDFLAGS) $(LDFLAGS) -o $@
-SOURCES = $(wb_auth_SOURCES)
-DIST_SOURCES = $(wb_auth_SOURCES)
-ETAGS = etags
-CTAGS = ctags
-DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
-ACLOCAL = @ACLOCAL@
-ALLOCA = @ALLOCA@
-AMDEP_FALSE = @AMDEP_FALSE@
-AMDEP_TRUE = @AMDEP_TRUE@
-AMTAR = @AMTAR@
-AR = @AR@
-AR_R = @AR_R@
-AUTH_LIBS = @AUTH_LIBS@
-AUTH_LINKOBJS = @AUTH_LINKOBJS@
-AUTH_MODULES = @AUTH_MODULES@
-AUTH_OBJS = @AUTH_OBJS@
-AUTOCONF = @AUTOCONF@
-AUTOHEADER = @AUTOHEADER@
-AUTOMAKE = @AUTOMAKE@
-AWK = @AWK@
-BASIC_AUTH_HELPERS = @BASIC_AUTH_HELPERS@
-CC = @CC@
-CCDEPMODE = @CCDEPMODE@
-CFLAGS = @CFLAGS@
-CGIEXT = @CGIEXT@
-CPP = @CPP@
-CPPFLAGS = @CPPFLAGS@
-CRYPTLIB = @CRYPTLIB@
-CXX = @CXX@
-CXXCPP = @CXXCPP@
-CXXDEPMODE = @CXXDEPMODE@
-CXXFLAGS = @CXXFLAGS@
-CYGPATH_W = @CYGPATH_W@
-DEFS = @DEFS@
-DEPDIR = @DEPDIR@
-DIGEST_AUTH_HELPERS = @DIGEST_AUTH_HELPERS@
-DISK_LIBS = @DISK_LIBS@
-DISK_LINKOBJS = @DISK_LINKOBJS@
-DISK_PROGRAMS = @DISK_PROGRAMS@
-ECHO = @ECHO@
-ECHO_C = @ECHO_C@
-ECHO_N = @ECHO_N@
-ECHO_T = @ECHO_T@
-EGREP = @EGREP@
-ENABLE_ARP_ACL_FALSE = @ENABLE_ARP_ACL_FALSE@
-ENABLE_ARP_ACL_TRUE = @ENABLE_ARP_ACL_TRUE@
-ENABLE_HTCP_FALSE = @ENABLE_HTCP_FALSE@
-ENABLE_HTCP_TRUE = @ENABLE_HTCP_TRUE@
-ENABLE_IDENT_FALSE = @ENABLE_IDENT_FALSE@
-ENABLE_IDENT_TRUE = @ENABLE_IDENT_TRUE@
-ENABLE_PINGER_FALSE = @ENABLE_PINGER_FALSE@
-ENABLE_PINGER_TRUE = @ENABLE_PINGER_TRUE@
-ENABLE_SSL_FALSE = @ENABLE_SSL_FALSE@
-ENABLE_SSL_TRUE = @ENABLE_SSL_TRUE@
-ENABLE_UNLINKD_FALSE = @ENABLE_UNLINKD_FALSE@
-ENABLE_UNLINKD_TRUE = @ENABLE_UNLINKD_TRUE@
-ENABLE_WIN32SPECIFIC_FALSE = @ENABLE_WIN32SPECIFIC_FALSE@
-ENABLE_WIN32SPECIFIC_TRUE = @ENABLE_WIN32SPECIFIC_TRUE@
-ENABLE_XPROF_STATS_FALSE = @ENABLE_XPROF_STATS_FALSE@
-ENABLE_XPROF_STATS_TRUE = @ENABLE_XPROF_STATS_TRUE@
-EPOLL_LIBS = @EPOLL_LIBS@
-ERR_DEFAULT_LANGUAGE = @ERR_DEFAULT_LANGUAGE@
-ERR_LANGUAGES = @ERR_LANGUAGES@
-EXEEXT = @EXEEXT@
-EXTERNAL_ACL_HELPERS = @EXTERNAL_ACL_HELPERS@
-F77 = @F77@
-FALSE = @FALSE@
-FFLAGS = @FFLAGS@
-INSTALL_DATA = @INSTALL_DATA@
-INSTALL_PROGRAM = @INSTALL_PROGRAM@
-INSTALL_SCRIPT = @INSTALL_SCRIPT@
-INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
-LDFLAGS = @LDFLAGS@
-LIBADD_DL = @LIBADD_DL@
-LIBDLMALLOC = @LIBDLMALLOC@
-LIBOBJS = @LIBOBJS@
-LIBREGEX = @LIBREGEX@
-LIBS = @LIBS@
-LIBSASL = @LIBSASL@
-LIBTOOL = @LIBTOOL@
-LIB_LBER = @LIB_LBER@
-LIB_LDAP = @LIB_LDAP@
-LIB_MALLOC = @LIB_MALLOC@
-LN = @LN@
-LN_S = @LN_S@
-LTLIBOBJS = @LTLIBOBJS@
-MAINT = @MAINT@
-MAINTAINER_MODE_FALSE = @MAINTAINER_MODE_FALSE@
-MAINTAINER_MODE_TRUE = @MAINTAINER_MODE_TRUE@
-MAKEINFO = @MAKEINFO@
-MAKE_LEAKFINDER_FALSE = @MAKE_LEAKFINDER_FALSE@
-MAKE_LEAKFINDER_TRUE = @MAKE_LEAKFINDER_TRUE@
-MKDIR = @MKDIR@
-MV = @MV@
-NEED_OWN_MD5_FALSE = @NEED_OWN_MD5_FALSE@
-NEED_OWN_MD5_TRUE = @NEED_OWN_MD5_TRUE@
-NEED_OWN_SNPRINTF_FALSE = @NEED_OWN_SNPRINTF_FALSE@
-NEED_OWN_SNPRINTF_TRUE = @NEED_OWN_SNPRINTF_TRUE@
-NTLM_AUTH_HELPERS = @NTLM_AUTH_HELPERS@
-OBJEXT = @OBJEXT@
-OPT_DEFAULT_HOSTS = @OPT_DEFAULT_HOSTS@
-PACKAGE = @PACKAGE@
-PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
-PACKAGE_NAME = @PACKAGE_NAME@
-PACKAGE_STRING = @PACKAGE_STRING@
-PACKAGE_TARNAME = @PACKAGE_TARNAME@
-PACKAGE_VERSION = @PACKAGE_VERSION@
-PATH_SEPARATOR = @PATH_SEPARATOR@
-PERL = @PERL@
-RANLIB = @RANLIB@
-REGEXLIB = @REGEXLIB@
-REPL_LIBS = @REPL_LIBS@
-REPL_OBJS = @REPL_OBJS@
-REPL_POLICIES = @REPL_POLICIES@
-RM = @RM@
-SAMBASOURCES = @SAMBASOURCES@
-SET_MAKE = @SET_MAKE@
-SH = @SH@
-SHELL = @SHELL@
-SNMPLIB = @SNMPLIB@
-SQUID_CFLAGS = @SQUID_CFLAGS@
-SQUID_CPPUNIT_DIR = @SQUID_CPPUNIT_DIR@
-SQUID_CPPUNIT_INC = @SQUID_CPPUNIT_INC@
-SQUID_CPPUNIT_LA = @SQUID_CPPUNIT_LA@
-SQUID_CXXFLAGS = @SQUID_CXXFLAGS@
-SSLLIB = @SSLLIB@
-STORE_LIBS = @STORE_LIBS@
-STORE_LINKOBJS = @STORE_LINKOBJS@
-STORE_OBJS = @STORE_OBJS@
-STRIP = @STRIP@
-TRUE = @TRUE@
-USE_DELAY_POOLS_FALSE = @USE_DELAY_POOLS_FALSE@
-USE_DELAY_POOLS_TRUE = @USE_DELAY_POOLS_TRUE@
-USE_DNSSERVER_FALSE = @USE_DNSSERVER_FALSE@
-USE_DNSSERVER_TRUE = @USE_DNSSERVER_TRUE@
-USE_ESI_FALSE = @USE_ESI_FALSE@
-USE_ESI_TRUE = @USE_ESI_TRUE@
-USE_SNMP_FALSE = @USE_SNMP_FALSE@
-USE_SNMP_TRUE = @USE_SNMP_TRUE@
-VERSION = @VERSION@
-WIN32_PSAPI = @WIN32_PSAPI@
-XTRA_LIBS = @XTRA_LIBS@
-XTRA_OBJS = @XTRA_OBJS@
-ac_ct_AR = @ac_ct_AR@
-ac_ct_CC = @ac_ct_CC@
-ac_ct_CXX = @ac_ct_CXX@
-ac_ct_F77 = @ac_ct_F77@
-ac_ct_RANLIB = @ac_ct_RANLIB@
-ac_ct_STRIP = @ac_ct_STRIP@
-am__fastdepCC_FALSE = @am__fastdepCC_FALSE@
-am__fastdepCC_TRUE = @am__fastdepCC_TRUE@
-am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@
-am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@
-am__include = @am__include@
-am__leading_dot = @am__leading_dot@
-am__quote = @am__quote@
-am__tar = @am__tar@
-am__untar = @am__untar@
-bindir = @bindir@
-build = @build@
-build_alias = @build_alias@
-build_cpu = @build_cpu@
-build_os = @build_os@
-build_vendor = @build_vendor@
-datadir = @datadir@
-exec_prefix = @exec_prefix@
-host = @host@
-host_alias = @host_alias@
-host_cpu = @host_cpu@
-host_os = @host_os@
-host_vendor = @host_vendor@
-includedir = @includedir@
-infodir = @infodir@
-install_sh = @install_sh@
-libdir = @libdir@
-libexecdir = @libexecdir@
-localstatedir = @localstatedir@
-makesnmplib = @makesnmplib@
-mandir = @mandir@
-mkdir_p = @mkdir_p@
-oldincludedir = @oldincludedir@
-prefix = @prefix@
-program_transform_name = @program_transform_name@
-sbindir = @sbindir@
-sharedstatedir = @sharedstatedir@
-subdirs = @subdirs@
-sysconfdir = @sysconfdir@
-target_alias = @target_alias@
-wb_auth_SOURCES = wb_basic_auth.c wb_common.c wbntlm.h
-INCLUDES = -I$(top_srcdir)/include -I@SAMBASOURCES@
-LDADD = -L$(top_builddir)/lib -lmiscutil -lntlmauth $(XTRA_LIBS)
-all: all-am
-
-.SUFFIXES:
-.SUFFIXES: .c .lo .o .obj
-$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps)
- @for dep in $?; do \
- case '$(am__configure_deps)' in \
- *$$dep*) \
- cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \
- && exit 0; \
- exit 1;; \
- esac; \
- done; \
- echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign helpers/basic_auth/winbind/Makefile'; \
- cd $(top_srcdir) && \
- $(AUTOMAKE) --foreign helpers/basic_auth/winbind/Makefile
-.PRECIOUS: Makefile
-Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
- @case '$?' in \
- *config.status*) \
- cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
- *) \
- echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
- cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
- esac;
-
-$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
- cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
-
-$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
- cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
-$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps)
- cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
-install-libexecPROGRAMS: $(libexec_PROGRAMS)
- @$(NORMAL_INSTALL)
- test -z "$(libexecdir)" || $(mkdir_p) "$(DESTDIR)$(libexecdir)"
- @list='$(libexec_PROGRAMS)'; for p in $$list; do \
- p1=`echo $$p|sed 's/$(EXEEXT)$$//'`; \
- if test -f $$p \
- || test -f $$p1 \
- ; then \
- f=`echo "$$p1" | sed 's,^.*/,,;$(transform);s/$$/$(EXEEXT)/'`; \
- echo " $(INSTALL_PROGRAM_ENV) $(LIBTOOL) --mode=install $(libexecPROGRAMS_INSTALL) '$$p' '$(DESTDIR)$(libexecdir)/$$f'"; \
- $(INSTALL_PROGRAM_ENV) $(LIBTOOL) --mode=install $(libexecPROGRAMS_INSTALL) "$$p" "$(DESTDIR)$(libexecdir)/$$f" || exit 1; \
- else :; fi; \
- done
-
-uninstall-libexecPROGRAMS:
- @$(NORMAL_UNINSTALL)
- @list='$(libexec_PROGRAMS)'; for p in $$list; do \
- f=`echo "$$p" | sed 's,^.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/'`; \
- echo " rm -f '$(DESTDIR)$(libexecdir)/$$f'"; \
- rm -f "$(DESTDIR)$(libexecdir)/$$f"; \
- done
-
-clean-libexecPROGRAMS:
- @list='$(libexec_PROGRAMS)'; for p in $$list; do \
- f=`echo $$p|sed 's/$(EXEEXT)$$//'`; \
- echo " rm -f $$p $$f"; \
- rm -f $$p $$f ; \
- done
-wb_auth$(EXEEXT): $(wb_auth_OBJECTS) $(wb_auth_DEPENDENCIES)
- @rm -f wb_auth$(EXEEXT)
- $(LINK) $(wb_auth_LDFLAGS) $(wb_auth_OBJECTS) $(wb_auth_LDADD) $(LIBS)
-
-mostlyclean-compile:
- -rm -f *.$(OBJEXT)
-
-distclean-compile:
- -rm -f *.tab.c
-
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/wb_basic_auth.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/wb_common.Po@am__quote@
-
-.c.o:
-@am__fastdepCC_TRUE@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \
-@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(COMPILE) -c $<
-
-.c.obj:
-@am__fastdepCC_TRUE@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ `$(CYGPATH_W) '$<'`; \
-@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'`
-
-.c.lo:
-@am__fastdepCC_TRUE@ if $(LTCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \
-@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Plo"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $<
-
-mostlyclean-libtool:
- -rm -f *.lo
-
-clean-libtool:
- -rm -rf .libs _libs
-
-distclean-libtool:
- -rm -f libtool
-uninstall-info-am:
-
-ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
- list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
- unique=`for i in $$list; do \
- if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
- done | \
- $(AWK) ' { files[$$0] = 1; } \
- END { for (i in files) print i; }'`; \
- mkid -fID $$unique
-tags: TAGS
-
-TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
- $(TAGS_FILES) $(LISP)
- tags=; \
- here=`pwd`; \
- list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
- unique=`for i in $$list; do \
- if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
- done | \
- $(AWK) ' { files[$$0] = 1; } \
- END { for (i in files) print i; }'`; \
- if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \
- test -n "$$unique" || unique=$$empty_fix; \
- $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
- $$tags $$unique; \
- fi
-ctags: CTAGS
-CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
- $(TAGS_FILES) $(LISP)
- tags=; \
- here=`pwd`; \
- list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
- unique=`for i in $$list; do \
- if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
- done | \
- $(AWK) ' { files[$$0] = 1; } \
- END { for (i in files) print i; }'`; \
- test -z "$(CTAGS_ARGS)$$tags$$unique" \
- || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
- $$tags $$unique
-
-GTAGS:
- here=`$(am__cd) $(top_builddir) && pwd` \
- && cd $(top_srcdir) \
- && gtags -i $(GTAGS_ARGS) $$here
-
-distclean-tags:
- -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
-
-distdir: $(DISTFILES)
- @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \
- topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \
- list='$(DISTFILES)'; for file in $$list; do \
- case $$file in \
- $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \
- $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \
- esac; \
- if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
- dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \
- if test "$$dir" != "$$file" && test "$$dir" != "."; then \
- dir="/$$dir"; \
- $(mkdir_p) "$(distdir)$$dir"; \
- else \
- dir=''; \
- fi; \
- if test -d $$d/$$file; then \
- if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
- cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
- fi; \
- cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
- else \
- test -f $(distdir)/$$file \
- || cp -p $$d/$$file $(distdir)/$$file \
- || exit 1; \
- fi; \
- done
-check-am: all-am
-check: check-am
-all-am: Makefile $(PROGRAMS)
-installdirs:
- for dir in "$(DESTDIR)$(libexecdir)"; do \
- test -z "$$dir" || $(mkdir_p) "$$dir"; \
- done
-install: install-am
-install-exec: install-exec-am
-install-data: install-data-am
-uninstall: uninstall-am
-
-install-am: all-am
- @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
-
-installcheck: installcheck-am
-install-strip:
- $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
- install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
- `test -z '$(STRIP)' || \
- echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
-mostlyclean-generic:
-
-clean-generic:
-
-distclean-generic:
- -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
-
-maintainer-clean-generic:
- @echo "This command is intended for maintainers to use"
- @echo "it deletes files that may require special tools to rebuild."
-clean: clean-am
-
-clean-am: clean-generic clean-libexecPROGRAMS clean-libtool \
- mostlyclean-am
-
-distclean: distclean-am
- -rm -rf ./$(DEPDIR)
- -rm -f Makefile
-distclean-am: clean-am distclean-compile distclean-generic \
- distclean-libtool distclean-tags
-
-dvi: dvi-am
-
-dvi-am:
-
-html: html-am
-
-info: info-am
-
-info-am:
-
-install-data-am:
-
-install-exec-am: install-libexecPROGRAMS
-
-install-info: install-info-am
-
-install-man:
-
-installcheck-am:
-
-maintainer-clean: maintainer-clean-am
- -rm -rf ./$(DEPDIR)
- -rm -f Makefile
-maintainer-clean-am: distclean-am maintainer-clean-generic
-
-mostlyclean: mostlyclean-am
-
-mostlyclean-am: mostlyclean-compile mostlyclean-generic \
- mostlyclean-libtool
-
-pdf: pdf-am
-
-pdf-am:
-
-ps: ps-am
-
-ps-am:
-
-uninstall-am: uninstall-info-am uninstall-libexecPROGRAMS
-
-.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \
- clean-libexecPROGRAMS clean-libtool ctags distclean \
- distclean-compile distclean-generic distclean-libtool \
- distclean-tags distdir dvi dvi-am html html-am info info-am \
- install install-am install-data install-data-am install-exec \
- install-exec-am install-info install-info-am \
- install-libexecPROGRAMS install-man install-strip installcheck \
- installcheck-am installdirs maintainer-clean \
- maintainer-clean-generic mostlyclean mostlyclean-compile \
- mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
- tags uninstall uninstall-am uninstall-info-am \
- uninstall-libexecPROGRAMS
-
-# Tell versions [3.59,3.63) of GNU make to not export all variables.
-# Otherwise a system limit (for SysV at least) may be exceeded.
-.NOEXPORT:
+++ /dev/null
-/*
- * (C) 2000 Francesco Chemolli <kinkie@kame.usr.dsi.unimi.it>
- *
- * Distributed freely under the terms of the GNU General Public License,
- * version 2. See the file COPYING for licensing details
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
-
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111, USA.
- *
- */
-
-
-#include "wbntlm.h"
-#include "util.h"
-/* stdio.h is included in wbntlm.h */
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <unistd.h>
-#include <sys/time.h> /* for gettimeofday */
-#include <errno.h> /* BUG: is this portable? */
-
-#include "nsswitch/winbind_nss_config.h"
-#include "nsswitch/winbindd_nss.h"
-
-char debug_enabled=0;
-char *myname;
-pid_t mypid;
-
-NSS_STATUS winbindd_request(int req_type,
- struct winbindd_request *request,
- struct winbindd_response *response);
-
-
-void do_authenticate(char *user, char *pass)
-{
- struct winbindd_request request;
- struct winbindd_response response;
- NSS_STATUS winbindd_result;
-
- memset(&request,0,sizeof(struct winbindd_request));
- memset(&response,0,sizeof(struct winbindd_response));
-
- strncpy(request.data.auth.user,user,sizeof(fstring)-1);
- strncpy(request.data.auth.pass,pass,sizeof(fstring)-1);
-
- winbindd_result = winbindd_request(WINBINDD_PAM_AUTH,
- &request, &response);
- debug("winbindd result: %d\n",winbindd_result);
-
- if (winbindd_result==NSS_STATUS_SUCCESS) {
- SEND("OK");
- } else {
- SEND("ERR");
- }
-
- return; /* useless */
-}
-
-static void
-usage(char *program)
-{
- fprintf(stderr,"Usage: %s [-d] [-h]\n"
- " -d enable debugging\n"
- " -h this message\n",
- program);
-}
-
-void
-process_options(int argc, char *argv[])
-{
- int opt;
-
- opterr = 0;
- while (-1 != (opt = getopt(argc, argv, "dh"))) {
- switch (opt) {
- case 'd':
- debug_enabled = 1;
- break;
- case 'h':
- usage(argv[0]);
- exit(0);
- case '?':
- opt = optopt;
- /* fall thru to default */
- default:
- warn("Unknown option: -%c\n\n", opt);
- usage(argv[0]);
- exit(1);
- break; /* not reached */
- }
- }
- return;
-}
-
-int manage_request(void)
-{
- char buf[BUFFER_SIZE+1];
- int length;
- char *c, *user, *pass;
-
- if (fgets(buf, BUFFER_SIZE, stdin) == NULL)
- return 0;
-
- c=memchr(buf,'\n',BUFFER_SIZE);
- if (c) {
- *c = '\0';
- length = c-buf;
- } else {
- warn("Oversized message\n");
- fgets(buf, BUFFER_SIZE, stdin);
- SEND("ERR");
- return 1;
- }
-
- debug("Got '%s' from squid (length: %d).\n",buf,length);
-
- if (buf[0] == '\0') {
- warn("Invalid Request\n");
- SEND("ERR");
- return 1;
- }
-
- user=buf;
-
- pass=memchr(buf,' ',length);
- if (!pass) {
- warn("Password not found. Denying access\n");
- SEND("ERR");
- return 1;
- }
- *pass='\0';
- pass++;
-
- rfc1738_unescape(user);
- rfc1738_unescape(pass);
-
- do_authenticate(user,pass);
- return 1;
-}
-
-void
-check_winbindd()
-{
- NSS_STATUS r;
- int retry=10;
- struct winbindd_request request;
- struct winbindd_response response;
- do {
- r = winbindd_request(WINBINDD_INTERFACE_VERSION, &request, &response);
- if (r != NSS_STATUS_SUCCESS)
- retry--;
- } while (r != NSS_STATUS_SUCCESS && retry);
- if (r != NSS_STATUS_SUCCESS) {
- warn("Can't contact winbindd. Dying\n");
- exit(1);
- }
- if (response.data.interface_version != WINBIND_INTERFACE_VERSION) {
- warn("Winbind protocol mismatch. Align squid and samba. Dying\n");
- exit(1);
- }
-}
-
-
-int main (int argc, char ** argv)
-{
- if (argc > 0) { /* should always be true */
- myname=strrchr(argv[0],'/');
- if (myname==NULL)
- myname=argv[0];
- } else {
- myname="(unknown)";
- }
- mypid=getpid();
- process_options(argc, argv);
-
- debug("basic winbindd auth helper build " __DATE__ ", " __TIME__
- " starting up...\n");
- /* initialize FDescs */
- setbuf(stdout, NULL);
- setbuf(stderr, NULL);
-
- check_winbindd();
-
- while(manage_request()) {
- /* everything is done within manage_request */
- }
- return 0;
-}
+++ /dev/null
-/*
- Unix SMB/Netbios implementation.
- Version 2.0
-
- winbind client common code
-
- Copyright (C) Tim Potter 2000
- Copyright (C) Andrew Tridgell 2000
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Library General Public
- License as published by the Free Software Foundation; either
- version 2 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Library General Public License for more details.
-
- You should have received a copy of the GNU Library General Public
- License along with this library; if not, write to the
- Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- Boston, MA 02111-1307, USA.
-*/
-
-#include "nsswitch/winbind_nss_config.h"
-#include "nsswitch/winbindd_nss.h"
-#include "config.h"
-
-
-/* Global variables. These are effectively the client state information */
-
-int winbindd_fd = -1; /* fd for winbindd socket */
-static char *excluded_domain;
-
-/* Free a response structure */
-
-void free_response(struct winbindd_response *response)
-{
- /* Free any allocated extra_data */
-
- if (response)
- SAFE_FREE(response->extra_data);
-}
-
-/*
- smbd needs to be able to exclude lookups for its own domain
-*/
-void winbind_exclude_domain(const char *domain)
-{
- SAFE_FREE(excluded_domain);
- excluded_domain = strdup(domain);
-}
-
-
-/* Initialise a request structure */
-
-void init_request(struct winbindd_request *request, int request_type)
-{
- static char *domain_env;
- static BOOL initialised;
-
- request->length = sizeof(struct winbindd_request);
-
- request->cmd = (enum winbindd_cmd)request_type;
- request->pid = getpid();
- request->domain[0] = '\0';
-
- if (!initialised) {
- initialised = True;
- domain_env = getenv(WINBINDD_DOMAIN_ENV);
- }
-
- if (domain_env) {
- strncpy(request->domain, domain_env,
- sizeof(request->domain) - 1);
- request->domain[sizeof(request->domain) - 1] = '\0';
- }
-}
-
-/* Initialise a response structure */
-
-void init_response(struct winbindd_response *response)
-{
- /* Initialise return value */
-
- response->result = WINBINDD_ERROR;
-}
-
-/* Close established socket */
-
-void close_sock(void)
-{
- if (winbindd_fd != -1) {
- close(winbindd_fd);
- winbindd_fd = -1;
- }
-}
-
-/* Connect to winbindd socket */
-
-int winbind_open_pipe_sock(void)
-{
- struct sockaddr_un sunaddr;
- static pid_t our_pid;
- struct stat st;
- pstring path;
-
- if (our_pid != getpid()) {
- close_sock();
- our_pid = getpid();
- }
-
- if (winbindd_fd != -1) {
- return winbindd_fd;
- }
-
- /* Check permissions on unix socket directory */
-
- if (lstat(WINBINDD_SOCKET_DIR, &st) == -1) {
- return -1;
- }
-
- if (!S_ISDIR(st.st_mode) ||
- (st.st_uid != 0 && st.st_uid != geteuid())) {
- return -1;
- }
-
- /* Connect to socket */
-
- strncpy(path, WINBINDD_SOCKET_DIR, sizeof(path) - 1);
- path[sizeof(path) - 1] = '\0';
-
- strncat(path, "/", sizeof(path) - 1);
- path[sizeof(path) - 1] = '\0';
-
- strncat(path, WINBINDD_SOCKET_NAME, sizeof(path) - 1);
- path[sizeof(path) - 1] = '\0';
-
- ZERO_STRUCT(sunaddr);
- sunaddr.sun_family = AF_UNIX;
- strncpy(sunaddr.sun_path, path, sizeof(sunaddr.sun_path) - 1);
-
- /* If socket file doesn't exist, don't bother trying to connect
- with retry. This is an attempt to make the system usable when
- the winbindd daemon is not running. */
-
- if (lstat(path, &st) == -1) {
- return -1;
- }
-
- /* Check permissions on unix socket file */
-
- if (!S_ISSOCK(st.st_mode) ||
- (st.st_uid != 0 && st.st_uid != geteuid())) {
- return -1;
- }
-
- /* Connect to socket */
-
- if ((winbindd_fd = socket(AF_UNIX, SOCK_STREAM, 0)) == -1) {
- return -1;
- }
-
- if (connect(winbindd_fd, (struct sockaddr *)&sunaddr,
- sizeof(sunaddr)) == -1) {
- close_sock();
- return -1;
- }
-
- return winbindd_fd;
-}
-
-/* Write data to winbindd socket with timeout */
-
-int write_sock(void *buffer, int count)
-{
- int result, nwritten;
-
- /* Open connection to winbind daemon */
-
- restart:
-
- if (winbind_open_pipe_sock() == -1) {
- return -1;
- }
-
- /* Write data to socket */
-
- nwritten = 0;
-
- while(nwritten < count) {
- struct timeval tv;
- fd_set r_fds;
-
- /* Catch pipe close on other end by checking if a read()
- call would not block by calling select(). */
-
- FD_ZERO(&r_fds);
- FD_SET(winbindd_fd, &r_fds);
- ZERO_STRUCT(tv);
-
- if (select(winbindd_fd + 1, &r_fds, NULL, NULL, &tv) == -1) {
- close_sock();
- return -1; /* Select error */
- }
-
- /* Write should be OK if fd not available for reading */
-
- if (!FD_ISSET(winbindd_fd, &r_fds)) {
-
- /* Do the write */
-
- result = write(winbindd_fd,
- (char *)buffer + nwritten,
- count - nwritten);
-
- if ((result == -1) || (result == 0)) {
-
- /* Write failed */
-
- close_sock();
- return -1;
- }
-
- nwritten += result;
-
- } else {
-
- /* Pipe has closed on remote end */
-
- close_sock();
- goto restart;
- }
- }
-
- return nwritten;
-}
-
-/* Read data from winbindd socket with timeout */
-
-static int read_sock(void *buffer, int count)
-{
- int result = 0, nread = 0;
-
- /* Read data from socket */
-
- while(nread < count) {
-
- result = read(winbindd_fd, (char *)buffer + nread,
- count - nread);
-
- if ((result == -1) || (result == 0)) {
-
- /* Read failed. I think the only useful thing we
- can do here is just return -1 and fail since the
- transaction has failed half way through. */
-
- close_sock();
- return -1;
- }
-
- nread += result;
- }
-
- return result;
-}
-
-/* Read reply */
-
-int read_reply(struct winbindd_response *response)
-{
- int result1, result2 = 0;
-
- if (!response) {
- return -1;
- }
-
- /* Read fixed length response */
-
- if ((result1 = read_sock(response, sizeof(struct winbindd_response)))
- == -1) {
-
- return -1;
- }
-
- /* We actually send the pointer value of the extra_data field from
- the server. This has no meaning in the client's address space
- so we clear it out. */
-
- response->extra_data = NULL;
-
- /* Read variable length response */
-
- if (response->length > sizeof(struct winbindd_response)) {
- int extra_data_len = response->length -
- sizeof(struct winbindd_response);
-
- /* Mallocate memory for extra data */
-
- if (!(response->extra_data = malloc(extra_data_len))) {
- return -1;
- }
-
- if ((result2 = read_sock(response->extra_data, extra_data_len))
- == -1) {
- free_response(response);
- return -1;
- }
- }
-
- /* Return total amount of data read */
-
- return result1 + result2;
-}
-
-/*
- * send simple types of requests
- */
-
-NSS_STATUS winbindd_send_request(int req_type, struct winbindd_request *request)
-{
- struct winbindd_request lrequest;
-
- /* Check for our tricky environment variable */
-
- if (getenv(WINBINDD_DONT_ENV)) {
- return NSS_STATUS_NOTFOUND;
- }
-
- /* smbd may have excluded this domain */
- if (excluded_domain &&
- strcasecmp(excluded_domain, request->domain) == 0) {
- return NSS_STATUS_NOTFOUND;
- }
-
- if (!request) {
- ZERO_STRUCT(lrequest);
- request = &lrequest;
- }
-
- /* Fill in request and send down pipe */
-
- init_request(request, req_type);
-
- if (write_sock(request, sizeof(*request)) == -1) {
- return NSS_STATUS_UNAVAIL;
- }
-
- return NSS_STATUS_SUCCESS;
-}
-
-/*
- * Get results from winbindd request
- */
-
-NSS_STATUS winbindd_get_response(struct winbindd_response *response)
-{
- struct winbindd_response lresponse;
-
- if (!response) {
- ZERO_STRUCT(lresponse);
- response = &lresponse;
- }
-
- init_response(response);
-
- /* Wait for reply */
- if (read_reply(response) == -1) {
- return NSS_STATUS_UNAVAIL;
- }
-
- /* Throw away extra data if client didn't request it */
- if (response == &lresponse) {
- free_response(response);
- }
-
- /* Copy reply data from socket */
- if (response->result != WINBINDD_OK) {
- return NSS_STATUS_NOTFOUND;
- }
-
- return NSS_STATUS_SUCCESS;
-}
-
-/* Handle simple types of requests */
-
-NSS_STATUS winbindd_request(int req_type,
- struct winbindd_request *request,
- struct winbindd_response *response)
-{
- NSS_STATUS status;
-
- status = winbindd_send_request(req_type, request);
- if (status != NSS_STATUS_SUCCESS)
- return(status);
- return winbindd_get_response(response);
-}
+++ /dev/null
-/*
- * (C) 2000 Francesco Chemolli <kinkie@kame.usr.dsi.unimi.it>,
- *
- * Distributed freely under the terms of the GNU General Public License,
- * version 2. See the file COPYING for licensing details
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
-
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111, USA.
- */
-
-#ifndef _WBNTLM_H_
-#define _WBNTLM_H_
-
-#include "config.h"
-#include "ntlmauth.h"
-#include <sys/types.h>
-#include <unistd.h>
-#include <stdlib.h>
-#include <stdio.h>
-
-
-/*************** CONFIGURATION ***************/
-#ifndef DEBUG
-#define DEBUG
-#endif
-
-/* the attempted entropy source. If it doesn't exist, random() is uesed */
-#define ENTROPY_SOURCE "/dev/urandom"
-
-/************* END CONFIGURATION *************/
-
-/* Debugging stuff */
-extern char *myname;
-static char *__foo;
-extern pid_t mypid;
-extern char debug_enabled;
-
-#ifdef DEBUG
-#define __DO_DEBUG 1
-#else
-#define __DO_DEBUG 0
-#endif
-
-#ifdef __GNUC__ /* this is really a gcc-ism */
-#define warn(X...) fprintf(stderr,"%s[%d](%s:%d): ", myname, mypid, \
- ((__foo=strrchr(__FILE__,'/'))==NULL?__FILE__:__foo+1),\
- __LINE__);\
- fprintf(stderr,X)
-#define debug(X...) if(__DO_DEBUG && debug_enabled) { warn(X); }
-#else /* __GNUC__ */
-static void
-debug(char *format,...)
-{
-}
-static void
-warn(char *format,...)
-{
-}
-#endif /* __GNUC__ */
-
-
-
-/* A couple of harmless helper macros */
-#define SEND(X) debug("sending '%s' to squid\n",X); printf(X "\n");
-#ifdef __GNUC__
-#define SEND2(X,Y...) debug("sending '" X "' to squid\n",Y); \
- printf(X "\n",Y)
-#else
-/* no gcc, no debugging. varargs macros are a gcc extension */
-#define SEND2 printf
-#endif
-
-typedef enum {
- YES,
- NO,
- DONTKNOW
-} tristate;
-
-#define CHALLENGE_LEN 8
-#define BUFFER_SIZE 2010
-
-#endif /* _WBNTLM_H_ */
# Makefile for storage modules in the Squid Object Cache server
#
-# $Id: Makefile.am,v 1.3 2003/01/23 00:35:59 robertc Exp $
+# $Id: Makefile.am,v 1.4 2005/07/01 22:34:50 hno Exp $
#
-DIST_SUBDIRS = ip_user ldap_group unix_group wbinfo_group winbind_group
+DIST_SUBDIRS = ip_user ldap_group unix_group wbinfo_group
SUBDIRS = @EXTERNAL_ACL_HELPERS@
+++ /dev/null
-#
-# Makefile for the wb_group external_acl helper
-#
-# $Id: Makefile.am,v 1.7 2004/08/14 22:54:53 hno Exp $
-#
-
-libexec_PROGRAMS = wb_group
-wb_group_SOURCES = wb_check_group.c wb_common.c wbntlm.h wb_common.h
-EXTRA_DIST = readme.txt
-
-LDADD = -L$(top_builddir)/lib -lmiscutil @XTRA_LIBS@
-INCLUDES = -I. -I$(top_builddir)/include -I$(top_srcdir)/include -I@SAMBASOURCES@
+++ /dev/null
-# Makefile.in generated by automake 1.9.5 from Makefile.am.
-# @configure_input@
-
-# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
-# 2003, 2004, 2005 Free Software Foundation, Inc.
-# This Makefile.in is free software; the Free Software Foundation
-# gives unlimited permission to copy and/or distribute it,
-# with or without modifications, as long as this notice is preserved.
-
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
-# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
-# PARTICULAR PURPOSE.
-
-@SET_MAKE@
-
-#
-# Makefile for the wb_group external_acl helper
-#
-# $Id: Makefile.in,v 1.43 2005/06/06 00:40:04 hno Exp $
-#
-
-SOURCES = $(wb_group_SOURCES)
-
-srcdir = @srcdir@
-top_srcdir = @top_srcdir@
-VPATH = @srcdir@
-pkgdatadir = $(datadir)/@PACKAGE@
-pkglibdir = $(libdir)/@PACKAGE@
-pkgincludedir = $(includedir)/@PACKAGE@
-top_builddir = ../../..
-am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
-INSTALL = @INSTALL@
-install_sh_DATA = $(install_sh) -c -m 644
-install_sh_PROGRAM = $(install_sh) -c
-install_sh_SCRIPT = $(install_sh) -c
-INSTALL_HEADER = $(INSTALL_DATA)
-transform = $(program_transform_name)
-NORMAL_INSTALL = :
-PRE_INSTALL = :
-POST_INSTALL = :
-NORMAL_UNINSTALL = :
-PRE_UNINSTALL = :
-POST_UNINSTALL = :
-build_triplet = @build@
-host_triplet = @host@
-libexec_PROGRAMS = wb_group$(EXEEXT)
-subdir = helpers/external_acl/winbind_group
-DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
-ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/acinclude.m4 \
- $(top_srcdir)/configure.in
-am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
- $(ACLOCAL_M4)
-mkinstalldirs = $(SHELL) $(top_srcdir)/cfgaux/mkinstalldirs
-CONFIG_HEADER = $(top_builddir)/include/autoconf.h
-CONFIG_CLEAN_FILES =
-am__installdirs = "$(DESTDIR)$(libexecdir)"
-libexecPROGRAMS_INSTALL = $(INSTALL_PROGRAM)
-PROGRAMS = $(libexec_PROGRAMS)
-am_wb_group_OBJECTS = wb_check_group.$(OBJEXT) wb_common.$(OBJEXT)
-wb_group_OBJECTS = $(am_wb_group_OBJECTS)
-wb_group_LDADD = $(LDADD)
-wb_group_DEPENDENCIES =
-DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir)/include
-depcomp = $(SHELL) $(top_srcdir)/cfgaux/depcomp
-am__depfiles_maybe = depfiles
-COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
- $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
-LTCOMPILE = $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) \
- $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \
- $(AM_CFLAGS) $(CFLAGS)
-CCLD = $(CC)
-LINK = $(LIBTOOL) --tag=CC --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
- $(AM_LDFLAGS) $(LDFLAGS) -o $@
-SOURCES = $(wb_group_SOURCES)
-DIST_SOURCES = $(wb_group_SOURCES)
-ETAGS = etags
-CTAGS = ctags
-DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
-ACLOCAL = @ACLOCAL@
-ALLOCA = @ALLOCA@
-AMDEP_FALSE = @AMDEP_FALSE@
-AMDEP_TRUE = @AMDEP_TRUE@
-AMTAR = @AMTAR@
-AR = @AR@
-AR_R = @AR_R@
-AUTH_LIBS = @AUTH_LIBS@
-AUTH_LINKOBJS = @AUTH_LINKOBJS@
-AUTH_MODULES = @AUTH_MODULES@
-AUTH_OBJS = @AUTH_OBJS@
-AUTOCONF = @AUTOCONF@
-AUTOHEADER = @AUTOHEADER@
-AUTOMAKE = @AUTOMAKE@
-AWK = @AWK@
-BASIC_AUTH_HELPERS = @BASIC_AUTH_HELPERS@
-CC = @CC@
-CCDEPMODE = @CCDEPMODE@
-CFLAGS = @CFLAGS@
-CGIEXT = @CGIEXT@
-CPP = @CPP@
-CPPFLAGS = @CPPFLAGS@
-CRYPTLIB = @CRYPTLIB@
-CXX = @CXX@
-CXXCPP = @CXXCPP@
-CXXDEPMODE = @CXXDEPMODE@
-CXXFLAGS = @CXXFLAGS@
-CYGPATH_W = @CYGPATH_W@
-DEFS = @DEFS@
-DEPDIR = @DEPDIR@
-DIGEST_AUTH_HELPERS = @DIGEST_AUTH_HELPERS@
-DISK_LIBS = @DISK_LIBS@
-DISK_LINKOBJS = @DISK_LINKOBJS@
-DISK_PROGRAMS = @DISK_PROGRAMS@
-ECHO = @ECHO@
-ECHO_C = @ECHO_C@
-ECHO_N = @ECHO_N@
-ECHO_T = @ECHO_T@
-EGREP = @EGREP@
-ENABLE_ARP_ACL_FALSE = @ENABLE_ARP_ACL_FALSE@
-ENABLE_ARP_ACL_TRUE = @ENABLE_ARP_ACL_TRUE@
-ENABLE_HTCP_FALSE = @ENABLE_HTCP_FALSE@
-ENABLE_HTCP_TRUE = @ENABLE_HTCP_TRUE@
-ENABLE_IDENT_FALSE = @ENABLE_IDENT_FALSE@
-ENABLE_IDENT_TRUE = @ENABLE_IDENT_TRUE@
-ENABLE_PINGER_FALSE = @ENABLE_PINGER_FALSE@
-ENABLE_PINGER_TRUE = @ENABLE_PINGER_TRUE@
-ENABLE_SSL_FALSE = @ENABLE_SSL_FALSE@
-ENABLE_SSL_TRUE = @ENABLE_SSL_TRUE@
-ENABLE_UNLINKD_FALSE = @ENABLE_UNLINKD_FALSE@
-ENABLE_UNLINKD_TRUE = @ENABLE_UNLINKD_TRUE@
-ENABLE_WIN32SPECIFIC_FALSE = @ENABLE_WIN32SPECIFIC_FALSE@
-ENABLE_WIN32SPECIFIC_TRUE = @ENABLE_WIN32SPECIFIC_TRUE@
-ENABLE_XPROF_STATS_FALSE = @ENABLE_XPROF_STATS_FALSE@
-ENABLE_XPROF_STATS_TRUE = @ENABLE_XPROF_STATS_TRUE@
-EPOLL_LIBS = @EPOLL_LIBS@
-ERR_DEFAULT_LANGUAGE = @ERR_DEFAULT_LANGUAGE@
-ERR_LANGUAGES = @ERR_LANGUAGES@
-EXEEXT = @EXEEXT@
-EXTERNAL_ACL_HELPERS = @EXTERNAL_ACL_HELPERS@
-F77 = @F77@
-FALSE = @FALSE@
-FFLAGS = @FFLAGS@
-INSTALL_DATA = @INSTALL_DATA@
-INSTALL_PROGRAM = @INSTALL_PROGRAM@
-INSTALL_SCRIPT = @INSTALL_SCRIPT@
-INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
-LDFLAGS = @LDFLAGS@
-LIBADD_DL = @LIBADD_DL@
-LIBDLMALLOC = @LIBDLMALLOC@
-LIBOBJS = @LIBOBJS@
-LIBREGEX = @LIBREGEX@
-LIBS = @LIBS@
-LIBSASL = @LIBSASL@
-LIBTOOL = @LIBTOOL@
-LIB_LBER = @LIB_LBER@
-LIB_LDAP = @LIB_LDAP@
-LIB_MALLOC = @LIB_MALLOC@
-LN = @LN@
-LN_S = @LN_S@
-LTLIBOBJS = @LTLIBOBJS@
-MAINT = @MAINT@
-MAINTAINER_MODE_FALSE = @MAINTAINER_MODE_FALSE@
-MAINTAINER_MODE_TRUE = @MAINTAINER_MODE_TRUE@
-MAKEINFO = @MAKEINFO@
-MAKE_LEAKFINDER_FALSE = @MAKE_LEAKFINDER_FALSE@
-MAKE_LEAKFINDER_TRUE = @MAKE_LEAKFINDER_TRUE@
-MKDIR = @MKDIR@
-MV = @MV@
-NEED_OWN_MD5_FALSE = @NEED_OWN_MD5_FALSE@
-NEED_OWN_MD5_TRUE = @NEED_OWN_MD5_TRUE@
-NEED_OWN_SNPRINTF_FALSE = @NEED_OWN_SNPRINTF_FALSE@
-NEED_OWN_SNPRINTF_TRUE = @NEED_OWN_SNPRINTF_TRUE@
-NTLM_AUTH_HELPERS = @NTLM_AUTH_HELPERS@
-OBJEXT = @OBJEXT@
-OPT_DEFAULT_HOSTS = @OPT_DEFAULT_HOSTS@
-PACKAGE = @PACKAGE@
-PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
-PACKAGE_NAME = @PACKAGE_NAME@
-PACKAGE_STRING = @PACKAGE_STRING@
-PACKAGE_TARNAME = @PACKAGE_TARNAME@
-PACKAGE_VERSION = @PACKAGE_VERSION@
-PATH_SEPARATOR = @PATH_SEPARATOR@
-PERL = @PERL@
-RANLIB = @RANLIB@
-REGEXLIB = @REGEXLIB@
-REPL_LIBS = @REPL_LIBS@
-REPL_OBJS = @REPL_OBJS@
-REPL_POLICIES = @REPL_POLICIES@
-RM = @RM@
-SAMBASOURCES = @SAMBASOURCES@
-SET_MAKE = @SET_MAKE@
-SH = @SH@
-SHELL = @SHELL@
-SNMPLIB = @SNMPLIB@
-SQUID_CFLAGS = @SQUID_CFLAGS@
-SQUID_CPPUNIT_DIR = @SQUID_CPPUNIT_DIR@
-SQUID_CPPUNIT_INC = @SQUID_CPPUNIT_INC@
-SQUID_CPPUNIT_LA = @SQUID_CPPUNIT_LA@
-SQUID_CXXFLAGS = @SQUID_CXXFLAGS@
-SSLLIB = @SSLLIB@
-STORE_LIBS = @STORE_LIBS@
-STORE_LINKOBJS = @STORE_LINKOBJS@
-STORE_OBJS = @STORE_OBJS@
-STRIP = @STRIP@
-TRUE = @TRUE@
-USE_DELAY_POOLS_FALSE = @USE_DELAY_POOLS_FALSE@
-USE_DELAY_POOLS_TRUE = @USE_DELAY_POOLS_TRUE@
-USE_DNSSERVER_FALSE = @USE_DNSSERVER_FALSE@
-USE_DNSSERVER_TRUE = @USE_DNSSERVER_TRUE@
-USE_ESI_FALSE = @USE_ESI_FALSE@
-USE_ESI_TRUE = @USE_ESI_TRUE@
-USE_SNMP_FALSE = @USE_SNMP_FALSE@
-USE_SNMP_TRUE = @USE_SNMP_TRUE@
-VERSION = @VERSION@
-WIN32_PSAPI = @WIN32_PSAPI@
-XTRA_LIBS = @XTRA_LIBS@
-XTRA_OBJS = @XTRA_OBJS@
-ac_ct_AR = @ac_ct_AR@
-ac_ct_CC = @ac_ct_CC@
-ac_ct_CXX = @ac_ct_CXX@
-ac_ct_F77 = @ac_ct_F77@
-ac_ct_RANLIB = @ac_ct_RANLIB@
-ac_ct_STRIP = @ac_ct_STRIP@
-am__fastdepCC_FALSE = @am__fastdepCC_FALSE@
-am__fastdepCC_TRUE = @am__fastdepCC_TRUE@
-am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@
-am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@
-am__include = @am__include@
-am__leading_dot = @am__leading_dot@
-am__quote = @am__quote@
-am__tar = @am__tar@
-am__untar = @am__untar@
-bindir = @bindir@
-build = @build@
-build_alias = @build_alias@
-build_cpu = @build_cpu@
-build_os = @build_os@
-build_vendor = @build_vendor@
-datadir = @datadir@
-exec_prefix = @exec_prefix@
-host = @host@
-host_alias = @host_alias@
-host_cpu = @host_cpu@
-host_os = @host_os@
-host_vendor = @host_vendor@
-includedir = @includedir@
-infodir = @infodir@
-install_sh = @install_sh@
-libdir = @libdir@
-libexecdir = @libexecdir@
-localstatedir = @localstatedir@
-makesnmplib = @makesnmplib@
-mandir = @mandir@
-mkdir_p = @mkdir_p@
-oldincludedir = @oldincludedir@
-prefix = @prefix@
-program_transform_name = @program_transform_name@
-sbindir = @sbindir@
-sharedstatedir = @sharedstatedir@
-subdirs = @subdirs@
-sysconfdir = @sysconfdir@
-target_alias = @target_alias@
-wb_group_SOURCES = wb_check_group.c wb_common.c wbntlm.h wb_common.h
-EXTRA_DIST = readme.txt
-LDADD = -L$(top_builddir)/lib -lmiscutil @XTRA_LIBS@
-INCLUDES = -I. -I$(top_builddir)/include -I$(top_srcdir)/include -I@SAMBASOURCES@
-all: all-am
-
-.SUFFIXES:
-.SUFFIXES: .c .lo .o .obj
-$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps)
- @for dep in $?; do \
- case '$(am__configure_deps)' in \
- *$$dep*) \
- cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \
- && exit 0; \
- exit 1;; \
- esac; \
- done; \
- echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign helpers/external_acl/winbind_group/Makefile'; \
- cd $(top_srcdir) && \
- $(AUTOMAKE) --foreign helpers/external_acl/winbind_group/Makefile
-.PRECIOUS: Makefile
-Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
- @case '$?' in \
- *config.status*) \
- cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
- *) \
- echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
- cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
- esac;
-
-$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
- cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
-
-$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
- cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
-$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps)
- cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
-install-libexecPROGRAMS: $(libexec_PROGRAMS)
- @$(NORMAL_INSTALL)
- test -z "$(libexecdir)" || $(mkdir_p) "$(DESTDIR)$(libexecdir)"
- @list='$(libexec_PROGRAMS)'; for p in $$list; do \
- p1=`echo $$p|sed 's/$(EXEEXT)$$//'`; \
- if test -f $$p \
- || test -f $$p1 \
- ; then \
- f=`echo "$$p1" | sed 's,^.*/,,;$(transform);s/$$/$(EXEEXT)/'`; \
- echo " $(INSTALL_PROGRAM_ENV) $(LIBTOOL) --mode=install $(libexecPROGRAMS_INSTALL) '$$p' '$(DESTDIR)$(libexecdir)/$$f'"; \
- $(INSTALL_PROGRAM_ENV) $(LIBTOOL) --mode=install $(libexecPROGRAMS_INSTALL) "$$p" "$(DESTDIR)$(libexecdir)/$$f" || exit 1; \
- else :; fi; \
- done
-
-uninstall-libexecPROGRAMS:
- @$(NORMAL_UNINSTALL)
- @list='$(libexec_PROGRAMS)'; for p in $$list; do \
- f=`echo "$$p" | sed 's,^.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/'`; \
- echo " rm -f '$(DESTDIR)$(libexecdir)/$$f'"; \
- rm -f "$(DESTDIR)$(libexecdir)/$$f"; \
- done
-
-clean-libexecPROGRAMS:
- @list='$(libexec_PROGRAMS)'; for p in $$list; do \
- f=`echo $$p|sed 's/$(EXEEXT)$$//'`; \
- echo " rm -f $$p $$f"; \
- rm -f $$p $$f ; \
- done
-wb_group$(EXEEXT): $(wb_group_OBJECTS) $(wb_group_DEPENDENCIES)
- @rm -f wb_group$(EXEEXT)
- $(LINK) $(wb_group_LDFLAGS) $(wb_group_OBJECTS) $(wb_group_LDADD) $(LIBS)
-
-mostlyclean-compile:
- -rm -f *.$(OBJEXT)
-
-distclean-compile:
- -rm -f *.tab.c
-
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/wb_check_group.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/wb_common.Po@am__quote@
-
-.c.o:
-@am__fastdepCC_TRUE@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \
-@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(COMPILE) -c $<
-
-.c.obj:
-@am__fastdepCC_TRUE@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ `$(CYGPATH_W) '$<'`; \
-@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'`
-
-.c.lo:
-@am__fastdepCC_TRUE@ if $(LTCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \
-@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Plo"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $<
-
-mostlyclean-libtool:
- -rm -f *.lo
-
-clean-libtool:
- -rm -rf .libs _libs
-
-distclean-libtool:
- -rm -f libtool
-uninstall-info-am:
-
-ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
- list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
- unique=`for i in $$list; do \
- if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
- done | \
- $(AWK) ' { files[$$0] = 1; } \
- END { for (i in files) print i; }'`; \
- mkid -fID $$unique
-tags: TAGS
-
-TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
- $(TAGS_FILES) $(LISP)
- tags=; \
- here=`pwd`; \
- list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
- unique=`for i in $$list; do \
- if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
- done | \
- $(AWK) ' { files[$$0] = 1; } \
- END { for (i in files) print i; }'`; \
- if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \
- test -n "$$unique" || unique=$$empty_fix; \
- $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
- $$tags $$unique; \
- fi
-ctags: CTAGS
-CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
- $(TAGS_FILES) $(LISP)
- tags=; \
- here=`pwd`; \
- list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
- unique=`for i in $$list; do \
- if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
- done | \
- $(AWK) ' { files[$$0] = 1; } \
- END { for (i in files) print i; }'`; \
- test -z "$(CTAGS_ARGS)$$tags$$unique" \
- || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
- $$tags $$unique
-
-GTAGS:
- here=`$(am__cd) $(top_builddir) && pwd` \
- && cd $(top_srcdir) \
- && gtags -i $(GTAGS_ARGS) $$here
-
-distclean-tags:
- -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
-
-distdir: $(DISTFILES)
- @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \
- topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \
- list='$(DISTFILES)'; for file in $$list; do \
- case $$file in \
- $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \
- $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \
- esac; \
- if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
- dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \
- if test "$$dir" != "$$file" && test "$$dir" != "."; then \
- dir="/$$dir"; \
- $(mkdir_p) "$(distdir)$$dir"; \
- else \
- dir=''; \
- fi; \
- if test -d $$d/$$file; then \
- if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
- cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
- fi; \
- cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
- else \
- test -f $(distdir)/$$file \
- || cp -p $$d/$$file $(distdir)/$$file \
- || exit 1; \
- fi; \
- done
-check-am: all-am
-check: check-am
-all-am: Makefile $(PROGRAMS)
-installdirs:
- for dir in "$(DESTDIR)$(libexecdir)"; do \
- test -z "$$dir" || $(mkdir_p) "$$dir"; \
- done
-install: install-am
-install-exec: install-exec-am
-install-data: install-data-am
-uninstall: uninstall-am
-
-install-am: all-am
- @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
-
-installcheck: installcheck-am
-install-strip:
- $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
- install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
- `test -z '$(STRIP)' || \
- echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
-mostlyclean-generic:
-
-clean-generic:
-
-distclean-generic:
- -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
-
-maintainer-clean-generic:
- @echo "This command is intended for maintainers to use"
- @echo "it deletes files that may require special tools to rebuild."
-clean: clean-am
-
-clean-am: clean-generic clean-libexecPROGRAMS clean-libtool \
- mostlyclean-am
-
-distclean: distclean-am
- -rm -rf ./$(DEPDIR)
- -rm -f Makefile
-distclean-am: clean-am distclean-compile distclean-generic \
- distclean-libtool distclean-tags
-
-dvi: dvi-am
-
-dvi-am:
-
-html: html-am
-
-info: info-am
-
-info-am:
-
-install-data-am:
-
-install-exec-am: install-libexecPROGRAMS
-
-install-info: install-info-am
-
-install-man:
-
-installcheck-am:
-
-maintainer-clean: maintainer-clean-am
- -rm -rf ./$(DEPDIR)
- -rm -f Makefile
-maintainer-clean-am: distclean-am maintainer-clean-generic
-
-mostlyclean: mostlyclean-am
-
-mostlyclean-am: mostlyclean-compile mostlyclean-generic \
- mostlyclean-libtool
-
-pdf: pdf-am
-
-pdf-am:
-
-ps: ps-am
-
-ps-am:
-
-uninstall-am: uninstall-info-am uninstall-libexecPROGRAMS
-
-.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \
- clean-libexecPROGRAMS clean-libtool ctags distclean \
- distclean-compile distclean-generic distclean-libtool \
- distclean-tags distdir dvi dvi-am html html-am info info-am \
- install install-am install-data install-data-am install-exec \
- install-exec-am install-info install-info-am \
- install-libexecPROGRAMS install-man install-strip installcheck \
- installcheck-am installdirs maintainer-clean \
- maintainer-clean-generic mostlyclean mostlyclean-compile \
- mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
- tags uninstall uninstall-am uninstall-info-am \
- uninstall-libexecPROGRAMS
-
-# Tell versions [3.59,3.63) of GNU make to not export all variables.
-# Otherwise a system limit (for SysV at least) may be exceeded.
-.NOEXPORT:
+++ /dev/null
-This is the README file for wb_group, an external
-helper fo the External ACL Scheme for Squid based on
-Samba Winbindd from Samba 2.2.4 or greater.
-
-
-This helper must be used in with an authentication scheme, tipically
-basic or NTLM, based on Windows NT/2000 domain users.
-It reads from the standard input the domain username and a list of groups
-and tries to match it against the groups membership of the specified
-username.
-
-Before compile or configure it, look at the Squid winbind authenticators
-instructions: http://www.squid-cache.org/Doc/FAQ/FAQ-23.html#ss23.5
-
-When used in Windows 2000 domains, permissions compatible with pre-Windows
-2000 servers are required. See the Q257988 Microsoft KB article for more
-details.
-
-
-==============
-Program Syntax
-==============
-
-wb_group [-c][-d][-h]
-
--c use case insensitive compare
--d enable debugging
--h this message
-
-
-================
-squid.conf usage
-================
-
-external_acl_type NT_global_group %LOGIN /usr/local/squid/libexec/wb_group
-
-acl ProxyUsers external NT_global_group ProxyUsers
-acl password proxy_auth REQUIRED
-
-http_access allow password ProxyUsers
-http_access deny all
-
-In the previous example all validated NT users member of ProxyUsers Global
-domain group are allowed to use the cache.
-
-Groups name can be specified in both domain-qualified group notation
-(DOMAIN\Groupname) or simple group name notation.
-
-Groups with spaces in name, for example "Domain Users", must be quoted and
-the acl data ("Domain Users") must be placed into a separate file included
-by specifying "/path/to/file". The previous example will be:
-
-acl ProxyUsers external NT_global_group "/usr/local/squid/etc/DomainUsers"
-
-and the DomainUsers files will contain only the following line:
-
-"Domain Users"
-
-NOTE: the standard group name comparation is case sensitive, so group name
-must be specified with same case as in the NT/2000 Domain.
-It's possible to enable not case sensitive group name comparation (-c),
-but on on some non - English locales, the results can be unexpected.
-For details see toupper man page, BUGS section.
-
-
-=======
-Testing
-=======
-
-I strongly urge that wb_group is tested prior to being used in a
-production environment. It may behave differently on different platforms.
-To test it, run it from the command line. Enter username and group
-pairs separated by a space (username must entered with domain\\username
-syntax). Press ENTER to get an OK or ERR message.
-Make sure pressing <CTRL><D> behaves the same as a carriage return.
-Make sure pressing <CTRL><C> aborts the program.
-
-Test that entering no details does not result in an OK or ERR message.
-Test that entering an invalid username and group results in an ERR message.
-Test that entering an valid username and group results in an OK message.
-
-To check winbind functionality use wbinfo provided with Samba,
-try -t, -g and -r options.
-
---
-Serassio Guido
-guido.serassio@acmeconsulting.it
+++ /dev/null
-/*
- * winbind_group: lookup group membership in a Windows NT/2000 domain
- *
- * (C)2002,2003 Guido Serassio - Acme Consulting S.r.l.
- *
- * Authors:
- * Guido Serassio <guido.serassio@acmeconsulting.it>
- * Acme Consulting S.r.l., Italy <http://www.acmeconsulting.it>
- *
- * With contributions from others mentioned in the change history section
- * below.
- *
- * In part based on check_group by Rodrigo Albani de Campos and wbinfo
- * from Samba Project.
- *
- * Dependencies: Samba 2.2.4 or later with Winbindd.
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111, USA.
- *
- * History:
- *
- * Version 1.21
- * 15-08-2004 Henrik Nordstrom
- * Helper protocol changed to use URL escaped strings in Squid-3.0
- * Version 1.20
- * 10-05-2003 Roberto Moreda
- * Added support for domain-qualified group Microsoft notation
- * (DOMAIN\Groupname).
- * Guido Serassio
- * More debug info.
- * Updated documentation.
- * Version 1.10
- * 26-04-2003 Guido Serassio
- * Added option for case insensitive group name comparation.
- * More debug info.
- * Updated documentation.
- * 21-03-2003 Nicolas Chaillot
- * Segfault bug fix (Bugzilla #574)
- * Version 1.0
- * 02-07-2002 Guido Serassio
- * Using the main function from check_group and sections
- * from wbinfo wrote winbind_group
- *
- * This is a helper for the external ACL interface for Squid Cache
- *
- * It reads from the standard input the domain username and a list of
- * groups and tries to match it against the groups membership of the
- * specified username.
- *
- * Returns `OK' if the user belongs to a group or `ERR' otherwise, as
- * described on http://devel.squid-cache.org/external_acl/config.html
- *
- */
-#include "wbntlm.h"
-#include "util.h"
-
-#include <assert.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <ctype.h>
-
-#include "nsswitch/winbind_nss_config.h"
-#include "nsswitch/winbindd_nss.h"
-#include "wb_common.h"
-
-#define BUFSIZE 8192 /* the stdin buffer size */
-char debug_enabled=0;
-const char *myname;
-pid_t mypid;
-static int use_case_insensitive_compare=0;
-
-static int strCaseCmp (const char *s1, const char *s2)
-{
- while (*s1 && toupper (*s1) == toupper (*s2)) s1++, s2++;
- return *s1 - *s2;
-}
-
-/* Convert sid to string */
-
-static char * wbinfo_lookupsid(char * group, char *sid)
-{
- struct winbindd_request request;
- struct winbindd_response response;
-
- memset(&request,0,sizeof(struct winbindd_request));
- memset(&response,0,sizeof(struct winbindd_response));
-
- /* Send off request */
-
- strncpy(request.data.sid, sid,sizeof(fstring)-1);
-
- if (winbindd_request(WINBINDD_LOOKUPSID, &request, &response) !=
- NSS_STATUS_SUCCESS)
- return NULL;
-
- /* Display response */
-
- strcpy(group,response.data.name.dom_name);
- strcat(group,"\\");
- strcat(group,response.data.name.name);
- return group;
-}
-
-/* Convert gid to sid */
-
-static char * wbinfo_gid_to_sid(char * sid, gid_t gid)
-{
- struct winbindd_request request;
- struct winbindd_response response;
-
- memset(&request,0,sizeof(struct winbindd_request));
- memset(&response,0,sizeof(struct winbindd_response));
-
- /* Send request */
-
- request.data.gid = gid;
-
- if (winbindd_request(WINBINDD_GID_TO_SID, &request, &response) !=
- NSS_STATUS_SUCCESS)
- return NULL;
-
- /* Display response */
-
- strcpy(sid, response.data.sid.sid);
-
- return sid;
-}
-
-/* returns 0 on match, -1 if no match */
-static inline int strcmparray(const char *str, const char **array)
-{
- const char *wgroup;
-
- while (*array) {
- /* If the groups we want to match are specified as 'group', and
- * not as 'DOMAIN\group' we strip the domain from the group to
- * match against */
- if (strstr(*array,"\\") == NULL) {
- wgroup = strstr(str,"\\") + 1;
- debug("Stripping domain from group name %s\n", str);
- } else {
- wgroup = str;
- }
-
- debug("Windows group: %s, Squid group: %s\n", wgroup, *array);
- if ((use_case_insensitive_compare ? strCaseCmp(wgroup, *array) : strcmp(wgroup, *array)) == 0)
- return 0;
- array++;
- }
- return -1;
-}
-
-/* returns 1 on success, 0 on failure */
-static int
-Valid_Groups(char *UserName, const char **UserGroups)
-{
- struct winbindd_request request;
- struct winbindd_response response;
- NSS_STATUS result;
- int i;
- char sid[FSTRING_LEN];
- char group[FSTRING_LEN];
- int match = 0;
-
- memset(&request,0,sizeof(struct winbindd_request));
- memset(&response,0,sizeof(struct winbindd_response));
-
- /* Send request */
-
- strncpy(request.data.username,UserName,sizeof(fstring)-1);
-
- result = winbindd_request(WINBINDD_GETGROUPS, &request, &response);
-
- if (result != NSS_STATUS_SUCCESS) {
- warn("Warning: Can't enum user groups.\n");
- return match;
- }
-
- for (i = 0; i < response.data.num_entries; i++) {
- if ((wbinfo_gid_to_sid(sid, (int)((gid_t *)response.extra_data)[i])) != NULL) {
- debug("SID: %s\n", sid);
- if (wbinfo_lookupsid(group,sid) == NULL) {
- warn("Can't lookup group SID.\n");
- break;
- }
- if (strcmparray(group, UserGroups) == 0) {
- match = 1;
- break;
- }
- } else {
- return match;
- }
- }
- SAFE_FREE(response.extra_data);
-
- return match;
-}
-
-static void
-usage(char *program)
-{
- fprintf(stderr,"Usage: %s [-c] [-d] [-h]\n"
- " -c use case insensitive compare\n"
- " -d enable debugging\n"
- " -h this message\n",
- program);
-}
-
-static void
-process_options(int argc, char *argv[])
-{
- int opt;
-
- opterr = 0;
- while (-1 != (opt = getopt(argc, argv, "cdh"))) {
- switch (opt) {
- case 'c':
- use_case_insensitive_compare = 1;
- break;
- case 'd':
- debug_enabled = 1;
- break;
- case 'h':
- usage(argv[0]);
- exit(0);
- case '?':
- opt = optopt;
- /* fall thru to default */
- default:
- warn("Unknown option: -%c\n\n", opt);
- usage(argv[0]);
- exit(1);
- break; /* not reached */
- }
- }
- return;
-}
-
-void
-check_winbindd()
-{
- NSS_STATUS r;
- int retry=10;
- struct winbindd_request request;
- struct winbindd_response response;
- do {
- r = winbindd_request(WINBINDD_INTERFACE_VERSION, &request, &response);
- if (r != NSS_STATUS_SUCCESS)
- retry--;
- } while (r != NSS_STATUS_SUCCESS && retry);
- if (r != NSS_STATUS_SUCCESS) {
- warn("Can't contact winbindd. Dying\n");
- exit(1);
- }
- if (response.data.interface_version != WINBIND_INTERFACE_VERSION) {
- warn("Winbind protocol mismatch. Align squid and samba. Dying\n");
- exit(1);
- }
-}
-
-int
-main (int argc, char *argv[])
-{
- char *p;
- char buf[BUFSIZE];
- char *username;
- char *group;
- const char *groups[512];
- int n;
-
- if (argc > 0) { /* should always be true */
- myname=strrchr(argv[0],'/');
- if (myname==NULL)
- myname=argv[0];
- } else {
- myname="(unknown)";
- }
- mypid=getpid();
-
- /* make standard output line buffered */
- setvbuf (stdout, NULL, _IOLBF, 0);
-
- /* Check Command Line */
- process_options(argc, argv);
-
- debug("External ACL winbindd group helper build " __DATE__ ", " __TIME__
- " starting up...\n");
- if (use_case_insensitive_compare)
- debug("Warning: running in case insensitive mode !!!\n");
-
- check_winbindd();
-
- /* Main Loop */
- while (fgets (buf, sizeof(buf), stdin))
- {
- if (NULL == strchr(buf, '\n')) {
- /* too large message received.. skip and deny */
- fprintf(stderr, "%s: ERROR: Too large: %s\n", argv[0], buf);
- while (fgets(buf, sizeof(buf), stdin)) {
- fprintf(stderr, "%s: ERROR: Too large..: %s\n", argv[0], buf);
- if (strchr(buf, '\n') != NULL)
- break;
- }
- goto error;
- }
-
- if ((p = strchr(buf, '\n')) != NULL)
- *p = '\0'; /* strip \n */
- if ((p = strchr(buf, '\r')) != NULL)
- *p = '\0'; /* strip \r */
-
- debug("Got '%s' from Squid (length: %d).\n",buf,strlen(buf));
-
- if (buf[0] == '\0') {
- warn("Invalid Request\n");
- goto error;
- }
-
- username = strtok(buf, " ");
- for (n = 0; (group = strtok(NULL, " ")) != NULL; n++) {
- rfc1738_unescape(group);
- groups[n] = group;
- }
- groups[n] = NULL;
-
- if (NULL == username) {
- warn("Invalid Request\n");
- goto error;
- }
- rfc1738_unescape(username);
-
- if (Valid_Groups(username, groups)) {
- printf ("OK\n");
- } else {
-error:
- printf ("ERR\n");
- }
- }
- return 0;
-}
+++ /dev/null
-/*
- Unix SMB/Netbios implementation.
- Version 2.0
-
- winbind client common code
-
- Copyright (C) Tim Potter 2000
- Copyright (C) Andrew Tridgell 2000
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Library General Public
- License as published by the Free Software Foundation; either
- version 2 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Library General Public License for more details.
-
- You should have received a copy of the GNU Library General Public
- License along with this library; if not, write to the
- Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- Boston, MA 02111-1307, USA.
-*/
-
-#include "nsswitch/winbind_nss_config.h"
-#include "nsswitch/winbindd_nss.h"
-#include "config.h"
-#include "wb_common.h"
-
-
-/* Global variables. These are effectively the client state information */
-
-int winbindd_fd = -1; /* fd for winbindd socket */
-static char *excluded_domain;
-
-/* Free a response structure */
-
-void free_response(struct winbindd_response *response)
-{
- /* Free any allocated extra_data */
-
- if (response)
- SAFE_FREE(response->extra_data);
-}
-
-/*
- smbd needs to be able to exclude lookups for its own domain
-*/
-void winbind_exclude_domain(const char *domain)
-{
- SAFE_FREE(excluded_domain);
- excluded_domain = strdup(domain);
-}
-
-
-/* Initialise a request structure */
-
-void init_request(struct winbindd_request *request, int request_type)
-{
- static char *domain_env;
- static BOOL initialised;
-
- request->length = sizeof(struct winbindd_request);
-
- request->cmd = (enum winbindd_cmd)request_type;
- request->pid = getpid();
- request->domain[0] = '\0';
-
- if (!initialised) {
- initialised = True;
- domain_env = getenv(WINBINDD_DOMAIN_ENV);
- }
-
- if (domain_env) {
- strncpy(request->domain, domain_env,
- sizeof(request->domain) - 1);
- request->domain[sizeof(request->domain) - 1] = '\0';
- }
-}
-
-/* Initialise a response structure */
-
-void init_response(struct winbindd_response *response)
-{
- /* Initialise return value */
-
- response->result = WINBINDD_ERROR;
-}
-
-/* Close established socket */
-
-void close_sock(void)
-{
- if (winbindd_fd != -1) {
- close(winbindd_fd);
- winbindd_fd = -1;
- }
-}
-
-/* Connect to winbindd socket */
-
-int winbind_open_pipe_sock(void)
-{
- struct sockaddr_un sunaddr;
- static pid_t our_pid;
- struct stat st;
- pstring path;
-
- if (our_pid != getpid()) {
- close_sock();
- our_pid = getpid();
- }
-
- if (winbindd_fd != -1) {
- return winbindd_fd;
- }
-
- /* Check permissions on unix socket directory */
-
- if (lstat(WINBINDD_SOCKET_DIR, &st) == -1) {
- return -1;
- }
-
- if (!S_ISDIR(st.st_mode) ||
- (st.st_uid != 0 && st.st_uid != geteuid())) {
- return -1;
- }
-
- /* Connect to socket */
-
- strncpy(path, WINBINDD_SOCKET_DIR, sizeof(path) - 1);
- path[sizeof(path) - 1] = '\0';
-
- strncat(path, "/", sizeof(path) - 1);
- path[sizeof(path) - 1] = '\0';
-
- strncat(path, WINBINDD_SOCKET_NAME, sizeof(path) - 1);
- path[sizeof(path) - 1] = '\0';
-
- ZERO_STRUCT(sunaddr);
- sunaddr.sun_family = AF_UNIX;
- strncpy(sunaddr.sun_path, path, sizeof(sunaddr.sun_path) - 1);
-
- /* If socket file doesn't exist, don't bother trying to connect
- with retry. This is an attempt to make the system usable when
- the winbindd daemon is not running. */
-
- if (lstat(path, &st) == -1) {
- return -1;
- }
-
- /* Check permissions on unix socket file */
-
- if (!S_ISSOCK(st.st_mode) ||
- (st.st_uid != 0 && st.st_uid != geteuid())) {
- return -1;
- }
-
- /* Connect to socket */
-
- if ((winbindd_fd = socket(AF_UNIX, SOCK_STREAM, 0)) == -1) {
- return -1;
- }
-
- if (connect(winbindd_fd, (struct sockaddr *)&sunaddr,
- sizeof(sunaddr)) == -1) {
- close_sock();
- return -1;
- }
-
- return winbindd_fd;
-}
-
-/* Write data to winbindd socket with timeout */
-
-int write_sock(void *buffer, int count)
-{
- int result, nwritten;
-
- /* Open connection to winbind daemon */
-
- restart:
-
- if (winbind_open_pipe_sock() == -1) {
- return -1;
- }
-
- /* Write data to socket */
-
- nwritten = 0;
-
- while(nwritten < count) {
- struct timeval tv;
- fd_set r_fds;
-
- /* Catch pipe close on other end by checking if a read()
- call would not block by calling select(). */
-
- FD_ZERO(&r_fds);
- FD_SET(winbindd_fd, &r_fds);
- ZERO_STRUCT(tv);
-
- if (select(winbindd_fd + 1, &r_fds, NULL, NULL, &tv) == -1) {
- close_sock();
- return -1; /* Select error */
- }
-
- /* Write should be OK if fd not available for reading */
-
- if (!FD_ISSET(winbindd_fd, &r_fds)) {
-
- /* Do the write */
-
- result = write(winbindd_fd,
- (char *)buffer + nwritten,
- count - nwritten);
-
- if ((result == -1) || (result == 0)) {
-
- /* Write failed */
-
- close_sock();
- return -1;
- }
-
- nwritten += result;
-
- } else {
-
- /* Pipe has closed on remote end */
-
- close_sock();
- goto restart;
- }
- }
-
- return nwritten;
-}
-
-/* Read data from winbindd socket with timeout */
-
-static int read_sock(void *buffer, int count)
-{
- int result = 0, nread = 0;
-
- /* Read data from socket */
-
- while(nread < count) {
-
- result = read(winbindd_fd, (char *)buffer + nread,
- count - nread);
-
- if ((result == -1) || (result == 0)) {
-
- /* Read failed. I think the only useful thing we
- can do here is just return -1 and fail since the
- transaction has failed half way through. */
-
- close_sock();
- return -1;
- }
-
- nread += result;
- }
-
- return result;
-}
-
-/* Read reply */
-
-int read_reply(struct winbindd_response *response)
-{
- int result1, result2 = 0;
-
- if (!response) {
- return -1;
- }
-
- /* Read fixed length response */
-
- if ((result1 = read_sock(response, sizeof(struct winbindd_response)))
- == -1) {
-
- return -1;
- }
-
- /* We actually send the pointer value of the extra_data field from
- the server. This has no meaning in the client's address space
- so we clear it out. */
-
- response->extra_data = NULL;
-
- /* Read variable length response */
-
- if (response->length > sizeof(struct winbindd_response)) {
- int extra_data_len = response->length -
- sizeof(struct winbindd_response);
-
- /* Mallocate memory for extra data */
-
- if (!(response->extra_data = malloc(extra_data_len))) {
- return -1;
- }
-
- if ((result2 = read_sock(response->extra_data, extra_data_len))
- == -1) {
- free_response(response);
- return -1;
- }
- }
-
- /* Return total amount of data read */
-
- return result1 + result2;
-}
-
-/*
- * send simple types of requests
- */
-
-NSS_STATUS winbindd_send_request(int req_type, struct winbindd_request *request)
-{
- struct winbindd_request lrequest;
-
- /* Check for our tricky environment variable */
-
- if (getenv(WINBINDD_DONT_ENV)) {
- return NSS_STATUS_NOTFOUND;
- }
-
- /* smbd may have excluded this domain */
- if (excluded_domain &&
- strcasecmp(excluded_domain, request->domain) == 0) {
- return NSS_STATUS_NOTFOUND;
- }
-
- if (!request) {
- ZERO_STRUCT(lrequest);
- request = &lrequest;
- }
-
- /* Fill in request and send down pipe */
-
- init_request(request, req_type);
-
- if (write_sock(request, sizeof(*request)) == -1) {
- return NSS_STATUS_UNAVAIL;
- }
-
- return NSS_STATUS_SUCCESS;
-}
-
-/*
- * Get results from winbindd request
- */
-
-NSS_STATUS winbindd_get_response(struct winbindd_response *response)
-{
- struct winbindd_response lresponse;
-
- if (!response) {
- ZERO_STRUCT(lresponse);
- response = &lresponse;
- }
-
- init_response(response);
-
- /* Wait for reply */
- if (read_reply(response) == -1) {
- return NSS_STATUS_UNAVAIL;
- }
-
- /* Throw away extra data if client didn't request it */
- if (response == &lresponse) {
- free_response(response);
- }
-
- /* Copy reply data from socket */
- if (response->result != WINBINDD_OK) {
- return NSS_STATUS_NOTFOUND;
- }
-
- return NSS_STATUS_SUCCESS;
-}
-
-/* Handle simple types of requests */
-
-NSS_STATUS winbindd_request(int req_type,
- struct winbindd_request *request,
- struct winbindd_response *response)
-{
- NSS_STATUS status;
-
- status = winbindd_send_request(req_type, request);
- if (status != NSS_STATUS_SUCCESS)
- return(status);
- return winbindd_get_response(response);
-}
+++ /dev/null
-/* wb_common.c */
-void free_response(struct winbindd_response *response);
-void winbind_exclude_domain(const char *domain);
-void init_request(struct winbindd_request *request, int request_type);
-void init_response(struct winbindd_response *response);
-void close_sock(void);
-int winbind_open_pipe_sock(void);
-int write_sock(void *buffer, int count);
-int read_reply(struct winbindd_response *response);
-NSS_STATUS winbindd_send_request(int req_type, struct winbindd_request *request);
-NSS_STATUS winbindd_get_response(struct winbindd_response *response);
-NSS_STATUS winbindd_request(int req_type, struct winbindd_request *request, struct winbindd_response *response);
+++ /dev/null
-/*
- * (C) 2000 Francesco Chemolli <kinkie@kame.usr.dsi.unimi.it>,
- *
- * Distributed freely under the terms of the GNU General Public License,
- * version 2. See the file COPYING for licensing details
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
-
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111, USA.
- */
-
-#ifndef _WBNTLM_H_
-#define _WBNTLM_H_
-
-#include "config.h"
-#include "ntlmauth.h"
-#include <sys/types.h>
-#include <unistd.h>
-#include <stdlib.h>
-#include <stdio.h>
-
-
-/*************** CONFIGURATION ***************/
-#ifndef DEBUG
-#define DEBUG
-#endif
-
-/* the attempted entropy source. If it doesn't exist, random() is uesed */
-#define ENTROPY_SOURCE "/dev/urandom"
-
-#define DOMAIN "GCSINT" /* TODO: fix ntlm_make_challenge */
-
-/************* END CONFIGURATION *************/
-
-/* Debugging stuff */
-extern const char *myname;
-static const char *__foo;
-extern pid_t mypid;
-extern char debug_enabled;
-
-#ifdef DEBUG
-#define __DO_DEBUG 1
-#else
-#define __DO_DEBUG 0
-#endif
-
-#ifdef __GNUC__ /* this is really a gcc-ism */
-#define warn(X...) fprintf(stderr,"%s[%d](%s:%d): ", myname, mypid, \
- ((__foo=strrchr(__FILE__,'/'))==NULL?__FILE__:__foo+1),\
- __LINE__);\
- fprintf(stderr,X)
-#define debug(X...) if(__DO_DEBUG && debug_enabled) { warn(X); }
-#else /* __GNUC__ */
-static void
-debug(char *format,...)
-{
-}
-static void
-warn(char *format,...)
-{
-}
-#endif /* __GNUC__ */
-
-
-
-/* A couple of harmless helper macros */
-#define SEND(X) debug("sending '%s' to squid\n",X); printf(X "\n");
-#ifdef __GNUC__
-#define SEND2(X,Y...) debug("sending '" X "' to squid\n",Y); \
- printf(X "\n",Y)
-#else
-/* no gcc, no debugging. varargs macros are a gcc extension */
-#define SEND2 printf
-#endif
-
-typedef enum {
- YES,
- NO,
- DONTKNOW
-} tristate;
-
-#define CHALLENGE_LEN 8
-#define BUFFER_SIZE 2010
-
-#endif /* _WBNTLM_H_ */
# Makefile for storage modules in the Squid Object Cache server
#
-# $Id: Makefile.am,v 1.6 2003/01/23 00:36:25 robertc Exp $
+# $Id: Makefile.am,v 1.7 2005/07/01 22:34:51 hno Exp $
#
-DIST_SUBDIRS = fakeauth no_check SMB winbind
+DIST_SUBDIRS = fakeauth no_check SMB
SUBDIRS = @NTLM_AUTH_HELPERS@
+++ /dev/null
-#
-# Makefile for the Squid Object Cache server
-#
-# $Id: Makefile.am,v 1.7 2003/02/11 14:34:41 hno Exp $
-#
-
-libexec_PROGRAMS = wb_ntlmauth
-wb_ntlmauth_SOURCES = wb_ntlm_auth.c wb_common.c wbntlm.h
-EXTRA_DIST = \
- patches/wb_common.patch \
- patches/winbind_nss_config.patch
-INCLUDES = -I. -I$(top_builddir)/include -I$(top_srcdir)/include \
- -I$(top_srcdir)/src -I@SAMBASOURCES@
-LDADD = -L$(top_builddir)/lib -lmiscutil -lntlmauth $(XTRA_LIBS)
+++ /dev/null
-# Makefile.in generated by automake 1.9.5 from Makefile.am.
-# @configure_input@
-
-# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
-# 2003, 2004, 2005 Free Software Foundation, Inc.
-# This Makefile.in is free software; the Free Software Foundation
-# gives unlimited permission to copy and/or distribute it,
-# with or without modifications, as long as this notice is preserved.
-
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
-# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
-# PARTICULAR PURPOSE.
-
-@SET_MAKE@
-
-#
-# Makefile for the Squid Object Cache server
-#
-# $Id: Makefile.in,v 1.44 2005/06/06 00:40:06 hno Exp $
-#
-
-SOURCES = $(wb_ntlmauth_SOURCES)
-
-srcdir = @srcdir@
-top_srcdir = @top_srcdir@
-VPATH = @srcdir@
-pkgdatadir = $(datadir)/@PACKAGE@
-pkglibdir = $(libdir)/@PACKAGE@
-pkgincludedir = $(includedir)/@PACKAGE@
-top_builddir = ../../..
-am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
-INSTALL = @INSTALL@
-install_sh_DATA = $(install_sh) -c -m 644
-install_sh_PROGRAM = $(install_sh) -c
-install_sh_SCRIPT = $(install_sh) -c
-INSTALL_HEADER = $(INSTALL_DATA)
-transform = $(program_transform_name)
-NORMAL_INSTALL = :
-PRE_INSTALL = :
-POST_INSTALL = :
-NORMAL_UNINSTALL = :
-PRE_UNINSTALL = :
-POST_UNINSTALL = :
-build_triplet = @build@
-host_triplet = @host@
-libexec_PROGRAMS = wb_ntlmauth$(EXEEXT)
-subdir = helpers/ntlm_auth/winbind
-DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
-ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/acinclude.m4 \
- $(top_srcdir)/configure.in
-am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
- $(ACLOCAL_M4)
-mkinstalldirs = $(SHELL) $(top_srcdir)/cfgaux/mkinstalldirs
-CONFIG_HEADER = $(top_builddir)/include/autoconf.h
-CONFIG_CLEAN_FILES =
-am__installdirs = "$(DESTDIR)$(libexecdir)"
-libexecPROGRAMS_INSTALL = $(INSTALL_PROGRAM)
-PROGRAMS = $(libexec_PROGRAMS)
-am_wb_ntlmauth_OBJECTS = wb_ntlm_auth.$(OBJEXT) wb_common.$(OBJEXT)
-wb_ntlmauth_OBJECTS = $(am_wb_ntlmauth_OBJECTS)
-wb_ntlmauth_LDADD = $(LDADD)
-am__DEPENDENCIES_1 =
-wb_ntlmauth_DEPENDENCIES = $(am__DEPENDENCIES_1)
-DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir)/include
-depcomp = $(SHELL) $(top_srcdir)/cfgaux/depcomp
-am__depfiles_maybe = depfiles
-COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
- $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
-LTCOMPILE = $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) \
- $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \
- $(AM_CFLAGS) $(CFLAGS)
-CCLD = $(CC)
-LINK = $(LIBTOOL) --tag=CC --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
- $(AM_LDFLAGS) $(LDFLAGS) -o $@
-SOURCES = $(wb_ntlmauth_SOURCES)
-DIST_SOURCES = $(wb_ntlmauth_SOURCES)
-ETAGS = etags
-CTAGS = ctags
-DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
-ACLOCAL = @ACLOCAL@
-ALLOCA = @ALLOCA@
-AMDEP_FALSE = @AMDEP_FALSE@
-AMDEP_TRUE = @AMDEP_TRUE@
-AMTAR = @AMTAR@
-AR = @AR@
-AR_R = @AR_R@
-AUTH_LIBS = @AUTH_LIBS@
-AUTH_LINKOBJS = @AUTH_LINKOBJS@
-AUTH_MODULES = @AUTH_MODULES@
-AUTH_OBJS = @AUTH_OBJS@
-AUTOCONF = @AUTOCONF@
-AUTOHEADER = @AUTOHEADER@
-AUTOMAKE = @AUTOMAKE@
-AWK = @AWK@
-BASIC_AUTH_HELPERS = @BASIC_AUTH_HELPERS@
-CC = @CC@
-CCDEPMODE = @CCDEPMODE@
-CFLAGS = @CFLAGS@
-CGIEXT = @CGIEXT@
-CPP = @CPP@
-CPPFLAGS = @CPPFLAGS@
-CRYPTLIB = @CRYPTLIB@
-CXX = @CXX@
-CXXCPP = @CXXCPP@
-CXXDEPMODE = @CXXDEPMODE@
-CXXFLAGS = @CXXFLAGS@
-CYGPATH_W = @CYGPATH_W@
-DEFS = @DEFS@
-DEPDIR = @DEPDIR@
-DIGEST_AUTH_HELPERS = @DIGEST_AUTH_HELPERS@
-DISK_LIBS = @DISK_LIBS@
-DISK_LINKOBJS = @DISK_LINKOBJS@
-DISK_PROGRAMS = @DISK_PROGRAMS@
-ECHO = @ECHO@
-ECHO_C = @ECHO_C@
-ECHO_N = @ECHO_N@
-ECHO_T = @ECHO_T@
-EGREP = @EGREP@
-ENABLE_ARP_ACL_FALSE = @ENABLE_ARP_ACL_FALSE@
-ENABLE_ARP_ACL_TRUE = @ENABLE_ARP_ACL_TRUE@
-ENABLE_HTCP_FALSE = @ENABLE_HTCP_FALSE@
-ENABLE_HTCP_TRUE = @ENABLE_HTCP_TRUE@
-ENABLE_IDENT_FALSE = @ENABLE_IDENT_FALSE@
-ENABLE_IDENT_TRUE = @ENABLE_IDENT_TRUE@
-ENABLE_PINGER_FALSE = @ENABLE_PINGER_FALSE@
-ENABLE_PINGER_TRUE = @ENABLE_PINGER_TRUE@
-ENABLE_SSL_FALSE = @ENABLE_SSL_FALSE@
-ENABLE_SSL_TRUE = @ENABLE_SSL_TRUE@
-ENABLE_UNLINKD_FALSE = @ENABLE_UNLINKD_FALSE@
-ENABLE_UNLINKD_TRUE = @ENABLE_UNLINKD_TRUE@
-ENABLE_WIN32SPECIFIC_FALSE = @ENABLE_WIN32SPECIFIC_FALSE@
-ENABLE_WIN32SPECIFIC_TRUE = @ENABLE_WIN32SPECIFIC_TRUE@
-ENABLE_XPROF_STATS_FALSE = @ENABLE_XPROF_STATS_FALSE@
-ENABLE_XPROF_STATS_TRUE = @ENABLE_XPROF_STATS_TRUE@
-EPOLL_LIBS = @EPOLL_LIBS@
-ERR_DEFAULT_LANGUAGE = @ERR_DEFAULT_LANGUAGE@
-ERR_LANGUAGES = @ERR_LANGUAGES@
-EXEEXT = @EXEEXT@
-EXTERNAL_ACL_HELPERS = @EXTERNAL_ACL_HELPERS@
-F77 = @F77@
-FALSE = @FALSE@
-FFLAGS = @FFLAGS@
-INSTALL_DATA = @INSTALL_DATA@
-INSTALL_PROGRAM = @INSTALL_PROGRAM@
-INSTALL_SCRIPT = @INSTALL_SCRIPT@
-INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
-LDFLAGS = @LDFLAGS@
-LIBADD_DL = @LIBADD_DL@
-LIBDLMALLOC = @LIBDLMALLOC@
-LIBOBJS = @LIBOBJS@
-LIBREGEX = @LIBREGEX@
-LIBS = @LIBS@
-LIBSASL = @LIBSASL@
-LIBTOOL = @LIBTOOL@
-LIB_LBER = @LIB_LBER@
-LIB_LDAP = @LIB_LDAP@
-LIB_MALLOC = @LIB_MALLOC@
-LN = @LN@
-LN_S = @LN_S@
-LTLIBOBJS = @LTLIBOBJS@
-MAINT = @MAINT@
-MAINTAINER_MODE_FALSE = @MAINTAINER_MODE_FALSE@
-MAINTAINER_MODE_TRUE = @MAINTAINER_MODE_TRUE@
-MAKEINFO = @MAKEINFO@
-MAKE_LEAKFINDER_FALSE = @MAKE_LEAKFINDER_FALSE@
-MAKE_LEAKFINDER_TRUE = @MAKE_LEAKFINDER_TRUE@
-MKDIR = @MKDIR@
-MV = @MV@
-NEED_OWN_MD5_FALSE = @NEED_OWN_MD5_FALSE@
-NEED_OWN_MD5_TRUE = @NEED_OWN_MD5_TRUE@
-NEED_OWN_SNPRINTF_FALSE = @NEED_OWN_SNPRINTF_FALSE@
-NEED_OWN_SNPRINTF_TRUE = @NEED_OWN_SNPRINTF_TRUE@
-NTLM_AUTH_HELPERS = @NTLM_AUTH_HELPERS@
-OBJEXT = @OBJEXT@
-OPT_DEFAULT_HOSTS = @OPT_DEFAULT_HOSTS@
-PACKAGE = @PACKAGE@
-PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
-PACKAGE_NAME = @PACKAGE_NAME@
-PACKAGE_STRING = @PACKAGE_STRING@
-PACKAGE_TARNAME = @PACKAGE_TARNAME@
-PACKAGE_VERSION = @PACKAGE_VERSION@
-PATH_SEPARATOR = @PATH_SEPARATOR@
-PERL = @PERL@
-RANLIB = @RANLIB@
-REGEXLIB = @REGEXLIB@
-REPL_LIBS = @REPL_LIBS@
-REPL_OBJS = @REPL_OBJS@
-REPL_POLICIES = @REPL_POLICIES@
-RM = @RM@
-SAMBASOURCES = @SAMBASOURCES@
-SET_MAKE = @SET_MAKE@
-SH = @SH@
-SHELL = @SHELL@
-SNMPLIB = @SNMPLIB@
-SQUID_CFLAGS = @SQUID_CFLAGS@
-SQUID_CPPUNIT_DIR = @SQUID_CPPUNIT_DIR@
-SQUID_CPPUNIT_INC = @SQUID_CPPUNIT_INC@
-SQUID_CPPUNIT_LA = @SQUID_CPPUNIT_LA@
-SQUID_CXXFLAGS = @SQUID_CXXFLAGS@
-SSLLIB = @SSLLIB@
-STORE_LIBS = @STORE_LIBS@
-STORE_LINKOBJS = @STORE_LINKOBJS@
-STORE_OBJS = @STORE_OBJS@
-STRIP = @STRIP@
-TRUE = @TRUE@
-USE_DELAY_POOLS_FALSE = @USE_DELAY_POOLS_FALSE@
-USE_DELAY_POOLS_TRUE = @USE_DELAY_POOLS_TRUE@
-USE_DNSSERVER_FALSE = @USE_DNSSERVER_FALSE@
-USE_DNSSERVER_TRUE = @USE_DNSSERVER_TRUE@
-USE_ESI_FALSE = @USE_ESI_FALSE@
-USE_ESI_TRUE = @USE_ESI_TRUE@
-USE_SNMP_FALSE = @USE_SNMP_FALSE@
-USE_SNMP_TRUE = @USE_SNMP_TRUE@
-VERSION = @VERSION@
-WIN32_PSAPI = @WIN32_PSAPI@
-XTRA_LIBS = @XTRA_LIBS@
-XTRA_OBJS = @XTRA_OBJS@
-ac_ct_AR = @ac_ct_AR@
-ac_ct_CC = @ac_ct_CC@
-ac_ct_CXX = @ac_ct_CXX@
-ac_ct_F77 = @ac_ct_F77@
-ac_ct_RANLIB = @ac_ct_RANLIB@
-ac_ct_STRIP = @ac_ct_STRIP@
-am__fastdepCC_FALSE = @am__fastdepCC_FALSE@
-am__fastdepCC_TRUE = @am__fastdepCC_TRUE@
-am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@
-am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@
-am__include = @am__include@
-am__leading_dot = @am__leading_dot@
-am__quote = @am__quote@
-am__tar = @am__tar@
-am__untar = @am__untar@
-bindir = @bindir@
-build = @build@
-build_alias = @build_alias@
-build_cpu = @build_cpu@
-build_os = @build_os@
-build_vendor = @build_vendor@
-datadir = @datadir@
-exec_prefix = @exec_prefix@
-host = @host@
-host_alias = @host_alias@
-host_cpu = @host_cpu@
-host_os = @host_os@
-host_vendor = @host_vendor@
-includedir = @includedir@
-infodir = @infodir@
-install_sh = @install_sh@
-libdir = @libdir@
-libexecdir = @libexecdir@
-localstatedir = @localstatedir@
-makesnmplib = @makesnmplib@
-mandir = @mandir@
-mkdir_p = @mkdir_p@
-oldincludedir = @oldincludedir@
-prefix = @prefix@
-program_transform_name = @program_transform_name@
-sbindir = @sbindir@
-sharedstatedir = @sharedstatedir@
-subdirs = @subdirs@
-sysconfdir = @sysconfdir@
-target_alias = @target_alias@
-wb_ntlmauth_SOURCES = wb_ntlm_auth.c wb_common.c wbntlm.h
-EXTRA_DIST = \
- patches/wb_common.patch \
- patches/winbind_nss_config.patch
-
-INCLUDES = -I. -I$(top_builddir)/include -I$(top_srcdir)/include \
- -I$(top_srcdir)/src -I@SAMBASOURCES@
-
-LDADD = -L$(top_builddir)/lib -lmiscutil -lntlmauth $(XTRA_LIBS)
-all: all-am
-
-.SUFFIXES:
-.SUFFIXES: .c .lo .o .obj
-$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps)
- @for dep in $?; do \
- case '$(am__configure_deps)' in \
- *$$dep*) \
- cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \
- && exit 0; \
- exit 1;; \
- esac; \
- done; \
- echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign helpers/ntlm_auth/winbind/Makefile'; \
- cd $(top_srcdir) && \
- $(AUTOMAKE) --foreign helpers/ntlm_auth/winbind/Makefile
-.PRECIOUS: Makefile
-Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
- @case '$?' in \
- *config.status*) \
- cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
- *) \
- echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
- cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
- esac;
-
-$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
- cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
-
-$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
- cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
-$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps)
- cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
-install-libexecPROGRAMS: $(libexec_PROGRAMS)
- @$(NORMAL_INSTALL)
- test -z "$(libexecdir)" || $(mkdir_p) "$(DESTDIR)$(libexecdir)"
- @list='$(libexec_PROGRAMS)'; for p in $$list; do \
- p1=`echo $$p|sed 's/$(EXEEXT)$$//'`; \
- if test -f $$p \
- || test -f $$p1 \
- ; then \
- f=`echo "$$p1" | sed 's,^.*/,,;$(transform);s/$$/$(EXEEXT)/'`; \
- echo " $(INSTALL_PROGRAM_ENV) $(LIBTOOL) --mode=install $(libexecPROGRAMS_INSTALL) '$$p' '$(DESTDIR)$(libexecdir)/$$f'"; \
- $(INSTALL_PROGRAM_ENV) $(LIBTOOL) --mode=install $(libexecPROGRAMS_INSTALL) "$$p" "$(DESTDIR)$(libexecdir)/$$f" || exit 1; \
- else :; fi; \
- done
-
-uninstall-libexecPROGRAMS:
- @$(NORMAL_UNINSTALL)
- @list='$(libexec_PROGRAMS)'; for p in $$list; do \
- f=`echo "$$p" | sed 's,^.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/'`; \
- echo " rm -f '$(DESTDIR)$(libexecdir)/$$f'"; \
- rm -f "$(DESTDIR)$(libexecdir)/$$f"; \
- done
-
-clean-libexecPROGRAMS:
- @list='$(libexec_PROGRAMS)'; for p in $$list; do \
- f=`echo $$p|sed 's/$(EXEEXT)$$//'`; \
- echo " rm -f $$p $$f"; \
- rm -f $$p $$f ; \
- done
-wb_ntlmauth$(EXEEXT): $(wb_ntlmauth_OBJECTS) $(wb_ntlmauth_DEPENDENCIES)
- @rm -f wb_ntlmauth$(EXEEXT)
- $(LINK) $(wb_ntlmauth_LDFLAGS) $(wb_ntlmauth_OBJECTS) $(wb_ntlmauth_LDADD) $(LIBS)
-
-mostlyclean-compile:
- -rm -f *.$(OBJEXT)
-
-distclean-compile:
- -rm -f *.tab.c
-
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/wb_common.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/wb_ntlm_auth.Po@am__quote@
-
-.c.o:
-@am__fastdepCC_TRUE@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \
-@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(COMPILE) -c $<
-
-.c.obj:
-@am__fastdepCC_TRUE@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ `$(CYGPATH_W) '$<'`; \
-@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'`
-
-.c.lo:
-@am__fastdepCC_TRUE@ if $(LTCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \
-@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Plo"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $<
-
-mostlyclean-libtool:
- -rm -f *.lo
-
-clean-libtool:
- -rm -rf .libs _libs
-
-distclean-libtool:
- -rm -f libtool
-uninstall-info-am:
-
-ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
- list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
- unique=`for i in $$list; do \
- if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
- done | \
- $(AWK) ' { files[$$0] = 1; } \
- END { for (i in files) print i; }'`; \
- mkid -fID $$unique
-tags: TAGS
-
-TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
- $(TAGS_FILES) $(LISP)
- tags=; \
- here=`pwd`; \
- list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
- unique=`for i in $$list; do \
- if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
- done | \
- $(AWK) ' { files[$$0] = 1; } \
- END { for (i in files) print i; }'`; \
- if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \
- test -n "$$unique" || unique=$$empty_fix; \
- $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
- $$tags $$unique; \
- fi
-ctags: CTAGS
-CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
- $(TAGS_FILES) $(LISP)
- tags=; \
- here=`pwd`; \
- list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
- unique=`for i in $$list; do \
- if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
- done | \
- $(AWK) ' { files[$$0] = 1; } \
- END { for (i in files) print i; }'`; \
- test -z "$(CTAGS_ARGS)$$tags$$unique" \
- || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
- $$tags $$unique
-
-GTAGS:
- here=`$(am__cd) $(top_builddir) && pwd` \
- && cd $(top_srcdir) \
- && gtags -i $(GTAGS_ARGS) $$here
-
-distclean-tags:
- -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
-
-distdir: $(DISTFILES)
- $(mkdir_p) $(distdir)/patches
- @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \
- topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \
- list='$(DISTFILES)'; for file in $$list; do \
- case $$file in \
- $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \
- $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \
- esac; \
- if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
- dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \
- if test "$$dir" != "$$file" && test "$$dir" != "."; then \
- dir="/$$dir"; \
- $(mkdir_p) "$(distdir)$$dir"; \
- else \
- dir=''; \
- fi; \
- if test -d $$d/$$file; then \
- if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
- cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
- fi; \
- cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
- else \
- test -f $(distdir)/$$file \
- || cp -p $$d/$$file $(distdir)/$$file \
- || exit 1; \
- fi; \
- done
-check-am: all-am
-check: check-am
-all-am: Makefile $(PROGRAMS)
-installdirs:
- for dir in "$(DESTDIR)$(libexecdir)"; do \
- test -z "$$dir" || $(mkdir_p) "$$dir"; \
- done
-install: install-am
-install-exec: install-exec-am
-install-data: install-data-am
-uninstall: uninstall-am
-
-install-am: all-am
- @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
-
-installcheck: installcheck-am
-install-strip:
- $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
- install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
- `test -z '$(STRIP)' || \
- echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
-mostlyclean-generic:
-
-clean-generic:
-
-distclean-generic:
- -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
-
-maintainer-clean-generic:
- @echo "This command is intended for maintainers to use"
- @echo "it deletes files that may require special tools to rebuild."
-clean: clean-am
-
-clean-am: clean-generic clean-libexecPROGRAMS clean-libtool \
- mostlyclean-am
-
-distclean: distclean-am
- -rm -rf ./$(DEPDIR)
- -rm -f Makefile
-distclean-am: clean-am distclean-compile distclean-generic \
- distclean-libtool distclean-tags
-
-dvi: dvi-am
-
-dvi-am:
-
-html: html-am
-
-info: info-am
-
-info-am:
-
-install-data-am:
-
-install-exec-am: install-libexecPROGRAMS
-
-install-info: install-info-am
-
-install-man:
-
-installcheck-am:
-
-maintainer-clean: maintainer-clean-am
- -rm -rf ./$(DEPDIR)
- -rm -f Makefile
-maintainer-clean-am: distclean-am maintainer-clean-generic
-
-mostlyclean: mostlyclean-am
-
-mostlyclean-am: mostlyclean-compile mostlyclean-generic \
- mostlyclean-libtool
-
-pdf: pdf-am
-
-pdf-am:
-
-ps: ps-am
-
-ps-am:
-
-uninstall-am: uninstall-info-am uninstall-libexecPROGRAMS
-
-.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \
- clean-libexecPROGRAMS clean-libtool ctags distclean \
- distclean-compile distclean-generic distclean-libtool \
- distclean-tags distdir dvi dvi-am html html-am info info-am \
- install install-am install-data install-data-am install-exec \
- install-exec-am install-info install-info-am \
- install-libexecPROGRAMS install-man install-strip installcheck \
- installcheck-am installdirs maintainer-clean \
- maintainer-clean-generic mostlyclean mostlyclean-compile \
- mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
- tags uninstall uninstall-am uninstall-info-am \
- uninstall-libexecPROGRAMS
-
-# Tell versions [3.59,3.63) of GNU make to not export all variables.
-# Otherwise a system limit (for SysV at least) may be exceeded.
-.NOEXPORT:
+++ /dev/null
---- samba-HEAD/source/nsswitch/wb_common.c Sat Jan 12 23:12:11 2002
-+++ squid-ntlm/src/auth/ntlm/helpers/winbind/wb_common.c Sat Jan 12 23:45:03 2002
-@@ -25,6 +25,8 @@
-
- #include "winbind_nss_config.h"
- #include "winbindd_nss.h"
-+#include "config.h"
-+
-
- /* Global variables. These are effectively the client state information */
-
+++ /dev/null
---- samba-HEAD/source/nsswitch/winbind_nss_config.h Wed Sep 5 10:11:16 2001
-+++ squid-ntlm/src/auth/ntlm/helpers/winbind/winbind_nss_config.h Sat Nov 24 00:32:05 2001
-@@ -27,7 +27,7 @@
-
- /* Include header files from data in config.h file */
-
--#include <config.h>
-+#include "config.h"
-
- #include <stdio.h>
-
-@@ -63,7 +63,7 @@
- #include <sys/stat.h>
- #include <errno.h>
- #include <pwd.h>
--#include "nsswitch/nss.h"
-+#include "samba_nss.h"
-
- /* Declarations for functions in winbind_nss.c
- needed in winbind_nss_solaris.c (solaris wrapper to nss) */
+++ /dev/null
-/*
- Unix SMB/Netbios implementation.
- Version 2.0
-
- winbind client common code
-
- Copyright (C) Tim Potter 2000
- Copyright (C) Andrew Tridgell 2000
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Library General Public
- License as published by the Free Software Foundation; either
- version 2 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Library General Public License for more details.
-
- You should have received a copy of the GNU Library General Public
- License along with this library; if not, write to the
- Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- Boston, MA 02111-1307, USA.
-*/
-
-#include "nsswitch/winbind_nss_config.h"
-#include "nsswitch/winbindd_nss.h"
-#include "config.h"
-
-
-/* Global variables. These are effectively the client state information */
-
-int winbindd_fd = -1; /* fd for winbindd socket */
-static char *excluded_domain;
-
-/* Free a response structure */
-
-void
-free_response(struct winbindd_response *response)
-{
- /* Free any allocated extra_data */
-
- if (response)
- SAFE_FREE(response->extra_data);
-}
-
-/*
- smbd needs to be able to exclude lookups for its own domain
-*/
-void
-winbind_exclude_domain(const char *domain)
-{
- SAFE_FREE(excluded_domain);
- excluded_domain = strdup(domain);
-}
-
-
-/* Initialise a request structure */
-
-void
-init_request(struct winbindd_request *request, int request_type)
-{
- static char *domain_env;
- static BOOL initialised;
-
- request->length = sizeof(struct winbindd_request);
-
- request->cmd = (enum winbindd_cmd) request_type;
- request->pid = getpid();
- request->domain[0] = '\0';
-
- if (!initialised) {
- initialised = True;
- domain_env = getenv(WINBINDD_DOMAIN_ENV);
- }
-
- if (domain_env) {
- strncpy(request->domain, domain_env, sizeof(request->domain) - 1);
- request->domain[sizeof(request->domain) - 1] = '\0';
- }
-}
-
-/* Initialise a response structure */
-
-void
-init_response(struct winbindd_response *response)
-{
- /* Initialise return value */
-
- response->result = WINBINDD_ERROR;
-}
-
-/* Close established socket */
-
-void
-close_sock(void)
-{
- if (winbindd_fd != -1) {
- close(winbindd_fd);
- winbindd_fd = -1;
- }
-}
-
-/* Connect to winbindd socket */
-
-int
-winbind_open_pipe_sock(void)
-{
- struct sockaddr_un sunaddr;
- static pid_t our_pid;
- struct stat st;
- pstring path;
-
- if (our_pid != getpid()) {
- close_sock();
- our_pid = getpid();
- }
-
- if (winbindd_fd != -1) {
- return winbindd_fd;
- }
-
- /* Check permissions on unix socket directory */
-
- if (lstat(WINBINDD_SOCKET_DIR, &st) == -1) {
- return -1;
- }
-
- if (!S_ISDIR(st.st_mode) || (st.st_uid != 0 && st.st_uid != geteuid())) {
- return -1;
- }
-
- /* Connect to socket */
-
- strncpy(path, WINBINDD_SOCKET_DIR, sizeof(path) - 1);
- path[sizeof(path) - 1] = '\0';
-
- strncat(path, "/", sizeof(path) - 1);
- path[sizeof(path) - 1] = '\0';
-
- strncat(path, WINBINDD_SOCKET_NAME, sizeof(path) - 1);
- path[sizeof(path) - 1] = '\0';
-
- ZERO_STRUCT(sunaddr);
- sunaddr.sun_family = AF_UNIX;
- strncpy(sunaddr.sun_path, path, sizeof(sunaddr.sun_path) - 1);
-
- /* If socket file doesn't exist, don't bother trying to connect
- * with retry. This is an attempt to make the system usable when
- * the winbindd daemon is not running. */
-
- if (lstat(path, &st) == -1) {
- return -1;
- }
-
- /* Check permissions on unix socket file */
-
- if (!S_ISSOCK(st.st_mode) || (st.st_uid != 0 && st.st_uid != geteuid())) {
- return -1;
- }
-
- /* Connect to socket */
-
- if ((winbindd_fd = socket(AF_UNIX, SOCK_STREAM, 0)) == -1) {
- return -1;
- }
-
- if (connect(winbindd_fd, (struct sockaddr *) &sunaddr,
- sizeof(sunaddr)) == -1) {
- close_sock();
- return -1;
- }
-
- return winbindd_fd;
-}
-
-/* Write data to winbindd socket with timeout */
-
-int
-write_sock(void *buffer, int count)
-{
- int result, nwritten;
-
- /* Open connection to winbind daemon */
-
- restart:
-
- if (winbind_open_pipe_sock() == -1) {
- return -1;
- }
-
- /* Write data to socket */
-
- nwritten = 0;
-
- while (nwritten < count) {
- struct timeval tv;
- fd_set r_fds;
-
- /* Catch pipe close on other end by checking if a read()
- * call would not block by calling select(). */
-
- FD_ZERO(&r_fds);
- FD_SET(winbindd_fd, &r_fds);
- ZERO_STRUCT(tv);
-
- if (select(winbindd_fd + 1, &r_fds, NULL, NULL, &tv) == -1) {
- close_sock();
- return -1; /* Select error */
- }
-
- /* Write should be OK if fd not available for reading */
-
- if (!FD_ISSET(winbindd_fd, &r_fds)) {
-
- /* Do the write */
-
- result = write(winbindd_fd,
- (char *) buffer + nwritten, count - nwritten);
-
- if ((result == -1) || (result == 0)) {
-
- /* Write failed */
-
- close_sock();
- return -1;
- }
-
- nwritten += result;
-
- } else {
-
- /* Pipe has closed on remote end */
-
- close_sock();
- goto restart;
- }
- }
-
- return nwritten;
-}
-
-/* Read data from winbindd socket with timeout */
-
-static int
-read_sock(void *buffer, int count)
-{
- int result = 0, nread = 0;
-
- /* Read data from socket */
-
- while (nread < count) {
-
- result = read(winbindd_fd, (char *) buffer + nread, count - nread);
-
- if ((result == -1) || (result == 0)) {
-
- /* Read failed. I think the only useful thing we
- * can do here is just return -1 and fail since the
- * transaction has failed half way through. */
-
- close_sock();
- return -1;
- }
-
- nread += result;
- }
-
- return result;
-}
-
-/* Read reply */
-
-int
-read_reply(struct winbindd_response *response)
-{
- int result1, result2 = 0;
-
- if (!response) {
- return -1;
- }
-
- /* Read fixed length response */
-
- if ((result1 = read_sock(response, sizeof(struct winbindd_response)))
- == -1) {
-
- return -1;
- }
-
- /* We actually send the pointer value of the extra_data field from
- * the server. This has no meaning in the client's address space
- * so we clear it out. */
-
- response->extra_data = NULL;
-
- /* Read variable length response */
-
- if (response->length > sizeof(struct winbindd_response)) {
- int extra_data_len = response->length -
- sizeof(struct winbindd_response);
-
- /* Mallocate memory for extra data */
-
- if (!(response->extra_data = malloc(extra_data_len))) {
- return -1;
- }
-
- if ((result2 = read_sock(response->extra_data, extra_data_len))
- == -1) {
- free_response(response);
- return -1;
- }
- }
-
- /* Return total amount of data read */
-
- return result1 + result2;
-}
-
-/*
- * send simple types of requests
- */
-
-NSS_STATUS
-winbindd_send_request(int req_type, struct winbindd_request * request)
-{
- struct winbindd_request lrequest;
-
- /* Check for our tricky environment variable */
-
- if (getenv(WINBINDD_DONT_ENV)) {
- return NSS_STATUS_NOTFOUND;
- }
-
- /* smbd may have excluded this domain */
- if (excluded_domain && strcasecmp(excluded_domain, request->domain) == 0) {
- return NSS_STATUS_NOTFOUND;
- }
-
- if (!request) {
- ZERO_STRUCT(lrequest);
- request = &lrequest;
- }
-
- /* Fill in request and send down pipe */
-
- init_request(request, req_type);
-
- if (write_sock(request, sizeof(*request)) == -1) {
- return NSS_STATUS_UNAVAIL;
- }
-
- return NSS_STATUS_SUCCESS;
-}
-
-/*
- * Get results from winbindd request
- */
-
-NSS_STATUS
-winbindd_get_response(struct winbindd_response * response)
-{
- struct winbindd_response lresponse;
-
- if (!response) {
- ZERO_STRUCT(lresponse);
- response = &lresponse;
- }
-
- init_response(response);
-
- /* Wait for reply */
- if (read_reply(response) == -1) {
- return NSS_STATUS_UNAVAIL;
- }
-
- /* Throw away extra data if client didn't request it */
- if (response == &lresponse) {
- free_response(response);
- }
-
- /* Copy reply data from socket */
- if (response->result != WINBINDD_OK) {
- return NSS_STATUS_NOTFOUND;
- }
-
- return NSS_STATUS_SUCCESS;
-}
-
-/* Handle simple types of requests */
-
-NSS_STATUS
-winbindd_request(int req_type,
- struct winbindd_request * request, struct winbindd_response * response)
-{
- NSS_STATUS status;
-
- status = winbindd_send_request(req_type, request);
- if (status != NSS_STATUS_SUCCESS)
- return (status);
- return winbindd_get_response(response);
-}
+++ /dev/null
-/*
- * (C) 2000 Francesco Chemolli <kinkie@kame.usr.dsi.unimi.it>
- * (C) 2002 Andrew Bartlett <abartlet@samba.org>
- *
- * Distributed freely under the terms of the GNU General Public License,
- * version 2. See the file COPYING for licensing details
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
-
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111, USA.
- *
- */
-/*
- * TODO:
- * -move all squid-helper-protocol-related operations to helper functions
- *
- * - MAYBE move squid-helper-protocol-related opetations to an external
- * library?
- */
-
-
-#include "wbntlm.h"
-#include "util.h"
-#include "squid_endian.h"
-/* stdio.h is included in wbntlm.h */
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <unistd.h>
-#include <sys/time.h> /* for gettimeofday */
-#include <errno.h> /* BUG: is this portable? */
-
-#ifdef HAVE_CTYPE_H
-#include <ctype.h>
-#endif
-
-#ifdef HAVE_UNISTD_H
-#include <unistd.h>
-#endif
-#if HAVE_GETOPT_H
-#include <getopt.h>
-#endif
-
-#include "nsswitch/winbind_nss_config.h"
-#include "nsswitch/winbindd_nss.h"
-
-#ifndef min
-#define min(x,y) ((x)<(y)?(x):(y))
-#endif
-
-void
-authfail(char *domain, char *user, char *reason)
-{
- /* TODO: -move away from SEND-type gcc-isms
- * -prepare for protocol extension as soon as rbcollins is ready
- */
- SEND2("NA %s\\%s auth failure because: %s", domain, user, reason);
-}
-
-void
-authok(const char *domain, const char *user)
-{
- SEND2("AF %s\\%s", domain, user);
-}
-
-void
-sendchallenge(const char *challenge)
-{
- SEND2("TT %s", challenge);
-}
-
-void
-helperfail(const char *reason)
-{
- SEND2("BH %s", reason);
-}
-
-char debug_enabled = 0;
-char *myname;
-pid_t mypid;
-
-static void
-lc(char *string)
-{
- char *p = string, c;
- while ((c = *p)) {
- *p = tolower(c);
- p++;
- }
-}
-
-static void
-uc(char *string)
-{
- char *p = string, c;
- while ((c = *p)) {
- *p = toupper(c);
- p++;
- }
-}
-
-
-
-NSS_STATUS winbindd_request(int req_type,
- struct winbindd_request *request, struct winbindd_response *response);
-
-
-static tristate have_urandom = DONTKNOW;
-FILE *urandom_file = NULL;
-
-void
-init_random()
-{
- if (have_urandom == DONTKNOW) {
- int result = 0;
- struct stat st;
- result = stat(ENTROPY_SOURCE, &st);
- if (result != 0 || !(S_ISCHR(st.st_mode) || S_ISBLK(st.st_mode))) {
- debug("Entropy source " ENTROPY_SOURCE " is unavailable\n");
- have_urandom = NO;
- }
- if ((urandom_file = fopen(ENTROPY_SOURCE, "r")) == NULL) {
- unsigned int seed;
- struct timeval t;
- warn("Can't open entropy source " ENTROPY_SOURCE "\n");
- have_urandom = NO;
- gettimeofday(&t, NULL);
- seed = squid_random() * getpid() * t.tv_sec * t.tv_usec;
- squid_srandom(seed);
- } else {
- have_urandom = YES;
- }
- }
-}
-
-static unsigned char challenge[CHALLENGE_LEN + 1];
-static unsigned char *
-build_challenge(void)
-{
- size_t gotchars;
- unsigned char j;
- switch (have_urandom) {
- case YES:
- if ((gotchars = fread(&challenge, CHALLENGE_LEN, 1, urandom_file)) == 0) {
- /* couldn't get a challenge. Fall back to random() and friends.
- * notice that even a single changed byte is good enough for us */
- have_urandom = NO;
- return build_challenge();
- }
- return challenge;
- case NO:
- if (!(squid_random() % 100)) { /* sometimes */
- init_random();
- }
- for (j = 0; j < CHALLENGE_LEN; j++)
- challenge[j] = (unsigned char) (squid_random() % 256);
- return challenge;
- default:
- warn("Critical internal error. Somebody forgot to initialize "
- "the random system. Exiting.\n");
- exit(1);
- }
-}
-
-lstring lmhash, nthash;
-static char have_nthash = 0; /* simple flag. A tad dirty.. */
-
-void
-do_authenticate(ntlm_authenticate * auth, int auth_length)
-{
- lstring tmp;
- int tocopy;
- NSS_STATUS winbindd_result;
- struct winbindd_request request;
- struct winbindd_response response;
- char *domain, *user;
-
- memset(&request, 0, sizeof(struct winbindd_request));
-
- memset(&response, 0, sizeof(struct winbindd_response));
-
- /* domain */
- tmp = ntlm_fetch_string((char *) auth, auth_length, &auth->domain);
- if (tmp.str == NULL || tmp.l == 0) { /* no domain supplied */
- request.data.auth_crap.domain[0] = 0;
- } else {
- tocopy = min(tmp.l + 1, sizeof(fstring));
- xstrncpy(request.data.auth_crap.domain, tmp.str, tocopy);
- }
-
- domain = request.data.auth_crap.domain; /* just a shortcut */
-
- /* username */
- tmp = ntlm_fetch_string((char *) auth, auth_length, &auth->user);
- if (tmp.str == NULL || tmp.l == 0) {
- authfail(domain, "-", "No username in request");
- return;
- }
-
- tocopy = min(sizeof(fstring), tmp.l + 1);
- xstrncpy(request.data.auth_crap.user, tmp.str, tocopy);
- user = request.data.auth_crap.user;
-
- /* now the LM hash */
- lmhash = ntlm_fetch_string((char *) auth, auth_length, &auth->lmresponse);
- switch (lmhash.l) {
- case 0:
- warn("No lm hash provided by user %s\\%s\n", domain, user);
- request.data.auth_crap.lm_resp_len = 0;
- break;
- case 24:
- memcpy(request.data.auth_crap.lm_resp, lmhash.str, 24);
- request.data.auth_crap.lm_resp_len = 24;
- break;
- default:
- authfail(domain, user, "Broken LM hash response");
- return;
- }
-
- have_nthash = 0;
- nthash = ntlm_fetch_string((char *) auth, auth_length, &auth->ntresponse);
- switch (nthash.l) {
- case 0:
- debug("no nthash\n");
- request.data.auth_crap.nt_resp_len = 0;
- break;
- case 24:
- memcpy(request.data.auth_crap.nt_resp, nthash.str, 24);
- request.data.auth_crap.nt_resp_len = 24;
- have_nthash = 1;
- break;
- default:
- debug("nthash len = %d. Ignoring it.\n", nthash.l);
- request.data.auth_crap.nt_resp_len = 0;
- break;
- }
-
- debug("Checking user '%s\\%s' lmhash len =%d, have_nthash=%d, "
- "nthash len=%d\n", domain, user, lmhash.l, have_nthash, nthash.l);
-
- memcpy(request.data.auth_crap.chal, challenge, CHALLENGE_LEN);
-
- winbindd_result = winbindd_request(WINBINDD_PAM_AUTH_CRAP,
- &request, &response);
- debug("winbindd result: %d\n", winbindd_result);
-
- if (winbindd_result == NSS_STATUS_SUCCESS) {
- lc(domain);
- lc(user);
- authok(domain, user);
- } else {
- char error_buf[200];
- snprintf(error_buf, sizeof(error_buf), "Authentication Failure (%s)",
- response.data.auth.error_string);
- authfail(domain, user, error_buf);
- }
- return; /* useless */
-}
-
-int
-manage_request(char *target_domain)
-{
- char buf[BUFFER_SIZE + 1];
- char *c, *decoded;
- ntlmhdr *fast_header;
- int oversized = 0;
-
-
-try_again:
- if (fgets(buf, BUFFER_SIZE, stdin) == NULL)
- return 0;
-
- c = memchr(buf, '\n', BUFFER_SIZE);
- if (c) {
- if (oversized) {
- helperfail("illegal request received");
- warn("Illegal request received: '%s'\n", buf);
- return 1;
- }
- *c = '\0';
- }
- else {
- warn("No newline in '%s'\n", buf);
- oversized = 1;
- goto try_again;
- }
-
- debug("Got '%s' from squid.\n", buf);
- if (memcmp(buf, "YR", 2) == 0) { /* refresh-request */
- sendchallenge(ntlm_make_challenge(target_domain, NULL,
- build_challenge(), CHALLENGE_LEN));
- return 1;
- }
- if (strncmp(buf, "KK ", 3) != 0) { /* not an auth-request */
- helperfail("illegal request received");
- warn("Illegal request received: '%s'\n", buf);
- return 1;
- }
- /* At this point I'm sure it's a KK */
- decoded = base64_decode(buf + 3);
- if (!decoded) { /* decoding failure, return error */
- authfail("-", "-", "Auth-format error, base64-decoding error");
- return 1;
- }
- fast_header = (struct _ntlmhdr *) decoded;
-
- /* sanity-check: it IS a NTLMSSP packet, isn't it? */
- if (memcmp(fast_header->signature, "NTLMSSP", 8) != 0) {
- authfail("-", "-", "Broken NTLM packet, missing NTLMSSP signature");
- return 1;
- }
- /* Understand what we got */
- switch le32toh(fast_header->type) {
- case NTLM_NEGOTIATE:
- authfail("-", "-", "Received neg-request while expecting auth packet");
- return 1;
- case NTLM_CHALLENGE:
- authfail("-", "-", "Received challenge. Refusing to abide");
- return 1;
- case NTLM_AUTHENTICATE:
- do_authenticate((ntlm_authenticate *) decoded,
- (strlen(buf) - 3) * 3 / 4);
- return 1;
- default:
- helperfail("Unknown authentication packet type");
- return 1;
- }
- /* notreached */
- return 1;
-}
-
-static char *
-get_winbind_domain(void)
-{
- struct winbindd_response response;
- char *domain;
-
- ZERO_STRUCT(response);
-
- /* Send off request */
-
- if (winbindd_request(WINBINDD_DOMAIN_NAME, NULL, &response) !=
- NSS_STATUS_SUCCESS) {
- warn("could not obtain winbind domain name!\n");
- exit(1);
- }
-
- domain = strdup(response.data.domain_name);
- uc(domain);
-
- warn("target domain is %s\n", domain);
- return domain;
-}
-
-static void
-usage(char *program)
-{
- fprintf(stderr,"Usage: %s [-d] [-h] [domain]\n"
- " -d enable debugging\n"
- " -h this message\n"
- " domain target domain, if different from the winbind configuration\n",
- program);
-}
-
-char *
-process_options(int argc, char *argv[])
-{
- int opt;
- char *target_domain = NULL;
-
- opterr = 0;
- while (-1 != (opt = getopt(argc, argv, "dh"))) {
- switch (opt) {
- case 'd':
- debug_enabled = 1;
- break;
- case 'h':
- usage(argv[0]);
- exit(0);
- case '?':
- opt = optopt;
- /* fall thru to default */
- default:
- warn("Unknown option: -%c\n\n", opt);
- usage(argv[0]);
- exit(1);
- break; /* not reached */
- }
- }
- if (optind < argc) {
- target_domain = argv[optind++];
- warn("target domain is %s\n", target_domain);
- if (optind < argc) {
- warn("Unknown argument: %s\n\n", argv[optind]);
- usage(argv[0]);
- exit(1);
- }
- }
- return target_domain;
-}
-
-void
-check_winbindd()
-{
- NSS_STATUS r;
- int retry=10;
- struct winbindd_request request;
- struct winbindd_response response;
- do {
- r = winbindd_request(WINBINDD_INTERFACE_VERSION, &request, &response);
- if (r != NSS_STATUS_SUCCESS)
- retry--;
- } while (r != NSS_STATUS_SUCCESS && retry);
- if (r != NSS_STATUS_SUCCESS) {
- warn("Can't contact winbindd. Dying\n");
- exit(1);
- }
- if (response.data.interface_version != WINBIND_INTERFACE_VERSION) {
- warn("Winbind protocol mismatch. Align squid and samba. Dying\n");
- exit(1);
- }
-}
-
-int
-main(int argc, char **argv)
-{
- char *target_domain;
- if (argc > 0) { /* should always be true */
- myname = strrchr(argv[0], '/');
- if (myname == NULL)
- myname = argv[0];
- else
- myname++;
- } else {
- myname = "(unknown)";
- }
- mypid = getpid();
- target_domain = process_options(argc, argv);
- debug("ntlm winbindd auth helper build " __DATE__ ", " __TIME__
- " starting up...\n");
-
- check_winbindd();
-
- if (target_domain == NULL) {
- target_domain = get_winbind_domain();
- }
-
- /* initialize FDescs */
- setbuf(stdout, NULL);
- setbuf(stderr, NULL);
- init_random();
- while (manage_request(target_domain)) {
- /* everything is done within manage_request */
- }
- return 0;
-}
+++ /dev/null
-/*
- * (C) 2000 Francesco Chemolli <kinkie@kame.usr.dsi.unimi.it>,
- *
- * Distributed freely under the terms of the GNU General Public License,
- * version 2. See the file COPYING for licensing details
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
-
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111, USA.
- */
-
-#ifndef _WBNTLM_H_
-#define _WBNTLM_H_
-
-#include "config.h"
-#include "ntlmauth.h"
-#include <sys/types.h>
-#include <unistd.h>
-#include <stdlib.h>
-#include <stdio.h>
-
-
-/*************** CONFIGURATION ***************/
-#ifndef DEBUG
-#define DEBUG
-#endif
-
-/* the attempted entropy source. If it doesn't exist, random() is uesed */
-#define ENTROPY_SOURCE "/dev/urandom"
-
-/************* END CONFIGURATION *************/
-
-/* Debugging stuff */
-extern char *myname;
-static const char *__foo;
-extern pid_t mypid;
-extern char debug_enabled;
-
-#ifdef DEBUG
-#define __DO_DEBUG 1
-#else
-#define __DO_DEBUG 0
-#endif
-
-#if defined(__GNUC__) || defined(__ICC) /* this is really a gcc-ism */
-#define warn(X...) fprintf(stderr,"%s[%d](%s:%d): ", myname, mypid, \
- ((__foo=strrchr(__FILE__,'/'))==NULL?__FILE__:__foo+1),\
- __LINE__);\
- fprintf(stderr,X)
-#define debug(X...) if(__DO_DEBUG && debug_enabled) { warn(X); }
-#else /* __GNUC__ */
-static void
-debug(char *format,...)
-{
-}
-static void
-warn(char *format,...)
-{
-}
-#endif /* __GNUC__ */
-
-
-
-/* A couple of harmless helper macros */
-#define SEND(X) debug("sending '%s' to squid\n",X); printf(X "\n");
-#if defined(__GNUC__) || defined (__ICC)
-#define SEND2(X,Y...) debug("sending '" X "' to squid\n",Y); \
- printf(X "\n",Y)
-#else
-/* no gcc, no debugging. varargs macros are a gcc extension */
-#define SEND2 printf
-#endif
-
-typedef enum {
- YES,
- NO,
- DONTKNOW
-} tristate;
-
-#define CHALLENGE_LEN 8
-#define BUFFER_SIZE 2010
-
-#endif /* _WBNTLM_H_ */