Browse Source

Ticket 48978 - Fix logging format errors and replace LDAP_DEBUG

Description:  This patch fixes a few format issues where the plugin name was
              not used for the subsystem.  Also replaced the LDAP_DEBUG flag
              with a more appropriate name.

              Also removed the logging macro from slapi-plugin.h

https://fedorahosted.org/389/ticket/48978

Reviewed by: wibrown & nhosoi (Thanks!!)
Mark Reynolds 9 years ago
parent
commit
1e1f6fe1b8
39 changed files with 368 additions and 287 deletions
  1. 34 15
      Makefile.in
  2. 129 65
      aclocal.m4
  3. 3 6
      config.h.in
  4. 112 132
      configure
  5. 5 1
      configure.ac
  6. 1 0
      ldap/servers/plugins/acct_usability/acct_usability.h
  7. 1 1
      ldap/servers/plugins/acctpolicy/acct_config.c
  8. 1 1
      ldap/servers/plugins/acctpolicy/acct_init.c
  9. 1 1
      ldap/servers/plugins/acctpolicy/acct_plugin.c
  10. 1 1
      ldap/servers/plugins/acctpolicy/acct_util.c
  11. 1 0
      ldap/servers/plugins/acctpolicy/acctpolicy.h
  12. 1 0
      ldap/servers/plugins/automember/automember.h
  13. 1 0
      ldap/servers/plugins/deref/deref.h
  14. 1 0
      ldap/servers/plugins/linkedattrs/linked_attrs.h
  15. 1 0
      ldap/servers/plugins/mep/mep.h
  16. 1 2
      ldap/servers/plugins/posix-winsync/posix-group-func.c
  17. 2 0
      ldap/servers/plugins/posix-winsync/posix-group-func.h
  18. 2 3
      ldap/servers/plugins/posix-winsync/posix-group-task.c
  19. 3 3
      ldap/servers/plugins/posix-winsync/posix-winsync-config.c
  20. 1 0
      ldap/servers/plugins/posix-winsync/posix-wsp-ident.h
  21. 1 0
      ldap/servers/plugins/pwdstorage/pwdstorage.h
  22. 14 8
      ldap/servers/plugins/replication/repl_session_plugin.c
  23. 17 20
      ldap/servers/plugins/replication/windows_private.c
  24. 0 1
      ldap/servers/plugins/retrocl/retrocl.h
  25. 1 0
      ldap/servers/plugins/rootdn_access/rootdn_access.h
  26. 1 0
      ldap/servers/plugins/statechange/statechange.c
  27. 1 0
      ldap/servers/plugins/sync/sync.h
  28. 2 1
      ldap/servers/plugins/uiduniq/7bit.c
  29. 2 1
      ldap/servers/plugins/uiduniq/plugin-utils.h
  30. 2 1
      ldap/servers/plugins/uiduniq/uid.c
  31. 1 0
      ldap/servers/plugins/whoami/whoami.c
  32. 2 2
      ldap/servers/slapd/back-ldbm/filterindex.c
  33. 3 3
      ldap/servers/slapd/back-ldbm/index.c
  34. 3 3
      ldap/servers/slapd/daemon.c
  35. 5 5
      ldap/servers/slapd/main.c
  36. 2 2
      ldap/servers/slapd/modify.c
  37. 0 8
      ldap/servers/slapd/slapi-plugin.h
  38. 8 0
      ldap/servers/slapd/slapi-private.h
  39. 1 1
      ldap/servers/slapd/tools/ldaptool.h

+ 34 - 15
Makefile.in

@@ -1,7 +1,7 @@
-# Makefile.in generated by automake 1.13.4 from Makefile.am.
+# Makefile.in generated by automake 1.15 from Makefile.am.
 # @configure_input@
 
-# Copyright (C) 1994-2013 Free Software Foundation, Inc.
+# Copyright (C) 1994-2014 Free Software Foundation, Inc.
 
 # This Makefile.in is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
@@ -20,7 +20,17 @@
 
 
 VPATH = @srcdir@
-am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)'
+am__is_gnu_make = { \
+  if test -z '$(MAKELEVEL)'; then \
+    false; \
+  elif test -n '$(MAKE_HOST)'; then \
+    true; \
+  elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \
+    true; \
+  else \
+    false; \
+  fi; \
+}
 am__make_running_with_option = \
   case $${target_option-} in \
       ?) ;; \
@@ -93,12 +103,6 @@ noinst_PROGRAMS = makstrdb$(EXEEXT)
 @SOLARIS_TRUE@am__append_2 = -lrt
 @SOLARIS_TRUE@am__append_3 = ldap/servers/slapd/tools/ldclt/opCheck.c
 subdir = .
-DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \
-	$(top_srcdir)/configure $(am__configure_deps) \
-	$(srcdir)/config.h.in $(top_srcdir)/rpm/389-ds-base.spec.in \
-	depcomp $(dist_man_MANS) $(dist_noinst_DATA) \
-	$(dist_noinst_HEADERS) $(serverinc_HEADERS) README compile \
-	config.guess config.sub install-sh missing ltmain.sh
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
 am__aclocal_m4_deps = $(top_srcdir)/m4/libtool.m4 \
 	$(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \
@@ -113,6 +117,9 @@ am__aclocal_m4_deps = $(top_srcdir)/m4/libtool.m4 \
 	$(top_srcdir)/m4/systemd.m4 $(top_srcdir)/configure.ac
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
 	$(ACLOCAL_M4)
+DIST_COMMON = $(srcdir)/Makefile.am $(top_srcdir)/configure \
+	$(am__configure_deps) $(dist_noinst_DATA) \
+	$(dist_noinst_HEADERS) $(serverinc_HEADERS) $(am__DIST_COMMON)
 am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \
  configure.lineno config.status.lineno
 mkinstalldirs = $(install_sh) -d
@@ -1255,6 +1262,10 @@ ETAGS = etags
 CTAGS = ctags
 CSCOPE = cscope
 AM_RECURSIVE_TARGETS = cscope
+am__DIST_COMMON = $(dist_man_MANS) $(srcdir)/Makefile.in \
+	$(srcdir)/config.h.in $(top_srcdir)/rpm/389-ds-base.spec.in \
+	README compile config.guess config.sub depcomp install-sh \
+	ltmain.sh missing
 DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
 distdir = $(PACKAGE)-$(VERSION)
 top_distdir = $(distdir)
@@ -3255,7 +3266,6 @@ $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am  $(am__confi
 	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign Makefile'; \
 	$(am__cd) $(top_srcdir) && \
 	  $(AUTOMAKE) --foreign Makefile
-.PRECIOUS: Makefile
 Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
 	@case '$?' in \
 	  *config.status*) \
@@ -3276,8 +3286,8 @@ $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps)
 $(am__aclocal_m4_deps):
 
 config.h: stamp-h1
-	@if test ! -f $@; then rm -f stamp-h1; else :; fi
-	@if test ! -f $@; then $(MAKE) $(AM_MAKEFLAGS) stamp-h1; else :; fi
+	@test -f $@ || rm -f stamp-h1
+	@test -f $@ || $(MAKE) $(AM_MAKEFLAGS) stamp-h1
 
 stamp-h1: $(srcdir)/config.h.in $(top_builddir)/config.status
 	@rm -f stamp-h1
@@ -10374,10 +10384,16 @@ dist-xz: distdir
 	$(am__post_remove_distdir)
 
 dist-tarZ: distdir
+	@echo WARNING: "Support for distribution archives compressed with" \
+		       "legacy program 'compress' is deprecated." >&2
+	@echo WARNING: "It will be removed altogether in Automake 2.0" >&2
 	tardir=$(distdir) && $(am__tar) | compress -c >$(distdir).tar.Z
 	$(am__post_remove_distdir)
 
 dist-shar: distdir
+	@echo WARNING: "Support for shar distribution archives is" \
+	               "deprecated." >&2
+	@echo WARNING: "It will be removed altogether in Automake 2.0" >&2
 	shar $(distdir) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).shar.gz
 	$(am__post_remove_distdir)
 
@@ -10412,16 +10428,17 @@ distcheck: dist
 	esac
 	chmod -R a-w $(distdir)
 	chmod u+w $(distdir)
