From d3b9e074d41d5097e2c9567e8c9a4b9b3d7dbf24 Mon Sep 17 00:00:00 2001 From: William Brown Date: Tue, 7 Jun 2016 13:54:52 +1000 Subject: [PATCH] Ticket 48272 - ADDN Sytle prebind plugin Fix Description: This plugin allows a unique entry that matches some filter to bind with "user1" -> "uid=user1,ou=People,dc=example,dc=com". For the user to bind: * Only a single entry may be mapped from the filter, else it is considered a failure. * The entry must belong under a specific suffix * The user@domain.com style bind is NOT implemented yet. https://fedorahosted.org/389/ticket/48272 Author: wibrown Review by: ??? --- Makefile.am | 14 +- Makefile.in | 125 +++++++-- aclocal.m4 | 194 +++++++++----- config.h.in | 3 - configure | 342 ++++++++++++------------ dirsrvtests/tests/tickets/ticket48272_test.py | 171 ++++++++++++ ldap/servers/plugins/addn/addn.c | 367 ++++++++++++++++++++++++++ ldap/servers/plugins/addn/addn.h | 22 ++ ldap/servers/slapd/bind.c | 5 + 9 files changed, 975 insertions(+), 268 deletions(-) create mode 100644 dirsrvtests/tests/tickets/ticket48272_test.py create mode 100644 ldap/servers/plugins/addn/addn.c create mode 100644 ldap/servers/plugins/addn/addn.h diff --git a/Makefile.am b/Makefile.am index 824b745..4d29d7a 100644 --- a/Makefile.am +++ b/Makefile.am @@ -242,7 +242,9 @@ LIBACCTPOLICY_SCHEMA = $(srcdir)/ldap/schema/60acctpolicy.ldif enable_acctpolicy = 1 endif -serverplugin_LTLIBRARIES = libacl-plugin.la libattr-unique-plugin.la \ +serverplugin_LTLIBRARIES = libacl-plugin.la \ + libaddn-plugin.la \ + libattr-unique-plugin.la \ libautomember-plugin.la libback-ldbm.la libchainingdb-plugin.la \ libcollation-plugin.la libcos-plugin.la libderef-plugin.la \ libpbe-plugin.la libdistrib-plugin.la libhttp-client-plugin.la \ @@ -324,6 +326,7 @@ dist_noinst_HEADERS = \ ldap/include/regex.h \ ldap/include/srchpref.h \ ldap/include/sysexits-compat.h \ + ldap/servers/plugins/addn/addn.h \ ldap/servers/plugins/collation/config.h \ ldap/servers/plugins/collation/collate.h \ ldap/servers/plugins/collation/orfilter.h \ @@ -1166,6 +1169,15 @@ libacl_plugin_la_LDFLAGS = -avoid-version libacl_plugin_la_LINK = $(CXXLINK) -avoid-version #------------------------ +# libaddn-plugin +#------------------------ +libaddn_plugin_la_SOURCES = ldap/servers/plugins/addn/addn.c + +libaddn_plugin_la_CPPFLAGS = $(PLUGIN_CPPFLAGS) +libaddn_plugin_la_LIBADD = libslapd.la $(NSPR_LINK) +libaddn_plugin_la_LDFLAGS = -avoid-version + +#------------------------ # librootdn-access-plugin #------------------------ # diff --git a/Makefile.in b/Makefile.in index 0752ff1..16244bf 100644 --- a/Makefile.in +++ b/Makefile.in @@ -1,7 +1,7 @@ -# Makefile.in generated by automake 1.13.4 from Makefile.am. +# Makefile.in generated by automake 1.15 from Makefile.am. # @configure_input@ -# Copyright (C) 1994-2013 Free Software Foundation, Inc. +# Copyright (C) 1994-2014 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -20,7 +20,17 @@ VPATH = @srcdir@ -am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)' +am__is_gnu_make = { \ + if test -z '$(MAKELEVEL)'; then \ + false; \ + elif test -n '$(MAKE_HOST)'; then \ + true; \ + elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ + true; \ + else \ + false; \ + fi; \ +} am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ @@ -93,12 +103,6 @@ noinst_PROGRAMS = makstrdb$(EXEEXT) @SOLARIS_TRUE@am__append_2 = -lrt @SOLARIS_TRUE@am__append_3 = ldap/servers/slapd/tools/ldclt/opCheck.c subdir = . -DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \ - $(top_srcdir)/configure $(am__configure_deps) \ - $(srcdir)/config.h.in $(top_srcdir)/rpm/389-ds-base.spec.in \ - depcomp $(dist_man_MANS) $(dist_noinst_DATA) \ - $(dist_noinst_HEADERS) $(serverinc_HEADERS) README compile \ - config.guess config.sub install-sh missing ltmain.sh ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/libtool.m4 \ $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ @@ -113,6 +117,9 @@ am__aclocal_m4_deps = $(top_srcdir)/m4/libtool.m4 \ $(top_srcdir)/m4/systemd.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) +DIST_COMMON = $(srcdir)/Makefile.am $(top_srcdir)/configure \ + $(am__configure_deps) $(dist_noinst_DATA) \ + $(dist_noinst_HEADERS) $(serverinc_HEADERS) $(am__DIST_COMMON) am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \ configure.lineno config.status.lineno mkinstalldirs = $(install_sh) -d @@ -226,6 +233,14 @@ am_libacl_plugin_la_OBJECTS = \ ldap/servers/plugins/acl/libacl_plugin_la-aclplugin.lo \ ldap/servers/plugins/acl/libacl_plugin_la-aclutil.lo libacl_plugin_la_OBJECTS = $(am_libacl_plugin_la_OBJECTS) +libaddn_plugin_la_DEPENDENCIES = libslapd.la $(am__DEPENDENCIES_1) +am_libaddn_plugin_la_OBJECTS = \ + ldap/servers/plugins/addn/libaddn_plugin_la-addn.lo +libaddn_plugin_la_OBJECTS = $(am_libaddn_plugin_la_OBJECTS) +libaddn_plugin_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \ + $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) \ + $(AM_CFLAGS) $(CFLAGS) $(libaddn_plugin_la_LDFLAGS) $(LDFLAGS) \ + -o $@ libattr_unique_plugin_la_DEPENDENCIES = libslapd.la \ $(am__DEPENDENCIES_1) am_libattr_unique_plugin_la_OBJECTS = \ @@ -1150,7 +1165,7 @@ am__v_CXXLD_1 = SOURCES = $(libavl_a_SOURCES) $(libldaputil_a_SOURCES) \ $(libacctpolicy_plugin_la_SOURCES) \ $(libacctusability_plugin_la_SOURCES) \ - $(libacl_plugin_la_SOURCES) \ + $(libacl_plugin_la_SOURCES) $(libaddn_plugin_la_SOURCES) \ $(libattr_unique_plugin_la_SOURCES) \ $(libautomember_plugin_la_SOURCES) $(libback_ldbm_la_SOURCES) \ $(libbitwise_plugin_la_SOURCES) \ @@ -1185,7 +1200,7 @@ SOURCES = $(libavl_a_SOURCES) $(libldaputil_a_SOURCES) \ DIST_SOURCES = $(libavl_a_SOURCES) $(libldaputil_a_SOURCES) \ $(libacctpolicy_plugin_la_SOURCES) \ $(libacctusability_plugin_la_SOURCES) \ - $(libacl_plugin_la_SOURCES) \ + $(libacl_plugin_la_SOURCES) $(libaddn_plugin_la_SOURCES) \ $(libattr_unique_plugin_la_SOURCES) \ $(libautomember_plugin_la_SOURCES) $(libback_ldbm_la_SOURCES) \ $(libbitwise_plugin_la_SOURCES) \ @@ -1255,6 +1270,10 @@ ETAGS = etags CTAGS = ctags CSCOPE = cscope AM_RECURSIVE_TARGETS = cscope +am__DIST_COMMON = $(dist_man_MANS) $(srcdir)/Makefile.in \ + $(srcdir)/config.h.in $(top_srcdir)/rpm/389-ds-base.spec.in \ + README compile config.guess config.sub depcomp install-sh \ + ltmain.sh missing DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) distdir = $(PACKAGE)-$(VERSION) top_distdir = $(distdir) @@ -1465,6 +1484,7 @@ program_transform_name = @program_transform_name@ propertydir = $(datadir)@propertydir@ psdir = @psdir@ pythondir = $(libdir)@pythondir@ +pythonexec = @pythonexec@ sampledatadir = $(datadir)@sampledatadir@ sasl_inc = @sasl_inc@ sasl_lib = @sasl_lib@ @@ -1523,6 +1543,8 @@ DS_DEFINES = -DBUILD_NUM=$(BUILDNUM) -DVENDOR="\"$(vendor)\"" -DBRAND="\"$(brand @enable_nunc_stans_FALSE@NUNC_STANS_ON = 0 @enable_nunc_stans_TRUE@NUNC_STANS_ON = 1 DS_INCLUDES = -I$(srcdir)/ldap/include -I$(srcdir)/ldap/servers/slapd -I$(srcdir)/include -I. $(NUNC_STANS_INCLUDES) +@enable_asan_FALSE@ASAN_ON = 0 +@enable_asan_TRUE@ASAN_ON = 1 # these paths are dependent on the settings of prefix and exec_prefix which may be specified # at make time. So we cannot use AC_DEFINE in the configure.ac because that would set the @@ -1628,6 +1650,7 @@ CLEANFILES = dberrstrs.h ns-slapd.properties \ ldap/admin/src/scripts/ns-inactivate.pl ldap/admin/src/scripts/ns-newpwpolicy.pl \ ldap/admin/src/scripts/schema-reload.pl ldap/admin/src/scripts/syntax-validate.pl \ ldap/admin/src/scripts/usn-tombstone-cleanup.pl ldap/admin/src/scripts/verify-db.pl \ + ldap/admin/src/scripts/ds_selinux_port_query ldap/admin/src/scripts/ds_selinux_enabled \ ldap/admin/src/scripts/dbverify \ $(NULL) @@ -1653,7 +1676,9 @@ server_LTLIBRARIES = libslapd.la libns-dshttpd.la @enable_acctpolicy_TRUE@LIBACCTPOLICY_PLUGIN = libacctpolicy-plugin.la @enable_acctpolicy_TRUE@LIBACCTPOLICY_SCHEMA = $(srcdir)/ldap/schema/60acctpolicy.ldif @enable_acctpolicy_TRUE@enable_acctpolicy = 1 -serverplugin_LTLIBRARIES = libacl-plugin.la libattr-unique-plugin.la \ +serverplugin_LTLIBRARIES = libacl-plugin.la \ + libaddn-plugin.la \ + libattr-unique-plugin.la \ libautomember-plugin.la libback-ldbm.la libchainingdb-plugin.la \ libcollation-plugin.la libcos-plugin.la libderef-plugin.la \ libpbe-plugin.la libdistrib-plugin.la libhttp-client-plugin.la \ @@ -1731,6 +1756,7 @@ dist_noinst_HEADERS = \ ldap/include/regex.h \ ldap/include/srchpref.h \ ldap/include/sysexits-compat.h \ + ldap/servers/plugins/addn/addn.h \ ldap/servers/plugins/collation/config.h \ ldap/servers/plugins/collation/collate.h \ ldap/servers/plugins/collation/orfilter.h \ @@ -2027,6 +2053,8 @@ sbin_SCRIPTS = ldap/admin/src/scripts/setup-ds.pl \ ldap/admin/src/scripts/dbverify \ ldap/admin/src/scripts/upgradedb \ ldap/admin/src/scripts/dbmon.sh \ + ldap/admin/src/scripts/ds_selinux_enabled \ + ldap/admin/src/scripts/ds_selinux_port_query \ wrappers/ldap-agent bin_SCRIPTS = ldap/servers/slapd/tools/rsearch/scripts/dbgen.pl \ @@ -2512,6 +2540,14 @@ libacl_plugin_la_LDFLAGS = -avoid-version libacl_plugin_la_LINK = $(CXXLINK) -avoid-version #------------------------ +# libaddn-plugin +#------------------------ +libaddn_plugin_la_SOURCES = ldap/servers/plugins/addn/addn.c +libaddn_plugin_la_CPPFLAGS = $(PLUGIN_CPPFLAGS) +libaddn_plugin_la_LIBADD = libslapd.la $(NSPR_LINK) +libaddn_plugin_la_LDFLAGS = -avoid-version + +#------------------------ # librootdn-access-plugin #------------------------ # @@ -3108,6 +3144,7 @@ rsearch_bin_LDADD = $(NSPR_LINK) $(NSS_LINK) $(LDAPSDK_LINK) $(SASL_LINK) $(LIBS @BUNDLE_FALSE@ -e 's,@enable_autobind\@,$(enable_autobind),g' \ @BUNDLE_FALSE@ -e 's,@enable_auto_dn_suffix\@,$(enable_auto_dn_suffix),g' \ @BUNDLE_FALSE@ -e 's,@enable_presence\@,$(enable_presence),g' \ +@BUNDLE_FALSE@ -e 's,@enable_asan\@,$(ASAN_ON),g' \ @BUNDLE_FALSE@ -e 's,@ECHO_N\@,$(ECHO_N),g' \ @BUNDLE_FALSE@ -e 's,@ECHO_C\@,$(ECHO_C),g' \ @BUNDLE_FALSE@ -e 's,@brand\@,$(brand),g' \ @@ -3126,6 +3163,7 @@ rsearch_bin_LDADD = $(NSPR_LINK) $(NSS_LINK) $(LDAPSDK_LINK) $(SASL_LINK) $(LIBS @BUNDLE_FALSE@ -e 's,@with_selinux\@,@with_selinux@,g' \ @BUNDLE_FALSE@ -e 's,@with_tmpfiles_d\@,@with_tmpfiles_d@,g' \ @BUNDLE_FALSE@ -e 's,@perlexec\@,@perlexec@,g' \ +@BUNDLE_FALSE@ -e 's,@pythonexec\@,@pythonexec@,g' \ @BUNDLE_FALSE@ -e 's,@sttyexec\@,@sttyexec@,g' \ @BUNDLE_FALSE@ -e 's,@initconfigdir\@,$(initconfigdir),g' \ @BUNDLE_FALSE@ -e 's,@updatedir\@,$(updatedir),g' \ @@ -3185,6 +3223,7 @@ rsearch_bin_LDADD = $(NSPR_LINK) $(NSS_LINK) $(LDAPSDK_LINK) $(SASL_LINK) $(LIBS @BUNDLE_TRUE@ -e 's,@enable_autobind\@,$(enable_autobind),g' \ @BUNDLE_TRUE@ -e 's,@enable_auto_dn_suffix\@,$(enable_auto_dn_suffix),g' \ @BUNDLE_TRUE@ -e 's,@enable_presence\@,$(enable_presence),g' \ +@BUNDLE_TRUE@ -e 's,@enable_asan\@,$(ASAN_ON),g' \ @BUNDLE_TRUE@ -e 's,@ECHO_N\@,$(ECHO_N),g' \ @BUNDLE_TRUE@ -e 's,@ECHO_C\@,$(ECHO_C),g' \ @BUNDLE_TRUE@ -e 's,@brand\@,$(brand),g' \ @@ -3203,6 +3242,7 @@ rsearch_bin_LDADD = $(NSPR_LINK) $(NSS_LINK) $(LDAPSDK_LINK) $(SASL_LINK) $(LIBS @BUNDLE_TRUE@ -e 's,@with_selinux\@,@with_selinux@,g' \ @BUNDLE_TRUE@ -e 's,@with_tmpfiles_d\@,@with_tmpfiles_d@,g' \ @BUNDLE_TRUE@ -e 's,@perlexec\@,@perlexec@,g' \ +@BUNDLE_TRUE@ -e 's,@pythonexec\@,@pythonexec@,g' \ @BUNDLE_TRUE@ -e 's,@sttyexec\@,@sttyexec@,g' \ @BUNDLE_TRUE@ -e 's,@initconfigdir\@,$(initconfigdir),g'\ @BUNDLE_TRUE@ -e 's,@updatedir\@,$(updatedir),g' \ @@ -3232,7 +3272,6 @@ $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__confi echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign Makefile -.PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ @@ -3253,8 +3292,8 @@ $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) $(am__aclocal_m4_deps): config.h: stamp-h1 - @if test ! -f $@; then rm -f stamp-h1; else :; fi - @if test ! -f $@; then $(MAKE) $(AM_MAKEFLAGS) stamp-h1; else :; fi + @test -f $@ || rm -f stamp-h1 + @test -f $@ || $(MAKE) $(AM_MAKEFLAGS) stamp-h1 stamp-h1: $(srcdir)/config.h.in $(top_builddir)/config.status @rm -f stamp-h1 @@ -3465,6 +3504,18 @@ ldap/servers/plugins/acl/libacl_plugin_la-aclutil.lo: \ libacl-plugin.la: $(libacl_plugin_la_OBJECTS) $(libacl_plugin_la_DEPENDENCIES) $(EXTRA_libacl_plugin_la_DEPENDENCIES) $(AM_V_GEN)$(libacl_plugin_la_LINK) -rpath $(serverplugindir) $(libacl_plugin_la_OBJECTS) $(libacl_plugin_la_LIBADD) $(LIBS) +ldap/servers/plugins/addn/$(am__dirstamp): + @$(MKDIR_P) ldap/servers/plugins/addn + @: > ldap/servers/plugins/addn/$(am__dirstamp) +ldap/servers/plugins/addn/$(DEPDIR)/$(am__dirstamp): + @$(MKDIR_P) ldap/servers/plugins/addn/$(DEPDIR) + @: > ldap/servers/plugins/addn/$(DEPDIR)/$(am__dirstamp) +ldap/servers/plugins/addn/libaddn_plugin_la-addn.lo: \ + ldap/servers/plugins/addn/$(am__dirstamp) \ + ldap/servers/plugins/addn/$(DEPDIR)/$(am__dirstamp) + +libaddn-plugin.la: $(libaddn_plugin_la_OBJECTS) $(libaddn_plugin_la_DEPENDENCIES) $(EXTRA_libaddn_plugin_la_DEPENDENCIES) + $(AM_V_CCLD)$(libaddn_plugin_la_LINK) -rpath $(serverplugindir) $(libaddn_plugin_la_OBJECTS) $(libaddn_plugin_la_LIBADD) $(LIBS) ldap/servers/plugins/uiduniq/$(am__dirstamp): @$(MKDIR_P) ldap/servers/plugins/uiduniq @: > ldap/servers/plugins/uiduniq/$(am__dirstamp) @@ -5458,6 +5509,8 @@ mostlyclean-compile: -rm -f ldap/servers/plugins/acctpolicy/*.lo -rm -f ldap/servers/plugins/acl/*.$(OBJEXT) -rm -f ldap/servers/plugins/acl/*.lo + -rm -f ldap/servers/plugins/addn/*.$(OBJEXT) + -rm -f ldap/servers/plugins/addn/*.lo -rm -f ldap/servers/plugins/automember/*.$(OBJEXT) -rm -f ldap/servers/plugins/automember/*.lo -rm -f ldap/servers/plugins/bitwise/*.$(OBJEXT) @@ -5561,6 +5614,7 @@ distclean-compile: @AMDEP_TRUE@@am__include@ @am__quote@ldap/servers/plugins/acl/$(DEPDIR)/libacl_plugin_la-aclparse.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@ldap/servers/plugins/acl/$(DEPDIR)/libacl_plugin_la-aclplugin.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@ldap/servers/plugins/acl/$(DEPDIR)/libacl_plugin_la-aclutil.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@ldap/servers/plugins/addn/$(DEPDIR)/libaddn_plugin_la-addn.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@ldap/servers/plugins/automember/$(DEPDIR)/libautomember_plugin_la-automember.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@ldap/servers/plugins/bitwise/$(DEPDIR)/libbitwise_plugin_la-bitwise.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@ldap/servers/plugins/chainingdb/$(DEPDIR)/libchainingdb_plugin_la-cb_abandon.Plo@am__quote@ @@ -6289,6 +6343,13 @@ ldap/servers/plugins/acl/libacl_plugin_la-aclutil.lo: ldap/servers/plugins/acl/a @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libacl_plugin_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o ldap/servers/plugins/acl/libacl_plugin_la-aclutil.lo `test -f 'ldap/servers/plugins/acl/aclutil.c' || echo '$(srcdir)/'`ldap/servers/plugins/acl/aclutil.c +ldap/servers/plugins/addn/libaddn_plugin_la-addn.lo: ldap/servers/plugins/addn/addn.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libaddn_plugin_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT ldap/servers/plugins/addn/libaddn_plugin_la-addn.lo -MD -MP -MF ldap/servers/plugins/addn/$(DEPDIR)/libaddn_plugin_la-addn.Tpo -c -o ldap/servers/plugins/addn/libaddn_plugin_la-addn.lo `test -f 'ldap/servers/plugins/addn/addn.c' || echo '$(srcdir)/'`ldap/servers/plugins/addn/addn.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) ldap/servers/plugins/addn/$(DEPDIR)/libaddn_plugin_la-addn.Tpo ldap/servers/plugins/addn/$(DEPDIR)/libaddn_plugin_la-addn.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='ldap/servers/plugins/addn/addn.c' object='ldap/servers/plugins/addn/libaddn_plugin_la-addn.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libaddn_plugin_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o ldap/servers/plugins/addn/libaddn_plugin_la-addn.lo `test -f 'ldap/servers/plugins/addn/addn.c' || echo '$(srcdir)/'`ldap/servers/plugins/addn/addn.c + ldap/servers/plugins/uiduniq/libattr_unique_plugin_la-7bit.lo: ldap/servers/plugins/uiduniq/7bit.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libattr_unique_plugin_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT ldap/servers/plugins/uiduniq/libattr_unique_plugin_la-7bit.lo -MD -MP -MF ldap/servers/plugins/uiduniq/$(DEPDIR)/libattr_unique_plugin_la-7bit.Tpo -c -o ldap/servers/plugins/uiduniq/libattr_unique_plugin_la-7bit.lo `test -f 'ldap/servers/plugins/uiduniq/7bit.c' || echo '$(srcdir)/'`ldap/servers/plugins/uiduniq/7bit.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) ldap/servers/plugins/uiduniq/$(DEPDIR)/libattr_unique_plugin_la-7bit.Tpo ldap/servers/plugins/uiduniq/$(DEPDIR)/libattr_unique_plugin_la-7bit.Plo @@ -9815,6 +9876,7 @@ clean-libtool: -rm -rf ldap/servers/plugins/acct_usability/.libs ldap/servers/plugins/acct_usability/_libs -rm -rf ldap/servers/plugins/acctpolicy/.libs ldap/servers/plugins/acctpolicy/_libs -rm -rf ldap/servers/plugins/acl/.libs ldap/servers/plugins/acl/_libs + -rm -rf ldap/servers/plugins/addn/.libs ldap/servers/plugins/addn/_libs -rm -rf ldap/servers/plugins/automember/.libs ldap/servers/plugins/automember/_libs -rm -rf ldap/servers/plugins/bitwise/.libs ldap/servers/plugins/bitwise/_libs -rm -rf ldap/servers/plugins/chainingdb/.libs ldap/servers/plugins/chainingdb/_libs @@ -10351,10 +10413,16 @@ dist-xz: distdir $(am__post_remove_distdir) dist-tarZ: distdir + @echo WARNING: "Support for distribution archives compressed with" \ + "legacy program 'compress' is deprecated." >&2 + @echo WARNING: "It will be removed altogether in Automake 2.0" >&2 tardir=$(distdir) && $(am__tar) | compress -c >$(distdir).tar.Z $(am__post_remove_distdir) dist-shar: distdir + @echo WARNING: "Support for shar distribution archives is" \ + "deprecated." >&2 + @echo WARNING: "It will be removed altogether in Automake 2.0" >&2 shar $(distdir) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).shar.gz $(am__post_remove_distdir) @@ -10389,16 +10457,17 @@ distcheck: dist esac chmod -R a-w $(distdir) chmod u+w $(distdir) - mkdir $(distdir)/_build $(distdir)/_inst + mkdir $(distdir)/_build $(distdir)/_build/sub $(distdir)/_inst chmod a-w $(distdir) test -d $(distdir)/_build || exit 0; \ dc_install_base=`$(am__cd) $(distdir)/_inst && pwd | sed -e 's,^[^:\\/]:[\\/],/,'` \ && dc_destdir="$${TMPDIR-/tmp}/am-dc-$$$$/" \ && am__cwd=`pwd` \ - && $(am__cd) $(distdir)/_build \ - && ../configure --srcdir=.. --prefix="$$dc_install_base" \ + && $(am__cd) $(distdir)/_build/sub \ + && ../../configure \ $(AM_DISTCHECK_CONFIGURE_FLAGS) \ $(DISTCHECK_CONFIGURE_FLAGS) \ + --srcdir=../.. --prefix="$$dc_install_base" \ && $(MAKE) $(AM_MAKEFLAGS) \ && $(MAKE) $(AM_MAKEFLAGS) dvi \ && $(MAKE) $(AM_MAKEFLAGS) check \ @@ -10496,6 +10565,8 @@ distclean-generic: -rm -f ldap/servers/plugins/acctpolicy/$(am__dirstamp) -rm -f ldap/servers/plugins/acl/$(DEPDIR)/$(am__dirstamp) -rm -f ldap/servers/plugins/acl/$(am__dirstamp) + -rm -f ldap/servers/plugins/addn/$(DEPDIR)/$(am__dirstamp) + -rm -f ldap/servers/plugins/addn/$(am__dirstamp) -rm -f ldap/servers/plugins/automember/$(DEPDIR)/$(am__dirstamp) -rm -f ldap/servers/plugins/automember/$(am__dirstamp) -rm -f ldap/servers/plugins/bitwise/$(DEPDIR)/$(am__dirstamp) @@ -10596,7 +10667,7 @@ clean-am: clean-binPROGRAMS clean-generic clean-libtool clean-local \ distclean: distclean-am -rm -f $(am__CONFIG_DISTCLEAN_FILES) - -rm -rf ldap/libraries/libavl/$(DEPDIR) ldap/servers/plugins/acct_usability/$(DEPDIR) ldap/servers/plugins/acctpolicy/$(DEPDIR) ldap/servers/plugins/acl/$(DEPDIR) ldap/servers/plugins/automember/$(DEPDIR) ldap/servers/plugins/bitwise/$(DEPDIR) ldap/servers/plugins/chainingdb/$(DEPDIR) ldap/servers/plugins/collation/$(DEPDIR) ldap/servers/plugins/cos/$(DEPDIR) ldap/servers/plugins/deref/$(DEPDIR) ldap/servers/plugins/distrib/$(DEPDIR) ldap/servers/plugins/dna/$(DEPDIR) ldap/servers/plugins/http/$(DEPDIR) ldap/servers/plugins/linkedattrs/$(DEPDIR) ldap/servers/plugins/memberof/$(DEPDIR) ldap/servers/plugins/mep/$(DEPDIR) ldap/servers/plugins/pam_passthru/$(DEPDIR) ldap/servers/plugins/passthru/$(DEPDIR) ldap/servers/plugins/posix-winsync/$(DEPDIR) ldap/servers/plugins/presence/$(DEPDIR) ldap/servers/plugins/pwdstorage/$(DEPDIR) ldap/servers/plugins/referint/$(DEPDIR) ldap/servers/plugins/replication/$(DEPDIR) ldap/servers/plugins/retrocl/$(DEPDIR) ldap/servers/plugins/rever/$(DEPDIR) ldap/servers/plugins/roles/$(DEPDIR) ldap/servers/plugins/rootdn_access/$(DEPDIR) ldap/servers/plugins/schema_reload/$(DEPDIR) ldap/servers/plugins/statechange/$(DEPDIR) ldap/servers/plugins/sync/$(DEPDIR) ldap/servers/plugins/syntaxes/$(DEPDIR) ldap/servers/plugins/uiduniq/$(DEPDIR) ldap/servers/plugins/usn/$(DEPDIR) ldap/servers/plugins/views/$(DEPDIR) ldap/servers/plugins/whoami/$(DEPDIR) ldap/servers/slapd/$(DEPDIR) ldap/servers/slapd/back-ldbm/$(DEPDIR) ldap/servers/slapd/tools/$(DEPDIR) ldap/servers/slapd/tools/ldclt/$(DEPDIR) ldap/servers/slapd/tools/rsearch/$(DEPDIR) ldap/servers/snmp/$(DEPDIR) ldap/systools/$(DEPDIR) lib/base/$(DEPDIR) lib/ldaputil/$(DEPDIR) lib/libaccess/$(DEPDIR) lib/libadmin/$(DEPDIR) lib/libsi18n/$(DEPDIR) + -rm -rf ldap/libraries/libavl/$(DEPDIR) ldap/servers/plugins/acct_usability/$(DEPDIR) ldap/servers/plugins/acctpolicy/$(DEPDIR) ldap/servers/plugins/acl/$(DEPDIR) ldap/servers/plugins/addn/$(DEPDIR) ldap/servers/plugins/automember/$(DEPDIR) ldap/servers/plugins/bitwise/$(DEPDIR) ldap/servers/plugins/chainingdb/$(DEPDIR) ldap/servers/plugins/collation/$(DEPDIR) ldap/servers/plugins/cos/$(DEPDIR) ldap/servers/plugins/deref/$(DEPDIR) ldap/servers/plugins/distrib/$(DEPDIR) ldap/servers/plugins/dna/$(DEPDIR) ldap/servers/plugins/http/$(DEPDIR) ldap/servers/plugins/linkedattrs/$(DEPDIR) ldap/servers/plugins/memberof/$(DEPDIR) ldap/servers/plugins/mep/$(DEPDIR) ldap/servers/plugins/pam_passthru/$(DEPDIR) ldap/servers/plugins/passthru/$(DEPDIR) ldap/servers/plugins/posix-winsync/$(DEPDIR) ldap/servers/plugins/presence/$(DEPDIR) ldap/servers/plugins/pwdstorage/$(DEPDIR) ldap/servers/plugins/referint/$(DEPDIR) ldap/servers/plugins/replication/$(DEPDIR) ldap/servers/plugins/retrocl/$(DEPDIR) ldap/servers/plugins/rever/$(DEPDIR) ldap/servers/plugins/roles/$(DEPDIR) ldap/servers/plugins/rootdn_access/$(DEPDIR) ldap/servers/plugins/schema_reload/$(DEPDIR) ldap/servers/plugins/statechange/$(DEPDIR) ldap/servers/plugins/sync/$(DEPDIR) ldap/servers/plugins/syntaxes/$(DEPDIR) ldap/servers/plugins/uiduniq/$(DEPDIR) ldap/servers/plugins/usn/$(DEPDIR) ldap/servers/plugins/views/$(DEPDIR) ldap/servers/plugins/whoami/$(DEPDIR) ldap/servers/slapd/$(DEPDIR) ldap/servers/slapd/back-ldbm/$(DEPDIR) ldap/servers/slapd/tools/$(DEPDIR) ldap/servers/slapd/tools/ldclt/$(DEPDIR) ldap/servers/slapd/tools/rsearch/$(DEPDIR) ldap/servers/snmp/$(DEPDIR) ldap/systools/$(DEPDIR) lib/base/$(DEPDIR) lib/ldaputil/$(DEPDIR) lib/libaccess/$(DEPDIR) lib/libadmin/$(DEPDIR) lib/libsi18n/$(DEPDIR) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-hdr distclean-libtool distclean-tags @@ -10652,7 +10723,7 @@ installcheck-am: maintainer-clean: maintainer-clean-am -rm -f $(am__CONFIG_DISTCLEAN_FILES) -rm -rf $(top_srcdir)/autom4te.cache - -rm -rf ldap/libraries/libavl/$(DEPDIR) ldap/servers/plugins/acct_usability/$(DEPDIR) ldap/servers/plugins/acctpolicy/$(DEPDIR) ldap/servers/plugins/acl/$(DEPDIR) ldap/servers/plugins/automember/$(DEPDIR) ldap/servers/plugins/bitwise/$(DEPDIR) ldap/servers/plugins/chainingdb/$(DEPDIR) ldap/servers/plugins/collation/$(DEPDIR) ldap/servers/plugins/cos/$(DEPDIR) ldap/servers/plugins/deref/$(DEPDIR) ldap/servers/plugins/distrib/$(DEPDIR) ldap/servers/plugins/dna/$(DEPDIR) ldap/servers/plugins/http/$(DEPDIR) ldap/servers/plugins/linkedattrs/$(DEPDIR) ldap/servers/plugins/memberof/$(DEPDIR) ldap/servers/plugins/mep/$(DEPDIR) ldap/servers/plugins/pam_passthru/$(DEPDIR) ldap/servers/plugins/passthru/$(DEPDIR) ldap/servers/plugins/posix-winsync/$(DEPDIR) ldap/servers/plugins/presence/$(DEPDIR) ldap/servers/plugins/pwdstorage/$(DEPDIR) ldap/servers/plugins/referint/$(DEPDIR) ldap/servers/plugins/replication/$(DEPDIR) ldap/servers/plugins/retrocl/$(DEPDIR) ldap/servers/plugins/rever/$(DEPDIR) ldap/servers/plugins/roles/$(DEPDIR) ldap/servers/plugins/rootdn_access/$(DEPDIR) ldap/servers/plugins/schema_reload/$(DEPDIR) ldap/servers/plugins/statechange/$(DEPDIR) ldap/servers/plugins/sync/$(DEPDIR) ldap/servers/plugins/syntaxes/$(DEPDIR) ldap/servers/plugins/uiduniq/$(DEPDIR) ldap/servers/plugins/usn/$(DEPDIR) ldap/servers/plugins/views/$(DEPDIR) ldap/servers/plugins/whoami/$(DEPDIR) ldap/servers/slapd/$(DEPDIR) ldap/servers/slapd/back-ldbm/$(DEPDIR) ldap/servers/slapd/tools/$(DEPDIR) ldap/servers/slapd/tools/ldclt/$(DEPDIR) ldap/servers/slapd/tools/rsearch/$(DEPDIR) ldap/servers/snmp/$(DEPDIR) ldap/systools/$(DEPDIR) lib/base/$(DEPDIR) lib/ldaputil/$(DEPDIR) lib/libaccess/$(DEPDIR) lib/libadmin/$(DEPDIR) lib/libsi18n/$(DEPDIR) + -rm -rf ldap/libraries/libavl/$(DEPDIR) ldap/servers/plugins/acct_usability/$(DEPDIR) ldap/servers/plugins/acctpolicy/$(DEPDIR) ldap/servers/plugins/acl/$(DEPDIR) ldap/servers/plugins/addn/$(DEPDIR) ldap/servers/plugins/automember/$(DEPDIR) ldap/servers/plugins/bitwise/$(DEPDIR) ldap/servers/plugins/chainingdb/$(DEPDIR) ldap/servers/plugins/collation/$(DEPDIR) ldap/servers/plugins/cos/$(DEPDIR) ldap/servers/plugins/deref/$(DEPDIR) ldap/servers/plugins/distrib/$(DEPDIR) ldap/servers/plugins/dna/$(DEPDIR) ldap/servers/plugins/http/$(DEPDIR) ldap/servers/plugins/linkedattrs/$(DEPDIR) ldap/servers/plugins/memberof/$(DEPDIR) ldap/servers/plugins/mep/$(DEPDIR) ldap/servers/plugins/pam_passthru/$(DEPDIR) ldap/servers/plugins/passthru/$(DEPDIR) ldap/servers/plugins/posix-winsync/$(DEPDIR) ldap/servers/plugins/presence/$(DEPDIR) ldap/servers/plugins/pwdstorage/$(DEPDIR) ldap/servers/plugins/referint/$(DEPDIR) ldap/servers/plugins/replication/$(DEPDIR) ldap/servers/plugins/retrocl/$(DEPDIR) ldap/servers/plugins/rever/$(DEPDIR) ldap/servers/plugins/roles/$(DEPDIR) ldap/servers/plugins/rootdn_access/$(DEPDIR) ldap/servers/plugins/schema_reload/$(DEPDIR) ldap/servers/plugins/statechange/$(DEPDIR) ldap/servers/plugins/sync/$(DEPDIR) ldap/servers/plugins/syntaxes/$(DEPDIR) ldap/servers/plugins/uiduniq/$(DEPDIR) ldap/servers/plugins/usn/$(DEPDIR) ldap/servers/plugins/views/$(DEPDIR) ldap/servers/plugins/whoami/$(DEPDIR) ldap/servers/slapd/$(DEPDIR) ldap/servers/slapd/back-ldbm/$(DEPDIR) ldap/servers/slapd/tools/$(DEPDIR) ldap/servers/slapd/tools/ldclt/$(DEPDIR) ldap/servers/slapd/tools/rsearch/$(DEPDIR) ldap/servers/snmp/$(DEPDIR) ldap/systools/$(DEPDIR) lib/base/$(DEPDIR) lib/ldaputil/$(DEPDIR) lib/libaccess/$(DEPDIR) lib/libadmin/$(DEPDIR) lib/libsi18n/$(DEPDIR) -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic @@ -10726,6 +10797,8 @@ uninstall-man: uninstall-man1 uninstall-man8 uninstall-systemdsystemunitDATA uninstall-taskSCRIPTS \ uninstall-updateDATA uninstall-updateSCRIPTS +.PRECIOUS: Makefile + clean-local: -rm -rf dist @@ -10774,9 +10847,13 @@ ns-slapd.properties: makstrdb $(fixupcmd) $^ > $@ # yes, that is an @ in the filename . . . -%/$(PACKAGE_NAME)@.service: %/systemd.template.service.in - if [ ! -d $(dir $@) ] ; then mkdir -p $(dir $@) ; fi - $(fixupcmd) $^ > $@ +@enable_asan_TRUE@%/$(PACKAGE_NAME)@.service: %/systemd.template.asan.service.in +@enable_asan_TRUE@ if [ ! -d $(dir $@) ] ; then mkdir -p $(dir $@) ; fi +@enable_asan_TRUE@ $(fixupcmd) $^ > $@ +# yes, that is an @ in the filename . . . +@enable_asan_FALSE@%/$(PACKAGE_NAME)@.service: %/systemd.template.service.in +@enable_asan_FALSE@ if [ ! -d $(dir $@) ] ; then mkdir -p $(dir $@) ; fi +@enable_asan_FALSE@ $(fixupcmd) $^ > $@ %/$(PACKAGE_NAME).systemd: %/systemd.template.sysconfig if [ ! -d $(dir $@) ] ; then mkdir -p $(dir $@) ; fi @@ -10821,7 +10898,7 @@ rpmbrprep: dist-bzip2 rpmroot cp $(distdir).tar.bz2 $(RPMBUILD)/SOURCES cp $(srcdir)/rpm/389-ds-base-git.sh $(RPMBUILD)/SOURCES cp $(srcdir)/rpm/389-ds-base-devel.README $(RPMBUILD)/SOURCES - sed -e "s/__VERSION__/$(RPM_VERSION)/" -e "s/__RELEASE__/$(RPM_RELEASE)/" -e "s/__NUNC_STANS_ON__/$(NUNC_STANS_ON)/" < $(abs_builddir)/rpm/389-ds-base.spec > $(RPMBUILD)/SPECS/389-ds-base.spec + sed -e "s/__VERSION__/$(RPM_VERSION)/" -e "s/__RELEASE__/$(RPM_RELEASE)/" -e "s/__NUNC_STANS_ON__/$(NUNC_STANS_ON)/" -e "s/__ASAN_ON__/$(ASAN_ON)/" < $(abs_builddir)/rpm/389-ds-base.spec > $(RPMBUILD)/SPECS/389-ds-base.spec # Requires rpmdevtools. Consider making this a dependancy of rpms. rpmsources: rpmbrprep diff --git a/aclocal.m4 b/aclocal.m4 index 58e04a0..8d926b8 100644 --- a/aclocal.m4 +++ b/aclocal.m4 @@ -1,6 +1,6 @@ -# generated automatically by aclocal 1.13.4 -*- Autoconf -*- +# generated automatically by aclocal 1.15 -*- Autoconf -*- -# Copyright (C) 1996-2013 Free Software Foundation, Inc. +# Copyright (C) 1996-2014 Free Software Foundation, Inc. # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -20,7 +20,7 @@ You have another version of autoconf. It may work, but is not guaranteed to. If you have problems, you may need to regenerate the build system entirely. To do so, use the procedure documented by the package, typically 'autoreconf'.])]) -# Copyright (C) 2002-2013 Free Software Foundation, Inc. +# Copyright (C) 2002-2014 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -32,10 +32,10 @@ To do so, use the procedure documented by the package, typically 'autoreconf'.]) # generated from the m4 files accompanying Automake X.Y. # (This private macro should not be called outside this file.) AC_DEFUN([AM_AUTOMAKE_VERSION], -[am__api_version='1.13' +[am__api_version='1.15' dnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to dnl require some minimum version. Point them to the right macro. -m4_if([$1], [1.13.4], [], +m4_if([$1], [1.15], [], [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl ]) @@ -51,14 +51,14 @@ m4_define([_AM_AUTOCONF_VERSION], []) # Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced. # This function is AC_REQUIREd by AM_INIT_AUTOMAKE. AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION], -[AM_AUTOMAKE_VERSION([1.13.4])dnl +[AM_AUTOMAKE_VERSION([1.15])dnl m4_ifndef([AC_AUTOCONF_VERSION], [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl _AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))]) # Figure out how to run the assembler. -*- Autoconf -*- -# Copyright (C) 2001-2013 Free Software Foundation, Inc. +# Copyright (C) 2001-2014 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -78,7 +78,7 @@ _AM_IF_OPTION([no-dependencies],, [_AM_DEPENDENCIES([CCAS])])dnl # AM_AUX_DIR_EXPAND -*- Autoconf -*- -# Copyright (C) 2001-2013 Free Software Foundation, Inc. +# Copyright (C) 2001-2014 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -123,15 +123,14 @@ _AM_IF_OPTION([no-dependencies],, [_AM_DEPENDENCIES([CCAS])])dnl # configured tree to be moved without reconfiguration. AC_DEFUN([AM_AUX_DIR_EXPAND], -[dnl Rely on autoconf to set up CDPATH properly. -AC_PREREQ([2.50])dnl -# expand $ac_aux_dir to an absolute path -am_aux_dir=`cd $ac_aux_dir && pwd` +[AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT])dnl +# Expand $ac_aux_dir to an absolute path. +am_aux_dir=`cd "$ac_aux_dir" && pwd` ]) # AM_COND_IF -*- Autoconf -*- -# Copyright (C) 2008-2013 Free Software Foundation, Inc. +# Copyright (C) 2008-2014 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -168,7 +167,7 @@ fi[]dnl # AM_CONDITIONAL -*- Autoconf -*- -# Copyright (C) 1997-2013 Free Software Foundation, Inc. +# Copyright (C) 1997-2014 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -199,7 +198,7 @@ AC_CONFIG_COMMANDS_PRE( Usually this means the macro was only invoked conditionally.]]) fi])]) -# Copyright (C) 1999-2013 Free Software Foundation, Inc. +# Copyright (C) 1999-2014 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -390,7 +389,7 @@ _AM_SUBST_NOTMAKE([am__nodep])dnl # Generate code to set up dependency tracking. -*- Autoconf -*- -# Copyright (C) 1999-2013 Free Software Foundation, Inc. +# Copyright (C) 1999-2014 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -466,7 +465,7 @@ AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS], # Do all the work for Automake. -*- Autoconf -*- -# Copyright (C) 1996-2013 Free Software Foundation, Inc. +# Copyright (C) 1996-2014 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -475,6 +474,12 @@ AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS], # This macro actually does too much. Some checks are only needed if # your package does certain things. But this isn't really a big deal. +dnl Redefine AC_PROG_CC to automatically invoke _AM_PROG_CC_C_O. +m4_define([AC_PROG_CC], +m4_defn([AC_PROG_CC]) +[_AM_PROG_CC_C_O +]) + # AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE]) # AM_INIT_AUTOMAKE([OPTIONS]) # ----------------------------------------------- @@ -550,8 +555,8 @@ AC_REQUIRE([AC_PROG_MKDIR_P])dnl # # AC_SUBST([mkdir_p], ['$(MKDIR_P)']) -# We need awk for the "check" target. The system "awk" is bad on -# some platforms. +# We need awk for the "check" target (and possibly the TAP driver). The +# system "awk" is bad on some platforms. AC_REQUIRE([AC_PROG_AWK])dnl AC_REQUIRE([AC_PROG_MAKE_SET])dnl AC_REQUIRE([AM_SET_LEADING_DOT])dnl @@ -583,6 +588,51 @@ dnl macro is hooked onto _AC_COMPILER_EXEEXT early, see below. AC_CONFIG_COMMANDS_PRE(dnl [m4_provide_if([_AM_COMPILER_EXEEXT], [AM_CONDITIONAL([am__EXEEXT], [test -n "$EXEEXT"])])])dnl + +# POSIX will say in a future version that running "rm -f" with no argument +# is OK; and we want to be able to make that assumption in our Makefile +# recipes. So use an aggressive probe to check that the usage we want is +# actually supported "in the wild" to an acceptable degree. +# See automake bug#10828. +# To make any issue more visible, cause the running configure to be aborted +# by default if the 'rm' program in use doesn't match our expectations; the +# user can still override this though. +if rm -f && rm -fr && rm -rf; then : OK; else + cat >&2 <<'END' +Oops! + +Your 'rm' program seems unable to run without file operands specified +on the command line, even when the '-f' option is present. This is contrary +to the behaviour of most rm programs out there, and not conforming with +the upcoming POSIX standard: + +Please tell bug-automake@gnu.org about your system, including the value +of your $PATH and any error possibly output before this message. This +can help us improve future automake versions. + +END + if test x"$ACCEPT_INFERIOR_RM_PROGRAM" = x"yes"; then + echo 'Configuration will proceed anyway, since you have set the' >&2 + echo 'ACCEPT_INFERIOR_RM_PROGRAM variable to "yes"' >&2 + echo >&2 + else + cat >&2 <<'END' +Aborting the configuration process, to ensure you take notice of the issue. + +You can download and install GNU coreutils to get an 'rm' implementation +that behaves properly: . + +If you want to complete the configuration process using your problematic +'rm' anyway, export the environment variable ACCEPT_INFERIOR_RM_PROGRAM +to "yes", and re-run configure. + +END + AC_MSG_ERROR([Your 'rm' program is bad, sorry.]) + fi +fi +dnl The trailing newline in this macro's definition is deliberate, for +dnl backward compatibility and to allow trailing 'dnl'-style comments +dnl after the AM_INIT_AUTOMAKE invocation. See automake bug#16841. ]) dnl Hook into '_AC_COMPILER_EXEEXT' early to learn its expansion. Do not @@ -591,7 +641,6 @@ dnl mangled by Autoconf and run in a shell conditional statement. m4_define([_AC_COMPILER_EXEEXT], m4_defn([_AC_COMPILER_EXEEXT])[m4_provide([_AM_COMPILER_EXEEXT])]) - # When config.status generates a header, we must update the stamp-h file. # This file resides in the same directory as the config header # that is generated. The stamp files are numbered to have different names. @@ -613,7 +662,7 @@ for _am_header in $config_headers :; do done echo "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count]) -# Copyright (C) 2001-2013 Free Software Foundation, Inc. +# Copyright (C) 2001-2014 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -624,7 +673,7 @@ echo "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_co # Define $install_sh. AC_DEFUN([AM_PROG_INSTALL_SH], [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl -if test x"${install_sh}" != xset; then +if test x"${install_sh+set}" != xset; then case $am_aux_dir in *\ * | *\ *) install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;; @@ -634,7 +683,7 @@ if test x"${install_sh}" != xset; then fi AC_SUBST([install_sh])]) -# Copyright (C) 2003-2013 Free Software Foundation, Inc. +# Copyright (C) 2003-2014 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -656,7 +705,7 @@ AC_SUBST([am__leading_dot])]) # Add --enable-maintainer-mode option to configure. -*- Autoconf -*- # From Jim Meyering -# Copyright (C) 1996-2013 Free Software Foundation, Inc. +# Copyright (C) 1996-2014 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -691,7 +740,7 @@ AC_MSG_CHECKING([whether to enable maintainer-specific portions of Makefiles]) # Check to see how 'make' treats includes. -*- Autoconf -*- -# Copyright (C) 2001-2013 Free Software Foundation, Inc. +# Copyright (C) 2001-2014 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -739,41 +788,9 @@ AC_MSG_RESULT([$_am_result]) rm -f confinc confmf ]) -# Copyright (C) 1999-2013 Free Software Foundation, Inc. -# -# This file 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. - -# AM_PROG_CC_C_O -# -------------- -# Like AC_PROG_CC_C_O, but changed for automake. -AC_DEFUN([AM_PROG_CC_C_O], -[AC_REQUIRE([AC_PROG_CC_C_O])dnl -AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl -AC_REQUIRE_AUX_FILE([compile])dnl -# FIXME: we rely on the cache variable name because -# there is no other way. -set dummy $CC -am_cc=`echo $[2] | sed ['s/[^a-zA-Z0-9_]/_/g;s/^[0-9]/_/']` -eval am_t=\$ac_cv_prog_cc_${am_cc}_c_o -if test "$am_t" != yes; then - # Losing compiler, so override with the script. - # FIXME: It is wrong to rewrite CC. - # But if we don't then we get into trouble of one sort or another. - # A longer-term fix would be to have automake use am__CC in this case, - # and then we could set am__CC="\$(top_srcdir)/compile \$(CC)" - CC="$am_aux_dir/compile $CC" -fi -dnl Make sure AC_PROG_CC is never called again, or it will override our -dnl setting of CC. -m4_define([AC_PROG_CC], - [m4_fatal([AC_PROG_CC cannot be called after AM_PROG_CC_C_O])]) -]) - # Fake the existence of programs that GNU maintainers use. -*- Autoconf -*- -# Copyright (C) 1997-2013 Free Software Foundation, Inc. +# Copyright (C) 1997-2014 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -812,7 +829,7 @@ fi # Helper functions for option handling. -*- Autoconf -*- -# Copyright (C) 2001-2013 Free Software Foundation, Inc. +# Copyright (C) 2001-2014 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -841,7 +858,54 @@ AC_DEFUN([_AM_SET_OPTIONS], AC_DEFUN([_AM_IF_OPTION], [m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])]) -# Copyright (C) 2001-2013 Free Software Foundation, Inc. +# Copyright (C) 1999-2014 Free Software Foundation, Inc. +# +# This file 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. + +# _AM_PROG_CC_C_O +# --------------- +# Like AC_PROG_CC_C_O, but changed for automake. We rewrite AC_PROG_CC +# to automatically call this. +AC_DEFUN([_AM_PROG_CC_C_O], +[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl +AC_REQUIRE_AUX_FILE([compile])dnl +AC_LANG_PUSH([C])dnl +AC_CACHE_CHECK( + [whether $CC understands -c and -o together], + [am_cv_prog_cc_c_o], + [AC_LANG_CONFTEST([AC_LANG_PROGRAM([])]) + # Make sure it works both with $CC and with simple cc. + # Following AC_PROG_CC_C_O, we do the test twice because some + # compilers refuse to overwrite an existing .o file with -o, + # though they will create one. + am_cv_prog_cc_c_o=yes + for am_i in 1 2; do + if AM_RUN_LOG([$CC -c conftest.$ac_ext -o conftest2.$ac_objext]) \ + && test -f conftest2.$ac_objext; then + : OK + else + am_cv_prog_cc_c_o=no + break + fi + done + rm -f core conftest* + unset am_i]) +if test "$am_cv_prog_cc_c_o" != yes; then + # Losing compiler, so override with the script. + # FIXME: It is wrong to rewrite CC. + # But if we don't then we get into trouble of one sort or another. + # A longer-term fix would be to have automake use am__CC in this case, + # and then we could set am__CC="\$(top_srcdir)/compile \$(CC)" + CC="$am_aux_dir/compile $CC" +fi +AC_LANG_POP([C])]) + +# For backward compatibility. +AC_DEFUN_ONCE([AM_PROG_CC_C_O], [AC_REQUIRE([AC_PROG_CC])]) + +# Copyright (C) 2001-2014 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -860,7 +924,7 @@ AC_DEFUN([AM_RUN_LOG], # Check to make sure that the build environment is sane. -*- Autoconf -*- -# Copyright (C) 1996-2013 Free Software Foundation, Inc. +# Copyright (C) 1996-2014 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -941,7 +1005,7 @@ AC_CONFIG_COMMANDS_PRE( rm -f conftest.file ]) -# Copyright (C) 2009-2013 Free Software Foundation, Inc. +# Copyright (C) 2009-2014 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -1001,7 +1065,7 @@ AC_SUBST([AM_BACKSLASH])dnl _AM_SUBST_NOTMAKE([AM_BACKSLASH])dnl ]) -# Copyright (C) 2001-2013 Free Software Foundation, Inc. +# Copyright (C) 2001-2014 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -1029,7 +1093,7 @@ fi INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s" AC_SUBST([INSTALL_STRIP_PROGRAM])]) -# Copyright (C) 2006-2013 Free Software Foundation, Inc. +# Copyright (C) 2006-2014 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -1048,7 +1112,7 @@ AC_DEFUN([AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE($@)]) # Check how to create a tarball. -*- Autoconf -*- -# Copyright (C) 2004-2013 Free Software Foundation, Inc. +# Copyright (C) 2004-2014 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, diff --git a/config.h.in b/config.h.in index ea9369b..1b549f7 100644 --- a/config.h.in +++ b/config.h.in @@ -357,9 +357,6 @@ /* no getdomainname */ #undef NO_DOMAINNAME -/* Define to 1 if your C compiler doesn't accept -c and -o together. */ -#undef NO_MINUS_C_MINUS_O - /* OS version */ #undef OSVERSION diff --git a/configure b/configure index 7dc8c3e..3f26631 100755 --- a/configure +++ b/configure @@ -715,6 +715,7 @@ HPUX_FALSE HPUX_TRUE initconfigdir sttyexec +pythonexec perlexec initdir LIBCRUN @@ -771,6 +772,8 @@ BUNDLE_TRUE gccsec_defs RPM_HARDEND_CC_FALSE RPM_HARDEND_CC_TRUE +enable_asan_FALSE +enable_asan_TRUE asan_defs debug_defs LIBOBJS @@ -935,7 +938,7 @@ with_fhs with_fhs_opt with_tmpfiles_d with_perldir -with_pythondir +with_pythonexec with_instconfigdir with_initddir with_nspr @@ -1667,7 +1670,7 @@ Optional Packages: --with-perldir=PATH Directory for perl) - --with-pythondir=PATH Directory for python) + --with-pythonexec=PATH Path to executable for python) --with-instconfigdir=/path Base directory for instance specific writable @@ -2802,7 +2805,7 @@ cat >>confdefs.h <<_ACEOF #define DS_PACKAGE_STRING "$PACKAGE_STRING" _ACEOF -am__api_version='1.13' +am__api_version='1.15' ac_aux_dir= for ac_dir in "$srcdir" "$srcdir/.." "$srcdir/../.."; do @@ -3003,8 +3006,8 @@ test "$program_suffix" != NONE && ac_script='s/[\\$]/&&/g;s/;s,x,x,$//' program_transform_name=`$as_echo "$program_transform_name" | sed "$ac_script"` -# expand $ac_aux_dir to an absolute path -am_aux_dir=`cd $ac_aux_dir && pwd` +# Expand $ac_aux_dir to an absolute path. +am_aux_dir=`cd "$ac_aux_dir" && pwd` if test x"${MISSING+set}" != xset; then case $am_aux_dir in @@ -3023,7 +3026,7 @@ else $as_echo "$as_me: WARNING: 'missing' script is too old or missing" >&2;} fi -if test x"${install_sh}" != xset; then +if test x"${install_sh+set}" != xset; then case $am_aux_dir in *\ * | *\ *) install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;; @@ -3342,8 +3345,8 @@ MAKEINFO=${MAKEINFO-"${am_missing_run}makeinfo"} # mkdir_p='$(MKDIR_P)' -# We need awk for the "check" target. The system "awk" is bad on -# some platforms. +# We need awk for the "check" target (and possibly the TAP driver). The +# system "awk" is bad on some platforms. # Always define AMTAR for backward compatibility. Yes, it's still used # in the wild :-( We should find a proper way to deprecate it ... AMTAR='$${TAR-tar}' @@ -3444,6 +3447,48 @@ $as_echo "$am_cv_prog_tar_pax" >&6; } +# POSIX will say in a future version that running "rm -f" with no argument +# is OK; and we want to be able to make that assumption in our Makefile +# recipes. So use an aggressive probe to check that the usage we want is +# actually supported "in the wild" to an acceptable degree. +# See automake bug#10828. +# To make any issue more visible, cause the running configure to be aborted +# by default if the 'rm' program in use doesn't match our expectations; the +# user can still override this though. +if rm -f && rm -fr && rm -rf; then : OK; else + cat >&2 <<'END' +Oops! + +Your 'rm' program seems unable to run without file operands specified +on the command line, even when the '-f' option is present. This is contrary +to the behaviour of most rm programs out there, and not conforming with +the upcoming POSIX standard: + +Please tell bug-automake@gnu.org about your system, including the value +of your $PATH and any error possibly output before this message. This +can help us improve future automake versions. + +END + if test x"$ACCEPT_INFERIOR_RM_PROGRAM" = x"yes"; then + echo 'Configuration will proceed anyway, since you have set the' >&2 + echo 'ACCEPT_INFERIOR_RM_PROGRAM variable to "yes"' >&2 + echo >&2 + else + cat >&2 <<'END' +Aborting the configuration process, to ensure you take notice of the issue. + +You can download and install GNU coreutils to get an 'rm' implementation +that behaves properly: . + +If you want to complete the configuration process using your problematic +'rm' anyway, export the environment variable ACCEPT_INFERIOR_RM_PROGRAM +to "yes", and re-run configure. + +END + as_fn_error $? "Your 'rm' program is bad, sorry." "$LINENO" 5 + fi +fi + # define these for automake distdir VERSION=$PACKAGE_VERSION PACKAGE=$PACKAGE_TARNAME @@ -4793,6 +4838,65 @@ ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC understands -c and -o together" >&5 +$as_echo_n "checking whether $CC understands -c and -o together... " >&6; } +if ${am_cv_prog_cc_c_o+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF + # Make sure it works both with $CC and with simple cc. + # Following AC_PROG_CC_C_O, we do the test twice because some + # compilers refuse to overwrite an existing .o file with -o, + # though they will create one. + am_cv_prog_cc_c_o=yes + for am_i in 1 2; do + if { echo "$as_me:$LINENO: $CC -c conftest.$ac_ext -o conftest2.$ac_objext" >&5 + ($CC -c conftest.$ac_ext -o conftest2.$ac_objext) >&5 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } \ + && test -f conftest2.$ac_objext; then + : OK + else + am_cv_prog_cc_c_o=no + break + fi + done + rm -f core conftest* + unset am_i +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_prog_cc_c_o" >&5 +$as_echo "$am_cv_prog_cc_c_o" >&6; } +if test "$am_cv_prog_cc_c_o" != yes; then + # Losing compiler, so override with the script. + # FIXME: It is wrong to rewrite CC. + # But if we don't then we get into trouble of one sort or another. + # A longer-term fix would be to have automake use am__CC in this case, + # and then we could set am__CC="\$(top_srcdir)/compile \$(CC)" + CC="$am_aux_dir/compile $CC" +fi +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + + depcc="$CC" am_compiler_list= { $as_echo "$as_me:${as_lineno-$LINENO}: checking dependency style of $depcc" >&5 @@ -4921,131 +5025,6 @@ else fi -if test "x$CC" != xcc; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC and cc understand -c and -o together" >&5 -$as_echo_n "checking whether $CC and cc understand -c and -o together... " >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether cc understands -c and -o together" >&5 -$as_echo_n "checking whether cc understands -c and -o together... " >&6; } -fi -set dummy $CC; ac_cc=`$as_echo "$2" | - sed 's/[^a-zA-Z0-9_]/_/g;s/^[0-9]/_/'` -if eval \${ac_cv_prog_cc_${ac_cc}_c_o+:} false; then : - $as_echo_n "(cached) " >&6 -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -int -main () -{ - - ; - return 0; -} -_ACEOF -# Make sure it works both with $CC and with simple cc. -# We do the test twice because some compilers refuse to overwrite an -# existing .o file with -o, though they will create one. -ac_try='$CC -c conftest.$ac_ext -o conftest2.$ac_objext >&5' -rm -f conftest2.* -if { { case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; } && - test -f conftest2.$ac_objext && { { case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; }; -then - eval ac_cv_prog_cc_${ac_cc}_c_o=yes - if test "x$CC" != xcc; then - # Test first that cc exists at all. - if { ac_try='cc -c conftest.$ac_ext >&5' - { { case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; }; }; then - ac_try='cc -c conftest.$ac_ext -o conftest2.$ac_objext >&5' - rm -f conftest2.* - if { { case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; } && - test -f conftest2.$ac_objext && { { case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; }; - then - # cc works too. - : - else - # cc exists but doesn't like -o. - eval ac_cv_prog_cc_${ac_cc}_c_o=no - fi - fi - fi -else - eval ac_cv_prog_cc_${ac_cc}_c_o=no -fi -rm -f core conftest* - -fi -if eval test \$ac_cv_prog_cc_${ac_cc}_c_o = yes; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - -$as_echo "#define NO_MINUS_C_MINUS_O 1" >>confdefs.h - -fi - -# FIXME: we rely on the cache variable name because -# there is no other way. -set dummy $CC -am_cc=`echo $2 | sed 's/[^a-zA-Z0-9_]/_/g;s/^[0-9]/_/'` -eval am_t=\$ac_cv_prog_cc_${am_cc}_c_o -if test "$am_t" != yes; then - # Losing compiler, so override with the script. - # FIXME: It is wrong to rewrite CC. - # But if we don't then we get into trouble of one sort or another. - # A longer-term fix would be to have automake use am__CC in this case, - # and then we could set am__CC="\$(top_srcdir)/compile \$(CC)" - CC="$am_aux_dir/compile $CC" -fi - # By default we simply use the C compiler to build assembly code. @@ -17694,7 +17673,7 @@ if test "${enable_debug+set}" = set; then : enableval=$enable_debug; { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } - debug_defs="-g3 -DDEBUG -DMCC_DEBUG" + debug_defs="-g3 -DDEBUG -DMCC_DEBUG -O0" else @@ -17724,6 +17703,14 @@ $as_echo "no" >&6; } fi + if test "$enable_asan" = "yes"; then + enable_asan_TRUE= + enable_asan_FALSE='#' +else + enable_asan_TRUE='#' + enable_asan_FALSE= +fi + if test -f /usr/lib/rpm/redhat/redhat-hardened-cc1; then RPM_HARDEND_CC_TRUE= @@ -18275,25 +18262,25 @@ else with_perldir= fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for --with-pythondir" >&5 -$as_echo_n "checking for --with-pythondir... " >&6; } +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for --with-pythonexec" >&5 +$as_echo_n "checking for --with-pythonexec... " >&6; } -# Check whether --with-pythondir was given. -if test "${with_pythondir+set}" = set; then : - withval=$with_pythondir; +# Check whether --with-pythonexec was given. +if test "${with_pythonexec+set}" = set; then : + withval=$with_pythonexec; fi -if test -n "$with_pythondir"; then - if test "$with_pythondir" = yes ; then - as_fn_error $? "You must specify --with-pythondir=/full/path/to/python" "$LINENO" 5 - elif test "$with_pythondir" = no ; then - with_pythondir= +if test -n "$with_pythonexec"; then + if test "$with_pythonexec" = yes ; then + as_fn_error $? "You must specify --with-pythonexec=/full/path/to/python" "$LINENO" 5 + elif test "$with_pythonexec" = no ; then + with_pythonexec=/usr/bin/python2 else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $with_pythondir" >&5 -$as_echo "$with_pythondir" >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $with_pythonexec" >&5 +$as_echo "$with_pythonexec" >&6; } fi else - with_pythondir= + with_pythonexec=/usr/bin/python2 fi @@ -18391,6 +18378,14 @@ if test -n "$with_perldir"; then else perlexec='/usr/bin/env perl' fi + +# This will let us change over the python version easier in the future. +if test -n "$with_pythonexec"; then + pythonexec="$with_pythonexec" +else + pythonexec='/usr/bin/env python2' +fi + # we use stty in perl scripts to disable password echo # this doesn't work unless the full absolute path of the # stty command is used e.g. system("stty -echo") does not @@ -18663,6 +18658,7 @@ fi + # set default initconfigdir if not already set # value will be set so as to be relative to $(sysconfdir) if test -z "$initconfigdir" ; then @@ -21259,24 +21255,18 @@ fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Systemd with pkg-config" >&5 $as_echo_n "checking for Systemd with pkg-config... " >&6; } - if test "$with_journald" = yes; then - if test -n "$PKG_CONFIG" && $PKG_CONFIG --exists systemd libsystemd-journal libsystemd-daemon ; then - systemd_inc=`$PKG_CONFIG --cflags-only-I systemd libsystemd-journal libsystemd-daemon` - systemd_lib=`$PKG_CONFIG --libs-only-l systemd libsystemd-journal libsystemd-daemon` - systemd_defs="-DWITH_SYSTEMD -DHAVE_JOURNALD" - else - as_fn_error $? "no Systemd / Journald pkg-config files" "$LINENO" 5 - fi + if test -n "$PKG_CONFIG" && $PKG_CONFIG --exists libsystemd ; then + systemd_inc=`$PKG_CONFIG --cflags-only-I libsystemd` + systemd_lib=`$PKG_CONFIG --libs-only-l libsystemd` else + as_fn_error $? "no Systemd pkg-config files" "$LINENO" 5 + fi - if test -n "$PKG_CONFIG" && $PKG_CONFIG --exists systemd libsystemd-daemon ; then - systemd_inc=`$PKG_CONFIG --cflags-only-I systemd libsystemd-daemon` - systemd_lib=`$PKG_CONFIG --libs-only-l systemd libsystemd-daemon` - systemd_defs="-DWITH_SYSTEMD" - else - as_fn_error $? "no Systemd pkg-config files" "$LINENO" 5 - fi + if test "$with_journald" = yes; then + systemd_defs="-DWITH_SYSTEMD -DHAVE_JOURNALD" + else + systemd_defs="-DWITH_SYSTEMD" fi # Check for the pkg config provided unit paths @@ -21333,11 +21323,10 @@ $as_echo "$with_systemdsystemconfdir" >&6; } fi - if test -n "$with_systemdsystemunitdir" -o -n "$with_systemdsystemconfdir" ; then - if test -z "$with_systemdgroupname" ; then - with_systemdgroupname=$PACKAGE_NAME.target - fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for --with-systemdgroupname" >&5 + if test -z "$with_systemdgroupname" ; then + with_systemdgroupname=$PACKAGE_NAME.target + fi + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for --with-systemdgroupname" >&5 $as_echo_n "checking for --with-systemdgroupname... " >&6; } # Check whether --with-systemdgroupname was given. @@ -21345,18 +21334,17 @@ if test "${with_systemdgroupname+set}" = set; then : withval=$with_systemdgroupname; fi - if test "$with_systemdgroupname" = yes ; then - as_fn_error $? "You must specify --with-systemdgroupname=name.of.group" "$LINENO" 5 - elif test "$with_systemdgroupname" = no ; then - as_fn_error $? "You must specify --with-systemdgroupname=name.of.group" "$LINENO" 5 - else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $with_systemdgroupname" >&5 + if test "$with_systemdgroupname" = yes ; then + as_fn_error $? "You must specify --with-systemdgroupname=name.of.group" "$LINENO" 5 + elif test "$with_systemdgroupname" = no ; then + as_fn_error $? "You must specify --with-systemdgroupname=name.of.group" "$LINENO" 5 + else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $with_systemdgroupname" >&5 $as_echo "$with_systemdgroupname" >&6; } - fi - fi + fi # End of with_systemd @@ -21653,6 +21641,10 @@ if test -z "${am__fastdepCCAS_TRUE}" && test -z "${am__fastdepCCAS_FALSE}"; then as_fn_error $? "conditional \"am__fastdepCCAS\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi +if test -z "${enable_asan_TRUE}" && test -z "${enable_asan_FALSE}"; then + as_fn_error $? "conditional \"enable_asan\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi if test -z "${RPM_HARDEND_CC_TRUE}" && test -z "${RPM_HARDEND_CC_FALSE}"; then as_fn_error $? "conditional \"RPM_HARDEND_CC\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 diff --git a/dirsrvtests/tests/tickets/ticket48272_test.py b/dirsrvtests/tests/tickets/ticket48272_test.py new file mode 100644 index 0000000..11b037b --- /dev/null +++ b/dirsrvtests/tests/tickets/ticket48272_test.py @@ -0,0 +1,171 @@ +import os +import sys +import time +import ldap +import logging +import pytest +from lib389 import DirSrv, Entry, tools, tasks +from lib389.tools import DirSrvTools +from lib389._constants import * +from lib389.properties import * +from lib389.tasks import * +from lib389.utils import * + +DEBUGGING = False + +if DEBUGGING: + logging.getLogger(__name__).setLevel(logging.DEBUG) +else: + logging.getLogger(__name__).setLevel(logging.INFO) + + +log = logging.getLogger(__name__) + +USER1 = 'user1' +PW = 'password' +USER1_DN = 'uid=user1,ou=People,%s' % DEFAULT_SUFFIX +USER1_CONFLICT_DN = 'uid=user1,%s' % DEFAULT_SUFFIX + + +class TopologyStandalone(object): + """The DS Topology Class""" + def __init__(self, standalone): + """Init""" + standalone.open() + self.standalone = standalone + + +@pytest.fixture(scope="module") +def topology(request): + """Create DS Deployment""" + + # Creating standalone instance ... + if DEBUGGING: + standalone = DirSrv(verbose=True) + else: + standalone = DirSrv(verbose=False) + args_instance[SER_HOST] = HOST_STANDALONE + args_instance[SER_PORT] = PORT_STANDALONE + args_instance[SER_SERVERID_PROP] = SERVERID_STANDALONE + args_instance[SER_CREATION_SUFFIX] = DEFAULT_SUFFIX + args_standalone = args_instance.copy() + standalone.allocate(args_standalone) + instance_standalone = standalone.exists() + if instance_standalone: + standalone.delete() + standalone.create() + standalone.open() + + def fin(): + """If we are debugging just stop the instances, otherwise remove + them + """ + if DEBUGGING: + standalone.stop(60) + else: + standalone.delete() + + request.addfinalizer(fin) + + # Clear out the tmp dir + standalone.clearTmpDir(__file__) + + return TopologyStandalone(standalone) + +def _create_user(inst, name, dn): + inst.add_s(Entry(( + dn, { + 'objectClass': 'top account simplesecurityobject'.split(), + 'uid': name, + 'userpassword': PW + }))) + +def _bind(name, cred): + # Returns true or false if it worked. + if DEBUGGING: + print('test 48272 BINDING AS %s:%s' % (name, cred)) + status = True + conn = ldap.initialize("ldap://%s:%s" % (HOST_STANDALONE, PORT_STANDALONE)) + try: + conn.simple_bind_s(name, cred) + conn.unbind_s() + except ldap.NO_SUCH_OBJECT: + status = False + return status + + +def test_ticket48272(topology): + """ + Test the functionality of the ADDN bind plugin. This should allow users + of the type "name" or "name@domain.com" to bind. + """ + + # Enable the plugin + + # There will be a better way to do this in the future. + topology.standalone.add_s(Entry(( + "cn=ADDN,cn=plugins,cn=config", { + "objectClass" : "top nsSlapdPlugin extensibleObject".split(), + "cn" : "ADDN", + "nsslapd-pluginPath": "libaddn-plugin", + "nsslapd-pluginInitfunc": "addn_init", + "nsslapd-pluginType": "preoperation", + "nsslapd-pluginEnabled": "on", + "nsslapd-pluginId": "addn", + "nsslapd-pluginVendor": "389 Project", + "nsslapd-pluginVersion": "1.3.4.0", + "nsslapd-pluginDescription": "Allow AD DN style bind names to LDAP", + "addn_default_suffix": "ou=People,%s" % DEFAULT_SUFFIX, + "addn_filter": "(&(objectClass=account)(uid=%s))", + } + ))) + + topology.standalone.restart(60) + + # Add a user + _create_user(topology.standalone, USER1, USER1_DN) + # Add a conflicting user to an alternate subtree + _create_user(topology.standalone, USER1, USER1_CONFLICT_DN) + + # Test an anonymous bind + + # Make sure our binds still work. + assert(_bind(USER1_DN, PW)) + assert(_bind(USER1_CONFLICT_DN, PW)) + + # Test bind as name + assert(_bind(USER1, PW)) + + # test bind as name@domain + # Make sure that name@fakedom fails + + # Change the plugin to search from the rootdn instead + + topology.standalone.modify_s("cn=ADDN,cn=plugins,cn=config", [(ldap.MOD_REPLACE, 'addn_default_suffix', DEFAULT_SUFFIX)]) + topology.standalone.restart(60) + + # Make sure our binds still work. + assert(_bind(USER1_DN, PW)) + assert(_bind(USER1_CONFLICT_DN, PW)) + + # Test bind as name fails + try: + _bind(USER1, PW) + assert(False) + except: + pass + # Test bind as name@domain fails + + if DEBUGGING: + # Add debugging steps(if any)... + pass + + log.info('Test PASSED') + + +if __name__ == '__main__': + # Run isolated + # -s for DEBUG mode + CURRENT_FILE = os.path.realpath(__file__) + pytest.main("-s %s" % CURRENT_FILE) + diff --git a/ldap/servers/plugins/addn/addn.c b/ldap/servers/plugins/addn/addn.c new file mode 100644 index 0000000..c1e1e22 --- /dev/null +++ b/ldap/servers/plugins/addn/addn.c @@ -0,0 +1,367 @@ +/** BEGIN COPYRIGHT BLOCK + * Copyright (C) 2016 Red Hat, Inc. + * All rights reserved. + * + * License: GPL (version 3 or any later version). + * See LICENSE for details. + * END COPYRIGHT BLOCK **/ + +#ifdef HAVE_CONFIG_H +# include +#endif + +/* + * AD DN bind plugin + * + * This plugin allows violation of the LDAP v3 standard for binds to occur + * as "uid" or "uid@example.com". This plugin re-maps those terms to a real + * dn such as uid=user,ou=People,dc=example,dc=com. + */ + +#include "addn.h" + +/* is there a better type we can use here? */ +#define ADDN_FAILURE 1 + +static void* plugin_identity = NULL; + +static Slapi_PluginDesc addn_description = { + "addn", + VENDOR, + DS_PACKAGE_VERSION, + "Allow AD DN style bind names to LDAP" +}; + +int +addn_prebind(Slapi_PBlock *pb) +{ + // Slapi_Entry *plugin_entry = NULL; + struct addn_config *config = NULL; + Slapi_DN *pb_sdn_target = NULL; + Slapi_DN *pb_sdn_mapped = NULL; + const char *dn = NULL; + + const char *dn_bind = NULL; + int dn_bind_len = 0; + char *dn_bind_escaped = NULL; + + const char *dn_domain = NULL; + int dn_domain_len = 0; + char *dn_domain_escaped = NULL; + + char *be_suffix = NULL; + Slapi_DN *be_suffix_dn = NULL; + char *config_filter = NULL; + char *filter = NULL; + int result = 0; + + Slapi_PBlock *search_pblock = NULL; + int search_result = 0; + Slapi_Entry **entries = NULL; + int entry_count = 0; + + slapi_log_error(SLAPI_LOG_PLUGIN, "addn_prebind", "--> begin\n"); + /* This is taking .2 of a second on my laptop .... */ + slapi_pblock_get(pb, SLAPI_BIND_TARGET_SDN, &pb_sdn_target); + dn = slapi_sdn_get_dn(pb_sdn_target); + if (dn == NULL) { + result = ADDN_FAILURE; + goto out; + } + slapi_log_error(SLAPI_LOG_PLUGIN, "addn_prebind", "Recieved %s\n", dn); + + result = slapi_dn_syntax_check(NULL, dn, 0); + slapi_log_error(SLAPI_LOG_PLUGIN, "addn_prebind", "Dn validation %d\n", result); + + if (result == LDAP_SUCCESS) { + slapi_log_error(SLAPI_LOG_PLUGIN, "addn_prebind", "Dn syntax is correct, do not alter\n"); + /* This is a syntax correct bind dn. Leave it alone! */ + goto out; + } + slapi_log_error(SLAPI_LOG_PLUGIN, "addn_prebind", "Dn syntax is incorrect, it may need ADDN mangaling\n"); + + + // get the plugin private config here!!!!! + + result = slapi_pblock_get(pb, SLAPI_PLUGIN_PRIVATE, &config); + if (result != LDAP_SUCCESS || config == NULL) { + slapi_log_error(SLAPI_LOG_FATAL, "addn_prebind", "CRITICAL: Unable to retrieve plugin configuration!\n"); + result = ADDN_FAILURE; + goto out; + } + + /* Right, the dn is invalid! This means it *could* be addn syntax */ + /* Do we have any other validation to run here? */ + /* Split the @domain component (if any) */ + + // For now, just copy; + dn_bind = dn; + dn_bind_len = strlen(dn); + + /* Filter escape the name, and the domain parts */ + if (dn_bind != NULL) { + dn_bind_escaped = slapi_escape_filter_value(dn_bind, dn_bind_len); + } + + if (dn_domain != NULL) { + dn_domain_escaped = slapi_escape_filter_value(dn_domain, dn_domain_len); + } + + /* How do we manage domain -> backend properly? */ + + /* If we don't have the @domain. get a default from config */ + + if (dn_domain_escaped == NULL) { + // This could alternately be domain, then we do the same domain -> suffix conversion .... + be_suffix = config->default_suffix; + } else { + // Parse the domain out to a potential suffix name. + } + + + /* Select the correct backend. If no backend, bail. */ + slapi_log_error(SLAPI_LOG_PLUGIN, "addn_prebind", "Selected suffix %s\n", be_suffix); + + if (be_suffix == NULL) { + slapi_log_error(SLAPI_LOG_FATAL, "addn_prebind", "CRITICAL: No default backend in configuration, you must set addn_default_suffix\n"); + result = ADDN_FAILURE; + goto out; + } + + be_suffix_dn = slapi_sdn_new_dn_byval(be_suffix); + + /* Get our filter. From the config */ + config_filter = config->filter_template; + + /* Put the search term into the filter. */ + //!! How does this return errors, like not enough values? Too many? + //!! This needs a careful check and review!!! + filter = slapi_ch_smprintf(config_filter, dn_bind_escaped); + slapi_log_error(SLAPI_LOG_PLUGIN, "addn_prebind", "Searching with filter %s\n", filter); + + /* Search the backend, and apply our filter given the username */ + search_pblock = slapi_pblock_new(); + + if (search_pblock == NULL) { + slapi_log_error(SLAPI_LOG_FATAL, "addn_prebind", "CRITICAL: Unable to allocate search_pblock!!!\n"); + result = ADDN_FAILURE; + goto out; + } + + // How can I do this search to retrieve NO attributes, only the DN? + + slapi_search_internal_set_pb_ext(search_pblock, be_suffix_dn, LDAP_SCOPE_SUBTREE, + filter, NULL, 0 /* attrs only */, + NULL /* controls */, NULL /* uniqueid */, + plugin_identity, 0 /* actions */); + slapi_search_internal_pb(search_pblock); + + result = slapi_pblock_get(search_pblock, SLAPI_PLUGIN_INTOP_RESULT, &search_result); + if (result != LDAP_SUCCESS) { + slapi_log_error(SLAPI_LOG_FATAL, "addn_prebind", "CRITICAL: Internal search pblock get failed!!!\n"); + result = ADDN_FAILURE; + goto out; + } + + /* No results are an error: Allow the plugin to continue, because */ + /* the bind will fail anyway ....? */ + + /* Do we want to return a fail here? Or pass, and allow the auth code + * to fail us. That will prevent some attacks I feel as this could be a + * disclosure attack .... + */ + if (search_result == LDAP_NO_SUCH_OBJECT) { + slapi_log_error(SLAPI_LOG_PLUGIN, "addn_prebind", "LDAP_NO_SUCH_OBJECT \n"); + result = LDAP_SUCCESS; + goto out; + } + + /* On all other errors, just fail out. */ + if (search_result != LDAP_SUCCESS) { + slapi_log_error(SLAPI_LOG_PLUGIN, "addn_prebind", "CRITICAL: Internal search error occured %d \n", search_result); + result = ADDN_FAILURE; + goto out; + } + + + result = slapi_pblock_get(search_pblock, SLAPI_NENTRIES, &entry_count); + + if (result != LDAP_SUCCESS) { + slapi_log_error(SLAPI_LOG_FATAL, "addn_prebind", "CRITICAL: Unable to retrieve number of entries from pblock!\n"); + result = ADDN_FAILURE; + goto out; + } + /* If there are multiple results, we should also fail as we cannot */ + /* be sure of the real object we want to bind to */ + + if (entry_count > 1) { + /* Is there a better log level for this? */ + slapi_log_error(SLAPI_LOG_FATAL, "addn_prebind", "WARNING, multiple results returned. Failing to auth ...\n"); + result = ADDN_FAILURE; + goto out; + } + + result = slapi_pblock_get(search_pblock, SLAPI_PLUGIN_INTOP_SEARCH_ENTRIES, &entries); + if (result != LDAP_SUCCESS) { + slapi_log_error(SLAPI_LOG_FATAL, "addn_prebind", "CRITICAL: Unable to retrieve entries from pblock!\n"); + result = ADDN_FAILURE; + goto out; + } + + /* We should only have one entry here! */ + + // Is there a result we should check here? + pb_sdn_mapped = slapi_sdn_dup(slapi_entry_get_sdn(*entries)); + + slapi_log_error(SLAPI_LOG_PLUGIN, "addn_prebind", "SEARCH entry dn=%s is mapped from addn=%s\n", slapi_sdn_get_dn(pb_sdn_mapped), dn); + + + /* If there is a result, take the DN and make the SDN for PB */ + + // Do we need to free the original SDN? + /* Free the original SDN */ + result = slapi_pblock_set(pb, SLAPI_TARGET_SDN, pb_sdn_mapped); + if (result != LDAP_SUCCESS) { + slapi_log_error(SLAPI_LOG_FATAL, "addn_prebind", "CRITICAL: Unable to set new mapped DN to pblock!\n"); + /* We have to free the mapped SDN here */ + slapi_sdn_free(pb_sdn_mapped); + result = ADDN_FAILURE; + goto out; + } + + slapi_sdn_free(&pb_sdn_target); + + slapi_log_error(SLAPI_LOG_PLUGIN, "addn_prebind", "<-- complete\n"); + + // For now, we force set the result to fail the op; + result = LDAP_SUCCESS; + +out: + if (search_pblock != NULL) { + slapi_free_search_results_internal(search_pblock); + slapi_pblock_destroy(search_pblock); + } + slapi_sdn_free(&be_suffix_dn); + slapi_ch_free_string(&be_suffix); + slapi_ch_free_string(&dn_bind_escaped); + slapi_ch_free_string(&dn_domain_escaped); + slapi_ch_free_string(&config_filter); + slapi_ch_free_string(&filter); + + + + return result; +} + + +/* + * addn_start + * + * This is called when the plugin is started. It allows a configuration change + * To be made while the directory server is live. + */ +int +addn_start(Slapi_PBlock *pb) +{ + Slapi_Entry *plugin_entry = NULL; + struct addn_config *config = NULL; + int result = LDAP_SUCCESS; + + slapi_log_error(SLAPI_LOG_PLUGIN, "addn_start", "starting ...\n"); + + /* I have no idea how this works .... should be SLAPI_PLUGIN_CONFIG */ + result = slapi_pblock_get(pb, SLAPI_ADD_ENTRY, &plugin_entry); + if (result != LDAP_SUCCESS || plugin_entry == NULL) { + slapi_log_error(SLAPI_LOG_FATAL, "addn_start", "CRITICAL: Failed to retrieve config entry!\n"); + return SLAPI_PLUGIN_FAILURE; + } + + /* Now set the values into the config */ + /* Are there some error cases here we should be checking? */ + config = (struct addn_config *)slapi_ch_malloc(sizeof(struct addn_config)); + config->default_suffix = slapi_ch_strdup(slapi_entry_attr_get_charptr(plugin_entry, "addn_default_suffix")); + config->filter_template = slapi_ch_strdup(slapi_entry_attr_get_charptr(plugin_entry, "addn_filter")); + + /* Set into the pblock */ + slapi_pblock_set(pb, SLAPI_PLUGIN_PRIVATE, (void *) config); + + slapi_log_error(SLAPI_LOG_PLUGIN, "addn_start", "startup complete\n"); + + return LDAP_SUCCESS; +} + +/* + * addn_close + * + * Called when the plugin is stopped. Frees the configs as needed + */ +int +addn_close(Slapi_PBlock *pb) +{ + struct addn_config *config = NULL; + + slapi_log_error(SLAPI_LOG_PLUGIN, "addn_close", "stopping ...\n"); + + slapi_pblock_get(pb, SLAPI_PLUGIN_PRIVATE, &config); + if (config != NULL) { + slapi_ch_free_string(&config->default_suffix); + slapi_ch_free_string(&config->filter_template); + slapi_ch_free((void **) &config); + slapi_pblock_set(pb, SLAPI_PLUGIN_PRIVATE, NULL); + } + + slapi_log_error(SLAPI_LOG_PLUGIN, "addn_close", "stop complete\n"); + + return LDAP_SUCCESS; +} + + +/* + * addn_init + * + * Initialise and register the addn plugin to the directory server. + */ +int +addn_init(Slapi_PBlock *pb) +{ + int result = 0; + + result = slapi_pblock_set(pb, SLAPI_PLUGIN_VERSION, SLAPI_PLUGIN_VERSION_03); + if (result != LDAP_SUCCESS) { + goto out; + } + + /* Get and stash our plugin identity */ + slapi_pblock_get (pb, SLAPI_PLUGIN_IDENTITY, &plugin_identity); + + result = slapi_pblock_set(pb, SLAPI_PLUGIN_DESCRIPTION, (void*)&addn_description); + if (result != LDAP_SUCCESS) { + goto out; + } + + result = slapi_pblock_set(pb, SLAPI_PLUGIN_START_FN, (void*)addn_start); + if (result != LDAP_SUCCESS) { + goto out; + } + + result = slapi_pblock_set(pb, SLAPI_PLUGIN_CLOSE_FN, (void*)addn_close); + if (result != LDAP_SUCCESS) { + goto out; + } + + result = slapi_pblock_set(pb, SLAPI_PLUGIN_PRE_BIND_FN, (void*)addn_prebind); + if (result != LDAP_SUCCESS) { + goto out; + } + +out: + if (result == LDAP_SUCCESS) { + slapi_log_error(SLAPI_LOG_PLUGIN, "addn_init", "Success: plugin loaded.\n"); + slapi_log_error(SLAPI_LOG_FATAL, "addn_init", "Warning: The use of this plugin violates the LDAPv3 specification RFC4511 section 4.2 BindDN specification. You have been warned ...\n"); + } else { + slapi_log_error(SLAPI_LOG_PLUGIN, "addn_init", "Error: %d. \n", result); + } + return result; +} + + diff --git a/ldap/servers/plugins/addn/addn.h b/ldap/servers/plugins/addn/addn.h new file mode 100644 index 0000000..6cac97c --- /dev/null +++ b/ldap/servers/plugins/addn/addn.h @@ -0,0 +1,22 @@ +/** BEGIN COPYRIGHT BLOCK + * Copyright (C) 2016 Red Hat, Inc. + * All rights reserved. + * + * License: GPL (version 3 or any later version). + * See LICENSE for details. + * END COPYRIGHT BLOCK **/ + +#ifdef HAVE_CONFIG_H +# include +#endif + +/* + * AD DN bind plugin header + */ + +#include "slapi-plugin.h" + +struct addn_config { + char *default_suffix; + char *filter_template; +}; diff --git a/ldap/servers/slapd/bind.c b/ldap/servers/slapd/bind.c index 1ffec4e..efdbca5 100644 --- a/ldap/servers/slapd/bind.c +++ b/ldap/servers/slapd/bind.c @@ -859,6 +859,11 @@ account_locked: } else { /* even though preop failed, we should still call the post-op plugins */ plugin_call_plugins( pb, SLAPI_PLUGIN_POST_BIND_FN ); + /* If the prebind plugins fail we MUST send a result! */ + /* Is there a way to get a better result descriptions from say the ADDN plugin? */ + slapi_create_errormsg(errorbuf, sizeof(errorbuf), "Pre-bind plug-in failed\n"); + send_ldap_result(pb, LDAP_OPERATIONS_ERROR, NULL, errorbuf, 0, NULL); + goto free_and_return; } } else { send_ldap_result( pb, LDAP_UNWILLING_TO_PERFORM, NULL, -- 1.8.3.1