]> git.sur5r.net Git - openldap/commitdiff
Misc changes from HEAD
authorKurt Zeilenga <kurt@openldap.org>
Mon, 11 Nov 2002 03:42:29 +0000 (03:42 +0000)
committerKurt Zeilenga <kurt@openldap.org>
Mon, 11 Nov 2002 03:42:29 +0000 (03:42 +0000)
44 files changed:
configure
configure.in
include/portable.h.in
libraries/libldbm/ldbm.c
servers/slapd/ad.c
servers/slapd/at.c
servers/slapd/back-bdb/cache.c
servers/slapd/back-bdb/config.c
servers/slapd/back-bdb/idl.c
servers/slapd/back-bdb/init.c
servers/slapd/back-ldap/add.c
servers/slapd/back-ldap/bind.c
servers/slapd/back-ldap/compare.c
servers/slapd/back-ldap/delete.c
servers/slapd/back-ldap/modify.c
servers/slapd/back-ldap/modrdn.c
servers/slapd/back-ldap/search.c
servers/slapd/back-meta/add.c
servers/slapd/back-meta/compare.c
servers/slapd/back-meta/conn.c
servers/slapd/back-meta/delete.c
servers/slapd/back-meta/modify.c
servers/slapd/back-meta/modrdn.c
servers/slapd/back-meta/search.c
servers/slapd/back-sql/config.c
servers/slapd/back-sql/modify.c
servers/slapd/back-sql/other.c
servers/slapd/back-sql/schema-map.c
servers/slapd/back-sql/search.c
servers/slapd/config.c
servers/slapd/cr.c
servers/slapd/filter.c
servers/slapd/main.c
servers/slapd/module.c
servers/slapd/mr.c
servers/slapd/oc.c
servers/slapd/result.c
servers/slapd/root_dse.c
servers/slapd/schema.c
servers/slapd/syntax.c
servers/slapd/value.c
tests/data/rootdse.ldif [new file with mode: 0644]
tests/data/slapd-schema.conf
tests/scripts/test007-replication

index 8d1dca106e19904a155e47fed888f6e68e1525c4..b56165a33c0d07db9de828775145fb048701bb03 100755 (executable)
--- a/configure
+++ b/configure
@@ -1,6 +1,6 @@
 #! /bin/sh
 # $OpenLDAP$
-# from OpenLDAP: pkg/ldap/configure.in,v 1.408.2.22 2002/10/28 19:51:11 kurt Exp  
+# from OpenLDAP: pkg/ldap/configure.in,v 1.408.2.23 2002/10/29 01:38:30 kurt Exp  
 
 # Copyright 1998-2002 The OpenLDAP Foundation.  All Rights Reserved.
 # 
 
 ol_link_sql=no
 if test $ol_enable_sql != no ; then