-	mkdir $(distdir)/_build $(distdir)/_inst
+	mkdir $(distdir)/_build $(distdir)/_build/sub $(distdir)/_inst
 	chmod a-w $(distdir)
 	test -d $(distdir)/_build || exit 0; \
 	dc_install_base=`$(am__cd) $(distdir)/_inst && pwd | sed -e 's,^[^:\\/]:[\\/],/,'` \
 	  && dc_destdir="$${TMPDIR-/tmp}/am-dc-$$$$/" \
 	  && am__cwd=`pwd` \
-	  && $(am__cd) $(distdir)/_build \
-	  && ../configure --srcdir=.. --prefix="$$dc_install_base" \
+	  && $(am__cd) $(distdir)/_build/sub \
+	  && ../../configure \
 	    $(AM_DISTCHECK_CONFIGURE_FLAGS) \
 	    $(DISTCHECK_CONFIGURE_FLAGS) \
+	    --srcdir=../.. --prefix="$$dc_install_base" \
 	  && $(MAKE) $(AM_MAKEFLAGS) \
 	  && $(MAKE) $(AM_MAKEFLAGS) dvi \
 	  && $(MAKE) $(AM_MAKEFLAGS) check \
@@ -10749,6 +10766,8 @@ uninstall-man: uninstall-man1 uninstall-man8
 	uninstall-systemdsystemunitDATA uninstall-taskSCRIPTS \
 	uninstall-updateDATA uninstall-updateSCRIPTS
 
+.PRECIOUS: Makefile
+
 
 clean-local:
 	-rm -rf dist

+ 129 - 65
aclocal.m4

@@ -1,6 +1,6 @@
-# generated automatically by aclocal 1.13.4 -*- Autoconf -*-
+# generated automatically by aclocal 1.15 -*- Autoconf -*-
 
-# Copyright (C) 1996-2013 Free Software Foundation, Inc.
+# Copyright (C) 1996-2014 Free Software Foundation, Inc.
 
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
@@ -20,7 +20,7 @@ You have another version of autoconf.  It may work, but is not guaranteed to.
 If you have problems, you may need to regenerate the build system entirely.
 To do so, use the procedure documented by the package, typically 'autoreconf'.])])
 
-# Copyright (C) 2002-2013 Free Software Foundation, Inc.
+# Copyright (C) 2002-2014 Free Software Foundation, Inc.
 #
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
@@ -32,10 +32,10 @@ To do so, use the procedure documented by the package, typically 'autoreconf'.])
 # generated from the m4 files accompanying Automake X.Y.
 # (This private macro should not be called outside this file.)
 AC_DEFUN([AM_AUTOMAKE_VERSION],
-[am__api_version='1.13'
+[am__api_version='1.15'
 dnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to
 dnl require some minimum version.  Point them to the right macro.
-m4_if([$1], [1.13.4], [],
+m4_if([$1], [1.15], [],
       [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl
 ])
 
@@ -51,14 +51,14 @@ m4_define([_AM_AUTOCONF_VERSION], [])
 # Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced.
 # This function is AC_REQUIREd by AM_INIT_AUTOMAKE.
 AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION],
-[AM_AUTOMAKE_VERSION([1.13.4])dnl
+[AM_AUTOMAKE_VERSION([1.15])dnl
 m4_ifndef([AC_AUTOCONF_VERSION],
   [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
 _AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))])
 
 # Figure out how to run the assembler.                      -*- Autoconf -*-
 
-# Copyright (C) 2001-2013 Free Software Foundation, Inc.
+# Copyright (C) 2001-2014 Free Software Foundation, Inc.
 #
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
@@ -78,7 +78,7 @@ _AM_IF_OPTION([no-dependencies],, [_AM_DEPENDENCIES([CCAS])])dnl
 
 # AM_AUX_DIR_EXPAND                                         -*- Autoconf -*-
 
-# Copyright (C) 2001-2013 Free Software Foundation, Inc.
+# Copyright (C) 2001-2014 Free Software Foundation, Inc.
 #
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
@@ -123,15 +123,14 @@ _AM_IF_OPTION([no-dependencies],, [_AM_DEPENDENCIES([CCAS])])dnl
 # configured tree to be moved without reconfiguration.
 
 AC_DEFUN([AM_AUX_DIR_EXPAND],
-[dnl Rely on autoconf to set up CDPATH properly.
-AC_PREREQ([2.50])dnl
-# expand $ac_aux_dir to an absolute path
-am_aux_dir=`cd $ac_aux_dir && pwd`
+[AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT])dnl
+# Expand $ac_aux_dir to an absolute path.
+am_aux_dir=`cd "$ac_aux_dir" && pwd`
 ])
 
 # AM_COND_IF                                            -*- Autoconf -*-
 
-# Copyright (C) 2008-2013 Free Software Foundation, Inc.
+# Copyright (C) 2008-2014 Free Software Foundation, Inc.
 #
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
@@ -168,7 +167,7 @@ fi[]dnl
 
 # AM_CONDITIONAL                                            -*- Autoconf -*-
 
-# Copyright (C) 1997-2013 Free Software Foundation, Inc.
+# Copyright (C) 1997-2014 Free Software Foundation, Inc.
 #
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
@@ -199,7 +198,7 @@ AC_CONFIG_COMMANDS_PRE(
 Usually this means the macro was only invoked conditionally.]])
 fi])])
 
-# Copyright (C) 1999-2013 Free Software Foundation, Inc.
+# Copyright (C) 1999-2014 Free Software Foundation, Inc.
 #
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
@@ -390,7 +389,7 @@ _AM_SUBST_NOTMAKE([am__nodep])dnl
 
 # Generate code to set up dependency tracking.              -*- Autoconf -*-
 
-# Copyright (C) 1999-2013 Free Software Foundation, Inc.
+# Copyright (C) 1999-2014 Free Software Foundation, Inc.
 #
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
@@ -466,7 +465,7 @@ AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS],
 
 # Do all the work for Automake.                             -*- Autoconf -*-
 
-# Copyright (C) 1996-2013 Free Software Foundation, Inc.
+# Copyright (C) 1996-2014 Free Software Foundation, Inc.
 #
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
@@ -475,6 +474,12 @@ AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS],
 # This macro actually does too much.  Some checks are only needed if
 # your package does certain things.  But this isn't really a big deal.
 
+dnl Redefine AC_PROG_CC to automatically invoke _AM_PROG_CC_C_O.
+m4_define([AC_PROG_CC],
+m4_defn([AC_PROG_CC])
+[_AM_PROG_CC_C_O
+])
+
 # AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE])
 # AM_INIT_AUTOMAKE([OPTIONS])
 # -----------------------------------------------
@@ -550,8 +555,8 @@ AC_REQUIRE([AC_PROG_MKDIR_P])dnl
 # <http://lists.gnu.org/archive/html/automake/2012-07/msg00001.html>
 # <http://lists.gnu.org/archive/html/automake/2012-07/msg00014.html>
 AC_SUBST([mkdir_p], ['$(MKDIR_P)'])
-# We need awk for the "check" target.  The system "awk" is bad on
-# some platforms.
+# We need awk for the "check" target (and possibly the TAP driver).  The
+# system "awk" is bad on some platforms.
 AC_REQUIRE([AC_PROG_AWK])dnl
 AC_REQUIRE([AC_PROG_MAKE_SET])dnl
 AC_REQUIRE([AM_SET_LEADING_DOT])dnl
@@ -583,6 +588,51 @@ dnl macro is hooked onto _AC_COMPILER_EXEEXT early, see below.
 AC_CONFIG_COMMANDS_PRE(dnl
 [m4_provide_if([_AM_COMPILER_EXEEXT],
   [AM_CONDITIONAL([am__EXEEXT], [test -n "$EXEEXT"])])])dnl
