diff options
author | Rich Megginson <rmeggins@redhat.com> | 2007-05-16 19:45:26 +0000 |
---|---|---|
committer | Rich Megginson <rmeggins@redhat.com> | 2007-05-16 19:45:26 +0000 |
commit | 1f0a9f9000e16b2bd66dc67b1848c4ef4af97c3a (patch) | |
tree | 5fe2e5b532bc0d792c4a95baa3779ac49c0c390b | |
parent | 6949bf2301e9f2fc5c64f6f9f60f7c24c0f7f68e (diff) | |
download | ds-1f0a9f9000e16b2bd66dc67b1848c4ef4af97c3a.tar.gz ds-1f0a9f9000e16b2bd66dc67b1848c4ef4af97c3a.tar.xz ds-1f0a9f9000e16b2bd66dc67b1848c4ef4af97c3a.zip |
Resolves: bug 239764
Description: bitwise matching plugin
Fix Description: Samba requires backend LDAP servers to support bitwise operations. This is to support search filters like this:
(|(|(&(!(groupType:1.2.840.113556.1.4.803:=1))(groupType:1.2.840.113556.1.4.803:=2147483648)(groupType:1.2.840.113556.1.4.804:=10))(samAccountType=805306368))(samAccountType=805306369))
Note: This patch works for Samba's tests, but hasn't been more broadly or specifically tested.
This commit also adds an --enable-bitwise option to configure (enabled by default - use --disable-bitwise to disable it) and adds the plugin entry to the configuration during new instance creation.
Platforms tested: FC5/FC6
-rw-r--r-- | Makefile.am | 15 | ||||
-rw-r--r-- | Makefile.in | 53 | ||||
-rw-r--r-- | aclocal.m4 | 34 | ||||
-rw-r--r-- | config.h.in | 3 | ||||
-rwxr-xr-x | configure | 252 | ||||
-rw-r--r-- | configure.ac | 15 | ||||
-rw-r--r-- | ldap/admin/src/create_instance.c | 13 | ||||
-rw-r--r-- | ldap/servers/plugins/bitwise/bitwise.c | 203 |
8 files changed, 524 insertions, 64 deletions
diff --git a/Makefile.am b/Makefile.am index 57fc66b3..613dac9d 100644 --- a/Makefile.am +++ b/Makefile.am @@ -93,13 +93,17 @@ if enable_dna LIBDNA_PLUGIN = libdna-plugin.la endif +if enable_bitwise +LIBBITWISE_PLUGIN = libbitwise-plugin.la +endif + serverplugin_LTLIBRARIES = libacl-plugin.la libattr-unique-plugin.la \ libback-ldbm.la libchainingdb-plugin.la libcos-plugin.la libdes-plugin.la \ libdistrib-plugin.la libhttp-client-plugin.la libcollation-plugin.la \ libpassthru-plugin.la libpresence-plugin.la \ libpwdstorage-plugin.la libreferint-plugin.la libreplication-plugin.la \ libretrocl-plugin.la libroles-plugin.la libstatechange-plugin.la libsyntax-plugin.la \ - libviews-plugin.la $(LIBPAM_PASSTHRU_PLUGIN) $(LIBDNA_PLUGIN) + libviews-plugin.la $(LIBPAM_PASSTHRU_PLUGIN) $(LIBDNA_PLUGIN) $(LIBBITWISE_PLUGIN) nodist_property_DATA = ns-slapd.properties @@ -323,6 +327,7 @@ libns_dshttpd_la_SOURCES = lib/libaccess/access_plhash.cpp \ $(libldaputil_a_SOURCES) libns_dshttpd_la_CPPFLAGS = -I$(srcdir)/include/base $(AM_CPPFLAGS) -I$(srcdir)/lib/ldaputil @ldapsdk_inc@ @nss_inc@ @nspr_inc@ +libns_dshttpd_la_LIBADD = $(LDAPSDK_LINK) $(NSS_LINK) $(NSPR_LINK) #------------------------ # libslapd @@ -783,6 +788,14 @@ libdna_plugin_la_SOURCES = ldap/servers/plugins/dna/dna.c libdna_plugin_la_CPPFLAGS = $(PLUGIN_CPPFLAGS) libdna_plugin_la_LDFLAGS = -avoid-version +#------------------------ +# libbitwise-plugin +#------------------------ +libbitwise_plugin_la_SOURCES = ldap/servers/plugins/bitwise/bitwise.c + +libbitwise_plugin_la_CPPFLAGS = $(PLUGIN_CPPFLAGS) +libbitwise_plugin_la_LDFLAGS = -avoid-version + #//////////////////////////////////////////////////////////////// # diff --git a/Makefile.in b/Makefile.in index c85fcc52..e6fc8c74 100644 --- a/Makefile.in +++ b/Makefile.in @@ -185,6 +185,12 @@ am_libback_ldbm_la_OBJECTS = \ ldap/servers/slapd/back-ldbm/libback_ldbm_la-vlv_key.lo \ ldap/servers/slapd/back-ldbm/libback_ldbm_la-vlv_srch.lo libback_ldbm_la_OBJECTS = $(am_libback_ldbm_la_OBJECTS) +libbitwise_plugin_la_LIBADD = +am_libbitwise_plugin_la_OBJECTS = \ + ldap/servers/plugins/bitwise/libbitwise_plugin_la-bitwise.lo +libbitwise_plugin_la_OBJECTS = $(am_libbitwise_plugin_la_OBJECTS) +@enable_bitwise_TRUE@am_libbitwise_plugin_la_rpath = -rpath \ +@enable_bitwise_TRUE@ $(serverplugindir) libchainingdb_plugin_la_LIBADD = am_libchainingdb_plugin_la_OBJECTS = ldap/servers/plugins/chainingdb/libchainingdb_plugin_la-cb_abandon.lo \ ldap/servers/plugins/chainingdb/libchainingdb_plugin_la-cb_acl.lo \ @@ -261,7 +267,8 @@ am_libhttp_client_plugin_la_OBJECTS = ldap/servers/plugins/http/libhttp_client_p ldap/servers/plugins/http/libhttp_client_plugin_la-http_impl.lo libhttp_client_plugin_la_OBJECTS = \ $(am_libhttp_client_plugin_la_OBJECTS) -libns_dshttpd_la_LIBADD = +libns_dshttpd_la_DEPENDENCIES = $(am__DEPENDENCIES_1) \ + $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) am__objects_1 = lib/ldaputil/libns_dshttpd_la-cert.lo \ lib/ldaputil/libns_dshttpd_la-certmap.lo \ lib/ldaputil/libns_dshttpd_la-dbconf.lo \ @@ -728,6 +735,7 @@ CXXLINK = $(LIBTOOL) --tag=CXX --mode=link $(CXXLD) $(AM_CXXFLAGS) \ SOURCES = $(libavl_a_SOURCES) $(libldaputil_a_SOURCES) \ $(libacl_plugin_la_SOURCES) \ $(libattr_unique_plugin_la_SOURCES) $(libback_ldbm_la_SOURCES) \ + $(libbitwise_plugin_la_SOURCES) \ $(libchainingdb_plugin_la_SOURCES) \ $(libcollation_plugin_la_SOURCES) $(libcos_plugin_la_SOURCES) \ $(libdes_plugin_la_SOURCES) $(libdistrib_plugin_la_SOURCES) \ @@ -753,6 +761,7 @@ SOURCES = $(libavl_a_SOURCES) $(libldaputil_a_SOURCES) \ DIST_SOURCES = $(libavl_a_SOURCES) $(libldaputil_a_SOURCES) \ $(libacl_plugin_la_SOURCES) \ $(libattr_unique_plugin_la_SOURCES) $(libback_ldbm_la_SOURCES) \ + $(libbitwise_plugin_la_SOURCES) \ $(libchainingdb_plugin_la_SOURCES) \ $(libcollation_plugin_la_SOURCES) $(libcos_plugin_la_SOURCES) \ $(libdes_plugin_la_SOURCES) $(libdistrib_plugin_la_SOURCES) \ @@ -858,6 +867,7 @@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PKG_CONFIG = @PKG_CONFIG@ RANLIB = @RANLIB@ +SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SOLARIS_FALSE = @SOLARIS_FALSE@ @@ -900,6 +910,8 @@ db_lib = @db_lib@ db_libdir = @db_libdir@ db_libver = @db_libver@ debug_defs = @debug_defs@ +enable_bitwise_FALSE = @enable_bitwise_FALSE@ +enable_bitwise_TRUE = @enable_bitwise_TRUE@ enable_dna_FALSE = @enable_dna_FALSE@ enable_dna_TRUE = @enable_dna_TRUE@ enable_ldapi_FALSE = @enable_ldapi_FALSE@ @@ -1012,13 +1024,14 @@ server_LTLIBRARIES = libslapd.la libds_admin.la libns-dshttpd.la # this is how to add optional plugins @enable_pam_passthru_TRUE@LIBPAM_PASSTHRU_PLUGIN = libpam-passthru-plugin.la @enable_dna_TRUE@LIBDNA_PLUGIN = libdna-plugin.la +@enable_bitwise_TRUE@LIBBITWISE_PLUGIN = libbitwise-plugin.la serverplugin_LTLIBRARIES = libacl-plugin.la libattr-unique-plugin.la \ libback-ldbm.la libchainingdb-plugin.la libcos-plugin.la libdes-plugin.la \ libdistrib-plugin.la libhttp-client-plugin.la libcollation-plugin.la \ libpassthru-plugin.la libpresence-plugin.la \ libpwdstorage-plugin.la libreferint-plugin.la libreplication-plugin.la \ libretrocl-plugin.la libroles-plugin.la libstatechange-plugin.la libsyntax-plugin.la \ - libviews-plugin.la $(LIBPAM_PASSTHRU_PLUGIN) $(LIBDNA_PLUGIN) + libviews-plugin.la $(LIBPAM_PASSTHRU_PLUGIN) $(LIBDNA_PLUGIN) $(LIBBITWISE_PLUGIN) nodist_property_DATA = ns-slapd.properties noinst_LIBRARIES = libavl.a libldaputil.a @@ -1230,6 +1243,7 @@ libns_dshttpd_la_SOURCES = lib/libaccess/access_plhash.cpp \ $(libldaputil_a_SOURCES) libns_dshttpd_la_CPPFLAGS = -I$(srcdir)/include/base $(AM_CPPFLAGS) -I$(srcdir)/lib/ldaputil @ldapsdk_inc@ @nss_inc@ @nspr_inc@ +libns_dshttpd_la_LIBADD = $(LDAPSDK_LINK) $(NSS_LINK) $(NSPR_LINK) #------------------------ # libslapd @@ -1683,6 +1697,13 @@ libdna_plugin_la_SOURCES = ldap/servers/plugins/dna/dna.c libdna_plugin_la_CPPFLAGS = $(PLUGIN_CPPFLAGS) libdna_plugin_la_LDFLAGS = -avoid-version +#------------------------ +# libbitwise-plugin +#------------------------ +libbitwise_plugin_la_SOURCES = ldap/servers/plugins/bitwise/bitwise.c +libbitwise_plugin_la_CPPFLAGS = $(PLUGIN_CPPFLAGS) +libbitwise_plugin_la_LDFLAGS = -avoid-version + #//////////////////////////////////////////////////////////////// # # Programs @@ -2308,6 +2329,17 @@ ldap/servers/slapd/back-ldbm/libback_ldbm_la-vlv_srch.lo: \ ldap/servers/slapd/back-ldbm/$(DEPDIR)/$(am__dirstamp) libback-ldbm.la: $(libback_ldbm_la_OBJECTS) $(libback_ldbm_la_DEPENDENCIES) $(LINK) -rpath $(serverplugindir) $(libback_ldbm_la_LDFLAGS) $(libback_ldbm_la_OBJECTS) $(libback_ldbm_la_LIBADD) $(LIBS) +ldap/servers/plugins/bitwise/$(am__dirstamp): + @$(mkdir_p) ldap/servers/plugins/bitwise + @: > ldap/servers/plugins/bitwise/$(am__dirstamp) +ldap/servers/plugins/bitwise/$(DEPDIR)/$(am__dirstamp): + @$(mkdir_p) ldap/servers/plugins/bitwise/$(DEPDIR) + @: > ldap/servers/plugins/bitwise/$(DEPDIR)/$(am__dirstamp) +ldap/servers/plugins/bitwise/libbitwise_plugin_la-bitwise.lo: \ + ldap/servers/plugins/bitwise/$(am__dirstamp) \ + ldap/servers/plugins/bitwise/$(DEPDIR)/$(am__dirstamp) +libbitwise-plugin.la: $(libbitwise_plugin_la_OBJECTS) $(libbitwise_plugin_la_DEPENDENCIES) + $(LINK) $(am_libbitwise_plugin_la_rpath) $(libbitwise_plugin_la_LDFLAGS) $(libbitwise_plugin_la_OBJECTS) $(libbitwise_plugin_la_LIBADD) $(LIBS) ldap/servers/plugins/chainingdb/$(am__dirstamp): @$(mkdir_p) ldap/servers/plugins/chainingdb @: > ldap/servers/plugins/chainingdb/$(am__dirstamp) @@ -3800,6 +3832,8 @@ mostlyclean-compile: -rm -f ldap/servers/plugins/acl/libacl_plugin_la-aclproxy.lo -rm -f ldap/servers/plugins/acl/libacl_plugin_la-aclutil.$(OBJEXT) -rm -f ldap/servers/plugins/acl/libacl_plugin_la-aclutil.lo + -rm -f ldap/servers/plugins/bitwise/libbitwise_plugin_la-bitwise.$(OBJEXT) + -rm -f ldap/servers/plugins/bitwise/libbitwise_plugin_la-bitwise.lo -rm -f ldap/servers/plugins/chainingdb/libchainingdb_plugin_la-cb_abandon.$(OBJEXT) -rm -f ldap/servers/plugins/chainingdb/libchainingdb_plugin_la-cb_abandon.lo -rm -f ldap/servers/plugins/chainingdb/libchainingdb_plugin_la-cb_acl.$(OBJEXT) @@ -4586,6 +4620,7 @@ distclean-compile: @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-aclproxy.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/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@ @AMDEP_TRUE@@am__include@ @am__quote@ldap/servers/plugins/chainingdb/$(DEPDIR)/libchainingdb_plugin_la-cb_acl.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@ldap/servers/plugins/chainingdb/$(DEPDIR)/libchainingdb_plugin_la-cb_add.Plo@am__quote@ @@ -5660,6 +5695,13 @@ ldap/servers/slapd/back-ldbm/libback_ldbm_la-vlv_srch.lo: ldap/servers/slapd/bac @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libback_ldbm_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o ldap/servers/slapd/back-ldbm/libback_ldbm_la-vlv_srch.lo `test -f 'ldap/servers/slapd/back-ldbm/vlv_srch.c' || echo '$(srcdir)/'`ldap/servers/slapd/back-ldbm/vlv_srch.c +ldap/servers/plugins/bitwise/libbitwise_plugin_la-bitwise.lo: ldap/servers/plugins/bitwise/bitwise.c +@am__fastdepCC_TRUE@ if $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libbitwise_plugin_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT ldap/servers/plugins/bitwise/libbitwise_plugin_la-bitwise.lo -MD -MP -MF "ldap/servers/plugins/bitwise/$(DEPDIR)/libbitwise_plugin_la-bitwise.Tpo" -c -o ldap/servers/plugins/bitwise/libbitwise_plugin_la-bitwise.lo `test -f 'ldap/servers/plugins/bitwise/bitwise.c' || echo '$(srcdir)/'`ldap/servers/plugins/bitwise/bitwise.c; \ +@am__fastdepCC_TRUE@ then mv -f "ldap/servers/plugins/bitwise/$(DEPDIR)/libbitwise_plugin_la-bitwise.Tpo" "ldap/servers/plugins/bitwise/$(DEPDIR)/libbitwise_plugin_la-bitwise.Plo"; else rm -f "ldap/servers/plugins/bitwise/$(DEPDIR)/libbitwise_plugin_la-bitwise.Tpo"; exit 1; fi +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='ldap/servers/plugins/bitwise/bitwise.c' object='ldap/servers/plugins/bitwise/libbitwise_plugin_la-bitwise.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libbitwise_plugin_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o ldap/servers/plugins/bitwise/libbitwise_plugin_la-bitwise.lo `test -f 'ldap/servers/plugins/bitwise/bitwise.c' || echo '$(srcdir)/'`ldap/servers/plugins/bitwise/bitwise.c + ldap/servers/plugins/chainingdb/libchainingdb_plugin_la-cb_abandon.lo: ldap/servers/plugins/chainingdb/cb_abandon.c @am__fastdepCC_TRUE@ if $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libchainingdb_plugin_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT ldap/servers/plugins/chainingdb/libchainingdb_plugin_la-cb_abandon.lo -MD -MP -MF "ldap/servers/plugins/chainingdb/$(DEPDIR)/libchainingdb_plugin_la-cb_abandon.Tpo" -c -o ldap/servers/plugins/chainingdb/libchainingdb_plugin_la-cb_abandon.lo `test -f 'ldap/servers/plugins/chainingdb/cb_abandon.c' || echo '$(srcdir)/'`ldap/servers/plugins/chainingdb/cb_abandon.c; \ @am__fastdepCC_TRUE@ then mv -f "ldap/servers/plugins/chainingdb/$(DEPDIR)/libchainingdb_plugin_la-cb_abandon.Tpo" "ldap/servers/plugins/chainingdb/$(DEPDIR)/libchainingdb_plugin_la-cb_abandon.Plo"; else rm -f "ldap/servers/plugins/chainingdb/$(DEPDIR)/libchainingdb_plugin_la-cb_abandon.Tpo"; exit 1; fi @@ -8660,6 +8702,7 @@ clean-libtool: -rm -rf ldap/admin/lib/.libs ldap/admin/lib/_libs -rm -rf ldap/libraries/libavl/.libs ldap/libraries/libavl/_libs -rm -rf ldap/servers/plugins/acl/.libs ldap/servers/plugins/acl/_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 -rm -rf ldap/servers/plugins/collation/.libs ldap/servers/plugins/collation/_libs -rm -rf ldap/servers/plugins/cos/.libs ldap/servers/plugins/cos/_libs @@ -8974,6 +9017,8 @@ distclean-generic: -rm -f ldap/libraries/libavl/$(am__dirstamp) -rm -f ldap/servers/plugins/acl/$(DEPDIR)/$(am__dirstamp) -rm -f ldap/servers/plugins/acl/$(am__dirstamp) + -rm -f ldap/servers/plugins/bitwise/$(DEPDIR)/$(am__dirstamp) + -rm -f ldap/servers/plugins/bitwise/$(am__dirstamp) -rm -f ldap/servers/plugins/chainingdb/$(DEPDIR)/$(am__dirstamp) -rm -f ldap/servers/plugins/chainingdb/$(am__dirstamp) -rm -f ldap/servers/plugins/collation/$(DEPDIR)/$(am__dirstamp) @@ -9052,7 +9097,7 @@ clean-am: clean-binPROGRAMS clean-generic clean-libtool \ distclean: distclean-am -rm -f $(am__CONFIG_DISTCLEAN_FILES) - -rm -rf ldap/admin/lib/$(DEPDIR) ldap/admin/src/$(DEPDIR) ldap/libraries/libavl/$(DEPDIR) ldap/servers/plugins/acl/$(DEPDIR) ldap/servers/plugins/chainingdb/$(DEPDIR) ldap/servers/plugins/collation/$(DEPDIR) ldap/servers/plugins/cos/$(DEPDIR) ldap/servers/plugins/distrib/$(DEPDIR) ldap/servers/plugins/dna/$(DEPDIR) ldap/servers/plugins/http/$(DEPDIR) ldap/servers/plugins/pam_passthru/$(DEPDIR) ldap/servers/plugins/passthru/$(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/shared/$(DEPDIR) ldap/servers/plugins/statechange/$(DEPDIR) ldap/servers/plugins/syntaxes/$(DEPDIR) ldap/servers/plugins/uiduniq/$(DEPDIR) ldap/servers/plugins/views/$(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/admin/lib/$(DEPDIR) ldap/admin/src/$(DEPDIR) ldap/libraries/libavl/$(DEPDIR) ldap/servers/plugins/acl/$(DEPDIR) ldap/servers/plugins/bitwise/$(DEPDIR) ldap/servers/plugins/chainingdb/$(DEPDIR) ldap/servers/plugins/collation/$(DEPDIR) ldap/servers/plugins/cos/$(DEPDIR) ldap/servers/plugins/distrib/$(DEPDIR) ldap/servers/plugins/dna/$(DEPDIR) ldap/servers/plugins/http/$(DEPDIR) ldap/servers/plugins/pam_passthru/$(DEPDIR) ldap/servers/plugins/passthru/$(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/shared/$(DEPDIR) ldap/servers/plugins/statechange/$(DEPDIR) ldap/servers/plugins/syntaxes/$(DEPDIR) ldap/servers/plugins/uiduniq/$(DEPDIR) ldap/servers/plugins/views/$(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 @@ -9084,7 +9129,7 @@ installcheck-am: maintainer-clean: maintainer-clean-am -rm -f $(am__CONFIG_DISTCLEAN_FILES) -rm -rf $(top_srcdir)/autom4te.cache - -rm -rf ldap/admin/lib/$(DEPDIR) ldap/admin/src/$(DEPDIR) ldap/libraries/libavl/$(DEPDIR) ldap/servers/plugins/acl/$(DEPDIR) ldap/servers/plugins/chainingdb/$(DEPDIR) ldap/servers/plugins/collation/$(DEPDIR) ldap/servers/plugins/cos/$(DEPDIR) ldap/servers/plugins/distrib/$(DEPDIR) ldap/servers/plugins/dna/$(DEPDIR) ldap/servers/plugins/http/$(DEPDIR) ldap/servers/plugins/pam_passthru/$(DEPDIR) ldap/servers/plugins/passthru/$(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/shared/$(DEPDIR) ldap/servers/plugins/statechange/$(DEPDIR) ldap/servers/plugins/syntaxes/$(DEPDIR) ldap/servers/plugins/uiduniq/$(DEPDIR) ldap/servers/plugins/views/$(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/admin/lib/$(DEPDIR) ldap/admin/src/$(DEPDIR) ldap/libraries/libavl/$(DEPDIR) ldap/servers/plugins/acl/$(DEPDIR) ldap/servers/plugins/bitwise/$(DEPDIR) ldap/servers/plugins/chainingdb/$(DEPDIR) ldap/servers/plugins/collation/$(DEPDIR) ldap/servers/plugins/cos/$(DEPDIR) ldap/servers/plugins/distrib/$(DEPDIR) ldap/servers/plugins/dna/$(DEPDIR) ldap/servers/plugins/http/$(DEPDIR) ldap/servers/plugins/pam_passthru/$(DEPDIR) ldap/servers/plugins/passthru/$(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/shared/$(DEPDIR) ldap/servers/plugins/statechange/$(DEPDIR) ldap/servers/plugins/syntaxes/$(DEPDIR) ldap/servers/plugins/uiduniq/$(DEPDIR) ldap/servers/plugins/views/$(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 @@ -1578,10 +1578,27 @@ linux*) # before this can be enabled. hardcode_into_libs=yes + # find out which ABI we are using + libsuff= + case "$host_cpu" in + x86_64*|s390x*|powerpc64*) + echo '[#]line __oline__ "configure"' > conftest.$ac_ext + if AC_TRY_EVAL(ac_compile); then + case `/usr/bin/file conftest.$ac_objext` in + *64-bit*) + libsuff=64 + sys_lib_search_path_spec="/lib${libsuff} /usr/lib${libsuff} /usr/local/lib${libsuff}" + ;; + esac + fi + rm -rf conftest* + ;; + esac + # Append ld.so.conf contents to the search path if test -f /etc/ld.so.conf; then - lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s", \[$]2)); skip = 1; } { if (!skip) print \[$]0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;/^$/d' | tr '\n' ' '` - sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra" + lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \[$]2)); skip = 1; } { if (!skip) print \[$]0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;/^$/d' | tr '\n' ' '` + sys_lib_dlsearch_path_spec="/lib${libsuff} /usr/lib${libsuff} $lt_ld_extra" fi # We used to test for /lib/ld.so.1 and disable shared libraries on @@ -4288,6 +4305,9 @@ CC=$lt_[]_LT_AC_TAGVAR(compiler, $1) # Is the compiler the GNU C compiler? with_gcc=$_LT_AC_TAGVAR(GCC, $1) +gcc_dir=\`gcc -print-file-name=. | $SED 's,/\.$,,'\` +gcc_ver=\`gcc -dumpversion\` + # An ERE matcher. EGREP=$lt_EGREP @@ -4421,11 +4441,11 @@ striplib=$lt_striplib # Dependencies to place before the objects being linked to create a # shared library. -predep_objects=$lt_[]_LT_AC_TAGVAR(predep_objects, $1) +predep_objects=\`echo $lt_[]_LT_AC_TAGVAR(predep_objects, $1) | \$SED -e "s@\${gcc_dir}@\\\${gcc_dir}@g;s@\${gcc_ver}@\\\${gcc_ver}@g"\` # Dependencies to place after the objects being linked to create a # shared library. -postdep_objects=$lt_[]_LT_AC_TAGVAR(postdep_objects, $1) +postdep_objects=\`echo $lt_[]_LT_AC_TAGVAR(postdep_objects, $1) | \$SED -e "s@\${gcc_dir}@\\\${gcc_dir}@g;s@\${gcc_ver}@\\\${gcc_ver}@g"\` # Dependencies to place before the objects being linked to create a # shared library. @@ -4437,7 +4457,7 @@ postdeps=$lt_[]_LT_AC_TAGVAR(postdeps, $1) # The library search path used internally by the compiler when linking # a shared library. -compiler_lib_search_path=$lt_[]_LT_AC_TAGVAR(compiler_lib_search_path, $1) +compiler_lib_search_path=\`echo $lt_[]_LT_AC_TAGVAR(compiler_lib_search_path, $1) | \$SED -e "s@\${gcc_dir}@\\\${gcc_dir}@g;s@\${gcc_ver}@\\\${gcc_ver}@g"\` # Method to check whether dependent libraries are shared objects. deplibs_check_method=$lt_deplibs_check_method @@ -4517,7 +4537,7 @@ variables_saved_for_relink="$variables_saved_for_relink" link_all_deplibs=$_LT_AC_TAGVAR(link_all_deplibs, $1) # Compile-time system search path for libraries -sys_lib_search_path_spec=$lt_sys_lib_search_path_spec +sys_lib_search_path_spec=\`echo $lt_sys_lib_search_path_spec | \$SED -e "s@\${gcc_dir}@\\\${gcc_dir}@g;s@\${gcc_ver}@\\\${gcc_ver}@g"\` # Run-time system search path for libraries sys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec @@ -6353,6 +6373,7 @@ do done done done +IFS=$as_save_IFS lt_ac_max=0 lt_ac_count=0 # Add /usr/xpg4/bin/sed as it is typically found on Solaris @@ -6385,6 +6406,7 @@ for lt_ac_sed in $lt_ac_sed_list /usr/xpg4/bin/sed; do done ]) SED=$lt_cv_path_SED +AC_SUBST([SED]) AC_MSG_RESULT([$SED]) ]) diff --git a/config.h.in b/config.h.in index 8da8808c..bacb59c9 100644 --- a/config.h.in +++ b/config.h.in @@ -12,6 +12,9 @@ /* cpu type sparc */ #undef CPU_sparc +/* enable the bitwise plugin */ +#undef ENABLE_BITWISE + /* enable the dna plugin */ #undef ENABLE_DNA @@ -465,7 +465,7 @@ ac_includes_default="\ #endif" ac_default_prefix=/opt/$PACKAGE_NAME -ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA CYGPATH_W PACKAGE VERSION ACLOCAL AUTOCONF AUTOMAKE AUTOHEADER MAKEINFO install_sh STRIP ac_ct_STRIP INSTALL_STRIP_PROGRAM mkdir_p AWK SET_MAKE am__leading_dot AMTAR am__tar am__untar MAINTAINER_MODE_TRUE MAINTAINER_MODE_FALSE MAINT build build_cpu build_vendor build_os host host_cpu host_vendor host_os CXX CXXFLAGS LDFLAGS CPPFLAGS ac_ct_CXX EXEEXT OBJEXT DEPDIR am__include am__quote AMDEP_TRUE AMDEP_FALSE AMDEPBACKSLASH CXXDEPMODE am__fastdepCXX_TRUE am__fastdepCXX_FALSE CC CFLAGS ac_ct_CC CCDEPMODE am__fastdepCC_TRUE am__fastdepCC_FALSE EGREP LN_S ECHO AR ac_ct_AR RANLIB ac_ct_RANLIB CPP CXXCPP F77 FFLAGS ac_ct_F77 LIBTOOL LIBOBJS debug_defs BUNDLE_TRUE BUNDLE_FALSE enable_pam_passthru_TRUE enable_pam_passthru_FALSE enable_dna_TRUE enable_dna_FALSE enable_ldapi_TRUE enable_ldapi_FALSE configdir sampledatadir propertydir schemadir serverdir serverplugindir scripttemplatedir instconfigdir WINNT_TRUE WINNT_FALSE LIBSOCKET LIBNSL LIBDL LIBCSTD LIBCRUN initdir HPUX_TRUE HPUX_FALSE SOLARIS_TRUE SOLARIS_FALSE PKG_CONFIG ICU_CONFIG NETSNMP_CONFIG nspr_inc nspr_lib nspr_libdir nss_inc nss_lib nss_libdir ldapsdk_inc ldapsdk_lib ldapsdk_libdir ldapsdk_bindir db_inc db_incdir db_lib db_libdir db_bindir db_libver sasl_inc sasl_lib sasl_libdir svrcore_inc svrcore_lib icu_lib icu_inc icu_bin netsnmp_inc netsnmp_lib netsnmp_libdir netsnmp_link LTLIBOBJS' +ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA CYGPATH_W PACKAGE VERSION ACLOCAL AUTOCONF AUTOMAKE AUTOHEADER MAKEINFO install_sh STRIP ac_ct_STRIP INSTALL_STRIP_PROGRAM mkdir_p AWK SET_MAKE am__leading_dot AMTAR am__tar am__untar MAINTAINER_MODE_TRUE MAINTAINER_MODE_FALSE MAINT build build_cpu build_vendor build_os host host_cpu host_vendor host_os CXX CXXFLAGS LDFLAGS CPPFLAGS ac_ct_CXX EXEEXT OBJEXT DEPDIR am__include am__quote AMDEP_TRUE AMDEP_FALSE AMDEPBACKSLASH CXXDEPMODE am__fastdepCXX_TRUE am__fastdepCXX_FALSE CC CFLAGS ac_ct_CC CCDEPMODE am__fastdepCC_TRUE am__fastdepCC_FALSE SED EGREP LN_S ECHO AR ac_ct_AR RANLIB ac_ct_RANLIB CPP CXXCPP F77 FFLAGS ac_ct_F77 LIBTOOL LIBOBJS debug_defs BUNDLE_TRUE BUNDLE_FALSE enable_pam_passthru_TRUE enable_pam_passthru_FALSE enable_dna_TRUE enable_dna_FALSE enable_ldapi_TRUE enable_ldapi_FALSE enable_bitwise_TRUE enable_bitwise_FALSE configdir sampledatadir propertydir schemadir serverdir serverplugindir scripttemplatedir instconfigdir WINNT_TRUE WINNT_FALSE LIBSOCKET LIBNSL LIBDL LIBCSTD LIBCRUN initdir HPUX_TRUE HPUX_FALSE SOLARIS_TRUE SOLARIS_FALSE PKG_CONFIG ICU_CONFIG NETSNMP_CONFIG nspr_inc nspr_lib nspr_libdir nss_inc nss_lib nss_libdir ldapsdk_inc ldapsdk_lib ldapsdk_libdir ldapsdk_bindir db_inc db_incdir db_lib db_libdir db_bindir db_libver sasl_inc sasl_lib sasl_libdir svrcore_inc svrcore_lib icu_lib icu_inc icu_bin netsnmp_inc netsnmp_lib netsnmp_libdir netsnmp_link LTLIBOBJS' ac_subst_files='' # Initialize some variables set by options. @@ -1046,6 +1046,8 @@ Optional Features: plugin (default: yes) --enable-ldapi enable LDAP over unix domain socket (LDAPI) support (default: yes) + --enable-bitwise enable the bitwise matching rule plugin (default: + yes) Optional Packages: --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] @@ -3833,6 +3835,7 @@ do done done done +IFS=$as_save_IFS lt_ac_max=0 lt_ac_count=0 # Add /usr/xpg4/bin/sed as it is typically found on Solaris @@ -3867,6 +3870,7 @@ done fi SED=$lt_cv_path_SED + echo "$as_me:$LINENO: result: $SED" >&5 echo "${ECHO_T}$SED" >&6 @@ -4307,7 +4311,7 @@ ia64-*-hpux*) ;; *-*-irix6*) # Find out which ABI we are using. - echo '#line 4310 "configure"' > conftest.$ac_ext + echo '#line 4314 "configure"' > conftest.$ac_ext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? @@ -5442,7 +5446,7 @@ fi # Provide some information about the compiler. -echo "$as_me:5445:" \ +echo "$as_me:5449:" \ "checking for Fortran 77 compiler version" >&5 ac_compiler=`set X $ac_compile; echo $2` { (eval echo "$as_me:$LINENO: \"$ac_compiler --version </dev/null >&5\"") >&5 @@ -6505,11 +6509,11 @@ else -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:6508: $lt_compile\"" >&5) + (eval echo "\"\$as_me:6512: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 - echo "$as_me:6512: \$? = $ac_status" >&5 + echo "$as_me:6516: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings other than the usual output. @@ -6773,11 +6777,11 @@ else -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:6776: $lt_compile\"" >&5) + (eval echo "\"\$as_me:6780: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 - echo "$as_me:6780: \$? = $ac_status" >&5 + echo "$as_me:6784: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings other than the usual output. @@ -6877,11 +6881,11 @@ else -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:6880: $lt_compile\"" >&5) + (eval echo "\"\$as_me:6884: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 - echo "$as_me:6884: \$? = $ac_status" >&5 + echo "$as_me:6888: \$? = $ac_status" >&5 if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized @@ -8342,10 +8346,31 @@ linux*) # before this can be enabled. hardcode_into_libs=yes + # find out which ABI we are using + libsuff= + case "$host_cpu" in + x86_64*|s390x*|powerpc64*) + echo '#line 8353 "configure"' > conftest.$ac_ext + if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; then + case `/usr/bin/file conftest.$ac_objext` in + *64-bit*) + libsuff=64 + sys_lib_search_path_spec="/lib${libsuff} /usr/lib${libsuff} /usr/local/lib${libsuff}" + ;; + esac + fi + rm -rf conftest* + ;; + esac + # Append ld.so.conf contents to the search path if test -f /etc/ld.so.conf; then - lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;/^$/d' | tr '\n' ' '` - sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra" + lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;/^$/d' | tr '\n' ' '` + sys_lib_dlsearch_path_spec="/lib${libsuff} /usr/lib${libsuff} $lt_ld_extra" fi # We used to test for /lib/ld.so.1 and disable shared libraries on @@ -9222,7 +9247,7 @@ else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<EOF -#line 9225 "configure" +#line 9250 "configure" #include "confdefs.h" #if HAVE_DLFCN_H @@ -9322,7 +9347,7 @@ else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<EOF -#line 9325 "configure" +#line 9350 "configure" #include "confdefs.h" #if HAVE_DLFCN_H @@ -9653,6 +9678,9 @@ CC=$lt_compiler # Is the compiler the GNU C compiler? with_gcc=$GCC +gcc_dir=\`gcc -print-file-name=. | $SED 's,/\.$,,'\` +gcc_ver=\`gcc -dumpversion\` + # An ERE matcher. EGREP=$lt_EGREP @@ -9786,11 +9814,11 @@ striplib=$lt_striplib # Dependencies to place before the objects being linked to create a # shared library. -predep_objects=$lt_predep_objects +predep_objects=\`echo $lt_predep_objects | \$SED -e "s@\${gcc_dir}@\\\${gcc_dir}@g;s@\${gcc_ver}@\\\${gcc_ver}@g"\` # Dependencies to place after the objects being linked to create a # shared library. -postdep_objects=$lt_postdep_objects +postdep_objects=\`echo $lt_postdep_objects | \$SED -e "s@\${gcc_dir}@\\\${gcc_dir}@g;s@\${gcc_ver}@\\\${gcc_ver}@g"\` # Dependencies to place before the objects being linked to create a # shared library. @@ -9802,7 +9830,7 @@ postdeps=$lt_postdeps # The library search path used internally by the compiler when linking # a shared library. -compiler_lib_search_path=$lt_compiler_lib_search_path +compiler_lib_search_path=\`echo $lt_compiler_lib_search_path | \$SED -e "s@\${gcc_dir}@\\\${gcc_dir}@g;s@\${gcc_ver}@\\\${gcc_ver}@g"\` # Method to check whether dependent libraries are shared objects. deplibs_check_method=$lt_deplibs_check_method @@ -9882,7 +9910,7 @@ variables_saved_for_relink="$variables_saved_for_relink" link_all_deplibs=$link_all_deplibs # Compile-time system search path for libraries -sys_lib_search_path_spec=$lt_sys_lib_search_path_spec +sys_lib_search_path_spec=\`echo $lt_sys_lib_search_path_spec | \$SED -e "s@\${gcc_dir}@\\\${gcc_dir}@g;s@\${gcc_ver}@\\\${gcc_ver}@g"\` # Run-time system search path for libraries sys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec @@ -11662,11 +11690,11 @@ else -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:11665: $lt_compile\"" >&5) + (eval echo "\"\$as_me:11693: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 - echo "$as_me:11669: \$? = $ac_status" >&5 + echo "$as_me:11697: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings other than the usual output. @@ -11766,11 +11794,11 @@ else -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:11769: $lt_compile\"" >&5) + (eval echo "\"\$as_me:11797: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 - echo "$as_me:11773: \$? = $ac_status" >&5 + echo "$as_me:11801: \$? = $ac_status" >&5 if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized @@ -12298,10 +12326,31 @@ linux*) # before this can be enabled. hardcode_into_libs=yes + # find out which ABI we are using + libsuff= + case "$host_cpu" in + x86_64*|s390x*|powerpc64*) + echo '#line 12333 "configure"' > conftest.$ac_ext + if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; then + case `/usr/bin/file conftest.$ac_objext` in + *64-bit*) + libsuff=64 + sys_lib_search_path_spec="/lib${libsuff} /usr/lib${libsuff} /usr/local/lib${libsuff}" + ;; + esac + fi + rm -rf conftest* + ;; + esac + # Append ld.so.conf contents to the search path if test -f /etc/ld.so.conf; then - lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;/^$/d' | tr '\n' ' '` - sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra" + lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;/^$/d' | tr '\n' ' '` + sys_lib_dlsearch_path_spec="/lib${libsuff} /usr/lib${libsuff} $lt_ld_extra" fi # We used to test for /lib/ld.so.1 and disable shared libraries on @@ -12685,6 +12734,9 @@ CC=$lt_compiler_CXX # Is the compiler the GNU C compiler? with_gcc=$GCC_CXX +gcc_dir=\`gcc -print-file-name=. | $SED 's,/\.$,,'\` +gcc_ver=\`gcc -dumpversion\` + # An ERE matcher. EGREP=$lt_EGREP @@ -12818,11 +12870,11 @@ striplib=$lt_striplib # Dependencies to place before the objects being linked to create a # shared library. -predep_objects=$lt_predep_objects_CXX +predep_objects=\`echo $lt_predep_objects_CXX | \$SED -e "s@\${gcc_dir}@\\\${gcc_dir}@g;s@\${gcc_ver}@\\\${gcc_ver}@g"\` # Dependencies to place after the objects being linked to create a # shared library. -postdep_objects=$lt_postdep_objects_CXX +postdep_objects=\`echo $lt_postdep_objects_CXX | \$SED -e "s@\${gcc_dir}@\\\${gcc_dir}@g;s@\${gcc_ver}@\\\${gcc_ver}@g"\` # Dependencies to place before the objects being linked to create a # shared library. @@ -12834,7 +12886,7 @@ postdeps=$lt_postdeps_CXX # The library search path used internally by the compiler when linking # a shared library. -compiler_lib_search_path=$lt_compiler_lib_search_path_CXX +compiler_lib_search_path=\`echo $lt_compiler_lib_search_path_CXX | \$SED -e "s@\${gcc_dir}@\\\${gcc_dir}@g;s@\${gcc_ver}@\\\${gcc_ver}@g"\` # Method to check whether dependent libraries are shared objects. deplibs_check_method=$lt_deplibs_check_method @@ -12914,7 +12966,7 @@ variables_saved_for_relink="$variables_saved_for_relink" link_all_deplibs=$link_all_deplibs_CXX # Compile-time system search path for libraries -sys_lib_search_path_spec=$lt_sys_lib_search_path_spec +sys_lib_search_path_spec=\`echo $lt_sys_lib_search_path_spec | \$SED -e "s@\${gcc_dir}@\\\${gcc_dir}@g;s@\${gcc_ver}@\\\${gcc_ver}@g"\` # Run-time system search path for libraries sys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec @@ -13336,11 +13388,11 @@ else -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:13339: $lt_compile\"" >&5) + (eval echo "\"\$as_me:13391: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 - echo "$as_me:13343: \$? = $ac_status" >&5 + echo "$as_me:13395: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings other than the usual output. @@ -13440,11 +13492,11 @@ else -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:13443: $lt_compile\"" >&5) + (eval echo "\"\$as_me:13495: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 - echo "$as_me:13447: \$? = $ac_status" >&5 + echo "$as_me:13499: \$? = $ac_status" >&5 if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized @@ -14885,10 +14937,31 @@ linux*) # before this can be enabled. hardcode_into_libs=yes + # find out which ABI we are using + libsuff= + case "$host_cpu" in + x86_64*|s390x*|powerpc64*) + echo '#line 14944 "configure"' > conftest.$ac_ext + if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; then + case `/usr/bin/file conftest.$ac_objext` in + *64-bit*) + libsuff=64 + sys_lib_search_path_spec="/lib${libsuff} /usr/lib${libsuff} /usr/local/lib${libsuff}" + ;; + esac + fi + rm -rf conftest* + ;; + esac + # Append ld.so.conf contents to the search path if test -f /etc/ld.so.conf; then - lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;/^$/d' | tr '\n' ' '` - sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra" + lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;/^$/d' | tr '\n' ' '` + sys_lib_dlsearch_path_spec="/lib${libsuff} /usr/lib${libsuff} $lt_ld_extra" fi # We used to test for /lib/ld.so.1 and disable shared libraries on @@ -15272,6 +15345,9 @@ CC=$lt_compiler_F77 # Is the compiler the GNU C compiler? with_gcc=$GCC_F77 +gcc_dir=\`gcc -print-file-name=. | $SED 's,/\.$,,'\` +gcc_ver=\`gcc -dumpversion\` + # An ERE matcher. EGREP=$lt_EGREP @@ -15405,11 +15481,11 @@ striplib=$lt_striplib # Dependencies to place before the objects being linked to create a # shared library. -predep_objects=$lt_predep_objects_F77 +predep_objects=\`echo $lt_predep_objects_F77 | \$SED -e "s@\${gcc_dir}@\\\${gcc_dir}@g;s@\${gcc_ver}@\\\${gcc_ver}@g"\` # Dependencies to place after the objects being linked to create a # shared library. -postdep_objects=$lt_postdep_objects_F77 +postdep_objects=\`echo $lt_postdep_objects_F77 | \$SED -e "s@\${gcc_dir}@\\\${gcc_dir}@g;s@\${gcc_ver}@\\\${gcc_ver}@g"\` # Dependencies to place before the objects being linked to create a # shared library. @@ -15421,7 +15497,7 @@ postdeps=$lt_postdeps_F77 # The library search path used internally by the compiler when linking # a shared library. -compiler_lib_search_path=$lt_compiler_lib_search_path_F77 +compiler_lib_search_path=\`echo $lt_compiler_lib_search_path_F77 | \$SED -e "s@\${gcc_dir}@\\\${gcc_dir}@g;s@\${gcc_ver}@\\\${gcc_ver}@g"\` # Method to check whether dependent libraries are shared objects. deplibs_check_method=$lt_deplibs_check_method @@ -15501,7 +15577,7 @@ variables_saved_for_relink="$variables_saved_for_relink" link_all_deplibs=$link_all_deplibs_F77 # Compile-time system search path for libraries -sys_lib_search_path_spec=$lt_sys_lib_search_path_spec +sys_lib_search_path_spec=\`echo $lt_sys_lib_search_path_spec | \$SED -e "s@\${gcc_dir}@\\\${gcc_dir}@g;s@\${gcc_ver}@\\\${gcc_ver}@g"\` # Run-time system search path for libraries sys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec @@ -15643,11 +15719,11 @@ else -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:15646: $lt_compile\"" >&5) + (eval echo "\"\$as_me:15722: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 - echo "$as_me:15650: \$? = $ac_status" >&5 + echo "$as_me:15726: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings other than the usual output. @@ -15911,11 +15987,11 @@ else -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:15914: $lt_compile\"" >&5) + (eval echo "\"\$as_me:15990: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 - echo "$as_me:15918: \$? = $ac_status" >&5 + echo "$as_me:15994: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings other than the usual output. @@ -16015,11 +16091,11 @@ else -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:16018: $lt_compile\"" >&5) + (eval echo "\"\$as_me:16094: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 - echo "$as_me:16022: \$? = $ac_status" >&5 + echo "$as_me:16098: \$? = $ac_status" >&5 if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized @@ -17480,10 +17556,31 @@ linux*) # before this can be enabled. hardcode_into_libs=yes + # find out which ABI we are using + libsuff= + case "$host_cpu" in + x86_64*|s390x*|powerpc64*) + echo '#line 17563 "configure"' > conftest.$ac_ext + if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; then + case `/usr/bin/file conftest.$ac_objext` in + *64-bit*) + libsuff=64 + sys_lib_search_path_spec="/lib${libsuff} /usr/lib${libsuff} /usr/local/lib${libsuff}" + ;; + esac + fi + rm -rf conftest* + ;; + esac + # Append ld.so.conf contents to the search path if test -f /etc/ld.so.conf; then - lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;/^$/d' | tr '\n' ' '` - sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra" + lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;/^$/d' | tr '\n' ' '` + sys_lib_dlsearch_path_spec="/lib${libsuff} /usr/lib${libsuff} $lt_ld_extra" fi # We used to test for /lib/ld.so.1 and disable shared libraries on @@ -17867,6 +17964,9 @@ CC=$lt_compiler_GCJ # Is the compiler the GNU C compiler? with_gcc=$GCC_GCJ +gcc_dir=\`gcc -print-file-name=. | $SED 's,/\.$,,'\` +gcc_ver=\`gcc -dumpversion\` + # An ERE matcher. EGREP=$lt_EGREP @@ -18000,11 +18100,11 @@ striplib=$lt_striplib # Dependencies to place before the objects being linked to create a # shared library. -predep_objects=$lt_predep_objects_GCJ +predep_objects=\`echo $lt_predep_objects_GCJ | \$SED -e "s@\${gcc_dir}@\\\${gcc_dir}@g;s@\${gcc_ver}@\\\${gcc_ver}@g"\` # Dependencies to place after the objects being linked to create a # shared library. -postdep_objects=$lt_postdep_objects_GCJ +postdep_objects=\`echo $lt_postdep_objects_GCJ | \$SED -e "s@\${gcc_dir}@\\\${gcc_dir}@g;s@\${gcc_ver}@\\\${gcc_ver}@g"\` # Dependencies to place before the objects being linked to create a # shared library. @@ -18016,7 +18116,7 @@ postdeps=$lt_postdeps_GCJ # The library search path used internally by the compiler when linking # a shared library. -compiler_lib_search_path=$lt_compiler_lib_search_path_GCJ +compiler_lib_search_path=\`echo $lt_compiler_lib_search_path_GCJ | \$SED -e "s@\${gcc_dir}@\\\${gcc_dir}@g;s@\${gcc_ver}@\\\${gcc_ver}@g"\` # Method to check whether dependent libraries are shared objects. deplibs_check_method=$lt_deplibs_check_method @@ -18096,7 +18196,7 @@ variables_saved_for_relink="$variables_saved_for_relink" link_all_deplibs=$link_all_deplibs_GCJ # Compile-time system search path for libraries -sys_lib_search_path_spec=$lt_sys_lib_search_path_spec +sys_lib_search_path_spec=\`echo $lt_sys_lib_search_path_spec | \$SED -e "s@\${gcc_dir}@\\\${gcc_dir}@g;s@\${gcc_ver}@\\\${gcc_ver}@g"\` # Run-time system search path for libraries sys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec @@ -18348,6 +18448,9 @@ CC=$lt_compiler_RC # Is the compiler the GNU C compiler? with_gcc=$GCC_RC +gcc_dir=\`gcc -print-file-name=. | $SED 's,/\.$,,'\` +gcc_ver=\`gcc -dumpversion\` + # An ERE matcher. EGREP=$lt_EGREP @@ -18481,11 +18584,11 @@ striplib=$lt_striplib # Dependencies to place before the objects being linked to create a # shared library. -predep_objects=$lt_predep_objects_RC +predep_objects=\`echo $lt_predep_objects_RC | \$SED -e "s@\${gcc_dir}@\\\${gcc_dir}@g;s@\${gcc_ver}@\\\${gcc_ver}@g"\` # Dependencies to place after the objects being linked to create a # shared library. -postdep_objects=$lt_postdep_objects_RC +postdep_objects=\`echo $lt_postdep_objects_RC | \$SED -e "s@\${gcc_dir}@\\\${gcc_dir}@g;s@\${gcc_ver}@\\\${gcc_ver}@g"\` # Dependencies to place before the objects being linked to create a # shared library. @@ -18497,7 +18600,7 @@ postdeps=$lt_postdeps_RC # The library search path used internally by the compiler when linking # a shared library. -compiler_lib_search_path=$lt_compiler_lib_search_path_RC +compiler_lib_search_path=\`echo $lt_compiler_lib_search_path_RC | \$SED -e "s@\${gcc_dir}@\\\${gcc_dir}@g;s@\${gcc_ver}@\\\${gcc_ver}@g"\` # Method to check whether dependent libraries are shared objects. deplibs_check_method=$lt_deplibs_check_method @@ -18577,7 +18680,7 @@ variables_saved_for_relink="$variables_saved_for_relink" link_all_deplibs=$link_all_deplibs_RC # Compile-time system search path for libraries -sys_lib_search_path_spec=$lt_sys_lib_search_path_spec +sys_lib_search_path_spec=\`echo $lt_sys_lib_search_path_spec | \$SED -e "s@\${gcc_dir}@\\\${gcc_dir}@g;s@\${gcc_ver}@\\\${gcc_ver}@g"\` # Run-time system search path for libraries sys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec @@ -22915,6 +23018,39 @@ else fi +if test -z "$enable_bitwise" ; then + enable_bitwise=yes # if not set on cmdline, set default +fi +echo "$as_me:$LINENO: checking for --enable-bitwise" >&5 +echo $ECHO_N "checking for --enable-bitwise... $ECHO_C" >&6 +# Check whether --enable-bitwise or --disable-bitwise was given. +if test "${enable_bitwise+set}" = set; then + enableval="$enable_bitwise" + +fi; +if test "$enable_bitwise" = yes ; then + echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6 + +cat >>confdefs.h <<\_ACEOF +#define ENABLE_BITWISE 1 +_ACEOF + +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + + +if test "$enable_bitwise" = "yes"; then + enable_bitwise_TRUE= + enable_bitwise_FALSE='#' +else + enable_bitwise_TRUE='#' + enable_bitwise_FALSE= +fi + + # the default prefix - override with --prefix or --with-fhs @@ -25194,6 +25330,13 @@ echo "$as_me: error: conditional \"enable_ldapi\" was never defined. Usually this means the macro was only invoked conditionally." >&2;} { (exit 1); exit 1; }; } fi +if test -z "${enable_bitwise_TRUE}" && test -z "${enable_bitwise_FALSE}"; then + { { echo "$as_me:$LINENO: error: conditional \"enable_bitwise\" was never defined. +Usually this means the macro was only invoked conditionally." >&5 +echo "$as_me: error: conditional \"enable_bitwise\" was never defined. +Usually this means the macro was only invoked conditionally." >&2;} + { (exit 1); exit 1; }; } +fi if test -z "${WINNT_TRUE}" && test -z "${WINNT_FALSE}"; then { { echo "$as_me:$LINENO: error: conditional \"WINNT\" was never defined. Usually this means the macro was only invoked conditionally." >&5 @@ -25802,6 +25945,7 @@ s,@ac_ct_CC@,$ac_ct_CC,;t t s,@CCDEPMODE@,$CCDEPMODE,;t t s,@am__fastdepCC_TRUE@,$am__fastdepCC_TRUE,;t t s,@am__fastdepCC_FALSE@,$am__fastdepCC_FALSE,;t t +s,@SED@,$SED,;t t s,@EGREP@,$EGREP,;t t s,@LN_S@,$LN_S,;t t s,@ECHO@,$ECHO,;t t @@ -25825,6 +25969,8 @@ s,@enable_dna_TRUE@,$enable_dna_TRUE,;t t s,@enable_dna_FALSE@,$enable_dna_FALSE,;t t s,@enable_ldapi_TRUE@,$enable_ldapi_TRUE,;t t s,@enable_ldapi_FALSE@,$enable_ldapi_FALSE,;t t +s,@enable_bitwise_TRUE@,$enable_bitwise_TRUE,;t t +s,@enable_bitwise_FALSE@,$enable_bitwise_FALSE,;t t s,@configdir@,$configdir,;t t s,@sampledatadir@,$sampledatadir,;t t s,@propertydir@,$propertydir,;t t diff --git a/configure.ac b/configure.ac index d643656b..d0d48e44 100644 --- a/configure.ac +++ b/configure.ac @@ -121,6 +121,21 @@ else fi AM_CONDITIONAL(enable_ldapi,test "$enable_ldapi" = "yes") +if test -z "$enable_bitwise" ; then + enable_bitwise=yes # if not set on cmdline, set default +fi +AC_MSG_CHECKING(for --enable-bitwise) +AC_ARG_ENABLE(bitwise, + AS_HELP_STRING([--enable-bitwise], + [enable the bitwise matching rule plugin (default: yes)])) +if test "$enable_bitwise" = yes ; then + AC_MSG_RESULT(yes) + AC_DEFINE([ENABLE_BITWISE], [1], [enable the bitwise plugin]) +else + AC_MSG_RESULT(no) +fi +AM_CONDITIONAL(enable_bitwise,test "$enable_bitwise" = "yes") + # the default prefix - override with --prefix or --with-fhs AC_PREFIX_DEFAULT([/opt/$PACKAGE_NAME]) diff --git a/ldap/admin/src/create_instance.c b/ldap/admin/src/create_instance.c index 2a75904c..032ef87a 100644 --- a/ldap/admin/src/create_instance.c +++ b/ldap/admin/src/create_instance.c @@ -3122,6 +3122,19 @@ char *ds_gen_confs(char *sroot, server_config_s *cf, char *cs_path) fprintf(f, "nsslapd-pluginarg0: %s/slapd-collations.conf\n", cf->config_dir); fprintf(f, "\n"); +#ifdef ENABLE_BITWISE + fprintf(f, "dn: cn=Bitwise Plugin,cn=plugins,cn=config\n"); + fprintf(f, "objectClass: top\n"); + fprintf(f, "objectClass: nsSlapdPlugin\n"); + fprintf(f, "objectClass: extensibleObject\n"); + fprintf(f, "cn: Bitwise Plugin\n"); + fprintf(f, "nsslapd-pluginPath: %s/libbitwise-plugin%s\n", cf->plugin_dir, shared_lib); + fprintf(f, "nsslapd-pluginInitfunc: bitwise_init\n"); + fprintf(f, "nsslapd-pluginType: matchingRule\n"); + fprintf(f, "nsslapd-pluginEnabled: on\n"); + fprintf(f, "\n"); +#endif + /* The HTTP client plugin */ fprintf(f, "dn: cn=HTTP Client,cn=plugins,cn=config\n"); fprintf(f, "objectclass: top\n"); diff --git a/ldap/servers/plugins/bitwise/bitwise.c b/ldap/servers/plugins/bitwise/bitwise.c new file mode 100644 index 00000000..2ff2a6b3 --- /dev/null +++ b/ldap/servers/plugins/bitwise/bitwise.c @@ -0,0 +1,203 @@ +/** BEGIN COPYRIGHT BLOCK + * 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; version 2 of the License. + * + * 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-1307 USA. + * + * In addition, as a special exception, Red Hat, Inc. gives You the additional + * right to link the code of this Program with code not covered under the GNU + * General Public License ("Non-GPL Code") and to distribute linked combinations + * including the two, subject to the limitations in this paragraph. Non-GPL Code + * permitted under this exception must only link to the code of this Program + * through those well defined interfaces identified in the file named EXCEPTION + * found in the source code files (the "Approved Interfaces"). The files of + * Non-GPL Code may instantiate templates or use macros or inline functions from + * the Approved Interfaces without causing the resulting work to be covered by + * the GNU General Public License. Only Red Hat, Inc. may make changes or + * additions to the list of Approved Interfaces. You must obey the GNU General + * Public License in all respects for all of the Program code and other code used + * in conjunction with the Program except the Non-GPL Code covered by this + * exception. If you modify this file, you may extend this exception to your + * version of the file, but you are not obligated to do so. If you do not wish to + * provide this exception without modification, you must delete this exception + * statement from your version and license this file solely under the GPL without + * exception. + * + * + * Copyright (C) 2007 Red Hat, Inc. + * All rights reserved. + * END COPYRIGHT BLOCK **/ + +#ifdef HAVE_CONFIG_H +# include <config.h> +#endif + +/* orfilter.c - implementation of ordering rule filter */ + +#include <ldap.h> /* LDAP_UTF8INC */ +#include <slap.h> /* for debug macros */ +#include <slapi-plugin.h> /* slapi_berval_cmp, SLAPI_BERVAL_EQ */ + +#ifdef HPUX11 +#include <dl.h> +#endif /* HPUX11 */ + +/* the match function needs the attribute type and value from the search + filter - this is unfortunately not passed into the match fn, so we + have to keep track of this +*/ +struct bitwise_match_cb { + char *type; /* the attribute type from the filter ava */ + struct berval *val; /* the value from the filter ava */ +}; + +/* + The type and val pointers are assumed to have sufficient lifetime - + we don't have to copy them - they are usually just pointers into + the SLAPI_PLUGIN_MR_TYPE and SLAPI_PLUGIN_MR_VALUE fields of the + operation pblock, whose lifetime should encompass the creation + and destruction of the bitwise_match_cb object. +*/ +static struct bitwise_match_cb * +new_bitwise_match_cb(char *type, struct berval *val) +{ + struct bitwise_match_cb *bmc = (struct bitwise_match_cb *)slapi_ch_calloc(1, sizeof(struct bitwise_match_cb)); + bmc->type = type; + bmc->val = val; + + return bmc; +} + +static void +delete_bitwise_match_cb(struct bitwise_match_cb *bmc) +{ + slapi_ch_free((void **)&bmc); +} + +static int +bitwise_filter_destroy(Slapi_PBlock* pb) +{ + void *obj = NULL; + slapi_pblock_get(pb, SLAPI_PLUGIN_OBJECT, &obj); + if (obj) { + struct bitwise_match_cb *bmc = (struct bitwise_match_cb *)obj; + delete_bitwise_match_cb(bmc); + obj = NULL; + slapi_pblock_set(pb, SLAPI_PLUGIN_OBJECT, obj); + } +} + +#define BITWISE_OP_AND 0 +#define BITWISE_OP_OR 1 + +static int +internal_bitwise_filter_match(void* obj, Slapi_Entry* entry, Slapi_Attr* attr, int op) +/* returns: 0 filter matched + * -1 filter did not match + * >0 an LDAP error code + */ +{ + struct bitwise_match_cb *bmc = obj; + unsigned long long a, b; + char *val_from_entry = NULL; + auto int rc = -1; /* no match */ + + val_from_entry = slapi_entry_attr_get_charptr(entry, bmc->type); + if (val_from_entry) { + errno = 0; + a = strtoull(val_from_entry, NULL, 10); + if (errno != ERANGE) { + errno = 0; + b = strtoull(bmc->val->bv_val, NULL, 10); + if (errno == ERANGE) { + rc = LDAP_CONSTRAINT_VIOLATION; + } else { + int result; + if (op == BITWISE_OP_AND) { + result = (a & b); + } else if (op == BITWISE_OP_OR) { + result = (a | b); + } + if (result) { + rc = 0; + } + } + } + slapi_ch_free_string(&val_from_entry); + } + return rc; +} + +static int +bitwise_filter_match_and (void* obj, Slapi_Entry* entry, Slapi_Attr* attr) +/* returns: 0 filter matched + * -1 filter did not match + * >0 an LDAP error code + */ +{ + return internal_bitwise_filter_match(obj, entry, attr, BITWISE_OP_AND); +} + +static int +bitwise_filter_match_or (void* obj, Slapi_Entry* entry, Slapi_Attr* attr) +/* returns: 0 filter matched + * -1 filter did not match + * >0 an LDAP error code + */ +{ + return internal_bitwise_filter_match(obj, entry, attr, BITWISE_OP_OR); +} + +static int +bitwise_filter_create (Slapi_PBlock* pb) +{ + auto int rc = LDAP_UNAVAILABLE_CRITICAL_EXTENSION; /* failed to initialize */ + auto char* mrOID = NULL; + auto char* mrTYPE = NULL; + auto struct berval* mrVALUE = NULL; + + if (!slapi_pblock_get (pb, SLAPI_PLUGIN_MR_OID, &mrOID) && mrOID != NULL && + !slapi_pblock_get (pb, SLAPI_PLUGIN_MR_TYPE, &mrTYPE) && mrTYPE != NULL && + !slapi_pblock_get (pb, SLAPI_PLUGIN_MR_VALUE, &mrVALUE) && mrVALUE != NULL) { + + struct bitwise_match_cb *bmc = new_bitwise_match_cb(mrTYPE, mrVALUE); + slapi_pblock_set (pb, SLAPI_PLUGIN_OBJECT, bmc); + slapi_pblock_set (pb, SLAPI_PLUGIN_DESTROY_FN, (void*)bitwise_filter_destroy); + if (strcmp(mrOID, "1.2.840.113556.1.4.803") == 0) { + slapi_pblock_set (pb, SLAPI_PLUGIN_MR_FILTER_MATCH_FN, (void*)bitwise_filter_match_and); + } else if (strcmp(mrOID, "1.2.840.113556.1.4.804") == 0) { + slapi_pblock_set (pb, SLAPI_PLUGIN_MR_FILTER_MATCH_FN, (void*)bitwise_filter_match_or); + } + rc = LDAP_SUCCESS; + } else { + LDAPDebug (LDAP_DEBUG_FILTER, "=> bitwise_filter_create missing parameter(s)\n", 0, 0, 0); + } + LDAPDebug (LDAP_DEBUG_FILTER, "<= bitwise_filter_create %i\n", rc, 0, 0); + return LDAP_SUCCESS; +} + +static Slapi_PluginDesc pdesc = { "bitwise", PLUGIN_MAGIC_VENDOR_STR, PRODUCTTEXT, + "bitwise match plugin" }; + +int /* LDAP error code */ +bitwise_init (Slapi_PBlock* pb) +{ + int rc; + int argc; + char** argv; + char* cfgpath; + + rc = slapi_pblock_set (pb, SLAPI_PLUGIN_MR_FILTER_CREATE_FN, (void*)bitwise_filter_create); + if ( rc == 0 ) { + rc = slapi_pblock_set( pb, SLAPI_PLUGIN_DESCRIPTION, (void *)&pdesc ); + } + LDAPDebug (LDAP_DEBUG_FILTER, "bitwise_init %i\n", rc, 0, 0); + return rc; +} |