From 4a8ab5dbf2ba037b0824d64bb3217ca06671884a Mon Sep 17 00:00:00 2001 From: Pierangelo Masarati Date: Mon, 8 Apr 2002 09:43:22 +0000 Subject: [PATCH] Mostly based on patches provided by Hallvard B. Furuseth ITS#1677 - cast away const warnings ITS#1678 - unsigned char args to ctype funcs ITS#1682 - don't redefine ldap_debug ITS#1683 - uninitialized vars ITS#1703 - ldo_debug initialization ITS#1705 - unsigned testing ITS#1706 - socklen_t args ITS#1719 - back-tcl update (other cleanups/fixes/improvements; yet untested) ITS#1724 - integerNormalize/integerFilter/integerIndexer bugs ITS#1725 - libdes not required Implement back-null (/dev/null style backend) Cleanup some misc warnings ("%lu" format, unused/uninitialized vars, ambiguous operator precedence) Kurt, please regenerate configure --- clients/tools/ldapwhoami.c | 1 - configure.in | 44 ++++- doc/man/man5/slapd.access.5 | 17 +- doc/man/man5/slapd.conf.5 | 33 +++- doc/man/man8/slapd.8 | 2 +- include/ldap_pvt_uc.h | 6 +- include/portable.h.in | 6 + include/portable.nt | 6 + libraries/liblber/bprint.c | 2 +- libraries/libldap/dntest.c | 4 +- libraries/libldap/ftest.c | 1 - libraries/libldap/getdn.c | 2 +- libraries/libldap/ldap-int.h | 2 +- libraries/libldap/os-ip.c | 6 +- libraries/libldap/os-local.c | 4 +- libraries/libldap/tls.c | 2 +- libraries/libldap/url.c | 4 +- libraries/libldap/utf-8.c | 2 +- libraries/libldif/line64.c | 8 +- libraries/liblutil/entropy.c | 2 +- libraries/librewrite/config.c | 4 +- libraries/librewrite/context.c | 6 +- libraries/librewrite/map.c | 6 +- libraries/librewrite/parse.c | 8 +- libraries/librewrite/session.c | 6 +- libraries/librewrite/subst.c | 2 +- libraries/librewrite/var.c | 4 +- servers/slapd/add.c | 2 +- servers/slapd/back-bdb/cache.c | 2 +- servers/slapd/back-bdb/search.c | 1 - servers/slapd/back-bdb/tools.c | 2 - servers/slapd/back-dnssrv/bind.c | 2 +- servers/slapd/back-dnssrv/config.c | 1 - servers/slapd/back-dnssrv/referral.c | 4 +- servers/slapd/back-dnssrv/search.c | 4 +- servers/slapd/back-ldap/bind.c | 4 +- servers/slapd/back-ldap/config.c | 7 +- servers/slapd/back-ldbm/attribute.c | 7 +- servers/slapd/back-ldbm/modrdn.c | 1 - servers/slapd/back-ldbm/passwd.c | 2 +- servers/slapd/back-meta/search.c | 1 + servers/slapd/back-monitor/README | 36 +++- servers/slapd/back-monitor/backend.c | 2 +- servers/slapd/back-monitor/time.c | 8 +- servers/slapd/back-null/Makefile.in | 26 +++ servers/slapd/back-null/README | 14 ++ servers/slapd/back-null/external.h | 33 ++++ servers/slapd/back-null/null.c | 236 +++++++++++++++++++++++++ servers/slapd/back-tcl/README.back-tcl | 30 ++-- servers/slapd/back-tcl/tcl_abandon.c | 18 +- servers/slapd/back-tcl/tcl_add.c | 26 +-- servers/slapd/back-tcl/tcl_back.h | 21 +-- servers/slapd/back-tcl/tcl_bind.c | 23 +-- servers/slapd/back-tcl/tcl_compare.c | 33 ++-- servers/slapd/back-tcl/tcl_config.c | 21 ++- servers/slapd/back-tcl/tcl_delete.c | 28 +-- servers/slapd/back-tcl/tcl_init.c | 42 +++-- servers/slapd/back-tcl/tcl_modify.c | 65 ++++--- servers/slapd/back-tcl/tcl_modrdn.c | 43 +++-- servers/slapd/back-tcl/tcl_search.c | 42 ++--- servers/slapd/back-tcl/tcl_unbind.c | 22 +-- servers/slapd/back-tcl/tcl_util.c | 39 ++++ servers/slapd/backend.c | 6 + servers/slapd/bind.c | 2 +- servers/slapd/charray.c | 2 +- servers/slapd/compare.c | 6 +- servers/slapd/delete.c | 2 +- servers/slapd/entry.c | 2 +- servers/slapd/limits.c | 4 +- servers/slapd/modify.c | 2 +- servers/slapd/modrdn.c | 2 +- servers/slapd/schema_init.c | 70 +++++++- servers/slapd/search.c | 2 +- servers/slapd/tools/slapadd.c | 3 +- servers/slapd/unbind.c | 2 +- servers/slurpd/ldap_op.c | 8 +- servers/slurpd/ri.c | 2 +- 77 files changed, 876 insertions(+), 277 deletions(-) create mode 100644 servers/slapd/back-null/Makefile.in create mode 100644 servers/slapd/back-null/README create mode 100644 servers/slapd/back-null/external.h create mode 100644 servers/slapd/back-null/null.c diff --git a/clients/tools/ldapwhoami.c b/clients/tools/ldapwhoami.c index fc7c44cee2..d69e35faa4 100644 --- a/clients/tools/ldapwhoami.c +++ b/clients/tools/ldapwhoami.c @@ -93,7 +93,6 @@ main( int argc, char *argv[] ) int use_tls = 0; int referrals = 0; LDAP *ld = NULL; - struct berval *bv = NULL; int id, code = LDAP_OTHER; LDAPMessage *res; diff --git a/configure.in b/configure.in index 68d7e63274..e76123546d 100644 --- a/configure.in +++ b/configure.in @@ -199,6 +199,9 @@ OL_ARG_WITH(meta_module,[ --with-meta-module module type], static, OL_ARG_ENABLE(monitor,[ --enable-monitor enable monitor backend], no)dnl OL_ARG_WITH(monitor_module,[ --with-monitor-module module type], static, [static dynamic]) +OL_ARG_ENABLE(null,[ --enable-null enable null backend], no)dnl +OL_ARG_WITH(null_module,[ --with-null-module module type], static, + [static dynamic]) OL_ARG_ENABLE(passwd,[ --enable-passwd enable passwd backend], no)dnl OL_ARG_WITH(passwd_module,[ --with-passwd-module module type], static, [static dynamic]) @@ -252,6 +255,9 @@ if test $ol_enable_slapd = no ; then if test $ol_enable_monitor = yes ; then AC_MSG_WARN([slapd disabled, ignoring --enable-monitor argument]) fi + if test $ol_enable_null = yes ; then + AC_MSG_WARN([slapd disabled, ignoring --enable-null argument]) + fi if test $ol_enable_passwd = yes ; then AC_MSG_WARN([slapd disabled, ignoring --enable-passwd argument]) fi @@ -309,6 +315,9 @@ dnl fi if test $ol_with_monitor_module != static ; then AC_MSG_WARN([slapd disabled, ignoring --with-monitor-module argument]) fi + if test $ol_with_null_module != static ; then + AC_MSG_WARN([slapd disabled, ignoring --with-null-module argument]) + fi if test $ol_with_passwd_module != static ; then AC_MSG_WARN([slapd disabled, ignoring --with-passwd-module argument]) fi @@ -338,6 +347,7 @@ dnl fi ol_enable_ldbm=no ol_enable_meta=no ol_enable_monitor=no + ol_enable_null=no ol_enable_passwd=no ol_enable_perl=no ol_enable_shell=no @@ -361,6 +371,7 @@ dnl ol_enable_multimaster=no ol_with_ldbm_module=static ol_with_meta_module=static ol_with_monitor_module=static + ol_with_null_module=static ol_with_passwd_module=static ol_with_perl_module=static ol_with_shell_module=static @@ -392,6 +403,7 @@ elif test $ol_enable_ldbm = no ; then $ol_enable_ldap = no -a \ $ol_enable_meta = no -a \ $ol_enable_monitor = no -a \ + $ol_enable_null = no -a \ $ol_enable_passwd = no -a \ $ol_enable_perl = no -a \ $ol_enable_shell = no -a \ @@ -506,6 +518,7 @@ BUILD_LDAP=no BUILD_LDBM=no BUILD_META=no BUILD_MONITOR=no +BUILD_NULL=no BUILD_PASSWD=no BUILD_PERL=no BUILD_SHELL=no @@ -518,6 +531,7 @@ BUILD_LDAP_DYNAMIC=static BUILD_LDBM_DYNAMIC=static BUILD_META_DYNAMIC=static BUILD_MONITOR_DYNAMIC=static +BUILD_NULL_DYNAMIC=static BUILD_PASSWD_DYNAMIC=static BUILD_PERL_DYNAMIC=static BUILD_SHELL_DYNAMIC=static @@ -734,6 +748,7 @@ else ol_with_ldbm_module=static ol_with_meta_module=static ol_with_monitor_module=static + ol_with_null_module=static ol_with_passwd_module=static ol_with_perl_module=static ol_with_shell_module=static @@ -1048,11 +1063,15 @@ if test $ol_with_kerberos = yes -o $ol_with_kerberos = auto \ [-l$krb5crypto -lcom_err]) elif test $krb5_impl = heimdal; then + AC_CHECK_LIB(des, main, + [krb5crypto=des], + [krb5crypto=crypto]) + AC_CHECK_LIB(krb5, main, [have_krb5=yes - KRB5_LIBS="-lkrb5 -ldes -lasn1 -lroken -lcom_err"], + KRB5_LIBS="-lkrb5 -l$krb5crypto -lasn1 -lroken -lcom_err"], [have_krb5=no], - [-ldes -lasn1 -lroken -lcom_err]) + [-l$krb5crypto -lasn1 -lroken -lcom_err]) AC_DEFINE(HAVE_HEIMDAL_KERBEROS, 1, [define if you have HEIMDAL Kerberos]) @@ -1097,7 +1116,7 @@ if test $ol_link_krb5 = yes -a \( $ol_with_kerberos = yes -o \ elif test $krb5_impl = heimdal; then AC_CHECK_LIB(krb4, main, [have_k425=yes KRB4_LIBS="-lkrb4"], [have_k425=no], - [-lkrb5 -ldes -lasn1 -lroken -lcom_err]) + [-lkrb5 -l$krb5crypto -lasn1 -lroken -lcom_err]) else have_425=no @@ -2599,6 +2618,22 @@ if test "$ol_enable_monitor" != no ; then fi fi +if test "$ol_enable_null" != no ; then + AC_DEFINE(SLAPD_NULL,1,[define to support NULL backend]) + BUILD_SLAPD=yes + BUILD_NULL=yes + if test "$ol_with_null_module" != static ; then + AC_DEFINE(SLAPD_NULL_DYNAMIC,1, + [define to support dynamic NULL backend]) + BUILD_NULL=mod + BUILD_NULL_DYNAMIC=shared + SLAPD_MODULES_LIST="$SLAPD_MODULES_LIST -dlopen \$(SLAP_DIR)back-null/back_null.la" + SLAPD_DYNAMIC_BACKENDS="$SLAPD_DYNAMIC_BACKENDS back-null" + else + SLAPD_STATIC_BACKENDS="$SLAPD_STATIC_BACKENDS back-null" + fi +fi + if test "$ol_enable_passwd" != no ; then AC_DEFINE(SLAPD_PASSWD,1,[define to support PASSWD backend]) BUILD_SLAPD=yes @@ -2715,6 +2750,7 @@ AC_SUBST(BUILD_SLAPD) AC_SUBST(BUILD_LDBM) AC_SUBST(BUILD_META) AC_SUBST(BUILD_MONITOR) + AC_SUBST(BUILD_NULL) AC_SUBST(BUILD_PASSWD) AC_SUBST(BUILD_PERL) AC_SUBST(BUILD_SHELL) @@ -2726,6 +2762,7 @@ AC_SUBST(BUILD_SLAPD) AC_SUBST(BUILD_LDBM_DYNAMIC) AC_SUBST(BUILD_META_DYNAMIC) AC_SUBST(BUILD_MONITOR_DYNAMIC) + AC_SUBST(BUILD_NULL_DYNAMIC) AC_SUBST(BUILD_PASSWD_DYNAMIC) AC_SUBST(BUILD_PERL_DYNAMIC) AC_SUBST(BUILD_SHELL_DYNAMIC) @@ -2813,6 +2850,7 @@ servers/slapd/back-ldap/Makefile:build/top.mk:servers/slapd/back-ldap/Makefile.i servers/slapd/back-ldbm/Makefile:build/top.mk:servers/slapd/back-ldbm/Makefile.in:build/mod.mk \ servers/slapd/back-meta/Makefile:build/top.mk:servers/slapd/back-meta/Makefile.in:build/mod.mk \ servers/slapd/back-monitor/Makefile:build/top.mk:servers/slapd/back-monitor/Makefile.in:build/mod.mk \ +servers/slapd/back-null/Makefile:build/top.mk:servers/slapd/back-null/Makefile.in:build/mod.mk \ servers/slapd/back-passwd/Makefile:build/top.mk:servers/slapd/back-passwd/Makefile.in:build/mod.mk \ servers/slapd/back-perl/Makefile:build/top.mk:servers/slapd/back-perl/Makefile.in:build/mod.mk \ servers/slapd/back-shell/Makefile:build/top.mk:servers/slapd/back-shell/Makefile.in:build/mod.mk \ diff --git a/doc/man/man5/slapd.access.5 b/doc/man/man5/slapd.access.5 index b2a0cb8df4..87a97f2bc9 100644 --- a/doc/man/man5/slapd.access.5 +++ b/doc/man/man5/slapd.access.5 @@ -139,13 +139,13 @@ It can have the forms users self - dn[.]= + dn[.[,]]= dnattr= group[/[/]] [.