+
+# POSIX will say in a future version that running "rm -f" with no argument
+# is OK; and we want to be able to make that assumption in our Makefile
+# recipes.  So use an aggressive probe to check that the usage we want is
+# actually supported "in the wild" to an acceptable degree.
+# See automake bug#10828.
+# To make any issue more visible, cause the running configure to be aborted
+# by default if the 'rm' program in use doesn't match our expectations; the
+# user can still override this though.
+if rm -f && rm -fr && rm -rf; then : OK; else
+  cat >&2 <<'END'
+Oops!
+
+Your 'rm' program seems unable to run without file operands specified
+on the command line, even when the '-f' option is present.  This is contrary
+to the behaviour of most rm programs out there, and not conforming with
+the upcoming POSIX standard: <http://austingroupbugs.net/view.php?id=542>
+
+Please tell [email protected] about your system, including the value
+of your $PATH and any error possibly output before this message.  This
+can help us improve future automake versions.
+
+END
+  if test x"$ACCEPT_INFERIOR_RM_PROGRAM" = x"yes"; then
+    echo 'Configuration will proceed anyway, since you have set the' >&2
+    echo 'ACCEPT_INFERIOR_RM_PROGRAM variable to "yes"' >&2
+    echo >&2
+  else
+    cat >&2 <<'END'
+Aborting the configuration process, to ensure you take notice of the issue.
+
+You can download and install GNU coreutils to get an 'rm' implementation
+that behaves properly: <http://www.gnu.org/software/coreutils/>.
+
+If you want to complete the configuration process using your problematic
+'rm' anyway, export the environment variable ACCEPT_INFERIOR_RM_PROGRAM
+to "yes", and re-run configure.
+
+END
+    AC_MSG_ERROR([Your 'rm' program is bad, sorry.])
+  fi
+fi
+dnl The trailing newline in this macro's definition is deliberate, for
+dnl backward compatibility and to allow trailing 'dnl'-style comments
+dnl after the AM_INIT_AUTOMAKE invocation. See automake bug#16841.
 ])
 
 dnl Hook into '_AC_COMPILER_EXEEXT' early to learn its expansion.  Do not
@@ -591,7 +641,6 @@ dnl mangled by Autoconf and run in a shell conditional statement.
 m4_define([_AC_COMPILER_EXEEXT],
 m4_defn([_AC_COMPILER_EXEEXT])[m4_provide([_AM_COMPILER_EXEEXT])])
 
-
 # When config.status generates a header, we must update the stamp-h file.
 # This file resides in the same directory as the config header
 # that is generated.  The stamp files are numbered to have different names.
@@ -613,7 +662,7 @@ for _am_header in $config_headers :; do
 done
 echo "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count])
 
-# Copyright (C) 2001-2013 Free Software Foundation, Inc.
+# Copyright (C) 2001-2014 Free Software Foundation, Inc.
 #
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
@@ -624,7 +673,7 @@ echo "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_co
 # Define $install_sh.
 AC_DEFUN([AM_PROG_INSTALL_SH],
 [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
-if test x"${install_sh}" != xset; then
+if test x"${install_sh+set}" != xset; then
   case $am_aux_dir in
   *\ * | *\	*)
     install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;;
@@ -634,7 +683,7 @@ if test x"${install_sh}" != xset; then
 fi
 AC_SUBST([install_sh])])
 
-# Copyright (C) 2003-2013 Free Software Foundation, Inc.
+# Copyright (C) 2003-2014 Free Software Foundation, Inc.
 #
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
@@ -656,7 +705,7 @@ AC_SUBST([am__leading_dot])])
 # Add --enable-maintainer-mode option to configure.         -*- Autoconf -*-
 # From Jim Meyering
 
-# Copyright (C) 1996-2013 Free Software Foundation, Inc.
+# Copyright (C) 1996-2014 Free Software Foundation, Inc.
 #
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
@@ -691,7 +740,7 @@ AC_MSG_CHECKING([whether to enable maintainer-specific portions of Makefiles])
 
 # Check to see how 'make' treats includes.	            -*- Autoconf -*-
 
-# Copyright (C) 2001-2013 Free Software Foundation, Inc.
+# Copyright (C) 2001-2014 Free Software Foundation, Inc.
 #
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
@@ -739,41 +788,9 @@ AC_MSG_RESULT([$_am_result])
 rm -f confinc confmf
 ])
 
-# Copyright (C) 1999-2013 Free Software Foundation, Inc.
-#
-# This file is free software; the Free Software Foundation
-# gives unlimited permission to copy and/or distribute it,
-# with or without modifications, as long as this notice is preserved.
-
-# AM_PROG_CC_C_O
-# --------------
-# Like AC_PROG_CC_C_O, but changed for automake.
-AC_DEFUN([AM_PROG_CC_C_O],
-[AC_REQUIRE([AC_PROG_CC_C_O])dnl
-AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
-AC_REQUIRE_AUX_FILE([compile])dnl
-# FIXME: we rely on the cache variable name because
-# there is no other way.
-set dummy $CC
-am_cc=`echo $[2] | sed ['s/[^a-zA-Z0-9_]/_/g;s/^[0-9]/_/']`
-eval am_t=\$ac_cv_prog_cc_${am_cc}_c_o
-if test "$am_t" != yes; then
-   # Losing compiler, so override with the script.
-   # FIXME: It is wrong to rewrite CC.
-   # But if we don't then we get into trouble of one sort or another.
-   # A longer-term fix would be to have automake use am__CC in this case,
-   # and then we could set am__CC="\$(top_srcdir)/compile \$(CC)"
-   CC="$am_aux_dir/compile $CC"
-fi
-dnl Make sure AC_PROG_CC is never called again, or it will override our
-dnl setting of CC.
-m4_define([AC_PROG_CC],
-          [m4_fatal([AC_PROG_CC cannot be called after AM_PROG_CC_C_O])])
-])
-
 # Fake the existence of programs that GNU maintainers use.  -*- Autoconf -*-
 
-# Copyright (C) 1997-2013 Free Software Foundation, Inc.
+# Copyright (C) 1997-2014 Free Software Foundation, Inc.
 #
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
@@ -812,7 +829,7 @@ fi
 
 # Helper functions for option handling.                     -*- Autoconf -*-
 
-# Copyright (C) 2001-2013 Free Software Foundation, Inc.
+# Copyright (C) 2001-2014 Free Software Foundation, Inc.
 #
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
@@ -841,7 +858,54 @@ AC_DEFUN([_AM_SET_OPTIONS],
 AC_DEFUN([_AM_IF_OPTION],
 [m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])])
 
-# Copyright (C) 2001-2013 Free Software Foundation, Inc.
+# Copyright (C) 1999-2014 Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# _AM_PROG_CC_C_O
+# ---------------
+# Like AC_PROG_CC_C_O, but changed for automake.  We rewrite AC_PROG_CC
+# to automatically call this.
+AC_DEFUN([_AM_PROG_CC_C_O],
+[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
+AC_REQUIRE_AUX_FILE([compile])dnl
+AC_LANG_PUSH([C])dnl
+AC_CACHE_CHECK(
+  [whether $CC understands -c and -o together],
+  [am_cv_prog_cc_c_o],
+  [AC_LANG_CONFTEST([AC_LANG_PROGRAM([])])
+  # Make sure it works both with $CC and with simple cc.
+  # Following AC_PROG_CC_C_O, we do the test twice because some
+  # compilers refuse to overwrite an existing .o file with -o,
+  # though they will create one.
+  am_cv_prog_cc_c_o=yes
+  for am_i in 1 2; do
+    if AM_RUN_LOG([$CC -c conftest.$ac_ext -o conftest2.$ac_objext]) \
+         && test -f conftest2.$ac_objext; then
+      : OK
+    else
+      am_cv_prog_cc_c_o=no
+      break
+    fi
+  done
+  rm -f core conftest*
+  unset am_i])
+if test "$am_cv_prog_cc_c_o" != yes; then
+   # Losing compiler, so override with the script.
+   # FIXME: It is wrong to rewrite CC.
+   # But if we don't then we get into trouble of one sort or another.
+   # A longer-term fix would be to have automake use am__CC in this case,
+   # and then we could set am__CC="\$(top_srcdir)/compile \$(CC)"
+   CC="$am_aux_dir/compile $CC"
+fi
+AC_LANG_POP([C])])
+
+# For backward compatibility.
+AC_DEFUN_ONCE([AM_PROG_CC_C_O], [AC_REQUIRE([AC_PROG_CC])])
+
+# Copyright (C) 2001-2014 Free Software Foundation, Inc.
 #
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
@@ -860,7 +924,7 @@ AC_DEFUN([AM_RUN_LOG],
 
 # Check to make sure that the build environment is sane.    -*- Autoconf -*-
 
-# Copyright (C) 1996-2013 Free Software Foundation, Inc.
+# Copyright (C) 1996-2014 Free Software Foundation, Inc.
 #
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
@@ -941,7 +1005,7 @@ AC_CONFIG_COMMANDS_PRE(
 rm -f conftest.file
 ])
 