+       for ac_hdr in sql.h sqlext.h
+do
+ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
+echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
+echo "configure:19262: checking for $ac_hdr" >&5
+if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  cat > conftest.$ac_ext <<EOF
+#line 19267 "configure"
+#include "confdefs.h"
+#include <$ac_hdr>
+EOF
+ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
+{ (eval echo configure:19272: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
+if test -z "$ac_err"; then
+  rm -rf conftest*
+  eval "ac_cv_header_$ac_safe=yes"
+else
+  echo "$ac_err" >&5
+  echo "configure: failed program was:" >&5
+  cat conftest.$ac_ext >&5
+  rm -rf conftest*
+  eval "ac_cv_header_$ac_safe=no"
+fi
+rm -f conftest*
+fi
+if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
+  echo "$ac_t""yes" 1>&6
+    ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
+  cat >> confdefs.h <<EOF
+#define $ac_tr_hdr 1
+EOF
+else
+  echo "$ac_t""no" 1>&6
+{ echo "configure: error: could not locate SQL headers" 1>&2; exit 1; }
+       
+fi
+done
+
+
        echo $ac_n "checking for SQLDriverConnect in -liodbc""... $ac_c" 1>&6
-echo "configure:19259: checking for SQLDriverConnect in -liodbc" >&5
+echo "configure:19302: checking for SQLDriverConnect in -liodbc" >&5
 ac_lib_var=`echo iodbc'_'SQLDriverConnect | sed 'y%./+-:%__p__%'`
 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -19263,7 +19306,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-liodbc  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 19267 "configure"
+#line 19310 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -19274,7 +19317,7 @@ int main() {
 SQLDriverConnect()
 ; return 0; }
 EOF
-if { (eval echo configure:19278: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:19321: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -19299,7 +19342,7 @@ fi
                ol_link_sql="-liodbc"
        else
                echo $ac_n "checking for SQLDriverConnect in -lodbc""... $ac_c" 1>&6
-echo "configure:19303: checking for SQLDriverConnect in -lodbc" >&5
+echo "configure:19346: checking for SQLDriverConnect in -lodbc" >&5
 ac_lib_var=`echo odbc'_'SQLDriverConnect | sed 'y%./+-:%__p__%'`
 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -19307,7 +19350,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lodbc  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 19311 "configure"
+#line 19354 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -19318,7 +19361,7 @@ int main() {
 SQLDriverConnect()
 ; return 0; }
 EOF
-if { (eval echo configure:19322: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:19365: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -19357,17 +19400,17 @@ for ac_hdr in termcap.h ncurses.h
 do
 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:19361: checking for $ac_hdr" >&5
+echo "configure:19404: checking for $ac_hdr" >&5
 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 19366 "configure"
+#line 19409 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:19371: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:19414: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -19396,7 +19439,7 @@ done
 
 if test $ol_link_termcap = no ; then
        echo $ac_n "checking for tputs in -ltermcap""... $ac_c" 1>&6
-echo "configure:19400: checking for tputs in -ltermcap" >&5
+echo "configure:19443: checking for tputs in -ltermcap" >&5
 ac_lib_var=`echo termcap'_'tputs | sed 'y%./+-:%__p__%'`
 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -19404,7 +19447,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-ltermcap  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 19408 "configure"
+#line 19451 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -19415,7 +19458,7 @@ int main() {
 tputs()
 ; return 0; }
 EOF
-if { (eval echo configure:19419: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:19462: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -19448,7 +19491,7 @@ fi
 
 if test $ol_link_termcap = no ; then
        echo $ac_n "checking for initscr in -lncurses""... $ac_c" 1>&6
-echo "configure:19452: checking for initscr in -lncurses" >&5
+echo "configure:19495: checking for initscr in -lncurses" >&5
 ac_lib_var=`echo ncurses'_'initscr | sed 'y%./+-:%__p__%'`
 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -19456,7 +19499,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lncurses  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 19460 "configure"
+#line 19503 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -19467,7 +19510,7 @@ int main() {
 initscr()
 ; return 0; }
 EOF
-if { (eval echo configure:19471: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:19514: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -19513,17 +19556,17 @@ if test $ol_with_cyrus_sasl != no ; then
 do
 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:19517: checking for $ac_hdr" >&5
+echo "configure:19560: checking for $ac_hdr" >&5
 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 19522 "configure"
+#line 19565 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:19527: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:19570: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -19552,7 +19595,7 @@ done
 
        if test $ac_cv_header_sasl_sasl_h = yes -o $ac_cv_header_sasl_h = yes; then
                echo $ac_n "checking for sasl_client_init in -lsasl2""... $ac_c" 1>&6
-echo "configure:19556: checking for sasl_client_init in -lsasl2" >&5
+echo "configure:19599: checking for sasl_client_init in -lsasl2" >&5
 ac_lib_var=`echo sasl2'_'sasl_client_init | sed 'y%./+-:%__p__%'`
 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -19560,7 +19603,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lsasl2  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 19564 "configure"
+#line 19607 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -19571,7 +19614,7 @@ int main() {
 sasl_client_init()
 ; return 0; }
 EOF
-if { (eval echo configure:19575: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:19618: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -19590,7 +19633,7 @@ if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
 else
   echo "$ac_t""no" 1>&6
 echo $ac_n "checking for sasl_client_init in -lsasl""... $ac_c" 1>&6
-echo "configure:19594: checking for sasl_client_init in -lsasl" >&5
+echo "configure:19637: checking for sasl_client_init in -lsasl" >&5
 ac_lib_var=`echo sasl'_'sasl_client_init | sed 'y%./+-:%__p__%'`
 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -19598,7 +19641,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lsasl  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 19602 "configure"
+#line 19645 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -19609,7 +19652,7 @@ int main() {
 sasl_client_init()
 ; return 0; }
 EOF
-if { (eval echo configure:19613: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:19656: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
                fi
        else
                echo $ac_n "checking Cyrus SASL library version""... $ac_c" 1>&6
-echo "configure:19649: checking Cyrus SASL library version" >&5
+echo "configure:19692: checking Cyrus SASL library version" >&5
 if eval "test \"\${ol_cv_sasl_compat+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   
        cat > conftest.$ac_ext <<EOF
-#line 19655 "configure"
+#line 19698 "configure"
 #include "confdefs.h"
 
 #ifdef HAVE_SASL_SASL_H
@@ -19702,12 +19745,12 @@ EOF
                ac_save_LIBS="$LIBS"
                LIBS="$LIBS $ol_link_sasl"
                echo $ac_n "checking for sasl_version""... $ac_c" 1>&6
-echo "configure:19706: checking for sasl_version" >&5
+echo "configure:19749: checking for sasl_version" >&5
 if eval "test \"\${ac_cv_func_sasl_version+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 19711 "configure"
+#line 19754 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char sasl_version(); below.  */
@@ -19731,7 +19774,7 @@ f = sasl_version;
 
 ; return 0; }
 EOF
-if { (eval echo configure:19735: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:19778: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_func_sasl_version=yes"
 else
@@ -19790,13 +19833,13 @@ if test $ol_with_fetch != no ; then
        ol_LIBS=$LIBS
 LIBS="-lfetch -lcom_err $LIBS"
 echo $ac_n "checking fetch(3) library""... $ac_c" 1>&6
-echo "configure:19794: checking fetch(3) library" >&5
+echo "configure:19837: checking fetch(3) library" >&5
 if eval "test \"\${ol_cv_lib_fetch+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   
        cat > conftest.$ac_ext <<EOF
-#line 19800 "configure"
+#line 19843 "configure"
 #include "confdefs.h"
 
 #include <sys/param.h>
@@ -19806,7 +19849,7 @@ int main() {
 struct url *u = fetchParseURL("file:///"); 
 ; return 0; }
 EOF
-if { (eval echo configure:19810: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:19853: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   ol_cv_lib_fetch=yes
 else
@@ -19844,17 +19887,17 @@ if test $ol_with_readline != no ; then
 do
 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:19848: checking for $ac_hdr" >&5
+echo "configure:19891: checking for $ac_hdr" >&5
 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 19853 "configure"
+#line 19896 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:19858: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:19901: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -19885,7 +19928,7 @@ done
                save_LIBS="$LIBS"
                LIBS="$TERMCAP_LIBS $LIBS"
                echo $ac_n "checking for readline in -lreadline""... $ac_c" 1>&6
-echo "configure:19889: checking for readline in -lreadline" >&5
+echo "configure:19932: checking for readline in -lreadline" >&5
 ac_lib_var=`echo readline'_'readline | sed 'y%./+-:%__p__%'`
 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -19893,7 +19936,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lreadline  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 19897 "configure"
+#line 19940 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -19904,7 +19947,7 @@ int main() {
 readline()
 ; return 0; }
 EOF
-if { (eval echo configure:19908: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:19951: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -19949,12 +19992,12 @@ if test $ol_enable_crypt != no ; then
        LIBS="$TLS_LIBS $LIBS"
 
        echo $ac_n "checking for crypt""... $ac_c" 1>&6
-echo "configure:19953: checking for crypt" >&5
+echo "configure:19996: checking for crypt" >&5
 if eval "test \"\${ac_cv_func_crypt+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 19958 "configure"
+#line 20001 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char crypt(); below.  */
@@ -19978,7 +20021,7 @@ f = crypt;
 
 ; return 0; }
 EOF
-if { (eval echo configure:19982: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:20025: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_func_crypt=yes"
 else
@@ -19998,7 +20041,7 @@ else
 
                LIBS="$save_LIBS"
                echo $ac_n "checking for crypt in -lcrypt""... $ac_c" 1>&6
-echo "configure:20002: checking for crypt in -lcrypt" >&5
+echo "configure:20045: checking for crypt in -lcrypt" >&5
 ac_lib_var=`echo crypt'_'crypt | sed 'y%./+-:%__p__%'`
 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -20006,7 +20049,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lcrypt  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 20010 "configure"
+#line 20053 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -20017,7 +20060,7 @@ int main() {
 crypt()
 ; return 0; }
 EOF
-if { (eval echo configure:20021: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:20064: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
 
 if test $ol_enable_proctitle != no ; then
        echo $ac_n "checking for setproctitle""... $ac_c" 1>&6
-echo "configure:20066: checking for setproctitle" >&5
+echo "configure:20109: checking for setproctitle" >&5
 if eval "test \"\${ac_cv_func_setproctitle+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 20071 "configure"
+#line 20114 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char setproctitle(); below.  */
@@ -20091,7 +20134,7 @@ f = setproctitle;
 
 ; return 0; }
 EOF
-if { (eval echo configure:20095: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:20138: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_func_setproctitle=yes"
 else
@@ -20110,7 +20153,7 @@ else
   echo "$ac_t""no" 1>&6
 
                echo $ac_n "checking for setproctitle in -lutil""... $ac_c" 1>&6
-echo "configure:20114: checking for setproctitle in -lutil" >&5
+echo "configure:20157: checking for setproctitle in -lutil" >&5
 ac_lib_var=`echo util'_'setproctitle | sed 'y%./+-:%__p__%'`
 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -20118,7 +20161,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lutil  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 20122 "configure"
+#line 20165 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -20129,7 +20172,7 @@ int main() {
 setproctitle()
 ; return 0; }
 EOF
-if { (eval echo configure:20133: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:20176: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -20169,17 +20212,17 @@ if test $ol_enable_slp != no ; then
 do
 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:20173: checking for $ac_hdr" >&5
+echo "configure:20216: checking for $ac_hdr" >&5
 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 20178 "configure"
+#line 20221 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:20183: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:20226: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -20208,7 +20251,7 @@ done
 
        if test $ac_cv_header_slp_h = yes ; then
                echo $ac_n "checking for SLPOpen in -lslp""... $ac_c" 1>&6
-echo "configure:20212: checking for SLPOpen in -lslp" >&5
+echo "configure:20255: checking for SLPOpen in -lslp" >&5
 ac_lib_var=`echo slp'_'SLPOpen | sed 'y%./+-:%__p__%'`
 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -20216,7 +20259,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lslp  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 20220 "configure"
+#line 20263 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -20227,7 +20270,7 @@ int main() {
 SLPOpen()
 ; return 0; }
 EOF
-if { (eval echo configure:20231: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:20274: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -20262,12 +20305,12 @@ EOF
 fi
 
 echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6
-echo "configure:20266: checking for ANSI C header files" >&5
+echo "configure:20309: checking for ANSI C header files" >&5
 if eval "test \"\${ac_cv_header_stdc+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 20271 "configure"
+#line 20314 "configure"
 #include "confdefs.h"
 #include <stdlib.h>
 #include <stdarg.h>
@@ -20275,7 +20318,7 @@ else
 #include <float.h>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:20279: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:20322: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -20292,7 +20335,7 @@ rm -f conftest*
 if test $ac_cv_header_stdc = yes; then
   # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
 cat > conftest.$ac_ext <<EOF
-#line 20296 "configure"
+#line 20339 "configure"
 #include "confdefs.h"
 #include <string.h>
 EOF
@@ -20310,7 +20353,7 @@ fi
 if test $ac_cv_header_stdc = yes; then
   # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
 cat > conftest.$ac_ext <<EOF
-#line 20314 "configure"
+#line 20357 "configure"
 #include "confdefs.h"
 #include <stdlib.h>
 EOF
@@ -20331,7 +20374,7 @@ if test "$cross_compiling" = yes; then
   :
 else
   cat > conftest.$ac_ext <<EOF
-#line 20335 "configure"
+#line 20378 "configure"
 #include "confdefs.h"
 #include <ctype.h>
 #if ((' ' & 0x0FF) == 0x020)
@@ -20349,7 +20392,7 @@ if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) exit(2);
 exit (0); }
 
 EOF
-if { (eval echo configure:20353: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:20396: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
 then
   :
 else
@@ -20373,12 +20416,12 @@ EOF
 fi
 
 echo $ac_n "checking for mode_t""... $ac_c" 1>&6
-echo "configure:20377: checking for mode_t" >&5
+echo "configure:20420: checking for mode_t" >&5
 if eval "test \"\${ac_cv_type_mode_t+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 20382 "configure"
+#line 20425 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #if STDC_HEADERS
@@ -20409,12 +20452,12 @@ EOF
 fi
 
 echo $ac_n "checking for off_t""... $ac_c" 1>&6
-echo "configure:20413: checking for off_t" >&5
+echo "configure:20456: checking for off_t" >&5
 if eval "test \"\${ac_cv_type_off_t+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 20418 "configure"
+#line 20461 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #if STDC_HEADERS
@@ -20445,12 +20488,12 @@ EOF
 fi
 
 echo $ac_n "checking for pid_t""... $ac_c" 1>&6
-echo "configure:20449: checking for pid_t" >&5
+echo "configure:20492: checking for pid_t" >&5
 if eval "test \"\${ac_cv_type_pid_t+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 20454 "configure"
+#line 20497 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #if STDC_HEADERS
@@ -20481,19 +20524,19 @@ EOF
 fi
 
 echo $ac_n "checking for ptrdiff_t""... $ac_c" 1>&6
-echo "configure:20485: checking for ptrdiff_t" >&5
+echo "configure:20528: checking for ptrdiff_t" >&5
 if eval "test \"\${am_cv_type_ptrdiff_t+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 20490 "configure"
+#line 20533 "configure"
 #include "confdefs.h"
 #include <stddef.h>
 int main() {
 ptrdiff_t p
 ; return 0; }
 EOF
-if { (eval echo configure:20497: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:20540: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   am_cv_type_ptrdiff_t=yes
 else
@@ -20514,12 +20557,12 @@ EOF
    fi
 
 echo $ac_n "checking return type of signal handlers""... $ac_c" 1>&6
-echo "configure:20518: checking return type of signal handlers" >&5
+echo "configure:20561: checking return type of signal handlers" >&5
 if eval "test \"\${ac_cv_type_signal+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 20523 "configure"
+#line 20566 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #include <signal.h>
@@ -20536,7 +20579,7 @@ int main() {
 int i;
 ; return 0; }
 EOF
-if { (eval echo configure:20540: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:20583: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ac_cv_type_signal=void
 else
@@ -20555,12 +20598,12 @@ EOF
 
 
 echo $ac_n "checking for size_t""... $ac_c" 1>&6
-echo "configure:20559: checking for size_t" >&5
+echo "configure:20602: checking for size_t" >&5
 if eval "test \"\${ac_cv_type_size_t+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 20564 "configure"
+#line 20607 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #if STDC_HEADERS
 
 
 echo $ac_n "checking for ssize_t""... $ac_c" 1>&6
-echo "configure:20596: checking for ssize_t" >&5
+echo "configure:20639: checking for ssize_t" >&5
 if eval "test \"\${ac_cv_type_ssize_t+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 20601 "configure"
+#line 20644 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #if STDC_HEADERS
@@ -20628,12 +20671,12 @@ EOF
 fi
 
 echo $ac_n "checking for caddr_t""... $ac_c" 1>&6
-echo "configure:20632: checking for caddr_t" >&5
+echo "configure:20675: checking for caddr_t" >&5
 if eval "test \"\${ac_cv_type_caddr_t+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 20637 "configure"
+#line 20680 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #if STDC_HEADERS
 
 
 echo $ac_n "checking for socklen_t""... $ac_c" 1>&6
-echo "configure:20669: checking for socklen_t" >&5
+echo "configure:20712: checking for socklen_t" >&5
 if eval "test \"\${ol_cv_type_socklen_t+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 20674 "configure"
+#line 20717 "configure"
 #include "confdefs.h"
 
 #ifdef HAVE_SYS_TYPES_H
@@ -20684,7 +20727,7 @@ int main() {
 socklen_t len;
 ; return 0; }
 EOF
-if { (eval echo configure:20688: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:20731: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ol_cv_type_socklen_t=yes
 else
@@ -20705,12 +20748,12 @@ EOF
   fi
  
 echo $ac_n "checking for member st_blksize in aggregate type struct stat""... $ac_c" 1>&6
-echo "configure:20709: checking for member st_blksize in aggregate type struct stat" >&5
+echo "configure:20752: checking for member st_blksize in aggregate type struct stat" >&5
 if eval "test \"\${ac_cv_c_struct_member_st_blksize+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 20714 "configure"
+#line 20757 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #include <sys/stat.h>
@@ -20718,7 +20761,7 @@ int main() {
 struct stat foo; foo.st_blksize;
 ; return 0; }
 EOF
-if { (eval echo configure:20722: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:20765: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ac_cv_c_struct_member_st_blksize=yes
 else
@@ -20740,12 +20783,12 @@ EOF
 fi
 
 echo $ac_n "checking whether time.h and sys/time.h may both be included""... $ac_c" 1>&6
-echo "configure:20744: checking whether time.h and sys/time.h may both be included" >&5
+echo "configure:20787: checking whether time.h and sys/time.h may both be included" >&5
 if eval "test \"\${ac_cv_header_time+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 20749 "configure"
+#line 20792 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #include <sys/time.h>
@@ -20754,7 +20797,7 @@ int main() {
 struct tm *tp;
 ; return 0; }
 EOF
-if { (eval echo configure:20758: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:20801: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ac_cv_header_time=yes
 else
@@ -20775,12 +20818,12 @@ EOF
 fi
 
 echo $ac_n "checking whether struct tm is in sys/time.h or time.h""... $ac_c" 1>&6
-echo "configure:20779: checking whether struct tm is in sys/time.h or time.h" >&5
+echo "configure:20822: checking whether struct tm is in sys/time.h or time.h" >&5
 if eval "test \"\${ac_cv_struct_tm+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 20784 "configure"
+#line 20827 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #include <time.h>
@@ -20788,7 +20831,7 @@ int main() {
 struct tm *tp; tp->tm_sec;
 ; return 0; }
 EOF
-if { (eval echo configure:20792: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:20835: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ac_cv_struct_tm=time.h
 else
@@ -20809,12 +20852,12 @@ EOF
 fi
 
 echo $ac_n "checking for uid_t in sys/types.h""... $ac_c" 1>&6
-echo "configure:20813: checking for uid_t in sys/types.h" >&5
+echo "configure:20856: checking for uid_t in sys/types.h" >&5
 if eval "test \"\${ac_cv_type_uid_t+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 20818 "configure"
+#line 20861 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 EOF
@@ -20843,19 +20886,19 @@ EOF
 fi
 
 echo $ac_n "checking for sig_atomic_t""... $ac_c" 1>&6
-echo "configure:20847: checking for sig_atomic_t" >&5
+echo "configure:20890: checking for sig_atomic_t" >&5
 if eval "test \"\${ol_cv_type_sig_atomic_t+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 20852 "configure"
+#line 20895 "configure"
 #include "confdefs.h"
 #include <signal.h>
 int main() {
 sig_atomic_t atomic;
 ; return 0; }
 EOF
-if { (eval echo configure:20859: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:20902: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ol_cv_type_sig_atomic_t=yes
 else
@@ -20879,13 +20922,13 @@ EOF
 
 # test for pw_gecos in struct passwd
 echo $ac_n "checking struct passwd for pw_gecos""... $ac_c" 1>&6
-echo "configure:20883: checking struct passwd for pw_gecos" >&5
+echo "configure:20926: checking struct passwd for pw_gecos" >&5
 if eval "test \"\${ol_cv_struct_passwd_pw_gecos+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   
        cat > conftest.$ac_ext <<EOF
-#line 20889 "configure"
+#line 20932 "configure"
 #include "confdefs.h"
 #include <pwd.h>
 int main() {
@@ -20895,7 +20938,7 @@ int main() {
 
 ; return 0; }
 EOF
-if { (eval echo configure:20899: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:20942: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ol_cv_struct_passwd_pw_gecos=yes
 else
 
 # test for pw_passwd in struct passwd
 echo $ac_n "checking struct passwd for pw_passwd""... $ac_c" 1>&6
-echo "configure:20921: checking struct passwd for pw_passwd" >&5
+echo "configure:20964: checking struct passwd for pw_passwd" >&5
 if eval "test \"\${ol_cv_struct_passwd_pw_passwd+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   
        cat > conftest.$ac_ext <<EOF
-#line 20927 "configure"
+#line 20970 "configure"
 #include "confdefs.h"
 #include <pwd.h>
 int main() {
@@ -20933,7 +20976,7 @@ int main() {
 
 ; return 0; }
 EOF
-if { (eval echo configure:20937: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:20980: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ol_cv_struct_passwd_pw_passwd=yes
 else
@@ -20955,7 +20998,7 @@ fi
 
 
 echo $ac_n "checking if toupper() requires islower()""... $ac_c" 1>&6
-echo "configure:20959: checking if toupper() requires islower()" >&5
+echo "configure:21002: checking if toupper() requires islower()" >&5
 if eval "test \"\${ol_cv_c_upper_lower+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -20964,7 +21007,7 @@ else
   ol_cv_c_upper_lower=safe
 else
   cat > conftest.$ac_ext <<EOF
-#line 20968 "configure"
+#line 21011 "configure"
 #include "confdefs.h"
 
 #include <ctype.h>
@@ -20976,7 +21019,7 @@ main()
                exit(1);
 }
 EOF
-if { (eval echo configure:20980: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:21023: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
 then
   ol_cv_c_upper_lower=no
 else
@@ -20999,12 +21042,12 @@ EOF
 fi
 
 echo $ac_n "checking for working const""... $ac_c" 1>&6
-echo "configure:21003: checking for working const" >&5
+echo "configure:21046: checking for working const" >&5
 if eval "test \"\${ac_cv_c_const+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 21008 "configure"
+#line 21051 "configure"
 #include "confdefs.h"
 
 int main() {
@@ -21053,7 +21096,7 @@ ccp = (char const *const *) p;
 
 ; return 0; }
 EOF
-if { (eval echo configure:21057: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:21100: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ac_cv_c_const=yes
 else
@@ -21074,12 +21117,12 @@ EOF
 fi
 
 echo $ac_n "checking if compiler understands volatile""... $ac_c" 1>&6
-echo "configure:21078: checking if compiler understands volatile" >&5
+echo "configure:21121: checking if compiler understands volatile" >&5
 if eval "test \"\${ol_cv_c_volatile+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 21083 "configure"
+#line 21126 "configure"
 #include "confdefs.h"
 int x, y, z;
 int main() {
@@ -21088,7 +21131,7 @@ volatile int a; int * volatile b = x ? &y : &z;
       *b = 0;
 ; return 0; }
 EOF
-if { (eval echo configure:21092: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:21135: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ol_cv_c_volatile=yes
 else
@@ -21118,14 +21161,14 @@ EOF
 
 else
        echo $ac_n "checking whether byte ordering is bigendian""... $ac_c" 1>&6
-echo "configure:21122: checking whether byte ordering is bigendian" >&5
+echo "configure:21165: checking whether byte ordering is bigendian" >&5
 if eval "test \"\${ac_cv_c_bigendian+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   ac_cv_c_bigendian=unknown
 # See if sys/param.h defines the BYTE_ORDER macro.
 cat > conftest.$ac_ext <<EOF
-#line 21129 "configure"
+#line 21172 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #include <sys/param.h>
@@ -21136,11 +21179,11 @@ int main() {
 #endif
 ; return 0; }
 EOF
-if { (eval echo configure:21140: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:21183: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   # It does; now see whether it defined to BIG_ENDIAN or not.
 cat > conftest.$ac_ext <<EOF
-#line 21144 "configure"
+#line 21187 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #include <sys/param.h>
@@ -21151,7 +21194,7 @@ int main() {
 #endif
 ; return 0; }
 EOF
-if { (eval echo configure:21155: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:21198: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ac_cv_c_bigendian=yes
 else
@@ -21171,7 +21214,7 @@ if test "$cross_compiling" = yes; then
     { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; }
 else
   cat > conftest.$ac_ext <<EOF
-#line 21175 "configure"
+#line 21218 "configure"
 #include "confdefs.h"
 main () {
   /* Are we little or big endian?  From Harbison&Steele.  */
@@ -21184,7 +21227,7 @@ main () {
   exit (u.c[sizeof (long) - 1] == 1);
 }
 EOF
-if { (eval echo configure:21188: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:21231: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
 then
   ac_cv_c_bigendian=no
 else
 fi
 
 echo $ac_n "checking size of short""... $ac_c" 1>&6
-echo "configure:21214: checking size of short" >&5 
+echo "configure:21257: checking size of short" >&5 
 if eval "test \"\${ac_cv_sizeof_short+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   for ac_size in 4 8 1 2 16  ; do # List sizes in rough order of prevalence. 
   cat > conftest.$ac_ext <<EOF
-#line 21220 "configure"
+#line 21263 "configure"
 #include "confdefs.h"
 #include "confdefs.h" 
 #include <sys/types.h> 
@@ -21226,7 +21269,7 @@ int main() {
 switch (0) case 0: case (sizeof (short) == $ac_size):;
 ; return 0; }
 EOF
-if { (eval echo configure:21230: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:21273: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ac_cv_sizeof_short=$ac_size
 else
@@ -21249,13 +21292,13 @@ EOF
  
  
 echo $ac_n "checking size of int""... $ac_c" 1>&6
-echo "configure:21253: checking size of int" >&5 
+echo "configure:21296: checking size of int" >&5 
 if eval "test \"\${ac_cv_sizeof_int+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   for ac_size in 4 8 1 2 16  ; do # List sizes in rough order of prevalence. 
   cat > conftest.$ac_ext <<EOF
-#line 21259 "configure"
+#line 21302 "configure"
 #include "confdefs.h"
 #include "confdefs.h" 
 #include <sys/types.h> 
@@ -21265,7 +21308,7 @@ int main() {
 switch (0) case 0: case (sizeof (int) == $ac_size):;
 ; return 0; }
 EOF
-if { (eval echo configure:21269: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:21312: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ac_cv_sizeof_int=$ac_size
 else
@@ -21288,13 +21331,13 @@ EOF
  
  
 echo $ac_n "checking size of long""... $ac_c" 1>&6
-echo "configure:21292: checking size of long" >&5 
+echo "configure:21335: checking size of long" >&5 
 if eval "test \"\${ac_cv_sizeof_long+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   for ac_size in 4 8 1 2 16  ; do # List sizes in rough order of prevalence. 
   cat > conftest.$ac_ext <<EOF
-#line 21298 "configure"
+#line 21341 "configure"
 #include "confdefs.h"
 #include "confdefs.h" 
 #include <sys/types.h> 
@@ -21304,7 +21347,7 @@ int main() {
 switch (0) case 0: case (sizeof (long) == $ac_size):;
 ; return 0; }
 EOF
-if { (eval echo configure:21308: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:21351: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ac_cv_sizeof_long=$ac_size
 else
@@ -21355,7 +21398,7 @@ EOF
 
 
 echo $ac_n "checking for 8-bit clean memcmp""... $ac_c" 1>&6
-echo "configure:21359: checking for 8-bit clean memcmp" >&5
+echo "configure:21402: checking for 8-bit clean memcmp" >&5
 if eval "test \"\${ac_cv_func_memcmp_clean+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -21363,7 +21406,7 @@ else
   ac_cv_func_memcmp_clean=no
 else
   cat > conftest.$ac_ext <<EOF
-#line 21367 "configure"
+#line 21410 "configure"
 #include "confdefs.h"
 
 main()
@@ -21373,7 +21416,7 @@ main()
 }
 
 EOF
-if { (eval echo configure:21377: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:21420: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
 then
   ac_cv_func_memcmp_clean=yes
 else
@@ -21391,12 +21434,12 @@ echo "$ac_t""$ac_cv_func_memcmp_clean" 1>&6
 test $ac_cv_func_memcmp_clean = no && LIBOBJS="$LIBOBJS memcmp.${ac_objext}"
 
 echo $ac_n "checking for strftime""... $ac_c" 1>&6
-echo "configure:21395: checking for strftime" >&5
+echo "configure:21438: checking for strftime" >&5
 if eval "test \"\${ac_cv_func_strftime+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 21400 "configure"
+#line 21443 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char strftime(); below.  */
@@ -21420,7 +21463,7 @@ f = strftime;
 
 ; return 0; }
 EOF
-if { (eval echo configure:21424: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:21467: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_func_strftime=yes"
 else
@@ -21442,7 +21485,7 @@ else
   echo "$ac_t""no" 1>&6
 # strftime is in -lintl on SCO UNIX.
 echo $ac_n "checking for strftime in -lintl""... $ac_c" 1>&6
-echo "configure:21446: checking for strftime in -lintl" >&5
+echo "configure:21489: checking for strftime in -lintl" >&5
 ac_lib_var=`echo intl'_'strftime | sed 'y%./+-:%__p__%'`
 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -21450,7 +21493,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lintl  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 21454 "configure"
+#line 21497 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -21461,7 +21504,7 @@ int main() {
 strftime()
 ; return 0; }
 EOF
-if { (eval echo configure:21465: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:21508: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
 
 
 echo $ac_n "checking for inet_aton()""... $ac_c" 1>&6
-echo "configure:21493: checking for inet_aton()" >&5
+echo "configure:21536: checking for inet_aton()" >&5
 if eval "test \"\${ol_cv_func_inet_aton+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 21498 "configure"
+#line 21541 "configure"
 #include "confdefs.h"
 
 #ifdef HAVE_SYS_TYPES_H
@@ -21516,7 +21559,7 @@ struct in_addr in;
 int rc = inet_aton( "255.255.255.255", &in );
 ; return 0; }
 EOF
-if { (eval echo configure:21520: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:21563: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   ol_cv_func_inet_aton=yes
 else
@@ -21538,12 +21581,12 @@ EOF
  
 
 echo $ac_n "checking for _spawnlp""... $ac_c" 1>&6
-echo "configure:21542: checking for _spawnlp" >&5
+echo "configure:21585: checking for _spawnlp" >&5
 if eval "test \"\${ac_cv_func__spawnlp+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 21547 "configure"
+#line 21590 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char _spawnlp(); below.  */
@@ -21567,7 +21610,7 @@ f = _spawnlp;
 
 ; return 0; }
 EOF
-if { (eval echo configure:21571: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:21614: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_func__spawnlp=yes"
 else
 
 
 echo $ac_n "checking for _snprintf""... $ac_c" 1>&6
-echo "configure:21595: checking for _snprintf" >&5
+echo "configure:21638: checking for _snprintf" >&5
 if eval "test \"\${ac_cv_func__snprintf+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 21600 "configure"
+#line 21643 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char _snprintf(); below.  */
@@ -21620,7 +21663,7 @@ f = _snprintf;
 
 ; return 0; }
 EOF
-if { (eval echo configure:21624: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:21667: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_func__snprintf=yes"
 else
 
 
 echo $ac_n "checking for _vsnprintf""... $ac_c" 1>&6
-echo "configure:21650: checking for _vsnprintf" >&5
+echo "configure:21693: checking for _vsnprintf" >&5
 if eval "test \"\${ac_cv_func__vsnprintf+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 21655 "configure"
+#line 21698 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char _vsnprintf(); below.  */
@@ -21675,7 +21718,7 @@ f = _vsnprintf;
 
 ; return 0; }
 EOF
-if { (eval echo configure:21679: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:21722: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_func__vsnprintf=yes"
 else
 
 
 echo $ac_n "checking for vprintf""... $ac_c" 1>&6
-echo "configure:21705: checking for vprintf" >&5
+echo "configure:21748: checking for vprintf" >&5
 if eval "test \"\${ac_cv_func_vprintf+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 21710 "configure"
+#line 21753 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char vprintf(); below.  */
@@ -21730,7 +21773,7 @@ f = vprintf;
 
 ; return 0; }
 EOF
-if { (eval echo configure:21734: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:21777: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_func_vprintf=yes"
 else
 
 if test "$ac_cv_func_vprintf" != yes; then
 echo $ac_n "checking for _doprnt""... $ac_c" 1>&6
-echo "configure:21758: checking for _doprnt" >&5
+echo "configure:21801: checking for _doprnt" >&5
 if eval "test \"\${ac_cv_func__doprnt+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 21763 "configure"
+#line 21806 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char _doprnt(); below.  */
@@ -21783,7 +21826,7 @@ f = _doprnt;
 
 ; return 0; }
 EOF
-if { (eval echo configure:21787: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:21830: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_func__doprnt=yes"
 else
@@ -21812,12 +21855,12 @@ if test $ac_cv_func_vprintf = yes ; then
                for ac_func in snprintf vsnprintf
 do
 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:21816: checking for $ac_func" >&5
+echo "configure:21859: checking for $ac_func" >&5
 if eval "test \"\${ac_cv_func_$ac_func+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 21821 "configure"
+#line 21864 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char $ac_func(); below.  */
@@ -21841,7 +21884,7 @@ f = $ac_func;
 
 ; return 0; }
 EOF
-if { (eval echo configure:21845: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:21888: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_func_$ac_func=yes"
 else
@@ -21923,12 +21966,12 @@ for ac_func in \
 
 do
 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:21927: checking for $ac_func" >&5
+echo "configure:21970: checking for $ac_func" >&5
 if eval "test \"\${ac_cv_func_$ac_func+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 21932 "configure"
+#line 21975 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char $ac_func(); below.  */
@@ -21952,7 +21995,7 @@ f = $ac_func;
 
 ; return 0; }
 EOF
-if { (eval echo configure:21956: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:21999: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_func_$ac_func=yes"
 else
@@ -21980,12 +22023,12 @@ done
 for ac_func in getopt
 do
 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:21984: checking for $ac_func" >&5
+echo "configure:22027: checking for $ac_func" >&5
 if eval "test \"\${ac_cv_func_$ac_func+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 21989 "configure"
+#line 22032 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char $ac_func(); below.  */
@@ -22009,7 +22052,7 @@ f = $ac_func;
 
 ; return 0; }
 EOF
-if { (eval echo configure:22013: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:22056: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_func_$ac_func=yes"
 else
 
 # Check Configuration
 echo $ac_n "checking declaration of sys_errlist""... $ac_c" 1>&6
-echo "configure:22060: checking declaration of sys_errlist" >&5
+echo "configure:22103: checking declaration of sys_errlist" >&5
 if eval "test \"\${ol_cv_dcl_sys_errlist+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   
        cat > conftest.$ac_ext <<EOF
-#line 22066 "configure"
+#line 22109 "configure"
 #include "confdefs.h"
 
 #include <stdio.h>
@@ -22075,7 +22118,7 @@ int main() {
 char *c = (char *) *sys_errlist
 ; return 0; }
 EOF
-if { (eval echo configure:22079: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:22122: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ol_cv_dcl_sys_errlist=yes
        ol_cv_have_sys_errlist=yes
@@ -22098,20 +22141,20 @@ EOF
 
 
        echo $ac_n "checking existence of sys_errlist""... $ac_c" 1>&6
-echo "configure:22102: checking existence of sys_errlist" >&5
+echo "configure:22145: checking existence of sys_errlist" >&5
 if eval "test \"\${ol_cv_have_sys_errlist+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   
                cat > conftest.$ac_ext <<EOF
-#line 22108 "configure"
+#line 22151 "configure"
 #include "confdefs.h"
 #include <errno.h>
 int main() {
 char *c = (char *) *sys_errlist
 ; return 0; }
 EOF
-if { (eval echo configure:22115: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:22158: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   ol_cv_have_sys_errlist=yes
 else
index 0660fd59e4987e506115997731f00e25130879db..3a1a9a15cf7f4a9faf5d0bf5510d906b94a43cd6 100644 (file)
@@ -2077,6 +2077,10 @@ dnl ----------------------------------------------------------------
 dnl SQL
 ol_link_sql=no
 if test $ol_enable_sql != no ; then
+       AC_CHECK_HEADERS(sql.h sqlext.h,[],[
+               AC_MSG_ERROR([could not locate SQL headers])
+       ])
+
        AC_CHECK_LIB(iodbc,SQLDriverConnect,[have_iodbc=yes],[have_iodbc=no])
        if test $have_iodbc = yes ; then
                ol_link_sql="-liodbc"
index faca16fac561654a15c868b0b67b3acd0157a891..93942cd0c8683c1b95288eac5f9b1242eb37a239 100644 (file)
 /* Define if you have the <slp.h> header file.  */
 #undef HAVE_SLP_H
 
+/* Define if you have the <sql.h> header file.  */
+#undef HAVE_SQL_H
+
+/* Define if you have the <sqlext.h> header file.  */
+#undef HAVE_SQLEXT_H
+
 /* Define if you have the <ssl.h> header file.  */
 #undef HAVE_SSL_H
 
index 31c845416f9702ee40d58d901d4b3fc088c5ad82..111ba97e627dbc56cc14ebc24db230feebb7711e 100644 (file)
@@ -91,6 +91,12 @@ static ldap_pvt_thread_mutex_t ldbm_big_mutex;
 DB_ENV *ldbm_Env = NULL;       /* real or fake, depending on db and version */
 #endif
 
+/* Let's make the version comparisons a little easier... */
+#undef DB_VERSION_X
+#ifdef HAVE_BERKELEY_DB
+#define        DB_VERSION_X    ((DB_VERSION_MAJOR<<16)|(DB_VERSION_MINOR<<8)|DB_VERSION_PATCH)
+#endif
+
 /*******************************************************************
  *                                                                 *
  *  Create some special functions to initialize Berkeley DB for    *
@@ -231,7 +237,7 @@ DB_ENV *ldbm_initialize_env(const char *home, int dbcachesize, int *envdirok)
                return NULL;
        }
 
-#if DB_VERSION_MAJOR > 3 || DB_VERSION_MINOR >= 3
+#if DB_VERSION_X >= 0x030300
        /* This interface appeared in 3.3 */
        env->set_alloc( env, ldbm_malloc, NULL, NULL );
 #endif
@@ -253,7 +259,7 @@ DB_ENV *ldbm_initialize_env(const char *home, int dbcachesize, int *envdirok)
        envFlags |= DB_THREAD;
 #endif
 
-#if DB_VERSION_MAJOR > 3 || DB_VERSION_MINOR > 0
+#if DB_VERSION_X >= 0x030100
        err = env->open( env, home, envFlags, 0 );
 #else
        /* 3.0.x requires an extra argument */
@@ -321,7 +327,7 @@ ldbm_open( DB_ENV *env, char *name, int rw, int mode, int dbcachesize )
                return NULL;
        }
 
-#if DB_VERSION_MAJOR == 3 && DB_VERSION_MINOR < 3
+#if DB_VERSION_X < 0x030300
        ret->set_malloc( ret, ldbm_malloc );
 #endif
 
@@ -335,7 +341,7 @@ ldbm_open( DB_ENV *env, char *name, int rw, int mode, int dbcachesize )
        __atoe(n2);
        name = n2;
 #endif
-#if DB_VERSION_MAJOR >= 4 && DB_VERSION_MINOR > 0 && DB_VERSION_PATCH >= 17
+#if DB_VERSION_X >= 0x040111
        err = ret->open( ret, NULL, name, NULL, DB_TYPE, rw, mode);
 #else
        err = ret->open( ret, name, NULL, DB_TYPE, rw, mode);
@@ -514,7 +520,7 @@ ldbm_firstkey( LDBM ldbm, LDBMCursor **dbch )
        LDBM_RLOCK;
 
        /* acquire a cursor for the DB */
-# if DB_VERSION_MAJOR >= 3 || (DB_VERSION_MAJOR == 2 && DB_VERSION_MINOR > 5)
+# if DB_VERSION_X >= 0x020600
        rc = ldbm->cursor( ldbm, NULL, &dbci, 0 );
 # else
        rc = ldbm->cursor( ldbm, NULL, &dbci );
index f7fa76241b870f1b1597dbf05010459935852814..9740fb0fdf0468d093a9e9a54b19a8bfc922acf8 100644 (file)
@@ -601,8 +601,16 @@ an_find(
        return( 0 );
 }
 
-/* Convert a delimited string into a list of AttributeNames; Add on
- * to an existing list if it was given.
+/*
+ * Convert a delimited string into a list of AttributeNames; 
+ * add on to an existing list if it was given.  If the string
+ * is not a valid attribute name, if a '-' is prepended it is 
+ * skipped and the remaining name is tried again; if a '+' is
+ * prepended, an objectclass name is searched instead.
+ * 
+ * NOTE: currently, if a valid attribute name is not found,
+ * the same string is also checked as valid objectclass name;
+ * however, this behavior is deprecated.
  */
 AttributeName *
 str2anlist( AttributeName *an, char *in, const char *brkstr )
@@ -647,11 +655,15 @@ str2anlist( AttributeName *an, char *in, const char *brkstr )
                                        slap_bv2ad(&adname, &anew->an_desc, &text);
                                        if ( !anew->an_desc ) {
                                                free( an );
-                                               /* overwrites input string on error! */
+                                               /*
+                                                * overwrites input string
+                                                * on error!
+                                                */
                                                strcpy( in, s );
                                                return NULL;
                                        }
                                } break;
+
                        case '+': {
                                        struct berval ocname;
                                        ocname.bv_len = anew->an_name.bv_len - 1;
@@ -659,11 +671,15 @@ str2anlist( AttributeName *an, char *in, const char *brkstr )
                                        anew->an_oc = oc_bvfind( &ocname );
                                        if ( !anew->an_oc ) {
                                                free( an );
-                                               /* overwrites input string on error! */
+                                               /*
+                                                * overwrites input string
+                                                * on error!
+                                                */
                                                strcpy( in, s );
                                                return NULL;
                                        }
                                } break;
+
                        default:
                                /* old (deprecated) way */
                                anew->an_oc = oc_bvfind( &anew->an_name );
index 988cfb9f0c8e6f39014d752f661b39ce1eb42dcf..87d174ca9d47f049b6d8ce3b7fbc78d5896ff8bc 100644 (file)
@@ -605,7 +605,8 @@ at_schema_info( Entry *e )
                        return -1;
                }
 
-               attr_merge( e, ad_attributeTypes, vals );
+               if( attr_merge( e, ad_attributeTypes, vals ) )
+                       return -1;
                ldap_memfree( vals[0].bv_val );
        }
        return 0;
index a2e43e0db9545dd2142a3d407a998d8adec30904..ab0cec701cae25978bcb42362e81f40579b4940f 100644 (file)
@@ -45,6 +45,7 @@ static int    bdb_cache_delete_entry_internal(Cache *cache, Entry *e);
 static void    bdb_lru_print(Cache *cache);
 #endif
 
+#if 0  /* unused */
 static int
 bdb_cache_entry_rdwr_lock(Entry *e, int rw)
 {
@@ -98,6 +99,7 @@ bdb_cache_entry_rdwr_unlock(Entry *e, int rw)
        else
                return ldap_pvt_thread_rdwr_runlock(&BEI(e)->bei_rdwr);
 }
+#endif /* unused */
 
 static int
 bdb_cache_entry_rdwr_init(Entry *e)
index f5aee6dedb8aa7a3666c5e4dcb0301f63678bf65..90f99672f38a5cc71f6ce3a5b9baf5649f577f65 100644 (file)
@@ -126,7 +126,7 @@ bdb_db_config(
                if( rc != LDAP_SUCCESS ) return 1;
 
        /* size of the cache in entries */
-         } else if ( strcasecmp( argv[0], "cachesize" ) == 0 ) {
+        } else if ( strcasecmp( argv[0], "cachesize" ) == 0 ) {
                  if ( argc < 2 ) {
                          fprintf( stderr,
                  "%s: line %d: missing size in \"cachesize <size>\" line\n",
index ecc856cb0e41bc01bc7a02a702991b3ec2432aba..e450a7c9c793f54ea1660106f95cea31b5d6cba9 100644 (file)
@@ -185,6 +185,7 @@ int bdb_idl_insert( ID *ids, ID id )
        return 0;
 }
 
+#if 0  /* unused */
 static int idl_delete( ID *ids, ID id )
 {
        unsigned x = bdb_idl_search( ids, id );
@@ -228,6 +229,7 @@ static int idl_delete( ID *ids, ID id )
 
        return 0;
 }
+#endif /* unused */
 
 static char *
 bdb_show_key(
index aa956d2b1e31049f10393a310913e3af98829cef..e61cb9bda9ade479ba77a60c278a340ad8c89bff 100644 (file)
@@ -37,13 +37,13 @@ struct berval bdb_uuid = { 0, NULL };
 typedef void * db_malloc(size_t);
 typedef void * db_realloc(void *, size_t);
 
+#if 0
 static int
 bdb_open( BackendInfo *bi )
 {
        return 0;
 }
 
-#if 0
 static int
 bdb_destroy( BackendInfo *bi )
 {
@@ -516,7 +516,7 @@ bdb_initialize(
 #ifdef NEW_LOGGING
        LDAP_LOG( BACK_BDB, ENTRY, "bdb_db_initialize\n", 0, 0, 0 );
 #else
-       Debug( LDAP_DEBUG_TRACE, "bdb_open: initialize BDB backend\n",
+       Debug( LDAP_DEBUG_TRACE, "bdb_initialize: initialize BDB backend\n",
                0, 0, 0 );
 #endif
 
@@ -545,7 +545,7 @@ bdb_initialize(
                                "\texpected: %s \tgot: %s\n", DB_VERSION_STRING, version, 0 );
 #else
                        Debug( LDAP_DEBUG_ANY,
-                               "bdb_open: version mismatch\n"
+                               "bdb_initialize: version mismatch\n"
                                "\texpected: " DB_VERSION_STRING "\n"
                                "\tgot: %s \n", version, 0, 0 );
 #endif
@@ -553,9 +553,9 @@ bdb_initialize(
 
 #ifdef NEW_LOGGING
                LDAP_LOG( BACK_BDB, DETAIL1, 
-                       "bdb_db_initialize: bdb_open: %s\n", version, 0, 0 );
+                       "bdb_db_initialize: %s\n", version, 0, 0 );
 #else
-               Debug( LDAP_DEBUG_ANY, "bdb_open: %s\n",
+               Debug( LDAP_DEBUG_ANY, "bdb_initialize: %s\n",
                        version, 0, 0 );
 #endif
        }
index db1382042767276542b0a494b20eb69a4967c672..21ada672c311ad7d6519cc708c771583fd47dd78 100644 (file)
@@ -95,12 +95,12 @@ ldap_back_add(
                
        case REWRITE_REGEXEC_UNWILLING:
                send_ldap_result( conn, op, LDAP_UNWILLING_TO_PERFORM,
-                               NULL, "Unwilling to perform", NULL, NULL );
+                               NULL, "Operation not allowed", NULL, NULL );
                return( -1 );
                
        case REWRITE_REGEXEC_ERR:
                send_ldap_result( conn, op, LDAP_OTHER,
-                               NULL, "Operations error", NULL, NULL );
+                               NULL, "Rewrite error", NULL, NULL );
                return( -1 );
        }
 #else /* !ENABLE_REWRITE */
@@ -154,12 +154,15 @@ ldap_back_add(
 #ifdef ENABLE_REWRITE
                /*
                 * FIXME: dn-valued attrs should be rewritten
-                * to allow their use in ACLs at the back-ldap
-                * level.
+                * to allow their use in ACLs at back-ldap level.
                 */
                if ( strcmp( a->a_desc->ad_type->sat_syntax->ssyn_oid,
                                        SLAPD_DN_SYNTAX ) == 0 ) {
-                       ldap_dnattr_rewrite( li->rwinfo, a->a_vals, conn );
+                       /*
+                        * FIXME: rewrite could fail; in this case
+                        * the operation should give up, right?
+                        */
+                       (void)ldap_dnattr_rewrite( li->rwinfo, a->a_vals, conn );
                }
 #endif /* ENABLE_REWRITE */
 
index e65ea665a6804aa5f274a95d9d08dbb0663bb4b6..501e4d9802930dc7cceabb5c26d9c06c5fddd63d 100644 (file)
@@ -102,12 +102,12 @@ ldap_back_bind(
                
        case REWRITE_REGEXEC_UNWILLING:
                send_ldap_result( conn, op, LDAP_UNWILLING_TO_PERFORM,
-                               NULL, "Unwilling to perform", NULL, NULL );
+                               NULL, "Operation not allowed", NULL, NULL );
                return( -1 );
 
        case REWRITE_REGEXEC_ERR:
                send_ldap_result( conn, op, LDAP_OTHER,
-                               NULL, "Operations error", NULL, NULL );
+                               NULL, "Rewrite error", NULL, NULL );
                return( -1 );
        }
 #else /* !ENABLE_REWRITE */
@@ -228,7 +228,7 @@ ldap_back_getconn(struct ldapinfo *li, Connection *conn, Operation *op)
                if (err != LDAP_SUCCESS) {
                        err = ldap_back_map_result(err);
                        send_ldap_result( conn, op, err,
-                               NULL, "ldap_init failed", NULL, NULL );
+                               NULL, "ldap_initialize() failed", NULL, NULL );
                        return( NULL );
                }
                /* Set LDAP version. This will always succeed: If the client
@@ -263,7 +263,8 @@ ldap_back_getconn(struct ldapinfo *li, Connection *conn, Operation *op)
                                                &lc->bound_dn.bv_val ) ) {
                        case REWRITE_REGEXEC_OK:
                                if ( lc->bound_dn.bv_val == NULL ) {
-                                       ber_dupbv( &lc->bound_dn, &lc->conn->c_dn );
+                                       ber_dupbv( &lc->bound_dn,
+                                                       &lc->conn->c_dn );
                                }
 #ifdef NEW_LOGGING
                                LDAP_LOG( BACK_LDAP, DETAIL1, 
@@ -283,25 +284,28 @@ ldap_back_getconn(struct ldapinfo *li, Connection *conn, Operation *op)
                        case REWRITE_REGEXEC_UNWILLING:
                                send_ldap_result( conn, op,
                                                LDAP_UNWILLING_TO_PERFORM,
-                                               NULL, "Unwilling to perform",
+                                               NULL, "Operation not allowed",
                                                NULL, NULL );
                                return( NULL );
                                
                        case REWRITE_REGEXEC_ERR:
                                send_ldap_result( conn, op,
                                                LDAP_OTHER,
-                                               NULL, "Operations error",
+                                               NULL, "Rewrite error",
                                                NULL, NULL );
                                return( NULL );
                        }
+
 #else /* !ENABLE_REWRITE */
                        struct berval bv;
                        ldap_back_dn_massage( li, &lc->conn->c_dn, &bv, 0, 1 );
-                       if ( bv.bv_val == lc->conn->c_dn.bv_val )
+                       if ( bv.bv_val == lc->conn->c_dn.bv_val ) {
                                ber_dupbv( &lc->bound_dn, &bv );
-                       else
+                       } else {
                                lc->bound_dn = bv;
+                       }
 #endif /* !ENABLE_REWRITE */
+
                } else {
                        lc->bound_dn.bv_val = NULL;
                        lc->bound_dn.bv_len = 0;
index 2b677edb5a5bf1da5c98d5e7d29807693a74d5c6..e4c966f9e97808d476eb507406f5672c73e498b7 100644 (file)
@@ -85,12 +85,12 @@ ldap_back_compare(
                
        case REWRITE_REGEXEC_UNWILLING:
                send_ldap_result( conn, op, LDAP_UNWILLING_TO_PERFORM,
-                               NULL, "Unwilling to perform", NULL, NULL );
+                               NULL, "Operation not allowed", NULL, NULL );
                return( -1 );
                
        case REWRITE_REGEXEC_ERR:
                send_ldap_result( conn, op, LDAP_OTHER,
-                               NULL, "Operations error", NULL, NULL );
+                               NULL, "Rewrite error", NULL, NULL );
                return( -1 );
        }
 #else /* !ENABLE_REWRITE */
index d545f77b14701c032cc8e4015cb0bc2b937f328b..3766df2db9ec2094c7302853c61b4ad8db3099be 100644 (file)
@@ -85,12 +85,12 @@ ldap_back_delete(
                
        case REWRITE_REGEXEC_UNWILLING:
                send_ldap_result( conn, op, LDAP_UNWILLING_TO_PERFORM,
-                               NULL, "Unwilling to perform", NULL, NULL );
+                               NULL, "Operation not allowed", NULL, NULL );
                return( -1 );
 
        case REWRITE_REGEXEC_ERR:
                send_ldap_result( conn, op, LDAP_OTHER,
-                               NULL, "Operations error", NULL, NULL );
+                               NULL, "Rewrite error", NULL, NULL );
                return( -1 );
        }
 #else /* !ENABLE_REWRITE */
index bea4dcbcd7506dad6d97c44963fd0492a01e4e91..8deeeaa88833d7591af263317d34c7a71e3c5eb9 100644 (file)
@@ -89,12 +89,12 @@ ldap_back_modify(
                
        case REWRITE_REGEXEC_UNWILLING:
                send_ldap_result( conn, op, LDAP_UNWILLING_TO_PERFORM,
-                               NULL, "Unwilling to perform", NULL, NULL );
+                               NULL, "Operation not allowed", NULL, NULL );
                return( -1 );
 
        case REWRITE_REGEXEC_ERR:
                send_ldap_result( conn, op, LDAP_OTHER,
-                               NULL, "Operations error", NULL, NULL );
+                               NULL, "Rewrite error", NULL, NULL );
                return( -1 );
        }
 #else /* !ENABLE_REWRITE */
@@ -139,13 +139,18 @@ ldap_back_modify(
                                        ml->sml_bvalues, conn );
                }
 #endif /* ENABLE_REWRITE */
-       
-               for (j = 0; ml->sml_bvalues[j].bv_val; j++);
-               mods[i].mod_bvalues = (struct berval **)ch_malloc((j+1) *
-                       sizeof(struct berval *));
-               for (j = 0; ml->sml_bvalues[j].bv_val; j++)
-                       mods[i].mod_bvalues[j] = &ml->sml_bvalues[j];
-               mods[i].mod_bvalues[j] = NULL;
+
+               if ( ml->sml_bvalues != NULL ) {        
+                       for (j = 0; ml->sml_bvalues[j].bv_val; j++);
+                       mods[i].mod_bvalues = (struct berval **)ch_malloc((j+1) *
+                               sizeof(struct berval *));
+                       for (j = 0; ml->sml_bvalues[j].bv_val; j++)
+                               mods[i].mod_bvalues[j] = &ml->sml_bvalues[j];
+                       mods[i].mod_bvalues[j] = NULL;
+               } else {
+                       mods[i].mod_bvalues = NULL;
+               }
+
                i++;
        }
        modv[i] = 0;
index 8c7eee586999da39d18882f3c568f6dcee9f1738..2eb905c844814ed00202cd285e955d75ca2598b4 100644 (file)
@@ -96,13 +96,13 @@ ldap_back_modrdn(
 
                case REWRITE_REGEXEC_UNWILLING:
                        send_ldap_result( conn, op, LDAP_UNWILLING_TO_PERFORM,
-                                       NULL, "Unwilling to perform",
+                                       NULL, "Operation not allowed",
                                        NULL, NULL );
                        return( -1 );
 
                case REWRITE_REGEXEC_ERR:
                        send_ldap_result( conn, op, LDAP_OTHER,
-                                       NULL, "Operations error",
+                                       NULL, "Rewrite error",
                                        NULL, NULL );
                        return( -1 );
                }
@@ -134,12 +134,12 @@ ldap_back_modrdn(
                
        case REWRITE_REGEXEC_UNWILLING:
                send_ldap_result( conn, op, LDAP_UNWILLING_TO_PERFORM,
-                               NULL, "Unwilling to perform", NULL, NULL );
+                               NULL, "Operation not allowed", NULL, NULL );
                return( -1 );
 
        case REWRITE_REGEXEC_ERR:
                send_ldap_result( conn, op, LDAP_OTHER,
-                               NULL, "Operations error", NULL, NULL );
+                               NULL, "Rewrite error", NULL, NULL );
                return( -1 );
        }
 #else /* !ENABLE_REWRITE */
index 47f211c5da48b3c6908612d6ef1aa4d259bb98d5..e2990e81d87ee05876cdc6c0ddef43623dc965b9 100644 (file)
@@ -172,13 +172,13 @@ ldap_back_search(
                
        case REWRITE_REGEXEC_UNWILLING:
                send_ldap_result( conn, op, LDAP_UNWILLING_TO_PERFORM,
-                               NULL, "Unwilling to perform", NULL, NULL );
+                               NULL, "Operation not allowed", NULL, NULL );
                rc = -1;
                goto finish;
 
        case REWRITE_REGEXEC_ERR:
                send_ldap_result( conn, op, LDAP_OTHER,
-                               NULL, "Operations error", NULL, NULL );
+                               NULL, "Rewrite error", NULL, NULL );
                rc = -1;
                goto finish;
        }
@@ -211,8 +211,13 @@ ldap_back_search(
                
        case REWRITE_REGEXEC_UNWILLING:
                send_ldap_result( conn, op, LDAP_UNWILLING_TO_PERFORM,
-                               NULL, "Unwilling to perform", NULL, NULL );
+                               NULL, "Operation not allowed", NULL, NULL );
+               rc = -1;
+               goto finish;
+
        case REWRITE_REGEXEC_ERR:
+               send_ldap_result( conn, op, LDAP_OTHER,
+                               NULL, "Rewrite error", NULL, NULL );
                rc = -1;
                goto finish;
        }
@@ -251,9 +256,9 @@ ldap_back_search(
                mapped_attrs[count] = NULL;
        }
 
-       if ((msgid = ldap_search(lc->ld, mbase.bv_val, scope, mapped_filter, mapped_attrs,
-               attrsonly)) == -1)
-       {
+       msgid = ldap_search(lc->ld, mbase.bv_val, scope, mapped_filter,
+                       mapped_attrs, attrsonly);
+       if ( msgid == -1 ) {
 fail:;
                rc = ldap_back_op_result(lc, op);
                goto finish;
@@ -364,19 +369,18 @@ fail:;
                        break;
                        
                case REWRITE_REGEXEC_UNWILLING:
-                       send_ldap_result( conn, op, LDAP_UNWILLING_TO_PERFORM,
-                                       NULL, "Unwilling to perform",
-                                       NULL, NULL );
                        
                case REWRITE_REGEXEC_ERR:
-                       rc = -1;
-                       goto finish;
+                       /* FIXME: no error, but no matched ... */
+                       mmatch = NULL;
+                       break;
                }
        }
 
        if ( v2refs ) {
                sres = LDAP_REFERRAL;
        }
+
        send_search_result( conn, op, sres,
                mmatch, err, v2refs, NULL, count );
 
index e0d52e1173816311c022a1b4b48b49cde1c3f008..6408654e9dfe735a825aed8f2016f11ea2a43b9f 100644 (file)
@@ -131,12 +131,12 @@ meta_back_add(
                
        case REWRITE_REGEXEC_UNWILLING:
                send_ldap_result( conn, op, LDAP_UNWILLING_TO_PERFORM,
-                               NULL, NULL, NULL, NULL );
+                               NULL, "Operation not allowed", NULL, NULL );
                return -1;
                
        case REWRITE_REGEXEC_ERR:
                send_ldap_result( conn, op, LDAP_OTHER,
-                               NULL, NULL, NULL, NULL );
+                               NULL, "Rewrite error", NULL, NULL );
                return -1;
        }
 
index 71475fdc39214ac2875598f4f1201cf1949d13e1..75a4c868e4e3cf7bc4ba6d360ef638069c625050 100644 (file)
@@ -138,7 +138,7 @@ meta_back_compare(
                
                case REWRITE_REGEXEC_UNWILLING:
                        send_ldap_result( conn, op, LDAP_UNWILLING_TO_PERFORM,
-                                       NULL, "Unwilling to perform",
+                                       NULL, "Operation not allowed",
                                        NULL, NULL );
                        return -1;
                        
@@ -324,7 +324,7 @@ finish:;
                
                case REWRITE_REGEXEC_UNWILLING:
                        send_ldap_result( conn, op, LDAP_UNWILLING_TO_PERFORM,
-                                       NULL, "Unwilling to perform",
+                                       NULL, "Operation not allowed",
                                        NULL, NULL );
                        rc = -1;
                        goto cleanup;
index 249555836e04d23608fc19c6220b11759d4bf8a0..e9deeb00512356b457c86febf5c2523811aba765 100644 (file)
@@ -286,7 +286,7 @@ init_one_conn(
                case REWRITE_REGEXEC_UNWILLING:
                        send_ldap_result( conn, op,
                                        LDAP_UNWILLING_TO_PERFORM,
-                                       NULL, "Unwilling to perform",
+                                       NULL, "Operation not allowed",
                                        NULL, NULL );
                        return LDAP_UNWILLING_TO_PERFORM;
                        
index daeada0ad30d0d17507c34041092f458953538d0..4909e73a6268ae60e402a6141b4c603783006a34 100644 (file)
@@ -118,12 +118,12 @@ meta_back_delete(
                
        case REWRITE_REGEXEC_UNWILLING:
                send_ldap_result( conn, op, LDAP_UNWILLING_TO_PERFORM,
-                               NULL, NULL, NULL, NULL );
+                               NULL, "Operation not allowed", NULL, NULL );
                return -1;
 
        case REWRITE_REGEXEC_ERR:
                send_ldap_result( conn, op, LDAP_OTHER,
-                               NULL, NULL, NULL, NULL );
+                               NULL, "Rewrite error", NULL, NULL );
                return -1;
        }
        
index b6890382c87a809c5504ec730c7b025978d9d02b..57dc40f90b0b6c743d6c8e8d5911b21be83b3804 100644 (file)
@@ -122,12 +122,12 @@ meta_back_modify(
                
        case REWRITE_REGEXEC_UNWILLING:
                send_ldap_result( conn, op, LDAP_UNWILLING_TO_PERFORM,
-                               NULL, NULL, NULL, NULL );
+                               NULL, "Operation not allowed", NULL, NULL );
                return -1;
 
        case REWRITE_REGEXEC_ERR:
                send_ldap_result( conn, op, LDAP_OTHER,
-                               NULL, NULL, NULL, NULL );
+                               NULL, "Rewrite error", NULL, NULL );
                return -1;
        }
 
@@ -179,12 +179,18 @@ meta_back_modify(
                                ml->sml_bvalues, conn );
                }
 
-               for (j = 0; ml->sml_bvalues[ j ].bv_val; j++);
-               mods[ i ].mod_bvalues = (struct berval **)ch_malloc((j+1) *
-                       sizeof(struct berval *));
-               for (j = 0; ml->sml_bvalues[ j ].bv_val; j++)
-                       mods[ i ].mod_bvalues[ j ] = &ml->sml_bvalues[j];
-               mods[ i ].mod_bvalues[ j ] = NULL;
+               if ( ml->sml_bvalues != NULL ){
+                       for (j = 0; ml->sml_bvalues[ j ].bv_val; j++);
+                       mods[ i ].mod_bvalues = (struct berval **)ch_malloc((j+1) *
+                               sizeof(struct berval *));
+                       for (j = 0; ml->sml_bvalues[ j ].bv_val; j++)
+                               mods[ i ].mod_bvalues[ j ] = &ml->sml_bvalues[j];
+                       mods[ i ].mod_bvalues[ j ] = NULL;
+
+               } else {
+                       mods[ i ].mod_bvalues = NULL;
+               }
+
                i++;
        }
        modv[ i ] = 0;
index c0f6d1437ff666c9359658cda0cd406afb8d9125..336001bdd2f98f87da3031c2c688102b81bdb027 100644 (file)
@@ -155,12 +155,13 @@ meta_back_modrdn(
 
                case REWRITE_REGEXEC_UNWILLING:
                        send_ldap_result( conn, op, LDAP_UNWILLING_TO_PERFORM,
-                                       NULL, NULL, NULL, NULL );
+                                       NULL, "Operation not allowed", 
+                                       NULL, NULL );
                        return -1;
 
                case REWRITE_REGEXEC_ERR:
                        send_ldap_result( conn, op, LDAP_OTHER,
-                                       NULL, NULL, NULL, NULL );
+                                       NULL, "Rewrite error", NULL, NULL );
                        return -1;
                }
        }
@@ -185,12 +186,12 @@ meta_back_modrdn(
                
        case REWRITE_REGEXEC_UNWILLING:
                send_ldap_result( conn, op, LDAP_UNWILLING_TO_PERFORM,
-                               NULL, NULL, NULL, NULL );
+                               NULL, "Operation not allowed", NULL, NULL );
                return -1;
 
        case REWRITE_REGEXEC_ERR:
                send_ldap_result( conn, op, LDAP_OTHER,
-                               NULL, NULL, NULL, NULL );
+                               NULL, "Rewrite error", NULL, NULL );
                return -1;
        }
 
index 0f6bce2dc73952084d09310812f6bb037c67de99..35b0aae92deb6ac8be79a3da0b704052e8e2ba4f 100644 (file)
@@ -296,13 +296,14 @@ meta_back_search(
                
                case REWRITE_REGEXEC_UNWILLING:
                        send_ldap_result( conn, op, LDAP_UNWILLING_TO_PERFORM,
-                                       NULL, NULL, NULL, NULL );
+                                       NULL, "Operation not allowed",
+                                       NULL, NULL );
                        rc = -1;
                        goto finish;
 
                case REWRITE_REGEXEC_ERR:
                        send_ldap_result( conn, op, LDAP_OTHER,
-                                       NULL, NULL, NULL, NULL );
+                                       NULL, "rewrite error", NULL, NULL );
                        rc = -1;
                        goto finish;
                }
@@ -335,13 +336,14 @@ meta_back_search(
                
                case REWRITE_REGEXEC_UNWILLING:
                        send_ldap_result( conn, op, LDAP_UNWILLING_TO_PERFORM,
-                                       NULL, NULL, NULL, NULL );
+                                       NULL, "Operation not allowed",
+                                       NULL, NULL );
                        rc = -1;
                        goto finish;
 
                case REWRITE_REGEXEC_ERR:
                        send_ldap_result( conn, op, LDAP_OTHER,
-                                       NULL, NULL, NULL, NULL );
+                                       NULL, "Rewrite error", NULL, NULL );
                        rc = -1;
                        goto finish;
                }
@@ -601,16 +603,11 @@ meta_back_search(
                        break;
                        
                case REWRITE_REGEXEC_UNWILLING:
-                       send_ldap_result( conn, op, LDAP_UNWILLING_TO_PERFORM,
-                                       NULL, NULL, NULL, NULL );
-                       rc = -1;
-                       goto finish;
                        
                case REWRITE_REGEXEC_ERR:
-                       send_ldap_result( conn, op, LDAP_OTHER,
-                                       NULL, NULL, NULL, NULL );
-                       rc = -1;
-                       goto finish;
+                       /* FIXME: no error, but no matched ... */
+                       mmatch = NULL;
+                       break;
                }
        }
 
@@ -691,8 +688,10 @@ meta_send_entry(
                }
                break;
                
-       case REWRITE_REGEXEC_ERR:
        case REWRITE_REGEXEC_UNWILLING:
+               return LDAP_UNWILLING_TO_PERFORM;
+
+       case REWRITE_REGEXEC_ERR:
                return LDAP_OTHER;
        }
 
index e26c6b94891fedcce8947c83f2c6bd96c302c64b..4508bef971ccc5afe81e018f154bd6d30584908a 100644 (file)
@@ -12,7 +12,7 @@
 #ifdef SLAPD_SQL
 
 #include <stdio.h>
-#include <string.h>
+#include "ac/string.h"
 #include <sys/types.h>
 #include "slap.h"
 #include "back-sql.h"
index d83eec1837cea07556d54141f443ecb2da0307a1..3511ce9240e04de0f51efcaf41c3f179616a7aee 100644 (file)
@@ -13,7 +13,7 @@
 
 #include <stdio.h>
 #include <sys/types.h>
-#include <string.h>
+#include "ac/string.h"
 #include "slap.h"
 #include "ldap_pvt.h"
 #include "back-sql.h"
index b2638960f4c697c6b7f0ea3991e64db1183e92d4..f0d863e6055eed015f5fbf398bdedfa7e5063ace 100644 (file)
@@ -70,10 +70,7 @@ backsql_operational(
 
 
        if ( ( opattrs || ad_inlist( slap_schema.si_ad_hasSubordinates, attrs ) ) 
-#ifdef SLAP_X_FILTER_HASSUBORDINATES
-                       && attr_find( e->e_attrs, slap_schema.si_ad_hasSubordinates ) == NULL
-#endif /* SLAP_X_FILTER_HASSUBORDINATES */
-                       ) {
+                       && attr_find( e->e_attrs, slap_schema.si_ad_hasSubordinates ) == NULL ) {
                
                rc = backsql_get_db_conn( be, conn, &dbh );
                if ( rc != LDAP_SUCCESS ) {
index 2f9fd207b7dda662605da60624465aab586f3b25..c78620445fae533d66c6fe37b99678619729fb3e 100644 (file)
@@ -13,7 +13,7 @@
 
 #include <stdio.h>
 #include <sys/types.h>
-#include <string.h>
+#include "ac/string.h"
 #include "slap.h"
 #include "lber_pvt.h"
 #include "ldap_pvt.h"
index 77428ea18c05543a73edd73efe337bebb2596e13..411468e6af8d76f962bc8bb7b7e6e2ad116cc52d 100644 (file)
@@ -386,7 +386,6 @@ backsql_process_filter( backsql_srch_info *bsi, Filter *f )
                                &bsi->oc->oc->soc_cname, 
                                '\'' );
 
-#if defined(SLAP_X_FILTER_HASSUBORDINATES) || defined(SLAP_X_MRA_MATCH_DNATTRS)
        } else if ( ad == slap_schema.si_ad_hasSubordinates || ad == NULL ) {
                /*
                 * FIXME: this is not robust; e.g. a filter
@@ -416,7 +415,6 @@ backsql_process_filter( backsql_srch_info *bsi, Filter *f )
                        backsql_attrlist_add( bsi, NULL );
                }
                goto done;
-#endif /* SLAP_X_FILTER_HASSUBORDINATES || SLAP_X_MRA_MATCH_DNATTRS */
                
        } else {
                at = backsql_ad2at( bsi->oc, ad );
@@ -1145,10 +1143,8 @@ backsql_search(
         */
        for ( eid = srch_info.id_list; eid != NULL; 
                        eid = backsql_free_entryID( eid, 1 ) ) {
-#ifdef SLAP_X_FILTER_HASSUBORDINATES
                Attribute       *hasSubordinate = NULL,
                                *a = NULL;
-#endif /* SLAP_X_FILTER_HASSUBORDINATES */
 
                /* check for abandon */
                if ( op->o_abandon ) {
@@ -1186,7 +1182,6 @@ backsql_search(
                        continue;
                }
 
-#ifdef SLAP_X_FILTER_HASSUBORDINATES
                /*
                 * We use this flag since we need to parse the filter
                 * anyway; we should have used the frontend API function
@@ -1224,18 +1219,15 @@ backsql_search(
                                continue;
                        }
                }
-#endif /* SLAP_X_FILTER_HASSUBORDINATES */
 
                if ( test_filter( be, conn, op, entry, filter ) 
                                == LDAP_COMPARE_TRUE ) {
-#ifdef SLAP_X_FILTER_HASSUBORDINATES
                        if ( hasSubordinate && !( srch_info.bsi_flags & BSQL_SF_ALL_OPER ) 
                                        && !ad_inlist( slap_schema.si_ad_hasSubordinates, attrs ) ) {
                                a->a_next = NULL;
                                attr_free( hasSubordinate );
                                hasSubordinate = NULL;
                        }
-#endif /* SLAP_X_FILTER_HASSUBORDINATES */
 
 #if 0  /* noop is masked SLAP_CTRL_UPDATE */
                        if ( op->o_noop ) {
index 2cc941023a9feeb9f74bd1898792526af64ad6ba..91c565f1ec2bd2d8c5f970561b26162a56abf0be 100644 (file)
@@ -1605,7 +1605,8 @@ read_config( const char *fname, int depth )
 
                        vals[0].bv_val = cargv[1];
                        vals[0].bv_len = strlen( vals[0].bv_val );
-                       value_add( &default_referral, vals );
+                       if( value_add( &default_referral, vals ) )
+                               return LDAP_OTHER;
 
 #ifdef NEW_LOGGING
                 } else if ( strcasecmp( cargv[0], "logfile" ) == 0 ) {
@@ -1989,7 +1990,8 @@ read_config( const char *fname, int depth )
 
                        vals[0].bv_val = cargv[1];
                        vals[0].bv_len = strlen( vals[0].bv_val );
-                       value_add( &be->be_update_refs, vals );
+                       if( value_add( &be->be_update_refs, vals ) )
+                               return LDAP_OTHER;
 
                /* replication log file to which changes are appended */
                } else if ( strcasecmp( cargv[0], "replogfile" ) == 0 ) {
index f8f5216cb404956f2c4ede68afbb12c9342bac33..cef1279c435f15ddb6b9af439ecd188c741a2a12 100644 (file)
@@ -409,7 +409,8 @@ cr_schema_info( Entry *e )
                Debug( LDAP_DEBUG_TRACE, "Merging cr [%ld] %s\n",
               (long) vals[0].bv_len, vals[0].bv_val, 0 );
 #endif
-               attr_merge( e, ad_ditContentRules, vals );
+               if( attr_merge( e, ad_ditContentRules, vals ) )
+                       return -1;
                ldap_memfree( vals[0].bv_val );
        }
 #endif
index 4582be62bb2d2acb3b97fae0e9e012395a03073e..7a4a207677b499ad29bbac15a208db4df8abefe0 100644 (file)
@@ -1531,92 +1531,3 @@ return_error:
        return( LDAP_SUCCESS );
 }
 
-#ifdef SLAP_X_FILTER_HASSUBORDINATES
-static int filter_has_subordinates_list(
-       Filter          *filter );
-
-/*
- * FIXME: we could detect the need to filter
- * for hasSubordinates when parsing the filter ...
- */
-
-static int
-filter_has_subordinates_list(
-       Filter          *fl )
-{
-       Filter                  *f;
-
-       for ( f = fl; f != NULL; f = f->f_next ) {
-               int     rc;
-
-               rc = filter_has_subordinates( f );
-
-               if ( rc ) {
-                       return rc;
-               }
-       }
-
-       return 0;
-}
-
-int
-filter_has_subordinates(
-       Filter          *f )
-{
-       AttributeDescription    *ad = NULL;
-
-       switch ( f->f_choice ) {
-       case LDAP_FILTER_PRESENT:
-               ad = f->f_desc;
-               break;
-
-       case LDAP_FILTER_EQUALITY:
-       case LDAP_FILTER_APPROX:
-       case LDAP_FILTER_GE:
-       case LDAP_FILTER_LE:
-               ad = f->f_ava->aa_desc;
-               break;
-
-       case LDAP_FILTER_SUBSTRINGS:
-               ad = f->f_sub_desc;
-               break;
-
-       case LDAP_FILTER_EXT:
-               /* could be null; however here it is harmless */
-               ad = f->f_mra->ma_desc;
-               break;
-
-       case LDAP_FILTER_NOT:
-               return filter_has_subordinates( f->f_not );
-
-       case LDAP_FILTER_AND:
-               return filter_has_subordinates_list( f->f_and );
-
-       case LDAP_FILTER_OR:
-               return filter_has_subordinates_list( f->f_or );
-
-       case SLAPD_FILTER_COMPUTED:
-               /*
-                * something wrong?
-                */
-               return 0;
-
-       default:
-               /*
-                * this means a new type of filter has been implemented,
-                * which is not handled yet in this function; we should
-                * issue a developer's warning, e.g. an assertion
-                */
-               assert( 0 );
-               return -1;
-       }
-
-       if ( ad == slap_schema.si_ad_hasSubordinates ) {
-               return 1;
-       }
-
-       return 0;
-}
-
-#endif /* SLAP_X_FILTER_HASSUBORDINATES */
-
index bda792fbf84ae5785885c99288fd3f7a3dc549df..1dc199c838d8910bc5d9cdb46ff1c6899725bd8d 100644 (file)
@@ -467,7 +467,7 @@ int main( int argc, char **argv )
 #else
                Debug( LDAP_DEBUG_ANY,
                    "main: TLS init def ctx failed: %d\n",
-                   0, 0, 0 );
+                   rc, 0, 0 );
 #endif
                rc = 1;
                SERVICE_EXIT( ERROR_SERVICE_SPECIFIC_ERROR, 20 );
index 12375773cfae4fcb4a7ca8871a0f8d43b7382f39..2dd747458d605f25b2539437d82df571e20083da 100644 (file)
@@ -171,7 +171,7 @@ int module_load(const char* file_name, int argc, char *argv[])
 #ifdef NEW_LOGGING
                LDAP_LOG( SLAPD, ERR, 
                        "module_load: module %s: unknown registration type (%d).\n", 
-                       file_name, 0);
+                       file_name, rc, 0);
 #else
                Debug(LDAP_DEBUG_CONFIG, "module %s: unknown registration type (%d)\n",
                        file_name, rc, 0);
index 069b72b370f685df24595810b1df211e6440d566..64d02b30581fd51d806e7289d3eaceafc7c67aae 100644 (file)
@@ -473,7 +473,8 @@ int mr_schema_info( Entry *e )
                Debug( LDAP_DEBUG_TRACE, "Merging mr [%lu] %s\n",
                        mr->smr_str.bv_len, mr->smr_str.bv_val, 0 );
 #endif
-               attr_merge_one( e, ad_matchingRules, &mr->smr_str );
+               if( attr_merge_one( e, ad_matchingRules, &mr->smr_str ) )
+                       return -1;
        }
        return 0;
 }
@@ -500,7 +501,8 @@ int mru_schema_info( Entry *e )
                Debug( LDAP_DEBUG_TRACE, "Merging mru [%lu] %s\n",
                        mru->smru_str.bv_len, mru->smru_str.bv_val, 0 );
 #endif
-               attr_merge_one( e, ad_matchingRuleUse, &mru->smru_str );
+               if( attr_merge_one( e, ad_matchingRuleUse, &mru->smru_str ) )
+                       return -1;
        }
        return 0;
 }
index ff6a81830344bcc302d320d8a37f87a2e846a67b..4ce2b8b66abf4a76aefe072a2a3da248a9e0928f 100644 (file)
@@ -491,7 +491,8 @@ oc_schema_info( Entry *e )
                Debug( LDAP_DEBUG_TRACE, "Merging oc [%ld] %s\n",
               (long) vals[0].bv_len, vals[0].bv_val, 0 );
 #endif
-               attr_merge( e, ad_objectClasses, vals );
+               if( attr_merge( e, ad_objectClasses, vals ) )
+                       return -1;
                ldap_memfree( vals[0].bv_val );
        }
        return 0;
index a7607d646b3b43fa91981bda5d1b1ba86f1c242f..4cfd8f1e2b7faffb8ff12a81f8666c2779030699 100644 (file)
@@ -38,7 +38,16 @@ static char *v2ref( BerVarray ref, const char *text )
                }
        }
 
-       v2 = ch_malloc( len+i+sizeof("Referral:") );
+       v2 = SLAP_MALLOC( len+i+sizeof("Referral:") );
+       if( v2 == NULL ) {
+#ifdef NEW_LOGGING
+               LDAP_LOG( OPERATION, ERR, "v2ref: SLAP_MALLOC failed", 0, 0, 0 );
+#else
+               Debug( LDAP_DEBUG_ANY, "v2ref: SLAP_MALLOC failed", 0, 0, 0 );
+#endif
+               return NULL;
+       }
+
        if( text != NULL ) {
                strcpy(v2, text);
                if( i ) {
@@ -49,7 +58,15 @@ static char *v2ref( BerVarray ref, const char *text )
        len += sizeof("Referral:");
 
        for( i=0; ref[i].bv_val != NULL; i++ ) {
-               v2 = ch_realloc( v2, len + ref[i].bv_len + 1 );
+               v2 = SLAP_REALLOC( v2, len + ref[i].bv_len + 1 );
+               if( v2 == NULL ) {
+#ifdef NEW_LOGGING
+                       LDAP_LOG( OPERATION, ERR, "v2ref: SLAP_MALLOC failed", 0, 0, 0 );
+#else
+                       Debug( LDAP_DEBUG_ANY, "v2ref: SLAP_MALLOC failed", 0, 0, 0 );
+#endif
+                       return NULL;
+               }
                v2[len-1] = '\n';
                AC_MEMCPY(&v2[len], ref[i].bv_val, ref[i].bv_len );
                len += ref[i].bv_len;
@@ -772,7 +789,23 @@ send_search_entry(
                size = i * sizeof(char *) + k;
                if ( size > 0 ) {
                        char    *a_flags;
-                       e_flags = ch_calloc ( 1, i * sizeof(char *) + k );
+                       e_flags = SLAP_CALLOC ( 1, i * sizeof(char *) + k );
+                       if( e_flags == NULL ) {
+#ifdef NEW_LOGGING
+                               LDAP_LOG( OPERATION, ERR, 
+                                       "send_search_entry: conn %lu SLAP_CALLOC failed\n",
+                                       conn ? conn->c_connid : 0, 0, 0 );
+#else
+                       Debug( LDAP_DEBUG_ANY, 
+                                       "send_search_entry: SLAP_CALLOC failed\n", 0, 0, 0 );
+#endif
+                               ber_free( ber, 1 );
+       
+                               send_ldap_result( conn, op, LDAP_OTHER,
+                                       NULL, "memory error", 
+                                       NULL, NULL );
+                               goto error_return;
+                       }
                        a_flags = (char *)(e_flags + i);
                        memset( a_flags, 0, k );
                        for ( a = e->e_attrs, i=0; a != NULL; a = a->a_next, i++ ) {
@@ -935,7 +968,7 @@ send_search_entry(
                         * Reuse previous memory - we likely need less space
                         * for operational attributes
                         */
-                       tmp = ch_realloc ( e_flags, i * sizeof(char *) + k );
+                       tmp = SLAP_REALLOC ( e_flags, i * sizeof(char *) + k );
                        if ( tmp == NULL ) {
 #ifdef NEW_LOGGING
                                LDAP_LOG( OPERATION, ERR, 
@@ -1267,7 +1300,8 @@ send_search_reference(
        if( op->o_protocol < LDAP_VERSION3 ) {
                /* save the references for the result */
                if( refs[0].bv_val != NULL ) {
-                       value_add( v2refs, refs );
+                       if( value_add( v2refs, refs ) )
+                               return LDAP_OTHER;
                }
                return 0;
        }
index 854bb0e2ec9e7652288cae77f13244da46c4c083..312052605ba2cc4458c2073b0b1be220b12929c1 100644 (file)
@@ -64,7 +64,18 @@ root_dse_info(
 
        vals[1].bv_val = NULL;
 
-       e = (Entry *) ch_calloc( 1, sizeof(Entry) );
+       e = (Entry *) SLAP_CALLOC( 1, sizeof(Entry) );
+
+       if( e == NULL ) {
+#ifdef NEW_LOGGING
+               LDAP_LOG( OPERATION, ERR,
+                       "root_dse_info: SLAP_CALLOC failed", 0, 0, 0 );
+#else
+               Debug( LDAP_DEBUG_ANY,
+                       "root_dse_info: SLAP_CALLOC failed", 0, 0, 0 );
+#endif
+               return LDAP_OTHER;
+       }
 
        e->e_attrs = NULL;
        e->e_name.bv_val = ch_strdup( LDAP_ROOT_DSE );
@@ -80,17 +91,21 @@ root_dse_info(
 
        vals[0].bv_val = "top";
        vals[0].bv_len = sizeof("top")-1;
-       attr_merge( e, ad_objectClass, vals );
+       if( attr_merge( e, ad_objectClass, vals ) )
+               return LDAP_OTHER;
 
        vals[0].bv_val = "OpenLDAProotDSE";
        vals[0].bv_len = sizeof("OpenLDAProotDSE")-1;
-       attr_merge( e, ad_objectClass, vals );
-       attr_merge( e, ad_structuralObjectClass, vals );
+       if( attr_merge( e, ad_objectClass, vals ) )
+               return LDAP_OTHER;
+       if( attr_merge( e, ad_structuralObjectClass, vals ) )
+               return LDAP_OTHER;
 
        for ( i = 0; i < nbackends; i++ ) {
                if ( backends[i].be_flags & SLAP_BFLAG_MONITOR ) {
                        vals[0] = backends[i].be_suffix[0];
-                       attr_merge( e, ad_monitorContext, vals );
+                       if( attr_merge( e, ad_monitorContext, vals ) )
+                               return LDAP_OTHER;
                        continue;
                }
                if ( backends[i].be_flags & SLAP_BFLAG_GLUE_SUBORDINATE ) {
@@ -98,7 +113,8 @@ root_dse_info(
                }
                for ( j = 0; backends[i].be_suffix[j].bv_val != NULL; j++ ) {
                        vals[0] = backends[i].be_suffix[j];
-                       attr_merge( e, ad_namingContexts, vals );
+                       if( attr_merge( e, ad_namingContexts, vals ) )
+                               return LDAP_OTHER;
                }
        }
 
@@ -107,17 +123,20 @@ root_dse_info(
        /* supportedControl */
        for ( i=0; (vals[0].bv_val = get_supported_ctrl(i)) != NULL; i++ ) {
                vals[0].bv_len = strlen( vals[0].bv_val );
-               attr_merge( e, ad_supportedControl, vals );
+               if( attr_merge( e, ad_supportedControl, vals ) )
+                       return LDAP_OTHER;
        }
 
        /* supportedExtension */
        for ( i=0; (bv = get_supported_extop(i)) != NULL; i++ ) {
                vals[0] = *bv;
-               attr_merge( e, ad_supportedExtension, vals );
+               if( attr_merge( e, ad_supportedExtension, vals ) )
+                       return LDAP_OTHER;
        }
 
        /* supportedFeatures */
-       attr_merge( e, ad_supportedFeatures, supportedFeatures );
+       if( attr_merge( e, ad_supportedFeatures, supportedFeatures ) )
+               return LDAP_OTHER;
 
        /* supportedLDAPVersion */
        for ( i=LDAP_VERSION_MIN; i<=LDAP_VERSION_MAX; i++ ) {
@@ -131,7 +150,8 @@ root_dse_info(
                snprintf(buf, sizeof buf, "%d", i);
                vals[0].bv_val = buf;
                vals[0].bv_len = strlen( vals[0].bv_val );
-               attr_merge( e, ad_supportedLDAPVersion, vals );
+               if( attr_merge( e, ad_supportedLDAPVersion, vals ) )
+                       return LDAP_OTHER;
        }
 
        /* supportedSASLMechanism */
@@ -141,19 +161,22 @@ root_dse_info(
                for ( i=0; supportedSASLMechanisms[i] != NULL; i++ ) {
                        vals[0].bv_val = supportedSASLMechanisms[i];
                        vals[0].bv_len = strlen( vals[0].bv_val );
-                       attr_merge( e, ad_supportedSASLMechanisms, vals );
+                       if( attr_merge( e, ad_supportedSASLMechanisms, vals ) )
+                               return LDAP_OTHER;
                }
                ldap_charray_free( supportedSASLMechanisms );
        }
 
        if ( default_referral != NULL ) {
-               attr_merge( e, ad_ref, default_referral );
+               if( attr_merge( e, ad_ref, default_referral ) )
+                       return LDAP_OTHER;
        }
 
        if( usr_attr != NULL) {
                Attribute *a;
                for( a = usr_attr->e_attrs; a != NULL; a = a->a_next ) {
-                       attr_merge( e, a->a_desc, a->a_vals );
+                       if( attr_merge( e, a->a_desc, a->a_vals ) )
+                               return LDAP_OTHER;
                }
        }
 
@@ -181,7 +204,17 @@ int read_root_dse_file( const char *fname )
                return EXIT_FAILURE;
        }
 
-       usr_attr = (Entry *) ch_calloc( 1, sizeof(Entry) );
+       usr_attr = (Entry *) SLAP_CALLOC( 1, sizeof(Entry) );
+       if( usr_attr == NULL ) {
+#ifdef NEW_LOGGING
+               LDAP_LOG( OPERATION, ERR,
+                       "read_root_dse_file: SLAP_CALLOC failed", 0, 0, 0 );
+#else
+               Debug( LDAP_DEBUG_ANY,
+                       "read_root_dse_file: SLAP_CALLOC failed", 0, 0, 0 );
+#endif
+               return LDAP_OTHER;
+       }
        usr_attr->e_attrs = NULL;
 
        while( ldif_read_record( fp, &lineno, &buf, &lmax ) ) {
@@ -191,7 +224,6 @@ int read_root_dse_file( const char *fname )
                if( e == NULL ) {
                        fprintf( stderr, "root_dse: could not parse entry (line=%d)\n",
                                lineno );
-                       entry_free( e );
                        entry_free( usr_attr );
                        usr_attr = NULL;
                        return EXIT_FAILURE;
@@ -215,7 +247,8 @@ int read_root_dse_file( const char *fname )
                 */
 
                for(a = e->e_attrs; a != NULL; a = a->a_next) {
-                       attr_merge( usr_attr, a->a_desc, a->a_vals );
+                       if( attr_merge( usr_attr, a->a_desc, a->a_vals ) )
+                               return LDAP_OTHER;
                }
 
                entry_free( e );
index c9d4436e8bc12f7da86f7cb4b8b8801cc9d2523e..4d401f85186e1b2833dffa6eedfe0bab03a460df 100644 (file)
@@ -33,7 +33,19 @@ schema_info( Entry **entry, const char **text )
        Entry           *e;
        struct berval   vals[5];
 
-       e = (Entry *) ch_calloc( 1, sizeof(Entry) );
+       e = (Entry *) SLAP_CALLOC( 1, sizeof(Entry) );
+       if( e == NULL ) {
+               /* Out of memory, do something about it */
+#ifdef NEW_LOGGING
+               LDAP_LOG( OPERATION, ERR, 
+                       "schema_info: SLAP_CALLOC failed - out of memory.\n", 0, 0,0 );
+#else
+               Debug( LDAP_DEBUG_ANY, 
+                       "schema_info: SLAP_CALLOC failed - out of memory.\n", 0, 0, 0 );
+#endif
+               *text = "out of memory";
+               return LDAP_OTHER;
+       }
 
        e->e_attrs = NULL;
        /* backend-specific schema info should be created by the
@@ -45,7 +57,12 @@ schema_info( Entry **entry, const char **text )
 
        vals[0].bv_val = "subentry";
        vals[0].bv_len = sizeof("subentry")-1;
-       attr_merge_one( e, ad_structuralObjectClass, vals );
+       if( attr_merge_one( e, ad_structuralObjectClass, vals ) ) {
+               /* Out of memory, do something about it */
+               entry_free( e );
+               *text = "out of memory";
+               return LDAP_OTHER;
+       }
 
        vals[0].bv_val = "top";
        vals[0].bv_len = sizeof("top")-1;
@@ -56,7 +73,12 @@ schema_info( Entry **entry, const char **text )
        vals[3].bv_val = "extensibleObject";
        vals[3].bv_len = sizeof("extensibleObject")-1;
        vals[4].bv_val = NULL;
-       attr_merge( e, ad_objectClass, vals );
+       if( attr_merge( e, ad_objectClass, vals ) ) {
+               /* Out of memory, do something about it */
+               entry_free( e );
+               *text = "out of memory";
+               return LDAP_OTHER;
+       }
 
        {
                int rc;
@@ -81,7 +103,12 @@ schema_info( Entry **entry, const char **text )
                        return LDAP_OTHER;
                }
 
-               attr_merge_one( e, desc, vals );
+               if( attr_merge_one( e, desc, vals ) ) {
+                       /* Out of memory, do something about it */
+                       entry_free( e );
+                       *text = "out of memory";
+                       return LDAP_OTHER;
+               }
        }
 
        {
@@ -107,8 +134,18 @@ schema_info( Entry **entry, const char **text )
                vals[0].bv_val = timebuf;
                vals[0].bv_len = strlen( timebuf );
 
-               attr_merge_one( e, ad_createTimestamp, vals );
-               attr_merge_one( e, ad_modifyTimestamp, vals );
+               if( attr_merge_one( e, ad_createTimestamp, vals ) ) {
+                       /* Out of memory, do something about it */
+                       entry_free( e );
+                       *text = "out of memory";
+                       return LDAP_OTHER;
+               }
+               if( attr_merge_one( e, ad_modifyTimestamp, vals ) ) {
+                       /* Out of memory, do something about it */
+                       entry_free( e );
+                       *text = "out of memory";
+                       return LDAP_OTHER;
+               }
        }
 
        if ( syn_schema_info( e ) 
index 2c1bc91f6d07ac334e206f21ead440c29ac557da..f12dd14012b3b2e38c467f622a3124d9a15d61bc 100644 (file)
@@ -94,7 +94,16 @@ syn_insert(
 
        if ( ssyn->ssyn_oid ) {
                sir = (struct sindexrec *)
-                       ch_calloc( 1, sizeof(struct sindexrec) );
+                       SLAP_CALLOC( 1, sizeof(struct sindexrec) );
+               if( sir == NULL ) {
+#ifdef NEW_LOGGING
+                       LDAP_LOG( OPERATION, ERR, 
+                               "syn_insert: SLAP_CALLOC Error\n", 0, 0, 0 );
+#else
+                       Debug( LDAP_DEBUG_ANY, "SLAP_CALLOC Error\n", 0, 0, 0 );
+#endif
+                       return LDAP_OTHER;
+               }
                sir->sir_name = ssyn->ssyn_oid;
                sir->sir_syn = ssyn;
                if ( avl_insert( &syn_index, (caddr_t) sir,
@@ -120,7 +129,16 @@ syn_add(
        Syntax          *ssyn;
        int             code;
 
-       ssyn = (Syntax *) ch_calloc( 1, sizeof(Syntax) );
+       ssyn = (Syntax *) SLAP_CALLOC( 1, sizeof(Syntax) );
+       if( ssyn == NULL ) {
+#ifdef NEW_LOGGING
+               LDAP_LOG( OPERATION, ERR, 
+                       "syn_add: SLAP_CALLOC Error\n", 0, 0, 0 );
+#else
+               Debug( LDAP_DEBUG_ANY, "SLAP_CALLOC Error\n", 0, 0, 0 );
+#endif
+               return LDAP_OTHER;
+       }
 
        AC_MEMCPY( &ssyn->ssyn_syn, syn, sizeof(LDAPSyntax) );
 
@@ -222,7 +240,8 @@ syn_schema_info( Entry *e )
 #endif
 
 #endif
-               attr_merge( e, ad_ldapSyntaxes, vals );
+               if( attr_merge( e, ad_ldapSyntaxes, vals ) )
+                       return -1;
                ldap_memfree( vals[0].bv_val );
        }
        return 0;
index b1288d07369ce3e7b24aaf0afc99196d40379cd0..9df3ab203769931793b849edf0de259e65cbe897 100644 (file)
@@ -31,15 +31,35 @@ value_add(
                ;       /* NULL */
 
        if ( *vals == NULL ) {
-               *vals = (BerVarray) ch_malloc( (nn + 1)
+               *vals = (BerVarray) SLAP_MALLOC( (nn + 1)
                    * sizeof(struct berval) );
+               if( *vals == NULL ) {
+#ifdef NEW_LOGGING
+                        LDAP_LOG( OPERATION, ERR,
+                     "value_add: SLAP_MALLOC failed.\n", 0, 0, 0 );
+#else
+                       Debug(LDAP_DEBUG_TRACE,
+                     "value_add: SLAP_MALLOC failed.\n", 0, 0, 0 );
+#endif
+                       return LBER_ERROR_MEMORY;
+               }
                n = 0;
        } else {
                for ( n = 0; (*vals)[n].bv_val != NULL; n++ ) {
                        ;       /* Empty */
                }
-               *vals = (BerVarray) ch_realloc( (char *) *vals,
+               *vals = (BerVarray) SLAP_REALLOC( (char *) *vals,
                    (n + nn + 1) * sizeof(struct berval) );
+               if( *vals == NULL ) {
+#ifdef NEW_LOGGING
+                        LDAP_LOG( OPERATION, ERR,
+                     "value_add: SLAP_MALLOC failed.\n", 0, 0, 0 );
+#else
+                       Debug(LDAP_DEBUG_TRACE,
+                     "value_add: SLAP_MALLOC failed.\n", 0, 0, 0 );
+#endif
+                       return LBER_ERROR_MEMORY;
+               }
        }
 
        v2 = *vals + n;
@@ -63,14 +83,34 @@ value_add_one(
        BerVarray v2;
 
        if ( *vals == NULL ) {
-               *vals = (BerVarray) ch_malloc( 2 * sizeof(struct berval) );
+               *vals = (BerVarray) SLAP_MALLOC( 2 * sizeof(struct berval) );
+               if( *vals == NULL ) {
+#ifdef NEW_LOGGING
+                        LDAP_LOG( OPERATION, ERR,
+                     "value_add_one: SLAP_MALLOC failed.\n", 0, 0, 0 );
+#else
+                       Debug(LDAP_DEBUG_TRACE,
+                     "value_add_one: SLAP_MALLOC failed.\n", 0, 0, 0 );
+#endif
+                       return LBER_ERROR_MEMORY;
+               }
                n = 0;
        } else {
                for ( n = 0; (*vals)[n].bv_val != NULL; n++ ) {
                        ;       /* Empty */
                }
-               *vals = (BerVarray) ch_realloc( (char *) *vals,
+               *vals = (BerVarray) SLAP_REALLOC( (char *) *vals,
                    (n + 2) * sizeof(struct berval) );
+               if( *vals == NULL ) {
+#ifdef NEW_LOGGING
+                        LDAP_LOG( OPERATION, ERR,
+                     "value_add_one: SLAP_MALLOC failed.\n", 0, 0, 0 );
+#else
+                       Debug(LDAP_DEBUG_TRACE,
+                     "value_add_one: SLAP_MALLOC failed.\n", 0, 0, 0 );
+#endif
+                       return LBER_ERROR_MEMORY;
+               }
        }
 
        v2 = *vals + n;
diff --git a/tests/data/rootdse.ldif b/tests/data/rootdse.ldif
new file mode 100644 (file)
index 0000000..6bad226
--- /dev/null
@@ -0,0 +1,2 @@
+dn:
+vendorName: The OpenLDAP Project <http://www.openldap.org/>
index 055e5fe14506fa3e1e0e51e1a8520c0ef21e9d25..8bd06bd31c795892df6ef5c32911a531eea12a5f 100644 (file)
@@ -18,6 +18,9 @@ include ./schema/openldap.schema
 pidfile     ./test-db/slapd.pid
 argsfile    ./test-db/slapd.args
 
+#
+rootdse        ./data/rootdse.ldif
+
 #######################################################################
 # ldbm database definitions
 #######################################################################
index babc6ffcc843284d281688a64281e9877b3c7976..d6fe2d842438d12610a664e91dce68c2373f7286 100755 (executable)
@@ -40,7 +40,7 @@ fi
 echo "Cleaning up in $DBDIR..."
 rm -f $DBDIR/[!C]*
 echo "Cleaning up in $REPLDIR..."
-rm -f $REPLDIR/[!C]*
+rm -rf $REPLDIR/[!C]*
 
 echo "Starting master slapd on TCP/IP port $PORT..."
 . $CONFFILTER $BACKEND $MONITORDB < $MASTERCONF > $DBCONF
@@ -65,12 +65,12 @@ for i in 0 1 2 3 4 5; do
        $LDAPSEARCH -s base -b "$MONITOR" -h $LOCALHOST -p $PORT \
                'objectclass=*' > /dev/null 2>&1
        RC=$?
-done
        if test $RC = 0 ; then
                break
        fi
        echo "Waiting 5 seconds for slapd to start..."
        sleep 5
+done
 
 echo "Using ldapsearch to check that slave slapd is running..."
 for i in 0 1 2 3 4 5; do