-# Copyright (C) 2009-2013 Free Software Foundation, Inc.
+# Copyright (C) 2009-2014 Free Software Foundation, Inc.
 #
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
@@ -1001,7 +1065,7 @@ AC_SUBST([AM_BACKSLASH])dnl
 _AM_SUBST_NOTMAKE([AM_BACKSLASH])dnl
 ])
 
-# Copyright (C) 2001-2013 Free Software Foundation, Inc.
+# Copyright (C) 2001-2014 Free Software Foundation, Inc.
 #
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
@@ -1029,7 +1093,7 @@ fi
 INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s"
 AC_SUBST([INSTALL_STRIP_PROGRAM])])
 
-# Copyright (C) 2006-2013 Free Software Foundation, Inc.
+# Copyright (C) 2006-2014 Free Software Foundation, Inc.
 #
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
@@ -1048,7 +1112,7 @@ AC_DEFUN([AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE($@)])
 
 # Check how to create a tarball.                            -*- Autoconf -*-
 
-# Copyright (C) 2004-2013 Free Software Foundation, Inc.
+# Copyright (C) 2004-2014 Free Software Foundation, Inc.
 #
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,

+ 3 - 6
config.h.in

@@ -325,12 +325,12 @@
 /* Use FHS optional layout */
 #undef IS_FHS_OPT
 
-/* LDAP debug flag */
-#undef LDAP_DEBUG
-
 /* Don't use smartheap */
 #undef LDAP_DONT_USE_SMARTHEAP
 
+/* LDAP error logging flag */
+#undef LDAP_ERROR_LOGGING
+
 /* Linux */
 #undef LINUX
 
@@ -356,9 +356,6 @@
 /* no getdomainname */
 #undef NO_DOMAINNAME
 
-/* Define to 1 if your C compiler doesn't accept -c and -o together. */
-#undef NO_MINUS_C_MINUS_O
-
 /* OS version */
 #undef OSVERSION
 

+ 112 - 132
configure

@@ -2819,7 +2819,7 @@ cat >>confdefs.h <<_ACEOF
 #define DS_PACKAGE_STRING "$PACKAGE_STRING"
 _ACEOF
 
-am__api_version='1.13'
+am__api_version='1.15'
 
 ac_aux_dir=
 for ac_dir in "$srcdir" "$srcdir/.." "$srcdir/../.."; do
@@ -3020,8 +3020,8 @@ test "$program_suffix" != NONE &&
 ac_script='s/[\\$]/&&/g;s/;s,x,x,$//'
 program_transform_name=`$as_echo "$program_transform_name" | sed "$ac_script"`
 
-# expand $ac_aux_dir to an absolute path
-am_aux_dir=`cd $ac_aux_dir && pwd`
+# Expand $ac_aux_dir to an absolute path.
+am_aux_dir=`cd "$ac_aux_dir" && pwd`
 
 if test x"${MISSING+set}" != xset; then
   case $am_aux_dir in
@@ -3040,7 +3040,7 @@ else
 $as_echo "$as_me: WARNING: 'missing' script is too old or missing" >&2;}
 fi
 
-if test x"${install_sh}" != xset; then
+if test x"${install_sh+set}" != xset; then
   case $am_aux_dir in
   *\ * | *\	*)
     install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;;
@@ -3359,8 +3359,8 @@ MAKEINFO=${MAKEINFO-"${am_missing_run}makeinfo"}
 # <http://lists.gnu.org/archive/html/automake/2012-07/msg00014.html>
 mkdir_p='$(MKDIR_P)'
 
-# We need awk for the "check" target.  The system "awk" is bad on
-# some platforms.
+# We need awk for the "check" target (and possibly the TAP driver).  The
+# system "awk" is bad on some platforms.
 # Always define AMTAR for backward compatibility.  Yes, it's still used
 # in the wild :-(  We should find a proper way to deprecate it ...
 AMTAR='$${TAR-tar}'
@@ -3461,6 +3461,48 @@ $as_echo "$am_cv_prog_tar_pax" >&6; }
 
 
 
+# POSIX will say in a future version that running "rm -f" with no argument
+# is OK; and we want to be able to make that assumption in our Makefile
+# recipes.  So use an aggressive probe to check that the usage we want is
+# actually supported "in the wild" to an acceptable degree.
+# See automake bug#10828.
+# To make any issue more visible, cause the running configure to be aborted
+# by default if the 'rm' program in use doesn't match our expectations; the
+# user can still override this though.
+if rm -f && rm -fr && rm -rf; then : OK; else
+  cat >&2 <<'END'
+Oops!
+
+Your 'rm' program seems unable to run without file operands specified
+on the command line, even when the '-f' option is present.  This is contrary
+to the behaviour of most rm programs out there, and not conforming with
+the upcoming POSIX standard: <http://austingroupbugs.net/view.php?id=542>
+
+Please tell [email protected] about your system, including the value
+of your $PATH and any error possibly output before this message.  This
+can help us improve future automake versions.
+
+END
+  if test x"$ACCEPT_INFERIOR_RM_PROGRAM" = x"yes"; then
+    echo 'Configuration will proceed anyway, since you have set the' >&2
+    echo 'ACCEPT_INFERIOR_RM_PROGRAM variable to "yes"' >&2
+    echo >&2
+  else
+    cat >&2 <<'END'
+Aborting the configuration process, to ensure you take notice of the issue.
+
+You can download and install GNU coreutils to get an 'rm' implementation
+that behaves properly: <http://www.gnu.org/software/coreutils/>.
+
+If you want to complete the configuration process using your problematic
+'rm' anyway, export the environment variable ACCEPT_INFERIOR_RM_PROGRAM
+to "yes", and re-run configure.
+
+END
+    as_fn_error $? "Your 'rm' program is bad, sorry." "$LINENO" 5
+  fi
+fi
+
 # define these for automake distdir
 VERSION=$PACKAGE_VERSION
 PACKAGE=$PACKAGE_TARNAME
@@ -4811,6 +4853,65 @@ ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
 ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
 ac_compiler_gnu=$ac_cv_c_compiler_gnu
 
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC understands -c and -o together" >&5
+$as_echo_n "checking whether $CC understands -c and -o together... " >&6; }
+if ${am_cv_prog_cc_c_o+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+  # Make sure it works both with $CC and with simple cc.
+  # Following AC_PROG_CC_C_O, we do the test twice because some
+  # compilers refuse to overwrite an existing .o file with -o,
+  # though they will create one.
+  am_cv_prog_cc_c_o=yes
+  for am_i in 1 2; do
+    if { echo "$as_me:$LINENO: $CC -c conftest.$ac_ext -o conftest2.$ac_objext" >&5
+   ($CC -c conftest.$ac_ext -o conftest2.$ac_objext) >&5 2>&5
+   ac_status=$?
+   echo "$as_me:$LINENO: \$? = $ac_status" >&5
+   (exit $ac_status); } \
+         && test -f conftest2.$ac_objext; then
+      : OK
+    else
+      am_cv_prog_cc_c_o=no
+      break
+    fi
+  done
+  rm -f core conftest*
+  unset am_i
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_prog_cc_c_o" >&5
+$as_echo "$am_cv_prog_cc_c_o" >&6; }
+if test "$am_cv_prog_cc_c_o" != yes; then
+   # Losing compiler, so override with the script.
+   # FIXME: It is wrong to rewrite CC.
+   # But if we don't then we get into trouble of one sort or another.
+   # A longer-term fix would be to have automake use am__CC in this case,
+   # and then we could set am__CC="\$(top_srcdir)/compile \$(CC)"
+   CC="$am_aux_dir/compile $CC"
+fi
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+
 depcc="$CC"   am_compiler_list=
 
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking dependency style of $depcc" >&5
@@ -4939,131 +5040,6 @@ else
 fi
 
 
-if test "x$CC" != xcc; then
-  { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC and cc understand -c and -o together" >&5
-$as_echo_n "checking whether $CC and cc understand -c and -o together... " >&6; }
-else
-  { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether cc understands -c and -o together" >&5
-$as_echo_n "checking whether cc understands -c and -o together... " >&6; }
-fi
-set dummy $CC; ac_cc=`$as_echo "$2" |
-		      sed 's/[^a-zA-Z0-9_]/_/g;s/^[0-9]/_/'`
-if eval \${ac_cv_prog_cc_${ac_cc}_c_o+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-
-int
-main ()
-{
-
-  ;
-  return 0;
-}
-_ACEOF
-# Make sure it works both with $CC and with simple cc.
-# We do the test twice because some compilers refuse to overwrite an
-# existing .o file with -o, though they will create one.
-ac_try='$CC -c conftest.$ac_ext -o conftest2.$ac_objext >&5'
-rm -f conftest2.*
-if { { case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
-$as_echo "$ac_try_echo"; } >&5
-  (eval "$ac_try") 2>&5
-  ac_status=$?
-  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
-  test $ac_status = 0; } &&
-   test -f conftest2.$ac_objext && { { case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
-$as_echo "$ac_try_echo"; } >&5
-  (eval "$ac_try") 2>&5
-  ac_status=$?
-  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
-  test $ac_status = 0; };
-then
-  eval ac_cv_prog_cc_${ac_cc}_c_o=yes
-  if test "x$CC" != xcc; then
-    # Test first that cc exists at all.
-    if { ac_try='cc -c conftest.$ac_ext >&5'
-  { { case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
-$as_echo "$ac_try_echo"; } >&5
-  (eval "$ac_try") 2>&5
-  ac_status=$?
-  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
-  test $ac_status = 0; }; }; then
-      ac_try='cc -c conftest.$ac_ext -o conftest2.$ac_objext >&5'
-      rm -f conftest2.*
-      if { { case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
-$as_echo "$ac_try_echo"; } >&5
-  (eval "$ac_try") 2>&5
-  ac_status=$?
-  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
-  test $ac_status = 0; } &&
-	 test -f conftest2.$ac_objext && { { case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
-$as_echo "$ac_try_echo"; } >&5
-  (eval "$ac_try") 2>&5
-  ac_status=$?
-  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
-  test $ac_status = 0; };
-      then
-	# cc works too.
-	:
-      else
-	# cc exists but doesn't like -o.
-	eval ac_cv_prog_cc_${ac_cc}_c_o=no
-      fi
-    fi
-  fi
-else
-  eval ac_cv_prog_cc_${ac_cc}_c_o=no
-fi
-rm -f core conftest*
-
-fi
-if eval test \$ac_cv_prog_cc_${ac_cc}_c_o = yes; then
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
-$as_echo "yes" >&6; }
-else
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-
-$as_echo "#define NO_MINUS_C_MINUS_O 1" >>confdefs.h
-
-fi
-
-# FIXME: we rely on the cache variable name because
-# there is no other way.
-set dummy $CC
-am_cc=`echo $2 | sed 's/[^a-zA-Z0-9_]/_/g;s/^[0-9]/_/'`
-eval am_t=\$ac_cv_prog_cc_${am_cc}_c_o
-if test "$am_t" != yes; then
-   # Losing compiler, so override with the script.
-   # FIXME: It is wrong to rewrite CC.
-   # But if we don't then we get into trouble of one sort or another.
-   # A longer-term fix would be to have automake use am__CC in this case,
-   # and then we could set am__CC="\$(top_srcdir)/compile \$(CC)"
-   CC="$am_aux_dir/compile $CC"
-fi
-
 
 # By default we simply use the C compiler to build assembly code.
 
@@ -22411,7 +22387,11 @@ fi
 
 # AC_DEFINE([USE_OLD_UNHASHED], [], [Use old unhashed code])
 
-$as_echo "#define LDAP_DEBUG 1" >>confdefs.h
+# Internally we use a macro function slapi_log_err() to call slapi_log_error()
+# which gives us the option to do performance testing without the presence of
+# logging.  To remove the presence of error logging undefine LDAP_ERROR_LOGGING.
+
+$as_echo "#define LDAP_ERROR_LOGGING 1" >>confdefs.h
 
 
 $as_echo "#define LDAP_DONT_USE_SMARTHEAP 1" >>confdefs.h

+ 5 - 1
configure.ac

@@ -740,7 +740,11 @@ AC_SUBST(capbrand)
 AC_SUBST(vendor)
 
 # AC_DEFINE([USE_OLD_UNHASHED], [], [Use old unhashed code])
-AC_DEFINE([LDAP_DEBUG], [1], [LDAP debug flag])
+
+# Internally we use a macro function slapi_log_err() to call slapi_log_error()
+# which gives us the option to do performance testing without the presence of
+# logging.  To remove the presence of error logging undefine LDAP_ERROR_LOGGING.
+AC_DEFINE([LDAP_ERROR_LOGGING], [1], [LDAP error logging flag])
 AC_DEFINE([LDAP_DONT_USE_SMARTHEAP], [1], [Don't use smartheap])
 
 # libtool on fedora/rhel contains some gcc-isms which cause problems

+ 1 - 0
ldap/servers/plugins/acct_usability/acct_usability.h

@@ -14,6 +14,7 @@
  * Account Usability Control plug-in header file
  */
 #include "slapi-plugin.h"
+#include "slapi-private.h"
 
 /*
  * Plug-in defines

+ 1 - 1
ldap/servers/plugins/acctpolicy/acct_config.c

@@ -20,8 +20,8 @@ Hewlett-Packard Development Company, L.P.
 
 #include <stdio.h>
 #include <string.h>
-#include "slapi-plugin.h"
 #include "acctpolicy.h"
+#include "slapi-plugin.h"
 #include "nspr.h"
 
 /* Globals */

+ 1 - 1
ldap/servers/plugins/acctpolicy/acct_init.c

@@ -44,8 +44,8 @@ limitattrname: accountInactivityLimit
 
 #include <stdio.h>
 #include <string.h>
-#include "slapi-plugin.h"
 #include "acctpolicy.h"
+#include "slapi-plugin.h"
 
 static Slapi_PluginDesc plugin_desc = { PLUGIN_NAME, PLUGIN_VENDOR,
 				PLUGIN_VERSION, PLUGIN_DESC };

+ 1 - 1
ldap/servers/plugins/acctpolicy/acct_plugin.c

@@ -24,8 +24,8 @@ Hewlett-Packard Development Company, L.P.
 #include <string.h>
 #include <ctype.h>
 #include <time.h>
-#include "slapi-plugin.h"
 #include "acctpolicy.h"
+#include "slapi-plugin.h"
 
 /*
  * acct_policy_dn_is_config()

+ 1 - 1
ldap/servers/plugins/acctpolicy/acct_util.c

@@ -23,8 +23,8 @@ Hewlett-Packard Development Company, L.P.
 #include <string.h>
 #include <time.h>
 #include <ctype.h>
-#include "slapi-plugin.h"
 #include "acctpolicy.h"
+#include "slapi-plugin.h"
 
 /* Globals */
 static void* plugin_id = NULL;

+ 1 - 0
ldap/servers/plugins/acctpolicy/acctpolicy.h

@@ -19,6 +19,7 @@ Hewlett-Packard Development Company, L.P.
 ******************************************************************************/
 
 #include <limits.h> /* ULONG_MAX */
+#include "slapi-private.h"
 #include "nspr.h"
 
 #define CFG_LASTLOGIN_STATE_ATTR "stateAttrName"

+ 1 - 0
ldap/servers/plugins/automember/automember.h

@@ -20,6 +20,7 @@
 #include "portable.h"
 #include "nspr.h"
 #include "slapi-plugin.h"
+#include "slapi-private.h"
 #include "prclist.h"
 #include "ldif.h"
 

+ 1 - 0
ldap/servers/plugins/deref/deref.h

@@ -14,6 +14,7 @@
  * Dereference plug-in header file
  */
 #include "slapi-plugin.h"
+#include "slapi-private.h"
 
 /*
  * Plug-in defines

+ 1 - 0
ldap/servers/plugins/linkedattrs/linked_attrs.h

@@ -20,6 +20,7 @@
 #include "portable.h"
 #include "nspr.h"
 #include "slapi-plugin.h"
+#include "slapi-private.h"
 #include "prclist.h"
 #include "ldif.h"
 

+ 1 - 0
ldap/servers/plugins/mep/mep.h

@@ -22,6 +22,7 @@
 #include "slapi-plugin.h"
 #include "prclist.h"
 #include "ldif.h"
+#include "slapi-private.h"
 
 /*
  * Plug-in defines

+ 1 - 2
ldap/servers/plugins/posix-winsync/posix-group-func.c

@@ -18,10 +18,9 @@
  $Id: posix-group-func.c 28 2011-05-13 14:35:29Z grzemba $
  */
 #include <string.h>
-#include "slapi-plugin.h"
-#include <nspr.h>
 #include "posix-wsp-ident.h"
 #include "posix-group-func.h"
+#include "slapi-plugin.h"
 
 #define MAX_RECURSION_DEPTH (5)
 

+ 2 - 0
ldap/servers/plugins/posix-winsync/posix-group-func.h

@@ -5,6 +5,8 @@
 #ifndef POSIX_GROUP_WINSYNC_H
 #define POSIX_GROUP_WINSYNC_H
 
+#include "slapi-private.h"
+
 /*
 Slapi_PBlock *searchDN( const char *baseDN, const char *filter, char *attrs[] );
 Slapi_PBlock * dnHasObjectClass( const char *baseDN, const char *objectClass, Slapi_Entry **entry );

+ 2 - 3
ldap/servers/plugins/posix-winsync/posix-group-task.c

@@ -1,9 +1,8 @@
-#include "slapi-plugin.h"
-#include "nspr.h"
 #include <string.h>
-
 #include "posix-wsp-ident.h"
 #include "posix-group-func.h"
+#include "slapi-plugin.h"
+
 
 typedef struct _task_data
 {

+ 3 - 3
ldap/servers/plugins/posix-winsync/posix-winsync-config.c

@@ -10,6 +10,9 @@
  $HeadURL: file:///storejet/svn/posix-winsync-plugin/trunk/posix-winsync-config.c $
  */
 
+#include "posix-wsp-ident.h"
+#include <string.h>
+#include "posix-group-func.h"
 #ifdef WINSYNC_TEST_POSIX
 #include <slapi-plugin.h>
 #include "winsync-plugin.h"
@@ -17,9 +20,6 @@
 #include <dirsrv/slapi-plugin.h>
 #include <dirsrv/winsync-plugin.h>
 #endif
-#include "posix-wsp-ident.h"
-#include <string.h>
-#include "posix-group-func.h"
 
 #define POSIX_WINSYNC_CONFIG_FILTER "(objectclass=*)"
 /*

+ 1 - 0
ldap/servers/plugins/posix-winsync/posix-wsp-ident.h

@@ -5,6 +5,7 @@
 #ifndef POSIX_WINSYNC_H
 #define POSIX_WINSYNC_H
 
+#include "slapi-private.h"
 
 #define POSIX_WINSYNC_PLUGIN_NAME "posix-winsync"
 

+ 1 - 0
ldap/servers/plugins/pwdstorage/pwdstorage.h

@@ -15,6 +15,7 @@
 #define _PWDSTORAGE_H
 
 #include "slapi-plugin.h"
+#include "slapi-private.h"
 #include <ssl.h>
 #include "nspr.h"
 #include "plbase64.h"

+ 14 - 8
ldap/servers/plugins/replication/repl_session_plugin.c

@@ -25,8 +25,8 @@ repl_session_plugin_init()
     if((NULL == _ReplSessionAPI) &&
        (slapi_apib_get_interface(REPL_SESSION_v1_0_GUID, &_ReplSessionAPI) ||
        (NULL == _ReplSessionAPI))) {
-            slapi_log_err(SLAPI_LOG_PLUGIN,
-                   "repl_session_plugin_init", "No replication session"
+            slapi_log_err(SLAPI_LOG_PLUGIN, repl_plugin_name,
+                   "repl_session_plugin_init - No replication session"
                    " plugin API registered for GUID [%s] -- end\n",
                    REPL_SESSION_v1_0_GUID);
     }
@@ -41,7 +41,8 @@ repl_session_plugin_call_agmt_init_cb(Repl_Agmt *ra)
     Slapi_DN *replarea = NULL;
     repl_session_plugin_agmt_init_cb initfunc = NULL;
 
-    slapi_log_err(SLAPI_LOG_PLUGIN, "repl_session_plugin_call_agmt_init_cb", "Begin\n");
+    slapi_log_err(SLAPI_LOG_PLUGIN, repl_plugin_name,
+            "repl_session_plugin_call_agmt_init_cb - Begin\n");
 
     if (_ReplSessionAPI) {
         initfunc = (repl_session_plugin_agmt_init_cb)_ReplSessionAPI[REPL_SESSION_PLUGIN_AGMT_INIT_CB];
@@ -49,7 +50,8 @@ repl_session_plugin_call_agmt_init_cb(Repl_Agmt *ra)
     if (initfunc) {
         replarea = agmt_get_replarea(ra);
         if (!replarea) {
-            slapi_log_err(SLAPI_LOG_ERR, "repl_session_plugin_call_agmt_init_cb", "Aborted - No replication area\n");
+            slapi_log_err(SLAPI_LOG_ERR, repl_plugin_name,
+                    "repl_session_plugin_call_agmt_init_cb- Aborted - No replication area\n");
             return;
         }
         cookie = (*initfunc)(replarea);
@@ -58,7 +60,7 @@ repl_session_plugin_call_agmt_init_cb(Repl_Agmt *ra)
 
     agmt_set_priv(ra, cookie);
 
-    slapi_log_err(SLAPI_LOG_PLUGIN, "<-- repl_session_plugin_call_agmt_init_cb", " end\n");
+    slapi_log_err(SLAPI_LOG_PLUGIN, repl_plugin_name, "repl_session_plugin_call_agmt_init_cb - End\n");
 
     return;
 }
@@ -78,7 +80,9 @@ repl_session_plugin_call_pre_acquire_cb(const Repl_Agmt *ra, int is_total,
     if (thefunc) {
         replarea = agmt_get_replarea(ra);
         if (!replarea) {
-            slapi_log_err(SLAPI_LOG_ERR, "repl_session_plugin_call_pre_acquire_cb", "Aborted - No replication area\n");
+            slapi_log_err(SLAPI_LOG_ERR, repl_plugin_name,
+                    "repl_session_plugin_call_pre_acquire_cb "
+                    "- Aborted - No replication area\n");
             return 1;
         }
         rc = (*thefunc)(agmt_get_priv(ra), replarea, is_total, data_guid, data);
@@ -103,7 +107,8 @@ repl_session_plugin_call_post_acquire_cb(const Repl_Agmt *ra, int is_total,
     if (thefunc) {
         replarea = agmt_get_replarea(ra);
         if (!replarea) {
-            slapi_log_err(SLAPI_LOG_ERR, "repl_session_plugin_call_post_acquire_cb", "Aborted - No replication area\n");
+            slapi_log_err(SLAPI_LOG_ERR, repl_plugin_name,
+                    "repl_session_plugin_call_post_acquire_cb - Aborted - No replication area\n");
             return 1;
         }
         rc = (*thefunc)(agmt_get_priv(ra), replarea, is_total, data_guid, data);
@@ -162,7 +167,8 @@ repl_session_plugin_call_destroy_agmt_cb(const Repl_Agmt *ra)
     if (thefunc) {
         replarea = agmt_get_replarea(ra);
         if (!replarea) {
-            slapi_log_err(SLAPI_LOG_ERR, "repl_session_plugin_call_destroy_agmt_cb", "Aborted - No replication area\n");
+            slapi_log_err(SLAPI_LOG_ERR, repl_plugin_name,
+                    "repl_session_plugin_call_destroy_agmt_cb - Aborted - No replication area\n");
             return;
         }
         (*thefunc)(agmt_get_priv(ra), replarea);

+ 17 - 20
ldap/servers/plugins/replication/windows_private.c

@@ -931,25 +931,20 @@ create_subtree_pairs(char **pairs)
 		p0 = ldap_utf8strtok_r(*ptr, ":", &saveptr);
 		p1 = ldap_utf8strtok_r(NULL, ":", &saveptr);
 		if ((NULL == p0) || (NULL == p1)) {
-			slapi_log_err(SLAPI_LOG_ERR,
-			              "create_subtree_pairs",
-			              "Ignoring invalid subtree pairs \"%s\".\n", *ptr);
+			slapi_log_err(SLAPI_LOG_ERR, windows_repl_plugin_name,
+				"create_subtree_pairs - Ignoring invalid subtree pairs \"%s\".\n", *ptr);
 			continue;
 		}
 		spp->DSsubtree = slapi_sdn_new_dn_byval(p0);
 		if (NULL == spp->DSsubtree) {
-			slapi_log_err(SLAPI_LOG_ERR,
-			              "create_subtree_pairs",
-			              "Ignoring invalid DS subtree \"%s\".\n",
-			              p0);
+			slapi_log_err(SLAPI_LOG_ERR, windows_repl_plugin_name,
+				"create_subtree_pairs - Ignoring invalid DS subtree \"%s\".\n", p0);
 			continue;
 		}
 		spp->ADsubtree = slapi_sdn_new_dn_byval(p1);
 		if (NULL == spp->ADsubtree) {
-			slapi_log_err(SLAPI_LOG_ERR,
-			              "create_subtree_pairs",
-			              "Ignoring invalid AD subtree \"%s\".\n",
-			              p1);
+			slapi_log_err(SLAPI_LOG_ERR, windows_repl_plugin_name,
+				"create_subtree_pairs - Ignoring invalid AD subtree \"%s\".\n", p1);
 			slapi_sdn_free(&(spp->DSsubtree));
 			continue;
 		}
@@ -1027,7 +1022,7 @@ windows_private_set_windows_treetop(const Repl_Agmt *ra, char *treetop)
 				dp->windows_treetop = treetop_sdn;
 			} else {
 				slapi_log_err(SLAPI_LOG_ERR, windows_repl_plugin_name,
-				               "windows_private_set_windows_treetop: "
+				               "windows_private_set_windows_treetop - "
 				               "winSyncSubtreePair contains inconsistent Windows subtrees.\n");
 				dp->windows_treetop = NULL;
 			}
@@ -1090,7 +1085,7 @@ windows_private_set_directory_treetop(const Repl_Agmt *ra, char *treetop)
 				dp->directory_treetop = treetop_sdn;
 			} else {
 				slapi_log_err(SLAPI_LOG_ERR, windows_repl_plugin_name, 
-				               "windows_private_set_directory_treetop: "
+				               "windows_private_set_directory_treetop - "
 				               "winSyncSubtreePair contains inconsistent Windows subtrees.\n");
 				dp->directory_treetop = NULL;
 			}
@@ -1232,9 +1227,11 @@ choke:
 	}
 
 #ifdef FOR_DEBUGGING
-	slapi_log_err(SLAPI_LOG_TRACE, windows_repl_plugin_name, "<= windows_private_update_dirsync_control: rc=%d\n", return_value);
+	slapi_log_err(SLAPI_LOG_TRACE, windows_repl_plugin_name,
+		"<= windows_private_update_dirsync_control - rc=%d\n", return_value);
 #else
-	slapi_log_err(SLAPI_LOG_TRACE, windows_repl_plugin_name, "<= windows_private_update_dirsync_control\n" );
+	slapi_log_err(SLAPI_LOG_TRACE, windows_repl_plugin_name,
+		"<= windows_private_update_dirsync_control\n" );
 #endif
 }
 
@@ -1691,7 +1688,7 @@ windows_plugin_callonce(void)
         
         if (slapi_apib_get_interface_all(guid, &theapis) || (NULL == theapis)) {
             slapi_log_err(SLAPI_LOG_PLUGIN, windows_repl_plugin_name, 
-                          "<-- windows_plugin_callonce -- no more windows plugin APIs registered "
+                          "<-- windows_plugin_callonce - No more windows plugin APIs registered "
                           "for GUID [%s] -- end\n",
                           guid);
         } else {
@@ -1699,7 +1696,7 @@ windows_plugin_callonce(void)
             for (idx = 0; theapis && theapis[idx]; ++idx) {
                 if (windows_plugin_add(theapis[idx], maxapi)) {
                     slapi_log_err(SLAPI_LOG_PLUGIN, windows_repl_plugin_name, 
-                              "<-- windows_plugin_callonce -- already added windows plugin API "
+                              "<-- windows_plugin_callonce - Already added windows plugin API "
                               "[%d][0x%p] for GUID [%s] -- end\n",
                               idx, theapis[idx], guid);
                 }
@@ -1756,11 +1753,11 @@ windows_plugin_init(Repl_Agmt *ra)
     struct winsync_plugin_cookie *list = NULL;
     void *cookie = NULL;
 
-    slapi_log_err(SLAPI_LOG_PLUGIN, windows_repl_plugin_name, "--> windows_plugin_init - begin\n");
+    slapi_log_err(SLAPI_LOG_PLUGIN, windows_repl_plugin_name, "windows_plugin_init - Begin\n");
 
     if (PR_CallOnce(&winsync_callOnce, windows_plugin_callonce)) {
 	    PRErrorCode prerr = PR_GetError();
-	    slapi_log_err(SLAPI_LOG_ERR, windows_repl_plugin_name,  "windows_plugin_init"
+	    slapi_log_err(SLAPI_LOG_ERR, windows_repl_plugin_name,  "windows_plugin_init - "
 		    	    "Cannot initialize plugin: %d:%s\n", prerr,
 		    	    slapi_pr_strerror(prerr));
 	    return;
@@ -1780,7 +1777,7 @@ windows_plugin_init(Repl_Agmt *ra)
        
     windows_private_set_api_cookie(ra, list);
 
-    slapi_log_err(SLAPI_LOG_PLUGIN, windows_repl_plugin_name, "<-- windows_plugin_init - end\n");
+    slapi_log_err(SLAPI_LOG_PLUGIN, windows_repl_plugin_name, "<-- windows_plugin_init - End\n");
     return;
 }
 

+ 0 - 1
ldap/servers/plugins/retrocl/retrocl.h

@@ -21,7 +21,6 @@
 
 #include "slapi-private.h"
 #include "slapi-plugin.h"
-/* #include "portable.h" */
 #include "ldif.h"
 #include "slap.h"
 

+ 1 - 0
ldap/servers/plugins/rootdn_access/rootdn_access.h

@@ -15,6 +15,7 @@
  *  Root DN access control plug-in header file
  */
 #include "slapi-plugin.h"
+#include "slapi-private.h"
 #include <nspr.h>
 #include <time.h>
 #include <ctype.h>

+ 1 - 0
ldap/servers/plugins/statechange/statechange.c

@@ -17,6 +17,7 @@
 #include <string.h>
 #include "portable.h"
 #include "slapi-plugin.h"
+#include "slapi-private.h"
 #include "statechange.h"
 #include <sys/stat.h>
 

+ 1 - 0
ldap/servers/plugins/sync/sync.h

@@ -17,6 +17,7 @@
 #include <stdio.h>
 #include <string.h>
 #include "slapi-plugin.h"
+#include "slapi-private.h"
 
 #define PLUGIN_NAME              "content-sync-plugin"
 

+ 2 - 1
ldap/servers/plugins/uiduniq/7bit.c

@@ -21,10 +21,11 @@
  */
 #include <stdio.h>
 #include <slapi-plugin.h>
+#include <slapi-private.h>
 #include <string.h>
 
 /* DBDB this should be pulled from a common header file */
-#if defined( LDAP_DEBUG ) && !defined( DEBUG )
+#if defined( LDAP_ERROR_LOGGING ) && !defined( DEBUG )
 #define DEBUG
 #endif
 

+ 2 - 1
ldap/servers/plugins/uiduniq/plugin-utils.h

@@ -42,8 +42,9 @@
 #include "slapi-plugin-compat4.h"
 #include <stdio.h>
 #include <string.h>
+#include <slapi-private.h>
 
-#ifdef LDAP_DEBUG
+#ifdef LDAP_ERROR_LOGGING
 #ifndef DEBUG
 #define DEBUG
 #endif

+ 2 - 1
ldap/servers/plugins/uiduniq/uid.c

@@ -23,11 +23,12 @@
  */
 #include <slapi-plugin.h>
 #include <portable.h>
+#include <slapi-private.h>
 #include <string.h>
 #include "plugin-utils.h"
 #include "nspr.h"
 
-#if defined( LDAP_DEBUG ) && !defined( DEBUG )
+#if defined( LDAP_ERROR_LOGGING ) && !defined( DEBUG )
 #define DEBUG
 #endif
 

+ 1 - 0
ldap/servers/plugins/whoami/whoami.c

@@ -17,6 +17,7 @@
 #include <stdio.h>
 #include <string.h>
 #include "slapi-plugin.h"
+#include "slapi-private.h"
 
 #define PLUGIN_NAME              "whoami-plugin"
 #define PLUGIN_DESC              "whoami extended operation plugin"

+ 2 - 2
ldap/servers/slapd/back-ldbm/filterindex.c

@@ -207,7 +207,7 @@ ava_candidates(
     slapi_pblock_get(pb, SLAPI_PAGED_RESULTS_INDEX, &pr_idx);
     slapi_attr_init(&sattr, type);
 
-#ifdef LDAP_DEBUG
+#ifdef LDAP_ERROR_LOGGING
     if ( loglevel_is_set( LDAP_DEBUG_TRACE )) {
         char    *op = NULL;
         char    buf[BUFSIZ];
@@ -981,7 +981,7 @@ keys2idl(
 
         idl2 = index_read_ext_allids( pb, be, type, indextype, slapi_value_get_berval(ivals[i]), txn, err, unindexed, allidslimit );
 
-#ifdef LDAP_DEBUG
+#ifdef LDAP_ERROR_LOGGING
         /* XXX if ( slapd_ldap_debug & LDAP_DEBUG_TRACE ) { XXX */
         {
             char    buf[BUFSIZ];

+ 3 - 3
ldap/servers/slapd/back-ldbm/index.c

@@ -1599,7 +1599,7 @@ index_range_read_ext(
         slapi_log_err(SLAPI_LOG_FILTER,
                       "index_range_read_ext", "dbc->c_get(...DB_NEXT) == %i\n", *err);
     }
-#ifdef LDAP_DEBUG
+#ifdef LDAP_ERROR_LOGGING
     /* this is for debugging only */
     if (idl != NULL) {
         if (ALLIDS(idl)) {
@@ -1737,7 +1737,7 @@ addordel_values(
                  */
 		key.flags = DB_DBT_USERMEM;
                 key.ulen = tmpbuflen;
-#ifdef LDAP_DEBUG
+#ifdef LDAP_ERROR_LOGGING
 		/* XXX if ( slapd_ldap_debug & LDAP_DEBUG_TRACE )  XXX */
 		{
 			char encbuf[BUFSIZ];
@@ -1907,7 +1907,7 @@ addordel_values_sv(
          */
         key.flags = DB_DBT_USERMEM;
         key.ulen = tmpbuflen;
-#ifdef LDAP_DEBUG
+#ifdef LDAP_ERROR_LOGGING
         /* XXX if ( slapd_ldap_debug & LDAP_DEBUG_TRACE )  XXX */
         {
             char encbuf[BUFSIZ];

+ 3 - 3
ldap/servers/slapd/daemon.c

@@ -1146,7 +1146,7 @@ void slapd_daemon( daemon_ports_t *ports )
 
 		tp_config.max_threads = maxthreads;
 		tp_config.stacksize = SLAPD_DEFAULT_THREAD_STACKSIZE;
-#ifdef LDAP_DEBUG
+#ifdef LDAP_ERROR_LOGGING
 		tp_config.log_fct = nunc_stans_logging;
 #else
 		tp_config.log_fct = NULL;
@@ -1689,12 +1689,12 @@ handle_pr_read_ready(Connection_Table *ct, PRIntn num_poll)
 	time_t curtime = current_time();
 	int maxthreads = config_get_maxthreadsperconn();
 
-#if LDAP_DEBUG
+#if LDAP_ERROR_LOGGING
 	if ( slapd_ldap_debug & LDAP_DEBUG_CONNS )
 	{
 		connection_table_dump_activity_to_errors_log(ct);
 	}
-#endif /* LDAP_DEBUG */
+#endif /* LDAP_ERROR_LOGGING */
 
 
 	/*

+ 5 - 5
ldap/servers/slapd/main.c

@@ -1449,7 +1449,7 @@ process_command_line(int argc, char **argv, char *myname,
 							 long_opts, &longopt_index)) != EOF ) {
 		char *configdir = 0;
 		switch ( i ) {
-#ifdef LDAP_DEBUG
+#ifdef LDAP_ERROR_LOGGING
 		case 'd':	/* turn on debugging */
 			if ( optarg_ext[0] == '?'
 						|| 0 == strcasecmp( optarg_ext, "help" )) {
@@ -1468,7 +1468,7 @@ process_command_line(int argc, char **argv, char *myname,
 #else
 		case 'd':	/* turn on debugging */
 			fprintf( stderr,
-			    "must compile with LDAP_DEBUG for debugging\n" );
+			    "must compile with LDAP_ERROR_LOGGING for debugging\n" );
 			break;
 #endif
 
@@ -2726,7 +2726,7 @@ slapd_exemode_dbverify(void)
 }
 
 
-#ifdef LDAP_DEBUG
+#ifdef LDAP_ERROR_LOGGING
 /*
  * Table to associate a string with a debug level.
  */
@@ -2772,7 +2772,7 @@ static struct slapd_debug_level_entry {
 
 
 /*
- * Given a string represention of a debug level, map it to a integer value
+ * Given a string representation of a debug level, map it to a integer value
  * and return that value.  -1 is returned upon error, with a message
  * printed to stderr.
  */
@@ -2893,7 +2893,7 @@ slapd_debug_level_usage( void )
 				"    -d 8+32\n"
 				"    -d 40\n" );
 }
-#endif /* LDAP_DEBUG */
+#endif /* LDAP_ERROR_LOGGING */
 
 static int
 force_to_disable_security(const char *what, int *init_ssl, daemon_ports_t *ports_info)

+ 2 - 2
ldap/servers/slapd/modify.c

@@ -51,7 +51,7 @@ static int hash_rootpw (LDAPMod **mods);
 static int valuearray_init_bervalarray_unhashed_only(struct berval **bvals, Slapi_Value ***cvals);
 static void optimize_mods(Slapi_Mods *smods);
 
-#ifdef LDAP_DEBUG
+#ifdef LDAP_ERROR_LOGGING
 static const char*
 mod_op_image (int op)
 {
@@ -358,7 +358,7 @@ do_modify( Slapi_PBlock *pb )
 		goto free_and_return;
 	}
 
-#ifdef LDAP_DEBUG
+#ifdef LDAP_ERROR_LOGGING
 	slapi_log_err(SLAPI_LOG_ARGS, "do_modify", "modifications:\n");
 	for (mod = slapi_mods_get_first_mod(&smods); mod != NULL; 
 		 mod = slapi_mods_get_next_mod(&smods))

+ 0 - 8
ldap/servers/slapd/slapi-plugin.h

@@ -27,7 +27,6 @@
 extern "C" {
 #endif
 
-#include "portable.h"
 #include "prtypes.h"
 #include "ldap.h"
 #include "prprf.h"
@@ -58,13 +57,6 @@ NSPR_API(PRUint32) PR_fprintf(struct PRFileDesc* fd, const char *fmt, ...)
         ;
 #endif
 
-/* Define our logging macros */
-#define slapi_log_err(level, subsystem, fmt, ...)
-#ifdef LDAP_DEBUG
-# undef slapi_log_err
-# define slapi_log_err(level, subsystem, ...) slapi_log_error(level, subsystem, __VA_ARGS__)
-#endif
-
 /* NSPR uses the print macros a bit differently than ANSI C.  We
  * need to use ll for a 64-bit integer, even when a long is 64-bit.
  */

+ 8 - 0
ldap/servers/slapd/slapi-private.h

@@ -22,6 +22,7 @@ extern "C" {
 
 #include <time.h>		/* for time_t */
 #include "nspr.h"
+#include "portable.h"
 #include "slapi-plugin.h"
 /*
  * XXXmcs: we can stop including slapi-plugin-compat4.h once we stop using
@@ -29,6 +30,13 @@ extern "C" {
  */
 #include "slapi-plugin-compat4.h"
 
+/* Define our internal logging macro */
+#define slapi_log_err(level, subsystem, fmt, ...)
+#ifdef LDAP_ERROR_LOGGING
+# undef slapi_log_err
+# define slapi_log_err(level, subsystem, ...) slapi_log_error(level, subsystem, __VA_ARGS__)
+#endif
+
 /*
  * server shutdown status
  */

+ 1 - 1
ldap/servers/slapd/tools/ldaptool.h

@@ -112,7 +112,7 @@ extern char		*ldaptool_progname;
 extern FILE		*ldaptool_fp;
 extern char		*ldaptool_charset;
 extern LDAPControl	*ldaptool_request_ctrls[];
-#ifdef LDAP_DEBUG
+#ifdef LDAP_ERROR_LOGGING
 extern int ldaptool_dbg_lvl;
 #define LDAPToolDebug(lvl,fmt,arg1,arg2,arg3) if (lvl & ldaptool_dbg_lvl) { fprintf(stderr,fmt,arg1,arg2,arg3); }
 #else