From d80d054e430b35855cc819255776295d1ccde6d1 Mon Sep 17 00:00:00 2001 From: Mark Reynolds Date: Oct 12 2016 01:28:40 +0000 Subject: Ticket 48978 - refactor LDADebug() to slapi_log_err() Description: Refactor LDAPDebug() & slapi_log_error() to slapi_log_err(). slapi_err_log() is a macro function that can be undefined for performance testing. Also removed ldaplog.h which contained all the old LDAPDebug macro functions. https://fedorahosted.org/389/ticket/48978 Reviewed by: wibrown & nhosoi(Thanks!!) --- diff --git a/Makefile.am b/Makefile.am index 7458ab7..4f1c92e 100644 --- a/Makefile.am +++ b/Makefile.am @@ -318,7 +318,6 @@ dist_noinst_HEADERS = \ ldap/include/avl.h \ ldap/include/dblayer.h \ ldap/include/disptmpl.h \ - ldap/include/ldaplog.h \ ldap/include/ldaprot.h \ ldap/include/ldbm.h \ ldap/include/portable.h \ diff --git a/Makefile.in b/Makefile.in index f7b3c95..b75dc58 100644 --- a/Makefile.in +++ b/Makefile.in @@ -1,7 +1,7 @@ -# Makefile.in generated by automake 1.13.4 from Makefile.am. +# Makefile.in generated by automake 1.15 from Makefile.am. # @configure_input@ -# Copyright (C) 1994-2013 Free Software Foundation, Inc. +# Copyright (C) 1994-2014 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -20,7 +20,17 @@ VPATH = @srcdir@ -am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)' +am__is_gnu_make = { \ + if test -z '$(MAKELEVEL)'; then \ + false; \ + elif test -n '$(MAKE_HOST)'; then \ + true; \ + elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ + true; \ + else \ + false; \ + fi; \ +} am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ @@ -93,12 +103,6 @@ noinst_PROGRAMS = makstrdb$(EXEEXT) @SOLARIS_TRUE@am__append_2 = -lrt @SOLARIS_TRUE@am__append_3 = ldap/servers/slapd/tools/ldclt/opCheck.c subdir = . -DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \ - $(top_srcdir)/configure $(am__configure_deps) \ - $(srcdir)/config.h.in $(top_srcdir)/rpm/389-ds-base.spec.in \ - depcomp $(dist_man_MANS) $(dist_noinst_DATA) \ - $(dist_noinst_HEADERS) $(serverinc_HEADERS) README compile \ - config.guess config.sub install-sh missing ltmain.sh ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/libtool.m4 \ $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ @@ -113,6 +117,9 @@ am__aclocal_m4_deps = $(top_srcdir)/m4/libtool.m4 \ $(top_srcdir)/m4/systemd.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) +DIST_COMMON = $(srcdir)/Makefile.am $(top_srcdir)/configure \ + $(am__configure_deps) $(dist_noinst_DATA) \ + $(dist_noinst_HEADERS) $(serverinc_HEADERS) $(am__DIST_COMMON) am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \ configure.lineno config.status.lineno mkinstalldirs = $(install_sh) -d @@ -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) @@ -1327,6 +1338,7 @@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ +LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ MAINT = @MAINT@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ @@ -1730,7 +1742,6 @@ dist_noinst_HEADERS = \ ldap/include/avl.h \ ldap/include/dblayer.h \ ldap/include/disptmpl.h \ - ldap/include/ldaplog.h \ ldap/include/ldaprot.h \ ldap/include/ldbm.h \ ldap/include/portable.h \ @@ -3251,7 +3262,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*) \ @@ -3272,8 +3282,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 @@ -10370,10 +10380,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) @@ -10408,16 +10424,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 \ @@ -10745,6 +10762,8 @@ uninstall-man: uninstall-man1 uninstall-man8 uninstall-systemdsystemunitDATA uninstall-taskSCRIPTS \ uninstall-updateDATA uninstall-updateSCRIPTS +.PRECIOUS: Makefile + clean-local: -rm -rf dist diff --git a/aclocal.m4 b/aclocal.m4 index 58e04a0..8d926b8 100644 --- a/aclocal.m4 +++ b/aclocal.m4 @@ -1,6 +1,6 @@ -# generated automatically by aclocal 1.13.4 -*- Autoconf -*- +# generated automatically by aclocal 1.15 -*- Autoconf -*- -# Copyright (C) 1996-2013 Free Software Foundation, Inc. +# Copyright (C) 1996-2014 Free Software Foundation, Inc. # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -20,7 +20,7 @@ You have another version of autoconf. It may work, but is not guaranteed to. If you have problems, you may need to regenerate the build system entirely. To do so, use the procedure documented by the package, typically 'autoreconf'.])]) -# Copyright (C) 2002-2013 Free Software Foundation, Inc. +# Copyright (C) 2002-2014 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -32,10 +32,10 @@ To do so, use the procedure documented by the package, typically 'autoreconf'.]) # generated from the m4 files accompanying Automake X.Y. # (This private macro should not be called outside this file.) AC_DEFUN([AM_AUTOMAKE_VERSION], -[am__api_version='1.13' +[am__api_version='1.15' dnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to dnl require some minimum version. Point them to the right macro. -m4_if([$1], [1.13.4], [], +m4_if([$1], [1.15], [], [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl ]) @@ -51,14 +51,14 @@ m4_define([_AM_AUTOCONF_VERSION], []) # Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced. # This function is AC_REQUIREd by AM_INIT_AUTOMAKE. AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION], -[AM_AUTOMAKE_VERSION([1.13.4])dnl +[AM_AUTOMAKE_VERSION([1.15])dnl m4_ifndef([AC_AUTOCONF_VERSION], [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl _AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))]) # Figure out how to run the assembler. -*- Autoconf -*- -# Copyright (C) 2001-2013 Free Software Foundation, Inc. +# Copyright (C) 2001-2014 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -78,7 +78,7 @@ _AM_IF_OPTION([no-dependencies],, [_AM_DEPENDENCIES([CCAS])])dnl # AM_AUX_DIR_EXPAND -*- Autoconf -*- -# Copyright (C) 2001-2013 Free Software Foundation, Inc. +# Copyright (C) 2001-2014 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -123,15 +123,14 @@ _AM_IF_OPTION([no-dependencies],, [_AM_DEPENDENCIES([CCAS])])dnl # configured tree to be moved without reconfiguration. AC_DEFUN([AM_AUX_DIR_EXPAND], -[dnl Rely on autoconf to set up CDPATH properly. -AC_PREREQ([2.50])dnl -# expand $ac_aux_dir to an absolute path -am_aux_dir=`cd $ac_aux_dir && pwd` +[AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT])dnl +# Expand $ac_aux_dir to an absolute path. +am_aux_dir=`cd "$ac_aux_dir" && pwd` ]) # AM_COND_IF -*- Autoconf -*- -# Copyright (C) 2008-2013 Free Software Foundation, Inc. +# Copyright (C) 2008-2014 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -168,7 +167,7 @@ fi[]dnl # AM_CONDITIONAL -*- Autoconf -*- -# Copyright (C) 1997-2013 Free Software Foundation, Inc. +# Copyright (C) 1997-2014 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -199,7 +198,7 @@ AC_CONFIG_COMMANDS_PRE( Usually this means the macro was only invoked conditionally.]]) fi])]) -# Copyright (C) 1999-2013 Free Software Foundation, Inc. +# Copyright (C) 1999-2014 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -390,7 +389,7 @@ _AM_SUBST_NOTMAKE([am__nodep])dnl # Generate code to set up dependency tracking. -*- Autoconf -*- -# Copyright (C) 1999-2013 Free Software Foundation, Inc. +# Copyright (C) 1999-2014 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -466,7 +465,7 @@ AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS], # Do all the work for Automake. -*- Autoconf -*- -# Copyright (C) 1996-2013 Free Software Foundation, Inc. +# Copyright (C) 1996-2014 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -475,6 +474,12 @@ AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS], # This macro actually does too much. Some checks are only needed if # your package does certain things. But this isn't really a big deal. +dnl Redefine AC_PROG_CC to automatically invoke _AM_PROG_CC_C_O. +m4_define([AC_PROG_CC], +m4_defn([AC_PROG_CC]) +[_AM_PROG_CC_C_O +]) + # AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE]) # AM_INIT_AUTOMAKE([OPTIONS]) # ----------------------------------------------- @@ -550,8 +555,8 @@ AC_REQUIRE([AC_PROG_MKDIR_P])dnl # # AC_SUBST([mkdir_p], ['$(MKDIR_P)']) -# We need awk for the "check" target. The system "awk" is bad on -# some platforms. +# We need awk for the "check" target (and possibly the TAP driver). The +# system "awk" is bad on some platforms. AC_REQUIRE([AC_PROG_AWK])dnl AC_REQUIRE([AC_PROG_MAKE_SET])dnl AC_REQUIRE([AM_SET_LEADING_DOT])dnl @@ -583,6 +588,51 @@ dnl macro is hooked onto _AC_COMPILER_EXEEXT early, see below. AC_CONFIG_COMMANDS_PRE(dnl [m4_provide_if([_AM_COMPILER_EXEEXT], [AM_CONDITIONAL([am__EXEEXT], [test -n "$EXEEXT"])])])dnl + +# POSIX will say in a future version that running "rm -f" with no argument +# is OK; and we want to be able to make that assumption in our Makefile +# recipes. So use an aggressive probe to check that the usage we want is +# actually supported "in the wild" to an acceptable degree. +# See automake bug#10828. +# To make any issue more visible, cause the running configure to be aborted +# by default if the 'rm' program in use doesn't match our expectations; the +# user can still override this though. +if rm -f && rm -fr && rm -rf; then : OK; else + cat >&2 <<'END' +Oops! + +Your 'rm' program seems unable to run without file operands specified +on the command line, even when the '-f' option is present. This is contrary +to the behaviour of most rm programs out there, and not conforming with +the upcoming POSIX standard: + +Please tell bug-automake@gnu.org about your system, including the value +of your $PATH and any error possibly output before this message. This +can help us improve future automake versions. + +END + if test x"$ACCEPT_INFERIOR_RM_PROGRAM" = x"yes"; then + echo 'Configuration will proceed anyway, since you have set the' >&2 + echo 'ACCEPT_INFERIOR_RM_PROGRAM variable to "yes"' >&2 + echo >&2 + else + cat >&2 <<'END' +Aborting the configuration process, to ensure you take notice of the issue. + +You can download and install GNU coreutils to get an 'rm' implementation +that behaves properly: . + +If you want to complete the configuration process using your problematic +'rm' anyway, export the environment variable ACCEPT_INFERIOR_RM_PROGRAM +to "yes", and re-run configure. + +END + AC_MSG_ERROR([Your 'rm' program is bad, sorry.]) + fi +fi +dnl The trailing newline in this macro's definition is deliberate, for +dnl backward compatibility and to allow trailing 'dnl'-style comments +dnl after the AM_INIT_AUTOMAKE invocation. See automake bug#16841. ]) dnl Hook into '_AC_COMPILER_EXEEXT' early to learn its expansion. Do not @@ -591,7 +641,6 @@ dnl mangled by Autoconf and run in a shell conditional statement. m4_define([_AC_COMPILER_EXEEXT], m4_defn([_AC_COMPILER_EXEEXT])[m4_provide([_AM_COMPILER_EXEEXT])]) - # When config.status generates a header, we must update the stamp-h file. # This file resides in the same directory as the config header # that is generated. The stamp files are numbered to have different names. @@ -613,7 +662,7 @@ for _am_header in $config_headers :; do done echo "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count]) -# Copyright (C) 2001-2013 Free Software Foundation, Inc. +# Copyright (C) 2001-2014 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -624,7 +673,7 @@ echo "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_co # Define $install_sh. AC_DEFUN([AM_PROG_INSTALL_SH], [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl -if test x"${install_sh}" != xset; then +if test x"${install_sh+set}" != xset; then case $am_aux_dir in *\ * | *\ *) install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;; @@ -634,7 +683,7 @@ if test x"${install_sh}" != xset; then fi AC_SUBST([install_sh])]) -# Copyright (C) 2003-2013 Free Software Foundation, Inc. +# Copyright (C) 2003-2014 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -656,7 +705,7 @@ AC_SUBST([am__leading_dot])]) # Add --enable-maintainer-mode option to configure. -*- Autoconf -*- # From Jim Meyering -# Copyright (C) 1996-2013 Free Software Foundation, Inc. +# Copyright (C) 1996-2014 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -691,7 +740,7 @@ AC_MSG_CHECKING([whether to enable maintainer-specific portions of Makefiles]) # Check to see how 'make' treats includes. -*- Autoconf -*- -# Copyright (C) 2001-2013 Free Software Foundation, Inc. +# Copyright (C) 2001-2014 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -739,41 +788,9 @@ AC_MSG_RESULT([$_am_result]) rm -f confinc confmf ]) -# Copyright (C) 1999-2013 Free Software Foundation, Inc. -# -# This file is free software; the Free Software Foundation -# gives unlimited permission to copy and/or distribute it, -# with or without modifications, as long as this notice is preserved. - -# AM_PROG_CC_C_O -# -------------- -# Like AC_PROG_CC_C_O, but changed for automake. -AC_DEFUN([AM_PROG_CC_C_O], -[AC_REQUIRE([AC_PROG_CC_C_O])dnl -AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl -AC_REQUIRE_AUX_FILE([compile])dnl -# FIXME: we rely on the cache variable name because -# there is no other way. -set dummy $CC -am_cc=`echo $[2] | sed ['s/[^a-zA-Z0-9_]/_/g;s/^[0-9]/_/']` -eval am_t=\$ac_cv_prog_cc_${am_cc}_c_o -if test "$am_t" != yes; then - # Losing compiler, so override with the script. - # FIXME: It is wrong to rewrite CC. - # But if we don't then we get into trouble of one sort or another. - # A longer-term fix would be to have automake use am__CC in this case, - # and then we could set am__CC="\$(top_srcdir)/compile \$(CC)" - CC="$am_aux_dir/compile $CC" -fi -dnl Make sure AC_PROG_CC is never called again, or it will override our -dnl setting of CC. -m4_define([AC_PROG_CC], - [m4_fatal([AC_PROG_CC cannot be called after AM_PROG_CC_C_O])]) -]) - # Fake the existence of programs that GNU maintainers use. -*- Autoconf -*- -# Copyright (C) 1997-2013 Free Software Foundation, Inc. +# Copyright (C) 1997-2014 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -812,7 +829,7 @@ fi # Helper functions for option handling. -*- Autoconf -*- -# Copyright (C) 2001-2013 Free Software Foundation, Inc. +# Copyright (C) 2001-2014 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -841,7 +858,54 @@ AC_DEFUN([_AM_SET_OPTIONS], AC_DEFUN([_AM_IF_OPTION], [m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])]) -# Copyright (C) 2001-2013 Free Software Foundation, Inc. +# Copyright (C) 1999-2014 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# _AM_PROG_CC_C_O +# --------------- +# Like AC_PROG_CC_C_O, but changed for automake. We rewrite AC_PROG_CC +# to automatically call this. +AC_DEFUN([_AM_PROG_CC_C_O], +[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl +AC_REQUIRE_AUX_FILE([compile])dnl +AC_LANG_PUSH([C])dnl +AC_CACHE_CHECK( + [whether $CC understands -c and -o together], + [am_cv_prog_cc_c_o], + [AC_LANG_CONFTEST([AC_LANG_PROGRAM([])]) + # Make sure it works both with $CC and with simple cc. + # Following AC_PROG_CC_C_O, we do the test twice because some + # compilers refuse to overwrite an existing .o file with -o, + # though they will create one. + am_cv_prog_cc_c_o=yes + for am_i in 1 2; do + if AM_RUN_LOG([$CC -c conftest.$ac_ext -o conftest2.$ac_objext]) \ + && test -f conftest2.$ac_objext; then + : OK + else + am_cv_prog_cc_c_o=no + break + fi + done + rm -f core conftest* + unset am_i]) +if test "$am_cv_prog_cc_c_o" != yes; then + # Losing compiler, so override with the script. + # FIXME: It is wrong to rewrite CC. + # But if we don't then we get into trouble of one sort or another. + # A longer-term fix would be to have automake use am__CC in this case, + # and then we could set am__CC="\$(top_srcdir)/compile \$(CC)" + CC="$am_aux_dir/compile $CC" +fi +AC_LANG_POP([C])]) + +# For backward compatibility. +AC_DEFUN_ONCE([AM_PROG_CC_C_O], [AC_REQUIRE([AC_PROG_CC])]) + +# Copyright (C) 2001-2014 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -860,7 +924,7 @@ AC_DEFUN([AM_RUN_LOG], # Check to make sure that the build environment is sane. -*- Autoconf -*- -# Copyright (C) 1996-2013 Free Software Foundation, Inc. +# Copyright (C) 1996-2014 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -941,7 +1005,7 @@ AC_CONFIG_COMMANDS_PRE( rm -f conftest.file ]) -# Copyright (C) 2009-2013 Free Software Foundation, Inc. +# Copyright (C) 2009-2014 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -1001,7 +1065,7 @@ AC_SUBST([AM_BACKSLASH])dnl _AM_SUBST_NOTMAKE([AM_BACKSLASH])dnl ]) -# Copyright (C) 2001-2013 Free Software Foundation, Inc. +# Copyright (C) 2001-2014 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -1029,7 +1093,7 @@ fi INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s" AC_SUBST([INSTALL_STRIP_PROGRAM])]) -# Copyright (C) 2006-2013 Free Software Foundation, Inc. +# Copyright (C) 2006-2014 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -1048,7 +1112,7 @@ AC_DEFUN([AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE($@)]) # Check how to create a tarball. -*- Autoconf -*- -# Copyright (C) 2004-2013 Free Software Foundation, Inc. +# Copyright (C) 2004-2014 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, diff --git a/compile b/compile index 531136b..a85b723 100755 --- a/compile +++ b/compile @@ -3,7 +3,7 @@ scriptversion=2012-10-14.11; # UTC -# Copyright (C) 1999-2013 Free Software Foundation, Inc. +# Copyright (C) 1999-2014 Free Software Foundation, Inc. # Written by Tom Tromey . # # This program is free software; you can redistribute it and/or modify diff --git a/config.guess b/config.guess index b79252d..dbfb978 100755 --- a/config.guess +++ b/config.guess @@ -1,8 +1,8 @@ #! /bin/sh # Attempt to guess a canonical system name. -# Copyright 1992-2013 Free Software Foundation, Inc. +# Copyright 1992-2015 Free Software Foundation, Inc. -timestamp='2013-06-10' +timestamp='2015-01-01' # This file is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by @@ -24,12 +24,12 @@ timestamp='2013-06-10' # program. This Exception is an additional permission under section 7 # of the GNU General Public License, version 3 ("GPLv3"). # -# Originally written by Per Bothner. +# Originally written by Per Bothner; maintained since 2000 by Ben Elliston. # # You can get the latest version of this script from: # http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=HEAD # -# Please send patches with a ChangeLog entry to config-patches@gnu.org. +# Please send patches to . me=`echo "$0" | sed -e 's,.*/,,'` @@ -50,7 +50,7 @@ version="\ GNU config.guess ($timestamp) Originally written by Per Bothner. -Copyright 1992-2013 Free Software Foundation, Inc. +Copyright 1992-2015 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." @@ -149,7 +149,7 @@ Linux|GNU|GNU/*) LIBC=gnu #endif EOF - eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^LIBC'` + eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^LIBC' | sed 's, ,,g'` ;; esac @@ -579,8 +579,9 @@ EOF else IBM_ARCH=powerpc fi - if [ -x /usr/bin/oslevel ] ; then - IBM_REV=`/usr/bin/oslevel` + if [ -x /usr/bin/lslpp ] ; then + IBM_REV=`/usr/bin/lslpp -Lqc bos.rte.libc | + awk -F: '{ print $3 }' | sed s/[0-9]*$/0/` else IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE} fi @@ -826,7 +827,7 @@ EOF *:MINGW*:*) echo ${UNAME_MACHINE}-pc-mingw32 exit ;; - i*:MSYS*:*) + *:MSYS*:*) echo ${UNAME_MACHINE}-pc-msys exit ;; i*:windows32*:*) @@ -969,10 +970,10 @@ EOF eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^CPU'` test x"${CPU}" != x && { echo "${CPU}-unknown-linux-${LIBC}"; exit; } ;; - or1k:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + openrisc*:Linux:*:*) + echo or1k-unknown-linux-${LIBC} exit ;; - or32:Linux:*:*) + or32:Linux:*:* | or1k*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; padre:Linux:*:*) @@ -1260,16 +1261,26 @@ EOF if test "$UNAME_PROCESSOR" = unknown ; then UNAME_PROCESSOR=powerpc fi - if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then - if (echo '#ifdef __LP64__'; echo IS_64BIT_ARCH; echo '#endif') | \ - (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \ - grep IS_64BIT_ARCH >/dev/null - then - case $UNAME_PROCESSOR in - i386) UNAME_PROCESSOR=x86_64 ;; - powerpc) UNAME_PROCESSOR=powerpc64 ;; - esac + if test `echo "$UNAME_RELEASE" | sed -e 's/\..*//'` -le 10 ; then + if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then + if (echo '#ifdef __LP64__'; echo IS_64BIT_ARCH; echo '#endif') | \ + (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \ + grep IS_64BIT_ARCH >/dev/null + then + case $UNAME_PROCESSOR in + i386) UNAME_PROCESSOR=x86_64 ;; + powerpc) UNAME_PROCESSOR=powerpc64 ;; + esac + fi fi + elif test "$UNAME_PROCESSOR" = i386 ; then + # Avoid executing cc on OS X 10.9, as it ships with a stub + # that puts up a graphical alert prompting to install + # developer tools. Any system running Mac OS X 10.7 or + # later (Darwin 11 and later) is required to have a 64-bit + # processor. This is not true of the ARM version of Darwin + # that Apple uses in portable devices. + UNAME_PROCESSOR=x86_64 fi echo ${UNAME_PROCESSOR}-apple-darwin${UNAME_RELEASE} exit ;; @@ -1361,154 +1372,6 @@ EOF exit ;; esac -eval $set_cc_for_build -cat >$dummy.c < -# include -#endif -main () -{ -#if defined (sony) -#if defined (MIPSEB) - /* BFD wants "bsd" instead of "newsos". Perhaps BFD should be changed, - I don't know.... */ - printf ("mips-sony-bsd\n"); exit (0); -#else -#include - printf ("m68k-sony-newsos%s\n", -#ifdef NEWSOS4 - "4" -#else - "" -#endif - ); exit (0); -#endif -#endif - -#if defined (__arm) && defined (__acorn) && defined (__unix) - printf ("arm-acorn-riscix\n"); exit (0); -#endif - -#if defined (hp300) && !defined (hpux) - printf ("m68k-hp-bsd\n"); exit (0); -#endif - -#if defined (NeXT) -#if !defined (__ARCHITECTURE__) -#define __ARCHITECTURE__ "m68k" -#endif - int version; - version=`(hostinfo | sed -n 's/.*NeXT Mach \([0-9]*\).*/\1/p') 2>/dev/null`; - if (version < 4) - printf ("%s-next-nextstep%d\n", __ARCHITECTURE__, version); - else - printf ("%s-next-openstep%d\n", __ARCHITECTURE__, version); - exit (0); -#endif - -#if defined (MULTIMAX) || defined (n16) -#if defined (UMAXV) - printf ("ns32k-encore-sysv\n"); exit (0); -#else -#if defined (CMU) - printf ("ns32k-encore-mach\n"); exit (0); -#else - printf ("ns32k-encore-bsd\n"); exit (0); -#endif -#endif -#endif - -#if defined (__386BSD__) - printf ("i386-pc-bsd\n"); exit (0); -#endif - -#if defined (sequent) -#if defined (i386) - printf ("i386-sequent-dynix\n"); exit (0); -#endif -#if defined (ns32000) - printf ("ns32k-sequent-dynix\n"); exit (0); -#endif -#endif - -#if defined (_SEQUENT_) - struct utsname un; - - uname(&un); - - if (strncmp(un.version, "V2", 2) == 0) { - printf ("i386-sequent-ptx2\n"); exit (0); - } - if (strncmp(un.version, "V1", 2) == 0) { /* XXX is V1 correct? */ - printf ("i386-sequent-ptx1\n"); exit (0); - } - printf ("i386-sequent-ptx\n"); exit (0); - -#endif - -#if defined (vax) -# if !defined (ultrix) -# include -# if defined (BSD) -# if BSD == 43 - printf ("vax-dec-bsd4.3\n"); exit (0); -# else -# if BSD == 199006 - printf ("vax-dec-bsd4.3reno\n"); exit (0); -# else - printf ("vax-dec-bsd\n"); exit (0); -# endif -# endif -# else - printf ("vax-dec-bsd\n"); exit (0); -# endif -# else - printf ("vax-dec-ultrix\n"); exit (0); -# endif -#endif - -#if defined (alliant) && defined (i860) - printf ("i860-alliant-bsd\n"); exit (0); -#endif - - exit (1); -} -EOF - -$CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null && SYSTEM_NAME=`$dummy` && - { echo "$SYSTEM_NAME"; exit; } - -# Apollos put the system type in the environment. - -test -d /usr/apollo && { echo ${ISP}-apollo-${SYSTYPE}; exit; } - -# Convex versions that predate uname can use getsysinfo(1) - -if [ -x /usr/convex/getsysinfo ] -then - case `getsysinfo -f cpu_type` in - c1*) - echo c1-convex-bsd - exit ;; - c2*) - if getsysinfo -f scalar_acc - then echo c32-convex-bsd - else echo c2-convex-bsd - fi - exit ;; - c34*) - echo c34-convex-bsd - exit ;; - c38*) - echo c38-convex-bsd - exit ;; - c4*) - echo c4-convex-bsd - exit ;; - esac -fi - cat >&2 <. # # Configuration subroutine to validate and canonicalize a configuration type. # Supply the specified configuration type as an argument. @@ -68,7 +68,7 @@ Report bugs and patches to ." version="\ GNU config.sub ($timestamp) -Copyright 1992-2013 Free Software Foundation, Inc. +Copyright 1992-2015 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." @@ -257,14 +257,15 @@ case $basic_machine in | avr | avr32 \ | be32 | be64 \ | bfin \ - | c4x | clipper \ + | c4x | c8051 | clipper \ | d10v | d30v | dlx | dsp16xx \ | epiphany \ - | fido | fr30 | frv \ + | fido | fr30 | frv | ft32 \ | h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \ | hexagon \ | i370 | i860 | i960 | ia64 \ | ip2k | iq2000 \ + | k1om \ | le32 | le64 \ | lm32 \ | m32c | m32r | m32rle | m68000 | m68k | m88k \ @@ -282,8 +283,10 @@ case $basic_machine in | mips64vr5900 | mips64vr5900el \ | mipsisa32 | mipsisa32el \ | mipsisa32r2 | mipsisa32r2el \ + | mipsisa32r6 | mipsisa32r6el \ | mipsisa64 | mipsisa64el \ | mipsisa64r2 | mipsisa64r2el \ + | mipsisa64r6 | mipsisa64r6el \ | mipsisa64sb1 | mipsisa64sb1el \ | mipsisa64sr71k | mipsisa64sr71kel \ | mipsr5900 | mipsr5900el \ @@ -295,11 +298,11 @@ case $basic_machine in | nds32 | nds32le | nds32be \ | nios | nios2 | nios2eb | nios2el \ | ns16k | ns32k \ - | open8 \ - | or1k | or32 \ + | open8 | or1k | or1knd | or32 \ | pdp10 | pdp11 | pj | pjl \ | powerpc | powerpc64 | powerpc64le | powerpcle \ | pyramid \ + | riscv32 | riscv64 \ | rl78 | rx \ | score \ | sh | sh[1234] | sh[24]a | sh[24]aeb | sh[23]e | sh[34]eb | sheb | shbe | shle | sh[1234]le | sh3ele \ @@ -310,6 +313,7 @@ case $basic_machine in | tahoe | tic4x | tic54x | tic55x | tic6x | tic80 | tron \ | ubicom32 \ | v850 | v850e | v850e1 | v850e2 | v850es | v850e2v3 \ + | visium \ | we32k \ | x86 | xc16x | xstormy16 | xtensa \ | z8k | z80) @@ -324,7 +328,10 @@ case $basic_machine in c6x) basic_machine=tic6x-unknown ;; - m6811 | m68hc11 | m6812 | m68hc12 | m68hcs12x | picochip) + leon|leon[3-9]) + basic_machine=sparc-$basic_machine + ;; + m6811 | m68hc11 | m6812 | m68hc12 | m68hcs12x | nvptx | picochip) basic_machine=$basic_machine-unknown os=-none ;; @@ -372,7 +379,7 @@ case $basic_machine in | be32-* | be64-* \ | bfin-* | bs2000-* \ | c[123]* | c30-* | [cjt]90-* | c4x-* \ - | clipper-* | craynv-* | cydra-* \ + | c8051-* | clipper-* | craynv-* | cydra-* \ | d10v-* | d30v-* | dlx-* \ | elxsi-* \ | f30[01]-* | f700-* | fido-* | fr30-* | frv-* | fx80-* \ @@ -381,6 +388,7 @@ case $basic_machine in | hexagon-* \ | i*86-* | i860-* | i960-* | ia64-* \ | ip2k-* | iq2000-* \ + | k1om-* \ | le32-* | le64-* \ | lm32-* \ | m32c-* | m32r-* | m32rle-* \ @@ -400,8 +408,10 @@ case $basic_machine in | mips64vr5900-* | mips64vr5900el-* \ | mipsisa32-* | mipsisa32el-* \ | mipsisa32r2-* | mipsisa32r2el-* \ + | mipsisa32r6-* | mipsisa32r6el-* \ | mipsisa64-* | mipsisa64el-* \ | mipsisa64r2-* | mipsisa64r2el-* \ + | mipsisa64r6-* | mipsisa64r6el-* \ | mipsisa64sb1-* | mipsisa64sb1el-* \ | mipsisa64sr71k-* | mipsisa64sr71kel-* \ | mipsr5900-* | mipsr5900el-* \ @@ -413,6 +423,7 @@ case $basic_machine in | nios-* | nios2-* | nios2eb-* | nios2el-* \ | none-* | np1-* | ns16k-* | ns32k-* \ | open8-* \ + | or1k*-* \ | orion-* \ | pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \ | powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* \ @@ -430,6 +441,7 @@ case $basic_machine in | ubicom32-* \ | v850-* | v850e-* | v850e1-* | v850es-* | v850e2-* | v850e2v3-* \ | vax-* \ + | visium-* \ | we32k-* \ | x86-* | x86_64-* | xc16x-* | xps100-* \ | xstormy16-* | xtensa*-* \ @@ -767,6 +779,9 @@ case $basic_machine in basic_machine=m68k-isi os=-sysv ;; + leon-*|leon[3-9]-*) + basic_machine=sparc-`echo $basic_machine | sed 's/-.*//'` + ;; m68knommu) basic_machine=m68k-unknown os=-linux @@ -794,7 +809,7 @@ case $basic_machine in os=-mingw64 ;; mingw32) - basic_machine=i386-pc + basic_machine=i686-pc os=-mingw32 ;; mingw32ce) @@ -822,6 +837,10 @@ case $basic_machine in basic_machine=powerpc-unknown os=-morphos ;; + moxiebox) + basic_machine=moxie-unknown + os=-moxiebox + ;; msdos) basic_machine=i386-pc os=-msdos @@ -830,7 +849,7 @@ case $basic_machine in basic_machine=`echo $basic_machine | sed -e 's/ms1-/mt-/'` ;; msys) - basic_machine=i386-pc + basic_machine=i686-pc os=-msys ;; mvs) @@ -1367,14 +1386,14 @@ case $os in | -cygwin* | -msys* | -pe* | -psos* | -moss* | -proelf* | -rtems* \ | -mingw32* | -mingw64* | -linux-gnu* | -linux-android* \ | -linux-newlib* | -linux-musl* | -linux-uclibc* \ - | -uxpv* | -beos* | -mpeix* | -udk* \ + | -uxpv* | -beos* | -mpeix* | -udk* | -moxiebox* \ | -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \ | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \ | -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* \ | -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \ | -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* \ | -powermax* | -dnix* | -nx6 | -nx7 | -sei* | -dragonfly* \ - | -skyos* | -haiku* | -rdos* | -toppers* | -drops* | -es*) + | -skyos* | -haiku* | -rdos* | -toppers* | -drops* | -es* | -tirtos*) # Remember, each alternative MUST END IN *, to match a version number. ;; -qnx*) @@ -1546,6 +1565,9 @@ case $basic_machine in c4x-* | tic4x-*) os=-coff ;; + c8051-*) + os=-elf + ;; hexagon-*) os=-elf ;; @@ -1589,9 +1611,6 @@ case $basic_machine in mips*-*) os=-elf ;; - or1k-*) - os=-elf - ;; or32-*) os=-coff ;; diff --git a/configure b/configure index 1290d52..a069d19 100755 --- a/configure +++ b/configure @@ -780,6 +780,7 @@ debug_defs LIBOBJS CXXCPP CPP +LT_SYS_LIBRARY_PATH OTOOL64 OTOOL LIPO @@ -919,6 +920,7 @@ enable_static enable_shared with_pic enable_fast_install +with_aix_soname with_gnu_ld with_sysroot enable_libtool_lock @@ -1000,6 +1002,7 @@ CC CFLAGS CCAS CCASFLAGS +LT_SYS_LIBRARY_PATH CPP CXXCPP' @@ -1662,9 +1665,12 @@ Optional Packages: --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) --with-pic[=PKGS] try to use only PIC/non-PIC objects [default=use both] + --with-aix-soname=aix|svr4|both + shared library versioning (aka "SONAME") variant to + provide on AIX, [default=aix]. --with-gnu-ld assume the C compiler uses GNU ld [default=no] - --with-sysroot=DIR Search for dependent libraries within DIR - (or the compiler's sysroot if not specified). + --with-sysroot[=DIR] Search for dependent libraries within DIR (or the + compiler's sysroot if not specified). --with-fhs Use FHS layout --with-fhs-opt Use FHS optional layout --with-tmpfiles-d=PATH system uses tmpfiles.d to handle temp files/dirs @@ -1770,6 +1776,8 @@ Some influential environment variables: CFLAGS C compiler flags CCAS assembler compiler command (defaults to CC) CCASFLAGS assembler compiler flags (defaults to CFLAGS) + LT_SYS_LIBRARY_PATH + User-defined run-time library search path. CPP C preprocessor CXXCPP C++ preprocessor @@ -2807,7 +2815,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 @@ -3008,8 +3016,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 @@ -3028,7 +3036,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'" ;; @@ -3347,8 +3355,8 @@ MAKEINFO=${MAKEINFO-"${am_missing_run}makeinfo"} # mkdir_p='$(MKDIR_P)' -# We need awk for the "check" target. The system "awk" is bad on -# some platforms. +# We need awk for the "check" target (and possibly the TAP driver). The +# system "awk" is bad on some platforms. # Always define AMTAR for backward compatibility. Yes, it's still used # in the wild :-( We should find a proper way to deprecate it ... AMTAR='$${TAR-tar}' @@ -3449,6 +3457,48 @@ $as_echo "$am_cv_prog_tar_pax" >&6; } +# POSIX will say in a future version that running "rm -f" with no argument +# is OK; and we want to be able to make that assumption in our Makefile +# recipes. So use an aggressive probe to check that the usage we want is +# actually supported "in the wild" to an acceptable degree. +# See automake bug#10828. +# To make any issue more visible, cause the running configure to be aborted +# by default if the 'rm' program in use doesn't match our expectations; the +# user can still override this though. +if rm -f && rm -fr && rm -rf; then : OK; else + cat >&2 <<'END' +Oops! + +Your 'rm' program seems unable to run without file operands specified +on the command line, even when the '-f' option is present. This is contrary +to the behaviour of most rm programs out there, and not conforming with +the upcoming POSIX standard: + +Please tell bug-automake@gnu.org about your system, including the value +of your $PATH and any error possibly output before this message. This +can help us improve future automake versions. + +END + if test x"$ACCEPT_INFERIOR_RM_PROGRAM" = x"yes"; then + echo 'Configuration will proceed anyway, since you have set the' >&2 + echo 'ACCEPT_INFERIOR_RM_PROGRAM variable to "yes"' >&2 + echo >&2 + else + cat >&2 <<'END' +Aborting the configuration process, to ensure you take notice of the issue. + +You can download and install GNU coreutils to get an 'rm' implementation +that behaves properly: . + +If you want to complete the configuration process using your problematic +'rm' anyway, export the environment variable ACCEPT_INFERIOR_RM_PROGRAM +to "yes", and re-run configure. + +END + as_fn_error $? "Your 'rm' program is bad, sorry." "$LINENO" 5 + fi +fi + # define these for automake distdir VERSION=$PACKAGE_VERSION PACKAGE=$PACKAGE_TARNAME @@ -4799,6 +4849,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 @@ -4927,131 +5036,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. @@ -5489,14 +5473,14 @@ if test "${enable_static+set}" = set; then : *) enable_static=no # Look at the argument we got. We use all the common list separators. - lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," + lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR, for pkg in $enableval; do - IFS="$lt_save_ifs" + IFS=$lt_save_ifs if test "X$pkg" = "X$p"; then enable_static=yes fi done - IFS="$lt_save_ifs" + IFS=$lt_save_ifs ;; esac else @@ -5519,8 +5503,8 @@ esac -macro_version='2.4.2' -macro_revision='1.3337' +macro_version='2.4.6' +macro_revision='2.4.6' @@ -5534,7 +5518,7 @@ macro_revision='1.3337' -ltmain="$ac_aux_dir/ltmain.sh" +ltmain=$ac_aux_dir/ltmain.sh # Backslashify metacharacters that are still active within # double-quoted strings. @@ -5583,7 +5567,7 @@ func_echo_all () $ECHO "" } -case "$ECHO" in +case $ECHO in printf*) { $as_echo "$as_me:${as_lineno-$LINENO}: result: printf" >&5 $as_echo "printf" >&6; } ;; print*) { $as_echo "$as_me:${as_lineno-$LINENO}: result: print -r" >&5 @@ -5906,19 +5890,19 @@ test -z "$GREP" && GREP=grep # Check whether --with-gnu-ld was given. if test "${with_gnu_ld+set}" = set; then : - withval=$with_gnu_ld; test "$withval" = no || with_gnu_ld=yes + withval=$with_gnu_ld; test no = "$withval" || with_gnu_ld=yes else with_gnu_ld=no fi ac_prog=ld -if test "$GCC" = yes; then +if test yes = "$GCC"; then # Check if gcc -print-prog-name=ld gives a path. { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ld used by $CC" >&5 $as_echo_n "checking for ld used by $CC... " >&6; } case $host in *-*-mingw*) - # gcc leaves a trailing carriage return which upsets mingw + # gcc leaves a trailing carriage return, which upsets mingw ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;; *) ac_prog=`($CC -print-prog-name=ld) 2>&5` ;; @@ -5932,7 +5916,7 @@ $as_echo_n "checking for ld used by $CC... " >&6; } while $ECHO "$ac_prog" | $GREP "$re_direlt" > /dev/null 2>&1; do ac_prog=`$ECHO $ac_prog| $SED "s%$re_direlt%/%"` done - test -z "$LD" && LD="$ac_prog" + test -z "$LD" && LD=$ac_prog ;; "") # If it fails, then pretend we aren't using GCC. @@ -5943,7 +5927,7 @@ $as_echo_n "checking for ld used by $CC... " >&6; } with_gnu_ld=unknown ;; esac -elif test "$with_gnu_ld" = yes; then +elif test yes = "$with_gnu_ld"; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for GNU ld" >&5 $as_echo_n "checking for GNU ld... " >&6; } else @@ -5954,32 +5938,32 @@ if ${lt_cv_path_LD+:} false; then : $as_echo_n "(cached) " >&6 else if test -z "$LD"; then - lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR + lt_save_ifs=$IFS; IFS=$PATH_SEPARATOR for ac_dir in $PATH; do - IFS="$lt_save_ifs" + IFS=$lt_save_ifs test -z "$ac_dir" && ac_dir=. if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then - lt_cv_path_LD="$ac_dir/$ac_prog" + lt_cv_path_LD=$ac_dir/$ac_prog # Check to see if the program is GNU ld. I'd rather use --version, # but apparently some variants of GNU ld only accept -v. # Break only if it was the GNU/non-GNU ld that we prefer. case `"$lt_cv_path_LD" -v 2>&1 &5 $as_echo "$LD" >&6; } @@ -6022,33 +6006,38 @@ if ${lt_cv_path_NM+:} false; then : else if test -n "$NM"; then # Let the user override the test. - lt_cv_path_NM="$NM" + lt_cv_path_NM=$NM else - lt_nm_to_check="${ac_tool_prefix}nm" + lt_nm_to_check=${ac_tool_prefix}nm if test -n "$ac_tool_prefix" && test "$build" = "$host"; then lt_nm_to_check="$lt_nm_to_check nm" fi for lt_tmp_nm in $lt_nm_to_check; do - lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR + lt_save_ifs=$IFS; IFS=$PATH_SEPARATOR for ac_dir in $PATH /usr/ccs/bin/elf /usr/ccs/bin /usr/ucb /bin; do - IFS="$lt_save_ifs" + IFS=$lt_save_ifs test -z "$ac_dir" && ac_dir=. - tmp_nm="$ac_dir/$lt_tmp_nm" - if test -f "$tmp_nm" || test -f "$tmp_nm$ac_exeext" ; then + tmp_nm=$ac_dir/$lt_tmp_nm + if test -f "$tmp_nm" || test -f "$tmp_nm$ac_exeext"; then # Check to see if the nm accepts a BSD-compat flag. - # Adding the `sed 1q' prevents false positives on HP-UX, which says: + # Adding the 'sed 1q' prevents false positives on HP-UX, which says: # nm: unknown option "B" ignored # Tru64's nm complains that /dev/null is an invalid object file - case `"$tmp_nm" -B /dev/null 2>&1 | sed '1q'` in - */dev/null* | *'Invalid file or object type'*) + # MSYS converts /dev/null to NUL, MinGW nm treats NUL as empty + case $build_os in + mingw*) lt_bad_file=conftest.nm/nofile ;; + *) lt_bad_file=/dev/null ;; + esac + case `"$tmp_nm" -B $lt_bad_file 2>&1 | sed '1q'` in + *$lt_bad_file* | *'Invalid file or object type'*) lt_cv_path_NM="$tmp_nm -B" - break + break 2 ;; *) case `"$tmp_nm" -p /dev/null 2>&1 | sed '1q'` in */dev/null*) lt_cv_path_NM="$tmp_nm -p" - break + break 2 ;; *) lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but @@ -6059,15 +6048,15 @@ else esac fi done - IFS="$lt_save_ifs" + IFS=$lt_save_ifs done : ${lt_cv_path_NM=no} fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_path_NM" >&5 $as_echo "$lt_cv_path_NM" >&6; } -if test "$lt_cv_path_NM" != "no"; then - NM="$lt_cv_path_NM" +if test no != "$lt_cv_path_NM"; then + NM=$lt_cv_path_NM else # Didn't find any BSD compatible name lister, look for dumpbin. if test -n "$DUMPBIN"; then : @@ -6173,9 +6162,9 @@ esac fi fi - case `$DUMPBIN -symbols /dev/null 2>&1 | sed '1q'` in + case `$DUMPBIN -symbols -headers /dev/null 2>&1 | sed '1q'` in *COFF*) - DUMPBIN="$DUMPBIN -symbols" + DUMPBIN="$DUMPBIN -symbols -headers" ;; *) DUMPBIN=: @@ -6183,8 +6172,8 @@ fi esac fi - if test "$DUMPBIN" != ":"; then - NM="$DUMPBIN" + if test : != "$DUMPBIN"; then + NM=$DUMPBIN fi fi test -z "$NM" && NM=nm @@ -6235,7 +6224,7 @@ if ${lt_cv_sys_max_cmd_len+:} false; then : $as_echo_n "(cached) " >&6 else i=0 - teststring="ABCD" + teststring=ABCD case $build_os in msdosdjgpp*) @@ -6275,7 +6264,7 @@ else lt_cv_sys_max_cmd_len=8192; ;; - netbsd* | freebsd* | openbsd* | darwin* | dragonfly*) + bitrig* | darwin* | dragonfly* | freebsd* | netbsd* | openbsd*) # This has been around since 386BSD, at least. Likely further. if test -x /sbin/sysctl; then lt_cv_sys_max_cmd_len=`/sbin/sysctl -n kern.argmax` @@ -6325,22 +6314,23 @@ else ;; *) lt_cv_sys_max_cmd_len=`(getconf ARG_MAX) 2> /dev/null` - if test -n "$lt_cv_sys_max_cmd_len"; then + if test -n "$lt_cv_sys_max_cmd_len" && \ + test undefined != "$lt_cv_sys_max_cmd_len"; then lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4` lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3` else # Make teststring a little bigger before we do anything with it. # a 1K string should be a reasonable start. - for i in 1 2 3 4 5 6 7 8 ; do + for i in 1 2 3 4 5 6 7 8; do teststring=$teststring$teststring done SHELL=${SHELL-${CONFIG_SHELL-/bin/sh}} # If test is not a shell built-in, we'll probably end up computing a # maximum length that is only half of the actual maximum length, but # we can't tell. - while { test "X"`env echo "$teststring$teststring" 2>/dev/null` \ + while { test X`env echo "$teststring$teststring" 2>/dev/null` \ = "X$teststring$teststring"; } >/dev/null 2>&1 && - test $i != 17 # 1/2 MB should be enough + test 17 != "$i" # 1/2 MB should be enough do i=`expr $i + 1` teststring=$teststring$teststring @@ -6358,7 +6348,7 @@ else fi -if test -n $lt_cv_sys_max_cmd_len ; then +if test -n "$lt_cv_sys_max_cmd_len"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_sys_max_cmd_len" >&5 $as_echo "$lt_cv_sys_max_cmd_len" >&6; } else @@ -6376,30 +6366,6 @@ max_cmd_len=$lt_cv_sys_max_cmd_len : ${MV="mv -f"} : ${RM="rm -f"} -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the shell understands some XSI constructs" >&5 -$as_echo_n "checking whether the shell understands some XSI constructs... " >&6; } -# Try some XSI features -xsi_shell=no -( _lt_dummy="a/b/c" - test "${_lt_dummy##*/},${_lt_dummy%/*},${_lt_dummy#??}"${_lt_dummy%"$_lt_dummy"}, \ - = c,a/b,b/c, \ - && eval 'test $(( 1 + 1 )) -eq 2 \ - && test "${#_lt_dummy}" -eq 5' ) >/dev/null 2>&1 \ - && xsi_shell=yes -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $xsi_shell" >&5 -$as_echo "$xsi_shell" >&6; } - - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the shell understands \"+=\"" >&5 -$as_echo_n "checking whether the shell understands \"+=\"... " >&6; } -lt_shell_append=no -( foo=bar; set foo baz; eval "$1+=\$2" && test "$foo" = barbaz ) \ - >/dev/null 2>&1 \ - && lt_shell_append=yes -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_shell_append" >&5 -$as_echo "$lt_shell_append" >&6; } - - if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then lt_unset=unset else @@ -6522,13 +6488,13 @@ esac reload_cmds='$LD$reload_flag -o $output$reload_objs' case $host_os in cygwin* | mingw* | pw32* | cegcc*) - if test "$GCC" != yes; then + if test yes != "$GCC"; then reload_cmds=false fi ;; darwin*) - if test "$GCC" = yes; then - reload_cmds='$LTCC $LTCFLAGS -nostdlib ${wl}-r -o $output$reload_objs' + if test yes = "$GCC"; then + reload_cmds='$LTCC $LTCFLAGS -nostdlib $wl-r -o $output$reload_objs' else reload_cmds='$LD$reload_flag -o $output$reload_objs' fi @@ -6656,13 +6622,13 @@ lt_cv_deplibs_check_method='unknown' # Need to set the preceding variable on all platforms that support # interlibrary dependencies. # 'none' -- dependencies not supported. -# `unknown' -- same as none, but documents that we really don't know. +# 'unknown' -- same as none, but documents that we really don't know. # 'pass_all' -- all dependencies passed with no checks. # 'test_compile' -- check by making test program. # 'file_magic [[regex]]' -- check by looking for files in library path -# which responds to the $file_magic_cmd with a given extended regex. -# If you have `file' or equivalent on your system and you're not sure -# whether `pass_all' will *always* work, you probably want this one. +# that responds to the $file_magic_cmd with a given extended regex. +# If you have 'file' or equivalent on your system and you're not sure +# whether 'pass_all' will *always* work, you probably want this one. case $host_os in aix[4-9]*) @@ -6689,8 +6655,7 @@ mingw* | pw32*) # Base MSYS/MinGW do not provide the 'file' command needed by # func_win32_libid shell function, so use a weaker test based on 'objdump', # unless we find 'file', for example because we are cross-compiling. - # func_win32_libid assumes BSD nm, so disallow it if using MS dumpbin. - if ( test "$lt_cv_nm_interface" = "BSD nm" && file / ) >/dev/null 2>&1; then + if ( file / ) >/dev/null 2>&1; then lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL' lt_cv_file_magic_cmd='func_win32_libid' else @@ -6726,10 +6691,6 @@ freebsd* | dragonfly*) fi ;; -gnu*) - lt_cv_deplibs_check_method=pass_all - ;; - haiku*) lt_cv_deplibs_check_method=pass_all ;; @@ -6768,7 +6729,7 @@ irix5* | irix6* | nonstopux*) ;; # This must be glibc/ELF. -linux* | k*bsd*-gnu | kopensolaris*-gnu) +linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) lt_cv_deplibs_check_method=pass_all ;; @@ -6790,8 +6751,8 @@ newos6*) lt_cv_deplibs_check_method=pass_all ;; -openbsd*) - if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then +openbsd* | bitrig*) + if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`"; then lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|\.so|_pic\.a)$' else lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|_pic\.a)$' @@ -6844,6 +6805,9 @@ sysv4 | sysv4.3*) tpf*) lt_cv_deplibs_check_method=pass_all ;; +os2*) + lt_cv_deplibs_check_method=pass_all + ;; esac fi @@ -7001,8 +6965,8 @@ else case $host_os in cygwin* | mingw* | pw32* | cegcc*) - # two different shell functions defined in ltmain.sh - # decide which to use based on capabilities of $DLLTOOL + # two different shell functions defined in ltmain.sh; + # decide which one to use based on capabilities of $DLLTOOL case `$DLLTOOL --help 2>&1` in *--identify-strict*) lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib @@ -7014,7 +6978,7 @@ cygwin* | mingw* | pw32* | cegcc*) ;; *) # fallback: assume linklib IS sharedlib - lt_cv_sharedlib_from_linklib_cmd="$ECHO" + lt_cv_sharedlib_from_linklib_cmd=$ECHO ;; esac @@ -7169,7 +7133,7 @@ if ac_fn_c_try_compile "$LINENO"; then : ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } - if test "$ac_status" -eq 0; then + if test 0 -eq "$ac_status"; then # Ensure the archiver fails upon bogus file names. rm -f conftest.$ac_objext libconftest.a { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$lt_ar_try\""; } >&5 @@ -7177,7 +7141,7 @@ if ac_fn_c_try_compile "$LINENO"; then : ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } - if test "$ac_status" -ne 0; then + if test 0 -ne "$ac_status"; then lt_cv_ar_at_file=@ fi fi @@ -7190,7 +7154,7 @@ fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ar_at_file" >&5 $as_echo "$lt_cv_ar_at_file" >&6; } -if test "x$lt_cv_ar_at_file" = xno; then +if test no = "$lt_cv_ar_at_file"; then archiver_list_spec= else archiver_list_spec=$lt_cv_ar_at_file @@ -7407,7 +7371,7 @@ old_postuninstall_cmds= if test -n "$RANLIB"; then case $host_os in - openbsd*) + bitrig* | openbsd*) old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB -t \$tool_oldlib" ;; *) @@ -7497,7 +7461,7 @@ cygwin* | mingw* | pw32* | cegcc*) symcode='[ABCDGISTW]' ;; hpux*) - if test "$host_cpu" = ia64; then + if test ia64 = "$host_cpu"; then symcode='[ABCDEGRST]' fi ;; @@ -7530,14 +7494,44 @@ case `$NM -V 2>&1` in symcode='[ABCDGIRSTW]' ;; esac +if test "$lt_cv_nm_interface" = "MS dumpbin"; then + # Gets list of data symbols to import. + lt_cv_sys_global_symbol_to_import="sed -n -e 's/^I .* \(.*\)$/\1/p'" + # Adjust the below global symbol transforms to fixup imported variables. + lt_cdecl_hook=" -e 's/^I .* \(.*\)$/extern __declspec(dllimport) char \1;/p'" + lt_c_name_hook=" -e 's/^I .* \(.*\)$/ {\"\1\", (void *) 0},/p'" + lt_c_name_lib_hook="\ + -e 's/^I .* \(lib.*\)$/ {\"\1\", (void *) 0},/p'\ + -e 's/^I .* \(.*\)$/ {\"lib\1\", (void *) 0},/p'" +else + # Disable hooks by default. + lt_cv_sys_global_symbol_to_import= + lt_cdecl_hook= + lt_c_name_hook= + lt_c_name_lib_hook= +fi + # Transform an extracted symbol line into a proper C declaration. # Some systems (esp. on ia64) link data and code symbols differently, # so use this general approach. -lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'" +lt_cv_sys_global_symbol_to_cdecl="sed -n"\ +$lt_cdecl_hook\ +" -e 's/^T .* \(.*\)$/extern int \1();/p'"\ +" -e 's/^$symcode$symcode* .* \(.*\)$/extern char \1;/p'" # Transform an extracted symbol line into symbol name and symbol address -lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([^ ]*\)[ ]*$/ {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([^ ]*\) \([^ ]*\)$/ {\"\2\", (void *) \&\2},/p'" -lt_cv_sys_global_symbol_to_c_name_address_lib_prefix="sed -n -e 's/^: \([^ ]*\)[ ]*$/ {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([^ ]*\) \(lib[^ ]*\)$/ {\"\2\", (void *) \&\2},/p' -e 's/^$symcode* \([^ ]*\) \([^ ]*\)$/ {\"lib\2\", (void *) \&\2},/p'" +lt_cv_sys_global_symbol_to_c_name_address="sed -n"\ +$lt_c_name_hook\ +" -e 's/^: \(.*\) .*$/ {\"\1\", (void *) 0},/p'"\ +" -e 's/^$symcode$symcode* .* \(.*\)$/ {\"\1\", (void *) \&\1},/p'" + +# Transform an extracted symbol line into symbol name with lib prefix and +# symbol address. +lt_cv_sys_global_symbol_to_c_name_address_lib_prefix="sed -n"\ +$lt_c_name_lib_hook\ +" -e 's/^: \(.*\) .*$/ {\"\1\", (void *) 0},/p'"\ +" -e 's/^$symcode$symcode* .* \(lib.*\)$/ {\"\1\", (void *) \&\1},/p'"\ +" -e 's/^$symcode$symcode* .* \(.*\)$/ {\"lib\1\", (void *) \&\1},/p'" # Handle CRLF in mingw tool chain opt_cr= @@ -7555,21 +7549,24 @@ for ac_symprfx in "" "_"; do # Write the raw and C identifiers. if test "$lt_cv_nm_interface" = "MS dumpbin"; then - # Fake it for dumpbin and say T for any non-static function - # and D for any global variable. + # Fake it for dumpbin and say T for any non-static function, + # D for any global variable and I for any imported variable. # Also find C++ and __fastcall symbols from MSVC++, # which start with @ or ?. lt_cv_sys_global_symbol_pipe="$AWK '"\ " {last_section=section; section=\$ 3};"\ " /^COFF SYMBOL TABLE/{for(i in hide) delete hide[i]};"\ " /Section length .*#relocs.*(pick any)/{hide[last_section]=1};"\ +" /^ *Symbol name *: /{split(\$ 0,sn,\":\"); si=substr(sn[2],2)};"\ +" /^ *Type *: code/{print \"T\",si,substr(si,length(prfx))};"\ +" /^ *Type *: data/{print \"I\",si,substr(si,length(prfx))};"\ " \$ 0!~/External *\|/{next};"\ " / 0+ UNDEF /{next}; / UNDEF \([^|]\)*()/{next};"\ " {if(hide[section]) next};"\ -" {f=0}; \$ 0~/\(\).*\|/{f=1}; {printf f ? \"T \" : \"D \"};"\ -" {split(\$ 0, a, /\||\r/); split(a[2], s)};"\ -" s[1]~/^[@?]/{print s[1], s[1]; next};"\ -" s[1]~prfx {split(s[1],t,\"@\"); print t[1], substr(t[1],length(prfx))}"\ +" {f=\"D\"}; \$ 0~/\(\).*\|/{f=\"T\"};"\ +" {split(\$ 0,a,/\||\r/); split(a[2],s)};"\ +" s[1]~/^[@?]/{print f,s[1],s[1]; next};"\ +" s[1]~prfx {split(s[1],t,\"@\"); print f,t[1],substr(t[1],length(prfx))}"\ " ' prfx=^$ac_symprfx" else lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[ ]\($symcode$symcode*\)[ ][ ]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'" @@ -7617,11 +7614,11 @@ _LT_EOF if $GREP ' nm_test_func$' "$nlist" >/dev/null; then cat <<_LT_EOF > conftest.$ac_ext /* Keep this code in sync between libtool.m4, ltmain, lt_system.h, and tests. */ -#if defined(_WIN32) || defined(__CYGWIN__) || defined(_WIN32_WCE) -/* DATA imports from DLLs on WIN32 con't be const, because runtime +#if defined _WIN32 || defined __CYGWIN__ || defined _WIN32_WCE +/* DATA imports from DLLs on WIN32 can't be const, because runtime relocations are performed -- see ld's documentation on pseudo-relocs. */ # define LT_DLSYM_CONST -#elif defined(__osf__) +#elif defined __osf__ /* This system does not cope well with relocations in const data. */ # define LT_DLSYM_CONST #else @@ -7647,7 +7644,7 @@ lt__PROGRAM__LTX_preloaded_symbols[] = { { "@PROGRAM@", (void *) 0 }, _LT_EOF - $SED "s/^$symcode$symcode* \(.*\) \(.*\)$/ {\"\2\", (void *) \&\2},/" < "$nlist" | $GREP -v main >> conftest.$ac_ext + $SED "s/^$symcode$symcode* .* \(.*\)$/ {\"\1\", (void *) \&\1},/" < "$nlist" | $GREP -v main >> conftest.$ac_ext cat <<\_LT_EOF >> conftest.$ac_ext {0, (void *) 0} }; @@ -7667,13 +7664,13 @@ _LT_EOF mv conftest.$ac_objext conftstm.$ac_objext lt_globsym_save_LIBS=$LIBS lt_globsym_save_CFLAGS=$CFLAGS - LIBS="conftstm.$ac_objext" + LIBS=conftstm.$ac_objext CFLAGS="$CFLAGS$lt_prog_compiler_no_builtin_flag" if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5 (eval $ac_link) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; } && test -s conftest${ac_exeext}; then + test $ac_status = 0; } && test -s conftest$ac_exeext; then pipe_works=yes fi LIBS=$lt_globsym_save_LIBS @@ -7694,7 +7691,7 @@ _LT_EOF rm -rf conftest* conftst* # Do not use the global_symbol_pipe unless it works. - if test "$pipe_works" = yes; then + if test yes = "$pipe_works"; then break else lt_cv_sys_global_symbol_pipe= @@ -7747,6 +7744,16 @@ fi + + + + + + + + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for sysroot" >&5 $as_echo_n "checking for sysroot... " >&6; } @@ -7759,9 +7766,9 @@ fi lt_sysroot= -case ${with_sysroot} in #( +case $with_sysroot in #( yes) - if test "$GCC" = yes; then + if test yes = "$GCC"; then lt_sysroot=`$CC --print-sysroot 2>/dev/null` fi ;; #( @@ -7771,8 +7778,8 @@ case ${with_sysroot} in #( no|'') ;; #( *) - { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${with_sysroot}" >&5 -$as_echo "${with_sysroot}" >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $with_sysroot" >&5 +$as_echo "$with_sysroot" >&6; } as_fn_error $? "The sysroot must be an absolute path." "$LINENO" 5 ;; esac @@ -7784,18 +7791,99 @@ $as_echo "${lt_sysroot:-no}" >&6; } +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for a working dd" >&5 +$as_echo_n "checking for a working dd... " >&6; } +if ${ac_cv_path_lt_DD+:} false; then : + $as_echo_n "(cached) " >&6 +else + printf 0123456789abcdef0123456789abcdef >conftest.i +cat conftest.i conftest.i >conftest2.i +: ${lt_DD:=$DD} +if test -z "$lt_DD"; then + ac_path_lt_DD_found=false + # Loop through the user's path and test for each of PROGNAME-LIST + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_prog in dd; do + for ac_exec_ext in '' $ac_executable_extensions; do + ac_path_lt_DD="$as_dir/$ac_prog$ac_exec_ext" + as_fn_executable_p "$ac_path_lt_DD" || continue +if "$ac_path_lt_DD" bs=32 count=1 conftest.out 2>/dev/null; then + cmp -s conftest.i conftest.out \ + && ac_cv_path_lt_DD="$ac_path_lt_DD" ac_path_lt_DD_found=: +fi + $ac_path_lt_DD_found && break 3 + done + done + done +IFS=$as_save_IFS + if test -z "$ac_cv_path_lt_DD"; then + : + fi +else + ac_cv_path_lt_DD=$lt_DD +fi + +rm -f conftest.i conftest2.i conftest.out +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_lt_DD" >&5 +$as_echo "$ac_cv_path_lt_DD" >&6; } + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to truncate binary pipes" >&5 +$as_echo_n "checking how to truncate binary pipes... " >&6; } +if ${lt_cv_truncate_bin+:} false; then : + $as_echo_n "(cached) " >&6 +else + printf 0123456789abcdef0123456789abcdef >conftest.i +cat conftest.i conftest.i >conftest2.i +lt_cv_truncate_bin= +if "$ac_cv_path_lt_DD" bs=32 count=1 conftest.out 2>/dev/null; then + cmp -s conftest.i conftest.out \ + && lt_cv_truncate_bin="$ac_cv_path_lt_DD bs=4096 count=1" +fi +rm -f conftest.i conftest2.i conftest.out +test -z "$lt_cv_truncate_bin" && lt_cv_truncate_bin="$SED -e 4q" +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_truncate_bin" >&5 +$as_echo "$lt_cv_truncate_bin" >&6; } + + + + + + + +# Calculate cc_basename. Skip known compiler wrappers and cross-prefix. +func_cc_basename () +{ + for cc_temp in $*""; do + case $cc_temp in + compile | *[\\/]compile | ccache | *[\\/]ccache ) ;; + distcc | *[\\/]distcc | purify | *[\\/]purify ) ;; + \-*) ;; + *) break;; + esac + done + func_cc_basename_result=`$ECHO "$cc_temp" | $SED "s%.*/%%; s%^$host_alias-%%"` +} + # Check whether --enable-libtool-lock was given. if test "${enable_libtool_lock+set}" = set; then : enableval=$enable_libtool_lock; fi -test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes +test no = "$enable_libtool_lock" || enable_libtool_lock=yes # Some flags need to be propagated to the compiler or linker for good # libtool support. case $host in ia64-*-hpux*) - # Find out which ABI we are using. + # Find out what ABI is being produced by ac_compile, and set mode + # options accordingly. echo 'int i;' > conftest.$ac_ext if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 (eval $ac_compile) 2>&5 @@ -7804,24 +7892,25 @@ ia64-*-hpux*) test $ac_status = 0; }; then case `/usr/bin/file conftest.$ac_objext` in *ELF-32*) - HPUX_IA64_MODE="32" + HPUX_IA64_MODE=32 ;; *ELF-64*) - HPUX_IA64_MODE="64" + HPUX_IA64_MODE=64 ;; esac fi rm -rf conftest* ;; *-*-irix6*) - # Find out which ABI we are using. + # Find out what ABI is being produced by ac_compile, and set linker + # options accordingly. echo '#line '$LINENO' "configure"' > conftest.$ac_ext if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 (eval $ac_compile) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then - if test "$lt_cv_prog_gnu_ld" = yes; then + if test yes = "$lt_cv_prog_gnu_ld"; then case `/usr/bin/file conftest.$ac_objext` in *32-bit*) LD="${LD-ld} -melf32bsmip" @@ -7850,9 +7939,50 @@ ia64-*-hpux*) rm -rf conftest* ;; -x86_64-*kfreebsd*-gnu|x86_64-*linux*|ppc*-*linux*|powerpc*-*linux*| \ +mips64*-*linux*) + # Find out what ABI is being produced by ac_compile, and set linker + # options accordingly. + echo '#line '$LINENO' "configure"' > conftest.$ac_ext + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + emul=elf + case `/usr/bin/file conftest.$ac_objext` in + *32-bit*) + emul="${emul}32" + ;; + *64-bit*) + emul="${emul}64" + ;; + esac + case `/usr/bin/file conftest.$ac_objext` in + *MSB*) + emul="${emul}btsmip" + ;; + *LSB*) + emul="${emul}ltsmip" + ;; + esac + case `/usr/bin/file conftest.$ac_objext` in + *N32*) + emul="${emul}n32" + ;; + esac + LD="${LD-ld} -m $emul" + fi + rm -rf conftest* + ;; + +x86_64-*kfreebsd*-gnu|x86_64-*linux*|powerpc*-*linux*| \ s390*-*linux*|s390*-*tpf*|sparc*-*linux*) - # Find out which ABI we are using. + # Find out what ABI is being produced by ac_compile, and set linker + # options accordingly. Note that the listed cases only cover the + # situations where additional linker options are needed (such as when + # doing 32-bit compilation for a host where ld defaults to 64-bit, or + # vice versa); the common cases where no linker options are needed do + # not appear in the list. echo 'int i;' > conftest.$ac_ext if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 (eval $ac_compile) 2>&5 @@ -7866,9 +7996,19 @@ s390*-*linux*|s390*-*tpf*|sparc*-*linux*) LD="${LD-ld} -m elf_i386_fbsd" ;; x86_64-*linux*) - LD="${LD-ld} -m elf_i386" + case `/usr/bin/file conftest.o` in + *x86-64*) + LD="${LD-ld} -m elf32_x86_64" + ;; + *) + LD="${LD-ld} -m elf_i386" + ;; + esac ;; - ppc64-*linux*|powerpc64-*linux*) + powerpc64le-*linux*) + LD="${LD-ld} -m elf32lppclinux" + ;; + powerpc64-*linux*) LD="${LD-ld} -m elf32ppclinux" ;; s390x-*linux*) @@ -7887,7 +8027,10 @@ s390*-*linux*|s390*-*tpf*|sparc*-*linux*) x86_64-*linux*) LD="${LD-ld} -m elf_x86_64" ;; - ppc*-*linux*|powerpc*-*linux*) + powerpcle-*linux*) + LD="${LD-ld} -m elf64lppc" + ;; + powerpc-*linux*) LD="${LD-ld} -m elf64ppc" ;; s390*-*linux*|s390*-*tpf*) @@ -7905,7 +8048,7 @@ s390*-*linux*|s390*-*tpf*|sparc*-*linux*) *-*-sco3.2v5*) # On SCO OpenServer 5, we need -belf to get full-featured binaries. - SAVE_CFLAGS="$CFLAGS" + SAVE_CFLAGS=$CFLAGS CFLAGS="$CFLAGS -belf" { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the C compiler needs -belf" >&5 $as_echo_n "checking whether the C compiler needs -belf... " >&6; } @@ -7945,13 +8088,14 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_cc_needs_belf" >&5 $as_echo "$lt_cv_cc_needs_belf" >&6; } - if test x"$lt_cv_cc_needs_belf" != x"yes"; then + if test yes != "$lt_cv_cc_needs_belf"; then # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf - CFLAGS="$SAVE_CFLAGS" + CFLAGS=$SAVE_CFLAGS fi ;; *-*solaris*) - # Find out which ABI we are using. + # Find out what ABI is being produced by ac_compile, and set linker + # options accordingly. echo 'int i;' > conftest.$ac_ext if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 (eval $ac_compile) 2>&5 @@ -7963,7 +8107,7 @@ $as_echo "$lt_cv_cc_needs_belf" >&6; } case $lt_cv_prog_gnu_ld in yes*) case $host in - i?86-*-solaris*) + i?86-*-solaris*|x86_64-*-solaris*) LD="${LD-ld} -m elf_x86_64" ;; sparc*-*-solaris*) @@ -7972,7 +8116,7 @@ $as_echo "$lt_cv_cc_needs_belf" >&6; } esac # GNU ld 2.21 introduced _sol2 emulations. Use them if available. if ${LD-ld} -V | grep _sol2 >/dev/null 2>&1; then - LD="${LD-ld}_sol2" + LD=${LD-ld}_sol2 fi ;; *) @@ -7988,7 +8132,7 @@ $as_echo "$lt_cv_cc_needs_belf" >&6; } ;; esac -need_locks="$enable_libtool_lock" +need_locks=$enable_libtool_lock if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}mt", so it can be a program name with args. @@ -8099,7 +8243,7 @@ else fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_path_mainfest_tool" >&5 $as_echo "$lt_cv_path_mainfest_tool" >&6; } -if test "x$lt_cv_path_mainfest_tool" != xyes; then +if test yes != "$lt_cv_path_mainfest_tool"; then MANIFEST_TOOL=: fi @@ -8602,7 +8746,7 @@ if ${lt_cv_apple_cc_single_mod+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_apple_cc_single_mod=no - if test -z "${LT_MULTI_MODULE}"; then + if test -z "$LT_MULTI_MODULE"; then # By default we will add the -single_module flag. You can override # by either setting the environment variable LT_MULTI_MODULE # non-empty at configure time, or by adding -multi_module to the @@ -8620,7 +8764,7 @@ else cat conftest.err >&5 # Otherwise, if the output was created with a 0 exit code from # the compiler, it worked. - elif test -f libconftest.dylib && test $_lt_result -eq 0; then + elif test -f libconftest.dylib && test 0 = "$_lt_result"; then lt_cv_apple_cc_single_mod=yes else cat conftest.err >&5 @@ -8659,7 +8803,7 @@ else fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext - LDFLAGS="$save_LDFLAGS" + LDFLAGS=$save_LDFLAGS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ld_exported_symbols_list" >&5 @@ -8688,7 +8832,7 @@ _LT_EOF _lt_result=$? if test -s conftest.err && $GREP force_load conftest.err; then cat conftest.err >&5 - elif test -f conftest && test $_lt_result -eq 0 && $GREP forced_load conftest >/dev/null 2>&1 ; then + elif test -f conftest && test 0 = "$_lt_result" && $GREP forced_load conftest >/dev/null 2>&1; then lt_cv_ld_force_load=yes else cat conftest.err >&5 @@ -8701,32 +8845,32 @@ fi $as_echo "$lt_cv_ld_force_load" >&6; } case $host_os in rhapsody* | darwin1.[012]) - _lt_dar_allow_undefined='${wl}-undefined ${wl}suppress' ;; + _lt_dar_allow_undefined='$wl-undefined ${wl}suppress' ;; darwin1.*) - _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;; + _lt_dar_allow_undefined='$wl-flat_namespace $wl-undefined ${wl}suppress' ;; darwin*) # darwin 5.x on # if running on 10.5 or later, the deployment target defaults # to the OS version, if on x86, and 10.4, the deployment # target defaults to 10.4. Don't you love it? case ${MACOSX_DEPLOYMENT_TARGET-10.0},$host in 10.0,*86*-darwin8*|10.0,*-darwin[91]*) - _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;; - 10.[012]*) - _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;; + _lt_dar_allow_undefined='$wl-undefined ${wl}dynamic_lookup' ;; + 10.[012][,.]*) + _lt_dar_allow_undefined='$wl-flat_namespace $wl-undefined ${wl}suppress' ;; 10.*) - _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;; + _lt_dar_allow_undefined='$wl-undefined ${wl}dynamic_lookup' ;; esac ;; esac - if test "$lt_cv_apple_cc_single_mod" = "yes"; then + if test yes = "$lt_cv_apple_cc_single_mod"; then _lt_dar_single_mod='$single_module' fi - if test "$lt_cv_ld_exported_symbols_list" = "yes"; then - _lt_dar_export_syms=' ${wl}-exported_symbols_list,$output_objdir/${libname}-symbols.expsym' + if test yes = "$lt_cv_ld_exported_symbols_list"; then + _lt_dar_export_syms=' $wl-exported_symbols_list,$output_objdir/$libname-symbols.expsym' else - _lt_dar_export_syms='~$NMEDIT -s $output_objdir/${libname}-symbols.expsym ${lib}' + _lt_dar_export_syms='~$NMEDIT -s $output_objdir/$libname-symbols.expsym $lib' fi - if test "$DSYMUTIL" != ":" && test "$lt_cv_ld_force_load" = "no"; then + if test : != "$DSYMUTIL" && test no = "$lt_cv_ld_force_load"; then _lt_dsymutil='~$DSYMUTIL $lib || :' else _lt_dsymutil= @@ -8734,6 +8878,41 @@ $as_echo "$lt_cv_ld_force_load" >&6; } ;; esac +# func_munge_path_list VARIABLE PATH +# ----------------------------------- +# VARIABLE is name of variable containing _space_ separated list of +# directories to be munged by the contents of PATH, which is string +# having a format: +# "DIR[:DIR]:" +# string "DIR[ DIR]" will be prepended to VARIABLE +# ":DIR[:DIR]" +# string "DIR[ DIR]" will be appended to VARIABLE +# "DIRP[:DIRP]::[DIRA:]DIRA" +# string "DIRP[ DIRP]" will be prepended to VARIABLE and string +# "DIRA[ DIRA]" will be appended to VARIABLE +# "DIR[:DIR]" +# VARIABLE will be replaced by "DIR[ DIR]" +func_munge_path_list () +{ + case x$2 in + x) + ;; + *:) + eval $1=\"`$ECHO $2 | $SED 's/:/ /g'` \$$1\" + ;; + x:*) + eval $1=\"\$$1 `$ECHO $2 | $SED 's/:/ /g'`\" + ;; + *::*) + eval $1=\"\$$1\ `$ECHO $2 | $SED -e 's/.*:://' -e 's/:/ /g'`\" + eval $1=\"`$ECHO $2 | $SED -e 's/::.*//' -e 's/:/ /g'`\ \$$1\" + ;; + *) + eval $1=\"`$ECHO $2 | $SED 's/:/ /g'`\" + ;; + esac +} + ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' @@ -9019,9 +9198,9 @@ done func_stripname_cnf () { - case ${2} in - .*) func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%\\\\${2}\$%%"`;; - *) func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%${2}\$%%"`;; + case $2 in + .*) func_stripname_result=`$ECHO "$3" | $SED "s%^$1%%; s%\\\\$2\$%%"`;; + *) func_stripname_result=`$ECHO "$3" | $SED "s%^$1%%; s%$2\$%%"`;; esac } # func_stripname_cnf @@ -9048,14 +9227,14 @@ if test "${enable_shared+set}" = set; then : *) enable_shared=no # Look at the argument we got. We use all the common list separators. - lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," + lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR, for pkg in $enableval; do - IFS="$lt_save_ifs" + IFS=$lt_save_ifs if test "X$pkg" = "X$p"; then enable_shared=yes fi done - IFS="$lt_save_ifs" + IFS=$lt_save_ifs ;; esac else @@ -9080,14 +9259,14 @@ if test "${with_pic+set}" = set; then : *) pic_mode=default # Look at the argument we got. We use all the common list separators. - lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," + lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR, for lt_pkg in $withval; do - IFS="$lt_save_ifs" + IFS=$lt_save_ifs if test "X$lt_pkg" = "X$lt_p"; then pic_mode=yes fi done - IFS="$lt_save_ifs" + IFS=$lt_save_ifs ;; esac else @@ -9095,8 +9274,6 @@ else fi -test -z "$pic_mode" && pic_mode=default - @@ -9112,14 +9289,14 @@ if test "${enable_fast_install+set}" = set; then : *) enable_fast_install=no # Look at the argument we got. We use all the common list separators. - lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," + lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR, for pkg in $enableval; do - IFS="$lt_save_ifs" + IFS=$lt_save_ifs if test "X$pkg" = "X$p"; then enable_fast_install=yes fi done - IFS="$lt_save_ifs" + IFS=$lt_save_ifs ;; esac else @@ -9133,11 +9310,63 @@ fi + shared_archive_member_spec= +case $host,$enable_shared in +power*-*-aix[5-9]*,yes) + { $as_echo "$as_me:${as_lineno-$LINENO}: checking which variant of shared library versioning to provide" >&5 +$as_echo_n "checking which variant of shared library versioning to provide... " >&6; } + +# Check whether --with-aix-soname was given. +if test "${with_aix_soname+set}" = set; then : + withval=$with_aix_soname; case $withval in + aix|svr4|both) + ;; + *) + as_fn_error $? "Unknown argument to --with-aix-soname" "$LINENO" 5 + ;; + esac + lt_cv_with_aix_soname=$with_aix_soname +else + if ${lt_cv_with_aix_soname+:} false; then : + $as_echo_n "(cached) " >&6 +else + lt_cv_with_aix_soname=aix +fi + + with_aix_soname=$lt_cv_with_aix_soname +fi + + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $with_aix_soname" >&5 +$as_echo "$with_aix_soname" >&6; } + if test aix != "$with_aix_soname"; then + # For the AIX way of multilib, we name the shared archive member + # based on the bitwidth used, traditionally 'shr.o' or 'shr_64.o', + # and 'shr.imp' or 'shr_64.imp', respectively, for the Import File. + # Even when GNU compilers ignore OBJECT_MODE but need '-maix64' flag, + # the AIX toolchain works better with OBJECT_MODE set (default 32). + if test 64 = "${OBJECT_MODE-32}"; then + shared_archive_member_spec=shr_64 + else + shared_archive_member_spec=shr + fi + fi + ;; +*) + with_aix_soname=aix + ;; +esac + + + + + + + # This can be used to rebuild libtool when needed -LIBTOOL_DEPS="$ltmain" +LIBTOOL_DEPS=$ltmain # Always use our own libtool. LIBTOOL='$(SHELL) $(top_builddir)/libtool' @@ -9186,7 +9415,7 @@ test -z "$LN_S" && LN_S="ln -s" -if test -n "${ZSH_VERSION+set}" ; then +if test -n "${ZSH_VERSION+set}"; then setopt NO_GLOB_SUBST fi @@ -9225,7 +9454,7 @@ aix3*) # AIX sometimes has problems with the GCC collect2 program. For some # reason, if we set the COLLECT_NAMES environment variable, the problems # vanish in a puff of smoke. - if test "X${COLLECT_NAMES+set}" != Xset; then + if test set != "${COLLECT_NAMES+set}"; then COLLECT_NAMES= export COLLECT_NAMES fi @@ -9236,14 +9465,14 @@ esac ofile=libtool can_build_shared=yes -# All known linkers require a `.a' archive for static linking (except MSVC, +# All known linkers require a '.a' archive for static linking (except MSVC, # which needs '.lib'). libext=a -with_gnu_ld="$lt_cv_prog_gnu_ld" +with_gnu_ld=$lt_cv_prog_gnu_ld -old_CC="$CC" -old_CFLAGS="$CFLAGS" +old_CC=$CC +old_CFLAGS=$CFLAGS # Set sane defaults for various variables test -z "$CC" && CC=cc @@ -9252,15 +9481,8 @@ test -z "$LTCFLAGS" && LTCFLAGS=$CFLAGS test -z "$LD" && LD=ld test -z "$ac_objext" && ac_objext=o -for cc_temp in $compiler""; do - case $cc_temp in - compile | *[\\/]compile | ccache | *[\\/]ccache ) ;; - distcc | *[\\/]distcc | purify | *[\\/]purify ) ;; - \-*) ;; - *) break;; - esac -done -cc_basename=`$ECHO "$cc_temp" | $SED "s%.*/%%; s%^$host_alias-%%"` +func_cc_basename $compiler +cc_basename=$func_cc_basename_result # Only perform the check for file, if the check method requires it @@ -9275,22 +9497,22 @@ if ${lt_cv_path_MAGIC_CMD+:} false; then : else case $MAGIC_CMD in [\\/*] | ?:[\\/]*) - lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path. + lt_cv_path_MAGIC_CMD=$MAGIC_CMD # Let the user override the test with a path. ;; *) - lt_save_MAGIC_CMD="$MAGIC_CMD" - lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR + lt_save_MAGIC_CMD=$MAGIC_CMD + lt_save_ifs=$IFS; IFS=$PATH_SEPARATOR ac_dummy="/usr/bin$PATH_SEPARATOR$PATH" for ac_dir in $ac_dummy; do - IFS="$lt_save_ifs" + IFS=$lt_save_ifs test -z "$ac_dir" && ac_dir=. - if test -f $ac_dir/${ac_tool_prefix}file; then - lt_cv_path_MAGIC_CMD="$ac_dir/${ac_tool_prefix}file" + if test -f "$ac_dir/${ac_tool_prefix}file"; then + lt_cv_path_MAGIC_CMD=$ac_dir/"${ac_tool_prefix}file" if test -n "$file_magic_test_file"; then case $deplibs_check_method in "file_magic "*) file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"` - MAGIC_CMD="$lt_cv_path_MAGIC_CMD" + MAGIC_CMD=$lt_cv_path_MAGIC_CMD if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null | $EGREP "$file_magic_regex" > /dev/null; then : @@ -9313,13 +9535,13 @@ _LT_EOF break fi done - IFS="$lt_save_ifs" - MAGIC_CMD="$lt_save_MAGIC_CMD" + IFS=$lt_save_ifs + MAGIC_CMD=$lt_save_MAGIC_CMD ;; esac fi -MAGIC_CMD="$lt_cv_path_MAGIC_CMD" +MAGIC_CMD=$lt_cv_path_MAGIC_CMD if test -n "$MAGIC_CMD"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MAGIC_CMD" >&5 $as_echo "$MAGIC_CMD" >&6; } @@ -9341,22 +9563,22 @@ if ${lt_cv_path_MAGIC_CMD+:} false; then : else case $MAGIC_CMD in [\\/*] | ?:[\\/]*) - lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path. + lt_cv_path_MAGIC_CMD=$MAGIC_CMD # Let the user override the test with a path. ;; *) - lt_save_MAGIC_CMD="$MAGIC_CMD" - lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR + lt_save_MAGIC_CMD=$MAGIC_CMD + lt_save_ifs=$IFS; IFS=$PATH_SEPARATOR ac_dummy="/usr/bin$PATH_SEPARATOR$PATH" for ac_dir in $ac_dummy; do - IFS="$lt_save_ifs" + IFS=$lt_save_ifs test -z "$ac_dir" && ac_dir=. - if test -f $ac_dir/file; then - lt_cv_path_MAGIC_CMD="$ac_dir/file" + if test -f "$ac_dir/file"; then + lt_cv_path_MAGIC_CMD=$ac_dir/"file" if test -n "$file_magic_test_file"; then case $deplibs_check_method in "file_magic "*) file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"` - MAGIC_CMD="$lt_cv_path_MAGIC_CMD" + MAGIC_CMD=$lt_cv_path_MAGIC_CMD if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null | $EGREP "$file_magic_regex" > /dev/null; then : @@ -9379,13 +9601,13 @@ _LT_EOF break fi done - IFS="$lt_save_ifs" - MAGIC_CMD="$lt_save_MAGIC_CMD" + IFS=$lt_save_ifs + MAGIC_CMD=$lt_save_MAGIC_CMD ;; esac fi -MAGIC_CMD="$lt_cv_path_MAGIC_CMD" +MAGIC_CMD=$lt_cv_path_MAGIC_CMD if test -n "$MAGIC_CMD"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MAGIC_CMD" >&5 $as_echo "$MAGIC_CMD" >&6; } @@ -9406,7 +9628,7 @@ esac # Use C for the default configuration in the libtool script -lt_save_CC="$CC" +lt_save_CC=$CC ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' @@ -9468,7 +9690,7 @@ if test -n "$compiler"; then lt_prog_compiler_no_builtin_flag= -if test "$GCC" = yes; then +if test yes = "$GCC"; then case $cc_basename in nvcc*) lt_prog_compiler_no_builtin_flag=' -Xcompiler -fno-builtin' ;; @@ -9484,7 +9706,7 @@ else lt_cv_prog_compiler_rtti_exceptions=no ac_outfile=conftest.$ac_objext echo "$lt_simple_compile_test_code" > conftest.$ac_ext - lt_compiler_flag="-fno-rtti -fno-exceptions" + lt_compiler_flag="-fno-rtti -fno-exceptions" ## exclude from sc_useless_quotes_in_assignment # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins @@ -9514,7 +9736,7 @@ fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_rtti_exceptions" >&5 $as_echo "$lt_cv_prog_compiler_rtti_exceptions" >&6; } -if test x"$lt_cv_prog_compiler_rtti_exceptions" = xyes; then +if test yes = "$lt_cv_prog_compiler_rtti_exceptions"; then lt_prog_compiler_no_builtin_flag="$lt_prog_compiler_no_builtin_flag -fno-rtti -fno-exceptions" else : @@ -9532,17 +9754,18 @@ lt_prog_compiler_pic= lt_prog_compiler_static= - if test "$GCC" = yes; then + if test yes = "$GCC"; then lt_prog_compiler_wl='-Wl,' lt_prog_compiler_static='-static' case $host_os in aix*) # All AIX code is PIC. - if test "$host_cpu" = ia64; then + if test ia64 = "$host_cpu"; then # AIX 5 now supports IA64 processor lt_prog_compiler_static='-Bstatic' fi + lt_prog_compiler_pic='-fPIC' ;; amigaos*) @@ -9553,8 +9776,8 @@ lt_prog_compiler_static= ;; m68k) # FIXME: we need at least 68020 code to build shared libraries, but - # adding the `-m68020' flag to GCC prevents building anything better, - # like `-m68040'. + # adding the '-m68020' flag to GCC prevents building anything better, + # like '-m68040'. lt_prog_compiler_pic='-m68020 -resident32 -malways-restore-a4' ;; esac @@ -9570,6 +9793,11 @@ lt_prog_compiler_static= # Although the cygwin gcc ignores -fPIC, still need this for old-style # (--disable-auto-import) libraries lt_prog_compiler_pic='-DDLL_EXPORT' + case $host_os in + os2*) + lt_prog_compiler_static='$wl-static' + ;; + esac ;; darwin* | rhapsody*) @@ -9640,7 +9868,7 @@ lt_prog_compiler_static= case $host_os in aix*) lt_prog_compiler_wl='-Wl,' - if test "$host_cpu" = ia64; then + if test ia64 = "$host_cpu"; then # AIX 5 now supports IA64 processor lt_prog_compiler_static='-Bstatic' else @@ -9648,10 +9876,29 @@ lt_prog_compiler_static= fi ;; + darwin* | rhapsody*) + # PIC is the default on this platform + # Common symbols not allowed in MH_DYLIB files + lt_prog_compiler_pic='-fno-common' + case $cc_basename in + nagfor*) + # NAG Fortran compiler + lt_prog_compiler_wl='-Wl,-Wl,,' + lt_prog_compiler_pic='-PIC' + lt_prog_compiler_static='-Bstatic' + ;; + esac + ;; + mingw* | cygwin* | pw32* | os2* | cegcc*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). lt_prog_compiler_pic='-DDLL_EXPORT' + case $host_os in + os2*) + lt_prog_compiler_static='$wl-static' + ;; + esac ;; hpux9* | hpux10* | hpux11*) @@ -9667,7 +9914,7 @@ lt_prog_compiler_static= ;; esac # Is there a better lt_prog_compiler_static that works with the bundled CC? - lt_prog_compiler_static='${wl}-a ${wl}archive' + lt_prog_compiler_static='$wl-a ${wl}archive' ;; irix5* | irix6* | nonstopux*) @@ -9676,9 +9923,9 @@ lt_prog_compiler_static= lt_prog_compiler_static='-non_shared' ;; - linux* | k*bsd*-gnu | kopensolaris*-gnu) + linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) case $cc_basename in - # old Intel for x86_64 which still supported -KPIC. + # old Intel for x86_64, which still supported -KPIC. ecc*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-KPIC' @@ -9703,6 +9950,12 @@ lt_prog_compiler_static= lt_prog_compiler_pic='-PIC' lt_prog_compiler_static='-Bstatic' ;; + tcc*) + # Fabrice Bellard et al's Tiny C Compiler + lt_prog_compiler_wl='-Wl,' + lt_prog_compiler_pic='-fPIC' + lt_prog_compiler_static='-static' + ;; pgcc* | pgf77* | pgf90* | pgf95* | pgfortran*) # Portland Group compilers (*not* the Pentium gcc compiler, # which looks to be a dead project) @@ -9800,7 +10053,7 @@ lt_prog_compiler_static= ;; sysv4*MP*) - if test -d /usr/nec ;then + if test -d /usr/nec; then lt_prog_compiler_pic='-Kconform_pic' lt_prog_compiler_static='-Bstatic' fi @@ -9829,7 +10082,7 @@ lt_prog_compiler_static= fi case $host_os in - # For platforms which do not support PIC, -DPIC is meaningless: + # For platforms that do not support PIC, -DPIC is meaningless: *djgpp*) lt_prog_compiler_pic= ;; @@ -9861,7 +10114,7 @@ else lt_cv_prog_compiler_pic_works=no ac_outfile=conftest.$ac_objext echo "$lt_simple_compile_test_code" > conftest.$ac_ext - lt_compiler_flag="$lt_prog_compiler_pic -DPIC" + lt_compiler_flag="$lt_prog_compiler_pic -DPIC" ## exclude from sc_useless_quotes_in_assignment # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins @@ -9891,7 +10144,7 @@ fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_pic_works" >&5 $as_echo "$lt_cv_prog_compiler_pic_works" >&6; } -if test x"$lt_cv_prog_compiler_pic_works" = xyes; then +if test yes = "$lt_cv_prog_compiler_pic_works"; then case $lt_prog_compiler_pic in "" | " "*) ;; *) lt_prog_compiler_pic=" $lt_prog_compiler_pic" ;; @@ -9923,7 +10176,7 @@ if ${lt_cv_prog_compiler_static_works+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_prog_compiler_static_works=no - save_LDFLAGS="$LDFLAGS" + save_LDFLAGS=$LDFLAGS LDFLAGS="$LDFLAGS $lt_tmp_static_flag" echo "$lt_simple_link_test_code" > conftest.$ac_ext if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then @@ -9942,13 +10195,13 @@ else fi fi $RM -r conftest* - LDFLAGS="$save_LDFLAGS" + LDFLAGS=$save_LDFLAGS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_static_works" >&5 $as_echo "$lt_cv_prog_compiler_static_works" >&6; } -if test x"$lt_cv_prog_compiler_static_works" = xyes; then +if test yes = "$lt_cv_prog_compiler_static_works"; then : else lt_prog_compiler_static= @@ -10068,8 +10321,8 @@ $as_echo "$lt_cv_prog_compiler_c_o" >&6; } -hard_links="nottested" -if test "$lt_cv_prog_compiler_c_o" = no && test "$need_locks" != no; then +hard_links=nottested +if test no = "$lt_cv_prog_compiler_c_o" && test no != "$need_locks"; then # do not overwrite the value of need_locks provided by the user { $as_echo "$as_me:${as_lineno-$LINENO}: checking if we can lock with hard links" >&5 $as_echo_n "checking if we can lock with hard links... " >&6; } @@ -10081,9 +10334,9 @@ $as_echo_n "checking if we can lock with hard links... " >&6; } ln conftest.a conftest.b 2>/dev/null && hard_links=no { $as_echo "$as_me:${as_lineno-$LINENO}: result: $hard_links" >&5 $as_echo "$hard_links" >&6; } - if test "$hard_links" = no; then - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&5 -$as_echo "$as_me: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&2;} + if test no = "$hard_links"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: '$CC' does not support '-c -o', so 'make -j' may be unsafe" >&5 +$as_echo "$as_me: WARNING: '$CC' does not support '-c -o', so 'make -j' may be unsafe" >&2;} need_locks=warn fi else @@ -10126,9 +10379,9 @@ $as_echo_n "checking whether the $compiler linker ($LD) supports shared librarie # included in the symbol list include_expsyms= # exclude_expsyms can be an extended regexp of symbols to exclude - # it will be wrapped by ` (' and `)$', so one must not match beginning or - # end of line. Example: `a|bc|.*d.*' will exclude the symbols `a' and `bc', - # as well as any symbol that contains `d'. + # it will be wrapped by ' (' and ')$', so one must not match beginning or + # end of line. Example: 'a|bc|.*d.*' will exclude the symbols 'a' and 'bc', + # as well as any symbol that contains 'd'. exclude_expsyms='_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*' # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out # platforms (ab)use it in PIC code, but their linkers get confused if @@ -10143,7 +10396,7 @@ $as_echo_n "checking whether the $compiler linker ($LD) supports shared librarie # FIXME: the MSVC++ port hasn't been tested in a loooong time # When not using gcc, we currently assume that we are using # Microsoft Visual C++. - if test "$GCC" != yes; then + if test yes != "$GCC"; then with_gnu_ld=no fi ;; @@ -10151,7 +10404,7 @@ $as_echo_n "checking whether the $compiler linker ($LD) supports shared librarie # we just hope/assume this is gcc and not c89 (= MSVC++) with_gnu_ld=yes ;; - openbsd*) + openbsd* | bitrig*) with_gnu_ld=no ;; esac @@ -10161,7 +10414,7 @@ $as_echo_n "checking whether the $compiler linker ($LD) supports shared librarie # On some targets, GNU ld is compatible enough with the native linker # that we're better off using the native interface for both. lt_use_gnu_ld_interface=no - if test "$with_gnu_ld" = yes; then + if test yes = "$with_gnu_ld"; then case $host_os in aix*) # The AIX port of GNU ld has always aspired to compatibility @@ -10183,24 +10436,24 @@ $as_echo_n "checking whether the $compiler linker ($LD) supports shared librarie esac fi - if test "$lt_use_gnu_ld_interface" = yes; then + if test yes = "$lt_use_gnu_ld_interface"; then # If archive_cmds runs LD, not CC, wlarc should be empty - wlarc='${wl}' + wlarc='$wl' # Set some defaults for GNU ld with shared library support. These # are reset later if shared libraries are not supported. Putting them # here allows them to be overridden if necessary. runpath_var=LD_RUN_PATH - hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' - export_dynamic_flag_spec='${wl}--export-dynamic' + hardcode_libdir_flag_spec='$wl-rpath $wl$libdir' + export_dynamic_flag_spec='$wl--export-dynamic' # ancient GNU ld didn't support --whole-archive et. al. if $LD --help 2>&1 | $GREP 'no-whole-archive' > /dev/null; then - whole_archive_flag_spec="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' + whole_archive_flag_spec=$wlarc'--whole-archive$convenience '$wlarc'--no-whole-archive' else whole_archive_flag_spec= fi supports_anon_versioning=no - case `$LD -v 2>&1` in + case `$LD -v | $SED -e 's/(^)\+)\s\+//' 2>&1` in *GNU\ gold*) supports_anon_versioning=yes ;; *\ [01].* | *\ 2.[0-9].* | *\ 2.10.*) ;; # catch versions < 2.11 *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ... @@ -10213,7 +10466,7 @@ $as_echo_n "checking whether the $compiler linker ($LD) supports shared librarie case $host_os in aix[3-9]*) # On AIX/PPC, the GNU linker is very broken - if test "$host_cpu" != ia64; then + if test ia64 != "$host_cpu"; then ld_shlibs=no cat <<_LT_EOF 1>&2 @@ -10232,7 +10485,7 @@ _LT_EOF case $host_cpu in powerpc) # see comment about AmigaOS4 .so support - archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' archive_expsym_cmds='' ;; m68k) @@ -10248,7 +10501,7 @@ _LT_EOF allow_undefined_flag=unsupported # Joseph Beckenbach says some releases of gcc # support --undefined. This deserves some investigation. FIXME - archive_cmds='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + archive_cmds='$CC -nostart $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' else ld_shlibs=no fi @@ -10258,7 +10511,7 @@ _LT_EOF # _LT_TAGVAR(hardcode_libdir_flag_spec, ) is actually meaningless, # as there is no search path for DLLs. hardcode_libdir_flag_spec='-L$libdir' - export_dynamic_flag_spec='${wl}--export-all-symbols' + export_dynamic_flag_spec='$wl--export-all-symbols' allow_undefined_flag=unsupported always_export_symbols=no enable_shared_with_static_runtimes=yes @@ -10266,61 +10519,89 @@ _LT_EOF exclude_expsyms='[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname' if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then - archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' - # If the export-symbols file already is a .def file (1st line - # is EXPORTS), use it as is; otherwise, prepend... - archive_expsym_cmds='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then - cp $export_symbols $output_objdir/$soname.def; - else - echo EXPORTS > $output_objdir/$soname.def; - cat $export_symbols >> $output_objdir/$soname.def; - fi~ - $CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' + archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname $wl--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' + # If the export-symbols file already is a .def file, use it as + # is; otherwise, prepend EXPORTS... + archive_expsym_cmds='if test DEF = "`$SED -n -e '\''s/^[ ]*//'\'' -e '\''/^\(;.*\)*$/d'\'' -e '\''s/^\(EXPORTS\|LIBRARY\)\([ ].*\)*$/DEF/p'\'' -e q $export_symbols`" ; then + cp $export_symbols $output_objdir/$soname.def; + else + echo EXPORTS > $output_objdir/$soname.def; + cat $export_symbols >> $output_objdir/$soname.def; + fi~ + $CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname $wl--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' else ld_shlibs=no fi ;; haiku*) - archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' link_all_deplibs=yes ;; + os2*) + hardcode_libdir_flag_spec='-L$libdir' + hardcode_minus_L=yes + allow_undefined_flag=unsupported + shrext_cmds=.dll + archive_cmds='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~ + $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~ + $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~ + $ECHO EXPORTS >> $output_objdir/$libname.def~ + emxexp $libobjs | $SED /"_DLL_InitTerm"/d >> $output_objdir/$libname.def~ + $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~ + emximp -o $lib $output_objdir/$libname.def' + archive_expsym_cmds='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~ + $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~ + $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~ + $ECHO EXPORTS >> $output_objdir/$libname.def~ + prefix_cmds="$SED"~ + if test EXPORTS = "`$SED 1q $export_symbols`"; then + prefix_cmds="$prefix_cmds -e 1d"; + fi~ + prefix_cmds="$prefix_cmds -e \"s/^\(.*\)$/_\1/g\""~ + cat $export_symbols | $prefix_cmds >> $output_objdir/$libname.def~ + $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~ + emximp -o $lib $output_objdir/$libname.def' + old_archive_From_new_cmds='emximp -o $output_objdir/${libname}_dll.a $output_objdir/$libname.def' + enable_shared_with_static_runtimes=yes + ;; + interix[3-9]*) hardcode_direct=no hardcode_shlibpath_var=no - hardcode_libdir_flag_spec='${wl}-rpath,$libdir' - export_dynamic_flag_spec='${wl}-E' + hardcode_libdir_flag_spec='$wl-rpath,$libdir' + export_dynamic_flag_spec='$wl-E' # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc. # Instead, shared libraries are loaded at an image base (0x10000000 by # default) and relocated if they conflict, which is a slow very memory # consuming and fragmenting process. To avoid this, we pick a random, # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link # time. Moving up from 0x10000000 also allows more sbrk(2) space. - archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' - archive_expsym_cmds='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' + archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-h,$soname $wl--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' + archive_expsym_cmds='sed "s|^|_|" $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-h,$soname $wl--retain-symbols-file,$output_objdir/$soname.expsym $wl--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' ;; gnu* | linux* | tpf* | k*bsd*-gnu | kopensolaris*-gnu) tmp_diet=no - if test "$host_os" = linux-dietlibc; then + if test linux-dietlibc = "$host_os"; then case $cc_basename in diet\ *) tmp_diet=yes;; # linux-dietlibc with static linking (!diet-dyn) esac fi if $LD --help 2>&1 | $EGREP ': supported targets:.* elf' > /dev/null \ - && test "$tmp_diet" = no + && test no = "$tmp_diet" then tmp_addflag=' $pic_flag' tmp_sharedflag='-shared' case $cc_basename,$host_cpu in pgcc*) # Portland Group C compiler - whole_archive_flag_spec='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' + whole_archive_flag_spec='$wl--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive' tmp_addflag=' $pic_flag' ;; pgf77* | pgf90* | pgf95* | pgfortran*) # Portland Group f77 and f90 compilers - whole_archive_flag_spec='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' + whole_archive_flag_spec='$wl--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive' tmp_addflag=' $pic_flag -Mnomain' ;; ecc*,ia64* | icc*,ia64*) # Intel C compiler on ia64 tmp_addflag=' -i_dynamic' ;; @@ -10331,42 +10612,47 @@ _LT_EOF lf95*) # Lahey Fortran 8.1 whole_archive_flag_spec= tmp_sharedflag='--shared' ;; + nagfor*) # NAGFOR 5.3 + tmp_sharedflag='-Wl,-shared' ;; xl[cC]* | bgxl[cC]* | mpixl[cC]*) # IBM XL C 8.0 on PPC (deal with xlf below) tmp_sharedflag='-qmkshrobj' tmp_addflag= ;; nvcc*) # Cuda Compiler Driver 2.2 - whole_archive_flag_spec='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' + whole_archive_flag_spec='$wl--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive' compiler_needs_object=yes ;; esac case `$CC -V 2>&1 | sed 5q` in *Sun\ C*) # Sun C 5.9 - whole_archive_flag_spec='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' + whole_archive_flag_spec='$wl--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive' compiler_needs_object=yes tmp_sharedflag='-G' ;; *Sun\ F*) # Sun Fortran 8.3 tmp_sharedflag='-G' ;; esac - archive_cmds='$CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + archive_cmds='$CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' - if test "x$supports_anon_versioning" = xyes; then + if test yes = "$supports_anon_versioning"; then archive_expsym_cmds='echo "{ global:" > $output_objdir/$libname.ver~ - cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ - echo "local: *; };" >> $output_objdir/$libname.ver~ - $CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib' + cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ + echo "local: *; };" >> $output_objdir/$libname.ver~ + $CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-version-script $wl$output_objdir/$libname.ver -o $lib' fi case $cc_basename in + tcc*) + export_dynamic_flag_spec='-rdynamic' + ;; xlf* | bgf* | bgxlf* | mpixlf*) # IBM XL Fortran 10.1 on PPC cannot create shared libs itself whole_archive_flag_spec='--whole-archive$convenience --no-whole-archive' - hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' + hardcode_libdir_flag_spec='$wl-rpath $wl$libdir' archive_cmds='$LD -shared $libobjs $deplibs $linker_flags -soname $soname -o $lib' - if test "x$supports_anon_versioning" = xyes; then + if test yes = "$supports_anon_versioning"; then archive_expsym_cmds='echo "{ global:" > $output_objdir/$libname.ver~ - cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ - echo "local: *; };" >> $output_objdir/$libname.ver~ - $LD -shared $libobjs $deplibs $linker_flags -soname $soname -version-script $output_objdir/$libname.ver -o $lib' + cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ + echo "local: *; };" >> $output_objdir/$libname.ver~ + $LD -shared $libobjs $deplibs $linker_flags -soname $soname -version-script $output_objdir/$libname.ver -o $lib' fi ;; esac @@ -10380,8 +10666,8 @@ _LT_EOF archive_cmds='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib' wlarc= else - archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' - archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' + archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' fi ;; @@ -10399,8 +10685,8 @@ _LT_EOF _LT_EOF elif $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then - archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' - archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' + archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' else ld_shlibs=no fi @@ -10412,7 +10698,7 @@ _LT_EOF ld_shlibs=no cat <<_LT_EOF 1>&2 -*** Warning: Releases of the GNU linker prior to 2.16.91.0.3 can not +*** Warning: Releases of the GNU linker prior to 2.16.91.0.3 cannot *** reliably create shared libraries on SCO systems. Therefore, libtool *** is disabling shared libraries support. We urge you to upgrade GNU *** binutils to release 2.16.91.0.3 or newer. Another option is to modify @@ -10427,9 +10713,9 @@ _LT_EOF # DT_RUNPATH tag from executables and libraries. But doing so # requires that you compile everything twice, which is a pain. if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then - hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' - archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' - archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + hardcode_libdir_flag_spec='$wl-rpath $wl$libdir' + archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' + archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' else ld_shlibs=no fi @@ -10446,15 +10732,15 @@ _LT_EOF *) if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then - archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' - archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' + archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' else ld_shlibs=no fi ;; esac - if test "$ld_shlibs" = no; then + if test no = "$ld_shlibs"; then runpath_var= hardcode_libdir_flag_spec= export_dynamic_flag_spec= @@ -10470,7 +10756,7 @@ _LT_EOF # Note: this linker hardcodes the directories in LIBPATH if there # are no directories specified by -L. hardcode_minus_L=yes - if test "$GCC" = yes && test -z "$lt_prog_compiler_static"; then + if test yes = "$GCC" && test -z "$lt_prog_compiler_static"; then # Neither direct hardcoding nor static linking is supported with a # broken collect2. hardcode_direct=unsupported @@ -10478,34 +10764,57 @@ _LT_EOF ;; aix[4-9]*) - if test "$host_cpu" = ia64; then + if test ia64 = "$host_cpu"; then # On IA64, the linker does run time linking by default, so we don't # have to do anything special. aix_use_runtimelinking=no exp_sym_flag='-Bexport' - no_entry_flag="" + no_entry_flag= else # If we're using GNU nm, then we don't want the "-C" option. - # -C means demangle to AIX nm, but means don't demangle with GNU nm - # Also, AIX nm treats weak defined symbols like other global - # defined symbols, whereas GNU nm marks them as "W". + # -C means demangle to GNU nm, but means don't demangle to AIX nm. + # Without the "-l" option, or with the "-B" option, AIX nm treats + # weak defined symbols like other global defined symbols, whereas + # GNU nm marks them as "W". + # While the 'weak' keyword is ignored in the Export File, we need + # it in the Import File for the 'aix-soname' feature, so we have + # to replace the "-B" option with "-P" for AIX nm. if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then - export_symbols_cmds='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && (substr(\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' + export_symbols_cmds='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && (substr(\$ 3,1,1) != ".")) { if (\$ 2 == "W") { print \$ 3 " weak" } else { print \$ 3 } } }'\'' | sort -u > $export_symbols' else - export_symbols_cmds='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && (substr(\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' + export_symbols_cmds='`func_echo_all $NM | $SED -e '\''s/B\([^B]*\)$/P\1/'\''` -PCpgl $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) && (substr(\$ 1,1,1) != ".")) { if ((\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) { print \$ 1 " weak" } else { print \$ 1 } } }'\'' | sort -u > $export_symbols' fi aix_use_runtimelinking=no # Test if we are trying to use run time linking or normal # AIX style linking. If -brtl is somewhere in LDFLAGS, we - # need to do runtime linking. + # have runtime linking enabled, and use it for executables. + # For shared libraries, we enable/disable runtime linking + # depending on the kind of the shared library created - + # when "with_aix_soname,aix_use_runtimelinking" is: + # "aix,no" lib.a(lib.so.V) shared, rtl:no, for executables + # "aix,yes" lib.so shared, rtl:yes, for executables + # lib.a static archive + # "both,no" lib.so.V(shr.o) shared, rtl:yes + # lib.a(lib.so.V) shared, rtl:no, for executables + # "both,yes" lib.so.V(shr.o) shared, rtl:yes, for executables + # lib.a(lib.so.V) shared, rtl:no + # "svr4,*" lib.so.V(shr.o) shared, rtl:yes, for executables + # lib.a static archive case $host_os in aix4.[23]|aix4.[23].*|aix[5-9]*) for ld_flag in $LDFLAGS; do - if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then + if (test x-brtl = "x$ld_flag" || test x-Wl,-brtl = "x$ld_flag"); then aix_use_runtimelinking=yes break fi done + if test svr4,no = "$with_aix_soname,$aix_use_runtimelinking"; then + # With aix-soname=svr4, we create the lib.so.V shared archives only, + # so we don't have lib.a shared libs to link our executables. + # We have to force runtime linking in this case. + aix_use_runtimelinking=yes + LDFLAGS="$LDFLAGS -Wl,-brtl" + fi ;; esac @@ -10524,13 +10833,21 @@ _LT_EOF hardcode_direct_absolute=yes hardcode_libdir_separator=':' link_all_deplibs=yes - file_list_spec='${wl}-f,' + file_list_spec='$wl-f,' + case $with_aix_soname,$aix_use_runtimelinking in + aix,*) ;; # traditional, no import file + svr4,* | *,yes) # use import file + # The Import File defines what to hardcode. + hardcode_direct=no + hardcode_direct_absolute=no + ;; + esac - if test "$GCC" = yes; then + if test yes = "$GCC"; then case $host_os in aix4.[012]|aix4.[012].*) # We only want to do this on AIX 4.2 and lower, the check # below for broken collect2 doesn't work under 4.3+ - collect2name=`${CC} -print-prog-name=collect2` + collect2name=`$CC -print-prog-name=collect2` if test -f "$collect2name" && strings "$collect2name" | $GREP resolve_lib_name >/dev/null then @@ -10549,35 +10866,42 @@ _LT_EOF ;; esac shared_flag='-shared' - if test "$aix_use_runtimelinking" = yes; then - shared_flag="$shared_flag "'${wl}-G' + if test yes = "$aix_use_runtimelinking"; then + shared_flag="$shared_flag "'$wl-G' fi + # Need to ensure runtime linking is disabled for the traditional + # shared library, or the linker may eventually find shared libraries + # /with/ Import File - we do not want to mix them. + shared_flag_aix='-shared' + shared_flag_svr4='-shared $wl-G' else # not using gcc - if test "$host_cpu" = ia64; then + if test ia64 = "$host_cpu"; then # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release # chokes on -Wl,-G. The following line is correct: shared_flag='-G' else - if test "$aix_use_runtimelinking" = yes; then - shared_flag='${wl}-G' + if test yes = "$aix_use_runtimelinking"; then + shared_flag='$wl-G' else - shared_flag='${wl}-bM:SRE' + shared_flag='$wl-bM:SRE' fi + shared_flag_aix='$wl-bM:SRE' + shared_flag_svr4='$wl-G' fi fi - export_dynamic_flag_spec='${wl}-bexpall' + export_dynamic_flag_spec='$wl-bexpall' # It seems that -bexpall does not export symbols beginning with # underscore (_), so it is better to generate a list of symbols to export. always_export_symbols=yes - if test "$aix_use_runtimelinking" = yes; then + if test aix,yes = "$with_aix_soname,$aix_use_runtimelinking"; then # Warning - without using the other runtime loading flags (-brtl), # -berok will link without error, but may produce a broken library. allow_undefined_flag='-berok' # Determine the default libpath from the value encoded in an # empty executable. - if test "${lt_cv_aix_libpath+set}" = set; then + if test set = "${lt_cv_aix_libpath+set}"; then aix_libpath=$lt_cv_aix_libpath else if ${lt_cv_aix_libpath_+:} false; then : @@ -10612,7 +10936,7 @@ fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext if test -z "$lt_cv_aix_libpath_"; then - lt_cv_aix_libpath_="/usr/lib:/lib" + lt_cv_aix_libpath_=/usr/lib:/lib fi fi @@ -10620,17 +10944,17 @@ fi aix_libpath=$lt_cv_aix_libpath_ fi - hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath" - archive_expsym_cmds='$CC -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then func_echo_all "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag" + hardcode_libdir_flag_spec='$wl-blibpath:$libdir:'"$aix_libpath" + archive_expsym_cmds='$CC -o $output_objdir/$soname $libobjs $deplibs $wl'$no_entry_flag' $compiler_flags `if test -n "$allow_undefined_flag"; then func_echo_all "$wl$allow_undefined_flag"; else :; fi` $wl'$exp_sym_flag:\$export_symbols' '$shared_flag else - if test "$host_cpu" = ia64; then - hardcode_libdir_flag_spec='${wl}-R $libdir:/usr/lib:/lib' + if test ia64 = "$host_cpu"; then + hardcode_libdir_flag_spec='$wl-R $libdir:/usr/lib:/lib' allow_undefined_flag="-z nodefs" - archive_expsym_cmds="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols" + archive_expsym_cmds="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\$wl$no_entry_flag"' $compiler_flags $wl$allow_undefined_flag '"\$wl$exp_sym_flag:\$export_symbols" else # Determine the default libpath from the value encoded in an # empty executable. - if test "${lt_cv_aix_libpath+set}" = set; then + if test set = "${lt_cv_aix_libpath+set}"; then aix_libpath=$lt_cv_aix_libpath else if ${lt_cv_aix_libpath_+:} false; then : @@ -10665,7 +10989,7 @@ fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext if test -z "$lt_cv_aix_libpath_"; then - lt_cv_aix_libpath_="/usr/lib:/lib" + lt_cv_aix_libpath_=/usr/lib:/lib fi fi @@ -10673,21 +10997,33 @@ fi aix_libpath=$lt_cv_aix_libpath_ fi - hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath" + hardcode_libdir_flag_spec='$wl-blibpath:$libdir:'"$aix_libpath" # Warning - without using the other run time loading flags, # -berok will link without error, but may produce a broken library. - no_undefined_flag=' ${wl}-bernotok' - allow_undefined_flag=' ${wl}-berok' - if test "$with_gnu_ld" = yes; then + no_undefined_flag=' $wl-bernotok' + allow_undefined_flag=' $wl-berok' + if test yes = "$with_gnu_ld"; then # We only use this code for GNU lds that support --whole-archive. - whole_archive_flag_spec='${wl}--whole-archive$convenience ${wl}--no-whole-archive' + whole_archive_flag_spec='$wl--whole-archive$convenience $wl--no-whole-archive' else # Exported symbols can be pulled into shared objects from archives whole_archive_flag_spec='$convenience' fi archive_cmds_need_lc=yes - # This is similar to how AIX traditionally builds its shared libraries. - archive_expsym_cmds="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname' + archive_expsym_cmds='$RM -r $output_objdir/$realname.d~$MKDIR $output_objdir/$realname.d' + # -brtl affects multiple linker settings, -berok does not and is overridden later + compiler_flags_filtered='`func_echo_all "$compiler_flags " | $SED -e "s%-brtl\\([, ]\\)%-berok\\1%g"`' + if test svr4 != "$with_aix_soname"; then + # This is similar to how AIX traditionally builds its shared libraries. + archive_expsym_cmds="$archive_expsym_cmds"'~$CC '$shared_flag_aix' -o $output_objdir/$realname.d/$soname $libobjs $deplibs $wl-bnoentry '$compiler_flags_filtered'$wl-bE:$export_symbols$allow_undefined_flag~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$realname.d/$soname' + fi + if test aix != "$with_aix_soname"; then + archive_expsym_cmds="$archive_expsym_cmds"'~$CC '$shared_flag_svr4' -o $output_objdir/$realname.d/$shared_archive_member_spec.o $libobjs $deplibs $wl-bnoentry '$compiler_flags_filtered'$wl-bE:$export_symbols$allow_undefined_flag~$STRIP -e $output_objdir/$realname.d/$shared_archive_member_spec.o~( func_echo_all "#! $soname($shared_archive_member_spec.o)"; if test shr_64 = "$shared_archive_member_spec"; then func_echo_all "# 64"; else func_echo_all "# 32"; fi; cat $export_symbols ) > $output_objdir/$realname.d/$shared_archive_member_spec.imp~$AR $AR_FLAGS $output_objdir/$soname $output_objdir/$realname.d/$shared_archive_member_spec.o $output_objdir/$realname.d/$shared_archive_member_spec.imp' + else + # used by -dlpreopen to get the symbols + archive_expsym_cmds="$archive_expsym_cmds"'~$MV $output_objdir/$realname.d/$soname $output_objdir' + fi + archive_expsym_cmds="$archive_expsym_cmds"'~$RM -r $output_objdir/$realname.d' fi fi ;; @@ -10696,7 +11032,7 @@ fi case $host_cpu in powerpc) # see comment about AmigaOS4 .so support - archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' archive_expsym_cmds='' ;; m68k) @@ -10726,16 +11062,17 @@ fi # Tell ltmain to make .lib files, not .a files. libext=lib # Tell ltmain to make .dll files, not .so files. - shrext_cmds=".dll" + shrext_cmds=.dll # FIXME: Setting linknames here is a bad hack. - archive_cmds='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-dll~linknames=' - archive_expsym_cmds='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then - sed -n -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' -e '1\\\!p' < $export_symbols > $output_objdir/$soname.exp; - else - sed -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' < $export_symbols > $output_objdir/$soname.exp; - fi~ - $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~ - linknames=' + archive_cmds='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~linknames=' + archive_expsym_cmds='if test DEF = "`$SED -n -e '\''s/^[ ]*//'\'' -e '\''/^\(;.*\)*$/d'\'' -e '\''s/^\(EXPORTS\|LIBRARY\)\([ ].*\)*$/DEF/p'\'' -e q $export_symbols`" ; then + cp "$export_symbols" "$output_objdir/$soname.def"; + echo "$tool_output_objdir$soname.def" > "$output_objdir/$soname.exp"; + else + $SED -e '\''s/^/-link -EXPORT:/'\'' < $export_symbols > $output_objdir/$soname.exp; + fi~ + $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~ + linknames=' # The linker will not automatically build a static lib if we build a DLL. # _LT_TAGVAR(old_archive_from_new_cmds, )='true' enable_shared_with_static_runtimes=yes @@ -10744,18 +11081,18 @@ fi # Don't use ranlib old_postinstall_cmds='chmod 644 $oldlib' postlink_cmds='lt_outputfile="@OUTPUT@"~ - lt_tool_outputfile="@TOOL_OUTPUT@"~ - case $lt_outputfile in - *.exe|*.EXE) ;; - *) - lt_outputfile="$lt_outputfile.exe" - lt_tool_outputfile="$lt_tool_outputfile.exe" - ;; - esac~ - if test "$MANIFEST_TOOL" != ":" && test -f "$lt_outputfile.manifest"; then - $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1; - $RM "$lt_outputfile.manifest"; - fi' + lt_tool_outputfile="@TOOL_OUTPUT@"~ + case $lt_outputfile in + *.exe|*.EXE) ;; + *) + lt_outputfile=$lt_outputfile.exe + lt_tool_outputfile=$lt_tool_outputfile.exe + ;; + esac~ + if test : != "$MANIFEST_TOOL" && test -f "$lt_outputfile.manifest"; then + $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1; + $RM "$lt_outputfile.manifest"; + fi' ;; *) # Assume MSVC wrapper @@ -10764,7 +11101,7 @@ fi # Tell ltmain to make .lib files, not .a files. libext=lib # Tell ltmain to make .dll files, not .so files. - shrext_cmds=".dll" + shrext_cmds=.dll # FIXME: Setting linknames here is a bad hack. archive_cmds='$CC -o $lib $libobjs $compiler_flags `func_echo_all "$deplibs" | $SED '\''s/ -lc$//'\''` -link -dll~linknames=' # The linker will automatically build a .lib file if we build a DLL. @@ -10783,24 +11120,24 @@ fi hardcode_direct=no hardcode_automatic=yes hardcode_shlibpath_var=unsupported - if test "$lt_cv_ld_force_load" = "yes"; then - whole_archive_flag_spec='`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience ${wl}-force_load,$conv\"; done; func_echo_all \"$new_convenience\"`' + if test yes = "$lt_cv_ld_force_load"; then + whole_archive_flag_spec='`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience $wl-force_load,$conv\"; done; func_echo_all \"$new_convenience\"`' else whole_archive_flag_spec='' fi link_all_deplibs=yes - allow_undefined_flag="$_lt_dar_allow_undefined" + allow_undefined_flag=$_lt_dar_allow_undefined case $cc_basename in - ifort*) _lt_dar_can_shared=yes ;; + ifort*|nagfor*) _lt_dar_can_shared=yes ;; *) _lt_dar_can_shared=$GCC ;; esac - if test "$_lt_dar_can_shared" = "yes"; then + if test yes = "$_lt_dar_can_shared"; then output_verbose_link_cmd=func_echo_all - archive_cmds="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod${_lt_dsymutil}" - module_cmds="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dsymutil}" - archive_expsym_cmds="sed 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring ${_lt_dar_single_mod}${_lt_dar_export_syms}${_lt_dsymutil}" - module_expsym_cmds="sed -e 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dar_export_syms}${_lt_dsymutil}" + archive_cmds="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod$_lt_dsymutil" + module_cmds="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags$_lt_dsymutil" + archive_expsym_cmds="sed 's|^|_|' < \$export_symbols > \$output_objdir/\$libname-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod$_lt_dar_export_syms$_lt_dsymutil" + module_expsym_cmds="sed -e 's|^|_|' < \$export_symbols > \$output_objdir/\$libname-symbols.expsym~\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags$_lt_dar_export_syms$_lt_dsymutil" else ld_shlibs=no @@ -10842,33 +11179,33 @@ fi ;; hpux9*) - if test "$GCC" = yes; then - archive_cmds='$RM $output_objdir/$soname~$CC -shared $pic_flag ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' + if test yes = "$GCC"; then + archive_cmds='$RM $output_objdir/$soname~$CC -shared $pic_flag $wl+b $wl$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test "x$output_objdir/$soname" = "x$lib" || mv $output_objdir/$soname $lib' else - archive_cmds='$RM $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' + archive_cmds='$RM $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test "x$output_objdir/$soname" = "x$lib" || mv $output_objdir/$soname $lib' fi - hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir' + hardcode_libdir_flag_spec='$wl+b $wl$libdir' hardcode_libdir_separator=: hardcode_direct=yes # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. hardcode_minus_L=yes - export_dynamic_flag_spec='${wl}-E' + export_dynamic_flag_spec='$wl-E' ;; hpux10*) - if test "$GCC" = yes && test "$with_gnu_ld" = no; then - archive_cmds='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' + if test yes,no = "$GCC,$with_gnu_ld"; then + archive_cmds='$CC -shared $pic_flag $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $libobjs $deplibs $compiler_flags' else archive_cmds='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' fi - if test "$with_gnu_ld" = no; then - hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir' + if test no = "$with_gnu_ld"; then + hardcode_libdir_flag_spec='$wl+b $wl$libdir' hardcode_libdir_separator=: hardcode_direct=yes hardcode_direct_absolute=yes - export_dynamic_flag_spec='${wl}-E' + export_dynamic_flag_spec='$wl-E' # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. hardcode_minus_L=yes @@ -10876,25 +11213,25 @@ fi ;; hpux11*) - if test "$GCC" = yes && test "$with_gnu_ld" = no; then + if test yes,no = "$GCC,$with_gnu_ld"; then case $host_cpu in hppa*64*) - archive_cmds='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' + archive_cmds='$CC -shared $wl+h $wl$soname -o $lib $libobjs $deplibs $compiler_flags' ;; ia64*) - archive_cmds='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' + archive_cmds='$CC -shared $pic_flag $wl+h $wl$soname $wl+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' ;; *) - archive_cmds='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' + archive_cmds='$CC -shared $pic_flag $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $libobjs $deplibs $compiler_flags' ;; esac else case $host_cpu in hppa*64*) - archive_cmds='$CC -b ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' + archive_cmds='$CC -b $wl+h $wl$soname -o $lib $libobjs $deplibs $compiler_flags' ;; ia64*) - archive_cmds='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' + archive_cmds='$CC -b $wl+h $wl$soname $wl+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' ;; *) @@ -10906,7 +11243,7 @@ if ${lt_cv_prog_compiler__b+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_prog_compiler__b=no - save_LDFLAGS="$LDFLAGS" + save_LDFLAGS=$LDFLAGS LDFLAGS="$LDFLAGS -b" echo "$lt_simple_link_test_code" > conftest.$ac_ext if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then @@ -10925,14 +11262,14 @@ else fi fi $RM -r conftest* - LDFLAGS="$save_LDFLAGS" + LDFLAGS=$save_LDFLAGS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler__b" >&5 $as_echo "$lt_cv_prog_compiler__b" >&6; } -if test x"$lt_cv_prog_compiler__b" = xyes; then - archive_cmds='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' +if test yes = "$lt_cv_prog_compiler__b"; then + archive_cmds='$CC -b $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $libobjs $deplibs $compiler_flags' else archive_cmds='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' fi @@ -10940,8 +11277,8 @@ fi ;; esac fi - if test "$with_gnu_ld" = no; then - hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir' + if test no = "$with_gnu_ld"; then + hardcode_libdir_flag_spec='$wl+b $wl$libdir' hardcode_libdir_separator=: case $host_cpu in @@ -10952,7 +11289,7 @@ fi *) hardcode_direct=yes hardcode_direct_absolute=yes - export_dynamic_flag_spec='${wl}-E' + export_dynamic_flag_spec='$wl-E' # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. @@ -10963,8 +11300,8 @@ fi ;; irix5* | irix6* | nonstopux*) - if test "$GCC" = yes; then - archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' + if test yes = "$GCC"; then + archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib' # Try to use the -exported_symbol ld option, if it does not # work, assume that -exports_file does not work either and # implicitly export all symbols. @@ -10974,8 +11311,8 @@ $as_echo_n "checking whether the $host_os linker accepts -exported_symbol... " > if ${lt_cv_irix_exported_symbol+:} false; then : $as_echo_n "(cached) " >&6 else - save_LDFLAGS="$LDFLAGS" - LDFLAGS="$LDFLAGS -shared ${wl}-exported_symbol ${wl}foo ${wl}-update_registry ${wl}/dev/null" + save_LDFLAGS=$LDFLAGS + LDFLAGS="$LDFLAGS -shared $wl-exported_symbol ${wl}foo $wl-update_registry $wl/dev/null" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int foo (void) { return 0; } @@ -10987,24 +11324,34 @@ else fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext - LDFLAGS="$save_LDFLAGS" + LDFLAGS=$save_LDFLAGS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_irix_exported_symbol" >&5 $as_echo "$lt_cv_irix_exported_symbol" >&6; } - if test "$lt_cv_irix_exported_symbol" = yes; then - archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations ${wl}-exports_file ${wl}$export_symbols -o $lib' + if test yes = "$lt_cv_irix_exported_symbol"; then + archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations $wl-exports_file $wl$export_symbols -o $lib' fi else - archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' - archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -exports_file $export_symbols -o $lib' + archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib' + archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -exports_file $export_symbols -o $lib' fi archive_cmds_need_lc='no' - hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' + hardcode_libdir_flag_spec='$wl-rpath $wl$libdir' hardcode_libdir_separator=: inherit_rpath=yes link_all_deplibs=yes ;; + linux*) + case $cc_basename in + tcc*) + # Fabrice Bellard et al's Tiny C Compiler + ld_shlibs=yes + archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' + ;; + esac + ;; + netbsd*) if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out @@ -11019,7 +11366,7 @@ $as_echo "$lt_cv_irix_exported_symbol" >&6; } newsos6) archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_direct=yes - hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' + hardcode_libdir_flag_spec='$wl-rpath $wl$libdir' hardcode_libdir_separator=: hardcode_shlibpath_var=no ;; @@ -11027,27 +11374,19 @@ $as_echo "$lt_cv_irix_exported_symbol" >&6; } *nto* | *qnx*) ;; - openbsd*) + openbsd* | bitrig*) if test -f /usr/libexec/ld.so; then hardcode_direct=yes hardcode_shlibpath_var=no hardcode_direct_absolute=yes - if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then + if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`"; then archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' - archive_expsym_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-retain-symbols-file,$export_symbols' - hardcode_libdir_flag_spec='${wl}-rpath,$libdir' - export_dynamic_flag_spec='${wl}-E' + archive_expsym_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags $wl-retain-symbols-file,$export_symbols' + hardcode_libdir_flag_spec='$wl-rpath,$libdir' + export_dynamic_flag_spec='$wl-E' else - case $host_os in - openbsd[01].* | openbsd2.[0-7] | openbsd2.[0-7].*) - archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' - hardcode_libdir_flag_spec='-R$libdir' - ;; - *) - archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' - hardcode_libdir_flag_spec='${wl}-rpath,$libdir' - ;; - esac + archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' + hardcode_libdir_flag_spec='$wl-rpath,$libdir' fi else ld_shlibs=no @@ -11058,33 +11397,53 @@ $as_echo "$lt_cv_irix_exported_symbol" >&6; } hardcode_libdir_flag_spec='-L$libdir' hardcode_minus_L=yes allow_undefined_flag=unsupported - archive_cmds='$ECHO "LIBRARY $libname INITINSTANCE" > $output_objdir/$libname.def~$ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~echo DATA >> $output_objdir/$libname.def~echo " SINGLE NONSHARED" >> $output_objdir/$libname.def~echo EXPORTS >> $output_objdir/$libname.def~emxexp $libobjs >> $output_objdir/$libname.def~$CC -Zdll -Zcrtdll -o $lib $libobjs $deplibs $compiler_flags $output_objdir/$libname.def' - old_archive_from_new_cmds='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def' + shrext_cmds=.dll + archive_cmds='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~ + $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~ + $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~ + $ECHO EXPORTS >> $output_objdir/$libname.def~ + emxexp $libobjs | $SED /"_DLL_InitTerm"/d >> $output_objdir/$libname.def~ + $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~ + emximp -o $lib $output_objdir/$libname.def' + archive_expsym_cmds='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~ + $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~ + $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~ + $ECHO EXPORTS >> $output_objdir/$libname.def~ + prefix_cmds="$SED"~ + if test EXPORTS = "`$SED 1q $export_symbols`"; then + prefix_cmds="$prefix_cmds -e 1d"; + fi~ + prefix_cmds="$prefix_cmds -e \"s/^\(.*\)$/_\1/g\""~ + cat $export_symbols | $prefix_cmds >> $output_objdir/$libname.def~ + $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~ + emximp -o $lib $output_objdir/$libname.def' + old_archive_From_new_cmds='emximp -o $output_objdir/${libname}_dll.a $output_objdir/$libname.def' + enable_shared_with_static_runtimes=yes ;; osf3*) - if test "$GCC" = yes; then - allow_undefined_flag=' ${wl}-expect_unresolved ${wl}\*' - archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' + if test yes = "$GCC"; then + allow_undefined_flag=' $wl-expect_unresolved $wl\*' + archive_cmds='$CC -shared$allow_undefined_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib' else allow_undefined_flag=' -expect_unresolved \*' - archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' + archive_cmds='$CC -shared$allow_undefined_flag $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib' fi archive_cmds_need_lc='no' - hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' + hardcode_libdir_flag_spec='$wl-rpath $wl$libdir' hardcode_libdir_separator=: ;; osf4* | osf5*) # as osf3* with the addition of -msym flag - if test "$GCC" = yes; then - allow_undefined_flag=' ${wl}-expect_unresolved ${wl}\*' - archive_cmds='$CC -shared${allow_undefined_flag} $pic_flag $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' - hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' + if test yes = "$GCC"; then + allow_undefined_flag=' $wl-expect_unresolved $wl\*' + archive_cmds='$CC -shared$allow_undefined_flag $pic_flag $libobjs $deplibs $compiler_flags $wl-msym $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib' + hardcode_libdir_flag_spec='$wl-rpath $wl$libdir' else allow_undefined_flag=' -expect_unresolved \*' - archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -msym -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' + archive_cmds='$CC -shared$allow_undefined_flag $libobjs $deplibs $compiler_flags -msym -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib' archive_expsym_cmds='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; printf "%s\\n" "-hidden">> $lib.exp~ - $CC -shared${allow_undefined_flag} ${wl}-input ${wl}$lib.exp $compiler_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && $ECHO "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib~$RM $lib.exp' + $CC -shared$allow_undefined_flag $wl-input $wl$lib.exp $compiler_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && $ECHO "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib~$RM $lib.exp' # Both c and cxx compiler support -rpath directly hardcode_libdir_flag_spec='-rpath $libdir' @@ -11095,24 +11454,24 @@ $as_echo "$lt_cv_irix_exported_symbol" >&6; } solaris*) no_undefined_flag=' -z defs' - if test "$GCC" = yes; then - wlarc='${wl}' - archive_cmds='$CC -shared $pic_flag ${wl}-z ${wl}text ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' + if test yes = "$GCC"; then + wlarc='$wl' + archive_cmds='$CC -shared $pic_flag $wl-z ${wl}text $wl-h $wl$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ - $CC -shared $pic_flag ${wl}-z ${wl}text ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp' + $CC -shared $pic_flag $wl-z ${wl}text $wl-M $wl$lib.exp $wl-h $wl$soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp' else case `$CC -V 2>&1` in *"Compilers 5.0"*) wlarc='' - archive_cmds='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags' + archive_cmds='$LD -G$allow_undefined_flag -h $soname -o $lib $libobjs $deplibs $linker_flags' archive_expsym_cmds='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ - $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$RM $lib.exp' + $LD -G$allow_undefined_flag -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$RM $lib.exp' ;; *) - wlarc='${wl}' - archive_cmds='$CC -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $compiler_flags' + wlarc='$wl' + archive_cmds='$CC -G$allow_undefined_flag -h $soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ - $CC -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp' + $CC -G$allow_undefined_flag -M $lib.exp -h $soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp' ;; esac fi @@ -11122,11 +11481,11 @@ $as_echo "$lt_cv_irix_exported_symbol" >&6; } solaris2.[0-5] | solaris2.[0-5].*) ;; *) # The compiler driver will combine and reorder linker options, - # but understands `-z linker_flag'. GCC discards it without `$wl', + # but understands '-z linker_flag'. GCC discards it without '$wl', # but is careful enough not to reorder. # Supported since Solaris 2.6 (maybe 2.5.1?) - if test "$GCC" = yes; then - whole_archive_flag_spec='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract' + if test yes = "$GCC"; then + whole_archive_flag_spec='$wl-z ${wl}allextract$convenience $wl-z ${wl}defaultextract' else whole_archive_flag_spec='-z allextract$convenience -z defaultextract' fi @@ -11136,10 +11495,10 @@ $as_echo "$lt_cv_irix_exported_symbol" >&6; } ;; sunos4*) - if test "x$host_vendor" = xsequent; then + if test sequent = "$host_vendor"; then # Use $CC to link under sequent, because it throws in some extra .o # files that make .init and .fini sections work. - archive_cmds='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags' + archive_cmds='$CC -G $wl-h $soname -o $lib $libobjs $deplibs $compiler_flags' else archive_cmds='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags' fi @@ -11188,43 +11547,43 @@ $as_echo "$lt_cv_irix_exported_symbol" >&6; } ;; sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[01].[10]* | unixware7* | sco3.2v5.0.[024]*) - no_undefined_flag='${wl}-z,text' + no_undefined_flag='$wl-z,text' archive_cmds_need_lc=no hardcode_shlibpath_var=no runpath_var='LD_RUN_PATH' - if test "$GCC" = yes; then - archive_cmds='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' - archive_expsym_cmds='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + if test yes = "$GCC"; then + archive_cmds='$CC -shared $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + archive_expsym_cmds='$CC -shared $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' else - archive_cmds='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' - archive_expsym_cmds='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + archive_cmds='$CC -G $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + archive_expsym_cmds='$CC -G $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' fi ;; sysv5* | sco3.2v5* | sco5v6*) - # Note: We can NOT use -z defs as we might desire, because we do not + # Note: We CANNOT use -z defs as we might desire, because we do not # link with -lc, and that would cause any symbols used from libc to # always be unresolved, which means just about no library would # ever link correctly. If we're not using GNU ld we use -z text # though, which does catch some bad symbols but isn't as heavy-handed # as -z defs. - no_undefined_flag='${wl}-z,text' - allow_undefined_flag='${wl}-z,nodefs' + no_undefined_flag='$wl-z,text' + allow_undefined_flag='$wl-z,nodefs' archive_cmds_need_lc=no hardcode_shlibpath_var=no - hardcode_libdir_flag_spec='${wl}-R,$libdir' + hardcode_libdir_flag_spec='$wl-R,$libdir' hardcode_libdir_separator=':' link_all_deplibs=yes - export_dynamic_flag_spec='${wl}-Bexport' + export_dynamic_flag_spec='$wl-Bexport' runpath_var='LD_RUN_PATH' - if test "$GCC" = yes; then - archive_cmds='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' - archive_expsym_cmds='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + if test yes = "$GCC"; then + archive_cmds='$CC -shared $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + archive_expsym_cmds='$CC -shared $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' else - archive_cmds='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' - archive_expsym_cmds='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + archive_cmds='$CC -G $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + archive_expsym_cmds='$CC -G $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' fi ;; @@ -11239,10 +11598,10 @@ $as_echo "$lt_cv_irix_exported_symbol" >&6; } ;; esac - if test x$host_vendor = xsni; then + if test sni = "$host_vendor"; then case $host in sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*) - export_dynamic_flag_spec='${wl}-Blargedynsym' + export_dynamic_flag_spec='$wl-Blargedynsym' ;; esac fi @@ -11250,7 +11609,7 @@ $as_echo "$lt_cv_irix_exported_symbol" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ld_shlibs" >&5 $as_echo "$ld_shlibs" >&6; } -test "$ld_shlibs" = no && can_build_shared=no +test no = "$ld_shlibs" && can_build_shared=no with_gnu_ld=$with_gnu_ld @@ -11276,7 +11635,7 @@ x|xyes) # Assume -lc should be added archive_cmds_need_lc=yes - if test "$enable_shared" = yes && test "$GCC" = yes; then + if test yes,yes = "$GCC,$enable_shared"; then case $archive_cmds in *'~'*) # FIXME: we may have to deal with multi-command sequences. @@ -11491,14 +11850,14 @@ esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking dynamic linker characteristics" >&5 $as_echo_n "checking dynamic linker characteristics... " >&6; } -if test "$GCC" = yes; then +if test yes = "$GCC"; then case $host_os in - darwin*) lt_awk_arg="/^libraries:/,/LR/" ;; - *) lt_awk_arg="/^libraries:/" ;; + darwin*) lt_awk_arg='/^libraries:/,/LR/' ;; + *) lt_awk_arg='/^libraries:/' ;; esac case $host_os in - mingw* | cegcc*) lt_sed_strip_eq="s,=\([A-Za-z]:\),\1,g" ;; - *) lt_sed_strip_eq="s,=/,/,g" ;; + mingw* | cegcc*) lt_sed_strip_eq='s|=\([A-Za-z]:\)|\1|g' ;; + *) lt_sed_strip_eq='s|=/|/|g' ;; esac lt_search_path_spec=`$CC -print-search-dirs | awk $lt_awk_arg | $SED -e "s/^libraries://" -e $lt_sed_strip_eq` case $lt_search_path_spec in @@ -11514,28 +11873,35 @@ if test "$GCC" = yes; then ;; esac # Ok, now we have the path, separated by spaces, we can step through it - # and add multilib dir if necessary. + # and add multilib dir if necessary... lt_tmp_lt_search_path_spec= - lt_multi_os_dir=`$CC $CPPFLAGS $CFLAGS $LDFLAGS -print-multi-os-directory 2>/dev/null` + lt_multi_os_dir=/`$CC $CPPFLAGS $CFLAGS $LDFLAGS -print-multi-os-directory 2>/dev/null` + # ...but if some path component already ends with the multilib dir we assume + # that all is fine and trust -print-search-dirs as is (GCC 4.2? or newer). + case "$lt_multi_os_dir; $lt_search_path_spec " in + "/; "* | "/.; "* | "/./; "* | *"$lt_multi_os_dir "* | *"$lt_multi_os_dir/ "*) + lt_multi_os_dir= + ;; + esac for lt_sys_path in $lt_search_path_spec; do - if test -d "$lt_sys_path/$lt_multi_os_dir"; then - lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path/$lt_multi_os_dir" - else + if test -d "$lt_sys_path$lt_multi_os_dir"; then + lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path$lt_multi_os_dir" + elif test -n "$lt_multi_os_dir"; then test -d "$lt_sys_path" && \ lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path" fi done lt_search_path_spec=`$ECHO "$lt_tmp_lt_search_path_spec" | awk ' -BEGIN {RS=" "; FS="/|\n";} { - lt_foo=""; - lt_count=0; +BEGIN {RS = " "; FS = "/|\n";} { + lt_foo = ""; + lt_count = 0; for (lt_i = NF; lt_i > 0; lt_i--) { if ($lt_i != "" && $lt_i != ".") { if ($lt_i == "..") { lt_count++; } else { if (lt_count == 0) { - lt_foo="/" $lt_i lt_foo; + lt_foo = "/" $lt_i lt_foo; } else { lt_count--; } @@ -11549,7 +11915,7 @@ BEGIN {RS=" "; FS="/|\n";} { # for these hosts. case $host_os in mingw* | cegcc*) lt_search_path_spec=`$ECHO "$lt_search_path_spec" |\ - $SED 's,/\([A-Za-z]:\),\1,g'` ;; + $SED 's|/\([A-Za-z]:\)|\1|g'` ;; esac sys_lib_search_path_spec=`$ECHO "$lt_search_path_spec" | $lt_NL2SP` else @@ -11558,7 +11924,7 @@ fi library_names_spec= libname_spec='lib$name' soname_spec= -shrext_cmds=".so" +shrext_cmds=.so postinstall_cmds= postuninstall_cmds= finish_cmds= @@ -11575,14 +11941,16 @@ hardcode_into_libs=no # flags to be left without arguments need_version=unknown + + case $host_os in aix3*) version_type=linux # correct to gnu/linux during the next big refactor - library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a' + library_names_spec='$libname$release$shared_ext$versuffix $libname.a' shlibpath_var=LIBPATH # AIX 3 has no versioning support, so we append a major version to the name. - soname_spec='${libname}${release}${shared_ext}$major' + soname_spec='$libname$release$shared_ext$major' ;; aix[4-9]*) @@ -11590,41 +11958,91 @@ aix[4-9]*) need_lib_prefix=no need_version=no hardcode_into_libs=yes - if test "$host_cpu" = ia64; then + if test ia64 = "$host_cpu"; then # AIX 5 supports IA64 - library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}' + library_names_spec='$libname$release$shared_ext$major $libname$release$shared_ext$versuffix $libname$shared_ext' shlibpath_var=LD_LIBRARY_PATH else # With GCC up to 2.95.x, collect2 would create an import file # for dependence libraries. The import file would start with - # the line `#! .'. This would cause the generated library to - # depend on `.', always an invalid library. This was fixed in + # the line '#! .'. This would cause the generated library to + # depend on '.', always an invalid library. This was fixed in # development snapshots of GCC prior to 3.0. case $host_os in aix4 | aix4.[01] | aix4.[01].*) if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)' echo ' yes ' - echo '#endif'; } | ${CC} -E - | $GREP yes > /dev/null; then + echo '#endif'; } | $CC -E - | $GREP yes > /dev/null; then : else can_build_shared=no fi ;; esac - # AIX (on Power*) has no versioning support, so currently we can not hardcode correct + # Using Import Files as archive members, it is possible to support + # filename-based versioning of shared library archives on AIX. While + # this would work for both with and without runtime linking, it will + # prevent static linking of such archives. So we do filename-based + # shared library versioning with .so extension only, which is used + # when both runtime linking and shared linking is enabled. + # Unfortunately, runtime linking may impact performance, so we do + # not want this to be the default eventually. Also, we use the + # versioned .so libs for executables only if there is the -brtl + # linker flag in LDFLAGS as well, or --with-aix-soname=svr4 only. + # To allow for filename-based versioning support, we need to create + # libNAME.so.V as an archive file, containing: + # *) an Import File, referring to the versioned filename of the + # archive as well as the shared archive member, telling the + # bitwidth (32 or 64) of that shared object, and providing the + # list of exported symbols of that shared object, eventually + # decorated with the 'weak' keyword + # *) the shared object with the F_LOADONLY flag set, to really avoid + # it being seen by the linker. + # At run time we better use the real file rather than another symlink, + # but for link time we create the symlink libNAME.so -> libNAME.so.V + + case $with_aix_soname,$aix_use_runtimelinking in + # AIX (on Power*) has no versioning support, so currently we cannot hardcode correct # soname into executable. Probably we can add versioning support to # collect2, so additional links can be useful in future. - if test "$aix_use_runtimelinking" = yes; then + aix,yes) # traditional libtool + dynamic_linker='AIX unversionable lib.so' # If using run time linking (on AIX 4.2 or later) use lib.so # instead of lib.a to let people know that these are not # typical AIX shared libraries. - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - else + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' + ;; + aix,no) # traditional AIX only + dynamic_linker='AIX lib.a(lib.so.V)' # We preserve .a as extension for shared libraries through AIX4.2 # and later when we are not doing run time linking. - library_names_spec='${libname}${release}.a $libname.a' - soname_spec='${libname}${release}${shared_ext}$major' - fi + library_names_spec='$libname$release.a $libname.a' + soname_spec='$libname$release$shared_ext$major' + ;; + svr4,*) # full svr4 only + dynamic_linker="AIX lib.so.V($shared_archive_member_spec.o)" + library_names_spec='$libname$release$shared_ext$major $libname$shared_ext' + # We do not specify a path in Import Files, so LIBPATH fires. + shlibpath_overrides_runpath=yes + ;; + *,yes) # both, prefer svr4 + dynamic_linker="AIX lib.so.V($shared_archive_member_spec.o), lib.a(lib.so.V)" + library_names_spec='$libname$release$shared_ext$major $libname$shared_ext' + # unpreferred sharedlib libNAME.a needs extra handling + postinstall_cmds='test -n "$linkname" || linkname="$realname"~func_stripname "" ".so" "$linkname"~$install_shared_prog "$dir/$func_stripname_result.$libext" "$destdir/$func_stripname_result.$libext"~test -z "$tstripme" || test -z "$striplib" || $striplib "$destdir/$func_stripname_result.$libext"' + postuninstall_cmds='for n in $library_names $old_library; do :; done~func_stripname "" ".so" "$n"~test "$func_stripname_result" = "$n" || func_append rmfiles " $odir/$func_stripname_result.$libext"' + # We do not specify a path in Import Files, so LIBPATH fires. + shlibpath_overrides_runpath=yes + ;; + *,no) # both, prefer aix + dynamic_linker="AIX lib.a(lib.so.V), lib.so.V($shared_archive_member_spec.o)" + library_names_spec='$libname$release.a $libname.a' + soname_spec='$libname$release$shared_ext$major' + # unpreferred sharedlib libNAME.so.V and symlink libNAME.so need extra handling + postinstall_cmds='test -z "$dlname" || $install_shared_prog $dir/$dlname $destdir/$dlname~test -z "$tstripme" || test -z "$striplib" || $striplib $destdir/$dlname~test -n "$linkname" || linkname=$realname~func_stripname "" ".a" "$linkname"~(cd "$destdir" && $LN_S -f $dlname $func_stripname_result.so)' + postuninstall_cmds='test -z "$dlname" || func_append rmfiles " $odir/$dlname"~for n in $old_library $library_names; do :; done~func_stripname "" ".a" "$n"~func_append rmfiles " $odir/$func_stripname_result.so"' + ;; + esac shlibpath_var=LIBPATH fi ;; @@ -11634,18 +12052,18 @@ amigaos*) powerpc) # Since July 2007 AmigaOS4 officially supports .so libraries. # When compiling the executable, add -use-dynld -Lsobjs: to the compileline. - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' ;; m68k) library_names_spec='$libname.ixlibrary $libname.a' # Create ${libname}_ixlibrary.a entries in /sys/libs. - finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`func_echo_all "$lib" | $SED '\''s%^.*/\([^/]*\)\.ixlibrary$%\1%'\''`; test $RM /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done' + finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`func_echo_all "$lib" | $SED '\''s%^.*/\([^/]*\)\.ixlibrary$%\1%'\''`; $RM /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done' ;; esac ;; beos*) - library_names_spec='${libname}${shared_ext}' + library_names_spec='$libname$shared_ext' dynamic_linker="$host_os ld.so" shlibpath_var=LIBRARY_PATH ;; @@ -11653,8 +12071,8 @@ beos*) bsdi[45]*) version_type=linux # correct to gnu/linux during the next big refactor need_version=no - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' + soname_spec='$libname$release$shared_ext$major' finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir' shlibpath_var=LD_LIBRARY_PATH sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib" @@ -11666,7 +12084,7 @@ bsdi[45]*) cygwin* | mingw* | pw32* | cegcc*) version_type=windows - shrext_cmds=".dll" + shrext_cmds=.dll need_version=no need_lib_prefix=no @@ -11675,8 +12093,8 @@ cygwin* | mingw* | pw32* | cegcc*) # gcc library_names_spec='$libname.dll.a' # DLL is installed to $(libdir)/../bin by postinstall_cmds - postinstall_cmds='base_file=`basename \${file}`~ - dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~ + postinstall_cmds='base_file=`basename \$file`~ + dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\$base_file'\''i; echo \$dlname'\''`~ dldir=$destdir/`dirname \$dlpath`~ test -d \$dldir || mkdir -p \$dldir~ $install_prog $dir/$dlname \$dldir/$dlname~ @@ -11692,17 +12110,17 @@ cygwin* | mingw* | pw32* | cegcc*) case $host_os in cygwin*) # Cygwin DLLs use 'cyg' prefix rather than 'lib' - soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' + soname_spec='`echo $libname | sed -e 's/^lib/cyg/'``echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext' sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/lib/w32api" ;; mingw* | cegcc*) # MinGW DLLs use traditional 'lib' prefix - soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' + soname_spec='$libname`echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext' ;; pw32*) # pw32 DLLs use 'pw' prefix rather than 'lib' - library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' + library_names_spec='`echo $libname | sed -e 's/^lib/pw/'``echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext' ;; esac dynamic_linker='Win32 ld.exe' @@ -11711,8 +12129,8 @@ cygwin* | mingw* | pw32* | cegcc*) *,cl*) # Native MSVC libname_spec='$name' - soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' - library_names_spec='${libname}.dll.lib' + soname_spec='$libname`echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext' + library_names_spec='$libname.dll.lib' case $build_os in mingw*) @@ -11739,7 +12157,7 @@ cygwin* | mingw* | pw32* | cegcc*) sys_lib_search_path_spec=`cygpath --path --unix "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` ;; *) - sys_lib_search_path_spec="$LIB" + sys_lib_search_path_spec=$LIB if $ECHO "$sys_lib_search_path_spec" | $GREP ';[c-zC-Z]:/' >/dev/null; then # It is most probably a Windows format PATH. sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` @@ -11752,8 +12170,8 @@ cygwin* | mingw* | pw32* | cegcc*) esac # DLL is installed to $(libdir)/../bin by postinstall_cmds - postinstall_cmds='base_file=`basename \${file}`~ - dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~ + postinstall_cmds='base_file=`basename \$file`~ + dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\$base_file'\''i; echo \$dlname'\''`~ dldir=$destdir/`dirname \$dlpath`~ test -d \$dldir || mkdir -p \$dldir~ $install_prog $dir/$dlname \$dldir/$dlname' @@ -11766,7 +12184,7 @@ cygwin* | mingw* | pw32* | cegcc*) *) # Assume MSVC wrapper - library_names_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext} $libname.lib' + library_names_spec='$libname`echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext $libname.lib' dynamic_linker='Win32 ld.exe' ;; esac @@ -11779,8 +12197,8 @@ darwin* | rhapsody*) version_type=darwin need_lib_prefix=no need_version=no - library_names_spec='${libname}${release}${major}$shared_ext ${libname}$shared_ext' - soname_spec='${libname}${release}${major}$shared_ext' + library_names_spec='$libname$release$major$shared_ext $libname$shared_ext' + soname_spec='$libname$release$major$shared_ext' shlibpath_overrides_runpath=yes shlibpath_var=DYLD_LIBRARY_PATH shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`' @@ -11793,8 +12211,8 @@ dgux*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext' - soname_spec='${libname}${release}${shared_ext}$major' + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' + soname_spec='$libname$release$shared_ext$major' shlibpath_var=LD_LIBRARY_PATH ;; @@ -11812,12 +12230,13 @@ freebsd* | dragonfly*) version_type=freebsd-$objformat case $version_type in freebsd-elf*) - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' + soname_spec='$libname$release$shared_ext$major' need_version=no need_lib_prefix=no ;; freebsd-*) - library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix' + library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix' need_version=yes ;; esac @@ -11842,26 +12261,15 @@ freebsd* | dragonfly*) esac ;; -gnu*) - version_type=linux # correct to gnu/linux during the next big refactor - need_lib_prefix=no - need_version=no - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=no - hardcode_into_libs=yes - ;; - haiku*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no dynamic_linker="$host_os runtime_loader" - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' + soname_spec='$libname$release$shared_ext$major' shlibpath_var=LIBRARY_PATH - shlibpath_overrides_runpath=yes + shlibpath_overrides_runpath=no sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/system/lib' hardcode_into_libs=yes ;; @@ -11879,14 +12287,15 @@ hpux9* | hpux10* | hpux11*) dynamic_linker="$host_os dld.so" shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - if test "X$HPUX_IA64_MODE" = X32; then + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' + soname_spec='$libname$release$shared_ext$major' + if test 32 = "$HPUX_IA64_MODE"; then sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib" + sys_lib_dlsearch_path_spec=/usr/lib/hpux32 else sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64" + sys_lib_dlsearch_path_spec=/usr/lib/hpux64 fi - sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec ;; hppa*64*) shrext_cmds='.sl' @@ -11894,8 +12303,8 @@ hpux9* | hpux10* | hpux11*) dynamic_linker="$host_os dld.sl" shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' + soname_spec='$libname$release$shared_ext$major' sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64" sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec ;; @@ -11904,8 +12313,8 @@ hpux9* | hpux10* | hpux11*) dynamic_linker="$host_os dld.sl" shlibpath_var=SHLIB_PATH shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' + soname_spec='$libname$release$shared_ext$major' ;; esac # HP-UX runs *really* slowly unless shared libraries are mode 555, ... @@ -11918,8 +12327,8 @@ interix[3-9]*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' + soname_spec='$libname$release$shared_ext$major' dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no @@ -11930,7 +12339,7 @@ irix5* | irix6* | nonstopux*) case $host_os in nonstopux*) version_type=nonstopux ;; *) - if test "$lt_cv_prog_gnu_ld" = yes; then + if test yes = "$lt_cv_prog_gnu_ld"; then version_type=linux # correct to gnu/linux during the next big refactor else version_type=irix @@ -11938,8 +12347,8 @@ irix5* | irix6* | nonstopux*) esac need_lib_prefix=no need_version=no - soname_spec='${libname}${release}${shared_ext}$major' - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}' + soname_spec='$libname$release$shared_ext$major' + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$release$shared_ext $libname$shared_ext' case $host_os in irix5* | nonstopux*) libsuff= shlibsuff= @@ -11958,8 +12367,8 @@ irix5* | irix6* | nonstopux*) esac shlibpath_var=LD_LIBRARY${shlibsuff}_PATH shlibpath_overrides_runpath=no - sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}" - sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}" + sys_lib_search_path_spec="/usr/lib$libsuff /lib$libsuff /usr/local/lib$libsuff" + sys_lib_dlsearch_path_spec="/usr/lib$libsuff /lib$libsuff" hardcode_into_libs=yes ;; @@ -11968,13 +12377,33 @@ linux*oldld* | linux*aout* | linux*coff*) dynamic_linker=no ;; +linux*android*) + version_type=none # Android doesn't support versioned libraries. + need_lib_prefix=no + need_version=no + library_names_spec='$libname$release$shared_ext' + soname_spec='$libname$release$shared_ext' + finish_cmds= + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + + # This implies no fast_install, which is unacceptable. + # Some rework will be needed to allow for fast_install + # before this can be enabled. + hardcode_into_libs=yes + + dynamic_linker='Android linker' + # Don't embed -rpath directories since the linker doesn't support them. + hardcode_libdir_flag_spec='-L$libdir' + ;; + # This must be glibc/ELF. -linux* | k*bsd*-gnu | kopensolaris*-gnu) +linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' + soname_spec='$libname$release$shared_ext$major' finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no @@ -12021,11 +12450,15 @@ fi # Add ABI-specific directories to the system library path. sys_lib_dlsearch_path_spec="/lib64 /usr/lib64 /lib /usr/lib" - # Append ld.so.conf contents to the search path + # Ideally, we could use ldconfig to report *all* directores which are + # searched for libraries, however this is still not possible. Aside from not + # being certain /sbin/ldconfig is available, command + # 'ldconfig -N -X -v | grep ^/' on 64bit Fedora does not report /usr/lib64, + # even though it is searched at run-time. Try to do the best guess by + # appending ld.so.conf contents (and includes) to the search path. if test -f /etc/ld.so.conf; then lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[ ]*hwcap[ ]/d;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;s/"//g;/^$/d' | tr '\n' ' '` sys_lib_dlsearch_path_spec="$sys_lib_dlsearch_path_spec $lt_ld_extra" - fi # We used to test for /lib/ld.so.1 and disable shared libraries on @@ -12042,12 +12475,12 @@ netbsd*) need_lib_prefix=no need_version=no if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' + library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix' finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' dynamic_linker='NetBSD (a.out) ld.so' else - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' + soname_spec='$libname$release$shared_ext$major' dynamic_linker='NetBSD ld.elf_so' fi shlibpath_var=LD_LIBRARY_PATH @@ -12057,7 +12490,7 @@ netbsd*) newsos6) version_type=linux # correct to gnu/linux during the next big refactor - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes ;; @@ -12066,58 +12499,68 @@ newsos6) version_type=qnx need_lib_prefix=no need_version=no - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' + soname_spec='$libname$release$shared_ext$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes dynamic_linker='ldqnx.so' ;; -openbsd*) +openbsd* | bitrig*) version_type=sunos - sys_lib_dlsearch_path_spec="/usr/lib" + sys_lib_dlsearch_path_spec=/usr/lib need_lib_prefix=no - # Some older versions of OpenBSD (3.3 at least) *do* need versioned libs. - case $host_os in - openbsd3.3 | openbsd3.3.*) need_version=yes ;; - *) need_version=no ;; - esac - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' - finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' - shlibpath_var=LD_LIBRARY_PATH - if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then - case $host_os in - openbsd2.[89] | openbsd2.[89].*) - shlibpath_overrides_runpath=no - ;; - *) - shlibpath_overrides_runpath=yes - ;; - esac + if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`"; then + need_version=no else - shlibpath_overrides_runpath=yes + need_version=yes fi + library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix' + finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes ;; os2*) libname_spec='$name' - shrext_cmds=".dll" + version_type=windows + shrext_cmds=.dll + need_version=no need_lib_prefix=no - library_names_spec='$libname${shared_ext} $libname.a' + # OS/2 can only load a DLL with a base name of 8 characters or less. + soname_spec='`test -n "$os2dllname" && libname="$os2dllname"; + v=$($ECHO $release$versuffix | tr -d .-); + n=$($ECHO $libname | cut -b -$((8 - ${#v})) | tr . _); + $ECHO $n$v`$shared_ext' + library_names_spec='${libname}_dll.$libext' dynamic_linker='OS/2 ld.exe' - shlibpath_var=LIBPATH + shlibpath_var=BEGINLIBPATH + sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" + sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec + postinstall_cmds='base_file=`basename \$file`~ + dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\$base_file'\''i; $ECHO \$dlname'\''`~ + dldir=$destdir/`dirname \$dlpath`~ + test -d \$dldir || mkdir -p \$dldir~ + $install_prog $dir/$dlname \$dldir/$dlname~ + chmod a+x \$dldir/$dlname~ + if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then + eval '\''$striplib \$dldir/$dlname'\'' || exit \$?; + fi' + postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; $ECHO \$dlname'\''`~ + dlpath=$dir/\$dldll~ + $RM \$dlpath' ;; osf3* | osf4* | osf5*) version_type=osf need_lib_prefix=no need_version=no - soname_spec='${libname}${release}${shared_ext}$major' - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='$libname$release$shared_ext$major' + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' shlibpath_var=LD_LIBRARY_PATH sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib" - sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec" + sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec ;; rdos*) @@ -12128,8 +12571,8 @@ solaris*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' + soname_spec='$libname$release$shared_ext$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes @@ -12139,11 +12582,11 @@ solaris*) sunos4*) version_type=sunos - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' + library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix' finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes - if test "$with_gnu_ld" = yes; then + if test yes = "$with_gnu_ld"; then need_lib_prefix=no fi need_version=yes @@ -12151,8 +12594,8 @@ sunos4*) sysv4 | sysv4.3*) version_type=linux # correct to gnu/linux during the next big refactor - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' + soname_spec='$libname$release$shared_ext$major' shlibpath_var=LD_LIBRARY_PATH case $host_vendor in sni) @@ -12173,24 +12616,24 @@ sysv4 | sysv4.3*) ;; sysv4*MP*) - if test -d /usr/nec ;then + if test -d /usr/nec; then version_type=linux # correct to gnu/linux during the next big refactor - library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}' - soname_spec='$libname${shared_ext}.$major' + library_names_spec='$libname$shared_ext.$versuffix $libname$shared_ext.$major $libname$shared_ext' + soname_spec='$libname$shared_ext.$major' shlibpath_var=LD_LIBRARY_PATH fi ;; sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) - version_type=freebsd-elf + version_type=sco need_lib_prefix=no need_version=no - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext $libname$shared_ext' + soname_spec='$libname$release$shared_ext$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes - if test "$with_gnu_ld" = yes; then + if test yes = "$with_gnu_ld"; then sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib' else sys_lib_search_path_spec='/usr/ccs/lib /usr/lib' @@ -12208,7 +12651,7 @@ tpf*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes @@ -12216,8 +12659,8 @@ tpf*) uts4*) version_type=linux # correct to gnu/linux during the next big refactor - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' + soname_spec='$libname$release$shared_ext$major' shlibpath_var=LD_LIBRARY_PATH ;; @@ -12227,20 +12670,35 @@ uts4*) esac { $as_echo "$as_me:${as_lineno-$LINENO}: result: $dynamic_linker" >&5 $as_echo "$dynamic_linker" >&6; } -test "$dynamic_linker" = no && can_build_shared=no +test no = "$dynamic_linker" && can_build_shared=no variables_saved_for_relink="PATH $shlibpath_var $runpath_var" -if test "$GCC" = yes; then +if test yes = "$GCC"; then variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH" fi -if test "${lt_cv_sys_lib_search_path_spec+set}" = set; then - sys_lib_search_path_spec="$lt_cv_sys_lib_search_path_spec" +if test set = "${lt_cv_sys_lib_search_path_spec+set}"; then + sys_lib_search_path_spec=$lt_cv_sys_lib_search_path_spec fi -if test "${lt_cv_sys_lib_dlsearch_path_spec+set}" = set; then - sys_lib_dlsearch_path_spec="$lt_cv_sys_lib_dlsearch_path_spec" + +if test set = "${lt_cv_sys_lib_dlsearch_path_spec+set}"; then + sys_lib_dlsearch_path_spec=$lt_cv_sys_lib_dlsearch_path_spec fi +# remember unaugmented sys_lib_dlsearch_path content for libtool script decls... +configure_time_dlsearch_path=$sys_lib_dlsearch_path_spec + +# ... but it needs LT_SYS_LIBRARY_PATH munging for other configure-time code +func_munge_path_list sys_lib_dlsearch_path_spec "$LT_SYS_LIBRARY_PATH" + +# to be used as default LT_SYS_LIBRARY_PATH value in generated libtool +configure_time_lt_sys_library_path=$LT_SYS_LIBRARY_PATH + + + + + + @@ -12337,15 +12795,15 @@ $as_echo_n "checking how to hardcode library paths into programs... " >&6; } hardcode_action= if test -n "$hardcode_libdir_flag_spec" || test -n "$runpath_var" || - test "X$hardcode_automatic" = "Xyes" ; then + test yes = "$hardcode_automatic"; then # We can hardcode non-existent directories. - if test "$hardcode_direct" != no && + if test no != "$hardcode_direct" && # If the only mechanism to avoid hardcoding is shlibpath_var, we # have to relink, otherwise we might link with an installed library # when we should be linking with a yet-to-be-installed one - ## test "$_LT_TAGVAR(hardcode_shlibpath_var, )" != no && - test "$hardcode_minus_L" != no; then + ## test no != "$_LT_TAGVAR(hardcode_shlibpath_var, )" && + test no != "$hardcode_minus_L"; then # Linking always hardcodes the temporary library directory. hardcode_action=relink else @@ -12360,12 +12818,12 @@ fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $hardcode_action" >&5 $as_echo "$hardcode_action" >&6; } -if test "$hardcode_action" = relink || - test "$inherit_rpath" = yes; then +if test relink = "$hardcode_action" || + test yes = "$inherit_rpath"; then # Fast installation is not supported enable_fast_install=no -elif test "$shlibpath_overrides_runpath" = yes || - test "$enable_shared" = no; then +elif test yes = "$shlibpath_overrides_runpath" || + test no = "$enable_shared"; then # Fast installation is not necessary enable_fast_install=needless fi @@ -12375,7 +12833,7 @@ fi - if test "x$enable_dlopen" != xyes; then + if test yes != "$enable_dlopen"; then enable_dlopen=unknown enable_dlopen_self=unknown enable_dlopen_self_static=unknown @@ -12385,23 +12843,23 @@ else case $host_os in beos*) - lt_cv_dlopen="load_add_on" + lt_cv_dlopen=load_add_on lt_cv_dlopen_libs= lt_cv_dlopen_self=yes ;; mingw* | pw32* | cegcc*) - lt_cv_dlopen="LoadLibrary" + lt_cv_dlopen=LoadLibrary lt_cv_dlopen_libs= ;; cygwin*) - lt_cv_dlopen="dlopen" + lt_cv_dlopen=dlopen lt_cv_dlopen_libs= ;; darwin*) - # if libdl is installed we need to link against it + # if libdl is installed we need to link against it { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -ldl" >&5 $as_echo_n "checking for dlopen in -ldl... " >&6; } if ${ac_cv_lib_dl_dlopen+:} false; then : @@ -12439,10 +12897,10 @@ fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dl_dlopen" >&5 $as_echo "$ac_cv_lib_dl_dlopen" >&6; } if test "x$ac_cv_lib_dl_dlopen" = xyes; then : - lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl" + lt_cv_dlopen=dlopen lt_cv_dlopen_libs=-ldl else - lt_cv_dlopen="dyld" + lt_cv_dlopen=dyld lt_cv_dlopen_libs= lt_cv_dlopen_self=yes @@ -12450,10 +12908,18 @@ fi ;; + tpf*) + # Don't try to run any link tests for TPF. We know it's impossible + # because TPF is a cross-compiler, and we know how we open DSOs. + lt_cv_dlopen=dlopen + lt_cv_dlopen_libs= + lt_cv_dlopen_self=no + ;; + *) ac_fn_c_check_func "$LINENO" "shl_load" "ac_cv_func_shl_load" if test "x$ac_cv_func_shl_load" = xyes; then : - lt_cv_dlopen="shl_load" + lt_cv_dlopen=shl_load else { $as_echo "$as_me:${as_lineno-$LINENO}: checking for shl_load in -ldld" >&5 $as_echo_n "checking for shl_load in -ldld... " >&6; } @@ -12492,11 +12958,11 @@ fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dld_shl_load" >&5 $as_echo "$ac_cv_lib_dld_shl_load" >&6; } if test "x$ac_cv_lib_dld_shl_load" = xyes; then : - lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-ldld" + lt_cv_dlopen=shl_load lt_cv_dlopen_libs=-ldld else ac_fn_c_check_func "$LINENO" "dlopen" "ac_cv_func_dlopen" if test "x$ac_cv_func_dlopen" = xyes; then : - lt_cv_dlopen="dlopen" + lt_cv_dlopen=dlopen else { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -ldl" >&5 $as_echo_n "checking for dlopen in -ldl... " >&6; } @@ -12535,7 +13001,7 @@ fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dl_dlopen" >&5 $as_echo "$ac_cv_lib_dl_dlopen" >&6; } if test "x$ac_cv_lib_dl_dlopen" = xyes; then : - lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl" + lt_cv_dlopen=dlopen lt_cv_dlopen_libs=-ldl else { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -lsvld" >&5 $as_echo_n "checking for dlopen in -lsvld... " >&6; } @@ -12574,7 +13040,7 @@ fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_svld_dlopen" >&5 $as_echo "$ac_cv_lib_svld_dlopen" >&6; } if test "x$ac_cv_lib_svld_dlopen" = xyes; then : - lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld" + lt_cv_dlopen=dlopen lt_cv_dlopen_libs=-lsvld else { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dld_link in -ldld" >&5 $as_echo_n "checking for dld_link in -ldld... " >&6; } @@ -12613,7 +13079,7 @@ fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dld_dld_link" >&5 $as_echo "$ac_cv_lib_dld_dld_link" >&6; } if test "x$ac_cv_lib_dld_dld_link" = xyes; then : - lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-ldld" + lt_cv_dlopen=dld_link lt_cv_dlopen_libs=-ldld fi @@ -12634,21 +13100,21 @@ fi ;; esac - if test "x$lt_cv_dlopen" != xno; then - enable_dlopen=yes - else + if test no = "$lt_cv_dlopen"; then enable_dlopen=no + else + enable_dlopen=yes fi case $lt_cv_dlopen in dlopen) - save_CPPFLAGS="$CPPFLAGS" - test "x$ac_cv_header_dlfcn_h" = xyes && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H" + save_CPPFLAGS=$CPPFLAGS + test yes = "$ac_cv_header_dlfcn_h" && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H" - save_LDFLAGS="$LDFLAGS" + save_LDFLAGS=$LDFLAGS wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\" - save_LIBS="$LIBS" + save_LIBS=$LIBS LIBS="$lt_cv_dlopen_libs $LIBS" { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether a program can dlopen itself" >&5 @@ -12656,7 +13122,7 @@ $as_echo_n "checking whether a program can dlopen itself... " >&6; } if ${lt_cv_dlopen_self+:} false; then : $as_echo_n "(cached) " >&6 else - if test "$cross_compiling" = yes; then : + if test yes = "$cross_compiling"; then : lt_cv_dlopen_self=cross else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 @@ -12703,9 +13169,9 @@ else # endif #endif -/* When -fvisbility=hidden is used, assume the code has been annotated +/* When -fvisibility=hidden is used, assume the code has been annotated correspondingly for the symbols needed. */ -#if defined(__GNUC__) && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3)) +#if defined __GNUC__ && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3)) int fnord () __attribute__((visibility("default"))); #endif @@ -12735,7 +13201,7 @@ _LT_EOF (eval $ac_link) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; } && test -s conftest${ac_exeext} 2>/dev/null; then + test $ac_status = 0; } && test -s "conftest$ac_exeext" 2>/dev/null; then (./conftest; exit; ) >&5 2>/dev/null lt_status=$? case x$lt_status in @@ -12755,14 +13221,14 @@ fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_dlopen_self" >&5 $as_echo "$lt_cv_dlopen_self" >&6; } - if test "x$lt_cv_dlopen_self" = xyes; then + if test yes = "$lt_cv_dlopen_self"; then wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $lt_prog_compiler_static\" { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether a statically linked program can dlopen itself" >&5 $as_echo_n "checking whether a statically linked program can dlopen itself... " >&6; } if ${lt_cv_dlopen_self_static+:} false; then : $as_echo_n "(cached) " >&6 else - if test "$cross_compiling" = yes; then : + if test yes = "$cross_compiling"; then : lt_cv_dlopen_self_static=cross else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 @@ -12809,9 +13275,9 @@ else # endif #endif -/* When -fvisbility=hidden is used, assume the code has been annotated +/* When -fvisibility=hidden is used, assume the code has been annotated correspondingly for the symbols needed. */ -#if defined(__GNUC__) && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3)) +#if defined __GNUC__ && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3)) int fnord () __attribute__((visibility("default"))); #endif @@ -12841,7 +13307,7 @@ _LT_EOF (eval $ac_link) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; } && test -s conftest${ac_exeext} 2>/dev/null; then + test $ac_status = 0; } && test -s "conftest$ac_exeext" 2>/dev/null; then (./conftest; exit; ) >&5 2>/dev/null lt_status=$? case x$lt_status in @@ -12862,9 +13328,9 @@ fi $as_echo "$lt_cv_dlopen_self_static" >&6; } fi - CPPFLAGS="$save_CPPFLAGS" - LDFLAGS="$save_LDFLAGS" - LIBS="$save_LIBS" + CPPFLAGS=$save_CPPFLAGS + LDFLAGS=$save_LDFLAGS + LIBS=$save_LIBS ;; esac @@ -12908,7 +13374,7 @@ else # FIXME - insert some real tests, host_os isn't really good enough case $host_os in darwin*) - if test -n "$STRIP" ; then + if test -n "$STRIP"; then striplib="$STRIP -x" old_striplib="$STRIP -S" { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 @@ -12936,7 +13402,7 @@ fi - # Report which library types will actually be built + # Report what library types will actually be built { $as_echo "$as_me:${as_lineno-$LINENO}: checking if libtool supports shared libraries" >&5 $as_echo_n "checking if libtool supports shared libraries... " >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: result: $can_build_shared" >&5 @@ -12944,13 +13410,13 @@ $as_echo "$can_build_shared" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to build shared libraries" >&5 $as_echo_n "checking whether to build shared libraries... " >&6; } - test "$can_build_shared" = "no" && enable_shared=no + test no = "$can_build_shared" && enable_shared=no # On AIX, shared libraries and static libraries use the same namespace, and # are all built from PIC. case $host_os in aix3*) - test "$enable_shared" = yes && enable_static=no + test yes = "$enable_shared" && enable_static=no if test -n "$RANLIB"; then archive_cmds="$archive_cmds~\$RANLIB \$lib" postinstall_cmds='$RANLIB $lib' @@ -12958,8 +13424,12 @@ $as_echo_n "checking whether to build shared libraries... " >&6; } ;; aix[4-9]*) - if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then - test "$enable_shared" = yes && enable_static=no + if test ia64 != "$host_cpu"; then + case $enable_shared,$with_aix_soname,$aix_use_runtimelinking in + yes,aix,yes) ;; # shared object as lib.so file only + yes,svr4,*) ;; # shared object as lib.so archive member only + yes,*) enable_static=no ;; # shared object in lib.a archive as well + esac fi ;; esac @@ -12969,7 +13439,7 @@ $as_echo "$enable_shared" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to build static libraries" >&5 $as_echo_n "checking whether to build static libraries... " >&6; } # Make sure either enable_shared or enable_static is yes. - test "$enable_shared" = yes || enable_static=yes + test yes = "$enable_shared" || enable_static=yes { $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_static" >&5 $as_echo "$enable_static" >&6; } @@ -12983,11 +13453,11 @@ 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 -CC="$lt_save_CC" +CC=$lt_save_CC - if test -n "$CXX" && ( test "X$CXX" != "Xno" && - ( (test "X$CXX" = "Xg++" && `g++ -v >/dev/null 2>&1` ) || - (test "X$CXX" != "Xg++"))) ; then + if test -n "$CXX" && ( test no != "$CXX" && + ( (test g++ = "$CXX" && `g++ -v >/dev/null 2>&1` ) || + (test g++ != "$CXX"))); then ac_ext=cpp ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' @@ -13166,7 +13636,7 @@ objext_CXX=$objext # the CXX compiler isn't working. Some variables (like enable_shared) # are currently assumed to apply to all compilers on this platform, # and will be corrupted by setting them based on a non-working compiler. -if test "$_lt_caught_CXX_error" != yes; then +if test yes != "$_lt_caught_CXX_error"; then # Code to be used in simple compile tests lt_simple_compile_test_code="int some_variable = 0;" @@ -13227,46 +13697,39 @@ $RM -r conftest* CFLAGS=$CXXFLAGS compiler=$CC compiler_CXX=$CC - for cc_temp in $compiler""; do - case $cc_temp in - compile | *[\\/]compile | ccache | *[\\/]ccache ) ;; - distcc | *[\\/]distcc | purify | *[\\/]purify ) ;; - \-*) ;; - *) break;; - esac -done -cc_basename=`$ECHO "$cc_temp" | $SED "s%.*/%%; s%^$host_alias-%%"` + func_cc_basename $compiler +cc_basename=$func_cc_basename_result if test -n "$compiler"; then # We don't want -fno-exception when compiling C++ code, so set the # no_builtin_flag separately - if test "$GXX" = yes; then + if test yes = "$GXX"; then lt_prog_compiler_no_builtin_flag_CXX=' -fno-builtin' else lt_prog_compiler_no_builtin_flag_CXX= fi - if test "$GXX" = yes; then + if test yes = "$GXX"; then # Set up default GNU C++ configuration # Check whether --with-gnu-ld was given. if test "${with_gnu_ld+set}" = set; then : - withval=$with_gnu_ld; test "$withval" = no || with_gnu_ld=yes + withval=$with_gnu_ld; test no = "$withval" || with_gnu_ld=yes else with_gnu_ld=no fi ac_prog=ld -if test "$GCC" = yes; then +if test yes = "$GCC"; then # Check if gcc -print-prog-name=ld gives a path. { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ld used by $CC" >&5 $as_echo_n "checking for ld used by $CC... " >&6; } case $host in *-*-mingw*) - # gcc leaves a trailing carriage return which upsets mingw + # gcc leaves a trailing carriage return, which upsets mingw ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;; *) ac_prog=`($CC -print-prog-name=ld) 2>&5` ;; @@ -13280,7 +13743,7 @@ $as_echo_n "checking for ld used by $CC... " >&6; } while $ECHO "$ac_prog" | $GREP "$re_direlt" > /dev/null 2>&1; do ac_prog=`$ECHO $ac_prog| $SED "s%$re_direlt%/%"` done - test -z "$LD" && LD="$ac_prog" + test -z "$LD" && LD=$ac_prog ;; "") # If it fails, then pretend we aren't using GCC. @@ -13291,7 +13754,7 @@ $as_echo_n "checking for ld used by $CC... " >&6; } with_gnu_ld=unknown ;; esac -elif test "$with_gnu_ld" = yes; then +elif test yes = "$with_gnu_ld"; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for GNU ld" >&5 $as_echo_n "checking for GNU ld... " >&6; } else @@ -13302,32 +13765,32 @@ if ${lt_cv_path_LD+:} false; then : $as_echo_n "(cached) " >&6 else if test -z "$LD"; then - lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR + lt_save_ifs=$IFS; IFS=$PATH_SEPARATOR for ac_dir in $PATH; do - IFS="$lt_save_ifs" + IFS=$lt_save_ifs test -z "$ac_dir" && ac_dir=. if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then - lt_cv_path_LD="$ac_dir/$ac_prog" + lt_cv_path_LD=$ac_dir/$ac_prog # Check to see if the program is GNU ld. I'd rather use --version, # but apparently some variants of GNU ld only accept -v. # Break only if it was the GNU/non-GNU ld that we prefer. case `"$lt_cv_path_LD" -v 2>&1 &5 $as_echo "$LD" >&6; } @@ -13363,22 +13826,22 @@ with_gnu_ld=$lt_cv_prog_gnu_ld # Check if GNU C++ uses GNU ld as the underlying linker, since the # archiving commands below assume that GNU ld is being used. - if test "$with_gnu_ld" = yes; then - archive_cmds_CXX='$CC $pic_flag -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' - archive_expsym_cmds_CXX='$CC $pic_flag -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + if test yes = "$with_gnu_ld"; then + archive_cmds_CXX='$CC $pic_flag -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname -o $lib' + archive_expsym_cmds_CXX='$CC $pic_flag -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' - hardcode_libdir_flag_spec_CXX='${wl}-rpath ${wl}$libdir' - export_dynamic_flag_spec_CXX='${wl}--export-dynamic' + hardcode_libdir_flag_spec_CXX='$wl-rpath $wl$libdir' + export_dynamic_flag_spec_CXX='$wl--export-dynamic' # If archive_cmds runs LD, not CC, wlarc should be empty # XXX I think wlarc can be eliminated in ltcf-cxx, but I need to # investigate it a little bit more. (MM) - wlarc='${wl}' + wlarc='$wl' # ancient GNU ld didn't support --whole-archive et. al. if eval "`$CC -print-prog-name=ld` --help 2>&1" | $GREP 'no-whole-archive' > /dev/null; then - whole_archive_flag_spec_CXX="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' + whole_archive_flag_spec_CXX=$wlarc'--whole-archive$convenience '$wlarc'--no-whole-archive' else whole_archive_flag_spec_CXX= fi @@ -13415,18 +13878,30 @@ $as_echo_n "checking whether the $compiler linker ($LD) supports shared librarie ld_shlibs_CXX=no ;; aix[4-9]*) - if test "$host_cpu" = ia64; then + if test ia64 = "$host_cpu"; then # On IA64, the linker does run time linking by default, so we don't # have to do anything special. aix_use_runtimelinking=no exp_sym_flag='-Bexport' - no_entry_flag="" + no_entry_flag= else aix_use_runtimelinking=no # Test if we are trying to use run time linking or normal # AIX style linking. If -brtl is somewhere in LDFLAGS, we - # need to do runtime linking. + # have runtime linking enabled, and use it for executables. + # For shared libraries, we enable/disable runtime linking + # depending on the kind of the shared library created - + # when "with_aix_soname,aix_use_runtimelinking" is: + # "aix,no" lib.a(lib.so.V) shared, rtl:no, for executables + # "aix,yes" lib.so shared, rtl:yes, for executables + # lib.a static archive + # "both,no" lib.so.V(shr.o) shared, rtl:yes + # lib.a(lib.so.V) shared, rtl:no, for executables + # "both,yes" lib.so.V(shr.o) shared, rtl:yes, for executables + # lib.a(lib.so.V) shared, rtl:no + # "svr4,*" lib.so.V(shr.o) shared, rtl:yes, for executables + # lib.a static archive case $host_os in aix4.[23]|aix4.[23].*|aix[5-9]*) for ld_flag in $LDFLAGS; do case $ld_flag in @@ -13436,6 +13911,13 @@ $as_echo_n "checking whether the $compiler linker ($LD) supports shared librarie ;; esac done + if test svr4,no = "$with_aix_soname,$aix_use_runtimelinking"; then + # With aix-soname=svr4, we create the lib.so.V shared archives only, + # so we don't have lib.a shared libs to link our executables. + # We have to force runtime linking in this case. + aix_use_runtimelinking=yes + LDFLAGS="$LDFLAGS -Wl,-brtl" + fi ;; esac @@ -13454,13 +13936,21 @@ $as_echo_n "checking whether the $compiler linker ($LD) supports shared librarie hardcode_direct_absolute_CXX=yes hardcode_libdir_separator_CXX=':' link_all_deplibs_CXX=yes - file_list_spec_CXX='${wl}-f,' + file_list_spec_CXX='$wl-f,' + case $with_aix_soname,$aix_use_runtimelinking in + aix,*) ;; # no import file + svr4,* | *,yes) # use import file + # The Import File defines what to hardcode. + hardcode_direct_CXX=no + hardcode_direct_absolute_CXX=no + ;; + esac - if test "$GXX" = yes; then + if test yes = "$GXX"; then case $host_os in aix4.[012]|aix4.[012].*) # We only want to do this on AIX 4.2 and lower, the check # below for broken collect2 doesn't work under 4.3+ - collect2name=`${CC} -print-prog-name=collect2` + collect2name=`$CC -print-prog-name=collect2` if test -f "$collect2name" && strings "$collect2name" | $GREP resolve_lib_name >/dev/null then @@ -13478,36 +13968,44 @@ $as_echo_n "checking whether the $compiler linker ($LD) supports shared librarie fi esac shared_flag='-shared' - if test "$aix_use_runtimelinking" = yes; then - shared_flag="$shared_flag "'${wl}-G' + if test yes = "$aix_use_runtimelinking"; then + shared_flag=$shared_flag' $wl-G' fi + # Need to ensure runtime linking is disabled for the traditional + # shared library, or the linker may eventually find shared libraries + # /with/ Import File - we do not want to mix them. + shared_flag_aix='-shared' + shared_flag_svr4='-shared $wl-G' else # not using gcc - if test "$host_cpu" = ia64; then + if test ia64 = "$host_cpu"; then # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release # chokes on -Wl,-G. The following line is correct: shared_flag='-G' else - if test "$aix_use_runtimelinking" = yes; then - shared_flag='${wl}-G' + if test yes = "$aix_use_runtimelinking"; then + shared_flag='$wl-G' else - shared_flag='${wl}-bM:SRE' + shared_flag='$wl-bM:SRE' fi + shared_flag_aix='$wl-bM:SRE' + shared_flag_svr4='$wl-G' fi fi - export_dynamic_flag_spec_CXX='${wl}-bexpall' + export_dynamic_flag_spec_CXX='$wl-bexpall' # It seems that -bexpall does not export symbols beginning with # underscore (_), so it is better to generate a list of symbols to # export. always_export_symbols_CXX=yes - if test "$aix_use_runtimelinking" = yes; then + if test aix,yes = "$with_aix_soname,$aix_use_runtimelinking"; then # Warning - without using the other runtime loading flags (-brtl), # -berok will link without error, but may produce a broken library. - allow_undefined_flag_CXX='-berok' + # The "-G" linker flag allows undefined symbols. + no_undefined_flag_CXX='-bernotok' # Determine the default libpath from the value encoded in an empty # executable. - if test "${lt_cv_aix_libpath+set}" = set; then + if test set = "${lt_cv_aix_libpath+set}"; then aix_libpath=$lt_cv_aix_libpath else if ${lt_cv_aix_libpath__CXX+:} false; then : @@ -13542,7 +14040,7 @@ fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext if test -z "$lt_cv_aix_libpath__CXX"; then - lt_cv_aix_libpath__CXX="/usr/lib:/lib" + lt_cv_aix_libpath__CXX=/usr/lib:/lib fi fi @@ -13550,18 +14048,18 @@ fi aix_libpath=$lt_cv_aix_libpath__CXX fi - hardcode_libdir_flag_spec_CXX='${wl}-blibpath:$libdir:'"$aix_libpath" + hardcode_libdir_flag_spec_CXX='$wl-blibpath:$libdir:'"$aix_libpath" - archive_expsym_cmds_CXX='$CC -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then func_echo_all "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag" + archive_expsym_cmds_CXX='$CC -o $output_objdir/$soname $libobjs $deplibs $wl'$no_entry_flag' $compiler_flags `if test -n "$allow_undefined_flag"; then func_echo_all "$wl$allow_undefined_flag"; else :; fi` $wl'$exp_sym_flag:\$export_symbols' '$shared_flag else - if test "$host_cpu" = ia64; then - hardcode_libdir_flag_spec_CXX='${wl}-R $libdir:/usr/lib:/lib' + if test ia64 = "$host_cpu"; then + hardcode_libdir_flag_spec_CXX='$wl-R $libdir:/usr/lib:/lib' allow_undefined_flag_CXX="-z nodefs" - archive_expsym_cmds_CXX="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols" + archive_expsym_cmds_CXX="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\$wl$no_entry_flag"' $compiler_flags $wl$allow_undefined_flag '"\$wl$exp_sym_flag:\$export_symbols" else # Determine the default libpath from the value encoded in an # empty executable. - if test "${lt_cv_aix_libpath+set}" = set; then + if test set = "${lt_cv_aix_libpath+set}"; then aix_libpath=$lt_cv_aix_libpath else if ${lt_cv_aix_libpath__CXX+:} false; then : @@ -13596,7 +14094,7 @@ fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext if test -z "$lt_cv_aix_libpath__CXX"; then - lt_cv_aix_libpath__CXX="/usr/lib:/lib" + lt_cv_aix_libpath__CXX=/usr/lib:/lib fi fi @@ -13604,22 +14102,34 @@ fi aix_libpath=$lt_cv_aix_libpath__CXX fi - hardcode_libdir_flag_spec_CXX='${wl}-blibpath:$libdir:'"$aix_libpath" + hardcode_libdir_flag_spec_CXX='$wl-blibpath:$libdir:'"$aix_libpath" # Warning - without using the other run time loading flags, # -berok will link without error, but may produce a broken library. - no_undefined_flag_CXX=' ${wl}-bernotok' - allow_undefined_flag_CXX=' ${wl}-berok' - if test "$with_gnu_ld" = yes; then + no_undefined_flag_CXX=' $wl-bernotok' + allow_undefined_flag_CXX=' $wl-berok' + if test yes = "$with_gnu_ld"; then # We only use this code for GNU lds that support --whole-archive. - whole_archive_flag_spec_CXX='${wl}--whole-archive$convenience ${wl}--no-whole-archive' + whole_archive_flag_spec_CXX='$wl--whole-archive$convenience $wl--no-whole-archive' else # Exported symbols can be pulled into shared objects from archives whole_archive_flag_spec_CXX='$convenience' fi archive_cmds_need_lc_CXX=yes - # This is similar to how AIX traditionally builds its shared - # libraries. - archive_expsym_cmds_CXX="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname' + archive_expsym_cmds_CXX='$RM -r $output_objdir/$realname.d~$MKDIR $output_objdir/$realname.d' + # -brtl affects multiple linker settings, -berok does not and is overridden later + compiler_flags_filtered='`func_echo_all "$compiler_flags " | $SED -e "s%-brtl\\([, ]\\)%-berok\\1%g"`' + if test svr4 != "$with_aix_soname"; then + # This is similar to how AIX traditionally builds its shared + # libraries. Need -bnortl late, we may have -brtl in LDFLAGS. + archive_expsym_cmds_CXX="$archive_expsym_cmds_CXX"'~$CC '$shared_flag_aix' -o $output_objdir/$realname.d/$soname $libobjs $deplibs $wl-bnoentry '$compiler_flags_filtered'$wl-bE:$export_symbols$allow_undefined_flag~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$realname.d/$soname' + fi + if test aix != "$with_aix_soname"; then + archive_expsym_cmds_CXX="$archive_expsym_cmds_CXX"'~$CC '$shared_flag_svr4' -o $output_objdir/$realname.d/$shared_archive_member_spec.o $libobjs $deplibs $wl-bnoentry '$compiler_flags_filtered'$wl-bE:$export_symbols$allow_undefined_flag~$STRIP -e $output_objdir/$realname.d/$shared_archive_member_spec.o~( func_echo_all "#! $soname($shared_archive_member_spec.o)"; if test shr_64 = "$shared_archive_member_spec"; then func_echo_all "# 64"; else func_echo_all "# 32"; fi; cat $export_symbols ) > $output_objdir/$realname.d/$shared_archive_member_spec.imp~$AR $AR_FLAGS $output_objdir/$soname $output_objdir/$realname.d/$shared_archive_member_spec.o $output_objdir/$realname.d/$shared_archive_member_spec.imp' + else + # used by -dlpreopen to get the symbols + archive_expsym_cmds_CXX="$archive_expsym_cmds_CXX"'~$MV $output_objdir/$realname.d/$soname $output_objdir' + fi + archive_expsym_cmds_CXX="$archive_expsym_cmds_CXX"'~$RM -r $output_objdir/$realname.d' fi fi ;; @@ -13629,7 +14139,7 @@ fi allow_undefined_flag_CXX=unsupported # Joseph Beckenbach says some releases of gcc # support --undefined. This deserves some investigation. FIXME - archive_cmds_CXX='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + archive_cmds_CXX='$CC -nostart $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' else ld_shlibs_CXX=no fi @@ -13657,57 +14167,58 @@ fi # Tell ltmain to make .lib files, not .a files. libext=lib # Tell ltmain to make .dll files, not .so files. - shrext_cmds=".dll" + shrext_cmds=.dll # FIXME: Setting linknames here is a bad hack. - archive_cmds_CXX='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-dll~linknames=' - archive_expsym_cmds_CXX='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then - $SED -n -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' -e '1\\\!p' < $export_symbols > $output_objdir/$soname.exp; - else - $SED -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' < $export_symbols > $output_objdir/$soname.exp; - fi~ - $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~ - linknames=' + archive_cmds_CXX='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~linknames=' + archive_expsym_cmds_CXX='if test DEF = "`$SED -n -e '\''s/^[ ]*//'\'' -e '\''/^\(;.*\)*$/d'\'' -e '\''s/^\(EXPORTS\|LIBRARY\)\([ ].*\)*$/DEF/p'\'' -e q $export_symbols`" ; then + cp "$export_symbols" "$output_objdir/$soname.def"; + echo "$tool_output_objdir$soname.def" > "$output_objdir/$soname.exp"; + else + $SED -e '\''s/^/-link -EXPORT:/'\'' < $export_symbols > $output_objdir/$soname.exp; + fi~ + $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~ + linknames=' # The linker will not automatically build a static lib if we build a DLL. # _LT_TAGVAR(old_archive_from_new_cmds, CXX)='true' enable_shared_with_static_runtimes_CXX=yes # Don't use ranlib old_postinstall_cmds_CXX='chmod 644 $oldlib' postlink_cmds_CXX='lt_outputfile="@OUTPUT@"~ - lt_tool_outputfile="@TOOL_OUTPUT@"~ - case $lt_outputfile in - *.exe|*.EXE) ;; - *) - lt_outputfile="$lt_outputfile.exe" - lt_tool_outputfile="$lt_tool_outputfile.exe" - ;; - esac~ - func_to_tool_file "$lt_outputfile"~ - if test "$MANIFEST_TOOL" != ":" && test -f "$lt_outputfile.manifest"; then - $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1; - $RM "$lt_outputfile.manifest"; - fi' + lt_tool_outputfile="@TOOL_OUTPUT@"~ + case $lt_outputfile in + *.exe|*.EXE) ;; + *) + lt_outputfile=$lt_outputfile.exe + lt_tool_outputfile=$lt_tool_outputfile.exe + ;; + esac~ + func_to_tool_file "$lt_outputfile"~ + if test : != "$MANIFEST_TOOL" && test -f "$lt_outputfile.manifest"; then + $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1; + $RM "$lt_outputfile.manifest"; + fi' ;; *) # g++ # _LT_TAGVAR(hardcode_libdir_flag_spec, CXX) is actually meaningless, # as there is no search path for DLLs. hardcode_libdir_flag_spec_CXX='-L$libdir' - export_dynamic_flag_spec_CXX='${wl}--export-all-symbols' + export_dynamic_flag_spec_CXX='$wl--export-all-symbols' allow_undefined_flag_CXX=unsupported always_export_symbols_CXX=no enable_shared_with_static_runtimes_CXX=yes if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then - archive_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' - # If the export-symbols file already is a .def file (1st line - # is EXPORTS), use it as is; otherwise, prepend... - archive_expsym_cmds_CXX='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then - cp $export_symbols $output_objdir/$soname.def; - else - echo EXPORTS > $output_objdir/$soname.def; - cat $export_symbols >> $output_objdir/$soname.def; - fi~ - $CC -shared -nostdlib $output_objdir/$soname.def $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' + archive_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname $wl--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' + # If the export-symbols file already is a .def file, use it as + # is; otherwise, prepend EXPORTS... + archive_expsym_cmds_CXX='if test DEF = "`$SED -n -e '\''s/^[ ]*//'\'' -e '\''/^\(;.*\)*$/d'\'' -e '\''s/^\(EXPORTS\|LIBRARY\)\([ ].*\)*$/DEF/p'\'' -e q $export_symbols`" ; then + cp $export_symbols $output_objdir/$soname.def; + else + echo EXPORTS > $output_objdir/$soname.def; + cat $export_symbols >> $output_objdir/$soname.def; + fi~ + $CC -shared -nostdlib $output_objdir/$soname.def $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname $wl--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' else ld_shlibs_CXX=no fi @@ -13721,27 +14232,27 @@ fi hardcode_direct_CXX=no hardcode_automatic_CXX=yes hardcode_shlibpath_var_CXX=unsupported - if test "$lt_cv_ld_force_load" = "yes"; then - whole_archive_flag_spec_CXX='`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience ${wl}-force_load,$conv\"; done; func_echo_all \"$new_convenience\"`' + if test yes = "$lt_cv_ld_force_load"; then + whole_archive_flag_spec_CXX='`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience $wl-force_load,$conv\"; done; func_echo_all \"$new_convenience\"`' else whole_archive_flag_spec_CXX='' fi link_all_deplibs_CXX=yes - allow_undefined_flag_CXX="$_lt_dar_allow_undefined" + allow_undefined_flag_CXX=$_lt_dar_allow_undefined case $cc_basename in - ifort*) _lt_dar_can_shared=yes ;; + ifort*|nagfor*) _lt_dar_can_shared=yes ;; *) _lt_dar_can_shared=$GCC ;; esac - if test "$_lt_dar_can_shared" = "yes"; then + if test yes = "$_lt_dar_can_shared"; then output_verbose_link_cmd=func_echo_all - archive_cmds_CXX="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod${_lt_dsymutil}" - module_cmds_CXX="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dsymutil}" - archive_expsym_cmds_CXX="sed 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring ${_lt_dar_single_mod}${_lt_dar_export_syms}${_lt_dsymutil}" - module_expsym_cmds_CXX="sed -e 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dar_export_syms}${_lt_dsymutil}" - if test "$lt_cv_apple_cc_single_mod" != "yes"; then - archive_cmds_CXX="\$CC -r -keep_private_externs -nostdlib -o \${lib}-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \${lib}-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring${_lt_dsymutil}" - archive_expsym_cmds_CXX="sed 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -r -keep_private_externs -nostdlib -o \${lib}-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \${lib}-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring${_lt_dar_export_syms}${_lt_dsymutil}" + archive_cmds_CXX="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod$_lt_dsymutil" + module_cmds_CXX="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags$_lt_dsymutil" + archive_expsym_cmds_CXX="sed 's|^|_|' < \$export_symbols > \$output_objdir/\$libname-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod$_lt_dar_export_syms$_lt_dsymutil" + module_expsym_cmds_CXX="sed -e 's|^|_|' < \$export_symbols > \$output_objdir/\$libname-symbols.expsym~\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags$_lt_dar_export_syms$_lt_dsymutil" + if test yes != "$lt_cv_apple_cc_single_mod"; then + archive_cmds_CXX="\$CC -r -keep_private_externs -nostdlib -o \$lib-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$lib-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring$_lt_dsymutil" + archive_expsym_cmds_CXX="sed 's|^|_|' < \$export_symbols > \$output_objdir/\$libname-symbols.expsym~\$CC -r -keep_private_externs -nostdlib -o \$lib-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$lib-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring$_lt_dar_export_syms$_lt_dsymutil" fi else @@ -13750,6 +14261,34 @@ fi ;; + os2*) + hardcode_libdir_flag_spec_CXX='-L$libdir' + hardcode_minus_L_CXX=yes + allow_undefined_flag_CXX=unsupported + shrext_cmds=.dll + archive_cmds_CXX='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~ + $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~ + $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~ + $ECHO EXPORTS >> $output_objdir/$libname.def~ + emxexp $libobjs | $SED /"_DLL_InitTerm"/d >> $output_objdir/$libname.def~ + $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~ + emximp -o $lib $output_objdir/$libname.def' + archive_expsym_cmds_CXX='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~ + $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~ + $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~ + $ECHO EXPORTS >> $output_objdir/$libname.def~ + prefix_cmds="$SED"~ + if test EXPORTS = "`$SED 1q $export_symbols`"; then + prefix_cmds="$prefix_cmds -e 1d"; + fi~ + prefix_cmds="$prefix_cmds -e \"s/^\(.*\)$/_\1/g\""~ + cat $export_symbols | $prefix_cmds >> $output_objdir/$libname.def~ + $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~ + emximp -o $lib $output_objdir/$libname.def' + old_archive_From_new_cmds_CXX='emximp -o $output_objdir/${libname}_dll.a $output_objdir/$libname.def' + enable_shared_with_static_runtimes_CXX=yes + ;; + dgux*) case $cc_basename in ec++*) @@ -13784,18 +14323,15 @@ fi ld_shlibs_CXX=yes ;; - gnu*) - ;; - haiku*) - archive_cmds_CXX='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + archive_cmds_CXX='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' link_all_deplibs_CXX=yes ;; hpux9*) - hardcode_libdir_flag_spec_CXX='${wl}+b ${wl}$libdir' + hardcode_libdir_flag_spec_CXX='$wl+b $wl$libdir' hardcode_libdir_separator_CXX=: - export_dynamic_flag_spec_CXX='${wl}-E' + export_dynamic_flag_spec_CXX='$wl-E' hardcode_direct_CXX=yes hardcode_minus_L_CXX=yes # Not in the search PATH, # but as the default @@ -13807,7 +14343,7 @@ fi ld_shlibs_CXX=no ;; aCC*) - archive_cmds_CXX='$RM $output_objdir/$soname~$CC -b ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' + archive_cmds_CXX='$RM $output_objdir/$soname~$CC -b $wl+b $wl$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test "x$output_objdir/$soname" = "x$lib" || mv $output_objdir/$soname $lib' # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. @@ -13816,11 +14352,11 @@ fi # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. - output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $EGREP "\-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' + output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $EGREP "\-L"`; list= ; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' ;; *) - if test "$GXX" = yes; then - archive_cmds_CXX='$RM $output_objdir/$soname~$CC -shared -nostdlib $pic_flag ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' + if test yes = "$GXX"; then + archive_cmds_CXX='$RM $output_objdir/$soname~$CC -shared -nostdlib $pic_flag $wl+b $wl$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test "x$output_objdir/$soname" = "x$lib" || mv $output_objdir/$soname $lib' else # FIXME: insert proper C++ library support ld_shlibs_CXX=no @@ -13830,15 +14366,15 @@ fi ;; hpux10*|hpux11*) - if test $with_gnu_ld = no; then - hardcode_libdir_flag_spec_CXX='${wl}+b ${wl}$libdir' + if test no = "$with_gnu_ld"; then + hardcode_libdir_flag_spec_CXX='$wl+b $wl$libdir' hardcode_libdir_separator_CXX=: case $host_cpu in hppa*64*|ia64*) ;; *) - export_dynamic_flag_spec_CXX='${wl}-E' + export_dynamic_flag_spec_CXX='$wl-E' ;; esac fi @@ -13864,13 +14400,13 @@ fi aCC*) case $host_cpu in hppa*64*) - archive_cmds_CXX='$CC -b ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' + archive_cmds_CXX='$CC -b $wl+h $wl$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; ia64*) - archive_cmds_CXX='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' + archive_cmds_CXX='$CC -b $wl+h $wl$soname $wl+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; *) - archive_cmds_CXX='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' + archive_cmds_CXX='$CC -b $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; esac # Commands to make compiler produce verbose output that lists @@ -13881,20 +14417,20 @@ fi # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. - output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $GREP "\-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' + output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $GREP "\-L"`; list= ; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' ;; *) - if test "$GXX" = yes; then - if test $with_gnu_ld = no; then + if test yes = "$GXX"; then + if test no = "$with_gnu_ld"; then case $host_cpu in hppa*64*) - archive_cmds_CXX='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' + archive_cmds_CXX='$CC -shared -nostdlib -fPIC $wl+h $wl$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; ia64*) - archive_cmds_CXX='$CC -shared -nostdlib $pic_flag ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' + archive_cmds_CXX='$CC -shared -nostdlib $pic_flag $wl+h $wl$soname $wl+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; *) - archive_cmds_CXX='$CC -shared -nostdlib $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' + archive_cmds_CXX='$CC -shared -nostdlib $pic_flag $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; esac fi @@ -13909,22 +14445,22 @@ fi interix[3-9]*) hardcode_direct_CXX=no hardcode_shlibpath_var_CXX=no - hardcode_libdir_flag_spec_CXX='${wl}-rpath,$libdir' - export_dynamic_flag_spec_CXX='${wl}-E' + hardcode_libdir_flag_spec_CXX='$wl-rpath,$libdir' + export_dynamic_flag_spec_CXX='$wl-E' # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc. # Instead, shared libraries are loaded at an image base (0x10000000 by # default) and relocated if they conflict, which is a slow very memory # consuming and fragmenting process. To avoid this, we pick a random, # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link # time. Moving up from 0x10000000 also allows more sbrk(2) space. - archive_cmds_CXX='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' - archive_expsym_cmds_CXX='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' + archive_cmds_CXX='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-h,$soname $wl--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' + archive_expsym_cmds_CXX='sed "s|^|_|" $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-h,$soname $wl--retain-symbols-file,$output_objdir/$soname.expsym $wl--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' ;; irix5* | irix6*) case $cc_basename in CC*) # SGI C++ - archive_cmds_CXX='$CC -shared -all -multigot $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' + archive_cmds_CXX='$CC -shared -all -multigot $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib' # Archives containing C++ object files must be created using # "CC -ar", where "CC" is the IRIX C++ compiler. This is @@ -13933,22 +14469,22 @@ fi old_archive_cmds_CXX='$CC -ar -WR,-u -o $oldlib $oldobjs' ;; *) - if test "$GXX" = yes; then - if test "$with_gnu_ld" = no; then - archive_cmds_CXX='$CC -shared $pic_flag -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' + if test yes = "$GXX"; then + if test no = "$with_gnu_ld"; then + archive_cmds_CXX='$CC -shared $pic_flag -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib' else - archive_cmds_CXX='$CC -shared $pic_flag -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` -o $lib' + archive_cmds_CXX='$CC -shared $pic_flag -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` -o $lib' fi fi link_all_deplibs_CXX=yes ;; esac - hardcode_libdir_flag_spec_CXX='${wl}-rpath ${wl}$libdir' + hardcode_libdir_flag_spec_CXX='$wl-rpath $wl$libdir' hardcode_libdir_separator_CXX=: inherit_rpath_CXX=yes ;; - linux* | k*bsd*-gnu | kopensolaris*-gnu) + linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) case $cc_basename in KCC*) # Kuck and Associates, Inc. (KAI) C++ Compiler @@ -13956,8 +14492,8 @@ fi # KCC will only create a shared library if the output file # ends with ".so" (or ".sl" for HP-UX), so rename the library # to its proper name (with version) after linking. - archive_cmds_CXX='tempext=`echo $shared_ext | $SED -e '\''s/\([^()0-9A-Za-z{}]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib' - archive_expsym_cmds_CXX='tempext=`echo $shared_ext | $SED -e '\''s/\([^()0-9A-Za-z{}]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib ${wl}-retain-symbols-file,$export_symbols; mv \$templib $lib' + archive_cmds_CXX='tempext=`echo $shared_ext | $SED -e '\''s/\([^()0-9A-Za-z{}]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\$tempext\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib' + archive_expsym_cmds_CXX='tempext=`echo $shared_ext | $SED -e '\''s/\([^()0-9A-Za-z{}]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\$tempext\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib $wl-retain-symbols-file,$export_symbols; mv \$templib $lib' # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. @@ -13966,10 +14502,10 @@ fi # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. - output_verbose_link_cmd='templist=`$CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 | $GREP "ld"`; rm -f libconftest$shared_ext; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' + output_verbose_link_cmd='templist=`$CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 | $GREP "ld"`; rm -f libconftest$shared_ext; list= ; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' - hardcode_libdir_flag_spec_CXX='${wl}-rpath,$libdir' - export_dynamic_flag_spec_CXX='${wl}--export-dynamic' + hardcode_libdir_flag_spec_CXX='$wl-rpath,$libdir' + export_dynamic_flag_spec_CXX='$wl--export-dynamic' # Archives containing C++ object files must be created using # "CC -Bstatic", where "CC" is the KAI C++ compiler. @@ -13983,59 +14519,59 @@ fi # earlier do not add the objects themselves. case `$CC -V 2>&1` in *"Version 7."*) - archive_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' - archive_expsym_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + archive_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname -o $lib' + archive_expsym_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' ;; *) # Version 8.0 or newer tmp_idyn= case $host_cpu in ia64*) tmp_idyn=' -i_dynamic';; esac - archive_cmds_CXX='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' - archive_expsym_cmds_CXX='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + archive_cmds_CXX='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' + archive_expsym_cmds_CXX='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' ;; esac archive_cmds_need_lc_CXX=no - hardcode_libdir_flag_spec_CXX='${wl}-rpath,$libdir' - export_dynamic_flag_spec_CXX='${wl}--export-dynamic' - whole_archive_flag_spec_CXX='${wl}--whole-archive$convenience ${wl}--no-whole-archive' + hardcode_libdir_flag_spec_CXX='$wl-rpath,$libdir' + export_dynamic_flag_spec_CXX='$wl--export-dynamic' + whole_archive_flag_spec_CXX='$wl--whole-archive$convenience $wl--no-whole-archive' ;; pgCC* | pgcpp*) # Portland Group C++ compiler case `$CC -V` in *pgCC\ [1-5].* | *pgcpp\ [1-5].*) prelink_cmds_CXX='tpldir=Template.dir~ - rm -rf $tpldir~ - $CC --prelink_objects --instantiation_dir $tpldir $objs $libobjs $compile_deplibs~ - compile_command="$compile_command `find $tpldir -name \*.o | sort | $NL2SP`"' + rm -rf $tpldir~ + $CC --prelink_objects --instantiation_dir $tpldir $objs $libobjs $compile_deplibs~ + compile_command="$compile_command `find $tpldir -name \*.o | sort | $NL2SP`"' old_archive_cmds_CXX='tpldir=Template.dir~ - rm -rf $tpldir~ - $CC --prelink_objects --instantiation_dir $tpldir $oldobjs$old_deplibs~ - $AR $AR_FLAGS $oldlib$oldobjs$old_deplibs `find $tpldir -name \*.o | sort | $NL2SP`~ - $RANLIB $oldlib' + rm -rf $tpldir~ + $CC --prelink_objects --instantiation_dir $tpldir $oldobjs$old_deplibs~ + $AR $AR_FLAGS $oldlib$oldobjs$old_deplibs `find $tpldir -name \*.o | sort | $NL2SP`~ + $RANLIB $oldlib' archive_cmds_CXX='tpldir=Template.dir~ - rm -rf $tpldir~ - $CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~ - $CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | sort | $NL2SP` $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib' + rm -rf $tpldir~ + $CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~ + $CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | sort | $NL2SP` $postdep_objects $compiler_flags $wl-soname $wl$soname -o $lib' archive_expsym_cmds_CXX='tpldir=Template.dir~ - rm -rf $tpldir~ - $CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~ - $CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | sort | $NL2SP` $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname ${wl}-retain-symbols-file ${wl}$export_symbols -o $lib' + rm -rf $tpldir~ + $CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~ + $CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | sort | $NL2SP` $postdep_objects $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' ;; *) # Version 6 and above use weak symbols - archive_cmds_CXX='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib' - archive_expsym_cmds_CXX='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname ${wl}-retain-symbols-file ${wl}$export_symbols -o $lib' + archive_cmds_CXX='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname -o $lib' + archive_expsym_cmds_CXX='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' ;; esac - hardcode_libdir_flag_spec_CXX='${wl}--rpath ${wl}$libdir' - export_dynamic_flag_spec_CXX='${wl}--export-dynamic' - whole_archive_flag_spec_CXX='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' + hardcode_libdir_flag_spec_CXX='$wl--rpath $wl$libdir' + export_dynamic_flag_spec_CXX='$wl--export-dynamic' + whole_archive_flag_spec_CXX='$wl--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive' ;; cxx*) # Compaq C++ - archive_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' - archive_expsym_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib ${wl}-retain-symbols-file $wl$export_symbols' + archive_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname -o $lib' + archive_expsym_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname -o $lib $wl-retain-symbols-file $wl$export_symbols' runpath_var=LD_RUN_PATH hardcode_libdir_flag_spec_CXX='-rpath $libdir' @@ -14049,18 +14585,18 @@ fi # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. - output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "ld"`; templist=`func_echo_all "$templist" | $SED "s/\(^.*ld.*\)\( .*ld .*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "X$list" | $Xsed' + output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "ld"`; templist=`func_echo_all "$templist" | $SED "s/\(^.*ld.*\)\( .*ld .*$\)/\1/"`; list= ; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "X$list" | $Xsed' ;; xl* | mpixl* | bgxl*) # IBM XL 8.0 on PPC, with GNU ld - hardcode_libdir_flag_spec_CXX='${wl}-rpath ${wl}$libdir' - export_dynamic_flag_spec_CXX='${wl}--export-dynamic' - archive_cmds_CXX='$CC -qmkshrobj $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' - if test "x$supports_anon_versioning" = xyes; then + hardcode_libdir_flag_spec_CXX='$wl-rpath $wl$libdir' + export_dynamic_flag_spec_CXX='$wl--export-dynamic' + archive_cmds_CXX='$CC -qmkshrobj $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' + if test yes = "$supports_anon_versioning"; then archive_expsym_cmds_CXX='echo "{ global:" > $output_objdir/$libname.ver~ - cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ - echo "local: *; };" >> $output_objdir/$libname.ver~ - $CC -qmkshrobj $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib' + cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ + echo "local: *; };" >> $output_objdir/$libname.ver~ + $CC -qmkshrobj $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-version-script $wl$output_objdir/$libname.ver -o $lib' fi ;; *) @@ -14068,10 +14604,10 @@ fi *Sun\ C*) # Sun C++ 5.9 no_undefined_flag_CXX=' -zdefs' - archive_cmds_CXX='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' - archive_expsym_cmds_CXX='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-retain-symbols-file ${wl}$export_symbols' + archive_cmds_CXX='$CC -G$allow_undefined_flag -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' + archive_expsym_cmds_CXX='$CC -G$allow_undefined_flag -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-retain-symbols-file $wl$export_symbols' hardcode_libdir_flag_spec_CXX='-R$libdir' - whole_archive_flag_spec_CXX='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' + whole_archive_flag_spec_CXX='$wl--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive' compiler_needs_object_CXX=yes # Not sure whether something based on @@ -14129,22 +14665,17 @@ fi ld_shlibs_CXX=yes ;; - openbsd2*) - # C++ shared libraries are fairly broken - ld_shlibs_CXX=no - ;; - - openbsd*) + openbsd* | bitrig*) if test -f /usr/libexec/ld.so; then hardcode_direct_CXX=yes hardcode_shlibpath_var_CXX=no hardcode_direct_absolute_CXX=yes archive_cmds_CXX='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib' - hardcode_libdir_flag_spec_CXX='${wl}-rpath,$libdir' - if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then - archive_expsym_cmds_CXX='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-retain-symbols-file,$export_symbols -o $lib' - export_dynamic_flag_spec_CXX='${wl}-E' - whole_archive_flag_spec_CXX="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' + hardcode_libdir_flag_spec_CXX='$wl-rpath,$libdir' + if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`"; then + archive_expsym_cmds_CXX='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-retain-symbols-file,$export_symbols -o $lib' + export_dynamic_flag_spec_CXX='$wl-E' + whole_archive_flag_spec_CXX=$wlarc'--whole-archive$convenience '$wlarc'--no-whole-archive' fi output_verbose_link_cmd=func_echo_all else @@ -14160,9 +14691,9 @@ fi # KCC will only create a shared library if the output file # ends with ".so" (or ".sl" for HP-UX), so rename the library # to its proper name (with version) after linking. - archive_cmds_CXX='tempext=`echo $shared_ext | $SED -e '\''s/\([^()0-9A-Za-z{}]\)/\\\\\1/g'\''`; templib=`echo "$lib" | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib' + archive_cmds_CXX='tempext=`echo $shared_ext | $SED -e '\''s/\([^()0-9A-Za-z{}]\)/\\\\\1/g'\''`; templib=`echo "$lib" | $SED -e "s/\$tempext\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib' - hardcode_libdir_flag_spec_CXX='${wl}-rpath,$libdir' + hardcode_libdir_flag_spec_CXX='$wl-rpath,$libdir' hardcode_libdir_separator_CXX=: # Archives containing C++ object files must be created using @@ -14180,17 +14711,17 @@ fi cxx*) case $host in osf3*) - allow_undefined_flag_CXX=' ${wl}-expect_unresolved ${wl}\*' - archive_cmds_CXX='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $soname `test -n "$verstring" && func_echo_all "${wl}-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' - hardcode_libdir_flag_spec_CXX='${wl}-rpath ${wl}$libdir' + allow_undefined_flag_CXX=' $wl-expect_unresolved $wl\*' + archive_cmds_CXX='$CC -shared$allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $soname `test -n "$verstring" && func_echo_all "$wl-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib' + hardcode_libdir_flag_spec_CXX='$wl-rpath $wl$libdir' ;; *) allow_undefined_flag_CXX=' -expect_unresolved \*' - archive_cmds_CXX='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' + archive_cmds_CXX='$CC -shared$allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib' archive_expsym_cmds_CXX='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done~ - echo "-hidden">> $lib.exp~ - $CC -shared$allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname ${wl}-input ${wl}$lib.exp `test -n "$verstring" && $ECHO "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib~ - $RM $lib.exp' + echo "-hidden">> $lib.exp~ + $CC -shared$allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname $wl-input $wl$lib.exp `test -n "$verstring" && $ECHO "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib~ + $RM $lib.exp' hardcode_libdir_flag_spec_CXX='-rpath $libdir' ;; esac @@ -14205,21 +14736,21 @@ fi # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. - output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "ld" | $GREP -v "ld:"`; templist=`func_echo_all "$templist" | $SED "s/\(^.*ld.*\)\( .*ld.*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' + output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "ld" | $GREP -v "ld:"`; templist=`func_echo_all "$templist" | $SED "s/\(^.*ld.*\)\( .*ld.*$\)/\1/"`; list= ; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' ;; *) - if test "$GXX" = yes && test "$with_gnu_ld" = no; then - allow_undefined_flag_CXX=' ${wl}-expect_unresolved ${wl}\*' + if test yes,no = "$GXX,$with_gnu_ld"; then + allow_undefined_flag_CXX=' $wl-expect_unresolved $wl\*' case $host in osf3*) - archive_cmds_CXX='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' + archive_cmds_CXX='$CC -shared -nostdlib $allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib' ;; *) - archive_cmds_CXX='$CC -shared $pic_flag -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' + archive_cmds_CXX='$CC -shared $pic_flag -nostdlib $allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-msym $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib' ;; esac - hardcode_libdir_flag_spec_CXX='${wl}-rpath ${wl}$libdir' + hardcode_libdir_flag_spec_CXX='$wl-rpath $wl$libdir' hardcode_libdir_separator_CXX=: # Commands to make compiler produce verbose output that lists @@ -14265,9 +14796,9 @@ fi # Sun C++ 4.2, 5.x and Centerline C++ archive_cmds_need_lc_CXX=yes no_undefined_flag_CXX=' -zdefs' - archive_cmds_CXX='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' + archive_cmds_CXX='$CC -G$allow_undefined_flag -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' archive_expsym_cmds_CXX='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ - $CC -G${allow_undefined_flag} ${wl}-M ${wl}$lib.exp -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp' + $CC -G$allow_undefined_flag $wl-M $wl$lib.exp -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp' hardcode_libdir_flag_spec_CXX='-R$libdir' hardcode_shlibpath_var_CXX=no @@ -14275,7 +14806,7 @@ fi solaris2.[0-5] | solaris2.[0-5].*) ;; *) # The compiler driver will combine and reorder linker options, - # but understands `-z linker_flag'. + # but understands '-z linker_flag'. # Supported since Solaris 2.6 (maybe 2.5.1?) whole_archive_flag_spec_CXX='-z allextract$convenience -z defaultextract' ;; @@ -14292,30 +14823,30 @@ fi ;; gcx*) # Green Hills C++ Compiler - archive_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' + archive_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-h $wl$soname -o $lib' # The C++ compiler must be used to create the archive. old_archive_cmds_CXX='$CC $LDFLAGS -archive -o $oldlib $oldobjs' ;; *) # GNU C++ compiler with Solaris linker - if test "$GXX" = yes && test "$with_gnu_ld" = no; then - no_undefined_flag_CXX=' ${wl}-z ${wl}defs' + if test yes,no = "$GXX,$with_gnu_ld"; then + no_undefined_flag_CXX=' $wl-z ${wl}defs' if $CC --version | $GREP -v '^2\.7' > /dev/null; then - archive_cmds_CXX='$CC -shared $pic_flag -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' + archive_cmds_CXX='$CC -shared $pic_flag -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-h $wl$soname -o $lib' archive_expsym_cmds_CXX='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ - $CC -shared $pic_flag -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp' + $CC -shared $pic_flag -nostdlib $wl-M $wl$lib.exp $wl-h $wl$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp' # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"' else - # g++ 2.7 appears to require `-G' NOT `-shared' on this + # g++ 2.7 appears to require '-G' NOT '-shared' on this # platform. - archive_cmds_CXX='$CC -G -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' + archive_cmds_CXX='$CC -G -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-h $wl$soname -o $lib' archive_expsym_cmds_CXX='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ - $CC -G -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp' + $CC -G -nostdlib $wl-M $wl$lib.exp $wl-h $wl$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp' # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when @@ -14323,11 +14854,11 @@ fi output_verbose_link_cmd='$CC -G $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"' fi - hardcode_libdir_flag_spec_CXX='${wl}-R $wl$libdir' + hardcode_libdir_flag_spec_CXX='$wl-R $wl$libdir' case $host_os in solaris2.[0-5] | solaris2.[0-5].*) ;; *) - whole_archive_flag_spec_CXX='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract' + whole_archive_flag_spec_CXX='$wl-z ${wl}allextract$convenience $wl-z ${wl}defaultextract' ;; esac fi @@ -14336,52 +14867,52 @@ fi ;; sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[01].[10]* | unixware7* | sco3.2v5.0.[024]*) - no_undefined_flag_CXX='${wl}-z,text' + no_undefined_flag_CXX='$wl-z,text' archive_cmds_need_lc_CXX=no hardcode_shlibpath_var_CXX=no runpath_var='LD_RUN_PATH' case $cc_basename in CC*) - archive_cmds_CXX='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' - archive_expsym_cmds_CXX='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + archive_cmds_CXX='$CC -G $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + archive_expsym_cmds_CXX='$CC -G $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' ;; *) - archive_cmds_CXX='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' - archive_expsym_cmds_CXX='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + archive_cmds_CXX='$CC -shared $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + archive_expsym_cmds_CXX='$CC -shared $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' ;; esac ;; sysv5* | sco3.2v5* | sco5v6*) - # Note: We can NOT use -z defs as we might desire, because we do not + # Note: We CANNOT use -z defs as we might desire, because we do not # link with -lc, and that would cause any symbols used from libc to # always be unresolved, which means just about no library would # ever link correctly. If we're not using GNU ld we use -z text # though, which does catch some bad symbols but isn't as heavy-handed # as -z defs. - no_undefined_flag_CXX='${wl}-z,text' - allow_undefined_flag_CXX='${wl}-z,nodefs' + no_undefined_flag_CXX='$wl-z,text' + allow_undefined_flag_CXX='$wl-z,nodefs' archive_cmds_need_lc_CXX=no hardcode_shlibpath_var_CXX=no - hardcode_libdir_flag_spec_CXX='${wl}-R,$libdir' + hardcode_libdir_flag_spec_CXX='$wl-R,$libdir' hardcode_libdir_separator_CXX=':' link_all_deplibs_CXX=yes - export_dynamic_flag_spec_CXX='${wl}-Bexport' + export_dynamic_flag_spec_CXX='$wl-Bexport' runpath_var='LD_RUN_PATH' case $cc_basename in CC*) - archive_cmds_CXX='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' - archive_expsym_cmds_CXX='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + archive_cmds_CXX='$CC -G $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + archive_expsym_cmds_CXX='$CC -G $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' old_archive_cmds_CXX='$CC -Tprelink_objects $oldobjs~ - '"$old_archive_cmds_CXX" + '"$old_archive_cmds_CXX" reload_cmds_CXX='$CC -Tprelink_objects $reload_objs~ - '"$reload_cmds_CXX" + '"$reload_cmds_CXX" ;; *) - archive_cmds_CXX='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' - archive_expsym_cmds_CXX='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + archive_cmds_CXX='$CC -shared $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + archive_expsym_cmds_CXX='$CC -shared $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' ;; esac ;; @@ -14413,10 +14944,10 @@ fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ld_shlibs_CXX" >&5 $as_echo "$ld_shlibs_CXX" >&6; } - test "$ld_shlibs_CXX" = no && can_build_shared=no + test no = "$ld_shlibs_CXX" && can_build_shared=no - GCC_CXX="$GXX" - LD_CXX="$LD" + GCC_CXX=$GXX + LD_CXX=$LD ## CAVEAT EMPTOR: ## There is no encapsulation within the following macros, do not change @@ -14460,13 +14991,13 @@ if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 pre_test_object_deps_done=no for p in `eval "$output_verbose_link_cmd"`; do - case ${prev}${p} in + case $prev$p in -L* | -R* | -l*) # Some compilers place space between "-{L,R}" and the path. # Remove the space. - if test $p = "-L" || - test $p = "-R"; then + if test x-L = "$p" || + test x-R = "$p"; then prev=$p continue fi @@ -14482,16 +15013,16 @@ if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 case $p in =*) func_stripname_cnf '=' '' "$p"; p=$lt_sysroot$func_stripname_result ;; esac - if test "$pre_test_object_deps_done" = no; then - case ${prev} in + if test no = "$pre_test_object_deps_done"; then + case $prev in -L | -R) # Internal compiler library paths should come after those # provided the user. The postdeps already come after the # user supplied libs so there is no need to process them. if test -z "$compiler_lib_search_path_CXX"; then - compiler_lib_search_path_CXX="${prev}${p}" + compiler_lib_search_path_CXX=$prev$p else - compiler_lib_search_path_CXX="${compiler_lib_search_path_CXX} ${prev}${p}" + compiler_lib_search_path_CXX="${compiler_lib_search_path_CXX} $prev$p" fi ;; # The "-l" case would never come before the object being @@ -14499,9 +15030,9 @@ if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 esac else if test -z "$postdeps_CXX"; then - postdeps_CXX="${prev}${p}" + postdeps_CXX=$prev$p else - postdeps_CXX="${postdeps_CXX} ${prev}${p}" + postdeps_CXX="${postdeps_CXX} $prev$p" fi fi prev= @@ -14516,15 +15047,15 @@ if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 continue fi - if test "$pre_test_object_deps_done" = no; then + if test no = "$pre_test_object_deps_done"; then if test -z "$predep_objects_CXX"; then - predep_objects_CXX="$p" + predep_objects_CXX=$p else predep_objects_CXX="$predep_objects_CXX $p" fi else if test -z "$postdep_objects_CXX"; then - postdep_objects_CXX="$p" + postdep_objects_CXX=$p else postdep_objects_CXX="$postdep_objects_CXX $p" fi @@ -14554,51 +15085,6 @@ interix[3-9]*) postdep_objects_CXX= postdeps_CXX= ;; - -linux*) - case `$CC -V 2>&1 | sed 5q` in - *Sun\ C*) - # Sun C++ 5.9 - - # The more standards-conforming stlport4 library is - # incompatible with the Cstd library. Avoid specifying - # it if it's in CXXFLAGS. Ignore libCrun as - # -library=stlport4 depends on it. - case " $CXX $CXXFLAGS " in - *" -library=stlport4 "*) - solaris_use_stlport4=yes - ;; - esac - - if test "$solaris_use_stlport4" != yes; then - postdeps_CXX='-library=Cstd -library=Crun' - fi - ;; - esac - ;; - -solaris*) - case $cc_basename in - CC* | sunCC*) - # The more standards-conforming stlport4 library is - # incompatible with the Cstd library. Avoid specifying - # it if it's in CXXFLAGS. Ignore libCrun as - # -library=stlport4 depends on it. - case " $CXX $CXXFLAGS " in - *" -library=stlport4 "*) - solaris_use_stlport4=yes - ;; - esac - - # Adding this requires a known-good setup of shared libraries for - # Sun compiler versions before 5.6, else PIC objects from an old - # archive will be linked into the output, leading to subtle bugs. - if test "$solaris_use_stlport4" != yes; then - postdeps_CXX='-library=Cstd -library=Crun' - fi - ;; - esac - ;; esac @@ -14607,7 +15093,7 @@ case " $postdeps_CXX " in esac compiler_lib_search_dirs_CXX= if test -n "${compiler_lib_search_path_CXX}"; then - compiler_lib_search_dirs_CXX=`echo " ${compiler_lib_search_path_CXX}" | ${SED} -e 's! -L! !g' -e 's!^ !!'` + compiler_lib_search_dirs_CXX=`echo " ${compiler_lib_search_path_CXX}" | $SED -e 's! -L! !g' -e 's!^ !!'` fi @@ -14646,17 +15132,18 @@ lt_prog_compiler_static_CXX= # C++ specific cases for pic, static, wl, etc. - if test "$GXX" = yes; then + if test yes = "$GXX"; then lt_prog_compiler_wl_CXX='-Wl,' lt_prog_compiler_static_CXX='-static' case $host_os in aix*) # All AIX code is PIC. - if test "$host_cpu" = ia64; then + if test ia64 = "$host_cpu"; then # AIX 5 now supports IA64 processor lt_prog_compiler_static_CXX='-Bstatic' fi + lt_prog_compiler_pic_CXX='-fPIC' ;; amigaos*) @@ -14667,8 +15154,8 @@ lt_prog_compiler_static_CXX= ;; m68k) # FIXME: we need at least 68020 code to build shared libraries, but - # adding the `-m68020' flag to GCC prevents building anything better, - # like `-m68040'. + # adding the '-m68020' flag to GCC prevents building anything better, + # like '-m68040'. lt_prog_compiler_pic_CXX='-m68020 -resident32 -malways-restore-a4' ;; esac @@ -14683,6 +15170,11 @@ lt_prog_compiler_static_CXX= # Although the cygwin gcc ignores -fPIC, still need this for old-style # (--disable-auto-import) libraries lt_prog_compiler_pic_CXX='-DDLL_EXPORT' + case $host_os in + os2*) + lt_prog_compiler_static_CXX='$wl-static' + ;; + esac ;; darwin* | rhapsody*) # PIC is the default on this platform @@ -14732,7 +15224,7 @@ lt_prog_compiler_static_CXX= case $host_os in aix[4-9]*) # All AIX code is PIC. - if test "$host_cpu" = ia64; then + if test ia64 = "$host_cpu"; then # AIX 5 now supports IA64 processor lt_prog_compiler_static_CXX='-Bstatic' else @@ -14772,14 +15264,14 @@ lt_prog_compiler_static_CXX= case $cc_basename in CC*) lt_prog_compiler_wl_CXX='-Wl,' - lt_prog_compiler_static_CXX='${wl}-a ${wl}archive' - if test "$host_cpu" != ia64; then + lt_prog_compiler_static_CXX='$wl-a ${wl}archive' + if test ia64 != "$host_cpu"; then lt_prog_compiler_pic_CXX='+Z' fi ;; aCC*) lt_prog_compiler_wl_CXX='-Wl,' - lt_prog_compiler_static_CXX='${wl}-a ${wl}archive' + lt_prog_compiler_static_CXX='$wl-a ${wl}archive' case $host_cpu in hppa*64*|ia64*) # +Z the default @@ -14808,7 +15300,7 @@ lt_prog_compiler_static_CXX= ;; esac ;; - linux* | k*bsd*-gnu | kopensolaris*-gnu) + linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) case $cc_basename in KCC*) # KAI C++ Compiler @@ -14816,7 +15308,7 @@ lt_prog_compiler_static_CXX= lt_prog_compiler_pic_CXX='-fPIC' ;; ecpc* ) - # old Intel C++ for x86_64 which still supported -KPIC. + # old Intel C++ for x86_64, which still supported -KPIC. lt_prog_compiler_wl_CXX='-Wl,' lt_prog_compiler_pic_CXX='-KPIC' lt_prog_compiler_static_CXX='-static' @@ -14961,7 +15453,7 @@ lt_prog_compiler_static_CXX= fi case $host_os in - # For platforms which do not support PIC, -DPIC is meaningless: + # For platforms that do not support PIC, -DPIC is meaningless: *djgpp*) lt_prog_compiler_pic_CXX= ;; @@ -14993,7 +15485,7 @@ else lt_cv_prog_compiler_pic_works_CXX=no ac_outfile=conftest.$ac_objext echo "$lt_simple_compile_test_code" > conftest.$ac_ext - lt_compiler_flag="$lt_prog_compiler_pic_CXX -DPIC" + lt_compiler_flag="$lt_prog_compiler_pic_CXX -DPIC" ## exclude from sc_useless_quotes_in_assignment # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins @@ -15023,7 +15515,7 @@ fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_pic_works_CXX" >&5 $as_echo "$lt_cv_prog_compiler_pic_works_CXX" >&6; } -if test x"$lt_cv_prog_compiler_pic_works_CXX" = xyes; then +if test yes = "$lt_cv_prog_compiler_pic_works_CXX"; then case $lt_prog_compiler_pic_CXX in "" | " "*) ;; *) lt_prog_compiler_pic_CXX=" $lt_prog_compiler_pic_CXX" ;; @@ -15049,7 +15541,7 @@ if ${lt_cv_prog_compiler_static_works_CXX+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_prog_compiler_static_works_CXX=no - save_LDFLAGS="$LDFLAGS" + save_LDFLAGS=$LDFLAGS LDFLAGS="$LDFLAGS $lt_tmp_static_flag" echo "$lt_simple_link_test_code" > conftest.$ac_ext if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then @@ -15068,13 +15560,13 @@ else fi fi $RM -r conftest* - LDFLAGS="$save_LDFLAGS" + LDFLAGS=$save_LDFLAGS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_static_works_CXX" >&5 $as_echo "$lt_cv_prog_compiler_static_works_CXX" >&6; } -if test x"$lt_cv_prog_compiler_static_works_CXX" = xyes; then +if test yes = "$lt_cv_prog_compiler_static_works_CXX"; then : else lt_prog_compiler_static_CXX= @@ -15188,8 +15680,8 @@ $as_echo "$lt_cv_prog_compiler_c_o_CXX" >&6; } -hard_links="nottested" -if test "$lt_cv_prog_compiler_c_o_CXX" = no && test "$need_locks" != no; then +hard_links=nottested +if test no = "$lt_cv_prog_compiler_c_o_CXX" && test no != "$need_locks"; then # do not overwrite the value of need_locks provided by the user { $as_echo "$as_me:${as_lineno-$LINENO}: checking if we can lock with hard links" >&5 $as_echo_n "checking if we can lock with hard links... " >&6; } @@ -15201,9 +15693,9 @@ $as_echo_n "checking if we can lock with hard links... " >&6; } ln conftest.a conftest.b 2>/dev/null && hard_links=no { $as_echo "$as_me:${as_lineno-$LINENO}: result: $hard_links" >&5 $as_echo "$hard_links" >&6; } - if test "$hard_links" = no; then - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&5 -$as_echo "$as_me: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&2;} + if test no = "$hard_links"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: '$CC' does not support '-c -o', so 'make -j' may be unsafe" >&5 +$as_echo "$as_me: WARNING: '$CC' does not support '-c -o', so 'make -j' may be unsafe" >&2;} need_locks=warn fi else @@ -15220,17 +15712,21 @@ $as_echo_n "checking whether the $compiler linker ($LD) supports shared librarie case $host_os in aix[4-9]*) # If we're using GNU nm, then we don't want the "-C" option. - # -C means demangle to AIX nm, but means don't demangle with GNU nm - # Also, AIX nm treats weak defined symbols like other global defined - # symbols, whereas GNU nm marks them as "W". + # -C means demangle to GNU nm, but means don't demangle to AIX nm. + # Without the "-l" option, or with the "-B" option, AIX nm treats + # weak defined symbols like other global defined symbols, whereas + # GNU nm marks them as "W". + # While the 'weak' keyword is ignored in the Export File, we need + # it in the Import File for the 'aix-soname' feature, so we have + # to replace the "-B" option with "-P" for AIX nm. if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then - export_symbols_cmds_CXX='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && (substr(\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' + export_symbols_cmds_CXX='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && (substr(\$ 3,1,1) != ".")) { if (\$ 2 == "W") { print \$ 3 " weak" } else { print \$ 3 } } }'\'' | sort -u > $export_symbols' else - export_symbols_cmds_CXX='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && (substr(\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' + export_symbols_cmds_CXX='`func_echo_all $NM | $SED -e '\''s/B\([^B]*\)$/P\1/'\''` -PCpgl $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) && (substr(\$ 1,1,1) != ".")) { if ((\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) { print \$ 1 " weak" } else { print \$ 1 } } }'\'' | sort -u > $export_symbols' fi ;; pw32*) - export_symbols_cmds_CXX="$ltdll_cmds" + export_symbols_cmds_CXX=$ltdll_cmds ;; cygwin* | mingw* | cegcc*) case $cc_basename in @@ -15250,7 +15746,7 @@ $as_echo_n "checking whether the $compiler linker ($LD) supports shared librarie { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ld_shlibs_CXX" >&5 $as_echo "$ld_shlibs_CXX" >&6; } -test "$ld_shlibs_CXX" = no && can_build_shared=no +test no = "$ld_shlibs_CXX" && can_build_shared=no with_gnu_ld_CXX=$with_gnu_ld @@ -15267,7 +15763,7 @@ x|xyes) # Assume -lc should be added archive_cmds_need_lc_CXX=yes - if test "$enable_shared" = yes && test "$GCC" = yes; then + if test yes,yes = "$GCC,$enable_shared"; then case $archive_cmds_CXX in *'~'*) # FIXME: we may have to deal with multi-command sequences. @@ -15395,7 +15891,7 @@ $as_echo_n "checking dynamic linker characteristics... " >&6; } library_names_spec= libname_spec='lib$name' soname_spec= -shrext_cmds=".so" +shrext_cmds=.so postinstall_cmds= postuninstall_cmds= finish_cmds= @@ -15412,14 +15908,16 @@ hardcode_into_libs=no # flags to be left without arguments need_version=unknown + + case $host_os in aix3*) version_type=linux # correct to gnu/linux during the next big refactor - library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a' + library_names_spec='$libname$release$shared_ext$versuffix $libname.a' shlibpath_var=LIBPATH # AIX 3 has no versioning support, so we append a major version to the name. - soname_spec='${libname}${release}${shared_ext}$major' + soname_spec='$libname$release$shared_ext$major' ;; aix[4-9]*) @@ -15427,41 +15925,91 @@ aix[4-9]*) need_lib_prefix=no need_version=no hardcode_into_libs=yes - if test "$host_cpu" = ia64; then + if test ia64 = "$host_cpu"; then # AIX 5 supports IA64 - library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}' + library_names_spec='$libname$release$shared_ext$major $libname$release$shared_ext$versuffix $libname$shared_ext' shlibpath_var=LD_LIBRARY_PATH else # With GCC up to 2.95.x, collect2 would create an import file # for dependence libraries. The import file would start with - # the line `#! .'. This would cause the generated library to - # depend on `.', always an invalid library. This was fixed in + # the line '#! .'. This would cause the generated library to + # depend on '.', always an invalid library. This was fixed in # development snapshots of GCC prior to 3.0. case $host_os in aix4 | aix4.[01] | aix4.[01].*) if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)' echo ' yes ' - echo '#endif'; } | ${CC} -E - | $GREP yes > /dev/null; then + echo '#endif'; } | $CC -E - | $GREP yes > /dev/null; then : else can_build_shared=no fi ;; esac - # AIX (on Power*) has no versioning support, so currently we can not hardcode correct + # Using Import Files as archive members, it is possible to support + # filename-based versioning of shared library archives on AIX. While + # this would work for both with and without runtime linking, it will + # prevent static linking of such archives. So we do filename-based + # shared library versioning with .so extension only, which is used + # when both runtime linking and shared linking is enabled. + # Unfortunately, runtime linking may impact performance, so we do + # not want this to be the default eventually. Also, we use the + # versioned .so libs for executables only if there is the -brtl + # linker flag in LDFLAGS as well, or --with-aix-soname=svr4 only. + # To allow for filename-based versioning support, we need to create + # libNAME.so.V as an archive file, containing: + # *) an Import File, referring to the versioned filename of the + # archive as well as the shared archive member, telling the + # bitwidth (32 or 64) of that shared object, and providing the + # list of exported symbols of that shared object, eventually + # decorated with the 'weak' keyword + # *) the shared object with the F_LOADONLY flag set, to really avoid + # it being seen by the linker. + # At run time we better use the real file rather than another symlink, + # but for link time we create the symlink libNAME.so -> libNAME.so.V + + case $with_aix_soname,$aix_use_runtimelinking in + # AIX (on Power*) has no versioning support, so currently we cannot hardcode correct # soname into executable. Probably we can add versioning support to # collect2, so additional links can be useful in future. - if test "$aix_use_runtimelinking" = yes; then + aix,yes) # traditional libtool + dynamic_linker='AIX unversionable lib.so' # If using run time linking (on AIX 4.2 or later) use lib.so # instead of lib.a to let people know that these are not # typical AIX shared libraries. - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - else + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' + ;; + aix,no) # traditional AIX only + dynamic_linker='AIX lib.a(lib.so.V)' # We preserve .a as extension for shared libraries through AIX4.2 # and later when we are not doing run time linking. - library_names_spec='${libname}${release}.a $libname.a' - soname_spec='${libname}${release}${shared_ext}$major' - fi + library_names_spec='$libname$release.a $libname.a' + soname_spec='$libname$release$shared_ext$major' + ;; + svr4,*) # full svr4 only + dynamic_linker="AIX lib.so.V($shared_archive_member_spec.o)" + library_names_spec='$libname$release$shared_ext$major $libname$shared_ext' + # We do not specify a path in Import Files, so LIBPATH fires. + shlibpath_overrides_runpath=yes + ;; + *,yes) # both, prefer svr4 + dynamic_linker="AIX lib.so.V($shared_archive_member_spec.o), lib.a(lib.so.V)" + library_names_spec='$libname$release$shared_ext$major $libname$shared_ext' + # unpreferred sharedlib libNAME.a needs extra handling + postinstall_cmds='test -n "$linkname" || linkname="$realname"~func_stripname "" ".so" "$linkname"~$install_shared_prog "$dir/$func_stripname_result.$libext" "$destdir/$func_stripname_result.$libext"~test -z "$tstripme" || test -z "$striplib" || $striplib "$destdir/$func_stripname_result.$libext"' + postuninstall_cmds='for n in $library_names $old_library; do :; done~func_stripname "" ".so" "$n"~test "$func_stripname_result" = "$n" || func_append rmfiles " $odir/$func_stripname_result.$libext"' + # We do not specify a path in Import Files, so LIBPATH fires. + shlibpath_overrides_runpath=yes + ;; + *,no) # both, prefer aix + dynamic_linker="AIX lib.a(lib.so.V), lib.so.V($shared_archive_member_spec.o)" + library_names_spec='$libname$release.a $libname.a' + soname_spec='$libname$release$shared_ext$major' + # unpreferred sharedlib libNAME.so.V and symlink libNAME.so need extra handling + postinstall_cmds='test -z "$dlname" || $install_shared_prog $dir/$dlname $destdir/$dlname~test -z "$tstripme" || test -z "$striplib" || $striplib $destdir/$dlname~test -n "$linkname" || linkname=$realname~func_stripname "" ".a" "$linkname"~(cd "$destdir" && $LN_S -f $dlname $func_stripname_result.so)' + postuninstall_cmds='test -z "$dlname" || func_append rmfiles " $odir/$dlname"~for n in $old_library $library_names; do :; done~func_stripname "" ".a" "$n"~func_append rmfiles " $odir/$func_stripname_result.so"' + ;; + esac shlibpath_var=LIBPATH fi ;; @@ -15471,18 +16019,18 @@ amigaos*) powerpc) # Since July 2007 AmigaOS4 officially supports .so libraries. # When compiling the executable, add -use-dynld -Lsobjs: to the compileline. - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' ;; m68k) library_names_spec='$libname.ixlibrary $libname.a' # Create ${libname}_ixlibrary.a entries in /sys/libs. - finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`func_echo_all "$lib" | $SED '\''s%^.*/\([^/]*\)\.ixlibrary$%\1%'\''`; test $RM /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done' + finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`func_echo_all "$lib" | $SED '\''s%^.*/\([^/]*\)\.ixlibrary$%\1%'\''`; $RM /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done' ;; esac ;; beos*) - library_names_spec='${libname}${shared_ext}' + library_names_spec='$libname$shared_ext' dynamic_linker="$host_os ld.so" shlibpath_var=LIBRARY_PATH ;; @@ -15490,8 +16038,8 @@ beos*) bsdi[45]*) version_type=linux # correct to gnu/linux during the next big refactor need_version=no - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' + soname_spec='$libname$release$shared_ext$major' finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir' shlibpath_var=LD_LIBRARY_PATH sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib" @@ -15503,7 +16051,7 @@ bsdi[45]*) cygwin* | mingw* | pw32* | cegcc*) version_type=windows - shrext_cmds=".dll" + shrext_cmds=.dll need_version=no need_lib_prefix=no @@ -15512,8 +16060,8 @@ cygwin* | mingw* | pw32* | cegcc*) # gcc library_names_spec='$libname.dll.a' # DLL is installed to $(libdir)/../bin by postinstall_cmds - postinstall_cmds='base_file=`basename \${file}`~ - dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~ + postinstall_cmds='base_file=`basename \$file`~ + dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\$base_file'\''i; echo \$dlname'\''`~ dldir=$destdir/`dirname \$dlpath`~ test -d \$dldir || mkdir -p \$dldir~ $install_prog $dir/$dlname \$dldir/$dlname~ @@ -15529,16 +16077,16 @@ cygwin* | mingw* | pw32* | cegcc*) case $host_os in cygwin*) # Cygwin DLLs use 'cyg' prefix rather than 'lib' - soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' + soname_spec='`echo $libname | sed -e 's/^lib/cyg/'``echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext' ;; mingw* | cegcc*) # MinGW DLLs use traditional 'lib' prefix - soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' + soname_spec='$libname`echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext' ;; pw32*) # pw32 DLLs use 'pw' prefix rather than 'lib' - library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' + library_names_spec='`echo $libname | sed -e 's/^lib/pw/'``echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext' ;; esac dynamic_linker='Win32 ld.exe' @@ -15547,8 +16095,8 @@ cygwin* | mingw* | pw32* | cegcc*) *,cl*) # Native MSVC libname_spec='$name' - soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' - library_names_spec='${libname}.dll.lib' + soname_spec='$libname`echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext' + library_names_spec='$libname.dll.lib' case $build_os in mingw*) @@ -15575,7 +16123,7 @@ cygwin* | mingw* | pw32* | cegcc*) sys_lib_search_path_spec=`cygpath --path --unix "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` ;; *) - sys_lib_search_path_spec="$LIB" + sys_lib_search_path_spec=$LIB if $ECHO "$sys_lib_search_path_spec" | $GREP ';[c-zC-Z]:/' >/dev/null; then # It is most probably a Windows format PATH. sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` @@ -15588,8 +16136,8 @@ cygwin* | mingw* | pw32* | cegcc*) esac # DLL is installed to $(libdir)/../bin by postinstall_cmds - postinstall_cmds='base_file=`basename \${file}`~ - dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~ + postinstall_cmds='base_file=`basename \$file`~ + dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\$base_file'\''i; echo \$dlname'\''`~ dldir=$destdir/`dirname \$dlpath`~ test -d \$dldir || mkdir -p \$dldir~ $install_prog $dir/$dlname \$dldir/$dlname' @@ -15602,7 +16150,7 @@ cygwin* | mingw* | pw32* | cegcc*) *) # Assume MSVC wrapper - library_names_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext} $libname.lib' + library_names_spec='$libname`echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext $libname.lib' dynamic_linker='Win32 ld.exe' ;; esac @@ -15615,8 +16163,8 @@ darwin* | rhapsody*) version_type=darwin need_lib_prefix=no need_version=no - library_names_spec='${libname}${release}${major}$shared_ext ${libname}$shared_ext' - soname_spec='${libname}${release}${major}$shared_ext' + library_names_spec='$libname$release$major$shared_ext $libname$shared_ext' + soname_spec='$libname$release$major$shared_ext' shlibpath_overrides_runpath=yes shlibpath_var=DYLD_LIBRARY_PATH shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`' @@ -15628,8 +16176,8 @@ dgux*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext' - soname_spec='${libname}${release}${shared_ext}$major' + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' + soname_spec='$libname$release$shared_ext$major' shlibpath_var=LD_LIBRARY_PATH ;; @@ -15647,12 +16195,13 @@ freebsd* | dragonfly*) version_type=freebsd-$objformat case $version_type in freebsd-elf*) - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' + soname_spec='$libname$release$shared_ext$major' need_version=no need_lib_prefix=no ;; freebsd-*) - library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix' + library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix' need_version=yes ;; esac @@ -15677,26 +16226,15 @@ freebsd* | dragonfly*) esac ;; -gnu*) - version_type=linux # correct to gnu/linux during the next big refactor - need_lib_prefix=no - need_version=no - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=no - hardcode_into_libs=yes - ;; - haiku*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no dynamic_linker="$host_os runtime_loader" - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' + soname_spec='$libname$release$shared_ext$major' shlibpath_var=LIBRARY_PATH - shlibpath_overrides_runpath=yes + shlibpath_overrides_runpath=no sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/system/lib' hardcode_into_libs=yes ;; @@ -15714,14 +16252,15 @@ hpux9* | hpux10* | hpux11*) dynamic_linker="$host_os dld.so" shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - if test "X$HPUX_IA64_MODE" = X32; then + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' + soname_spec='$libname$release$shared_ext$major' + if test 32 = "$HPUX_IA64_MODE"; then sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib" + sys_lib_dlsearch_path_spec=/usr/lib/hpux32 else sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64" + sys_lib_dlsearch_path_spec=/usr/lib/hpux64 fi - sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec ;; hppa*64*) shrext_cmds='.sl' @@ -15729,8 +16268,8 @@ hpux9* | hpux10* | hpux11*) dynamic_linker="$host_os dld.sl" shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' + soname_spec='$libname$release$shared_ext$major' sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64" sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec ;; @@ -15739,8 +16278,8 @@ hpux9* | hpux10* | hpux11*) dynamic_linker="$host_os dld.sl" shlibpath_var=SHLIB_PATH shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' + soname_spec='$libname$release$shared_ext$major' ;; esac # HP-UX runs *really* slowly unless shared libraries are mode 555, ... @@ -15753,8 +16292,8 @@ interix[3-9]*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' + soname_spec='$libname$release$shared_ext$major' dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no @@ -15765,7 +16304,7 @@ irix5* | irix6* | nonstopux*) case $host_os in nonstopux*) version_type=nonstopux ;; *) - if test "$lt_cv_prog_gnu_ld" = yes; then + if test yes = "$lt_cv_prog_gnu_ld"; then version_type=linux # correct to gnu/linux during the next big refactor else version_type=irix @@ -15773,8 +16312,8 @@ irix5* | irix6* | nonstopux*) esac need_lib_prefix=no need_version=no - soname_spec='${libname}${release}${shared_ext}$major' - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}' + soname_spec='$libname$release$shared_ext$major' + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$release$shared_ext $libname$shared_ext' case $host_os in irix5* | nonstopux*) libsuff= shlibsuff= @@ -15793,8 +16332,8 @@ irix5* | irix6* | nonstopux*) esac shlibpath_var=LD_LIBRARY${shlibsuff}_PATH shlibpath_overrides_runpath=no - sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}" - sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}" + sys_lib_search_path_spec="/usr/lib$libsuff /lib$libsuff /usr/local/lib$libsuff" + sys_lib_dlsearch_path_spec="/usr/lib$libsuff /lib$libsuff" hardcode_into_libs=yes ;; @@ -15803,13 +16342,33 @@ linux*oldld* | linux*aout* | linux*coff*) dynamic_linker=no ;; +linux*android*) + version_type=none # Android doesn't support versioned libraries. + need_lib_prefix=no + need_version=no + library_names_spec='$libname$release$shared_ext' + soname_spec='$libname$release$shared_ext' + finish_cmds= + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + + # This implies no fast_install, which is unacceptable. + # Some rework will be needed to allow for fast_install + # before this can be enabled. + hardcode_into_libs=yes + + dynamic_linker='Android linker' + # Don't embed -rpath directories since the linker doesn't support them. + hardcode_libdir_flag_spec_CXX='-L$libdir' + ;; + # This must be glibc/ELF. -linux* | k*bsd*-gnu | kopensolaris*-gnu) +linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' + soname_spec='$libname$release$shared_ext$major' finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no @@ -15856,11 +16415,15 @@ fi # Add ABI-specific directories to the system library path. sys_lib_dlsearch_path_spec="/lib64 /usr/lib64 /lib /usr/lib" - # Append ld.so.conf contents to the search path + # Ideally, we could use ldconfig to report *all* directores which are + # searched for libraries, however this is still not possible. Aside from not + # being certain /sbin/ldconfig is available, command + # 'ldconfig -N -X -v | grep ^/' on 64bit Fedora does not report /usr/lib64, + # even though it is searched at run-time. Try to do the best guess by + # appending ld.so.conf contents (and includes) to the search path. if test -f /etc/ld.so.conf; then lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[ ]*hwcap[ ]/d;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;s/"//g;/^$/d' | tr '\n' ' '` sys_lib_dlsearch_path_spec="$sys_lib_dlsearch_path_spec $lt_ld_extra" - fi # We used to test for /lib/ld.so.1 and disable shared libraries on @@ -15877,12 +16440,12 @@ netbsd*) need_lib_prefix=no need_version=no if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' + library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix' finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' dynamic_linker='NetBSD (a.out) ld.so' else - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' + soname_spec='$libname$release$shared_ext$major' dynamic_linker='NetBSD ld.elf_so' fi shlibpath_var=LD_LIBRARY_PATH @@ -15892,7 +16455,7 @@ netbsd*) newsos6) version_type=linux # correct to gnu/linux during the next big refactor - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes ;; @@ -15901,58 +16464,68 @@ newsos6) version_type=qnx need_lib_prefix=no need_version=no - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' + soname_spec='$libname$release$shared_ext$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes dynamic_linker='ldqnx.so' ;; -openbsd*) +openbsd* | bitrig*) version_type=sunos - sys_lib_dlsearch_path_spec="/usr/lib" + sys_lib_dlsearch_path_spec=/usr/lib need_lib_prefix=no - # Some older versions of OpenBSD (3.3 at least) *do* need versioned libs. - case $host_os in - openbsd3.3 | openbsd3.3.*) need_version=yes ;; - *) need_version=no ;; - esac - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' - finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' - shlibpath_var=LD_LIBRARY_PATH - if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then - case $host_os in - openbsd2.[89] | openbsd2.[89].*) - shlibpath_overrides_runpath=no - ;; - *) - shlibpath_overrides_runpath=yes - ;; - esac + if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`"; then + need_version=no else - shlibpath_overrides_runpath=yes + need_version=yes fi + library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix' + finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes ;; os2*) libname_spec='$name' - shrext_cmds=".dll" + version_type=windows + shrext_cmds=.dll + need_version=no need_lib_prefix=no - library_names_spec='$libname${shared_ext} $libname.a' + # OS/2 can only load a DLL with a base name of 8 characters or less. + soname_spec='`test -n "$os2dllname" && libname="$os2dllname"; + v=$($ECHO $release$versuffix | tr -d .-); + n=$($ECHO $libname | cut -b -$((8 - ${#v})) | tr . _); + $ECHO $n$v`$shared_ext' + library_names_spec='${libname}_dll.$libext' dynamic_linker='OS/2 ld.exe' - shlibpath_var=LIBPATH + shlibpath_var=BEGINLIBPATH + sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" + sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec + postinstall_cmds='base_file=`basename \$file`~ + dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\$base_file'\''i; $ECHO \$dlname'\''`~ + dldir=$destdir/`dirname \$dlpath`~ + test -d \$dldir || mkdir -p \$dldir~ + $install_prog $dir/$dlname \$dldir/$dlname~ + chmod a+x \$dldir/$dlname~ + if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then + eval '\''$striplib \$dldir/$dlname'\'' || exit \$?; + fi' + postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; $ECHO \$dlname'\''`~ + dlpath=$dir/\$dldll~ + $RM \$dlpath' ;; osf3* | osf4* | osf5*) version_type=osf need_lib_prefix=no need_version=no - soname_spec='${libname}${release}${shared_ext}$major' - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='$libname$release$shared_ext$major' + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' shlibpath_var=LD_LIBRARY_PATH sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib" - sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec" + sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec ;; rdos*) @@ -15963,8 +16536,8 @@ solaris*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' + soname_spec='$libname$release$shared_ext$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes @@ -15974,11 +16547,11 @@ solaris*) sunos4*) version_type=sunos - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' + library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix' finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes - if test "$with_gnu_ld" = yes; then + if test yes = "$with_gnu_ld"; then need_lib_prefix=no fi need_version=yes @@ -15986,8 +16559,8 @@ sunos4*) sysv4 | sysv4.3*) version_type=linux # correct to gnu/linux during the next big refactor - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' + soname_spec='$libname$release$shared_ext$major' shlibpath_var=LD_LIBRARY_PATH case $host_vendor in sni) @@ -16008,24 +16581,24 @@ sysv4 | sysv4.3*) ;; sysv4*MP*) - if test -d /usr/nec ;then + if test -d /usr/nec; then version_type=linux # correct to gnu/linux during the next big refactor - library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}' - soname_spec='$libname${shared_ext}.$major' + library_names_spec='$libname$shared_ext.$versuffix $libname$shared_ext.$major $libname$shared_ext' + soname_spec='$libname$shared_ext.$major' shlibpath_var=LD_LIBRARY_PATH fi ;; sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) - version_type=freebsd-elf + version_type=sco need_lib_prefix=no need_version=no - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext $libname$shared_ext' + soname_spec='$libname$release$shared_ext$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes - if test "$with_gnu_ld" = yes; then + if test yes = "$with_gnu_ld"; then sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib' else sys_lib_search_path_spec='/usr/ccs/lib /usr/lib' @@ -16043,7 +16616,7 @@ tpf*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes @@ -16051,8 +16624,8 @@ tpf*) uts4*) version_type=linux # correct to gnu/linux during the next big refactor - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' + soname_spec='$libname$release$shared_ext$major' shlibpath_var=LD_LIBRARY_PATH ;; @@ -16062,20 +16635,32 @@ uts4*) esac { $as_echo "$as_me:${as_lineno-$LINENO}: result: $dynamic_linker" >&5 $as_echo "$dynamic_linker" >&6; } -test "$dynamic_linker" = no && can_build_shared=no +test no = "$dynamic_linker" && can_build_shared=no variables_saved_for_relink="PATH $shlibpath_var $runpath_var" -if test "$GCC" = yes; then +if test yes = "$GCC"; then variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH" fi -if test "${lt_cv_sys_lib_search_path_spec+set}" = set; then - sys_lib_search_path_spec="$lt_cv_sys_lib_search_path_spec" +if test set = "${lt_cv_sys_lib_search_path_spec+set}"; then + sys_lib_search_path_spec=$lt_cv_sys_lib_search_path_spec fi -if test "${lt_cv_sys_lib_dlsearch_path_spec+set}" = set; then - sys_lib_dlsearch_path_spec="$lt_cv_sys_lib_dlsearch_path_spec" + +if test set = "${lt_cv_sys_lib_dlsearch_path_spec+set}"; then + sys_lib_dlsearch_path_spec=$lt_cv_sys_lib_dlsearch_path_spec fi +# remember unaugmented sys_lib_dlsearch_path content for libtool script decls... +configure_time_dlsearch_path=$sys_lib_dlsearch_path_spec + +# ... but it needs LT_SYS_LIBRARY_PATH munging for other configure-time code +func_munge_path_list sys_lib_dlsearch_path_spec "$LT_SYS_LIBRARY_PATH" + +# to be used as default LT_SYS_LIBRARY_PATH value in generated libtool +configure_time_lt_sys_library_path=$LT_SYS_LIBRARY_PATH + + + @@ -16118,15 +16703,15 @@ $as_echo_n "checking how to hardcode library paths into programs... " >&6; } hardcode_action_CXX= if test -n "$hardcode_libdir_flag_spec_CXX" || test -n "$runpath_var_CXX" || - test "X$hardcode_automatic_CXX" = "Xyes" ; then + test yes = "$hardcode_automatic_CXX"; then # We can hardcode non-existent directories. - if test "$hardcode_direct_CXX" != no && + if test no != "$hardcode_direct_CXX" && # If the only mechanism to avoid hardcoding is shlibpath_var, we # have to relink, otherwise we might link with an installed library # when we should be linking with a yet-to-be-installed one - ## test "$_LT_TAGVAR(hardcode_shlibpath_var, CXX)" != no && - test "$hardcode_minus_L_CXX" != no; then + ## test no != "$_LT_TAGVAR(hardcode_shlibpath_var, CXX)" && + test no != "$hardcode_minus_L_CXX"; then # Linking always hardcodes the temporary library directory. hardcode_action_CXX=relink else @@ -16141,12 +16726,12 @@ fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $hardcode_action_CXX" >&5 $as_echo "$hardcode_action_CXX" >&6; } -if test "$hardcode_action_CXX" = relink || - test "$inherit_rpath_CXX" = yes; then +if test relink = "$hardcode_action_CXX" || + test yes = "$inherit_rpath_CXX"; then # Fast installation is not supported enable_fast_install=no -elif test "$shlibpath_overrides_runpath" = yes || - test "$enable_shared" = no; then +elif test yes = "$shlibpath_overrides_runpath" || + test no = "$enable_shared"; then # Fast installation is not necessary enable_fast_install=needless fi @@ -16169,7 +16754,7 @@ fi lt_cv_path_LD=$lt_save_path_LD lt_cv_prog_gnu_ldcxx=$lt_cv_prog_gnu_ld lt_cv_prog_gnu_ld=$lt_save_with_gnu_ld -fi # test "$_lt_caught_CXX_error" != yes +fi # test yes != "$_lt_caught_CXX_error" ac_ext=c ac_cpp='$CPP $CPPFLAGS' @@ -22648,6 +23233,7 @@ macro_revision='`$ECHO "$macro_revision" | $SED "$delay_single_quote_subst"`' enable_shared='`$ECHO "$enable_shared" | $SED "$delay_single_quote_subst"`' pic_mode='`$ECHO "$pic_mode" | $SED "$delay_single_quote_subst"`' enable_fast_install='`$ECHO "$enable_fast_install" | $SED "$delay_single_quote_subst"`' +shared_archive_member_spec='`$ECHO "$shared_archive_member_spec" | $SED "$delay_single_quote_subst"`' SHELL='`$ECHO "$SHELL" | $SED "$delay_single_quote_subst"`' ECHO='`$ECHO "$ECHO" | $SED "$delay_single_quote_subst"`' PATH_SEPARATOR='`$ECHO "$PATH_SEPARATOR" | $SED "$delay_single_quote_subst"`' @@ -22697,10 +23283,13 @@ compiler='`$ECHO "$compiler" | $SED "$delay_single_quote_subst"`' GCC='`$ECHO "$GCC" | $SED "$delay_single_quote_subst"`' lt_cv_sys_global_symbol_pipe='`$ECHO "$lt_cv_sys_global_symbol_pipe" | $SED "$delay_single_quote_subst"`' lt_cv_sys_global_symbol_to_cdecl='`$ECHO "$lt_cv_sys_global_symbol_to_cdecl" | $SED "$delay_single_quote_subst"`' +lt_cv_sys_global_symbol_to_import='`$ECHO "$lt_cv_sys_global_symbol_to_import" | $SED "$delay_single_quote_subst"`' lt_cv_sys_global_symbol_to_c_name_address='`$ECHO "$lt_cv_sys_global_symbol_to_c_name_address" | $SED "$delay_single_quote_subst"`' lt_cv_sys_global_symbol_to_c_name_address_lib_prefix='`$ECHO "$lt_cv_sys_global_symbol_to_c_name_address_lib_prefix" | $SED "$delay_single_quote_subst"`' +lt_cv_nm_interface='`$ECHO "$lt_cv_nm_interface" | $SED "$delay_single_quote_subst"`' nm_file_list_spec='`$ECHO "$nm_file_list_spec" | $SED "$delay_single_quote_subst"`' lt_sysroot='`$ECHO "$lt_sysroot" | $SED "$delay_single_quote_subst"`' +lt_cv_truncate_bin='`$ECHO "$lt_cv_truncate_bin" | $SED "$delay_single_quote_subst"`' objdir='`$ECHO "$objdir" | $SED "$delay_single_quote_subst"`' MAGIC_CMD='`$ECHO "$MAGIC_CMD" | $SED "$delay_single_quote_subst"`' lt_prog_compiler_no_builtin_flag='`$ECHO "$lt_prog_compiler_no_builtin_flag" | $SED "$delay_single_quote_subst"`' @@ -22765,7 +23354,8 @@ finish_cmds='`$ECHO "$finish_cmds" | $SED "$delay_single_quote_subst"`' finish_eval='`$ECHO "$finish_eval" | $SED "$delay_single_quote_subst"`' hardcode_into_libs='`$ECHO "$hardcode_into_libs" | $SED "$delay_single_quote_subst"`' sys_lib_search_path_spec='`$ECHO "$sys_lib_search_path_spec" | $SED "$delay_single_quote_subst"`' -sys_lib_dlsearch_path_spec='`$ECHO "$sys_lib_dlsearch_path_spec" | $SED "$delay_single_quote_subst"`' +configure_time_dlsearch_path='`$ECHO "$configure_time_dlsearch_path" | $SED "$delay_single_quote_subst"`' +configure_time_lt_sys_library_path='`$ECHO "$configure_time_lt_sys_library_path" | $SED "$delay_single_quote_subst"`' hardcode_action='`$ECHO "$hardcode_action" | $SED "$delay_single_quote_subst"`' enable_dlopen='`$ECHO "$enable_dlopen" | $SED "$delay_single_quote_subst"`' enable_dlopen_self='`$ECHO "$enable_dlopen_self" | $SED "$delay_single_quote_subst"`' @@ -22870,9 +23460,12 @@ CFLAGS \ compiler \ lt_cv_sys_global_symbol_pipe \ lt_cv_sys_global_symbol_to_cdecl \ +lt_cv_sys_global_symbol_to_import \ lt_cv_sys_global_symbol_to_c_name_address \ lt_cv_sys_global_symbol_to_c_name_address_lib_prefix \ +lt_cv_nm_interface \ nm_file_list_spec \ +lt_cv_truncate_bin \ lt_prog_compiler_no_builtin_flag \ lt_prog_compiler_pic \ lt_prog_compiler_wl \ @@ -22938,7 +23531,7 @@ postdeps_CXX \ compiler_lib_search_path_CXX; do case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in *[\\\\\\\`\\"\\\$]*) - eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED \\"\\\$sed_quote_subst\\"\\\`\\\\\\"" + eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED \\"\\\$sed_quote_subst\\"\\\`\\\\\\"" ## exclude from sc_prohibit_nested_quotes ;; *) eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\"" @@ -22965,7 +23558,8 @@ postinstall_cmds \ postuninstall_cmds \ finish_cmds \ sys_lib_search_path_spec \ -sys_lib_dlsearch_path_spec \ +configure_time_dlsearch_path \ +configure_time_lt_sys_library_path \ reload_cmds_CXX \ old_archive_cmds_CXX \ old_archive_from_new_cmds_CXX \ @@ -22979,7 +23573,7 @@ prelink_cmds_CXX \ postlink_cmds_CXX; do case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in *[\\\\\\\`\\"\\\$]*) - eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED -e \\"\\\$double_quote_subst\\" -e \\"\\\$sed_quote_subst\\" -e \\"\\\$delay_variable_subst\\"\\\`\\\\\\"" + eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED -e \\"\\\$double_quote_subst\\" -e \\"\\\$sed_quote_subst\\" -e \\"\\\$delay_variable_subst\\"\\\`\\\\\\"" ## exclude from sc_prohibit_nested_quotes ;; *) eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\"" @@ -22988,19 +23582,16 @@ postlink_cmds_CXX; do done ac_aux_dir='$ac_aux_dir' -xsi_shell='$xsi_shell' -lt_shell_append='$lt_shell_append' -# See if we are running on zsh, and set the options which allow our +# See if we are running on zsh, and set the options that allow our # commands through without removal of \ escapes INIT. -if test -n "\${ZSH_VERSION+set}" ; then +if test -n "\${ZSH_VERSION+set}"; then setopt NO_GLOB_SUBST fi PACKAGE='$PACKAGE' VERSION='$VERSION' - TIMESTAMP='$TIMESTAMP' RM='$RM' ofile='$ofile' @@ -23712,55 +24303,53 @@ $as_echo X"$file" | ;; "libtool":C) - # See if we are running on zsh, and set the options which allow our + # See if we are running on zsh, and set the options that allow our # commands through without removal of \ escapes. - if test -n "${ZSH_VERSION+set}" ; then + if test -n "${ZSH_VERSION+set}"; then setopt NO_GLOB_SUBST fi - cfgfile="${ofile}T" + cfgfile=${ofile}T trap "$RM \"$cfgfile\"; exit 1" 1 2 15 $RM "$cfgfile" cat <<_LT_EOF >> "$cfgfile" #! $SHELL - -# `$ECHO "$ofile" | sed 's%^.*/%%'` - Provide generalized library-building support services. -# Generated automatically by $as_me ($PACKAGE$TIMESTAMP) $VERSION +# Generated automatically by $as_me ($PACKAGE) $VERSION # Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`: # NOTE: Changes made to this file will be lost: look at ltmain.sh. + +# Provide generalized library-building support services. +# Written by Gordon Matzigkeit, 1996 + +# Copyright (C) 2014 Free Software Foundation, Inc. +# This is free software; see the source for copying conditions. There is NO +# warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + +# GNU Libtool is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of of the License, or +# (at your option) any later version. # -# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, -# 2006, 2007, 2008, 2009, 2010, 2011 Free Software -# Foundation, Inc. -# Written by Gordon Matzigkeit, 1996 -# -# This file is part of GNU Libtool. -# -# GNU Libtool is free software; you can redistribute it and/or -# modify it under the terms of the GNU General Public License as -# published by the Free Software Foundation; either version 2 of -# the License, or (at your option) any later version. -# -# As a special exception to the GNU General Public License, -# if you distribute this file as part of a program or library that -# is built using GNU Libtool, you may include this file under the -# same distribution terms that you use for the rest of that program. +# As a special exception to the GNU General Public License, if you +# distribute this file as part of a program or library that is built +# using GNU Libtool, you may include this file under the same +# distribution terms that you use for the rest of that program. # -# GNU Libtool is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of +# GNU Libtool is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License -# along with GNU Libtool; see the file COPYING. If not, a copy -# can be downloaded from http://www.gnu.org/licenses/gpl.html, or -# obtained by writing to the Free Software Foundation, Inc., -# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +# along with this program. If not, see . # The names of the tagged configurations supported by this script. -available_tags="CXX " +available_tags='CXX ' + +# Configured defaults for sys_lib_dlsearch_path munging. +: \${LT_SYS_LIBRARY_PATH="$configure_time_lt_sys_library_path"} # ### BEGIN LIBTOOL CONFIG @@ -23780,6 +24369,9 @@ pic_mode=$pic_mode # Whether or not to optimize for fast installation. fast_install=$enable_fast_install +# Shared archive member basename,for filename based shared library versioning on AIX. +shared_archive_member_spec=$shared_archive_member_spec + # Shell to use when invoking shell scripts. SHELL=$lt_SHELL @@ -23897,18 +24489,27 @@ global_symbol_pipe=$lt_lt_cv_sys_global_symbol_pipe # Transform the output of nm in a proper C declaration. global_symbol_to_cdecl=$lt_lt_cv_sys_global_symbol_to_cdecl +# Transform the output of nm into a list of symbols to manually relocate. +global_symbol_to_import=$lt_lt_cv_sys_global_symbol_to_import + # Transform the output of nm in a C name address pair. global_symbol_to_c_name_address=$lt_lt_cv_sys_global_symbol_to_c_name_address # Transform the output of nm in a C name address pair when lib prefix is needed. global_symbol_to_c_name_address_lib_prefix=$lt_lt_cv_sys_global_symbol_to_c_name_address_lib_prefix +# The name lister interface. +nm_interface=$lt_lt_cv_nm_interface + # Specify filename containing input files for \$NM. nm_file_list_spec=$lt_nm_file_list_spec -# The root where to search for dependent libraries,and in which our libraries should be installed. +# The root where to search for dependent libraries,and where our libraries should be installed. lt_sysroot=$lt_sysroot +# Command to truncate a binary pipe. +lt_truncate_bin=$lt_lt_cv_truncate_bin + # The name of the directory that contains temporary libtool files. objdir=$objdir @@ -23999,8 +24600,11 @@ hardcode_into_libs=$hardcode_into_libs # Compile-time system search path for libraries. sys_lib_search_path_spec=$lt_sys_lib_search_path_spec -# Run-time system search path for libraries. -sys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec +# Detected run-time system search path for libraries. +sys_lib_dlsearch_path_spec=$lt_configure_time_dlsearch_path + +# Explicit LT_SYS_LIBRARY_PATH set during ./configure time. +configure_time_lt_sys_library_path=$lt_configure_time_lt_sys_library_path # Whether dlopen is supported. dlopen_support=$enable_dlopen @@ -24093,13 +24697,13 @@ hardcode_libdir_flag_spec=$lt_hardcode_libdir_flag_spec # Whether we need a single "-rpath" flag with a separated argument. hardcode_libdir_separator=$lt_hardcode_libdir_separator -# Set to "yes" if using DIR/libNAME\${shared_ext} during linking hardcodes +# Set to "yes" if using DIR/libNAME\$shared_ext during linking hardcodes # DIR into the resulting binary. hardcode_direct=$hardcode_direct -# Set to "yes" if using DIR/libNAME\${shared_ext} during linking hardcodes +# Set to "yes" if using DIR/libNAME\$shared_ext during linking hardcodes # DIR into the resulting binary and the resulting library dependency is -# "absolute",i.e impossible to change by setting \${shlibpath_var} if the +# "absolute",i.e impossible to change by setting \$shlibpath_var if the # library is relocated. hardcode_direct_absolute=$hardcode_direct_absolute @@ -24165,13 +24769,72 @@ compiler_lib_search_path=$lt_compiler_lib_search_path _LT_EOF + cat <<'_LT_EOF' >> "$cfgfile" + +# ### BEGIN FUNCTIONS SHARED WITH CONFIGURE + +# func_munge_path_list VARIABLE PATH +# ----------------------------------- +# VARIABLE is name of variable containing _space_ separated list of +# directories to be munged by the contents of PATH, which is string +# having a format: +# "DIR[:DIR]:" +# string "DIR[ DIR]" will be prepended to VARIABLE +# ":DIR[:DIR]" +# string "DIR[ DIR]" will be appended to VARIABLE +# "DIRP[:DIRP]::[DIRA:]DIRA" +# string "DIRP[ DIRP]" will be prepended to VARIABLE and string +# "DIRA[ DIRA]" will be appended to VARIABLE +# "DIR[:DIR]" +# VARIABLE will be replaced by "DIR[ DIR]" +func_munge_path_list () +{ + case x$2 in + x) + ;; + *:) + eval $1=\"`$ECHO $2 | $SED 's/:/ /g'` \$$1\" + ;; + x:*) + eval $1=\"\$$1 `$ECHO $2 | $SED 's/:/ /g'`\" + ;; + *::*) + eval $1=\"\$$1\ `$ECHO $2 | $SED -e 's/.*:://' -e 's/:/ /g'`\" + eval $1=\"`$ECHO $2 | $SED -e 's/::.*//' -e 's/:/ /g'`\ \$$1\" + ;; + *) + eval $1=\"`$ECHO $2 | $SED 's/:/ /g'`\" + ;; + esac +} + + +# Calculate cc_basename. Skip known compiler wrappers and cross-prefix. +func_cc_basename () +{ + for cc_temp in $*""; do + case $cc_temp in + compile | *[\\/]compile | ccache | *[\\/]ccache ) ;; + distcc | *[\\/]distcc | purify | *[\\/]purify ) ;; + \-*) ;; + *) break;; + esac + done + func_cc_basename_result=`$ECHO "$cc_temp" | $SED "s%.*/%%; s%^$host_alias-%%"` +} + + +# ### END FUNCTIONS SHARED WITH CONFIGURE + +_LT_EOF + case $host_os in aix3*) cat <<\_LT_EOF >> "$cfgfile" # AIX sometimes has problems with the GCC collect2 program. For some # reason, if we set the COLLECT_NAMES environment variable, the problems # vanish in a puff of smoke. -if test "X${COLLECT_NAMES+set}" != Xset; then +if test set != "${COLLECT_NAMES+set}"; then COLLECT_NAMES= export COLLECT_NAMES fi @@ -24180,7 +24843,7 @@ _LT_EOF esac -ltmain="$ac_aux_dir/ltmain.sh" +ltmain=$ac_aux_dir/ltmain.sh # We use sed instead of cat because bash on DJGPP gets confused if @@ -24190,165 +24853,6 @@ ltmain="$ac_aux_dir/ltmain.sh" sed '$q' "$ltmain" >> "$cfgfile" \ || (rm -f "$cfgfile"; exit 1) - if test x"$xsi_shell" = xyes; then - sed -e '/^func_dirname ()$/,/^} # func_dirname /c\ -func_dirname ()\ -{\ -\ case ${1} in\ -\ */*) func_dirname_result="${1%/*}${2}" ;;\ -\ * ) func_dirname_result="${3}" ;;\ -\ esac\ -} # Extended-shell func_dirname implementation' "$cfgfile" > $cfgfile.tmp \ - && mv -f "$cfgfile.tmp" "$cfgfile" \ - || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") -test 0 -eq $? || _lt_function_replace_fail=: - - - sed -e '/^func_basename ()$/,/^} # func_basename /c\ -func_basename ()\ -{\ -\ func_basename_result="${1##*/}"\ -} # Extended-shell func_basename implementation' "$cfgfile" > $cfgfile.tmp \ - && mv -f "$cfgfile.tmp" "$cfgfile" \ - || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") -test 0 -eq $? || _lt_function_replace_fail=: - - - sed -e '/^func_dirname_and_basename ()$/,/^} # func_dirname_and_basename /c\ -func_dirname_and_basename ()\ -{\ -\ case ${1} in\ -\ */*) func_dirname_result="${1%/*}${2}" ;;\ -\ * ) func_dirname_result="${3}" ;;\ -\ esac\ -\ func_basename_result="${1##*/}"\ -} # Extended-shell func_dirname_and_basename implementation' "$cfgfile" > $cfgfile.tmp \ - && mv -f "$cfgfile.tmp" "$cfgfile" \ - || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") -test 0 -eq $? || _lt_function_replace_fail=: - - - sed -e '/^func_stripname ()$/,/^} # func_stripname /c\ -func_stripname ()\ -{\ -\ # pdksh 5.2.14 does not do ${X%$Y} correctly if both X and Y are\ -\ # positional parameters, so assign one to ordinary parameter first.\ -\ func_stripname_result=${3}\ -\ func_stripname_result=${func_stripname_result#"${1}"}\ -\ func_stripname_result=${func_stripname_result%"${2}"}\ -} # Extended-shell func_stripname implementation' "$cfgfile" > $cfgfile.tmp \ - && mv -f "$cfgfile.tmp" "$cfgfile" \ - || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") -test 0 -eq $? || _lt_function_replace_fail=: - - - sed -e '/^func_split_long_opt ()$/,/^} # func_split_long_opt /c\ -func_split_long_opt ()\ -{\ -\ func_split_long_opt_name=${1%%=*}\ -\ func_split_long_opt_arg=${1#*=}\ -} # Extended-shell func_split_long_opt implementation' "$cfgfile" > $cfgfile.tmp \ - && mv -f "$cfgfile.tmp" "$cfgfile" \ - || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") -test 0 -eq $? || _lt_function_replace_fail=: - - - sed -e '/^func_split_short_opt ()$/,/^} # func_split_short_opt /c\ -func_split_short_opt ()\ -{\ -\ func_split_short_opt_arg=${1#??}\ -\ func_split_short_opt_name=${1%"$func_split_short_opt_arg"}\ -} # Extended-shell func_split_short_opt implementation' "$cfgfile" > $cfgfile.tmp \ - && mv -f "$cfgfile.tmp" "$cfgfile" \ - || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") -test 0 -eq $? || _lt_function_replace_fail=: - - - sed -e '/^func_lo2o ()$/,/^} # func_lo2o /c\ -func_lo2o ()\ -{\ -\ case ${1} in\ -\ *.lo) func_lo2o_result=${1%.lo}.${objext} ;;\ -\ *) func_lo2o_result=${1} ;;\ -\ esac\ -} # Extended-shell func_lo2o implementation' "$cfgfile" > $cfgfile.tmp \ - && mv -f "$cfgfile.tmp" "$cfgfile" \ - || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") -test 0 -eq $? || _lt_function_replace_fail=: - - - sed -e '/^func_xform ()$/,/^} # func_xform /c\ -func_xform ()\ -{\ - func_xform_result=${1%.*}.lo\ -} # Extended-shell func_xform implementation' "$cfgfile" > $cfgfile.tmp \ - && mv -f "$cfgfile.tmp" "$cfgfile" \ - || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") -test 0 -eq $? || _lt_function_replace_fail=: - - - sed -e '/^func_arith ()$/,/^} # func_arith /c\ -func_arith ()\ -{\ - func_arith_result=$(( $* ))\ -} # Extended-shell func_arith implementation' "$cfgfile" > $cfgfile.tmp \ - && mv -f "$cfgfile.tmp" "$cfgfile" \ - || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") -test 0 -eq $? || _lt_function_replace_fail=: - - - sed -e '/^func_len ()$/,/^} # func_len /c\ -func_len ()\ -{\ - func_len_result=${#1}\ -} # Extended-shell func_len implementation' "$cfgfile" > $cfgfile.tmp \ - && mv -f "$cfgfile.tmp" "$cfgfile" \ - || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") -test 0 -eq $? || _lt_function_replace_fail=: - -fi - -if test x"$lt_shell_append" = xyes; then - sed -e '/^func_append ()$/,/^} # func_append /c\ -func_append ()\ -{\ - eval "${1}+=\\${2}"\ -} # Extended-shell func_append implementation' "$cfgfile" > $cfgfile.tmp \ - && mv -f "$cfgfile.tmp" "$cfgfile" \ - || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") -test 0 -eq $? || _lt_function_replace_fail=: - - - sed -e '/^func_append_quoted ()$/,/^} # func_append_quoted /c\ -func_append_quoted ()\ -{\ -\ func_quote_for_eval "${2}"\ -\ eval "${1}+=\\\\ \\$func_quote_for_eval_result"\ -} # Extended-shell func_append_quoted implementation' "$cfgfile" > $cfgfile.tmp \ - && mv -f "$cfgfile.tmp" "$cfgfile" \ - || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") -test 0 -eq $? || _lt_function_replace_fail=: - - - # Save a `func_append' function call where possible by direct use of '+=' - sed -e 's%func_append \([a-zA-Z_]\{1,\}\) "%\1+="%g' $cfgfile > $cfgfile.tmp \ - && mv -f "$cfgfile.tmp" "$cfgfile" \ - || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") - test 0 -eq $? || _lt_function_replace_fail=: -else - # Save a `func_append' function call even when '+=' is not available - sed -e 's%func_append \([a-zA-Z_]\{1,\}\) "%\1="$\1%g' $cfgfile > $cfgfile.tmp \ - && mv -f "$cfgfile.tmp" "$cfgfile" \ - || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") - test 0 -eq $? || _lt_function_replace_fail=: -fi - -if test x"$_lt_function_replace_fail" = x":"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Unable to substitute extended shell functions in $ofile" >&5 -$as_echo "$as_me: WARNING: Unable to substitute extended shell functions in $ofile" >&2;} -fi - - mv -f "$cfgfile" "$ofile" || (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile") chmod +x "$ofile" @@ -24435,13 +24939,13 @@ hardcode_libdir_flag_spec=$lt_hardcode_libdir_flag_spec_CXX # Whether we need a single "-rpath" flag with a separated argument. hardcode_libdir_separator=$lt_hardcode_libdir_separator_CXX -# Set to "yes" if using DIR/libNAME\${shared_ext} during linking hardcodes +# Set to "yes" if using DIR/libNAME\$shared_ext during linking hardcodes # DIR into the resulting binary. hardcode_direct=$hardcode_direct_CXX -# Set to "yes" if using DIR/libNAME\${shared_ext} during linking hardcodes +# Set to "yes" if using DIR/libNAME\$shared_ext during linking hardcodes # DIR into the resulting binary and the resulting library dependency is -# "absolute",i.e impossible to change by setting \${shlibpath_var} if the +# "absolute",i.e impossible to change by setting \$shlibpath_var if the # library is relocated. hardcode_direct_absolute=$hardcode_direct_absolute_CXX diff --git a/depcomp b/depcomp index 4ebd5b3..fc98710 100755 --- a/depcomp +++ b/depcomp @@ -3,7 +3,7 @@ scriptversion=2013-05-30.07; # UTC -# Copyright (C) 1999-2013 Free Software Foundation, Inc. +# Copyright (C) 1999-2014 Free Software Foundation, Inc. # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by diff --git a/install-sh b/install-sh index 377bb86..0b0fdcb 100755 --- a/install-sh +++ b/install-sh @@ -1,7 +1,7 @@ #!/bin/sh # install - install a program, script, or datafile -scriptversion=2011-11-20.07; # UTC +scriptversion=2013-12-25.23; # UTC # This originates from X11R5 (mit/util/scripts/install.sh), which was # later released in X11R6 (xc/config/util/install.sh) with the @@ -41,19 +41,15 @@ scriptversion=2011-11-20.07; # UTC # This script is compatible with the BSD install script, but was written # from scratch. +tab=' ' nl=' ' -IFS=" "" $nl" +IFS=" $tab$nl" -# set DOITPROG to echo to test this script +# Set DOITPROG to "echo" to test this script. -# Don't use :- since 4.3BSD and earlier shells don't like it. doit=${DOITPROG-} -if test -z "$doit"; then - doit_exec=exec -else - doit_exec=$doit -fi +doit_exec=${doit:-exec} # Put in absolute file names if you don't have them in your path; # or use environment vars. @@ -68,17 +64,6 @@ mvprog=${MVPROG-mv} rmprog=${RMPROG-rm} stripprog=${STRIPPROG-strip} -posix_glob='?' -initialize_posix_glob=' - test "$posix_glob" != "?" || { - if (set -f) 2>/dev/null; then - posix_glob= - else - posix_glob=: - fi - } -' - posix_mkdir= # Desired mode of installed file. @@ -97,7 +82,7 @@ dir_arg= dst_arg= copy_on_change=false -no_target_directory= +is_target_a_directory=possibly usage="\ Usage: $0 [OPTION]... [-T] SRCFILE DSTFILE @@ -137,46 +122,57 @@ while test $# -ne 0; do -d) dir_arg=true;; -g) chgrpcmd="$chgrpprog $2" - shift;; + shift;; --help) echo "$usage"; exit $?;; -m) mode=$2 - case $mode in - *' '* | *' '* | *' -'* | *'*'* | *'?'* | *'['*) - echo "$0: invalid mode: $mode" >&2 - exit 1;; - esac - shift;; + case $mode in + *' '* | *"$tab"* | *"$nl"* | *'*'* | *'?'* | *'['*) + echo "$0: invalid mode: $mode" >&2 + exit 1;; + esac + shift;; -o) chowncmd="$chownprog $2" - shift;; + shift;; -s) stripcmd=$stripprog;; - -t) dst_arg=$2 - # Protect names problematic for 'test' and other utilities. - case $dst_arg in - -* | [=\(\)!]) dst_arg=./$dst_arg;; - esac - shift;; + -t) + is_target_a_directory=always + dst_arg=$2 + # Protect names problematic for 'test' and other utilities. + case $dst_arg in + -* | [=\(\)!]) dst_arg=./$dst_arg;; + esac + shift;; - -T) no_target_directory=true;; + -T) is_target_a_directory=never;; --version) echo "$0 $scriptversion"; exit $?;; - --) shift - break;; + --) shift + break;; - -*) echo "$0: invalid option: $1" >&2 - exit 1;; + -*) echo "$0: invalid option: $1" >&2 + exit 1;; *) break;; esac shift done +# We allow the use of options -d and -T together, by making -d +# take the precedence; this is for compatibility with GNU install. + +if test -n "$dir_arg"; then + if test -n "$dst_arg"; then + echo "$0: target directory not allowed when installing a directory." >&2 + exit 1 + fi +fi + if test $# -ne 0 && test -z "$dir_arg$dst_arg"; then # When -d is used, all remaining arguments are directories to create. # When -t is used, the destination is already specified. @@ -208,6 +204,15 @@ if test $# -eq 0; then fi if test -z "$dir_arg"; then + if test $# -gt 1 || test "$is_target_a_directory" = always; then + if test ! -d "$dst_arg"; then + echo "$0: $dst_arg: Is not a directory." >&2 + exit 1 + fi + fi +fi + +if test -z "$dir_arg"; then do_exit='(exit $ret); exit $ret' trap "ret=129; $do_exit" 1 trap "ret=130; $do_exit" 2 @@ -223,16 +228,16 @@ if test -z "$dir_arg"; then *[0-7]) if test -z "$stripcmd"; then - u_plus_rw= + u_plus_rw= else - u_plus_rw='% 200' + u_plus_rw='% 200' fi cp_umask=`expr '(' 777 - $mode % 1000 ')' $u_plus_rw`;; *) if test -z "$stripcmd"; then - u_plus_rw= + u_plus_rw= else - u_plus_rw=,u+rw + u_plus_rw=,u+rw fi cp_umask=$mode$u_plus_rw;; esac @@ -269,41 +274,15 @@ do # If destination is a directory, append the input filename; won't work # if double slashes aren't ignored. if test -d "$dst"; then - if test -n "$no_target_directory"; then - echo "$0: $dst_arg: Is a directory" >&2 - exit 1 + if test "$is_target_a_directory" = never; then + echo "$0: $dst_arg: Is a directory" >&2 + exit 1 fi dstdir=$dst dst=$dstdir/`basename "$src"` dstdir_status=0 else - # Prefer dirname, but fall back on a substitute if dirname fails. - dstdir=` - (dirname "$dst") 2>/dev/null || - expr X"$dst" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ - X"$dst" : 'X\(//\)[^/]' \| \ - X"$dst" : 'X\(//\)$' \| \ - X"$dst" : 'X\(/\)' \| . 2>/dev/null || - echo X"$dst" | - sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ - s//\1/ - q - } - /^X\(\/\/\)[^/].*/{ - s//\1/ - q - } - /^X\(\/\/\)$/{ - s//\1/ - q - } - /^X\(\/\).*/{ - s//\1/ - q - } - s/.*/./; q' - ` - + dstdir=`dirname "$dst"` test -d "$dstdir" dstdir_status=$? fi @@ -314,74 +293,74 @@ do if test $dstdir_status != 0; then case $posix_mkdir in '') - # Create intermediate dirs using mode 755 as modified by the umask. - # This is like FreeBSD 'install' as of 1997-10-28. - umask=`umask` - case $stripcmd.$umask in - # Optimize common cases. - *[2367][2367]) mkdir_umask=$umask;; - .*0[02][02] | .[02][02] | .[02]) mkdir_umask=22;; - - *[0-7]) - mkdir_umask=`expr $umask + 22 \ - - $umask % 100 % 40 + $umask % 20 \ - - $umask % 10 % 4 + $umask % 2 - `;; - *) mkdir_umask=$umask,go-w;; - esac - - # With -d, create the new directory with the user-specified mode. - # Otherwise, rely on $mkdir_umask. - if test -n "$dir_arg"; then - mkdir_mode=-m$mode - else - mkdir_mode= - fi - - posix_mkdir=false - case $umask in - *[123567][0-7][0-7]) - # POSIX mkdir -p sets u+wx bits regardless of umask, which - # is incompatible with FreeBSD 'install' when (umask & 300) != 0. - ;; - *) - tmpdir=${TMPDIR-/tmp}/ins$RANDOM-$$ - trap 'ret=$?; rmdir "$tmpdir/d" "$tmpdir" 2>/dev/null; exit $ret' 0 - - if (umask $mkdir_umask && - exec $mkdirprog $mkdir_mode -p -- "$tmpdir/d") >/dev/null 2>&1 - then - if test -z "$dir_arg" || { - # Check for POSIX incompatibilities with -m. - # HP-UX 11.23 and IRIX 6.5 mkdir -m -p sets group- or - # other-writable bit of parent directory when it shouldn't. - # FreeBSD 6.1 mkdir -m -p sets mode of existing directory. - ls_ld_tmpdir=`ls -ld "$tmpdir"` - case $ls_ld_tmpdir in - d????-?r-*) different_mode=700;; - d????-?--*) different_mode=755;; - *) false;; - esac && - $mkdirprog -m$different_mode -p -- "$tmpdir" && { - ls_ld_tmpdir_1=`ls -ld "$tmpdir"` - test "$ls_ld_tmpdir" = "$ls_ld_tmpdir_1" - } - } - then posix_mkdir=: - fi - rmdir "$tmpdir/d" "$tmpdir" - else - # Remove any dirs left behind by ancient mkdir implementations. - rmdir ./$mkdir_mode ./-p ./-- 2>/dev/null - fi - trap '' 0;; - esac;; + # Create intermediate dirs using mode 755 as modified by the umask. + # This is like FreeBSD 'install' as of 1997-10-28. + umask=`umask` + case $stripcmd.$umask in + # Optimize common cases. + *[2367][2367]) mkdir_umask=$umask;; + .*0[02][02] | .[02][02] | .[02]) mkdir_umask=22;; + + *[0-7]) + mkdir_umask=`expr $umask + 22 \ + - $umask % 100 % 40 + $umask % 20 \ + - $umask % 10 % 4 + $umask % 2 + `;; + *) mkdir_umask=$umask,go-w;; + esac + + # With -d, create the new directory with the user-specified mode. + # Otherwise, rely on $mkdir_umask. + if test -n "$dir_arg"; then + mkdir_mode=-m$mode + else + mkdir_mode= + fi + + posix_mkdir=false + case $umask in + *[123567][0-7][0-7]) + # POSIX mkdir -p sets u+wx bits regardless of umask, which + # is incompatible with FreeBSD 'install' when (umask & 300) != 0. + ;; + *) + tmpdir=${TMPDIR-/tmp}/ins$RANDOM-$$ + trap 'ret=$?; rmdir "$tmpdir/d" "$tmpdir" 2>/dev/null; exit $ret' 0 + + if (umask $mkdir_umask && + exec $mkdirprog $mkdir_mode -p -- "$tmpdir/d") >/dev/null 2>&1 + then + if test -z "$dir_arg" || { + # Check for POSIX incompatibilities with -m. + # HP-UX 11.23 and IRIX 6.5 mkdir -m -p sets group- or + # other-writable bit of parent directory when it shouldn't. + # FreeBSD 6.1 mkdir -m -p sets mode of existing directory. + ls_ld_tmpdir=`ls -ld "$tmpdir"` + case $ls_ld_tmpdir in + d????-?r-*) different_mode=700;; + d????-?--*) different_mode=755;; + *) false;; + esac && + $mkdirprog -m$different_mode -p -- "$tmpdir" && { + ls_ld_tmpdir_1=`ls -ld "$tmpdir"` + test "$ls_ld_tmpdir" = "$ls_ld_tmpdir_1" + } + } + then posix_mkdir=: + fi + rmdir "$tmpdir/d" "$tmpdir" + else + # Remove any dirs left behind by ancient mkdir implementations. + rmdir ./$mkdir_mode ./-p ./-- 2>/dev/null + fi + trap '' 0;; + esac;; esac if $posix_mkdir && ( - umask $mkdir_umask && - $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir" + umask $mkdir_umask && + $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir" ) then : else @@ -391,53 +370,51 @@ do # directory the slow way, step by step, checking for races as we go. case $dstdir in - /*) prefix='/';; - [-=\(\)!]*) prefix='./';; - *) prefix='';; + /*) prefix='/';; + [-=\(\)!]*) prefix='./';; + *) prefix='';; esac - eval "$initialize_posix_glob" - oIFS=$IFS IFS=/ - $posix_glob set -f + set -f set fnord $dstdir shift - $posix_glob set +f + set +f IFS=$oIFS prefixes= for d do - test X"$d" = X && continue - - prefix=$prefix$d - if test -d "$prefix"; then - prefixes= - else - if $posix_mkdir; then - (umask=$mkdir_umask && - $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir") && break - # Don't fail if two instances are running concurrently. - test -d "$prefix" || exit 1 - else - case $prefix in - *\'*) qprefix=`echo "$prefix" | sed "s/'/'\\\\\\\\''/g"`;; - *) qprefix=$prefix;; - esac - prefixes="$prefixes '$qprefix'" - fi - fi - prefix=$prefix/ + test X"$d" = X && continue + + prefix=$prefix$d + if test -d "$prefix"; then + prefixes= + else + if $posix_mkdir; then + (umask=$mkdir_umask && + $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir") && break + # Don't fail if two instances are running concurrently. + test -d "$prefix" || exit 1 + else + case $prefix in + *\'*) qprefix=`echo "$prefix" | sed "s/'/'\\\\\\\\''/g"`;; + *) qprefix=$prefix;; + esac + prefixes="$prefixes '$qprefix'" + fi + fi + prefix=$prefix/ done if test -n "$prefixes"; then - # Don't fail if two instances are running concurrently. - (umask $mkdir_umask && - eval "\$doit_exec \$mkdirprog $prefixes") || - test -d "$dstdir" || exit 1 - obsolete_mkdir_used=true + # Don't fail if two instances are running concurrently. + (umask $mkdir_umask && + eval "\$doit_exec \$mkdirprog $prefixes") || + test -d "$dstdir" || exit 1 + obsolete_mkdir_used=true fi fi fi @@ -472,15 +449,12 @@ do # If -C, don't bother to copy if it wouldn't change the file. if $copy_on_change && - old=`LC_ALL=C ls -dlL "$dst" 2>/dev/null` && - new=`LC_ALL=C ls -dlL "$dsttmp" 2>/dev/null` && - - eval "$initialize_posix_glob" && - $posix_glob set -f && + old=`LC_ALL=C ls -dlL "$dst" 2>/dev/null` && + new=`LC_ALL=C ls -dlL "$dsttmp" 2>/dev/null` && + set -f && set X $old && old=:$2:$4:$5:$6 && set X $new && new=:$2:$4:$5:$6 && - $posix_glob set +f && - + set +f && test "$old" = "$new" && $cmpprog "$dst" "$dsttmp" >/dev/null 2>&1 then @@ -493,24 +467,24 @@ do # to itself, or perhaps because mv is so ancient that it does not # support -f. { - # Now remove or move aside any old file at destination location. - # We try this two ways since rm can't unlink itself on some - # systems and the destination file might be busy for other - # reasons. In this case, the final cleanup might fail but the new - # file should still install successfully. - { - test ! -f "$dst" || - $doit $rmcmd -f "$dst" 2>/dev/null || - { $doit $mvcmd -f "$dst" "$rmtmp" 2>/dev/null && - { $doit $rmcmd -f "$rmtmp" 2>/dev/null; :; } - } || - { echo "$0: cannot unlink or rename $dst" >&2 - (exit 1); exit 1 - } - } && - - # Now rename the file to the real destination. - $doit $mvcmd "$dsttmp" "$dst" + # Now remove or move aside any old file at destination location. + # We try this two ways since rm can't unlink itself on some + # systems and the destination file might be busy for other + # reasons. In this case, the final cleanup might fail but the new + # file should still install successfully. + { + test ! -f "$dst" || + $doit $rmcmd -f "$dst" 2>/dev/null || + { $doit $mvcmd -f "$dst" "$rmtmp" 2>/dev/null && + { $doit $rmcmd -f "$rmtmp" 2>/dev/null; :; } + } || + { echo "$0: cannot unlink or rename $dst" >&2 + (exit 1); exit 1 + } + } && + + # Now rename the file to the real destination. + $doit $mvcmd "$dsttmp" "$dst" } fi || exit 1 diff --git a/ldap/include/ldaplog.h b/ldap/include/ldaplog.h deleted file mode 100644 index 1593b6b..0000000 --- a/ldap/include/ldaplog.h +++ /dev/null @@ -1,100 +0,0 @@ -/** BEGIN COPYRIGHT BLOCK - * Copyright (C) 2001 Sun Microsystems, Inc. Used by permission. - * Copyright (C) 2005 Red Hat, Inc. - * All rights reserved. - * - * License: GPL (version 3 or any later version). - * See LICENSE for details. - * END COPYRIGHT BLOCK **/ - -#ifdef HAVE_CONFIG_H -# include -#endif - -#ifndef _LDAPLOG_H -#define _LDAPLOG_H - -#ifdef __cplusplus -extern "C" { -#endif - -#define LDAP_DEBUG_TRACE 0x00000001 /* 1 */ -#define LDAP_DEBUG_PACKETS 0x00000002 /* 2 */ -#define LDAP_DEBUG_ARGS 0x00000004 /* 4 */ -#define LDAP_DEBUG_CONNS 0x00000008 /* 8 */ -#define LDAP_DEBUG_BER 0x00000010 /* 16 */ -#define LDAP_DEBUG_FILTER 0x00000020 /* 32 */ -#define LDAP_DEBUG_CONFIG 0x00000040 /* 64 */ -#define LDAP_DEBUG_ACL 0x00000080 /* 128 */ -#define LDAP_DEBUG_STATS 0x00000100 /* 256 */ -#define LDAP_DEBUG_STATS2 0x00000200 /* 512 */ -#define LDAP_DEBUG_SHELL 0x00000400 /* 1024 */ -#define LDAP_DEBUG_PARSE 0x00000800 /* 2048 */ -#define LDAP_DEBUG_HOUSE 0x00001000 /* 4096 */ -#define LDAP_DEBUG_REPL 0x00002000 /* 8192 */ -#define LDAP_DEBUG_ANY 0x00004000 /* 16384 */ -#define LDAP_DEBUG_CACHE 0x00008000 /* 32768 */ -#define LDAP_DEBUG_PLUGIN 0x00010000 /* 65536 */ -#define LDAP_DEBUG_TIMING 0x00020000 /* 131072 */ -#define LDAP_DEBUG_ACLSUMMARY 0x00040000 /* 262144 */ -#define LDAP_DEBUG_BACKLDBM 0x00080000 /* 524288 */ -#define LDAP_DEBUG_NUNCSTANS 0x00100000 /* 1048576 */ -#define LDAP_DEBUG_EMERG 0x00200000 /* 2097152 */ -#define LDAP_DEBUG_ALERT 0x00400000 /* 4194304 */ -#define LDAP_DEBUG_CRIT 0x00800000 /* 8388608 */ -#define LDAP_DEBUG_ERR 0x01000000 /* 16777216 */ -#define LDAP_DEBUG_WARNING 0x02000000 /* 33554432 */ -#define LDAP_DEBUG_NOTICE 0x04000000 /* 67108864 */ -#define LDAP_DEBUG_INFO 0x08000000 /* 134217728 */ -#define LDAP_DEBUG_DEBUG 0x10000000 /* 268435456 */ - -#define LDAP_DEBUG_ALL_LEVELS 0xFFFFFF - -/* debugging stuff */ -/* Disable by default */ -#define LDAPDebug( level, fmt, arg1, arg2, arg3 ) -#define LDAPDebugLevelIsSet( level ) (0) -#define LDAPDebug0Args( level, fmt ) -#define LDAPDebug1Arg( level, fmt, arg ) -#define LDAPDebug2Args( level, fmt, arg1, arg2 ) - -#ifdef LDAP_DEBUG -# undef LDAPDebug -# undef LDAPDebug0Args -# undef LDAPDebug1Arg -# undef LDAPDebug2Args -# undef LDAPDebugLevelIsSet - - extern int slapd_ldap_debug; -# define LDAPDebug( level, fmt, arg1, arg2, arg3 ) \ - { \ - if ( slapd_ldap_debug & level ) { \ - slapd_log_error_proc( level, NULL, fmt, arg1, arg2, arg3 ); \ - } \ - } -# define LDAPDebug0Args( level, fmt ) \ - { \ - if ( slapd_ldap_debug & level ) { \ - slapd_log_error_proc( level, NULL, fmt ); \ - } \ - } -# define LDAPDebug1Arg( level, fmt, arg ) \ - { \ - if ( slapd_ldap_debug & level ) { \ - slapd_log_error_proc( level, NULL, fmt, arg ); \ - } \ - } -# define LDAPDebug2Args( level, fmt, arg1, arg2 ) \ - { \ - if ( slapd_ldap_debug & level ) { \ - slapd_log_error_proc( level, NULL, fmt, arg1, arg2 ); \ - } \ - } -# define LDAPDebugLevelIsSet( level ) (0 != (slapd_ldap_debug & level)) -#endif /* LDAP_DEBUG */ - -#ifdef __cplusplus -} -#endif - -#endif /* _LDAP_H */ diff --git a/ldap/servers/plugins/acct_usability/acct_usability.c b/ldap/servers/plugins/acct_usability/acct_usability.c index 1f958a5..d320fce 100644 --- a/ldap/servers/plugins/acct_usability/acct_usability.c +++ b/ldap/servers/plugins/acct_usability/acct_usability.c @@ -79,7 +79,7 @@ auc_init(Slapi_PBlock *pb) int status = 0; char *plugin_identity = NULL; - slapi_log_error(SLAPI_LOG_TRACE, AUC_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_TRACE, AUC_PLUGIN_SUBSYSTEM, "--> auc_init\n"); /* Store the plugin identity for later use. @@ -102,7 +102,7 @@ auc_init(Slapi_PBlock *pb) slapi_pblock_set(pb, SLAPI_PLUGIN_PRE_ENTRY_FN, (void *) auc_pre_entry) != 0 ) { - slapi_log_error(SLAPI_LOG_ERR, AUC_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_ERR, AUC_PLUGIN_SUBSYSTEM, "auc_init - Failed to register plugin\n"); status = -1; } @@ -111,7 +111,7 @@ auc_init(Slapi_PBlock *pb) slapi_register_supported_control(AUC_OID, SLAPI_OPERATION_SEARCH); } - slapi_log_error(SLAPI_LOG_TRACE, AUC_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_TRACE, AUC_PLUGIN_SUBSYSTEM, "<-- auc_init\n"); return status; } @@ -123,13 +123,13 @@ auc_init(Slapi_PBlock *pb) static int auc_start(Slapi_PBlock * pb) { - slapi_log_error(SLAPI_LOG_TRACE, AUC_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_TRACE, AUC_PLUGIN_SUBSYSTEM, "--> auc_start\n"); - slapi_log_error(SLAPI_LOG_PLUGIN, AUC_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_PLUGIN, AUC_PLUGIN_SUBSYSTEM, "auc_start - Account usability control plug-in: ready for service\n"); - slapi_log_error(SLAPI_LOG_TRACE, AUC_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_TRACE, AUC_PLUGIN_SUBSYSTEM, "<-- auc_start\n"); return 0; @@ -141,10 +141,10 @@ auc_start(Slapi_PBlock * pb) static int auc_close(Slapi_PBlock * pb) { - slapi_log_error(SLAPI_LOG_TRACE, AUC_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_TRACE, AUC_PLUGIN_SUBSYSTEM, "--> auc_close\n"); - slapi_log_error(SLAPI_LOG_TRACE, AUC_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_TRACE, AUC_PLUGIN_SUBSYSTEM, "<-- auc_close\n"); return 0; @@ -200,7 +200,7 @@ static LDAPControl *auc_create_response_ctrl(Slapi_Entry *e) time_t now = slapi_current_time(); if (!e) { - slapi_log_error(SLAPI_LOG_PLUGIN, AUC_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_PLUGIN, AUC_PLUGIN_SUBSYSTEM, "auc_create_response_ctrl - NULL entry specified.\n"); goto bail; } @@ -281,7 +281,7 @@ auc_pre_search(Slapi_PBlock *pb) int isroot = 0; int ii; - slapi_log_error(SLAPI_LOG_TRACE, AUC_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_TRACE, AUC_PLUGIN_SUBSYSTEM, "--> auc_pre_search\n"); /* See if the requestor is the root DN. */ @@ -294,14 +294,14 @@ auc_pre_search(Slapi_PBlock *pb) const LDAPControl *ctrl = reqctrls[ii]; if (!strcmp(ctrl->ldctl_oid, AUC_OID)) { if (aucctrl) { /* already specified */ - slapi_log_error(SLAPI_LOG_ERR, AUC_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_ERR, AUC_PLUGIN_SUBSYSTEM, "auc_pre_search - The account usability control was specified more than " "once - it must be specified only once in the search request\n"); ldapcode = LDAP_PROTOCOL_ERROR; ldaperrtext = "The account usability control cannot be specified more than once"; aucctrl = NULL; } else if (ctrl->ldctl_value.bv_len > 0) { - slapi_log_error(SLAPI_LOG_ERR, AUC_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_ERR, AUC_PLUGIN_SUBSYSTEM, "Non-null control value specified for account usability control\n"); ldapcode = LDAP_PROTOCOL_ERROR; ldaperrtext = "The account usability control must not have a value"; @@ -314,7 +314,7 @@ auc_pre_search(Slapi_PBlock *pb) } if (aucctrl && incompatible) { - slapi_log_error(SLAPI_LOG_ERR, AUC_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_ERR, AUC_PLUGIN_SUBSYSTEM, "auc_pre_search - Cannot use the account usability control and control " "[%s] for the same search operation\n", incompatible); /* not sure if this is a hard failure - the current spec says: @@ -362,7 +362,7 @@ auc_pre_search(Slapi_PBlock *pb) slapi_send_ldap_result(pb, ldapcode, NULL, (char *)ldaperrtext, 0, NULL); } - slapi_log_error(SLAPI_LOG_TRACE, AUC_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_TRACE, AUC_PLUGIN_SUBSYSTEM, "<-- auc_pre_op\n"); return ldapcode; @@ -394,7 +394,7 @@ auc_pre_entry(Slapi_PBlock *pb) /* grab the entry to be returned */ slapi_pblock_get(pb, SLAPI_SEARCH_ENTRY_ORIG, &e); if (!e) { - slapi_log_error(SLAPI_LOG_ERR, AUC_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_ERR, AUC_PLUGIN_SUBSYSTEM, "auc_pre_entry - Unable to fetch entry.\n"); goto bail; } @@ -402,7 +402,7 @@ auc_pre_entry(Slapi_PBlock *pb) /* create the respose control */ ctrl = auc_create_response_ctrl(e); if (!ctrl) { - slapi_log_error(SLAPI_LOG_ERR, AUC_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_ERR, AUC_PLUGIN_SUBSYSTEM, "auc_pre_entry - Error creating response control for entry \"%s\".\n", slapi_entry_get_ndn(e) ? slapi_entry_get_ndn(e) : "null"); goto bail; diff --git a/ldap/servers/plugins/acctpolicy/acct_config.c b/ldap/servers/plugins/acctpolicy/acct_config.c index 226d8ac..175c714 100644 --- a/ldap/servers/plugins/acctpolicy/acct_config.c +++ b/ldap/servers/plugins/acctpolicy/acct_config.c @@ -48,7 +48,7 @@ acct_policy_load_config_startup( Slapi_PBlock* pb, void* plugin_id ) { slapi_sdn_free( &config_sdn ); if( rc != LDAP_SUCCESS || config_entry == NULL ) { - slapi_log_error(SLAPI_LOG_ERR, PLUGIN_NAME, + slapi_log_err(SLAPI_LOG_ERR, PLUGIN_NAME, "acct_policy_load_config_startup - Failed to retrieve configuration entry %s: %d\n", PLUGIN_CONFIG_DN, rc ); return( -1 ); @@ -74,7 +74,7 @@ acct_policy_entry2config( Slapi_Entry *e, acctPluginCfg *newcfg ) { int rc = 0; if( newcfg == NULL ) { - slapi_log_error(SLAPI_LOG_ERR, PLUGIN_NAME, + slapi_log_err(SLAPI_LOG_ERR, PLUGIN_NAME, "acct_policy_entry2config - Failed to allocate configuration structure\n" ); return( -1 ); } @@ -86,7 +86,7 @@ acct_policy_entry2config( Slapi_Entry *e, acctPluginCfg *newcfg ) { newcfg->state_attr_name = slapi_ch_strdup( DEFAULT_LASTLOGIN_STATE_ATTR ); } else if (!update_is_allowed_attr(newcfg->state_attr_name)) { /* log a warning that this attribute cannot be updated */ - slapi_log_error(SLAPI_LOG_ERR, PLUGIN_NAME, + slapi_log_err(SLAPI_LOG_ERR, PLUGIN_NAME, "acct_policy_entry2config - The configured state attribute [%s] cannot be updated, accounts will always become inactive.\n", newcfg->state_attr_name ); } @@ -139,7 +139,7 @@ acct_policy_entry2config( Slapi_Entry *e, acctPluginCfg *newcfg ) { char *endptr = NULL; newcfg->inactivitylimit = strtoul(config_val, &endptr, 10); if (endptr && (*endptr != '\0')) { - slapi_log_error(SLAPI_LOG_ERR, PLUGIN_NAME, + slapi_log_err(SLAPI_LOG_ERR, PLUGIN_NAME, "acct_policy_entry2config - Failed to parse [%s] from the config entry: [%s] is not a valid unsigned long value\n", newcfg->limit_attr_name, config_val ); diff --git a/ldap/servers/plugins/acctpolicy/acct_init.c b/ldap/servers/plugins/acctpolicy/acct_init.c index 81ee6fa..ab62730 100644 --- a/ldap/servers/plugins/acctpolicy/acct_init.c +++ b/ldap/servers/plugins/acctpolicy/acct_init.c @@ -129,13 +129,13 @@ acct_policy_init( Slapi_PBlock *pb ) (void *)&acct_policy_close ) != 0 || slapi_pblock_set( pb, SLAPI_PLUGIN_START_FN, (void *)acct_policy_start ) != 0 ) { - slapi_log_error(SLAPI_LOG_ERR, PLUGIN_NAME, + slapi_log_err(SLAPI_LOG_ERR, PLUGIN_NAME, "acct_policy_init - Registration failed\n" ); return( CALLBACK_ERR ); } if( slapi_pblock_get( pb, SLAPI_PLUGIN_IDENTITY, &plugin_id ) != 0 ) { - slapi_log_error(SLAPI_LOG_ERR, PLUGIN_NAME, + slapi_log_err(SLAPI_LOG_ERR, PLUGIN_NAME, "acct_policy_init - Failed to get plugin identity\n" ); return( CALLBACK_ERR ); } @@ -147,7 +147,7 @@ acct_policy_init( Slapi_PBlock *pb ) acct_preop_init, PRE_PLUGIN_DESC, NULL, plugin_id) != 0 || slapi_register_plugin("postoperation", 1, "acct_postop_init", acct_postop_init, POST_PLUGIN_DESC, NULL, plugin_id) != 0 ) { - slapi_log_error(SLAPI_LOG_ERR, PLUGIN_NAME, + slapi_log_err(SLAPI_LOG_ERR, PLUGIN_NAME, "acct_policy_init - Failed to register callbacks\n" ); return( CALLBACK_ERR ); } @@ -189,14 +189,14 @@ acct_policy_start( Slapi_PBlock *pb ) /* Load plugin configuration */ if( acct_policy_load_config_startup( pb, plugin_id ) ) { - slapi_log_error(SLAPI_LOG_ERR, PLUGIN_NAME, + slapi_log_err(SLAPI_LOG_ERR, PLUGIN_NAME, "acct_policy_start failed to load configuration\n" ); return( CALLBACK_ERR ); } /* Show the configuration */ cfg = get_config(); - slapi_log_error(SLAPI_LOG_PLUGIN, PLUGIN_NAME, "acct_policy_start - config: " + slapi_log_err(SLAPI_LOG_PLUGIN, PLUGIN_NAME, "acct_policy_start - config: " "stateAttrName=%s altStateAttrName=%s specAttrName=%s limitAttrName=%s " "alwaysRecordLogin=%d\n", cfg->state_attr_name, cfg->alt_state_attr_name?cfg->alt_state_attr_name:"not configured", cfg->spec_attr_name, @@ -226,7 +226,7 @@ acct_preop_init( Slapi_PBlock *pb ) { SLAPI_PLUGIN_VERSION_01 ) != 0 || slapi_pblock_set( pb, SLAPI_PLUGIN_DESCRIPTION, (void *)&pre_plugin_desc ) != 0 ) { - slapi_log_error(SLAPI_LOG_ERR, PRE_PLUGIN_NAME, + slapi_log_err(SLAPI_LOG_ERR, PRE_PLUGIN_NAME, "Failed to set plugin version or description\n" ); return( CALLBACK_ERR ); } @@ -236,7 +236,7 @@ acct_preop_init( Slapi_PBlock *pb ) { slapi_pblock_set(pb, SLAPI_PLUGIN_PRE_MODIFY_FN, (void *) acct_mod_pre_op) != 0 || slapi_pblock_set(pb, SLAPI_PLUGIN_PRE_DELETE_FN, (void *) acct_del_pre_op) != 0) { - slapi_log_error(SLAPI_LOG_ERR, PRE_PLUGIN_NAME, + slapi_log_err(SLAPI_LOG_ERR, PRE_PLUGIN_NAME, "acct_preop_init - Failed to set plugin callback function\n" ); return( CALLBACK_ERR ); } @@ -253,7 +253,7 @@ acct_postop_init( Slapi_PBlock *pb ) SLAPI_PLUGIN_VERSION_01 ) != 0 || slapi_pblock_set( pb, SLAPI_PLUGIN_DESCRIPTION, (void *)&post_plugin_desc ) != 0 ) { - slapi_log_error(SLAPI_LOG_ERR, POST_PLUGIN_NAME, + slapi_log_err(SLAPI_LOG_ERR, POST_PLUGIN_NAME, "acct_postop_init - Failed to set plugin version or name\n" ); return( CALLBACK_ERR ); } @@ -263,13 +263,13 @@ acct_postop_init( Slapi_PBlock *pb ) slapi_pblock_set(pb, SLAPI_PLUGIN_POST_ADD_FN, (void *) acct_post_op) != 0 || slapi_pblock_set(pb, SLAPI_PLUGIN_POST_MODIFY_FN, (void *) acct_post_op) != 0) { - slapi_log_error(SLAPI_LOG_ERR, POST_PLUGIN_NAME, + slapi_log_err(SLAPI_LOG_ERR, POST_PLUGIN_NAME, "acct_postop_init - Failed to set plugin callback function\n" ); return( CALLBACK_ERR ); } if( slapi_pblock_get( pb, SLAPI_PLUGIN_IDENTITY, &plugin_id ) != 0 ) { - slapi_log_error(SLAPI_LOG_ERR, POST_PLUGIN_NAME, + slapi_log_err(SLAPI_LOG_ERR, POST_PLUGIN_NAME, "acct_postop_init - Failed to get plugin identity\n" ); return( CALLBACK_ERR ); } diff --git a/ldap/servers/plugins/acctpolicy/acct_plugin.c b/ldap/servers/plugins/acctpolicy/acct_plugin.c index a40c80f..00a95a2 100644 --- a/ldap/servers/plugins/acctpolicy/acct_plugin.c +++ b/ldap/servers/plugins/acctpolicy/acct_plugin.c @@ -37,7 +37,7 @@ acct_policy_dn_is_config(Slapi_DN *sdn) { int ret = 0; - slapi_log_error(SLAPI_LOG_TRACE, PLUGIN_NAME, + slapi_log_err(SLAPI_LOG_TRACE, PLUGIN_NAME, "--> acct_policy_dn_is_config\n"); if (sdn == NULL) { @@ -61,7 +61,7 @@ acct_policy_dn_is_config(Slapi_DN *sdn) } bail: - slapi_log_error(SLAPI_LOG_TRACE, PLUGIN_NAME, + slapi_log_err(SLAPI_LOG_TRACE, PLUGIN_NAME, "<-- acct_policy_dn_is_config\n"); return ret; @@ -83,17 +83,17 @@ acct_inact_limit( Slapi_PBlock *pb, const char *dn, Slapi_Entry *target_entry, a cfg = get_config(); if( ( lasttimestr = get_attr_string_val( target_entry, cfg->state_attr_name ) ) != NULL ) { - slapi_log_error(SLAPI_LOG_PLUGIN, PRE_PLUGIN_NAME, + slapi_log_err(SLAPI_LOG_PLUGIN, PRE_PLUGIN_NAME, "acct_inact_limit - \"%s\" login timestamp is %s\n", dn, lasttimestr ); } else if( cfg->alt_state_attr_name && (( lasttimestr = get_attr_string_val( target_entry, cfg->alt_state_attr_name ) ) != NULL) ) { - slapi_log_error(SLAPI_LOG_PLUGIN, PRE_PLUGIN_NAME, + slapi_log_err(SLAPI_LOG_PLUGIN, PRE_PLUGIN_NAME, "acct_inact_limit - \"%s\" alternate timestamp is %s\n", dn, lasttimestr ); } else { /* the primary or alternate attribute might not yet exist eg. * if only lastlogintime is specified and it id the first login */ - slapi_log_error(SLAPI_LOG_PLUGIN, PRE_PLUGIN_NAME, + slapi_log_err(SLAPI_LOG_PLUGIN, PRE_PLUGIN_NAME, "acct_inact_limit - \"%s\" has no value for stateattr or altstateattr \n", dn ); goto done; } @@ -104,13 +104,13 @@ acct_inact_limit( Slapi_PBlock *pb, const char *dn, Slapi_Entry *target_entry, a /* Finally do the time comparison */ if( cur_t > last_t + lim_t ) { - slapi_log_error(SLAPI_LOG_PLUGIN, PRE_PLUGIN_NAME, + slapi_log_err(SLAPI_LOG_PLUGIN, PRE_PLUGIN_NAME, "acct_inact_limit - \"%s\" has exceeded inactivity limit (%ld > (%ld + %ld))\n", dn, cur_t, last_t, lim_t ); rc = 1; goto done; } else { - slapi_log_error(SLAPI_LOG_PLUGIN, PRE_PLUGIN_NAME, + slapi_log_err(SLAPI_LOG_PLUGIN, PRE_PLUGIN_NAME, "acct_inact_limit - \"%s\" is within inactivity limit (%ld < (%ld + %ld))\n", dn, cur_t, last_t, lim_t ); } @@ -184,13 +184,13 @@ acct_record_login( const char *dn ) slapi_pblock_get( modpb, SLAPI_PLUGIN_INTOP_RESULT, &ldrc ); if (ldrc != LDAP_SUCCESS) { - slapi_log_error(SLAPI_LOG_ERR, POST_PLUGIN_NAME, + slapi_log_err(SLAPI_LOG_ERR, POST_PLUGIN_NAME, "acct_record_login - Recording %s=%s failed on \"%s\" err=%d\n", cfg->always_record_login_attr, timestr, dn, ldrc ); rc = -1; goto done; } else { - slapi_log_error(SLAPI_LOG_PLUGIN, POST_PLUGIN_NAME, + slapi_log_err(SLAPI_LOG_PLUGIN, POST_PLUGIN_NAME, "acct_record_login - Recorded %s=%s on \"%s\"\n", cfg->always_record_login_attr, timestr, dn ); } @@ -216,14 +216,14 @@ acct_bind_preop( Slapi_PBlock *pb ) acctPolicy *policy = NULL; void *plugin_id; - slapi_log_error(SLAPI_LOG_PLUGIN, PRE_PLUGIN_NAME, + slapi_log_err(SLAPI_LOG_PLUGIN, PRE_PLUGIN_NAME, "=> acct_bind_preop\n" ); plugin_id = get_identity(); /* This does not give a copy, so don't free it */ if( slapi_pblock_get( pb, SLAPI_BIND_TARGET_SDN, &sdn ) != 0 ) { - slapi_log_error(SLAPI_LOG_ERR, PRE_PLUGIN_NAME, + slapi_log_err(SLAPI_LOG_ERR, PRE_PLUGIN_NAME, "acct_bind_preop - Error retrieving target DN\n" ); rc = -1; goto done; @@ -242,7 +242,7 @@ acct_bind_preop( Slapi_PBlock *pb ) if( ldrc != LDAP_SUCCESS ) { if( ldrc != LDAP_NO_SUCH_OBJECT ) { /* The problem is not a bad bind or virtual entry; halt bind */ - slapi_log_error(SLAPI_LOG_ERR, PRE_PLUGIN_NAME, + slapi_log_err(SLAPI_LOG_ERR, PRE_PLUGIN_NAME, "acct_bind_preop - Failed to retrieve entry \"%s\": %d\n", dn, ldrc ); rc = -1; } @@ -250,7 +250,7 @@ acct_bind_preop( Slapi_PBlock *pb ) } if( get_acctpolicy( pb, target_entry, plugin_id, &policy ) ) { - slapi_log_error(SLAPI_LOG_ERR, PRE_PLUGIN_NAME, + slapi_log_err(SLAPI_LOG_ERR, PRE_PLUGIN_NAME, "acct_bind_preop - Account Policy object for \"%s\" is missing\n", dn ); rc = -1; goto done; @@ -258,7 +258,7 @@ acct_bind_preop( Slapi_PBlock *pb ) /* Null policy means target isnt's under the influence of a policy */ if( policy == NULL ) { - slapi_log_error(SLAPI_LOG_PLUGIN, PRE_PLUGIN_NAME, + slapi_log_err(SLAPI_LOG_PLUGIN, PRE_PLUGIN_NAME, "acct_bind_preop - \"%s\" is not governed by an account policy\n", dn); goto done; } @@ -278,7 +278,7 @@ done: free_acctpolicy( &policy ); - slapi_log_error(SLAPI_LOG_PLUGIN, PRE_PLUGIN_NAME, + slapi_log_err(SLAPI_LOG_PLUGIN, PRE_PLUGIN_NAME, "<= acct_bind_preop\n" ); return( rc == 0 ? CALLBACK_OK : CALLBACK_ERR ); @@ -300,14 +300,14 @@ acct_bind_postop( Slapi_PBlock *pb ) acctPluginCfg *cfg; void *plugin_id; - slapi_log_error(SLAPI_LOG_PLUGIN, POST_PLUGIN_NAME, + slapi_log_err(SLAPI_LOG_PLUGIN, POST_PLUGIN_NAME, "=> acct_bind_postop\n" ); plugin_id = get_identity(); /* Retrieving SLAPI_CONN_DN from the pb gives a copy */ if( slapi_pblock_get( pb, SLAPI_CONN_DN, &dn ) != 0 ) { - slapi_log_error(SLAPI_LOG_ERR, POST_PLUGIN_NAME, + slapi_log_err(SLAPI_LOG_ERR, POST_PLUGIN_NAME, "acct_bind_postop - Error retrieving bind DN\n" ); rc = -1; goto done; @@ -330,7 +330,7 @@ acct_bind_postop( Slapi_PBlock *pb ) plugin_id ); if( ldrc != LDAP_SUCCESS ) { - slapi_log_error(SLAPI_LOG_ERR, POST_PLUGIN_NAME, + slapi_log_err(SLAPI_LOG_ERR, POST_PLUGIN_NAME, "acct_bind_postop - Failed to retrieve entry \"%s\": %d\n", dn, ldrc ); rc = -1; goto done; @@ -360,7 +360,7 @@ done: slapi_ch_free_string( &dn ); - slapi_log_error(SLAPI_LOG_PLUGIN, POST_PLUGIN_NAME, + slapi_log_err(SLAPI_LOG_PLUGIN, POST_PLUGIN_NAME, "<= acct_bind_postop\n" ); return( rc == 0 ? CALLBACK_OK : CALLBACK_ERR ); @@ -376,7 +376,7 @@ static int acct_pre_op( Slapi_PBlock *pb, int modop ) char *errstr = NULL; int ret = SLAPI_PLUGIN_SUCCESS; - slapi_log_error(SLAPI_LOG_TRACE, PRE_PLUGIN_NAME, "--> acct_pre_op\n"); + slapi_log_err(SLAPI_LOG_TRACE, PRE_PLUGIN_NAME, "--> acct_pre_op\n"); slapi_pblock_get(pb, SLAPI_TARGET_SDN, &sdn); @@ -421,7 +421,7 @@ static int acct_pre_op( Slapi_PBlock *pb, int modop ) } } else if (modop == LDAP_CHANGETYPE_DELETE){ ret = LDAP_UNWILLING_TO_PERFORM; - slapi_log_error(SLAPI_LOG_ERR, PRE_PLUGIN_NAME, + slapi_log_err(SLAPI_LOG_ERR, PRE_PLUGIN_NAME, "acct_pre_op - Can not delete plugin config entry [%d]\n", ret); } else { errstr = slapi_ch_smprintf("acct_pre_op - Invalid op type %d", modop); @@ -441,7 +441,7 @@ static int acct_pre_op( Slapi_PBlock *pb, int modop ) slapi_entry_free(e); if (ret) { - slapi_log_error(SLAPI_LOG_PLUGIN, PRE_PLUGIN_NAME, + slapi_log_err(SLAPI_LOG_PLUGIN, PRE_PLUGIN_NAME, "acct_pre_op - Operation failure [%d]\n", ret); slapi_send_ldap_result(pb, ret, NULL, errstr, 0, NULL); slapi_ch_free((void **)&errstr); @@ -449,7 +449,7 @@ static int acct_pre_op( Slapi_PBlock *pb, int modop ) ret = SLAPI_PLUGIN_FAILURE; } - slapi_log_error(SLAPI_LOG_TRACE, PRE_PLUGIN_NAME, "<-- acct_pre_op\n"); + slapi_log_err(SLAPI_LOG_TRACE, PRE_PLUGIN_NAME, "<-- acct_pre_op\n"); return ret; } @@ -477,19 +477,19 @@ acct_post_op(Slapi_PBlock *pb) { Slapi_DN *sdn = NULL; - slapi_log_error(SLAPI_LOG_TRACE, POST_PLUGIN_NAME, + slapi_log_err(SLAPI_LOG_TRACE, POST_PLUGIN_NAME, "--> acct_policy_post_op\n"); slapi_pblock_get(pb, SLAPI_TARGET_SDN, &sdn); if (acct_policy_dn_is_config(sdn)){ if( acct_policy_load_config_startup( pb, get_identity() ) ) { - slapi_log_error(SLAPI_LOG_ERR, PLUGIN_NAME, + slapi_log_err(SLAPI_LOG_ERR, PLUGIN_NAME, "acct_post_op - Failed to load configuration\n" ); return( CALLBACK_ERR ); } } - slapi_log_error(SLAPI_LOG_TRACE, POST_PLUGIN_NAME, + slapi_log_err(SLAPI_LOG_TRACE, POST_PLUGIN_NAME, "<-- acct_policy_mod_post_op\n"); return SLAPI_PLUGIN_SUCCESS; diff --git a/ldap/servers/plugins/acctpolicy/acct_util.c b/ldap/servers/plugins/acctpolicy/acct_util.c index fa88b7d..918d6e7 100644 --- a/ldap/servers/plugins/acctpolicy/acct_util.c +++ b/ldap/servers/plugins/acctpolicy/acct_util.c @@ -106,13 +106,13 @@ get_acctpolicy( Slapi_PBlock *pb, Slapi_Entry *target_entry, void *plugin_id, /* Return success and NULL policy */ policy_dn = get_attr_string_val( target_entry, cfg->spec_attr_name ); if( policy_dn == NULL ) { - slapi_log_error(SLAPI_LOG_PLUGIN, PLUGIN_NAME, + slapi_log_err(SLAPI_LOG_PLUGIN, PLUGIN_NAME, "get_acctpolicy - \"%s\" is not governed by an account inactivity " "policy subentry\n", slapi_entry_get_ndn( target_entry ) ); if (cfg->inactivitylimit != ULONG_MAX) { goto dopolicy; } - slapi_log_error(SLAPI_LOG_PLUGIN, PLUGIN_NAME, + slapi_log_err(SLAPI_LOG_PLUGIN, PLUGIN_NAME, "get_acctpolicy - \"%s\" is not governed by an account inactivity " "global policy\n", slapi_entry_get_ndn( target_entry ) ); config_unlock(); @@ -127,10 +127,10 @@ get_acctpolicy( Slapi_PBlock *pb, Slapi_Entry *target_entry, void *plugin_id, /* There should be a policy but it can't be retrieved; fatal error */ if( policy_entry == NULL ) { if( ldrc != LDAP_NO_SUCH_OBJECT ) { - slapi_log_error(SLAPI_LOG_ERR, PLUGIN_NAME, + slapi_log_err(SLAPI_LOG_ERR, PLUGIN_NAME, "get_acctpolicy - Error retrieving policy entry \"%s\": %d\n", policy_dn, ldrc ); } else { - slapi_log_error(SLAPI_LOG_PLUGIN, PLUGIN_NAME, + slapi_log_err(SLAPI_LOG_PLUGIN, PLUGIN_NAME, "get_acctpolicy - Policy entry \"%s\" is missing: %d\n", policy_dn, ldrc ); } rc = -1; diff --git a/ldap/servers/plugins/acl/acl.c b/ldap/servers/plugins/acl/acl.c index 5a81d7f..0a93808 100644 --- a/ldap/servers/plugins/acl/acl.c +++ b/ldap/servers/plugins/acl/acl.c @@ -102,7 +102,7 @@ acl_access_allowed_modrdn( SLAPI_ACL_WRITE); if ( retCode != LDAP_SUCCESS ) { - slapi_log_error(SLAPI_LOG_ACL, plugin_name, + slapi_log_err(SLAPI_LOG_ACL, plugin_name, "acl_access_allowed_modrdn - Write permission to entry not allowed\n"); return(retCode); } @@ -117,7 +117,7 @@ acl_access_allowed_modrdn( retCode = check_rdn_access( pb, e, ci_newrdn, ACLPB_SLAPI_ACL_WRITE_ADD) ; slapi_ch_free_string(&ci_newrdn); if ( retCode != LDAP_SUCCESS ) { - slapi_log_error(SLAPI_LOG_ACL, plugin_name, + slapi_log_err(SLAPI_LOG_ACL, plugin_name, "acl_access_allowed_modrdn - Write permission to add new naming attribute not allowed\n"); return(retCode); } @@ -128,7 +128,7 @@ acl_access_allowed_modrdn( oldrdn = slapi_sdn_get_ndn(target_sdn); retCode = check_rdn_access( pb, e, oldrdn, ACLPB_SLAPI_ACL_WRITE_DEL) ; if ( retCode != LDAP_SUCCESS ) { - slapi_log_error(SLAPI_LOG_ACL, plugin_name, + slapi_log_err(SLAPI_LOG_ACL, plugin_name, "acl_access_allowed_modrdn - write permission to delete old naming attribute not allowed\n"); return(retCode); } @@ -158,7 +158,7 @@ check_rdn_access( Slapi_PBlock *pb, Slapi_Entry *e, const char *dn, int access) struct berval bv; if ( slapi_rdn2typeval( rdns[i], &type, &bv ) != 0 ) { - slapi_log_error(SLAPI_LOG_ACL, plugin_name, + slapi_log_err(SLAPI_LOG_ACL, plugin_name, "check_rdn_access - rdn2typeval (%s) failed\n", rdns[i]); retCode = LDAP_INSUFFICIENT_ACCESS; break; @@ -275,7 +275,7 @@ acl_access_allowed( privateBackend = slapi_be_private ( be ); if ( !privateBackend && (be_readonly || slapi_config_get_readonly () )){ - slapi_log_error(loglevel, plugin_name, + slapi_log_err(loglevel, plugin_name, "acl_access_allowed - conn=%" NSPRIu64 " op=%d (main): Deny %s on entry(%s)" ": readonly backend\n", o_connid, o_opid, @@ -288,7 +288,7 @@ acl_access_allowed( /* Check for things we need to skip */ TNF_PROBE_0_DEBUG(acl_skipaccess_start,"ACL",""); if ( acl_skip_access_check ( pb, e, access )) { - slapi_log_error(loglevel, plugin_name, + slapi_log_err(loglevel, plugin_name, "acl_access_allowed - conn=%" NSPRIu64 " op=%d (main): Allow %s on entry(%s)" ": root user\n", o_connid, o_opid, @@ -312,20 +312,20 @@ acl_access_allowed( aclpb = acl_get_aclpb ( pb, ACLPB_BINDDN_PBLOCK ); if ( !aclpb ) { - slapi_log_error (SLAPI_LOG_ERR, plugin_name, "acl_access_allowed - Missing aclpb 1 \n" ); + slapi_log_err (SLAPI_LOG_ERR, plugin_name, "acl_access_allowed - Missing aclpb 1 \n" ); ret_val = LDAP_OPERATIONS_ERROR; goto cleanup_and_ret; } if (pb != aclpb->aclpb_pblock) { - slapi_log_error(SLAPI_LOG_ERR, plugin_name, + slapi_log_err(SLAPI_LOG_ERR, plugin_name, "acl_access_allowed - Resetting aclpb_pblock %p to pblock addr %p\n", aclpb->aclpb_pblock, pb); aclpb->aclpb_pblock = pb; } if ( !aclpb->aclpb_curr_entry_sdn ) { - slapi_log_error(SLAPI_LOG_ERR ,plugin_name, "NULL aclpb_curr_entry_sdn \n" ); + slapi_log_err(SLAPI_LOG_ERR ,plugin_name, "NULL aclpb_curr_entry_sdn \n" ); ret_val = LDAP_OPERATIONS_ERROR; goto cleanup_and_ret; } @@ -381,7 +381,7 @@ acl_access_allowed( /* Convert access to string of rights eg SLAPI_ACL_ADD->"add". */ if ((right= acl_access2str(access)) == NULL) { /* ERROR: unknown rights */ - slapi_log_error(SLAPI_LOG_ACL, plugin_name, + slapi_log_err(SLAPI_LOG_ACL, plugin_name, "acl_access_allowed - Unknown rights:%d\n", access); ret_val = LDAP_OPERATIONS_ERROR; @@ -447,7 +447,7 @@ acl_access_allowed( (aclpb->aclpb_curr_entry != e) /* cannot trust the cached entry */ ) { TNF_PROBE_0_DEBUG(acl_entry_first_touch_start,"ACL",""); - slapi_log_error(loglevel, plugin_name, + slapi_log_err(loglevel, plugin_name, "acl_access_allowed - #### conn=%" NSPRIu64 " op=%d binddn=\"%s\"\n", o_connid, o_opid, clientDn); aclpb->aclpb_stat_total_entries++; @@ -513,7 +513,7 @@ acl_access_allowed( DS_ATTR_ENTRY, e, 0); if (rv < 0) { - slapi_log_error(SLAPI_LOG_ACL, plugin_name, + slapi_log_err(SLAPI_LOG_ACL, plugin_name, "acl_access_allowed - Unable to set the Slapi_Entry in the Plist\n"); ret_val = LDAP_OPERATIONS_ERROR; goto cleanup_and_ret; @@ -577,7 +577,7 @@ acl_access_allowed( goto cleanup_and_ret; } - slapi_log_error(SLAPI_LOG_ACL, plugin_name, + slapi_log_err(SLAPI_LOG_ACL, plugin_name, "acl_access_allowed - Processed attr:%s for entry:%s\n", attr ? attr : "NULL", n_edn); @@ -704,7 +704,7 @@ print_access_control_summary( char *source, int ret_val, char *clientDn, } if ( !aclpb ) { - slapi_log_error(SLAPI_LOG_ERR, plugin_name, "print_access_control_summary - Missing aclpb \n" ); + slapi_log_err(SLAPI_LOG_ERR, plugin_name, "print_access_control_summary - Missing aclpb \n" ); return; } @@ -775,7 +775,7 @@ print_access_control_summary( char *source, int ret_val, char *clientDn, slapi_sdn_get_ndn(aclpb->aclpb_authorization_sdn): null_user); if (strcasecmp(right, access_str_moddn) == 0) { - slapi_log_error(loglevel, plugin_name, "print_access_control_summary - " + slapi_log_err(loglevel, plugin_name, "print_access_control_summary - " "conn=%" NSPRIu64 " op=%d (%s): %s %s on entry(%s).attr(%s) [from %s] to proxy (%s)" ": %s\n", o_connid, o_opid, @@ -789,7 +789,7 @@ print_access_control_summary( char *source, int ret_val, char *clientDn, acl_info[0] ? acl_info : access_reason); } else { - slapi_log_error(loglevel, plugin_name, + slapi_log_err(loglevel, plugin_name, "print_access_control_summary - conn=%" NSPRIu64 " op=%d (%s): %s %s on entry(%s).attr(%s) to proxy (%s)" ": %s\n", o_connid, o_opid, @@ -804,7 +804,7 @@ print_access_control_summary( char *source, int ret_val, char *clientDn, } else { proxy_user = null_user; if (strcasecmp(right, access_str_moddn) == 0) { - slapi_log_error(loglevel, plugin_name, + slapi_log_err(loglevel, plugin_name, "print_access_control_summary - conn=%" NSPRIu64 " op=%d (%s): %s %s on entry(%s).attr(%s) [from %s] to proxy (%s)" ": %s\n", o_connid, o_opid, @@ -818,7 +818,7 @@ print_access_control_summary( char *source, int ret_val, char *clientDn, acl_info[0] ? acl_info : access_reason); } else { - slapi_log_error(loglevel, plugin_name, + slapi_log_err(loglevel, plugin_name, "print_access_control_summary - conn=%" NSPRIu64 " op=%d (%s): %s %s on entry(%s).attr(%s) to proxy (%s)" ": %s\n", o_connid, o_opid, @@ -833,7 +833,7 @@ print_access_control_summary( char *source, int ret_val, char *clientDn, } } else { if (strcasecmp(right, access_str_moddn) == 0) { - slapi_log_error(loglevel, plugin_name, + slapi_log_err(loglevel, plugin_name, "print_access_control_summary - conn=%" NSPRIu64 " op=%d (%s): %s %s on entry(%s).attr(%s) [from %s] to %s" ": %s\n", o_connid, o_opid, @@ -847,7 +847,7 @@ print_access_control_summary( char *source, int ret_val, char *clientDn, acl_info[0] ? acl_info : access_reason); } else { - slapi_log_error(loglevel, plugin_name, + slapi_log_err(loglevel, plugin_name, "print_access_control_summary - conn=%" NSPRIu64 " op=%d (%s): %s %s on entry(%s).attr(%s) to %s" ": %s\n", o_connid, o_opid, @@ -923,7 +923,7 @@ acl_read_access_allowed_on_entry ( */ if ( acl_skip_access_check ( pb, e, access ) ) { char *n_edn = slapi_entry_get_ndn ( e ); - slapi_log_error(SLAPI_LOG_ACL, plugin_name, + slapi_log_err(SLAPI_LOG_ACL, plugin_name, "acl_read_access_allowed_on_entry - Root access (%s) allowed on entry(%s)\n", acl_access2str(access), n_edn); @@ -934,14 +934,14 @@ acl_read_access_allowed_on_entry ( aclpb = acl_get_aclpb ( pb, ACLPB_BINDDN_PBLOCK ); if ( !aclpb ) { - slapi_log_error(SLAPI_LOG_ERR, plugin_name, "acl_read_access_allowed_on_entry - Missing aclpb 2 \n" ); + slapi_log_err(SLAPI_LOG_ERR, plugin_name, "acl_read_access_allowed_on_entry - Missing aclpb 2 \n" ); TNF_PROBE_1_DEBUG(acl_read_access_allowed_on_entry_end ,"ACL","", tnf_string,end,"aclpb error"); return LDAP_OPERATIONS_ERROR; } if (pb != aclpb->aclpb_pblock) { - slapi_log_error(SLAPI_LOG_ACL, plugin_name, + slapi_log_err(SLAPI_LOG_ACL, plugin_name, "acl_read_access_allowed_on_entry - Resetting aclpb_pblock %p to pblock addr %p\n", aclpb->aclpb_pblock, pb); aclpb->aclpb_pblock = pb; @@ -1228,7 +1228,7 @@ acl_read_access_allowed_on_attr ( /* If it's the root or acl is off or rootdse, he has all the priv */ if ( acl_skip_access_check ( pb, e, access ) ) { - slapi_log_error(SLAPI_LOG_ACL, plugin_name, + slapi_log_err(SLAPI_LOG_ACL, plugin_name, "Root access (%s) allowed on entry(%s)\n", acl_access2str(access), n_edn); @@ -1240,7 +1240,7 @@ acl_read_access_allowed_on_attr ( aclpb = acl_get_aclpb ( pb, ACLPB_BINDDN_PBLOCK ); if ( !aclpb ) { - slapi_log_error(SLAPI_LOG_ERR, plugin_name, "acl_read_access_allowed_on_attr - Missing aclpb 3 \n" ); + slapi_log_err(SLAPI_LOG_ERR, plugin_name, "acl_read_access_allowed_on_attr - Missing aclpb 3 \n" ); TNF_PROBE_1_DEBUG(acl_read_access_allowed_on_attr_end ,"ACL","", tnf_string,aclpb_error,""); @@ -1268,7 +1268,7 @@ acl_read_access_allowed_on_attr ( ret_val = acl__attr_cached_result (aclpb, attr, SLAPI_ACL_READ); if (ret_val != -1) { - slapi_log_error(SLAPI_LOG_ACL, plugin_name, + slapi_log_err(SLAPI_LOG_ACL, plugin_name, "acl_read_access_allowed_on_attr - MATCHED HANDLE:dn:%s attr: %s val:%d\n", n_edn, attr, ret_val ); if (ret_val == LDAP_SUCCESS) { @@ -1295,7 +1295,7 @@ acl_read_access_allowed_on_attr ( ** rest of the attributes. */ if (aclpb->aclpb_state & ACLPB_ATTR_STAR_MATCHED) { - slapi_log_error(SLAPI_LOG_ACL, plugin_name, + slapi_log_err(SLAPI_LOG_ACL, plugin_name, "acl_read_access_allowed_on_attr - STAR Access allowed on attr:%s; entry:%s \n", attr, n_edn); decision_reason.reason = ACL_REASON_EVALCONTEXT_CACHED_ATTR_STAR_ALLOW; @@ -1664,7 +1664,7 @@ acl_modified (Slapi_PBlock *pb, int optype, Slapi_DN *e_sdn, void *change) ** use this group. for now just do the whole thing. */ if ( group_change ) { - slapi_log_error(SLAPI_LOG_ACL, plugin_name, + slapi_log_err(SLAPI_LOG_ACL, plugin_name, "acl_modified - Group Change: Invalidating entire UserGroup Cache %s\n", n_dn); aclg_regen_group_signature(); @@ -1700,7 +1700,7 @@ acl_modified (Slapi_PBlock *pb, int optype, Slapi_DN *e_sdn, void *change) * Mark this for deletion next time round--try to impact * this mainline code as little as possible. */ - slapi_log_error(SLAPI_LOG_ACL, plugin_name, + slapi_log_err(SLAPI_LOG_ACL, plugin_name, "acl_modified - Marking entry %s for removal from ACL user Group Cache\n", n_dn); aclg_markUgroupForRemoval (ugroup); @@ -1852,7 +1852,7 @@ acl_modified (Slapi_PBlock *pb, int optype, Slapi_DN *e_sdn, void *change) } if (NULL == parent_DN) { if (NULL == new_RDN) { - slapi_log_error(SLAPI_LOG_ACL, plugin_name, + slapi_log_err(SLAPI_LOG_ACL, plugin_name, "acl_modified - (MODRDN %s => \"no change\"\n", n_dn); break; @@ -1870,7 +1870,7 @@ acl_modified (Slapi_PBlock *pb, int optype, Slapi_DN *e_sdn, void *change) new_DN = slapi_create_dn_string("%s,%s", new_RDN, parent_DN); } } - slapi_log_error(SLAPI_LOG_ACL, plugin_name, + slapi_log_err(SLAPI_LOG_ACL, plugin_name, "acl_modified - (MODRDN %s => \"%s\"\n", n_dn, new_RDN); /* Change the acls */ @@ -1932,7 +1932,7 @@ acl__scan_for_acis(Acl_PBlock *aclpb, int *err) aclpb->aclpb_handles_index[0] != -1 ) { int kk = 0; while ( kk < aclpb_max_selected_acls && aclpb->aclpb_handles_index[kk] != -1 ) { - slapi_log_error(SLAPI_LOG_ACL, plugin_name, "acl__scan_for_acis - Using ACL Container:%d for evaluation\n", kk); + slapi_log_err(SLAPI_LOG_ACL, plugin_name, "acl__scan_for_acis - Using ACL Container:%d for evaluation\n", kk); kk++; } } @@ -1946,7 +1946,7 @@ acl__scan_for_acis(Acl_PBlock *aclpb, int *err) /* Check the signature. If it has changed, start fresh */ if ( aclpb->aclpb_signature != acl_signature ) { - slapi_log_error(SLAPI_LOG_ACL, plugin_name, + slapi_log_err(SLAPI_LOG_ACL, plugin_name, "acl__scan_for_acis - Restart the scan due to acl changes\n"); acllist_init_scan ( aclpb->aclpb_pblock, LDAP_SCOPE_BASE, NULL ); } @@ -2027,7 +2027,7 @@ acl__scan_for_acis(Acl_PBlock *aclpb, int *err) aclpb->aclpb_num_deny_handles = deny_handle; aclpb->aclpb_num_allow_handles = allow_handle; - slapi_log_error(SLAPI_LOG_ACL, plugin_name, "acl__scan_for_acis - Num of ALLOW Handles:%d, DENY handles:%d\n", + slapi_log_err(SLAPI_LOG_ACL, plugin_name, "acl__scan_for_acis - Num of ALLOW Handles:%d, DENY handles:%d\n", aclpb->aclpb_num_allow_handles, aclpb->aclpb_num_deny_handles); TNF_PROBE_0_DEBUG(acl__scan_for_acis_end,"ACL",""); @@ -2179,12 +2179,12 @@ acl__resource_match_aci( Acl_PBlock *aclpb, aci_t *aci, int skip_attrEval, int * /* This is a filter with substring * e.g. ldap:///uid=*,cn=accounts,dc=example,dc=com */ - slapi_log_error(SLAPI_LOG_ACL, plugin_name, "acl__resource_match_aci - moddn target_to substring: %s\n", + slapi_log_err(SLAPI_LOG_ACL, plugin_name, "acl__resource_match_aci - moddn target_to substring: %s\n", slapi_filter_to_string(f, logbuf, sizeof(logbuf))); if ((rv = acl_match_substring(f, (char *) res_ndn, 0 /* match suffix */)) != ACL_TRUE) { dn_matched = ACL_FALSE; if (rv == ACL_ERR) { - slapi_log_error(SLAPI_LOG_ACL, plugin_name, + slapi_log_err(SLAPI_LOG_ACL, plugin_name, "acl__resource_match_aci:pattern err\n"); matches = ACL_FALSE; goto acl__resource_match_aci_EXIT; @@ -2194,7 +2194,7 @@ acl__resource_match_aci( Acl_PBlock *aclpb, aci_t *aci, int skip_attrEval, int * /* This is a filter without substring * e.g. ldap:///cn=accounts,dc=example,dc=com */ - slapi_log_error(SLAPI_LOG_ACL, plugin_name, "acl__resource_match_aci - moddn target_to: %s\n", + slapi_log_err(SLAPI_LOG_ACL, plugin_name, "acl__resource_match_aci - moddn target_to: %s\n", slapi_filter_to_string(f, logbuf, sizeof(logbuf))); slapi_filter_get_ava(f, &avaType, &avaValue); @@ -2220,12 +2220,12 @@ acl__resource_match_aci( Acl_PBlock *aclpb, aci_t *aci, int skip_attrEval, int * /* This is a filter with substring * e.g. ldap:///uid=*,cn=accounts,dc=example,dc=com */ - slapi_log_error(SLAPI_LOG_ACL, plugin_name, "acl__resource_match_aci - moddn target_from substring: %s\n", + slapi_log_err(SLAPI_LOG_ACL, plugin_name, "acl__resource_match_aci - moddn target_from substring: %s\n", slapi_filter_to_string(f, logbuf, sizeof(logbuf))); if ((rv = acl_match_substring(f, (char *) slapi_sdn_get_dn(aclpb->aclpb_moddn_source_sdn), 0 /* match suffix */)) != ACL_TRUE) { dn_matched = ACL_FALSE; if (rv == ACL_ERR) { - slapi_log_error(SLAPI_LOG_ACL, plugin_name, + slapi_log_err(SLAPI_LOG_ACL, plugin_name, "acl__resource_match_aci - pattern err\n"); matches = ACL_FALSE; goto acl__resource_match_aci_EXIT; @@ -2236,7 +2236,7 @@ acl__resource_match_aci( Acl_PBlock *aclpb, aci_t *aci, int skip_attrEval, int * /* This is a filter without substring * e.g. ldap:///cn=accounts,dc=example,dc=com */ - slapi_log_error(SLAPI_LOG_ACL, plugin_name, "acl__resource_match_aci - moddn target_from: %s\n", + slapi_log_err(SLAPI_LOG_ACL, plugin_name, "acl__resource_match_aci - moddn target_from: %s\n", slapi_filter_to_string(f, logbuf, sizeof(logbuf))); if (!slapi_dn_issuffix(slapi_sdn_get_dn(aclpb->aclpb_moddn_source_sdn), avaValue->bv_val)) { dn_matched = ACL_FALSE; @@ -2265,7 +2265,7 @@ acl__resource_match_aci( Acl_PBlock *aclpb, aci_t *aci, int skip_attrEval, int * if ((rv = acl_match_substring(f, (char *)res_ndn, 0 /* match suffux */)) != ACL_TRUE) { dn_matched = ACL_FALSE; if(rv == ACL_ERR) { - slapi_log_error(SLAPI_LOG_ACL, plugin_name, + slapi_log_err(SLAPI_LOG_ACL, plugin_name, "acl__resource_match_aci - Pattern err\n"); matches = ACL_FALSE; goto acl__resource_match_aci_EXIT; @@ -2312,7 +2312,7 @@ acl__resource_match_aci( Acl_PBlock *aclpb, aci_t *aci, int skip_attrEval, int * if ( matched_val == NULL && (aclpb->aclpb_res_type & (ACLPB_NEW_ENTRY | ACLPB_EFFECTIVE_RIGHTS))) { - slapi_log_error(SLAPI_LOG_ACL, plugin_name, + slapi_log_err(SLAPI_LOG_ACL, plugin_name, "acl__resource_match_aci - Evaluating macro aci(%d)%s for resource %s\n", aci->aci_index, aci->aclName, aclutil__access_str(res_right, res_right_str)); @@ -2350,14 +2350,14 @@ acl__resource_match_aci( Acl_PBlock *aclpb, aci_t *aci, int skip_attrEval, int * acl_ht_add_and_freeOld(aclpb->aclpb_macro_ht, (PLHashNumber)aci->aci_index, matched_val); - slapi_log_error(SLAPI_LOG_ACL, plugin_name, + slapi_log_err(SLAPI_LOG_ACL, plugin_name, "acl__resource_match_aci - Added aci(%d) and matched value (%s) to macro ht\n", aci->aci_index, matched_val); acl_ht_display_ht(aclpb->aclpb_macro_ht); } else { slapi_ch_free((void **)&matched_val); if (matches == ACL_FALSE) { - slapi_log_error(SLAPI_LOG_ACL, plugin_name, + slapi_log_err(SLAPI_LOG_ACL, plugin_name, "acl__resource_match_aci - Evaluated ACL_FALSE\n"); } } @@ -2427,7 +2427,7 @@ acl__resource_match_aci( Acl_PBlock *aclpb, aci_t *aci, int skip_attrEval, int * } } else { matches = ACL_FALSE; - slapi_log_error(SLAPI_LOG_ACL, plugin_name, + slapi_log_err(SLAPI_LOG_ACL, plugin_name, "acl__resource_match_aci - Returning UNDEFINED for targetfilter evaluation.\n"); } @@ -2957,7 +2957,7 @@ acl__TestRights(Acl_PBlock *aclpb,int access, const char **right, const char ** } k++; index = aci->aci_index; - slapi_log_error(SLAPI_LOG_ACL, plugin_name, + slapi_log_err(SLAPI_LOG_ACL, plugin_name, "acl__TestRights - Evaluating DENY aci(%d) \"%s\"\n", index, aci->aclName); if (access & ( SLAPI_ACL_SEARCH | SLAPI_ACL_READ)) { @@ -2989,7 +2989,7 @@ acl__TestRights(Acl_PBlock *aclpb,int access, const char **right, const char ** */ if (access & SLAPI_ACL_SEARCH) { if ( result & ACLPB_CACHE_SEARCH_RES_DENY){ - slapi_log_error(SLAPI_LOG_ACL, plugin_name, + slapi_log_err(SLAPI_LOG_ACL, plugin_name, "acl__TestRights - DENY:Found SEARCH DENY in cache\n"); __acl_set_aclIndex_inResult ( aclpb, access, index ); result_reason->deciding_aci = aci; @@ -2999,7 +2999,7 @@ acl__TestRights(Acl_PBlock *aclpb,int access, const char **right, const char ** return ACL_RES_DENY; } else if ((result & ACLPB_CACHE_SEARCH_RES_SKIP) || (result & ACLPB_CACHE_SEARCH_RES_ALLOW)) { - slapi_log_error(SLAPI_LOG_ACL, plugin_name, + slapi_log_err(SLAPI_LOG_ACL, plugin_name, "acl__TestRights - DENY:Found SEARCH SKIP in cache\n"); skip_eval = 1; break; @@ -3008,7 +3008,7 @@ acl__TestRights(Acl_PBlock *aclpb,int access, const char **right, const char ** } } else { /* must be READ */ if (result & ACLPB_CACHE_READ_RES_DENY) { - slapi_log_error(SLAPI_LOG_ACL, plugin_name, + slapi_log_err(SLAPI_LOG_ACL, plugin_name, "acl__TestRights - DENY:Found READ DENY in cache\n"); __acl_set_aclIndex_inResult ( aclpb, access, index ); result_reason->deciding_aci = aci; @@ -3017,7 +3017,7 @@ acl__TestRights(Acl_PBlock *aclpb,int access, const char **right, const char ** tnf_string,cached_deny,""); return ACL_RES_DENY; } else if ( result & ACLPB_CACHE_READ_RES_SKIP) { - slapi_log_error(SLAPI_LOG_ACL, plugin_name, + slapi_log_err(SLAPI_LOG_ACL, plugin_name, "acl__TestRights - DENY:Found READ SKIP in cache\n"); skip_eval = 1; break; @@ -3035,7 +3035,7 @@ acl__TestRights(Acl_PBlock *aclpb,int access, const char **right, const char ** rv = ACL_EvalSetACL(NULL, acleval, aci->aci_handle); if ( rv < 0) { - slapi_log_error(SLAPI_LOG_ACL, plugin_name, + slapi_log_err(SLAPI_LOG_ACL, plugin_name, "acl__TestRights - Unable to set the DENY acllist\n"); continue; } @@ -3050,7 +3050,7 @@ acl__TestRights(Acl_PBlock *aclpb,int access, const char **right, const char ** &deny_generic, &acl_tag, &expr_num); - slapi_log_error(SLAPI_LOG_ACL, plugin_name, "acl__TestRights - Processed:%d DENY handles Result:%d\n",index, rights_rv); + slapi_log_err(SLAPI_LOG_ACL, plugin_name, "acl__TestRights - Processed:%d DENY handles Result:%d\n",index, rights_rv); if (rights_rv == ACL_RES_FAIL) { result_reason->deciding_aci = aci; @@ -3085,7 +3085,7 @@ acl__TestRights(Acl_PBlock *aclpb,int access, const char **right, const char ** } else { /* cache overflow */ if (!(aclpb->aclpb_cache_result[j].result & ACLPB_CACHE_ERROR_REPORTED)) { - slapi_log_error(SLAPI_LOG_ERR, plugin_name, "acl__TestRights - " + slapi_log_err(SLAPI_LOG_ERR, plugin_name, "acl__TestRights - " "Your ACL cache of %d slots has overflowed. " "This can happen when you have many ACIs. " "This ACI evaluation requires %d slots to cache. " @@ -3185,7 +3185,7 @@ acl__TestRights(Acl_PBlock *aclpb,int access, const char **right, const char ** } k++; index = aci->aci_index; - slapi_log_error(SLAPI_LOG_ACL, plugin_name, + slapi_log_err(SLAPI_LOG_ACL, plugin_name, "acl__TestRights - %d. Evaluating ALLOW aci(%d) \"%s\"\n", k, index, aci->aclName); if (access & ( SLAPI_ACL_SEARCH | SLAPI_ACL_READ)) { @@ -3218,7 +3218,7 @@ acl__TestRights(Acl_PBlock *aclpb,int access, const char **right, const char ** */ if (access & SLAPI_ACL_SEARCH) { if (result & ACLPB_CACHE_SEARCH_RES_ALLOW) { - slapi_log_error(SLAPI_LOG_ACL, plugin_name, + slapi_log_err(SLAPI_LOG_ACL, plugin_name, "acl__TestRights - Found SEARCH ALLOW in cache\n"); __acl_set_aclIndex_inResult ( aclpb, access, index ); result_reason->deciding_aci = aci; @@ -3227,7 +3227,7 @@ acl__TestRights(Acl_PBlock *aclpb,int access, const char **right, const char ** tnf_string,cached_allow,""); return ACL_RES_ALLOW; } else if ( result & ACLPB_CACHE_SEARCH_RES_SKIP) { - slapi_log_error(SLAPI_LOG_ACL, plugin_name, + slapi_log_err(SLAPI_LOG_ACL, plugin_name, "acl__TestRights - Found SEARCH SKIP in cache\n"); skip_eval = 1; break; @@ -3237,7 +3237,7 @@ acl__TestRights(Acl_PBlock *aclpb,int access, const char **right, const char ** } } else { if ( result & ACLPB_CACHE_READ_RES_ALLOW) { - slapi_log_error(SLAPI_LOG_ACL, plugin_name, + slapi_log_err(SLAPI_LOG_ACL, plugin_name, "acl__TestRights - Found READ ALLOW in cache\n"); __acl_set_aclIndex_inResult ( aclpb, access, index ); result_reason->deciding_aci = aci; @@ -3246,7 +3246,7 @@ acl__TestRights(Acl_PBlock *aclpb,int access, const char **right, const char ** tnf_string,cached_allow,""); return ACL_RES_ALLOW; } else if ( result & ACLPB_CACHE_READ_RES_SKIP) { - slapi_log_error(SLAPI_LOG_ACL, plugin_name, + slapi_log_err(SLAPI_LOG_ACL, plugin_name, "acl__TestRights - Found READ SKIP in cache\n"); skip_eval = 1; break; @@ -3265,7 +3265,7 @@ acl__TestRights(Acl_PBlock *aclpb,int access, const char **right, const char ** TNF_PROBE_0_DEBUG(acl__libaccess_start,"ACL",""); rv = ACL_EvalSetACL(NULL, acleval, aci->aci_handle); if ( rv < 0) { - slapi_log_error(SLAPI_LOG_ERR, plugin_name, + slapi_log_err(SLAPI_LOG_ERR, plugin_name, "acl__TestRights - Unable to set the acllist\n"); continue; } @@ -3307,7 +3307,7 @@ acl__TestRights(Acl_PBlock *aclpb,int access, const char **right, const char ** } else { /* cache overflow */ if (!(aclpb->aclpb_cache_result[j].result & ACLPB_CACHE_ERROR_REPORTED)) { - slapi_log_error(SLAPI_LOG_ERR, plugin_name, "acl__TestRights - " + slapi_log_err(SLAPI_LOG_ERR, plugin_name, "acl__TestRights - " "Your ACL cache of %d slots has overflowed. " "This can happen when you have many ACIs. " "This ACI evaluation requires %d slots to cache. " @@ -3550,11 +3550,11 @@ acl__attr_cached_result (struct acl_pblock *aclpb, char *attr, int access ) if (aclpb->aclpb_state & ACLPB_HAS_ACLCB_EVALCONTEXT ) { c_evalContext = &aclpb->aclpb_prev_opEval_context; - slapi_log_error(SLAPI_LOG_ACL, plugin_name, + slapi_log_err(SLAPI_LOG_ACL, plugin_name, "acl__attr_cached_result - Using Context: ACLPB_ACLCB\n" ); } else { c_evalContext = &aclpb->aclpb_prev_entryEval_context; - slapi_log_error(SLAPI_LOG_ACL, plugin_name, + slapi_log_err(SLAPI_LOG_ACL, plugin_name, "acl__attr_cached_result - Using Context: ACLPB_PREV\n" ); } @@ -3739,7 +3739,7 @@ acl__scan_match_handles ( Acl_PBlock *aclpb, int type) ** to nullify the cached result */ if ( aci->aci_ruleType & ACI_ATTR_RULES ) { - slapi_log_error(SLAPI_LOG_ACL, plugin_name, + slapi_log_err(SLAPI_LOG_ACL, plugin_name, "acl__scan_match_handles - Found an attr Rule [Name:%s Index:%d\n", aci->aclName, aci->aci_index ); for ( jj =0; jj < c_evalContext->acle_numof_attrs; jj++ ) { @@ -4174,7 +4174,7 @@ acl__recompute_acl ( Acl_PBlock *aclpb, goto set_result_status; } - slapi_log_error(SLAPI_LOG_ACL, plugin_name, + slapi_log_err(SLAPI_LOG_ACL, plugin_name, "acl__recompute_acl - Recomputing the ACL Index:%d for entry:%s\n", aciIndex, slapi_entry_get_ndn ( aclpb->aclpb_curr_entry) ); diff --git a/ldap/servers/plugins/acl/acl_ext.c b/ldap/servers/plugins/acl/acl_ext.c index 84d4e66..19ffe43 100644 --- a/ldap/servers/plugins/acl/acl_ext.c +++ b/ldap/servers/plugins/acl/acl_ext.c @@ -98,7 +98,7 @@ acl_get_ext (ext_type type, void *object) void *data; if ( type >= ACL_EXT_ALL ) { - slapi_log_error(SLAPI_LOG_ACL, plugin_name, + slapi_log_err(SLAPI_LOG_ACL, plugin_name, "acl_get_ext - Invalid extension type:%d\n", type ); return NULL; } @@ -147,7 +147,7 @@ aclext_alloc_lockarray ( ) for ( i = 0; i < ACLEXT_MAX_LOCKS; i++) { if (NULL == (lock = PR_NewLock()) ) { - slapi_log_error(SLAPI_LOG_ERR, plugin_name, + slapi_log_err(SLAPI_LOG_ERR, plugin_name, "aclext_alloc_lockarray - Unable to allocate locks used for private extension\n"); return 1; } @@ -196,7 +196,7 @@ acl_conn_ext_constructor ( void *object, void *parent ) struct acl_cblock *ext = NULL; ext = (struct acl_cblock * ) slapi_ch_calloc (1, sizeof (struct acl_cblock ) ); if (( ext->aclcb_lock = aclext_get_lock () ) == NULL ) { - slapi_log_error(SLAPI_LOG_ERR, plugin_name, + slapi_log_err(SLAPI_LOG_ERR, plugin_name, "acl_conn_ext_constructor - Unable to get Read/Write lock for CONNECTION extension\n"); slapi_ch_free ( (void **) &ext ); return NULL; @@ -252,7 +252,7 @@ acl_operation_ext_constructor ( void *object, void *parent ) aclpb = acl__get_aclpb_from_pool(); if ( NULL == aclpb ) { - slapi_log_error(SLAPI_LOG_ERR, plugin_name, + slapi_log_err(SLAPI_LOG_ERR, plugin_name, "acl_operation_ext_constructor - Operation extension allocation Failed\n"); } @@ -286,7 +286,7 @@ acl_operation_ext_destructor ( void *ext, void *object, void *parent ) goto clean_aclpb; if ( NULL == aclpb->aclpb_authorization_sdn ) { - slapi_log_error(SLAPI_LOG_ERR, plugin_name, "acl_operation_ext_destructor - NULL aclcb_autorization_sdn\n"); + slapi_log_err(SLAPI_LOG_ERR, plugin_name, "acl_operation_ext_destructor - NULL aclcb_autorization_sdn\n"); goto clean_aclpb; } @@ -311,7 +311,7 @@ acl_operation_ext_destructor ( void *ext, void *object, void *parent ) goto clean_aclpb; } if ( !aclcb->aclcb_lock ) { - slapi_log_error(SLAPI_LOG_ERR, plugin_name, + slapi_log_err(SLAPI_LOG_ERR, plugin_name, "acl_operation_ext_destructor - aclcb lock released! aclcb cache can't be refreshed\n"); PR_Unlock ( shared_lock ); goto clean_aclpb; @@ -395,7 +395,7 @@ acl_get_aclpb ( Slapi_PBlock *pb, int type ) else if ( type == ACLPB_PROXYDN_PBLOCK ) return aclpb->aclpb_proxy; else - slapi_log_error(SLAPI_LOG_ERR, plugin_name, + slapi_log_err(SLAPI_LOG_ERR, plugin_name, "acl_get_aclpb - Invalid aclpb type %d\n", type ); return NULL; } @@ -565,7 +565,7 @@ acl__get_aclpb_from_pool(void) aclQueue->aclq_nfree--; } else { - slapi_log_error(SLAPI_LOG_ACL, plugin_name, + slapi_log_err(SLAPI_LOG_ACL, plugin_name, "Unable to find a free aclpb\n"); aclpb = acl__malloc_aclpb (); } @@ -635,38 +635,38 @@ acl__malloc_aclpb(void) /* Now set the propert we need for ACL evaluations */ if ((aclpb->aclpb_proplist = PListNew(NULL)) == NULL) { - slapi_log_error(SLAPI_LOG_ERR, plugin_name, + slapi_log_err(SLAPI_LOG_ERR, plugin_name, "Unable to allocate the aclprop PList\n"); goto error; } if (PListInitProp(aclpb->aclpb_proplist, 0, DS_PROP_ACLPB, aclpb, 0) < 0) { - slapi_log_error(SLAPI_LOG_ERR, plugin_name, + slapi_log_err(SLAPI_LOG_ERR, plugin_name, "acl__malloc_aclpb - Unable to set the ACL PBLOCK in the Plist\n"); goto error; } if (PListInitProp(aclpb->aclpb_proplist, 0, DS_ATTR_USERDN, aclpb, 0) < 0) { - slapi_log_error(SLAPI_LOG_ERR, plugin_name, + slapi_log_err(SLAPI_LOG_ERR, plugin_name, "acl__malloc_aclpb - Unable to set the USER DN in the Plist\n"); goto error; } if (PListInitProp(aclpb->aclpb_proplist, 0, DS_ATTR_AUTHTYPE, aclpb, 0) < 0) { - slapi_log_error(SLAPI_LOG_ERR, plugin_name, + slapi_log_err(SLAPI_LOG_ERR, plugin_name, "acl__malloc_aclpb - Unable to set the AUTH TYPE in the Plist\n"); goto error; } if (PListInitProp(aclpb->aclpb_proplist, 0, DS_ATTR_LDAPI, aclpb, 0) < 0) { - slapi_log_error(SLAPI_LOG_ERR, plugin_name, + slapi_log_err(SLAPI_LOG_ERR, plugin_name, "acl__malloc_aclpb - Unable to set the AUTH TYPE in the Plist\n"); goto error; } if (PListInitProp(aclpb->aclpb_proplist, 0, DS_ATTR_ENTRY, aclpb, 0) < 0) { - slapi_log_error(SLAPI_LOG_ERR, plugin_name, + slapi_log_err(SLAPI_LOG_ERR, plugin_name, "acl__malloc_aclpb - Unable to set the ENTRY TYPE in the Plist\n"); goto error; } if (PListInitProp(aclpb->aclpb_proplist, 0, DS_ATTR_SSF, aclpb, 0) < 0) { - slapi_log_error(SLAPI_LOG_ERR, plugin_name, + slapi_log_err(SLAPI_LOG_ERR, plugin_name, "acl__malloc_aclpb - Unable to set the SSF in the Plist\n"); goto error; } @@ -681,7 +681,7 @@ acl__malloc_aclpb(void) /* allocate the acleval struct */ aclpb->aclpb_acleval = (ACLEvalHandle_t *) ACL_EvalNew(NULL, NULL); if (aclpb->aclpb_acleval == NULL) { - slapi_log_error(SLAPI_LOG_ERR, plugin_name, + slapi_log_err(SLAPI_LOG_ERR, plugin_name, "acl__malloc_aclpb - Unable to allocate the acleval block\n"); goto error; } @@ -807,7 +807,7 @@ acl_init_aclpb ( Slapi_PBlock *pb, Acl_PBlock *aclpb, const char *ndn, int copy_ if ( NULL == aclpb ) { - slapi_log_error(SLAPI_LOG_ERR, plugin_name, "acl_init_aclpb - No ACLPB\n"); + slapi_log_err(SLAPI_LOG_ERR, plugin_name, "acl_init_aclpb - No ACLPB\n"); return; } @@ -834,26 +834,26 @@ acl_init_aclpb ( Slapi_PBlock *pb, Acl_PBlock *aclpb, const char *ndn, int copy_ if (PListAssignValue(aclpb->aclpb_proplist, DS_ATTR_USERDN, slapi_sdn_get_ndn(aclpb->aclpb_authorization_sdn), 0) < 0) { - slapi_log_error(SLAPI_LOG_ERR, plugin_name, + slapi_log_err(SLAPI_LOG_ERR, plugin_name, "acl_init_aclpb - Unable to set the USER DN in the Plist\n"); return; } slapi_pblock_get ( pb, SLAPI_OPERATION_AUTHTYPE, &authType ); if (PListAssignValue(aclpb->aclpb_proplist, DS_ATTR_AUTHTYPE, authType, 0) < 0) { - slapi_log_error(SLAPI_LOG_ERR, plugin_name, + slapi_log_err(SLAPI_LOG_ERR, plugin_name, "acl_init_aclpb - Unable to set the AUTH TYPE in the Plist\n"); return; } if(slapi_is_ldapi_conn(pb)){ if(PListAssignValue(aclpb->aclpb_proplist, DS_ATTR_LDAPI, "yes", 0) < 0){ - slapi_log_error(SLAPI_LOG_ERR, plugin_name, + slapi_log_err(SLAPI_LOG_ERR, plugin_name, "acl_init_aclpb - Unable to set the AUTH TYPE in the Plist\n"); return; } } slapi_pblock_get ( pb, SLAPI_OPERATION_SSF, &ssf); if (PListAssignValue(aclpb->aclpb_proplist, DS_ATTR_SSF, (const void *)ssf, 0) < 0) { - slapi_log_error(SLAPI_LOG_ERR, plugin_name, + slapi_log_err(SLAPI_LOG_ERR, plugin_name, "acl_init_aclpb - Unable to set the SSF in the Plist\n"); return; } @@ -890,7 +890,7 @@ acl_init_aclpb ( Slapi_PBlock *pb, Acl_PBlock *aclpb, const char *ndn, int copy_ /* This could happen if the client is dead and we are in ** process of abondoning this operation */ - slapi_log_error(SLAPI_LOG_ACL, plugin_name, + slapi_log_err(SLAPI_LOG_ACL, plugin_name, "acl_init_aclpb - No CONNECTION extension\n"); } else if ( aclcb->aclcb_state == -1 ) { @@ -959,7 +959,7 @@ acl__done_aclpb ( struct acl_pblock *aclpb ) /* Check the state */ if (aclpb->aclpb_state & ~ACLPB_STATE_ALL) { - slapi_log_error(SLAPI_LOG_ERR, plugin_name, + slapi_log_err(SLAPI_LOG_ERR, plugin_name, "acl__done_aclpb - The aclpb state value (%d) is incorrect. Exceeded the limit (%d)\n", aclpb->aclpb_state, ACLPB_STATE_ALL); dump_aclpb_info = 1; @@ -974,7 +974,7 @@ acl__done_aclpb ( struct acl_pblock *aclpb ) aclg_reset_userGroup ( aclpb ); if ( aclpb->aclpb_res_type & ~ACLPB_RESTYPE_ALL ) { - slapi_log_error(SLAPI_LOG_ERR, plugin_name, + slapi_log_err(SLAPI_LOG_ERR, plugin_name, "acl__done_aclpb - The aclpb res_type value (%d) has exceeded. Limit is (%d)\n", aclpb->aclpb_res_type, ACLPB_RESTYPE_ALL ); dump_aclpb_info = 1; @@ -982,16 +982,16 @@ acl__done_aclpb ( struct acl_pblock *aclpb ) if ( dump_aclpb_info ) { const char *ndn; - slapi_log_error(SLAPI_LOG_ERR, plugin_name, + slapi_log_err(SLAPI_LOG_ERR, plugin_name, "ACLPB value is:%p\n", aclpb ); ndn = slapi_sdn_get_ndn ( aclpb->aclpb_curr_entry_sdn ); - slapi_log_error(SLAPI_LOG_ERR, plugin_name, "acl__done_aclpb - curr_entry:%p num_entries:%d curr_dn:%p\n", + slapi_log_err(SLAPI_LOG_ERR, plugin_name, "acl__done_aclpb - curr_entry:%p num_entries:%d curr_dn:%p\n", aclpb->aclpb_curr_entry ? (char *) aclpb->aclpb_curr_entry : "NULL", aclpb->aclpb_num_entries, ndn ? ndn : "NULL"); - slapi_log_error(SLAPI_LOG_ERR, plugin_name, "acl__done_aclpb - Last attr:%p, Plist:%p acleval: %p\n", + slapi_log_err(SLAPI_LOG_ERR, plugin_name, "acl__done_aclpb - Last attr:%p, Plist:%p acleval: %p\n", aclpb->aclpb_Evalattr ? aclpb->aclpb_Evalattr : "NULL", aclpb->aclpb_proplist ? (char *) aclpb->aclpb_proplist : "NULL", aclpb->aclpb_acleval ? (char *) aclpb->aclpb_acleval : "NULL" ); @@ -1162,24 +1162,24 @@ acl__dump_stats ( struct acl_pblock *aclpb , const char *block_type) } /* DUMP STAT INFO */ - slapi_log_error(SLAPI_LOG_ACL, plugin_name, + slapi_log_err(SLAPI_LOG_ACL, plugin_name, "**** ACL OPERATION STAT BEGIN ( aclpb:%p Block type: %s): Conn:%" PRIu64 " Operation:%d *******\n", aclpb, block_type, connid, opid ); - slapi_log_error(SLAPI_LOG_ACL, plugin_name, "\tNumber of entries scanned: %d\n", + slapi_log_err(SLAPI_LOG_ACL, plugin_name, "\tNumber of entries scanned: %d\n", aclpb->aclpb_stat_total_entries); - slapi_log_error(SLAPI_LOG_ACL, plugin_name, "\tNumber of times ACL List scanned: %d\n", + slapi_log_err(SLAPI_LOG_ACL, plugin_name, "\tNumber of times ACL List scanned: %d\n", aclpb->aclpb_stat_acllist_scanned); - slapi_log_error(SLAPI_LOG_ACL, plugin_name, "\tNumber of ACLs with target matched:%d\n", + slapi_log_err(SLAPI_LOG_ACL, plugin_name, "\tNumber of ACLs with target matched:%d\n", aclpb->aclpb_stat_num_tmatched_acls); - slapi_log_error(SLAPI_LOG_ACL, plugin_name, "\tNumber of times acl resource matched:%d\n", + slapi_log_err(SLAPI_LOG_ACL, plugin_name, "\tNumber of times acl resource matched:%d\n", aclpb->aclpb_stat_aclres_matched); - slapi_log_error(SLAPI_LOG_ACL, plugin_name, "\tNumber of times ANOM list scanned:%d\n", + slapi_log_err(SLAPI_LOG_ACL, plugin_name, "\tNumber of times ANOM list scanned:%d\n", aclpb->aclpb_stat_anom_list_scanned); - slapi_log_error(SLAPI_LOG_ACL, plugin_name, "\tNumber of times Context was copied:%d\n", + slapi_log_err(SLAPI_LOG_ACL, plugin_name, "\tNumber of times Context was copied:%d\n", aclpb->aclpb_stat_num_copycontext); - slapi_log_error(SLAPI_LOG_ACL, plugin_name, "\tNumber of times Attrs was copied:%d\n", + slapi_log_err(SLAPI_LOG_ACL, plugin_name, "\tNumber of times Attrs was copied:%d\n", aclpb->aclpb_stat_num_copy_attrs); - slapi_log_error(SLAPI_LOG_ACL, plugin_name, " **** ACL OPERATION STAT END *******\n"); + slapi_log_err(SLAPI_LOG_ACL, plugin_name, " **** ACL OPERATION STAT END *******\n"); } #endif /****************************************************************************/ diff --git a/ldap/servers/plugins/acl/aclanom.c b/ldap/servers/plugins/acl/aclanom.c index 792fa5e..5462d87 100644 --- a/ldap/servers/plugins/acl/aclanom.c +++ b/ldap/servers/plugins/acl/aclanom.c @@ -61,7 +61,7 @@ aclanom_init () slapi_ch_calloc (1, sizeof ( struct anom_profile ) ); if (( anom_rwlock = slapi_new_rwlock()) == NULL ) { - slapi_log_error(SLAPI_LOG_ERR, plugin_name, + slapi_log_err(SLAPI_LOG_ERR, plugin_name, "aclanom_init - Failed in getting the ANOM rwlock\n" ); return 1; } @@ -115,7 +115,7 @@ aclanom_gen_anomProfile (acl_lock_flag_t lock_flag) /* We have a new signature now */ a_profile->anom_signature = acl_get_aclsignature(); - slapi_log_error(SLAPI_LOG_ACL, plugin_name, "aclanom_gen_anomProfile - GENERATING ANOM USER PROFILE\n"); + slapi_log_err(SLAPI_LOG_ACL, plugin_name, "aclanom_gen_anomProfile - GENERATING ANOM USER PROFILE\n"); /* ** Go thru the ACL list and find all the ACLs which apply to the ** anonymous user i.e anyone. we can generate a profile for that. @@ -140,7 +140,7 @@ aclanom_gen_anomProfile (acl_lock_flag_t lock_flag) ( (aci->aci_type & ACI_CONTAIN_NOT_USERDN ) || (aci->aci_type & ACI_CONTAIN_NOT_GROUPDN) || (aci->aci_type & ACI_CONTAIN_NOT_ROLEDN)) ){ - slapi_log_error(SLAPI_LOG_ACL, plugin_name, + slapi_log_err(SLAPI_LOG_ACL, plugin_name, "aclanom_gen_anomProfile - CANCELLING ANOM USER PROFILE BECAUSE OF DENY RULE\n"); goto cleanup; } @@ -158,7 +158,7 @@ aclanom_gen_anomProfile (acl_lock_flag_t lock_flag) ** let's not consider complex rules - let's make this lean. */ if ( aci->aci_ruleType & ~ACI_USERDN_RULE ){ - slapi_log_error(SLAPI_LOG_ACL, plugin_name, + slapi_log_err(SLAPI_LOG_ACL, plugin_name, "aclanom_gen_anomProfile - CANCELLING ANOM USER PROFILE BECAUSE OF COMPLEX RULE\n"); goto cleanup; } @@ -179,7 +179,7 @@ aclanom_gen_anomProfile (acl_lock_flag_t lock_flag) continue; } else { /* clean up before leaving */ - slapi_log_error(SLAPI_LOG_ACL, plugin_name, + slapi_log_err(SLAPI_LOG_ACL, plugin_name, "aclanom_gen_anomProfile - CANCELLING ANOM USER PROFILE 1\n"); goto cleanup; } @@ -190,7 +190,7 @@ aclanom_gen_anomProfile (acl_lock_flag_t lock_flag) a_numacl = a_profile->anom_numacls++; if ( a_profile->anom_numacls == ACL_ANOM_MAX_ACL ) { - slapi_log_error(SLAPI_LOG_ACL, plugin_name, "aclanom_gen_anomProfile - CANCELLING ANOM USER PROFILE 2\n"); + slapi_log_err(SLAPI_LOG_ACL, plugin_name, "aclanom_gen_anomProfile - CANCELLING ANOM USER PROFILE 2\n"); goto cleanup; } @@ -211,7 +211,7 @@ aclanom_gen_anomProfile (acl_lock_flag_t lock_flag) a_profile->anom_targetinfo[a_numacl].anom_filter = slapi_str2filter ( aci->targetFilterStr ); if (NULL == a_profile->anom_targetinfo[a_numacl].anom_filter) { const char *dn = slapi_sdn_get_dn ( aci->aci_sdn ); - slapi_log_error(SLAPI_LOG_ERR, plugin_name, + slapi_log_err(SLAPI_LOG_ERR, plugin_name, "aclanom_gen_anomProfile - Invalid filter [%s] in anonymous aci in entry [%s]\n", aci->targetFilterStr, dn); goto cleanup; @@ -237,7 +237,7 @@ aclanom_gen_anomProfile (acl_lock_flag_t lock_flag) destattrArray[i] = NULL; /* clean up before leaving */ aclanom__del_profile (0); - slapi_log_error(SLAPI_LOG_ACL, plugin_name, + slapi_log_err(SLAPI_LOG_ACL, plugin_name, "aclanom_gen_anomProfile - CANCELLING ANOM USER PROFILE 3\n"); goto cleanup; } @@ -522,7 +522,7 @@ aclanom_match_profile (Slapi_PBlock *pb, struct acl_pblock *aclpb, Slapi_Entry * const char *aci_ndn; aci_ndn = slapi_sdn_get_ndn (acl_anom_profile->anom_targetinfo[i].anom_target); if (access & SLAPI_ACL_MODDN) { - slapi_log_error(loglevel, plugin_name, + slapi_log_err(loglevel, plugin_name, "aclanom_match_profile - conn=%" NSPRIu64 " op=%d: Allow access on entry(%s).attr(%s) (from %s) to anonymous: acidn=\"%s\"\n", o_connid, o_opid, ndn, @@ -531,7 +531,7 @@ aclanom_match_profile (Slapi_PBlock *pb, struct acl_pblock *aclpb, Slapi_Entry * aci_ndn); } else { - slapi_log_error(loglevel, plugin_name, + slapi_log_err(loglevel, plugin_name, "aclanom_match_profile - conn=%" NSPRIu64 " op=%d: Allow access on entry(%s).attr(%s) to anonymous: acidn=\"%s\"\n", o_connid, o_opid, ndn, @@ -540,13 +540,13 @@ aclanom_match_profile (Slapi_PBlock *pb, struct acl_pblock *aclpb, Slapi_Entry * } } else { if (access & SLAPI_ACL_MODDN) { - slapi_log_error(loglevel, plugin_name, + slapi_log_err(loglevel, plugin_name, "aclanom_match_profile - conn=%" NSPRIu64 " op=%d: Deny access on entry(%s).attr(%s) (from %s) to anonymous\n", o_connid, o_opid, ndn, attr ? attr:"NULL" , aclpb->aclpb_moddn_source_sdn ? slapi_sdn_get_dn(aclpb->aclpb_moddn_source_sdn) : "NULL"); } else { - slapi_log_error(loglevel, plugin_name, + slapi_log_err(loglevel, plugin_name, "aclanom_match_profile - conn=%" NSPRIu64 " op=%d: Deny access on entry(%s).attr(%s) to anonymous\n", o_connid, o_opid, ndn, attr ? attr:"NULL" ); diff --git a/ldap/servers/plugins/acl/acleffectiverights.c b/ldap/servers/plugins/acl/acleffectiverights.c index 0bc8345..1e940a3 100644 --- a/ldap/servers/plugins/acl/acleffectiverights.c +++ b/ldap/servers/plugins/acl/acleffectiverights.c @@ -108,7 +108,7 @@ _ger_g_permission_granted ( } if ( slapi_sdn_get_dn (requestor_sdn) == NULL ) { - slapi_log_error(SLAPI_LOG_ACL, plugin_name, + slapi_log_err(SLAPI_LOG_ACL, plugin_name, "_ger_g_permission_granted - Anonymous has no g permission\n" ); rc = LDAP_INSUFFICIENT_ACCESS; goto bailout; @@ -144,7 +144,7 @@ _ger_g_permission_granted ( } aclutil_str_append ( errbuf, "get-effective-rights: requestor has no g permission on the entry" ); - slapi_log_error(SLAPI_LOG_ACL, plugin_name, + slapi_log_err(SLAPI_LOG_ACL, plugin_name, "_ger_g_permission_granted - %s\n", *errbuf); rc = LDAP_INSUFFICIENT_ACCESS; @@ -191,7 +191,7 @@ _ger_parse_control ( subjectber->bv_len == 0 ) { aclutil_str_append ( errbuf, "get-effective-rights: missing subject" ); - slapi_log_error(SLAPI_LOG_ERR, plugin_name, "_ger_parse_control - %s\n", *errbuf ); + slapi_log_err(SLAPI_LOG_ERR, plugin_name, "_ger_parse_control - %s\n", *errbuf ); if (iscritical) return LDAP_UNAVAILABLE_CRITICAL_EXTENSION; /* RFC 4511 4.1.11 */ else @@ -215,7 +215,7 @@ _ger_parse_control ( if ( ber == NULL ) { aclutil_str_append ( errbuf, "get-effective-rights: ber_init failed for the subject" ); - slapi_log_error(SLAPI_LOG_ERR, plugin_name, "_ger_parse_control - %s\n", *errbuf ); + slapi_log_err(SLAPI_LOG_ERR, plugin_name, "_ger_parse_control - %s\n", *errbuf ); if (iscritical) return LDAP_UNAVAILABLE_CRITICAL_EXTENSION; /* RFC 4511 4.1.11 */ else @@ -225,7 +225,7 @@ _ger_parse_control ( if ( ber_scanf (ber, "a", &orig) == LBER_ERROR ) { aclutil_str_append ( errbuf, "get-effective-rights: invalid ber tag in the subject" ); - slapi_log_error(SLAPI_LOG_ERR, plugin_name, "_ger_parse_control - %s\n", *errbuf ); + slapi_log_err(SLAPI_LOG_ERR, plugin_name, "_ger_parse_control - %s\n", *errbuf ); ber_free ( ber, 1 ); if (iscritical) return LDAP_UNAVAILABLE_CRITICAL_EXTENSION; /* RFC 4511 4.1.11 */ @@ -244,7 +244,7 @@ _ger_parse_control ( if ( NULL == orig || subjectndnlen < 3 || strncasecmp ( "dn:", orig, 3 ) != 0 ) { aclutil_str_append ( errbuf, "get-effective-rights: subject is not dnAuthzId" ); - slapi_log_error(SLAPI_LOG_ERR, plugin_name, "_ger_parse_control - %s\n", *errbuf ); + slapi_log_err(SLAPI_LOG_ERR, plugin_name, "_ger_parse_control - %s\n", *errbuf ); slapi_ch_free_string(&orig); if (iscritical) return LDAP_UNAVAILABLE_CRITICAL_EXTENSION; /* RFC 4511 4.1.11 */ @@ -257,7 +257,7 @@ _ger_parse_control ( if (NULL == normed) { aclutil_str_append (errbuf, "get-effective-rights: failed to normalize dn: "); aclutil_str_append (errbuf, orig); - slapi_log_error(SLAPI_LOG_ERR, plugin_name, "_ger_parse_control - %s\n", *errbuf); + slapi_log_err(SLAPI_LOG_ERR, plugin_name, "_ger_parse_control - %s\n", *errbuf); slapi_ch_free_string(&orig); if (iscritical) return LDAP_UNAVAILABLE_CRITICAL_EXTENSION; /* RFC 4511 4.1.11 */ @@ -403,7 +403,7 @@ _ger_get_entry_rights ( _append_gerstr(gerstr, gerstrsize, gerstrcap, "entryLevelRights: ", NULL); - slapi_log_error(SLAPI_LOG_ACL, plugin_name, + slapi_log_err(SLAPI_LOG_ACL, plugin_name, "_ger_get_entry_rights - SLAPI_ACL_READ\n" ); if (acl_access_allowed(gerpb, e, "*", NULL, SLAPI_ACL_READ) == LDAP_SUCCESS) { @@ -411,7 +411,7 @@ _ger_get_entry_rights ( entryrights |= SLAPI_ACL_READ; _append_gerstr(gerstr, gerstrsize, gerstrcap, "v", NULL); } - slapi_log_error(SLAPI_LOG_ACL, plugin_name, + slapi_log_err(SLAPI_LOG_ACL, plugin_name, "_ger_get_entry_rights - SLAPI_ACL_ADD\n" ); if (acl_access_allowed(gerpb, e, NULL, NULL, SLAPI_ACL_ADD) == LDAP_SUCCESS) { @@ -419,7 +419,7 @@ _ger_get_entry_rights ( entryrights |= SLAPI_ACL_ADD; _append_gerstr(gerstr, gerstrsize, gerstrcap, "a", NULL); } - slapi_log_error(SLAPI_LOG_ACL, plugin_name, + slapi_log_err(SLAPI_LOG_ACL, plugin_name, "_ger_get_entry_rights - SLAPI_ACL_DELETE\n" ); if (acl_access_allowed(gerpb, e, NULL, NULL, SLAPI_ACL_DELETE) == LDAP_SUCCESS) { @@ -435,7 +435,7 @@ _ger_get_entry_rights ( * WRITE was granted on rdn attrbibute */ if (acl_access_allowed(gerpb, e, NULL, NULL, SLAPI_ACL_MODDN) == LDAP_SUCCESS) { - slapi_log_error(SLAPI_LOG_ACL, plugin_name, + slapi_log_err(SLAPI_LOG_ACL, plugin_name, "_ger_get_entry_rights - SLAPI_ACL_MODDN %s\n", slapi_entry_get_ndn(e)); /* n - rename e */ entryrights |= SLAPI_ACL_MODDN; @@ -453,7 +453,7 @@ _ger_get_entry_rights ( rdn = slapi_rdn_new_dn(slapi_entry_get_ndn(e)); slapi_rdn_get_first(rdn, &rdntype, &rdnvalue); if (NULL != rdntype) { - slapi_log_error(SLAPI_LOG_ACL, plugin_name, + slapi_log_err(SLAPI_LOG_ACL, plugin_name, "_ger_get_entry_rights - SLAPI_ACL_WRITE_DEL & _ADD %s\n", rdntype); if (acl_access_allowed(gerpb, e, rdntype, NULL, ACLPB_SLAPI_ACL_WRITE_DEL) == LDAP_SUCCESS && @@ -501,7 +501,7 @@ _ger_get_attr_rights ( } _append_gerstr(gerstr, gerstrsize, gerstrcap, type, ":"); - slapi_log_error(SLAPI_LOG_ACL, plugin_name, + slapi_log_err(SLAPI_LOG_ACL, plugin_name, "_ger_get_attr_rights - SLAPI_ACL_READ %s\n", type ); if (acl_access_allowed(gerpb, e, type, NULL, SLAPI_ACL_READ) == LDAP_SUCCESS) { @@ -509,7 +509,7 @@ _ger_get_attr_rights ( attrrights |= SLAPI_ACL_READ; _append_gerstr(gerstr, gerstrsize, gerstrcap, "r", NULL); } - slapi_log_error(SLAPI_LOG_ACL, plugin_name, + slapi_log_err(SLAPI_LOG_ACL, plugin_name, "_ger_get_attr_rights - SLAPI_ACL_SEARCH %s\n", type ); if (acl_access_allowed(gerpb, e, type, NULL, SLAPI_ACL_SEARCH) == LDAP_SUCCESS) { @@ -517,7 +517,7 @@ _ger_get_attr_rights ( attrrights |= SLAPI_ACL_SEARCH; _append_gerstr(gerstr, gerstrsize, gerstrcap, "s", NULL); } - slapi_log_error(SLAPI_LOG_ACL, plugin_name, + slapi_log_err(SLAPI_LOG_ACL, plugin_name, "_ger_get_attr_rights - SLAPI_ACL_COMPARE %s\n", type ); if (acl_access_allowed(gerpb, e, type, NULL, SLAPI_ACL_COMPARE) == LDAP_SUCCESS) { @@ -525,7 +525,7 @@ _ger_get_attr_rights ( attrrights |= SLAPI_ACL_COMPARE; _append_gerstr(gerstr, gerstrsize, gerstrcap, "c", NULL); } - slapi_log_error(SLAPI_LOG_ACL, plugin_name, + slapi_log_err(SLAPI_LOG_ACL, plugin_name, "_ger_get_attr_rights - SLAPI_ACL_WRITE_ADD %s\n", type ); if (acl_access_allowed(gerpb, e, type, NULL, ACLPB_SLAPI_ACL_WRITE_ADD) == LDAP_SUCCESS) { @@ -533,7 +533,7 @@ _ger_get_attr_rights ( attrrights |= ACLPB_SLAPI_ACL_WRITE_ADD; _append_gerstr(gerstr, gerstrsize, gerstrcap, "w", NULL); } - slapi_log_error(SLAPI_LOG_ACL, plugin_name, + slapi_log_err(SLAPI_LOG_ACL, plugin_name, "_ger_get_attr_rights - SLAPI_ACL_WRITE_DEL %s\n", type ); if (acl_access_allowed(gerpb, e, type, NULL, ACLPB_SLAPI_ACL_WRITE_DEL) == LDAP_SUCCESS) { @@ -856,7 +856,7 @@ _ger_generate_template_entry ( slapi_pblock_get( pb, SLAPI_SEARCH_GERATTRS, &gerattrs ); if (NULL == gerattrs) { - slapi_log_error(SLAPI_LOG_ERR, plugin_name, + slapi_log_err(SLAPI_LOG_ERR, plugin_name, "_ger_generate_template_entry - Objectclass info is expected " "in the attr list, e.g., \"*@person\"\n"); rc = LDAP_SUCCESS; @@ -1089,10 +1089,10 @@ bailout: gerstr = slapi_ch_smprintf("entryLevelRights: %d\nattributeLevelRights: *:%d", rc, rc ); } - slapi_log_error(SLAPI_LOG_ACLSUMMARY, plugin_name, + slapi_log_err(SLAPI_LOG_ACLSUMMARY, plugin_name, "###### Effective Rights on Entry (%s) for Subject (%s) ######\n", e?slapi_entry_get_ndn(e):"null", subjectndn?subjectndn:"null"); - slapi_log_error(SLAPI_LOG_ACLSUMMARY, plugin_name, "%s\n", gerstr); + slapi_log_err(SLAPI_LOG_ACLSUMMARY, plugin_name, "%s\n", gerstr); /* Restore pb */ _ger_release_gerpb ( &gerpb, &aclcb, pb ); diff --git a/ldap/servers/plugins/acl/aclgroup.c b/ldap/servers/plugins/acl/aclgroup.c index 1777210..8ba09e6 100644 --- a/ldap/servers/plugins/acl/aclgroup.c +++ b/ldap/servers/plugins/acl/aclgroup.c @@ -41,7 +41,7 @@ aclgroup_init () aclUserGroups = ( aclGroupCache * ) slapi_ch_calloc (1, sizeof ( aclGroupCache ) ); if ( NULL == (aclUserGroups->aclg_rwlock = slapi_new_rwlock())) { - slapi_log_error(SLAPI_LOG_ERR, plugin_name, "Unable to allocate RWLOCK for group cache\n"); + slapi_log_err(SLAPI_LOG_ERR, plugin_name, "Unable to allocate RWLOCK for group cache\n"); return 1; } return 0; @@ -101,7 +101,7 @@ aclg_init_userGroup ( struct acl_pblock *aclpb, const char *n_dn , int got_lock */ if ( !u_group->aclug_refcnt ) { - slapi_log_error(SLAPI_LOG_ACL, plugin_name, + slapi_log_err(SLAPI_LOG_ACL, plugin_name, "aclg_init_userGroup - In traversal group deallocation\n" ); __aclg__delete_userGroup (u_group); } @@ -142,7 +142,7 @@ aclg_init_userGroup ( struct acl_pblock *aclpb, const char *n_dn , int got_lock if ( u_group == aclUserGroups->aclg_last ) aclUserGroups->aclg_last = p_group; } - slapi_log_error(SLAPI_LOG_ACL, plugin_name, "acl_init_userGroup - Found in cache for dn:%s\n", n_dn); + slapi_log_err(SLAPI_LOG_ACL, plugin_name, "acl_init_userGroup - Found in cache for dn:%s\n", n_dn); } if (!got_lock ) ACLG_ULOCK_GROUPCACHE_WRITE (); } @@ -252,7 +252,7 @@ aclg_get_usersGroup ( struct acl_pblock *aclpb , char *n_dn) aclUserGroup *u_group, *f_group; if ( !aclpb ) { - slapi_log_error(SLAPI_LOG_ACL, plugin_name, "aclg_get_usersGroup - NULL acl pblock\n" ); + slapi_log_err(SLAPI_LOG_ACL, plugin_name, "aclg_get_usersGroup - NULL acl pblock\n" ); return NULL; } @@ -274,7 +274,7 @@ aclg_get_usersGroup ( struct acl_pblock *aclpb , char *n_dn) * That's fine as the invalid one will be deallocated when done. */ - slapi_log_error(SLAPI_LOG_ACL, plugin_name, "aclg_get_usersGroup - ALLOCATING GROUP FOR:%s\n", n_dn ); + slapi_log_err(SLAPI_LOG_ACL, plugin_name, "aclg_get_usersGroup - ALLOCATING GROUP FOR:%s\n", n_dn ); u_group = ( aclUserGroup * ) slapi_ch_calloc ( 1, sizeof ( aclUserGroup ) ); u_group->aclug_refcnt = 1; @@ -368,7 +368,7 @@ __aclg__delete_userGroup ( aclUserGroup *u_group ) * be in a condemned state and later deleted. */ - slapi_log_error(SLAPI_LOG_ACL, plugin_name, "__aclg__delete_userGroup - DEALLOCATING GROUP FOR:%s\n", u_group->aclug_ndn ); + slapi_log_err(SLAPI_LOG_ACL, plugin_name, "__aclg__delete_userGroup - DEALLOCATING GROUP FOR:%s\n", u_group->aclug_ndn ); slapi_ch_free ( (void **) &u_group->aclug_ndn ); diff --git a/ldap/servers/plugins/acl/aclinit.c b/ldap/servers/plugins/acl/aclinit.c index 2d5342e..c8f5f55 100644 --- a/ldap/servers/plugins/acl/aclinit.c +++ b/ldap/servers/plugins/acl/aclinit.c @@ -56,7 +56,7 @@ aclinit_main() /* Initialize the LIBACCESS ACL library */ if (ACL_Init() != 0) { - slapi_log_error(SLAPI_LOG_ERR, plugin_name, + slapi_log_err(SLAPI_LOG_ERR, plugin_name, "aclinit_main - ACL Library Initialization failed\n"); return 1; } @@ -85,21 +85,21 @@ aclinit_main() /* ONREPL Moved to the acl_init function because extensions need to be registered before any operations are issued if ( 0 != acl_init_ext() ) { - slapi_log_error(SLAPI_LOG_ERR, plugin_name, + slapi_log_err(SLAPI_LOG_ERR, plugin_name, "Unable to initialize the extensions\n"); return 1; } */ /* create the mutex array */ if ( 0 != aclext_alloc_lockarray ( ) ) { - slapi_log_error(SLAPI_LOG_ERR, plugin_name, + slapi_log_err(SLAPI_LOG_ERR, plugin_name, "aclinit_main - Unable to create the mutext array\n"); return 1; } /* Allocate the pool */ if ( 0 != acl_create_aclpb_pool () ) { - slapi_log_error(SLAPI_LOG_ERR, plugin_name, + slapi_log_err(SLAPI_LOG_ERR, plugin_name, "aclinit_main - Unable to create the acl private pool\n"); return 1; } @@ -110,7 +110,7 @@ aclinit_main() */ /* initialize the ACLLIST sub-system */ if ( 0 != (rv = acllist_init ( ))) { - slapi_log_error(SLAPI_LOG_ERR, plugin_name, + slapi_log_err(SLAPI_LOG_ERR, plugin_name, "aclinit_main - Unable to initialize the plugin:%d\n", rv ); return 1; } @@ -128,7 +128,7 @@ aclinit_main() */ sdn = slapi_sdn_new_ndn_byval(""); - slapi_log_error(SLAPI_LOG_ACL, plugin_name, + slapi_log_err(SLAPI_LOG_ACL, plugin_name, "aclinit_main - Searching for all acis(scope base) at suffix ''\n"); aclinit_search_and_update_aci ( 0, /* thisbeonly */ sdn, /* base */ @@ -140,7 +140,7 @@ aclinit_main() sdn = slapi_get_first_suffix( &node, 1 ); while (sdn) { - slapi_log_error(SLAPI_LOG_ACL, plugin_name, + slapi_log_err(SLAPI_LOG_ACL, plugin_name, "aclinit_main - Searching for all acis(scope subtree) at suffix '%s'\n", slapi_sdn_get_dn(sdn) ); aclinit_search_and_update_aci ( 0, /* thisbeonly */ @@ -210,7 +210,7 @@ aclinit_search_and_update_aci ( int thisbeonly, const Slapi_DN *base, lock_flag == DO_TAKE_ACLCACHE_WRITELOCK); if ( thisbeonly && be_name == NULL) { - slapi_log_error(SLAPI_LOG_ERR, plugin_name, + slapi_log_err(SLAPI_LOG_ERR, plugin_name, "aclinit_search_and_update_aci - be_name must be specified.\n"); return -1; } @@ -335,7 +335,7 @@ __aclinit_handler ( Slapi_Entry *e, void *callback_data) */ if ( call_back_data->op == ACL_ADD_ACIS ) { - slapi_log_error(SLAPI_LOG_ACL, plugin_name, + slapi_log_err(SLAPI_LOG_ACL, plugin_name, "Adding acis for entry '%s'\n", slapi_sdn_get_dn(e_sdn)); slapi_entry_attr_find ( e, aci_attr_type, &attr ); @@ -355,7 +355,7 @@ __aclinit_handler ( Slapi_Entry *e, void *callback_data) aclutil_print_err(rv, e_sdn, attrValue, NULL); /* We got an error; Log it and then march along */ - slapi_log_error(SLAPI_LOG_ERR, plugin_name, + slapi_log_err(SLAPI_LOG_ERR, plugin_name, "__aclinit_handler - This (%s) ACL will not be considered for evaluation" " because of syntax errors.\n", attrValue->bv_val ? attrValue->bv_val: "NULL"); @@ -370,7 +370,7 @@ __aclinit_handler ( Slapi_Entry *e, void *callback_data) } else if (call_back_data->op == ACL_REMOVE_ACIS) { /* Here we are deleting the acis. */ - slapi_log_error(SLAPI_LOG_ACL, plugin_name, "__aclinit_handler - Removing acis\n"); + slapi_log_err(SLAPI_LOG_ACL, plugin_name, "__aclinit_handler - Removing acis\n"); if ( call_back_data->lock_flag == DO_TAKE_ACLCACHE_WRITELOCK) { acllist_acicache_WRITE_LOCK(); } @@ -378,7 +378,7 @@ __aclinit_handler ( Slapi_Entry *e, void *callback_data) aclutil_print_err(rv, e_sdn, NULL, NULL); /* We got an error; Log it and then march along */ - slapi_log_error(SLAPI_LOG_ERR, plugin_name, + slapi_log_err(SLAPI_LOG_ERR, plugin_name, "__aclinit_handler - ACLs not deleted from %s\n", slapi_sdn_get_dn(e_sdn)); call_back_data->retCode = rv; @@ -428,14 +428,14 @@ __aclinit__RegisterAttributes(void) rv = ACL_MethodRegister(&errp, DS_METHOD, &methodinfo); if (rv < 0) { acl_print_acllib_err(&errp, NULL); - slapi_log_error(SLAPI_LOG_ERR, plugin_name, + slapi_log_err(SLAPI_LOG_ERR, plugin_name, "__aclinit__RegisterAttributes - Unable to Register the methods\n"); return ACL_ERR; } rv = ACL_MethodSetDefault (&errp, methodinfo); if (rv < 0) { acl_print_acllib_err(&errp, NULL); - slapi_log_error(SLAPI_LOG_ERR, plugin_name, + slapi_log_err(SLAPI_LOG_ERR, plugin_name, "__aclinit__RegisterAttributes - Unable to Set the default method\n"); return ACL_ERR; } @@ -443,7 +443,7 @@ __aclinit__RegisterAttributes(void) methodinfo, ACL_DBTYPE_ANY, ACL_AT_FRONT, NULL); if (rv < 0) { acl_print_acllib_err(&errp, NULL); - slapi_log_error(SLAPI_LOG_ERR, plugin_name, + slapi_log_err(SLAPI_LOG_ERR, plugin_name, "__aclinit__RegisterAttributes - Unable to Register Attr ip\n"); return ACL_ERR; } @@ -451,7 +451,7 @@ __aclinit__RegisterAttributes(void) methodinfo, ACL_DBTYPE_ANY, ACL_AT_FRONT, NULL); if (rv < 0) { acl_print_acllib_err(&errp, NULL); - slapi_log_error(SLAPI_LOG_ERR, plugin_name, + slapi_log_err(SLAPI_LOG_ERR, plugin_name, "__aclinit__RegisterAttributes - Unable to Register Attr dns\n"); return ACL_ERR; } @@ -482,66 +482,66 @@ __aclinit__RegisterLases(void) if (ACL_LasRegister(NULL, DS_LAS_USER, (LASEvalFunc_t) DS_LASUserEval, (LASFlushFunc_t) NULL) < 0) { - slapi_log_error(SLAPI_LOG_ERR, plugin_name, + slapi_log_err(SLAPI_LOG_ERR, plugin_name, "__aclinit__RegisterLases - Unable to register USER Las\n"); return ACL_ERR; } if (ACL_LasRegister(NULL, DS_LAS_GROUP, (LASEvalFunc_t) DS_LASGroupEval, (LASFlushFunc_t) NULL) < 0) { - slapi_log_error(SLAPI_LOG_ERR, plugin_name, + slapi_log_err(SLAPI_LOG_ERR, plugin_name, "__aclinit__RegisterLases - Unable to register GROUP Las\n"); return ACL_ERR; } if (ACL_LasRegister(NULL, DS_LAS_GROUPDN, (LASEvalFunc_t)DS_LASGroupDnEval, (LASFlushFunc_t)NULL) < 0) { - slapi_log_error(SLAPI_LOG_ERR, plugin_name, + slapi_log_err(SLAPI_LOG_ERR, plugin_name, "__aclinit__RegisterLases - Unable to register GROUPDN Las\n"); return ACL_ERR; } if (ACL_LasRegister(NULL, DS_LAS_ROLEDN, (LASEvalFunc_t)DS_LASRoleDnEval, (LASFlushFunc_t)NULL) < 0) { - slapi_log_error(SLAPI_LOG_ERR, plugin_name, + slapi_log_err(SLAPI_LOG_ERR, plugin_name, "__aclinit__RegisterLases - Unable to register ROLEDN Las\n"); return ACL_ERR; } if (ACL_LasRegister(NULL, DS_LAS_USERDN, (LASEvalFunc_t)DS_LASUserDnEval, (LASFlushFunc_t)NULL) < 0) { - slapi_log_error(SLAPI_LOG_ERR, plugin_name, + slapi_log_err(SLAPI_LOG_ERR, plugin_name, "__aclinit__RegisterLases - Unable to register USERDN Las\n"); return ACL_ERR; } if (ACL_LasRegister(NULL, DS_LAS_USERDNATTR, (LASEvalFunc_t)DS_LASUserDnAttrEval, (LASFlushFunc_t)NULL) < 0) { - slapi_log_error(SLAPI_LOG_ERR, plugin_name, + slapi_log_err(SLAPI_LOG_ERR, plugin_name, "__aclinit__RegisterLases - Unable to register USERDNATTR Las\n"); return ACL_ERR; } if (ACL_LasRegister(NULL, DS_LAS_AUTHMETHOD, (LASEvalFunc_t)DS_LASAuthMethodEval, (LASFlushFunc_t)NULL) < 0) { - slapi_log_error(SLAPI_LOG_ERR, plugin_name, + slapi_log_err(SLAPI_LOG_ERR, plugin_name, "__aclinit__RegisterLases - Unable to register CLIENTAUTHTYPE Las\n"); return ACL_ERR; } if (ACL_LasRegister(NULL, DS_LAS_GROUPDNATTR, (LASEvalFunc_t)DS_LASGroupDnAttrEval, (LASFlushFunc_t)NULL) < 0) { - slapi_log_error(SLAPI_LOG_ERR, plugin_name, + slapi_log_err(SLAPI_LOG_ERR, plugin_name, "__aclinit__RegisterLases - Unable to register GROUPDNATTR Las\n"); return ACL_ERR; } if (ACL_LasRegister(NULL, DS_LAS_USERATTR, (LASEvalFunc_t)DS_LASUserAttrEval, (LASFlushFunc_t)NULL) < 0) { - slapi_log_error(SLAPI_LOG_ERR, plugin_name, + slapi_log_err(SLAPI_LOG_ERR, plugin_name, "__aclinit__RegisterLases - Unable to register USERATTR Las\n"); return ACL_ERR; } if (ACL_LasRegister(NULL, DS_LAS_SSF, (LASEvalFunc_t)DS_LASSSFEval, (LASFlushFunc_t)NULL) < 0) { - slapi_log_error(SLAPI_LOG_ERR, plugin_name, + slapi_log_err(SLAPI_LOG_ERR, plugin_name, "__aclinit__RegisterLases - Unable to register SSF Las\n"); return ACL_ERR; } diff --git a/ldap/servers/plugins/acl/acllas.c b/ldap/servers/plugins/acl/acllas.c index 9ed8ea4..172e1a7 100644 --- a/ldap/servers/plugins/acl/acllas.c +++ b/ldap/servers/plugins/acl/acllas.c @@ -259,35 +259,35 @@ DS_LASIpGetter(NSErr_t *errp, PList_t subject, PList_t resource, PList_t rv = ACL_GetAttribute(errp, DS_PROP_ACLPB, (void **)&aclpb, subject, resource, auth_info, global_auth); if ( rv != LAS_EVAL_TRUE || ( NULL == aclpb )) { acl_print_acllib_err(errp, NULL); - slapi_log_error(SLAPI_LOG_ACL, plugin_name, + slapi_log_err(SLAPI_LOG_ACL, plugin_name, "DS_LASIpGetter:Unable to get the ACLPB(%d)\n", rv); return LAS_EVAL_FAIL; } client_praddr = (PRNetAddr *)slapi_ch_malloc(sizeof(PRNetAddr)); if(client_praddr == NULL){ - slapi_log_error(SLAPI_LOG_ERR, plugin_name, "DS_LASIpGetter - Failed to allocate client_praddr\n"); + slapi_log_err(SLAPI_LOG_ERR, plugin_name, "DS_LASIpGetter - Failed to allocate client_praddr\n"); return( LAS_EVAL_FAIL ); } if ( slapi_pblock_get( aclpb->aclpb_pblock, SLAPI_CONN_CLIENTNETADDR, client_praddr ) != 0 ) { - slapi_log_error(SLAPI_LOG_ERR, plugin_name, "DS_LASIpGetter - Could not get client IP.\n" ); + slapi_log_err(SLAPI_LOG_ERR, plugin_name, "DS_LASIpGetter - Could not get client IP.\n" ); slapi_ch_free((void **)&client_praddr); return( LAS_EVAL_FAIL ); } rv = PListInitProp(subject, 0, ACL_ATTR_IP, (void *)client_praddr, NULL); if (rv < 0) { - slapi_log_error(SLAPI_LOG_ACL, plugin_name, "DS_LASIpGetter - " + slapi_log_err(SLAPI_LOG_ACL, plugin_name, "DS_LASIpGetter - " "Couldn't set the client addr property(%d)\n", rv ); slapi_ch_free((void **)&client_praddr); return LAS_EVAL_FAIL; } if( PR_NetAddrToString(client_praddr, ip_str, sizeof(ip_str)) == PR_SUCCESS){ - slapi_log_error(SLAPI_LOG_ACL, plugin_name, "DS_LASIpGetter - " + slapi_log_err(SLAPI_LOG_ACL, plugin_name, "DS_LASIpGetter - " "Returning client ip address '%s'\n", ip_str); } else { - slapi_log_error(SLAPI_LOG_ACL, plugin_name, "DS_LASIpGetter - " + slapi_log_err(SLAPI_LOG_ACL, plugin_name, "DS_LASIpGetter - " "Returning client ip address 'unknown'\n"); } @@ -317,13 +317,13 @@ DS_LASDnsGetter(NSErr_t *errp, PList_t subject, PList_t resource, PList_t subject, resource, auth_info, global_auth); if ( rv != LAS_EVAL_TRUE || ( NULL == aclpb )) { acl_print_acllib_err(errp, NULL); - slapi_log_error(SLAPI_LOG_ACL, plugin_name, + slapi_log_err(SLAPI_LOG_ACL, plugin_name, "DS_LASDnsGetter - Unable to get the ACLPB(%d)\n", rv); return LAS_EVAL_FAIL; } if ( slapi_pblock_get( aclpb->aclpb_pblock, SLAPI_CLIENT_DNS, &clientDns ) != 0 ) { - slapi_log_error(SLAPI_LOG_ERR, plugin_name, "DS_LASDnsGetter - Could not get client IP.\n" ); + slapi_log_err(SLAPI_LOG_ERR, plugin_name, "DS_LASDnsGetter - Could not get client IP.\n" ); return( LAS_EVAL_FAIL ); } @@ -346,7 +346,7 @@ DS_LASDnsGetter(NSErr_t *errp, PList_t subject, PList_t resource, PList_t if ( slapi_pblock_get( aclpb->aclpb_pblock, SLAPI_CONN_CLIENTNETADDR, &client_praddr ) != 0 ) { - slapi_log_error(SLAPI_LOG_ERR, plugin_name, "DS_LASDnsGetter - Could not get client IP.\n" ); + slapi_log_err(SLAPI_LOG_ERR, plugin_name, "DS_LASDnsGetter - Could not get client IP.\n" ); return( LAS_EVAL_FAIL ); } hp = (PRHostEnt *)slapi_ch_malloc( sizeof(PRHostEnt) ); @@ -368,11 +368,11 @@ DS_LASDnsGetter(NSErr_t *errp, PList_t subject, PList_t resource, PList_t rv = PListInitProp(subject, 0, ACL_ATTR_DNS, dnsName, NULL); if (rv < 0) { - slapi_log_error(SLAPI_LOG_ACL, plugin_name, + slapi_log_err(SLAPI_LOG_ACL, plugin_name, "DS_LASDnsGetter - Couldn't set the DNS property(%d)\n", rv ); return LAS_EVAL_FAIL; } - slapi_log_error(SLAPI_LOG_ACL, plugin_name, "DS_LASDnsGetter - DNS name: %s\n", dnsName ); + slapi_log_err(SLAPI_LOG_ACL, plugin_name, "DS_LASDnsGetter - DNS name: %s\n", dnsName ); return LAS_EVAL_TRUE; } @@ -395,7 +395,7 @@ DS_LASUserEval(NSErr_t *errp, char *attr_name, CmpOp_t comparator, PList_t subject, PList_t resource, PList_t auth_info, PList_t global_auth) { - slapi_log_error(SLAPI_LOG_ERR, plugin_name, + slapi_log_err(SLAPI_LOG_ERR, plugin_name, "DS_LASUserEval - User LAS is not supported in the ACL\n"); return LAS_EVAL_INVALID; @@ -407,7 +407,7 @@ DS_LASGroupEval(NSErr_t *errp, char *attr_name, CmpOp_t comparator, PList_t subject, PList_t resource, PList_t auth_info, PList_t global_auth) { - slapi_log_error(SLAPI_LOG_ERR, plugin_name, + slapi_log_err(SLAPI_LOG_ERR, plugin_name, "DS_LASGroupEval - Group LAS is not supported in the ACL\n"); return LAS_EVAL_INVALID; @@ -513,7 +513,7 @@ DS_LASUserDnEval(NSErr_t *errp, char *attr_name, CmpOp_t comparator, user += LDAPS_URL_prefix_len; } else { char ebuf[ BUFSIZ ]; - slapi_log_error(SLAPI_LOG_ERR, plugin_name, + slapi_log_err(SLAPI_LOG_ERR, plugin_name, "DS_LASUserDnEval - Syntax error(%s)\n", escape_string_with_punctuation( user, ebuf )); return LAS_EVAL_FAIL; @@ -630,7 +630,7 @@ DS_LASUserDnEval(NSErr_t *errp, char *attr_name, CmpOp_t comparator, if (( filterChoice != LDAP_FILTER_SUBSTRINGS) && ( filterChoice != LDAP_FILTER_PRESENT)) { - slapi_log_error(SLAPI_LOG_ACL, plugin_name, + slapi_log_err(SLAPI_LOG_ACL, plugin_name, "DS_LASUserDnEval - Error in gen. filter(%s)\n", user); } if ((rc = acl_match_substring( f, @@ -642,7 +642,7 @@ DS_LASUserDnEval(NSErr_t *errp, char *attr_name, CmpOp_t comparator, break; } if (rc == ACL_ERR) { - slapi_log_error(SLAPI_LOG_ACL, plugin_name, + slapi_log_err(SLAPI_LOG_ACL, plugin_name, "DS_LASUserDnEval - Error in matching patteren(%s)\n", user); } @@ -651,7 +651,7 @@ DS_LASUserDnEval(NSErr_t *errp, char *attr_name, CmpOp_t comparator, /* Must be a simple dn then */ char *normed = slapi_create_dn_string("%s", user); if (NULL == normed) { - slapi_log_error(SLAPI_LOG_ERR, plugin_name, + slapi_log_err(SLAPI_LOG_ERR, plugin_name, "DS_LASUserDnEval - Error in normalizing dn(%s)\n", user); normed = user; } @@ -689,7 +689,7 @@ DS_LASUserDnEval(NSErr_t *errp, char *attr_name, CmpOp_t comparator, } } else { rc = LAS_EVAL_FAIL; - slapi_log_error(SLAPI_LOG_ACL, plugin_name, + slapi_log_err(SLAPI_LOG_ACL, plugin_name, "DS_LASUserDnEval - Returning UNDEFINED for userdn evaluation.\n"); } @@ -773,7 +773,7 @@ DS_LASGroupDnEval(NSErr_t *errp, char *attr_name, CmpOp_t comparator, groupName += LDAP_URL_prefix_len; } else { char ebuf[ BUFSIZ ]; - slapi_log_error(SLAPI_LOG_ERR, plugin_name, + slapi_log_err(SLAPI_LOG_ERR, plugin_name, "DS_LASGroupDnEval - Syntax error(%s)\n", escape_string_with_punctuation( groupName, ebuf )); } @@ -822,7 +822,7 @@ DS_LASGroupDnEval(NSErr_t *errp, char *attr_name, CmpOp_t comparator, break; } else if ( lasinfo.anomUser && (lasinfo.aclpb->aclpb_clientcert == NULL) && (!any_group)) { - slapi_log_error(SLAPI_LOG_ACL, plugin_name, + slapi_log_err(SLAPI_LOG_ACL, plugin_name, "DS_LASGroupDnEval - Group not evaluated(%s)\n", groupName); break; } else { @@ -831,7 +831,7 @@ DS_LASGroupDnEval(NSErr_t *errp, char *attr_name, CmpOp_t comparator, (PL_strcasestr (groupName, ACL_RULE_MACRO_ATTR_KEY) != NULL)) { matched = aclutil_evaluate_macro( groupName, &lasinfo, ACL_EVAL_GROUP); - slapi_log_error(SLAPI_LOG_ACL, plugin_name, + slapi_log_err(SLAPI_LOG_ACL, plugin_name, "DS_LASGroupDnEval - Param group name:%s\n", groupName); } else { @@ -882,7 +882,7 @@ DS_LASGroupDnEval(NSErr_t *errp, char *attr_name, CmpOp_t comparator, } else { if (urlerr) { - slapi_log_error(SLAPI_LOG_ACL, plugin_name, + slapi_log_err(SLAPI_LOG_ACL, plugin_name, "DS_LASGroupDnEval - Groupname [%s] not a valid ldap url: %d (%s)\n", groupNameOrig, urlerr, slapi_urlparse_err2string(urlerr)); } @@ -919,7 +919,7 @@ DS_LASGroupDnEval(NSErr_t *errp, char *attr_name, CmpOp_t comparator, } } else { rc = LAS_EVAL_FAIL; - slapi_log_error(SLAPI_LOG_ACL, plugin_name, + slapi_log_err(SLAPI_LOG_ACL, plugin_name, "DS_LASGroupDnEval - Returning UNDEFINED for groupdn evaluation.\n"); } @@ -999,7 +999,7 @@ DS_LASRoleDnEval(NSErr_t *errp, char *attr_name, CmpOp_t comparator, role += LDAP_URL_prefix_len; } else { char ebuf[ BUFSIZ ]; - slapi_log_error(SLAPI_LOG_ERR, plugin_name, + slapi_log_err(SLAPI_LOG_ERR, plugin_name, "DS_LASRoleDnEval - Syntax error(%s)\n", escape_string_with_punctuation( role, ebuf )); } @@ -1039,7 +1039,7 @@ DS_LASRoleDnEval(NSErr_t *errp, char *attr_name, CmpOp_t comparator, break; } else if ( lasinfo.anomUser && (lasinfo.aclpb->aclpb_clientcert == NULL) && (!any_role)) { - slapi_log_error(SLAPI_LOG_ACL, plugin_name, + slapi_log_err(SLAPI_LOG_ACL, plugin_name, "DS_LASRoleDnEval - Role not evaluated(%s) for anon user\n", role); break; } else { @@ -1051,7 +1051,7 @@ DS_LASRoleDnEval(NSErr_t *errp, char *attr_name, CmpOp_t comparator, matched = aclutil_evaluate_macro( role, &lasinfo, ACL_EVAL_ROLE); - slapi_log_error(SLAPI_LOG_ACL, plugin_name, + slapi_log_err(SLAPI_LOG_ACL, plugin_name, "DS_LASRoleDnEval - Param role name:%s\n", role); } else {/* normal evaluation */ @@ -1085,7 +1085,7 @@ DS_LASRoleDnEval(NSErr_t *errp, char *attr_name, CmpOp_t comparator, } } else { rc = LAS_EVAL_FAIL; - slapi_log_error(SLAPI_LOG_ACL, plugin_name, + slapi_log_err(SLAPI_LOG_ACL, plugin_name, "DS_LASRoleDnEval - Returning UNDEFINED for roledn evaluation.\n"); } @@ -1144,7 +1144,7 @@ DS_LASUserDnAttrEval(NSErr_t *errp, char *attr_name, CmpOp_t comparator, if (attr_name == NULL || (strcmp(DS_LAS_SELFDNATTR, attr_name) && strcmp(DS_LAS_USERDNATTR, attr_name))) { - slapi_log_error(SLAPI_LOG_ERR, plugin_name, + slapi_log_err(SLAPI_LOG_ERR, plugin_name, "DS_LASUserDnAttrEval - Invalid attr_name (should be %s or %s)\n", DS_LAS_SELFDNATTR, DS_LAS_USERDNATTR); return LAS_EVAL_FAIL; @@ -1212,7 +1212,7 @@ DS_LASUserDnAttrEval(NSErr_t *errp, char *attr_name, CmpOp_t comparator, * Here, ignore the extra levels..it's really * a syntax error which should have been ruled out at parse time */ - slapi_log_error(SLAPI_LOG_ERR, plugin_name, + slapi_log_err(SLAPI_LOG_ERR, plugin_name, "DS_LASUserDnAttrEval - Exceeded the ATTR LIMIT:%d: Ignoring extra levels\n", ACLLAS_MAX_LEVELS); } @@ -1243,7 +1243,7 @@ DS_LASUserDnAttrEval(NSErr_t *errp, char *attr_name, CmpOp_t comparator, return LAS_EVAL_FAIL; } - slapi_log_error(SLAPI_LOG_ACL, plugin_name,"Attr:%s\n" , attrName); + slapi_log_err(SLAPI_LOG_ACL, plugin_name,"Attr:%s\n" , attrName); matched = ACL_FALSE; for (i=0; i < numOflevels; i++) { if ( levels[i] == 0 ) { @@ -1262,10 +1262,10 @@ DS_LASUserDnAttrEval(NSErr_t *errp, char *attr_name, CmpOp_t comparator, if ( lasinfo.aclpb->aclpb_optype == SLAPI_OPERATION_ADD) { if (selfdn) { - slapi_log_error(SLAPI_LOG_ACL, plugin_name, + slapi_log_err(SLAPI_LOG_ACL, plugin_name, "DS_LASUserDnAttrEval - ACL info: %s DOES allow ADD permission at level 0.\n", attr_name); } else { - slapi_log_error(SLAPI_LOG_ACL, plugin_name, + slapi_log_err(SLAPI_LOG_ACL, plugin_name, "DS_LASUserDnAttrEval - ACL info: %s does not allow ADD permission at level 0.\n", attr_name); got_undefined = 1; continue; @@ -1280,7 +1280,7 @@ DS_LASUserDnAttrEval(NSErr_t *errp, char *attr_name, CmpOp_t comparator, */ slapi_attr_get_numvalues((const Slapi_Attr *) a, &numValues); if (numValues != 1) { - slapi_log_error(SLAPI_LOG_ACL, plugin_name, + slapi_log_err(SLAPI_LOG_ACL, plugin_name, "DS_LASUserDnAttrEval - Failed because the retrieved %s in resource has more than one value (%d)\n", attrName, numValues); got_undefined = 1; @@ -1293,7 +1293,7 @@ DS_LASUserDnAttrEval(NSErr_t *errp, char *attr_name, CmpOp_t comparator, /* Here if atleast 1 value matches then we are done.*/ val = slapi_create_dn_string("%s", attrVal->bv_val); if (NULL == val) { - slapi_log_error(SLAPI_LOG_ERR, plugin_name, + slapi_log_err(SLAPI_LOG_ERR, plugin_name, "DS_LASUserDnAttrEval - Invalid syntax: %s\n", attrVal->bv_val ); slapi_ch_free ( (void**) &s_attrName); @@ -1303,7 +1303,7 @@ DS_LASUserDnAttrEval(NSErr_t *errp, char *attr_name, CmpOp_t comparator, if (slapi_utf8casecmp((ACLUCHP)val, (ACLUCHP)lasinfo.clientDn ) == 0) { char ebuf [ BUFSIZ ]; /* Wow it matches */ - slapi_log_error(SLAPI_LOG_ACL, plugin_name, + slapi_log_err(SLAPI_LOG_ACL, plugin_name, "DS_LASUserDnAttrEval - %s matches(%s, %s) level (%d)\n", attr_name, val, ACL_ESCAPE_STRING_WITH_PUNCTUATION (lasinfo.clientDn, ebuf), 0); matched = ACL_TRUE; @@ -1353,7 +1353,7 @@ DS_LASUserDnAttrEval(NSErr_t *errp, char *attr_name, CmpOp_t comparator, */ if (info.result) { matched = ACL_TRUE; - slapi_log_error(SLAPI_LOG_ACL, plugin_name, + slapi_log_err(SLAPI_LOG_ACL, plugin_name, "DS_LASUserDnAttrEval - %s matches at level (%d)\n", attr_name, levels[i]); } } @@ -1377,7 +1377,7 @@ DS_LASUserDnAttrEval(NSErr_t *errp, char *attr_name, CmpOp_t comparator, } } else { rc = LAS_EVAL_FAIL; - slapi_log_error(SLAPI_LOG_ACL, plugin_name, + slapi_log_err(SLAPI_LOG_ACL, plugin_name, "DS_LASUserDnAttrEval - Returning UNDEFINED for %s evaluation.\n", attr_name); } @@ -1476,7 +1476,7 @@ DS_LASLdapUrlAttrEval(NSErr_t *errp, char *attr_name, CmpOp_t comparator, * Here, ignore the extra levels..it's really * a syntax error which should have been ruled out at parse time */ - slapi_log_error(SLAPI_LOG_WARNING, plugin_name, + slapi_log_err(SLAPI_LOG_WARNING, plugin_name, "DS_LASLdapUrlAttrEval - Exceeded the ATTR LIMIT:%d: Ignoring extra levels\n", ACLLAS_MAX_LEVELS); } @@ -1508,7 +1508,7 @@ DS_LASLdapUrlAttrEval(NSErr_t *errp, char *attr_name, CmpOp_t comparator, return LAS_EVAL_FAIL; } - slapi_log_error(SLAPI_LOG_ACL, plugin_name, "DS_LASLdapUrlAttrEval - Attr:%s\n", attrName); + slapi_log_err(SLAPI_LOG_ACL, plugin_name, "DS_LASLdapUrlAttrEval - Attr:%s\n", attrName); matched = ACL_FALSE; for (i = 0; i < numOflevels; i++) { if ( levels[i] == 0 ) { /* parent[0] or the target itself */ @@ -1583,7 +1583,7 @@ DS_LASLdapUrlAttrEval(NSErr_t *errp, char *attr_name, CmpOp_t comparator, */ if (info.result) { matched = ACL_TRUE; - slapi_log_error(SLAPI_LOG_ACL, plugin_name, + slapi_log_err(SLAPI_LOG_ACL, plugin_name, "DS_LASLdapUrlAttrEval - userdnAttr matches at level (%d)\n", levels[i]); } } @@ -1607,7 +1607,7 @@ DS_LASLdapUrlAttrEval(NSErr_t *errp, char *attr_name, CmpOp_t comparator, } } else { rc = LAS_EVAL_FAIL; - slapi_log_error(SLAPI_LOG_ACL, plugin_name, + slapi_log_err(SLAPI_LOG_ACL, plugin_name, "DS_LASLdapUrlAttrEval - Returning UNDEFINED for userdnattr evaluation.\n"); } @@ -1676,7 +1676,7 @@ DS_LASAuthMethodEval(NSErr_t *errp, char *attr_name, CmpOp_t comparator, LDAP_UTF8DEC(ptr); } - slapi_log_error(SLAPI_LOG_ACL, plugin_name, + slapi_log_err(SLAPI_LOG_ACL, plugin_name, "DS_LASAuthMethodEval - authtype:%s authmethod:%s\n", lasinfo.authType, attr); @@ -1756,23 +1756,23 @@ DS_LASSSFEval(NSErr_t *errp, char *attr_name, CmpOp_t comparator, aclssf = (int) strtol(attr, &ptr, 10); if (*ptr != '\0') { rc = LAS_EVAL_FAIL; - slapi_log_error(SLAPI_LOG_ACL, plugin_name, + slapi_log_err(SLAPI_LOG_ACL, plugin_name, "DS_LASSSFEval - Error parsing numeric SSF from bind rule.\n"); - slapi_log_error(SLAPI_LOG_ACL, plugin_name, + slapi_log_err(SLAPI_LOG_ACL, plugin_name, "DS_LASSSFEval - Returning UNDEFINED for ssf evaluation.\n"); } /* Check for negative values or a value overflow. */ if ((aclssf < 0) || (((aclssf == INT_MAX) || (aclssf == INT_MIN)) && (errno == ERANGE))){ rc = LAS_EVAL_FAIL; - slapi_log_error(SLAPI_LOG_ACL, plugin_name, + slapi_log_err(SLAPI_LOG_ACL, plugin_name, "DS_LASSSFEval - SSF \"%s\" is invalid. Value must range from 0 to %d", attr, INT_MAX); - slapi_log_error(SLAPI_LOG_ACL, plugin_name, + slapi_log_err(SLAPI_LOG_ACL, plugin_name, "DS_LASSSFEval - Returning UNDEFINED for ssf evaluation.\n"); } - slapi_log_error(SLAPI_LOG_ACL, plugin_name, + slapi_log_err(SLAPI_LOG_ACL, plugin_name, "DS_LASSSFEval - aclssf:%d, ssf:%d\n", aclssf, lasinfo.ssf); @@ -1824,10 +1824,10 @@ DS_LASSSFEval(NSErr_t *errp, char *attr_name, CmpOp_t comparator, * validated by __acllas_setup(), but better safe * than sorry. */ rc = LAS_EVAL_FAIL; - slapi_log_error(SLAPI_LOG_ACL, plugin_name, + slapi_log_err(SLAPI_LOG_ACL, plugin_name, "DS_LASSSFEval - Invalid comparator \"%d\" evaluating SSF.\n", (int)comparator); - slapi_log_error(SLAPI_LOG_ACL, plugin_name, + slapi_log_err(SLAPI_LOG_ACL, plugin_name, "DS_LASSSFEval - Returning UNDEFINED for ssf evaluation.\n"); } @@ -1911,7 +1911,7 @@ dump_eval_info (char *caller, struct eval_info *info, int idx) sprintf ( &buf[len], "\n [%d]: ", i ); dump_member_info ( info, info->memberInfo[i], buf ); } - slapi_log_error(SLAPI_LOG_DEBUG, plugin_name, "\n======== candidate member info in eval_info ========%s\n\n", buf ); + slapi_log_err(SLAPI_LOG_DEBUG, plugin_name, "\n======== candidate member info in eval_info ========%s\n\n", buf ); } else { @@ -1987,33 +1987,33 @@ acllas__user_ismember_of_group( struct acl_pblock *aclpb, ** a member of the cached list of groups. */ if ( (u_group = aclg_get_usersGroup ( aclpb , clientDN )) == NULL) { - slapi_log_error(SLAPI_LOG_ACL, plugin_name, + slapi_log_err(SLAPI_LOG_ACL, plugin_name, "acllas__user_ismember_of_group - Failed to find/allocate a usergroup--aborting evaluation\n"); return(ACL_DONT_KNOW); } - slapi_log_error(SLAPI_LOG_ACL, plugin_name, "acllas__user_ismember_of_group - Evaluating user %s in group %s?\n", + slapi_log_err(SLAPI_LOG_ACL, plugin_name, "acllas__user_ismember_of_group - Evaluating user %s in group %s?\n", clientDN, groupDN ); /* Before I start using, get a reader lock on the group cache */ aclg_lock_groupCache ( 1 /* reader */ ); for ( i= 0; i < u_group->aclug_numof_member_group; i++) { - slapi_log_error(SLAPI_LOG_ACL, plugin_name, "-- In %s\n", + slapi_log_err(SLAPI_LOG_ACL, plugin_name, "-- In %s\n", u_group->aclug_member_groups[i] ); if ( slapi_utf8casecmp((ACLUCHP)groupDN, (ACLUCHP)u_group->aclug_member_groups[i]) == 0){ aclg_unlock_groupCache ( 1 /* reader */ ); - slapi_log_error(SLAPI_LOG_ACL, plugin_name, "acllas__user_ismember_of_group - Evaluated ACL_TRUE\n"); + slapi_log_err(SLAPI_LOG_ACL, plugin_name, "acllas__user_ismember_of_group - Evaluated ACL_TRUE\n"); return ACL_TRUE; } } /* see if we know the client is not a member of a group. */ for ( i= 0; i < u_group->aclug_numof_notmember_group; i++) { - slapi_log_error(SLAPI_LOG_ACL, plugin_name, "-- Not in %s\n", + slapi_log_err(SLAPI_LOG_ACL, plugin_name, "-- Not in %s\n", u_group->aclug_notmember_groups[i] ); if ( slapi_utf8casecmp((ACLUCHP)groupDN, (ACLUCHP)u_group->aclug_notmember_groups[i]) == 0){ aclg_unlock_groupCache ( 1 /* reader */ ); - slapi_log_error(SLAPI_LOG_ACL, plugin_name, "acllas__user_ismember_of_group - Evaluated ACL_FALSE\n"); + slapi_log_err(SLAPI_LOG_ACL, plugin_name, "acllas__user_ismember_of_group - Evaluated ACL_FALSE\n"); return ACL_FALSE; } } @@ -2098,9 +2098,9 @@ eval_another_member: NULL /* referral_callback */); if ( info.result == ACL_TRUE ) - slapi_log_error(SLAPI_LOG_ACL, plugin_name,"acllas__user_ismember_of_group - In %s\n", info.memberInfo[info.c_idx]->member ); + slapi_log_err(SLAPI_LOG_ACL, plugin_name,"acllas__user_ismember_of_group - In %s\n", info.memberInfo[info.c_idx]->member ); else if ( info.result == ACL_FALSE ) - slapi_log_error(SLAPI_LOG_ACL, plugin_name,"acllas__user_ismember_of_group - Not in %s\n", info.memberInfo[info.c_idx]->member ); + slapi_log_err(SLAPI_LOG_ACL, plugin_name,"acllas__user_ismember_of_group - Not in %s\n", info.memberInfo[info.c_idx]->member ); slapi_pblock_destroy (aPb); } @@ -2111,7 +2111,7 @@ eval_another_member: ** group or one of the nested groups. We are done. */ result = ACL_TRUE; - slapi_log_error(SLAPI_LOG_ACL, plugin_name, "acllas__user_ismember_of_group - Evaluated ACL_TRUE\n"); + slapi_log_err(SLAPI_LOG_ACL, plugin_name, "acllas__user_ismember_of_group - Evaluated ACL_TRUE\n"); goto free_and_return; } numOfMembersVisited++; @@ -2132,7 +2132,7 @@ eval_another_member: } if ((nesting_level > max_nestlevel)) { - slapi_log_error(SLAPI_LOG_ACL, plugin_name, + slapi_log_err(SLAPI_LOG_ACL, plugin_name, "acllas__user_ismember_of_group - Member not found within the allowed nesting level (Allowed:%d Looked at:%d)\n", max_nestlevel, nesting_level); @@ -2143,7 +2143,7 @@ eval_another_member: /* limit of -1 means "no limit */ if (info.c_idx > max_memberlimit && max_memberlimit != -1 ) { - slapi_log_error(SLAPI_LOG_ACL, plugin_name, + slapi_log_err(SLAPI_LOG_ACL, plugin_name, "acllas__user_ismember_of_group - Looked at too many entries:(%d, %d)\n", info.c_idx, info.lu_idx); result = ACL_DONT_KNOW; /* don't try to cache info based on this result */ @@ -2272,7 +2272,7 @@ free_and_return: ACLUG_INCR_GROUPS_LIST; } u_group->aclug_member_groups[ngr] = slapi_ch_strdup ( groupMember->member ); - slapi_log_error(SLAPI_LOG_ACL, plugin_name, + slapi_log_err(SLAPI_LOG_ACL, plugin_name, "acllas__user_ismember_of_group - Adding Group (%s) ParentGroup (%s) to the IN GROUP List\n", groupMember->member , parentGroup ? parentGroup->member: "NULL"); @@ -2317,7 +2317,7 @@ free_and_return: ACLUG_INCR_GROUPS_LIST; } u_group->aclug_notmember_groups[ngr] = slapi_ch_strdup ( groupMember->member ); - slapi_log_error(SLAPI_LOG_ACL, plugin_name, + slapi_log_err(SLAPI_LOG_ACL, plugin_name, "acllas__user_ismember_of_group - Adding Group (%s) ParentGroup (%s) to the NOT IN GROUP List\n", groupMember->member , parentGroup ? parentGroup->member: "NULL"); @@ -2330,7 +2330,7 @@ free_and_return: * We terminated the search without reaching a conclusion--so * don't cache any info based on this evaluation. */ - slapi_log_error(SLAPI_LOG_ACL, plugin_name, "acllas__user_ismember_of_group - Evaluated ACL_DONT_KNOW\n"); + slapi_log_err(SLAPI_LOG_ACL, plugin_name, "acllas__user_ismember_of_group - Evaluated ACL_DONT_KNOW\n"); } /* Unlock the group cache, we are done with updating */ @@ -2399,14 +2399,14 @@ acllas__handle_group_entry (Slapi_Entry* e, void *callback_data) attrVal = slapi_value_get_berval ( sval ); n_dn = slapi_create_dn_string( "%s", attrVal->bv_val ); if (NULL == n_dn) { - slapi_log_error(SLAPI_LOG_ERR, plugin_name, + slapi_log_err(SLAPI_LOG_ERR, plugin_name, "acllas__handle_group_entry - Invalid syntax: %s\n", attrVal->bv_val ); return 0; } n = ++info->lu_idx; if (n < 0) { - slapi_log_error(SLAPI_LOG_ERR, plugin_name, + slapi_log_err(SLAPI_LOG_ERR, plugin_name, "acllas__handle_group_entry - Last member index lu_idx is overflown:%d: Too many group ACL members\n", n); slapi_ch_free_string(&n_dn); return 0; @@ -2418,7 +2418,7 @@ acllas__handle_group_entry (Slapi_Entry* e, void *callback_data) (n + ACLLAS_MAX_GRP_MEMBER) * sizeof(struct member_info *)); if (!info->memberInfo) { - slapi_log_error(SLAPI_LOG_ERR, plugin_name, + slapi_log_err(SLAPI_LOG_ERR, plugin_name, "acllas__handle_group_entry - Out of memory - could not allocate space for %d group members\n", n + ACLLAS_MAX_GRP_MEMBER ); info->memberInfo = orig_memberInfo; @@ -2463,12 +2463,12 @@ acllas__handle_group_entry (Slapi_Entry* e, void *callback_data) savURL = memberURL = slapi_create_dn_string("%s", attrVal->bv_val); if (NULL == savURL) { - slapi_log_error(SLAPI_LOG_ERR, plugin_name, + slapi_log_err(SLAPI_LOG_ERR, plugin_name, "acllas__handle_group_entry - Invalid syntax: %s\n", attrVal->bv_val ); return 0; } - slapi_log_error(SLAPI_LOG_ACL, plugin_name, + slapi_log_err(SLAPI_LOG_ACL, plugin_name, "acllas__handle_group_entry - MemberURL:%s\n", memberURL); info->result = acllas__client_match_URL ( info->aclpb, @@ -2479,7 +2479,7 @@ acllas__handle_group_entry (Slapi_Entry* e, void *callback_data) return 0; } else { /* This means that the URL is ill-formed */ - slapi_log_error(SLAPI_LOG_ACL, plugin_name, + slapi_log_err(SLAPI_LOG_ACL, plugin_name, "acllas__handle_group_entry - Badly Formed MemberURL:%s\n", attrVal->bv_val); } i = slapi_attr_next_value ( currAttr, i, &sval ); @@ -2488,7 +2488,7 @@ acllas__handle_group_entry (Slapi_Entry* e, void *callback_data) } else if ((strcasecmp (attrType, type_memberCert) == 0) ) { /* Do we have the certificate around */ if (!info->clientCert) { - slapi_log_error(SLAPI_LOG_ACL, plugin_name, + slapi_log_err(SLAPI_LOG_ACL, plugin_name, "acllas__handle_group_entry - Client Cert missing\n" ); /* cannot evaulate cert membership without cert - go to next attribute */ goto nextattr; @@ -2620,7 +2620,7 @@ DS_LASGroupDnAttrEval(NSErr_t *errp, char *attr_name, CmpOp_t comparator, LDAP_UTF8DEC(ptr); } - slapi_log_error(SLAPI_LOG_ACL, plugin_name,"DS_LASGroupDnAttrEval - Attr:%s\n" , attrName); + slapi_log_err(SLAPI_LOG_ACL, plugin_name,"DS_LASGroupDnAttrEval - Attr:%s\n" , attrName); /* See if we have a parent[2].attr" rule */ if (strstr(attrName, "parent[") != NULL) { @@ -2644,7 +2644,7 @@ DS_LASGroupDnAttrEval(NSErr_t *errp, char *attr_name, CmpOp_t comparator, * Here, ignore the extra levels..it's really * a syntax error which should have been ruled out at parse time */ - slapi_log_error(SLAPI_LOG_ERR, plugin_name, + slapi_log_err(SLAPI_LOG_ERR, plugin_name, "DS_LASGroupDnAttrEval - Exceeded the ATTR LIMIT:%d: Ignoring extra levels\n", ACLLAS_MAX_LEVELS); } @@ -2681,7 +2681,7 @@ DS_LASGroupDnAttrEval(NSErr_t *errp, char *attr_name, CmpOp_t comparator, */ if ( lasinfo.aclpb->aclpb_optype == SLAPI_OPERATION_ADD) { - slapi_log_error(SLAPI_LOG_ACL, plugin_name, + slapi_log_err(SLAPI_LOG_ACL, plugin_name, "DS_LASGroupDnAttrEval - ACL info: groupdnAttr does not allow ADD permission at level 0.\n"); got_undefined = 1; continue; @@ -2693,7 +2693,7 @@ DS_LASGroupDnAttrEval(NSErr_t *errp, char *attr_name, CmpOp_t comparator, attrVal = slapi_value_get_berval ( sval ); n_groupdn = slapi_create_dn_string("%s", attrVal->bv_val); if (NULL == n_groupdn) { - slapi_log_error(SLAPI_LOG_ERR, plugin_name, + slapi_log_err(SLAPI_LOG_ERR, plugin_name, "DS_LASGroupDnAttrEval - Invalid syntax: %s\n", attrVal->bv_val ); slapi_ch_free_string(&s_attrName); @@ -2705,7 +2705,7 @@ DS_LASGroupDnAttrEval(NSErr_t *errp, char *attr_name, CmpOp_t comparator, lasinfo.aclpb->aclpb_clientcert); slapi_ch_free ( (void **) &n_groupdn); if (matched == ACL_TRUE ) { - slapi_log_error(SLAPI_LOG_ACL, plugin_name, + slapi_log_err(SLAPI_LOG_ACL, plugin_name, "DS_LASGroupDnAttrEval - groupdnattr matches at level (%d)\n", levels[i]); break; } else if ( matched == ACL_DONT_KNOW ) { @@ -2782,7 +2782,7 @@ DS_LASGroupDnAttrEval(NSErr_t *errp, char *attr_name, CmpOp_t comparator, slapi_ch_free ((void **) &info.member); } if (matched == ACL_TRUE) { - slapi_log_error(SLAPI_LOG_ACL, plugin_name, + slapi_log_err(SLAPI_LOG_ACL, plugin_name, "DS_LASGroupDnAttrEval - groupdnattr matches at level (%d)\n", levels[i]); break; } else if ( matched == ACL_DONT_KNOW ) { @@ -2808,7 +2808,7 @@ DS_LASGroupDnAttrEval(NSErr_t *errp, char *attr_name, CmpOp_t comparator, } } else { rc = LAS_EVAL_FAIL; - slapi_log_error(SLAPI_LOG_ACL, plugin_name, + slapi_log_err(SLAPI_LOG_ACL, plugin_name, "DS_LASGroupDnAttrEval - Returning UNDEFINED for groupdnattr evaluation.\n"); } @@ -2865,7 +2865,7 @@ acllas__eval_memberGroupDnAttr (char *attrName, Slapi_Entry *e, } if ( (u_group = aclg_get_usersGroup ( aclpb , n_clientdn )) == NULL) { - slapi_log_error(SLAPI_LOG_ACL, plugin_name, + slapi_log_err(SLAPI_LOG_ACL, plugin_name, "acllas__eval_memberGroupDnAttr - Failed to find/allocate a usergroup--aborting evaluation\n"); slapi_ch_free ( (void **)&s_str ); return(ACL_DONT_KNOW); @@ -2907,7 +2907,7 @@ acllas__eval_memberGroupDnAttr (char *attrName, Slapi_Entry *e, } normed = slapi_create_dn_string("%s", base); if (NULL == normed) { - slapi_log_error(SLAPI_LOG_ERR, plugin_name, + slapi_log_err(SLAPI_LOG_ERR, plugin_name, "acllas__eval_memberGroupDnAttr - Invalid syntax: %s\n", base ); slapi_ch_free ( (void **)&s_str ); @@ -2964,11 +2964,11 @@ acllas__eval_memberGroupDnAttr (char *attrName, Slapi_Entry *e, if (slapi_is_loglevel_set(SLAPI_LOG_ACL)) { char ebuf[BUFSIZ]; if (tt == info.lu_idx) { - slapi_log_error(SLAPI_LOG_ACL, plugin_name, "acllas__eval_memberGroupDnAttr - currDn:(%s) \n\tNO MEMBER ADDED\n", + slapi_log_err(SLAPI_LOG_ACL, plugin_name, "acllas__eval_memberGroupDnAttr - currDn:(%s) \n\tNO MEMBER ADDED\n", ACL_ESCAPE_STRING_WITH_PUNCTUATION (curMemberDn, ebuf)); } else { for (i=tt; i < info.lu_idx; i++) { - slapi_log_error(SLAPI_LOG_ACL, plugin_name, + slapi_log_err(SLAPI_LOG_ACL, plugin_name, "acllas__eval_memberGroupDnAttr - currDn:(%s) \n\tADDED MEMBER[%d]=%s\n", ACL_ESCAPE_STRING_WITH_PUNCTUATION (curMemberDn, ebuf), i, info.member[i]); } @@ -3020,7 +3020,7 @@ acllas__eval_memberGroupDnAttr (char *attrName, Slapi_Entry *e, if (slapi_is_loglevel_set(SLAPI_LOG_ACL)) { char ebuf[BUFSIZ]; for (j = 0; j < u_group->aclug_numof_member_group; j++) { - slapi_log_error(SLAPI_LOG_ACL, plugin_name, + slapi_log_err(SLAPI_LOG_ACL, plugin_name, "acllas__eval_memberGroupDnAttr - GROUP[%d] IN CACHE:%s\n", j, ACL_ESCAPE_STRING_WITH_PUNCTUATION (u_group->aclug_member_groups[j], ebuf)); } @@ -3038,7 +3038,7 @@ acllas__eval_memberGroupDnAttr (char *attrName, Slapi_Entry *e, attrVal = slapi_value_get_berval ( sval ); n_attrval = slapi_create_dn_string("%s", attrVal->bv_val); if (NULL == n_attrval) { - slapi_log_error(SLAPI_LOG_ERR, plugin_name, + slapi_log_err(SLAPI_LOG_ERR, plugin_name, "acllas__eval_memberGroupDnAttr - Invalid syntax: %s\n", attrVal->bv_val ); slapi_ch_free ( (void **)&s_str ); @@ -3200,7 +3200,7 @@ acllas__verify_client (Slapi_Entry* e, void *callback_data) attrVal = slapi_value_get_berval ( sval ); val = slapi_create_dn_string("%s", attrVal->bv_val); if (NULL == val) { - slapi_log_error(SLAPI_LOG_ERR, plugin_name, + slapi_log_err(SLAPI_LOG_ERR, plugin_name, "acllas__verify_client - Invalid syntax: %s\n", attrVal->bv_val ); return 0; @@ -3294,7 +3294,7 @@ acllas__get_members (Slapi_Entry* e, void *callback_data) attrVal =slapi_value_get_berval ( sval ); info->member[i] = slapi_create_dn_string ("%s", attrVal->bv_val); if (NULL == info->member[i]) { - slapi_log_error(SLAPI_LOG_ERR, plugin_name, + slapi_log_err(SLAPI_LOG_ERR, plugin_name, "acllas__get_members: Invalid syntax: %s\n", attrVal->bv_val ); } @@ -3354,7 +3354,7 @@ DS_LASUserAttrEval(NSErr_t *errp, char *attr_name, CmpOp_t comparator, /* Which rule are we evaluating ? */ attrName = slapi_ch_strdup (attr_pattern ); if ( NULL == (p = strchr ( attrName, '#' ))) { - slapi_log_error(SLAPI_LOG_ACL, plugin_name, + slapi_log_err(SLAPI_LOG_ACL, plugin_name, "DS_LASUserAttrEval - Invalid value(%s)\n", attr_pattern); slapi_ch_free ( (void **) &attrName ); return LAS_EVAL_FAIL; @@ -3420,7 +3420,7 @@ DS_LASUserAttrEval(NSErr_t *errp, char *attr_name, CmpOp_t comparator, } - slapi_log_error(SLAPI_LOG_ACL, plugin_name, + slapi_log_err(SLAPI_LOG_ACL, plugin_name, "DS_LASUserAttrEval - AttrName:%s, attrVal:%s\n", attrName, attrValue ); /* @@ -3506,7 +3506,7 @@ acllas__client_match_URL (struct acl_pblock *aclpb, char *n_clientdn, char *url int result = ACL_FALSE; if ( NULL == aclpb ) { - slapi_log_error(SLAPI_LOG_ACL, plugin_name, + slapi_log_err(SLAPI_LOG_ACL, plugin_name, "acllas__client_match_URL - NULL acl pblock\n"); return ACL_FALSE; } @@ -3542,7 +3542,7 @@ acllas__client_match_URL (struct acl_pblock *aclpb, char *n_clientdn, char *url } if ( NULL == aclpb->aclpb_client_entry ) { - slapi_log_error(SLAPI_LOG_ACL, plugin_name, + slapi_log_err(SLAPI_LOG_ACL, plugin_name, "acllas__client_match_URL - Unable to get client's entry\n"); goto done; } @@ -3557,7 +3557,7 @@ acllas__client_match_URL (struct acl_pblock *aclpb, char *n_clientdn, char *url } else if (strncasecmp (url, LDAPS_URL_prefix, LDAPS_URL_prefix_len) == 0) { prefix_len = LDAPS_URL_prefix_len; } else { - slapi_log_error(SLAPI_LOG_ACL, plugin_name, + slapi_log_err(SLAPI_LOG_ACL, plugin_name, "acllas__client_match_URL - url %s does not have a recognized ldap protocol prefix\n", url); goto done; } @@ -3571,7 +3571,7 @@ acllas__client_match_URL (struct acl_pblock *aclpb, char *n_clientdn, char *url rawdn = strchr(tmpp, '/'); size_t hostport_len = 0; if (NULL == rawdn) { - slapi_log_error(SLAPI_LOG_ACL, plugin_name, + slapi_log_err(SLAPI_LOG_ACL, plugin_name, "acllas__client_match_URL - url %s does not have a valid ldap protocol prefix\n", url); goto done; } @@ -3588,7 +3588,7 @@ acllas__client_match_URL (struct acl_pblock *aclpb, char *n_clientdn, char *url } dn = slapi_create_dn_string("%s", rawdn); if (NULL == dn) { - slapi_log_error(SLAPI_LOG_ERR, plugin_name, + slapi_log_err(SLAPI_LOG_ERR, plugin_name, "acllas__client_match_URL - Error normalizing dn [%s] part of URL [%s]\n", rawdn, url); goto done; @@ -3604,13 +3604,13 @@ acllas__client_match_URL (struct acl_pblock *aclpb, char *n_clientdn, char *url slapi_ch_free_string(&dn); rc = slapi_ldap_url_parse(normed, &ludp, 1, NULL); if (rc) { - slapi_log_error(SLAPI_LOG_ERR, plugin_name, + slapi_log_err(SLAPI_LOG_ERR, plugin_name, "acllas__client_match_URL - url [%s] is invalid: %d (%s)\n", normed, rc, slapi_urlparse_err2string(rc)); goto done; } if ( ( NULL == ludp->lud_dn) || ( NULL == ludp->lud_filter) ) { - slapi_log_error(SLAPI_LOG_ERR, plugin_name, + slapi_log_err(SLAPI_LOG_ERR, plugin_name, "acllas__client_match_URL - url [%s] has no base dn [%s] or filter [%s]\n", normed, NULL == ludp->lud_dn ? "null" : ludp->lud_dn, @@ -3621,7 +3621,7 @@ acllas__client_match_URL (struct acl_pblock *aclpb, char *n_clientdn, char *url /* Check the scope */ if ( ludp->lud_scope == LDAP_SCOPE_SUBTREE ) { if (!slapi_dn_issuffix(n_clientdn, ludp->lud_dn)) { - slapi_log_error(SLAPI_LOG_ACL, plugin_name, + slapi_log_err(SLAPI_LOG_ACL, plugin_name, "acllas__client_match_URL - url [%s] scope is subtree but dn [%s] " "is not a suffix of [%s]\n", normed, ludp->lud_dn, n_clientdn ); @@ -3631,7 +3631,7 @@ acllas__client_match_URL (struct acl_pblock *aclpb, char *n_clientdn, char *url char *parent = slapi_dn_parent (n_clientdn); if (slapi_utf8casecmp ((ACLUCHP)parent, (ACLUCHP)ludp->lud_dn) != 0 ) { - slapi_log_error(SLAPI_LOG_ACL, plugin_name, + slapi_log_err(SLAPI_LOG_ACL, plugin_name, "acllas__client_match_URL - url [%s] scope is onelevel but dn [%s] " "is not a direct child of [%s]\n", normed, ludp->lud_dn, parent ); @@ -3641,7 +3641,7 @@ acllas__client_match_URL (struct acl_pblock *aclpb, char *n_clientdn, char *url slapi_ch_free_string(&parent); } else { /* default */ if (slapi_utf8casecmp ( (ACLUCHP)n_clientdn, (ACLUCHP)ludp->lud_dn) != 0 ) { - slapi_log_error(SLAPI_LOG_ACL, plugin_name, + slapi_log_err(SLAPI_LOG_ACL, plugin_name, "acllas__client_match_URL - url [%s] scope is base but dn [%s] " "does not match [%s]\n", normed, ludp->lud_dn, n_clientdn ); @@ -3654,7 +3654,7 @@ acllas__client_match_URL (struct acl_pblock *aclpb, char *n_clientdn, char *url f = slapi_str2filter ( ludp->lud_filter ); if (ludp->lud_filter && (f == NULL)) { /* bogus filter */ - slapi_log_error(SLAPI_LOG_ERR, plugin_name, + slapi_log_err(SLAPI_LOG_ERR, plugin_name, "acllas__client_match_URL - The member URL [%s] search filter in entry [%s] is not valid: [%s]\n", normed, n_clientdn, ludp->lud_filter); goto done; @@ -3714,7 +3714,7 @@ __acllas_setup ( NSErr_t *errp, char *attr_name, CmpOp_t comparator, *LAS_cookie = (void *)0; if (strcmp(attr_name, lasType) != 0) { - slapi_log_error(SLAPI_LOG_ACL, plugin_name, + slapi_log_err(SLAPI_LOG_ACL, plugin_name, "__acllas_setup - %s:Invalid LAS(%s)\n", lasName, attr_name); return LAS_EVAL_INVALID; } @@ -3723,11 +3723,11 @@ __acllas_setup ( NSErr_t *errp, char *attr_name, CmpOp_t comparator, if (allow_range && (comparator != CMP_OP_EQ) && (comparator != CMP_OP_NE) && (comparator != CMP_OP_GT) && (comparator != CMP_OP_LT) && (comparator != CMP_OP_GE) && (comparator != CMP_OP_LE)) { - slapi_log_error(SLAPI_LOG_ACL, plugin_name, + slapi_log_err(SLAPI_LOG_ACL, plugin_name, "__acllas_setup - %s:Invalid comparator(%d)\n", lasName, (int)comparator); return LAS_EVAL_INVALID; } else if (!allow_range && (comparator != CMP_OP_EQ) && (comparator != CMP_OP_NE)) { - slapi_log_error(SLAPI_LOG_ACL, plugin_name, + slapi_log_err(SLAPI_LOG_ACL, plugin_name, "__acllas_setup - %s:Invalid comparator(%d)\n", lasName, (int)comparator); return LAS_EVAL_INVALID; } @@ -3739,7 +3739,7 @@ __acllas_setup ( NSErr_t *errp, char *attr_name, CmpOp_t comparator, if ( rc != LAS_EVAL_TRUE ) { acl_print_acllib_err(errp, NULL); - slapi_log_error(SLAPI_LOG_ACL, plugin_name, + slapi_log_err(SLAPI_LOG_ACL, plugin_name, "__acllas_setup - %s:Unable to get the clientdn attribute(%d)\n",lasName, rc); return LAS_EVAL_FAIL; } @@ -3750,7 +3750,7 @@ __acllas_setup ( NSErr_t *errp, char *attr_name, CmpOp_t comparator, if (*(linfo->clientDn) == '\0') linfo->anomUser = ACL_TRUE; } else { - slapi_log_error(SLAPI_LOG_ACL, plugin_name, + slapi_log_err(SLAPI_LOG_ACL, plugin_name, "%s: No user\n",lasName); return LAS_EVAL_FAIL; } @@ -3758,7 +3758,7 @@ __acllas_setup ( NSErr_t *errp, char *attr_name, CmpOp_t comparator, if ((rc = PListFindValue(subject, DS_ATTR_ENTRY, (void **)&linfo->resourceEntry, NULL)) < 0){ acl_print_acllib_err(errp, NULL); - slapi_log_error(SLAPI_LOG_ACL, plugin_name, + slapi_log_err(SLAPI_LOG_ACL, plugin_name, "__acllas_setup - %s:Unable to get the Slapi_Entry attr(%d)\n",lasName, rc); return LAS_EVAL_FAIL; } @@ -3768,21 +3768,21 @@ __acllas_setup ( NSErr_t *errp, char *attr_name, CmpOp_t comparator, subject, resource, auth_info, global_auth); if ( rc != LAS_EVAL_TRUE ) { acl_print_acllib_err(errp, NULL); - slapi_log_error(SLAPI_LOG_ACL, plugin_name, + slapi_log_err(SLAPI_LOG_ACL, plugin_name, "__acllas_setup - %s:Unable to get the ACLPB(%d)\n", lasName, rc); return LAS_EVAL_FAIL; } /* LDAPI? */ if ((rc = PListFindValue(subject, DS_ATTR_LDAPI, (void **)&linfo->ldapi, NULL)) < 0){ - slapi_log_error(SLAPI_LOG_ACL, plugin_name, + slapi_log_err(SLAPI_LOG_ACL, plugin_name, "__acllas_setup - %s:Unable to get LDAPI value(%d)\n", lasName, rc); return LAS_EVAL_FAIL; } if (NULL == attr_pattern ) { - slapi_log_error(SLAPI_LOG_ACL, plugin_name, + slapi_log_err(SLAPI_LOG_ACL, plugin_name, "%s:No rule value in the ACL\n", lasName); return LAS_EVAL_FAIL; @@ -3791,7 +3791,7 @@ __acllas_setup ( NSErr_t *errp, char *attr_name, CmpOp_t comparator, if ((rc = PListFindValue(subject, DS_ATTR_AUTHTYPE, (void **)&linfo->authType, NULL)) < 0) { acl_print_acllib_err(errp, NULL); - slapi_log_error(SLAPI_LOG_ACL, plugin_name, + slapi_log_err(SLAPI_LOG_ACL, plugin_name, "__acllas_setup - %s:Unable to get the auth type(%d)\n", lasName, rc); return LAS_EVAL_FAIL; } @@ -3800,7 +3800,7 @@ __acllas_setup ( NSErr_t *errp, char *attr_name, CmpOp_t comparator, if ((rc = PListFindValue(subject, DS_ATTR_SSF, (void **)&linfo->ssf, NULL)) < 0) { acl_print_acllib_err(errp, NULL); - slapi_log_error(SLAPI_LOG_ACL, plugin_name, + slapi_log_err(SLAPI_LOG_ACL, plugin_name, "__acllas_setup - %s:Unable to get the ssf(%d)\n", lasName, rc); } return 0; @@ -3818,7 +3818,7 @@ static int acllas__user_has_role( struct acl_pblock *aclpb, int present = 0; if ( NULL == aclpb ) { - slapi_log_error ( SLAPI_LOG_ACL, plugin_name, + slapi_log_err ( SLAPI_LOG_ACL, plugin_name, "acllas__user_has_role - NULL acl pblock\n"); return ACL_FALSE; } @@ -3854,7 +3854,7 @@ static int acllas__user_has_role( struct acl_pblock *aclpb, } if ( NULL == aclpb->aclpb_client_entry ) { - slapi_log_error ( SLAPI_LOG_ACL, plugin_name, + slapi_log_err ( SLAPI_LOG_ACL, plugin_name, "acllas__user_has_role - Unable to get client's entry\n"); return ACL_FALSE; } @@ -3928,7 +3928,7 @@ DS_LASRoleDnAttrEval(NSErr_t *errp, char *attr_name, CmpOp_t comparator, * * */ - slapi_log_error(SLAPI_LOG_ACL, plugin_name, + slapi_log_err(SLAPI_LOG_ACL, plugin_name, "DS_LASRoleDnAttrEval - ACL info: userattr=XXX#ROLEDN does not allow ADD permission.\n"); got_undefined = 1; } else { @@ -3946,7 +3946,7 @@ DS_LASRoleDnAttrEval(NSErr_t *errp, char *attr_name, CmpOp_t comparator, attrVal = slapi_value_get_berval ( sval ); n_attrval = slapi_create_dn_string("%s", attrVal->bv_val); if (NULL == n_attrval) { - slapi_log_error(SLAPI_LOG_ERR, plugin_name, + slapi_log_err(SLAPI_LOG_ERR, plugin_name, "DS_LASRoleDnAttrEval - Invalid syntax: %s\n", attrVal->bv_val ); return LAS_EVAL_FAIL; @@ -4023,7 +4023,7 @@ aclutil_evaluate_macro( char * rule, lasInfo *lasinfo, * We have alredy done this matching once beofer at tasrget match time. */ - slapi_log_error(SLAPI_LOG_ACL, plugin_name, + slapi_log_err(SLAPI_LOG_ACL, plugin_name, "aclutil_evaluate_macro - For aci '%s' index '%d'\n", aci->aclName, aci->aci_index ); if ( aci->aci_macro == NULL ) { @@ -4038,13 +4038,13 @@ aclutil_evaluate_macro( char * rule, lasInfo *lasinfo, if ( (matched_val = (char *)acl_ht_lookup( aclpb->aclpb_macro_ht, (PLHashNumber)aci->aci_index)) == NULL) { - slapi_log_error(SLAPI_LOG_ACL, plugin_name, + slapi_log_err(SLAPI_LOG_ACL, plugin_name, "aclutil_evaluate_macro - ACL info: failed to locate the calculated target" "macro for aci '%s' index '%d'\n", aci->aclName, aci->aci_index ); return(ACL_FALSE); /* Not a match */ } else { - slapi_log_error(SLAPI_LOG_ACL, plugin_name, + slapi_log_err(SLAPI_LOG_ACL, plugin_name, "aclutil_evaluate_macro - ACL info: found matched_val (%s) for aci index %d" "in macro ht\n", aci->aclName, aci->aci_index ); @@ -4309,7 +4309,7 @@ acllas_replace_attr_macro( char *rule, lasInfo *lasinfo) str = strstr(macro_str, "."); if (!str) { - slapi_log_error(SLAPI_LOG_ERR, plugin_name, + slapi_log_err(SLAPI_LOG_ERR, plugin_name, "acllas_replace_attr_macro - Invalid macro \"%s\".", macro_str); slapi_ch_free_string(¯o_str); @@ -4489,11 +4489,11 @@ acllas_eval_one_role(char *role, lasInfo *lasinfo) { if (slapi_is_loglevel_set(SLAPI_LOG_ACL)) { char ebuf[BUFSIZ]; if (rc == ACL_TRUE ) { - slapi_log_error(SLAPI_LOG_ACL, plugin_name, + slapi_log_err(SLAPI_LOG_ACL, plugin_name, "acllas_eval_one_role - User '%s' does have role '%s'\n", ACL_ESCAPE_STRING_WITH_PUNCTUATION (lasinfo->clientDn, ebuf), role); } else { - slapi_log_error(SLAPI_LOG_ACL, plugin_name, + slapi_log_err(SLAPI_LOG_ACL, plugin_name, "acllas_eval_one_role - User '%s' does NOT have role '%s'\n", ACL_ESCAPE_STRING_WITH_PUNCTUATION (lasinfo->clientDn, ebuf), role); } @@ -4513,7 +4513,7 @@ static int acllas_eval_one_target_filter( char * str, Slapi_Entry *e) { PR_ASSERT(str); if ((f = slapi_str2filter(str)) == NULL) { - slapi_log_error(SLAPI_LOG_WARNING, plugin_name, + slapi_log_err(SLAPI_LOG_WARNING, plugin_name, "acllas_eval_one_target_filter - Bad targetfilter(%s) in aci: does not match\n", str); return(ACL_DONT_KNOW); } diff --git a/ldap/servers/plugins/acl/acllist.c b/ldap/servers/plugins/acl/acllist.c index 597d12f..e907f1e 100644 --- a/ldap/servers/plugins/acl/acllist.c +++ b/ldap/servers/plugins/acl/acllist.c @@ -72,7 +72,7 @@ acllist_init(void) { if (( aci_rwlock = slapi_new_rwlock() ) == NULL ) { - slapi_log_error(SLAPI_LOG_ERR, plugin_name, + slapi_log_err(SLAPI_LOG_ERR, plugin_name, "acllist_init - Failed in getting the rwlock\n" ); return 1; } @@ -114,12 +114,12 @@ void acl_be_state_change_fnc ( void *handle, char *be_name, int old_state, if ( old_state == SLAPI_BE_STATE_ON && new_state != SLAPI_BE_STATE_ON) { - slapi_log_error(SLAPI_LOG_ACL, plugin_name, + slapi_log_err(SLAPI_LOG_ACL, plugin_name, "acl_be_state_change_fnc - Backend %s is no longer STARTED--deactivating it's acis\n", be_name); if ( (be = slapi_be_select_by_instance_name( be_name )) == NULL) { - slapi_log_error(SLAPI_LOG_ACL, plugin_name, + slapi_log_err(SLAPI_LOG_ACL, plugin_name, "acl_be_state_change_fnc - Failed to retrieve backend--NOT activating it's acis\n"); return; } @@ -129,7 +129,7 @@ void acl_be_state_change_fnc ( void *handle, char *be_name, int old_state, */ if ( (sdn = slapi_be_getsuffix( be, 0)) == NULL ) { - slapi_log_error(SLAPI_LOG_ACL, plugin_name, + slapi_log_err(SLAPI_LOG_ACL, plugin_name, "acl_be_state_change_fnc - Failed to retrieve backend--NOT activating it's acis\n"); return; } @@ -142,11 +142,11 @@ void acl_be_state_change_fnc ( void *handle, char *be_name, int old_state, DO_TAKE_ACLCACHE_WRITELOCK); } else if ( old_state != SLAPI_BE_STATE_ON && new_state == SLAPI_BE_STATE_ON) { - slapi_log_error(SLAPI_LOG_ACL, plugin_name, + slapi_log_err(SLAPI_LOG_ACL, plugin_name, "acl_be_state_change_fnc - Backend %s is now STARTED--activating it's acis\n", be_name); if ( (be = slapi_be_select_by_instance_name( be_name )) == NULL) { - slapi_log_error(SLAPI_LOG_ACL, plugin_name, + slapi_log_err(SLAPI_LOG_ACL, plugin_name, "acl_be_state_change_fnc - Failed to retrieve backend--NOT activating it's acis\n"); return; } @@ -156,7 +156,7 @@ void acl_be_state_change_fnc ( void *handle, char *be_name, int old_state, */ if ( (sdn = slapi_be_getsuffix( be, 0)) == NULL ) { - slapi_log_error(SLAPI_LOG_ACL, plugin_name, + slapi_log_err(SLAPI_LOG_ACL, plugin_name, "acl_be_state_change_fnc - Failed to retrieve backend--NOT activating it's acis\n"); return; } @@ -195,7 +195,7 @@ acllist_insert_aci_needsLock_ext( Slapi_PBlock *pb, const Slapi_DN *e_sdn, const acl_str = slapi_ch_strdup(aci_attr->bv_val); /* Parse the ACL TEXT */ if ( 0 != (rv = acl_parse ( pb, acl_str, aci, NULL )) ) { - slapi_log_error(SLAPI_LOG_ERR, plugin_name, + slapi_log_err(SLAPI_LOG_ERR, plugin_name, "acllist_insert_aci_needsLock_ext - ACL PARSE ERR(rv=%d): %s\n", rv, acl_str ); slapi_ch_free ( (void **) &acl_str ); acllist_free_aci ( aci ); @@ -205,7 +205,7 @@ acllist_insert_aci_needsLock_ext( Slapi_PBlock *pb, const Slapi_DN *e_sdn, const /* Now add it to the list */ if ( 0 != (rv =__acllist_add_aci ( aci ))) { - slapi_log_error(SLAPI_LOG_ACL, plugin_name, + slapi_log_err(SLAPI_LOG_ACL, plugin_name, "acllist_insert_aci_needsLock_ext - ACL ADD ACI ERR(rv=%d): %s\n", rv, acl_str ); slapi_ch_free ( (void **) &acl_str ); acllist_free_aci ( aci ); @@ -241,7 +241,7 @@ __acllist_add_aci ( aci_t *aci ) /* Find the node that contains the acl. */ if ( NULL == (head = (AciContainer *) avl_find( acllistRoot, aciListHead, (IFP) __acllist_aciContainer_node_cmp ) ) ) { - slapi_log_error ( SLAPI_PLUGIN_ACL, plugin_name, + slapi_log_err ( SLAPI_PLUGIN_ACL, plugin_name, "__acllist_add_aci - Can't insert the acl in the tree\n"); rv = 1; } else { @@ -255,7 +255,7 @@ __acllist_add_aci ( aci_t *aci ) /* Now add the new one to the end of the list */ t_aci->aci_next = aci; - slapi_log_error(SLAPI_LOG_ACL, plugin_name, "__acllist_add_aci - Added the ACL:%s to existing container:[%d]%s\n", + slapi_log_err(SLAPI_LOG_ACL, plugin_name, "__acllist_add_aci - Added the ACL:%s to existing container:[%d]%s\n", aci->aclName, head->acic_index, slapi_sdn_get_ndn( head->acic_sdn )); } @@ -290,7 +290,7 @@ __acllist_add_aci ( aci_t *aci ) aciContainerArray[ aciListHead->acic_index ] = aciListHead; - slapi_log_error(SLAPI_LOG_ACL, plugin_name, "__acllist_add_aci - Added %s to container:%d\n", + slapi_log_err(SLAPI_LOG_ACL, plugin_name, "__acllist_add_aci - Added %s to container:%d\n", slapi_sdn_get_ndn( aciListHead->acic_sdn ), aciListHead->acic_index ); break; } @@ -359,7 +359,7 @@ acllist_remove_aci_needsLock( const Slapi_DN *sdn, const struct berval *attr ) /* In that case we don't have any acl for this entry. cool !!! */ acllist_free_aciContainer ( &aciListHead ); - slapi_log_error(SLAPI_LOG_ACL, plugin_name, + slapi_log_err(SLAPI_LOG_ACL, plugin_name, "acllist_remove_aci_needsLock - No acis to remove in this entry\n" ); return 0; } @@ -384,7 +384,7 @@ acllist_remove_aci_needsLock( const Slapi_DN *sdn, const struct berval *attr ) /* remove the container from the slot */ aciContainerArray[root->acic_index] = NULL; - slapi_log_error(SLAPI_LOG_ACL, plugin_name, + slapi_log_err(SLAPI_LOG_ACL, plugin_name, "acllist_remove_aci_needsLock - Removing container[%d]=%s\n", root->acic_index, slapi_sdn_get_ndn ( root->acic_sdn) ); dContainer = (AciContainer *) avl_delete ( &acllistRoot, aciListHead, @@ -409,7 +409,7 @@ acllist_remove_aci_needsLock( const Slapi_DN *sdn, const struct berval *attr ) LDAP_SCOPE_BASE, ACL_ADD_ACIS, DONT_TAKE_ACLCACHE_WRITELOCK))) { - slapi_log_error(SLAPI_LOG_ERR, plugin_name, + slapi_log_err(SLAPI_LOG_ERR, plugin_name, "acllist_remove_aci_needsLock - Can't add the rest of the acls for entry:%s after delete\n", slapi_sdn_get_dn ( sdn ) ); } @@ -624,7 +624,7 @@ acllist_init_scan (Slapi_PBlock *pb, int scope, const char *base) } aclpb = acl_get_aclpb (pb, ACLPB_BINDDN_PBLOCK ); if ( !aclpb ) { - slapi_log_error(SLAPI_LOG_ERR, plugin_name, "acllist_init_scan - Missing aclpb\n" ); + slapi_log_err(SLAPI_LOG_ERR, plugin_name, "acllist_init_scan - Missing aclpb\n" ); return; } @@ -665,7 +665,7 @@ acllist_init_scan (Slapi_PBlock *pb, int scope, const char *base) /* slapi_dn_parent returns the "parent" dn syntactically. * Most likely, basedn is above suffix (e.g., dn=com). * Thus, no need to make it FATAL. */ - slapi_log_error(SLAPI_LOG_ACL, plugin_name, + slapi_log_err(SLAPI_LOG_ACL, plugin_name, "acllist_init_scan - Failed to find root for base: %s \n", basedn ); } tmp = slapi_dn_parent ( basedn ); @@ -699,7 +699,7 @@ acllist_aciscan_update_scan ( Acl_PBlock *aclpb, char *edn ) int is_not_search_base = 1; if ( !aclpb ) { - slapi_log_error(SLAPI_LOG_ACL, plugin_name, + slapi_log_err(SLAPI_LOG_ACL, plugin_name, "acllist_aciscan_update_scan - NULL acl pblock\n"); return; } @@ -745,7 +745,7 @@ acllist_aciscan_update_scan ( Acl_PBlock *aclpb, char *edn ) (caddr_t) aclpb->aclpb_aclContainer, (IFP) __acllist_aciContainer_node_cmp); - slapi_log_error(SLAPI_LOG_ACL, plugin_name, + slapi_log_err(SLAPI_LOG_ACL, plugin_name, "acllist_aciscan_update_scan - Searching AVL tree for update:%s: container:%d\n", basedn, root ? root->acic_index: -1); if ( index >= aclpb_max_selected_acls -2 ) { @@ -910,7 +910,7 @@ acllist_moddn_aci_needsLock ( Slapi_DN *oldsdn, char *newdn ) if ( NULL == (head = (AciContainer *) avl_find( acllistRoot, aciListHead, (IFP) __acllist_aciContainer_node_cmp ) ) ) { - slapi_log_error ( SLAPI_PLUGIN_ACL, plugin_name, + slapi_log_err ( SLAPI_PLUGIN_ACL, plugin_name, "acllist_moddn_aci_needsLock - Can't find the acl in the tree for moddn operation:olddn%s\n", slapi_sdn_get_ndn ( oldsdn )); aciListHead->acic_sdn = NULL; @@ -956,7 +956,7 @@ acllist_print_tree ( Avlnode *root, int *depth, char *start, char *side) return; } aciHeadList = (AciContainer *) root->avl_data; - slapi_log_error(SLAPI_LOG_ACL, "plugin_name", + slapi_log_err(SLAPI_LOG_ACL, "plugin_name", "acllist_print_tree - Container[ Depth=%d%s-%s]: %s\n", *depth, start, side, slapi_sdn_get_ndn ( aciHeadList->acic_sdn ) ); diff --git a/ldap/servers/plugins/acl/aclparse.c b/ldap/servers/plugins/acl/aclparse.c index 45adb2b..a1dae19 100644 --- a/ldap/servers/plugins/acl/aclparse.c +++ b/ldap/servers/plugins/acl/aclparse.c @@ -148,7 +148,7 @@ acl_parse(Slapi_PBlock *pb, char * str, aci_t *aci_item, char **errbuf) slapi_search_internal_pb(temppb); slapi_pblock_get(temppb, SLAPI_PLUGIN_INTOP_RESULT, &rc); if (rc != LDAP_SUCCESS) { - slapi_log_error(SLAPI_LOG_ERR, plugin_name, + slapi_log_err(SLAPI_LOG_ERR, plugin_name, "acl_parse - The ACL target %s does not exist\n", slapi_sdn_get_dn(&targdn)); } @@ -183,7 +183,7 @@ acl_parse(Slapi_PBlock *pb, char * str, aci_t *aci_item, char **errbuf) if (!(aci_item->aci_type & ACI_TARGET_MACRO_DN) && (aci_item->aci_ruleType & ACI_PARAM_DNRULE)) { - slapi_log_error(SLAPI_LOG_ERR, plugin_name, + slapi_log_err(SLAPI_LOG_ERR, plugin_name, "acl_parse - A macro in a subject ($dn) must have a macro in the target.\n"); return(ACL_INVALID_TARGET); } @@ -294,7 +294,7 @@ __aclp__parse_aci(char *str, aci_t *aci_item, char **errbuf) /* Must have a targetmacro */ if ( !(aci_item->aci_type & ACI_TARGET_MACRO_DN)) { - slapi_log_error(SLAPI_LOG_ERR, plugin_name, + slapi_log_err(SLAPI_LOG_ERR, plugin_name, "__aclp__parse_aci - A macro in a targetfilter ($dn) must have a macro in the target.\n"); return(ACL_SYNTAX_ERR); } @@ -468,7 +468,7 @@ __aclp__parse_aci(char *str, aci_t *aci_item, char **errbuf) filterChoice = slapi_filter_get_choice ( f ); if ( (type & (ACI_TARGET_DN | ACI_TARGET_MODDN)) && ( filterChoice == LDAP_FILTER_PRESENT)) { - slapi_log_error(SLAPI_LOG_ACL, plugin_name, + slapi_log_err(SLAPI_LOG_ACL, plugin_name, "__aclp__parse_aci - Unsupported filter type:%d\n", filterChoice); return(ACL_SYNTAX_ERR); } else if (( filterChoice == LDAP_FILTER_SUBSTRINGS) && @@ -489,7 +489,7 @@ __aclp__parse_aci(char *str, aci_t *aci_item, char **errbuf) (type & ACI_TARGET_PATTERN)) { if (aci_item->target) { /* There is something already. ERROR */ - slapi_log_error(SLAPI_LOG_ACL, plugin_name, + slapi_log_err(SLAPI_LOG_ACL, plugin_name, "__aclp__parse_aci - Multiple targets in the ACL syntax\n"); slapi_filter_free(f, 1); return(ACL_SYNTAX_ERR); @@ -498,7 +498,7 @@ __aclp__parse_aci(char *str, aci_t *aci_item, char **errbuf) } } else if ( type & ACI_TARGET_FILTER) { if (aci_item->targetFilter) { - slapi_log_error(SLAPI_LOG_ACL, plugin_name, + slapi_log_err(SLAPI_LOG_ACL, plugin_name, "__aclp__parse_aci - Multiple target Filters in the ACL Syntax\n"); slapi_filter_free(f, 1); return(ACL_SYNTAX_ERR); @@ -509,7 +509,7 @@ __aclp__parse_aci(char *str, aci_t *aci_item, char **errbuf) if (is_target_to) { if (aci_item->target_to) { /* There is something already. ERROR */ - slapi_log_error(SLAPI_LOG_ACL, plugin_name, + slapi_log_err(SLAPI_LOG_ACL, plugin_name, "__aclp__parse_aci - Multiple targets (target_to) in the ACL syntax\n"); slapi_filter_free(f, 1); return(ACL_SYNTAX_ERR); @@ -519,7 +519,7 @@ __aclp__parse_aci(char *str, aci_t *aci_item, char **errbuf) } else { if (aci_item->target_from) { /* There is something already. ERROR */ - slapi_log_error(SLAPI_LOG_ACL, plugin_name, + slapi_log_err(SLAPI_LOG_ACL, plugin_name, "__aclp__parse_aci - Multiple targets (target_from) in the ACL syntax\n"); slapi_filter_free(f, 1); return(ACL_SYNTAX_ERR); @@ -531,7 +531,7 @@ __aclp__parse_aci(char *str, aci_t *aci_item, char **errbuf) break; /* 't' */ default: /* Here the keyword did not start with 'v' ot 't' so error */ - slapi_log_error(SLAPI_LOG_ACL, plugin_name, + slapi_log_err(SLAPI_LOG_ACL, plugin_name, "__aclp__parse_aci - Unknown keyword at \"%s\"\n Expecting" " \"target\", \"targetattr\", \"targetfilter\", \"targattrfilters\"" " or \"version\"\n", str); @@ -649,7 +649,7 @@ __aclp__sanity_check_acltxt (aci_t *aci_item, char *str) if ((newstr = __aclp__normalize_acltxt (aci_item, str )) == NULL) { return ACL_SYNTAX_ERR; } - slapi_log_error(SLAPI_LOG_ACL, plugin_name, "__aclp__sanity_check_acltxt - Normalized String:%s\n", newstr); + slapi_log_err(SLAPI_LOG_ACL, plugin_name, "__aclp__sanity_check_acltxt - Normalized String:%s\n", newstr); /* check for acl syntax error */ if ((handle = (ACLListHandle_t *) ACL_ParseString(&errp, newstr)) == NULL) { @@ -1514,7 +1514,7 @@ __aclp__init_targetattr (aci_t *aci, char *attr_val, char **errbuf) char *errstr = slapi_ch_smprintf("The statement does not begin and end " "with a \": [%s]. ", attr_val); - slapi_log_error(SLAPI_LOG_ERR, plugin_name, + slapi_log_err(SLAPI_LOG_ERR, plugin_name, "__aclp__init_targetattr - %s\n", errstr); if (errbuf) { aclutil_str_append(errbuf, errstr); @@ -1591,7 +1591,7 @@ __aclp__init_targetattr (aci_t *aci, char *attr_val, char **errbuf) if (f == NULL) { char *errstr = slapi_ch_smprintf("Unable to generate filter" " (%s). ", lineptr); - slapi_log_error(SLAPI_LOG_ERR, plugin_name, + slapi_log_err(SLAPI_LOG_ERR, plugin_name, "__aclp__init_targetattr - %s\n", errstr); if (errbuf) { aclutil_str_append(errbuf, errstr); @@ -1617,7 +1617,7 @@ __aclp__init_targetattr (aci_t *aci, char *attr_val, char **errbuf) char *errstr = slapi_ch_smprintf("targetattr \"%s\" does not " "exist in schema. Please add attributeTypes " "\"%s\" to schema if necessary. ", str, str); - slapi_log_error(SLAPI_LOG_ERR, plugin_name, + slapi_log_err(SLAPI_LOG_ERR, plugin_name, "__aclp__init_targetattr - %s\n", errstr); if (errbuf) { aclutil_str_append(errbuf, errstr); @@ -1845,7 +1845,7 @@ acl_check_for_target_macro( aci_t *aci_item, char *value) /* Macro dn needs to normalize. E.g., "ou=Groups, ($dN), dn=example,dn=com" */ aci_item->aci_macro->match_this = slapi_create_dn_string_case("%s", value); if (NULL == aci_item->aci_macro->match_this) { - slapi_log_error(SLAPI_LOG_ERR, plugin_name, + slapi_log_err(SLAPI_LOG_ERR, plugin_name, "acl_check_for_target_macro - Invalid macro target dn: \"%s\"\n", value); aci_item->aci_type &= ~ACI_TARGET_MACRO_DN; slapi_ch_free((void **)&aci_item->aci_macro); @@ -1986,7 +1986,7 @@ static int __acl__init_targetattrfilters( aci_t *aci, char *input_str) { s[len-1] = '\0'; s++; /* skip the first " */ } else { /* No matching quotes */ - slapi_log_error(SLAPI_LOG_ERR, plugin_name, + slapi_log_err(SLAPI_LOG_ERR, plugin_name, "__aclp__init_targetattrfilters - The statement does not begin and end with a \": [%s]\n", s); return (ACL_SYNTAX_ERR); @@ -2213,7 +2213,7 @@ static int __acl_init_targetattrfilter( Targetattrfilter *attrfilter, if ( (tmp_ptr = strstr( str, ":")) == NULL ) { /* No :, syntax error */ - slapi_log_error(SLAPI_LOG_ACL, plugin_name, + slapi_log_err(SLAPI_LOG_ACL, plugin_name, "__acl_init_targetattrfilter - Bad targetattrfilter %s:%s\n", str,"Expecting \":\""); @@ -2227,7 +2227,7 @@ static int __acl_init_targetattrfilter( Targetattrfilter *attrfilter, /* s should be the attribute name-make sure it's non-empty. */ if ( *s == '\0' ) { - slapi_log_error(SLAPI_LOG_ACL, plugin_name, + slapi_log_err(SLAPI_LOG_ACL, plugin_name, "__acl_init_targetattrfilter - No attribute name in targattrfilters\n"); return(ACL_SYNTAX_ERR); } @@ -2244,7 +2244,7 @@ static int __acl_init_targetattrfilter( Targetattrfilter *attrfilter, tmp_ptr = __acl_trim_filterstr(filter_ptr); if ((f = slapi_str2filter(tmp_ptr)) == NULL) { - slapi_log_error(SLAPI_LOG_ACL, plugin_name, + slapi_log_err(SLAPI_LOG_ACL, plugin_name, "__acl_init_targetattrfilter - Bad targetattr filter for attribute %s:%s\n", attrfilter->attr_str,tmp_ptr); slapi_ch_free( (void **) &attrfilter->attr_str); @@ -2259,7 +2259,7 @@ static int __acl_init_targetattrfilter( Targetattrfilter *attrfilter, if (acl_verify_exactly_one_attribute( attrfilter->attr_str, f) != SLAPI_FILTER_SCAN_NOMORE) { - slapi_log_error(SLAPI_LOG_ACL, plugin_name, + slapi_log_err(SLAPI_LOG_ACL, plugin_name, "__acl_init_targetattrfilter - Exactly one attribute type per filter allowed in targattrfilters (%s)\n", attrfilter->attr_str); slapi_ch_free( (void **) &attrfilter->attr_str); diff --git a/ldap/servers/plugins/acl/aclplugin.c b/ldap/servers/plugins/acl/aclplugin.c index 095898d..bd768d1 100644 --- a/ldap/servers/plugins/acl/aclplugin.c +++ b/ldap/servers/plugins/acl/aclplugin.c @@ -94,7 +94,7 @@ acl_preopInit (Slapi_PBlock *pb) #endif - slapi_log_error(SLAPI_LOG_PLUGIN, plugin_name, "<= acl_preop_Init %d\n", rc ); + slapi_log_err(SLAPI_LOG_PLUGIN, plugin_name, "<= acl_preop_Init %d\n", rc ); return( rc ); } @@ -187,7 +187,7 @@ aclplugin_preop_common( Slapi_PBlock *pb ) aclpb = acl_get_aclpb ( pb, ACLPB_BINDDN_PBLOCK ); if (aclpb == NULL) { - slapi_log_error(SLAPI_LOG_ACL, plugin_name, "aclplugin_preop_common - Error: aclpb is NULL\n" ); + slapi_log_err(SLAPI_LOG_ACL, plugin_name, "aclplugin_preop_common - Error: aclpb is NULL\n" ); slapi_send_ldap_result( pb, LDAP_OPERATIONS_ERROR, NULL, NULL, 0, NULL ); return 1; } @@ -220,7 +220,7 @@ aclplugin_preop_common( Slapi_PBlock *pb ) if ( proxy_dn) { TNF_PROBE_0_DEBUG(proxyacpb_init_start,"ACL",""); - slapi_log_error(SLAPI_LOG_ACL, plugin_name, + slapi_log_err(SLAPI_LOG_ACL, plugin_name, "aclplugin_preop_common - Proxied authorization dn is (%s)\n", proxy_dn ); acl_init_aclpb ( pb, aclpb, proxy_dn, 1 ); aclpb = acl_new_proxy_aclpb ( pb ); @@ -297,10 +297,10 @@ acl_init( Slapi_PBlock *pb ) { int rc =0; - slapi_log_error(SLAPI_LOG_PLUGIN, plugin_name, "=> acl_init\n" ); + slapi_log_err(SLAPI_LOG_PLUGIN, plugin_name, "=> acl_init\n" ); if ( 0 != acl_init_ext() ) { - slapi_log_error(SLAPI_LOG_ERR, plugin_name, + slapi_log_err(SLAPI_LOG_ERR, plugin_name, "acl_init - Unable to initialize the extensions\n"); return 1; } @@ -324,7 +324,7 @@ acl_init( Slapi_PBlock *pb ) rc |= slapi_pblock_set( pb, SLAPI_PLUGIN_ACL_MODS_UPDATE, (void *) acl_modified ); - slapi_log_error(SLAPI_LOG_PLUGIN, plugin_name, "<= acl_init %d\n", rc); + slapi_log_err(SLAPI_LOG_PLUGIN, plugin_name, "<= acl_init %d\n", rc); return( rc ); } @@ -356,7 +356,7 @@ acl_access_allowed_main ( Slapi_PBlock *pb, Slapi_Entry *e, char **attrs, rc = acl_read_access_allowed_on_entry ( pb, e, attrs, access); } else if ( ACLPLUGIN_ACCESS_READ_ON_ATTR == flags) { if (attr == NULL) { - slapi_log_error(SLAPI_LOG_PLUGIN, plugin_name, "acl_access_allowed_main - Missing attribute\n" ); + slapi_log_err(SLAPI_LOG_PLUGIN, plugin_name, "acl_access_allowed_main - Missing attribute\n" ); rc = LDAP_OPERATIONS_ERROR; } else { rc = acl_read_access_allowed_on_attr ( pb, e, attr, val, access); diff --git a/ldap/servers/plugins/acl/aclutil.c b/ldap/servers/plugins/acl/aclutil.c index bdd10fa..23f6e5c 100644 --- a/ldap/servers/plugins/acl/aclutil.c +++ b/ldap/servers/plugins/acl/aclutil.c @@ -115,10 +115,10 @@ acl_print_acllib_err (NSErr_t *errp , char * str) msgbuf[ACLUTIL_ACLLIB_MSGBUF_LEN-1] = '\0'; if (strlen(msgbuf) > 0) { - slapi_log_error(SLAPI_LOG_ACL, plugin_name,"acl_print_acllib_err - ACL LIB ERR:(%s)(%s)\n", + slapi_log_err(SLAPI_LOG_ACL, plugin_name,"acl_print_acllib_err - ACL LIB ERR:(%s)(%s)\n", msgbuf, str ? str: "NULL"); } else { - slapi_log_error(SLAPI_LOG_ACL, plugin_name,"acl_print_acllib_err - ACL LIB ERR:(%s)\n", + slapi_log_err(SLAPI_LOG_ACL, plugin_name,"acl_print_acllib_err - ACL LIB ERR:(%s)\n", str ? str: "NULL"); } @@ -134,30 +134,30 @@ aclutil_print_aci (aci_t *aci_item, char *type) if (!aci_item) { - slapi_log_error(SLAPI_LOG_ACL, plugin_name, + slapi_log_err(SLAPI_LOG_ACL, plugin_name, "acl__print_aci: Null item\n"); return; } - slapi_log_error(SLAPI_LOG_ACL, plugin_name, + slapi_log_err(SLAPI_LOG_ACL, plugin_name, "***BEGIN ACL INFO[ Name:%s]***\n", aci_item->aclName); - slapi_log_error(SLAPI_LOG_ACL, plugin_name, + slapi_log_err(SLAPI_LOG_ACL, plugin_name, "ACL Index:%d ACL_ELEVEL:%d\n", aci_item->aci_index, aci_item->aci_elevel ); aclutil__access_str (aci_item->aci_access, str); aclutil__typestr (aci_item->aci_type, &str[strlen(str)]); - slapi_log_error(SLAPI_LOG_ACL, plugin_name, + slapi_log_err(SLAPI_LOG_ACL, plugin_name, "ACI type:(%s)\n", str); aclutil__Ruletypestr (aci_item->aci_ruleType, str); - slapi_log_error(SLAPI_LOG_ACL, plugin_name, + slapi_log_err(SLAPI_LOG_ACL, plugin_name, "ACI RULE type:(%s)\n",str); dn = slapi_sdn_get_dn ( aci_item->aci_sdn ); - slapi_log_error(SLAPI_LOG_ACL, plugin_name, "Slapi_Entry DN:%s\n", dn); + slapi_log_err(SLAPI_LOG_ACL, plugin_name, "Slapi_Entry DN:%s\n", dn); - slapi_log_error(SLAPI_LOG_ACL, plugin_name, + slapi_log_err(SLAPI_LOG_ACL, plugin_name, "***END ACL INFO*****************************\n"); } @@ -263,7 +263,7 @@ aclutil_print_err (int rv , const Slapi_DN *sdn, const struct berval* val, aclutil_str_append(errbuf, lineptr); } - slapi_log_error(SLAPI_LOG_ERR, plugin_name, "aclutil_print_err - %s", lineptr); + slapi_log_err(SLAPI_LOG_ERR, plugin_name, "aclutil_print_err - %s", lineptr); slapi_ch_free_string(&newline); } @@ -491,21 +491,21 @@ aclutil_print_resource( struct acl_pblock *aclpb, const char *right , char *attr if ( ! slapi_is_loglevel_set ( SLAPI_LOG_ACL ) ) return; - slapi_log_error(SLAPI_LOG_ACL, plugin_name, " ************ RESOURCE INFO STARTS *********\n"); - slapi_log_error(SLAPI_LOG_ACL, plugin_name, " Client DN: %s\n", + slapi_log_err(SLAPI_LOG_ACL, plugin_name, " ************ RESOURCE INFO STARTS *********\n"); + slapi_log_err(SLAPI_LOG_ACL, plugin_name, " Client DN: %s\n", clientdn ? clientdn : "NULL"); aclutil__access_str (aclpb->aclpb_access, str); aclutil__typestr (aclpb->aclpb_res_type, &str[strlen(str)]); - slapi_log_error(SLAPI_LOG_ACL, plugin_name, " resource type:%d(%s)\n", + slapi_log_err(SLAPI_LOG_ACL, plugin_name, " resource type:%d(%s)\n", aclpb->aclpb_res_type, str); dn = slapi_sdn_get_dn ( aclpb->aclpb_curr_entry_sdn ); - slapi_log_error(SLAPI_LOG_ACL, plugin_name, " Slapi_Entry DN: %s\n", + slapi_log_err(SLAPI_LOG_ACL, plugin_name, " Slapi_Entry DN: %s\n", dn ? dn : "NULL"); - slapi_log_error(SLAPI_LOG_ACL, plugin_name, " ATTR: %s\n", attr ? attr : "NULL"); - slapi_log_error(SLAPI_LOG_ACL, plugin_name, " rights:%s\n", right ? right: "NULL"); - slapi_log_error(SLAPI_LOG_ACL, plugin_name, " ************ RESOURCE INFO ENDS *********\n"); + slapi_log_err(SLAPI_LOG_ACL, plugin_name, " ATTR: %s\n", attr ? attr : "NULL"); + slapi_log_err(SLAPI_LOG_ACL, plugin_name, " rights:%s\n", right ? right: "NULL"); + slapi_log_err(SLAPI_LOG_ACL, plugin_name, " ************ RESOURCE INFO ENDS *********\n"); } /* * The input string contains a rule like @@ -765,7 +765,7 @@ acl_match_macro_in_target( const char *ndn, char * match_this, /* we know it's got a $(dn) */ tmp_ptr = PL_strcasestr(macro_prefix, ACL_TARGET_MACRO_DN_KEY); if (!tmp_ptr) { - slapi_log_error(SLAPI_LOG_ACL, plugin_name, "acl_match_macro_in_target - " + slapi_log_err(SLAPI_LOG_ACL, plugin_name, "acl_match_macro_in_target - " "Target macro DN key \"%s\" not found in \"%s\".\n", ACL_TARGET_MACRO_DN_KEY, macro_prefix); slapi_ch_free_string(¯o_prefix); @@ -1463,7 +1463,7 @@ acl_ht_display_entry(PLHashEntry *he, PRIntn i, void *arg) PLHashNumber aci_index = (PLHashNumber)he->key; char *matched_val = (char *)he->value; - slapi_log_error(LDAP_DEBUG_ACL, plugin_name, "acl_ht_display_entry - macro ht entry: key='%d' matched_val='%s'" + slapi_log_err(LDAP_DEBUG_ACL, plugin_name, "acl_ht_display_entry - macro ht entry: key='%d' matched_val='%s'" "keyhash='%d'\n", aci_index, (matched_val ? matched_val: "NULL"), (PLHashNumber)he->keyHash); diff --git a/ldap/servers/plugins/automember/automember.c b/ldap/servers/plugins/automember/automember.c index 7b5d9e1..2b52ae8 100644 --- a/ldap/servers/plugins/automember/automember.c +++ b/ldap/servers/plugins/automember/automember.c @@ -160,7 +160,7 @@ automember_init(Slapi_PBlock *pb) int preadd = SLAPI_PLUGIN_PRE_ADD_FN; int premod = SLAPI_PLUGIN_PRE_MODIFY_FN; - slapi_log_error(SLAPI_LOG_TRACE, AUTOMEMBER_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_TRACE, AUTOMEMBER_PLUGIN_SUBSYSTEM, "--> automember_init\n"); /* get args */ @@ -191,7 +191,7 @@ automember_init(Slapi_PBlock *pb) (void *) &pdesc) != 0 || slapi_pblock_set(pb, premod, (void *) automember_mod_pre_op) != 0 || slapi_pblock_set(pb, preadd, (void *) automember_add_pre_op) != 0) { - slapi_log_error(SLAPI_LOG_ERR, AUTOMEMBER_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_ERR, AUTOMEMBER_PLUGIN_SUBSYSTEM, "automember_init - Failed to register plugin\n"); status = -1; } @@ -205,7 +205,7 @@ automember_init(Slapi_PBlock *pb) NULL, /* ? */ plugin_identity /* access control */ )) { - slapi_log_error(SLAPI_LOG_ERR, AUTOMEMBER_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_ERR, AUTOMEMBER_PLUGIN_SUBSYSTEM, "automember_init - Failed to register internalpostoperation plugin\n"); status = -1; } @@ -224,13 +224,13 @@ automember_init(Slapi_PBlock *pb) plugin_identity /* access control */ ) ) { - slapi_log_error(SLAPI_LOG_ERR, AUTOMEMBER_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_ERR, AUTOMEMBER_PLUGIN_SUBSYSTEM, "automember_init - Failed to register postop plugin\n"); status = -1; } } - slapi_log_error(SLAPI_LOG_TRACE, AUTOMEMBER_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_TRACE, AUTOMEMBER_PLUGIN_SUBSYSTEM, "<-- automember_init\n"); return status; } @@ -253,7 +253,7 @@ automember_internal_postop_init(Slapi_PBlock *pb) (void *) automember_mod_post_op) != 0 || slapi_pblock_set(pb, SLAPI_PLUGIN_INTERNAL_POST_MODRDN_FN, (void *) automember_modrdn_post_op) != 0) { - slapi_log_error(SLAPI_LOG_ERR, AUTOMEMBER_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_ERR, AUTOMEMBER_PLUGIN_SUBSYSTEM, "automember_internal_postop_init - Failed to register plugin\n"); status = -1; } @@ -285,7 +285,7 @@ automember_postop_init(Slapi_PBlock *pb) slapi_pblock_set(pb, delfn, (void *) automember_del_post_op) != 0 || slapi_pblock_set(pb, modfn, (void *) automember_mod_post_op) != 0 || slapi_pblock_set(pb, mdnfn, (void *) automember_modrdn_post_op) != 0) { - slapi_log_error(SLAPI_LOG_ERR, AUTOMEMBER_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_ERR, AUTOMEMBER_PLUGIN_SUBSYSTEM, "automember_postop_init - Failed to register plugin\n"); status = -1; } @@ -306,7 +306,7 @@ automember_start(Slapi_PBlock * pb) Slapi_DN *plugindn = NULL; char *config_area = NULL; - slapi_log_error(SLAPI_LOG_TRACE, AUTOMEMBER_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_TRACE, AUTOMEMBER_PLUGIN_SUBSYSTEM, "--> automember_start\n"); slapi_plugin_task_register_handler("automember rebuild membership", automember_task_add, pb); @@ -314,7 +314,7 @@ automember_start(Slapi_PBlock * pb) slapi_plugin_task_register_handler("automember map updates", automember_task_add_map_entries, pb); if ((g_automember_config_lock = slapi_new_rwlock()) == NULL) { - slapi_log_error(SLAPI_LOG_ERR, AUTOMEMBER_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_ERR, AUTOMEMBER_PLUGIN_SUBSYSTEM, "automember_start - Lock creation failed\n"); return -1; } @@ -324,7 +324,7 @@ automember_start(Slapi_PBlock * pb) * and store it for future use. */ slapi_pblock_get(pb, SLAPI_TARGET_SDN, &plugindn); if (NULL == plugindn || 0 == slapi_sdn_get_ndn_len(plugindn)) { - slapi_log_error(SLAPI_LOG_PLUGIN, AUTOMEMBER_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_PLUGIN, AUTOMEMBER_PLUGIN_SUBSYSTEM, "automember_start - Unable to retrieve plugin dn\n"); return -1; } @@ -344,14 +344,14 @@ automember_start(Slapi_PBlock * pb) PR_INIT_CLIST(g_automember_config); if (automember_load_config() != 0) { - slapi_log_error(SLAPI_LOG_ERR, AUTOMEMBER_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_ERR, AUTOMEMBER_PLUGIN_SUBSYSTEM, "automember_start - Unable to load plug-in configuration\n"); return -1; } - slapi_log_error(SLAPI_LOG_PLUGIN, AUTOMEMBER_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_PLUGIN, AUTOMEMBER_PLUGIN_SUBSYSTEM, "auto membership plug-in: ready for service\n"); - slapi_log_error(SLAPI_LOG_TRACE, AUTOMEMBER_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_TRACE, AUTOMEMBER_PLUGIN_SUBSYSTEM, "<-- automember_start\n"); return 0; @@ -365,7 +365,7 @@ automember_start(Slapi_PBlock * pb) static int automember_close(Slapi_PBlock * pb) { - slapi_log_error(SLAPI_LOG_TRACE, AUTOMEMBER_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_TRACE, AUTOMEMBER_PLUGIN_SUBSYSTEM, "--> automember_close\n"); /* unregister the tasks */ @@ -382,7 +382,7 @@ automember_close(Slapi_PBlock * pb) slapi_destroy_rwlock(g_automember_config_lock); g_automember_config_lock = NULL; - slapi_log_error(SLAPI_LOG_TRACE, AUTOMEMBER_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_TRACE, AUTOMEMBER_PLUGIN_SUBSYSTEM, "<-- automember_close\n"); return 0; @@ -413,7 +413,7 @@ automember_load_config(void) Slapi_PBlock *search_pb; Slapi_Entry **entries = NULL; - slapi_log_error(SLAPI_LOG_TRACE, AUTOMEMBER_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_TRACE, AUTOMEMBER_PLUGIN_SUBSYSTEM, "--> automember_load_config\n"); /* Clear out any old config. */ @@ -430,7 +430,7 @@ automember_load_config(void) * config entry. */ if (automember_get_config_area()) { /* Find the config entries beneath the alternate config area. */ - slapi_log_error(SLAPI_LOG_PLUGIN, AUTOMEMBER_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_PLUGIN, AUTOMEMBER_PLUGIN_SUBSYSTEM, "automember_load_config - Looking for config entries " "beneath \"%s\".\n", slapi_sdn_get_ndn(automember_get_config_area())); @@ -439,7 +439,7 @@ automember_load_config(void) NULL, 0, NULL, NULL, automember_get_plugin_id(), 0); } else { /* Find the config entries beneath our plugin entry. */ - slapi_log_error(SLAPI_LOG_PLUGIN, AUTOMEMBER_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_PLUGIN, AUTOMEMBER_PLUGIN_SUBSYSTEM, "automember_load_config - Looking for config entries " "beneath \"%s\".\n", slapi_sdn_get_ndn(automember_get_plugin_sdn())); @@ -453,7 +453,7 @@ automember_load_config(void) if (LDAP_SUCCESS != result) { if (automember_get_config_area() && (result == LDAP_NO_SUCH_OBJECT)) { - slapi_log_error(SLAPI_LOG_PLUGIN, AUTOMEMBER_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_PLUGIN, AUTOMEMBER_PLUGIN_SUBSYSTEM, "automember_load_config - Config container \"%s\" does " "not exist.\n", slapi_sdn_get_ndn(automember_get_config_area())); goto cleanup; @@ -468,7 +468,7 @@ automember_load_config(void) /* Loop through all of the entries we found and parse them. */ for (i = 0; entries && (entries[i] != NULL); i++) { - slapi_log_error(SLAPI_LOG_PLUGIN, AUTOMEMBER_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_PLUGIN, AUTOMEMBER_PLUGIN_SUBSYSTEM, "automember_load_config - Parsing config entry " "\"%s\".\n", slapi_entry_get_dn(entries[i])); /* We don't care about the status here because we may have @@ -481,7 +481,7 @@ automember_load_config(void) slapi_free_search_results_internal(search_pb); slapi_pblock_destroy(search_pb); automember_config_unlock(); - slapi_log_error(SLAPI_LOG_TRACE, AUTOMEMBER_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_TRACE, AUTOMEMBER_PLUGIN_SUBSYSTEM, "<-- automember_load_config\n"); return status; @@ -515,7 +515,7 @@ automember_parse_config_entry(Slapi_Entry * e, int apply) int i = 0; int ret = 0; - slapi_log_error(SLAPI_LOG_TRACE, AUTOMEMBER_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_TRACE, AUTOMEMBER_PLUGIN_SUBSYSTEM, "--> automember_parse_config_entry\n"); /* If this is the main plug-in config entry or @@ -550,14 +550,14 @@ automember_parse_config_entry(Slapi_Entry * e, int apply) if (value) { entry->dn = slapi_ch_strdup(value); } else { - slapi_log_error(SLAPI_LOG_ERR, AUTOMEMBER_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_ERR, AUTOMEMBER_PLUGIN_SUBSYSTEM, "automember_parse_config_entry - Error " "reading dn from config entry\n"); ret = -1; goto bail; } - slapi_log_error(SLAPI_LOG_CONFIG, AUTOMEMBER_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_CONFIG, AUTOMEMBER_PLUGIN_SUBSYSTEM, "----------> dn [%s]\n", entry->dn); /* Load the scope */ @@ -565,7 +565,7 @@ automember_parse_config_entry(Slapi_Entry * e, int apply) if (value) { entry->scope = value; } else { - slapi_log_error(SLAPI_LOG_ERR, AUTOMEMBER_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_ERR, AUTOMEMBER_PLUGIN_SUBSYSTEM, "automember_parse_config_entry - The %s config " "setting is required for config entry \"%s\".\n", AUTOMEMBER_SCOPE_TYPE, entry->dn); @@ -578,7 +578,7 @@ automember_parse_config_entry(Slapi_Entry * e, int apply) if (value) { /* Convert to a Slapi_Filter to improve performance. */ if (NULL == (entry->filter = slapi_str2filter(value))) { - slapi_log_error(SLAPI_LOG_ERR, AUTOMEMBER_PLUGIN_SUBSYSTEM , + slapi_log_err(SLAPI_LOG_ERR, AUTOMEMBER_PLUGIN_SUBSYSTEM , "automember_parse_config_entry - Invalid search filter in " "%s config setting for config entry \"%s\" " "(filter = \"%s\").\n", AUTOMEMBER_FILTER_TYPE, entry->dn, value); @@ -591,7 +591,7 @@ automember_parse_config_entry(Slapi_Entry * e, int apply) goto bail; } } else { - slapi_log_error(SLAPI_LOG_ERR, AUTOMEMBER_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_ERR, AUTOMEMBER_PLUGIN_SUBSYSTEM, "automember_parse_config_entry - The %s config " "setting is required for config entry \"%s\".\n", AUTOMEMBER_FILTER_TYPE, entry->dn); @@ -614,7 +614,7 @@ automember_parse_config_entry(Slapi_Entry * e, int apply) dn = slapi_sdn_new_dn_byref(values[i]); if(slapi_sdn_issuffix(dn, automember_get_config_area())){ /* The groups are under the config area - not good */ - slapi_log_error(SLAPI_LOG_ERR, AUTOMEMBER_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_ERR, AUTOMEMBER_PLUGIN_SUBSYSTEM, "automember_parse_config_entry - The default group \"%s\" can not be " "a child of the plugin config area \"%s\".\n", values[i], slapi_sdn_get_dn(automember_get_config_area())); @@ -633,7 +633,7 @@ automember_parse_config_entry(Slapi_Entry * e, int apply) if (value) { if (automember_parse_grouping_attr(value, &(entry->grouping_attr), &(entry->grouping_value)) != 0) { - slapi_log_error(SLAPI_LOG_ERR, AUTOMEMBER_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_ERR, AUTOMEMBER_PLUGIN_SUBSYSTEM, "automember_parse_config_entry - Invalid " "%s config setting for config entry \"%s\" " "(value: \"%s\").\n", AUTOMEMBER_GROUPING_ATTR_TYPE, @@ -646,7 +646,7 @@ automember_parse_config_entry(Slapi_Entry * e, int apply) goto bail; } } else { - slapi_log_error(SLAPI_LOG_ERR, AUTOMEMBER_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_ERR, AUTOMEMBER_PLUGIN_SUBSYSTEM, "automember_parse_config_entry - The %s config " "setting is required for config entry \"%s\".\n", AUTOMEMBER_GROUPING_ATTR_TYPE, entry->dn); @@ -666,7 +666,7 @@ automember_parse_config_entry(Slapi_Entry * e, int apply) * when we are simply validating config. We can just ignore no * such object errors. */ if ((LDAP_SUCCESS != result) && (LDAP_NO_SUCH_OBJECT != result)) { - slapi_log_error(SLAPI_LOG_ERR, AUTOMEMBER_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_ERR, AUTOMEMBER_PLUGIN_SUBSYSTEM, "automember_parse_config_entry - Error searching " "for child rule entries for config \"%s\" (err=%d).", entry->dn, result); @@ -679,7 +679,7 @@ automember_parse_config_entry(Slapi_Entry * e, int apply) /* Go through each child rule entry and parse it. */ for (i = 0; rule_entries && (rule_entries[i] != NULL); i++) { - slapi_log_error(SLAPI_LOG_PLUGIN, AUTOMEMBER_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_PLUGIN, AUTOMEMBER_PLUGIN_SUBSYSTEM, "automember_parse_config_entry - Parsing regex rule entry " "\"%s\".\n", slapi_entry_get_dn(rule_entries[i])); automember_parse_regex_entry(entry, rule_entries[i]); @@ -703,7 +703,7 @@ automember_parse_config_entry(Slapi_Entry * e, int apply) * the entry before that list item. */ if (slapi_dn_issuffix(entry->scope, config_entry->scope)) { PR_INSERT_BEFORE(&(entry->list), list); - slapi_log_error(SLAPI_LOG_CONFIG, AUTOMEMBER_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_CONFIG, AUTOMEMBER_PLUGIN_SUBSYSTEM, "automember_parse_config_entry - store [%s] before [%s] \n", entry->dn, config_entry->dn); @@ -716,7 +716,7 @@ automember_parse_config_entry(Slapi_Entry * e, int apply) /* If we hit the end of the list, add to the tail. */ if (g_automember_config == list) { PR_INSERT_BEFORE(&(entry->list), list); - slapi_log_error(SLAPI_LOG_CONFIG, AUTOMEMBER_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_CONFIG, AUTOMEMBER_PLUGIN_SUBSYSTEM, "automember_parse_config_entry - store [%s] at tail\n", entry->dn); entry_added = 1; @@ -726,7 +726,7 @@ automember_parse_config_entry(Slapi_Entry * e, int apply) } else { /* first entry */ PR_INSERT_LINK(&(entry->list), g_automember_config); - slapi_log_error(SLAPI_LOG_CONFIG, AUTOMEMBER_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_CONFIG, AUTOMEMBER_PLUGIN_SUBSYSTEM, "automember_parse_config_entry - store [%s] at head \n", entry->dn); entry_added = 1; @@ -736,7 +736,7 @@ automember_parse_config_entry(Slapi_Entry * e, int apply) if (0 == entry_added) { /* Don't log error if we weren't asked to apply config */ if ((apply != 0) && (entry != NULL)) { - slapi_log_error(SLAPI_LOG_ERR, AUTOMEMBER_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_ERR, AUTOMEMBER_PLUGIN_SUBSYSTEM, "automember_parse_config_entry - Invalid config entry " "[%s] skipped\n", entry->dn); } @@ -750,7 +750,7 @@ automember_parse_config_entry(Slapi_Entry * e, int apply) slapi_free_search_results_internal(search_pb); slapi_pblock_destroy(search_pb); - slapi_log_error(SLAPI_LOG_TRACE, AUTOMEMBER_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_TRACE, AUTOMEMBER_PLUGIN_SUBSYSTEM, "<-- automember_parse_config_entry\n"); return ret; @@ -765,7 +765,7 @@ automember_free_config_entry(struct configEntry ** entry) return; if (e->dn) { - slapi_log_error(SLAPI_LOG_CONFIG, AUTOMEMBER_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_CONFIG, AUTOMEMBER_PLUGIN_SUBSYSTEM, "automember_free_config_entry - Freeing config entry [%s]\n", e->dn); slapi_ch_free_string(&e->dn); } @@ -847,12 +847,12 @@ static Slapi_DN * automember_get_sdn(Slapi_PBlock * pb) { Slapi_DN *sdn = 0; - slapi_log_error(SLAPI_LOG_TRACE, AUTOMEMBER_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_TRACE, AUTOMEMBER_PLUGIN_SUBSYSTEM, "--> automember_get_sdn\n"); slapi_pblock_get(pb, SLAPI_TARGET_SDN, &sdn); - slapi_log_error(SLAPI_LOG_TRACE, AUTOMEMBER_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_TRACE, AUTOMEMBER_PLUGIN_SUBSYSTEM, "<-- automember_get_sdn\n"); return sdn; @@ -880,7 +880,7 @@ automember_dn_is_config(Slapi_DN *sdn) { int ret = 0; - slapi_log_error(SLAPI_LOG_TRACE, AUTOMEMBER_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_TRACE, AUTOMEMBER_PLUGIN_SUBSYSTEM, "--> automember_dn_is_config\n"); if (sdn == NULL) { @@ -904,7 +904,7 @@ automember_dn_is_config(Slapi_DN *sdn) } bail: - slapi_log_error(SLAPI_LOG_TRACE, AUTOMEMBER_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_TRACE, AUTOMEMBER_PLUGIN_SUBSYSTEM, "<-- automember_dn_is_config\n"); return ret; @@ -922,11 +922,11 @@ automember_oktodo(Slapi_PBlock *pb) int ret = 1; int oprc = 0; - slapi_log_error(SLAPI_LOG_TRACE, AUTOMEMBER_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_TRACE, AUTOMEMBER_PLUGIN_SUBSYSTEM, "--> automember_oktodo\n" ); if(slapi_pblock_get(pb, SLAPI_PLUGIN_OPRETURN, &oprc) != 0) { - slapi_log_error(SLAPI_LOG_ERR, AUTOMEMBER_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_ERR, AUTOMEMBER_PLUGIN_SUBSYSTEM, "automember_oktodo - Could not get parameters\n" ); ret = -1; } @@ -936,7 +936,7 @@ automember_oktodo(Slapi_PBlock *pb) ret = 0; } - slapi_log_error(SLAPI_LOG_TRACE, AUTOMEMBER_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_TRACE, AUTOMEMBER_PLUGIN_SUBSYSTEM, "<-- automember_oktodo\n" ); return ret; @@ -953,12 +953,12 @@ automember_isrepl(Slapi_PBlock *pb) { int is_repl = 0; - slapi_log_error(SLAPI_LOG_TRACE, AUTOMEMBER_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_TRACE, AUTOMEMBER_PLUGIN_SUBSYSTEM, "--> automember_isrepl\n" ); slapi_pblock_get(pb, SLAPI_IS_REPLICATED_OPERATION, &is_repl); - slapi_log_error(SLAPI_LOG_TRACE, AUTOMEMBER_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_TRACE, AUTOMEMBER_PLUGIN_SUBSYSTEM, "<-- automember_isrepl\n" ); return is_repl; @@ -980,13 +980,13 @@ automember_parse_regex_entry(struct configEntry *config, Slapi_Entry *e) PRCList *list; int i = 0; - slapi_log_error(SLAPI_LOG_TRACE, AUTOMEMBER_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_TRACE, AUTOMEMBER_PLUGIN_SUBSYSTEM, "--> automember_parse_regex_entry\n"); /* Make sure the target group was specified. */ target_group = slapi_entry_attr_get_charptr(e, AUTOMEMBER_TARGET_GROUP_TYPE); if (!target_group) { - slapi_log_error(SLAPI_LOG_ERR, AUTOMEMBER_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_ERR, AUTOMEMBER_PLUGIN_SUBSYSTEM, "automember_parse_regex_entry - The %s config " "setting is required for rule entry \"%s\".\n", AUTOMEMBER_TARGET_GROUP_TYPE, slapi_entry_get_ndn(e)); @@ -995,7 +995,7 @@ automember_parse_regex_entry(struct configEntry *config, Slapi_Entry *e) /* Ensure that the target group DN is valid. */ if (slapi_dn_syntax_check(NULL, target_group, 1) != 0) { - slapi_log_error(SLAPI_LOG_ERR, AUTOMEMBER_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_ERR, AUTOMEMBER_PLUGIN_SUBSYSTEM, "automember_parse_regex_entry - Invalid target group DN " "in rule \"%s\" (dn=\"%s\").\n", slapi_entry_get_ndn(e), target_group); @@ -1007,7 +1007,7 @@ automember_parse_regex_entry(struct configEntry *config, Slapi_Entry *e) group_dn = slapi_sdn_new_dn_byref(target_group); if(slapi_sdn_issuffix(group_dn, automember_get_config_area())){ /* The target group is under the plugin config area - not good */ - slapi_log_error(SLAPI_LOG_ERR, AUTOMEMBER_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_ERR, AUTOMEMBER_PLUGIN_SUBSYSTEM, "automember_parse_regex_entry - The target group \"%s\" can not be " "a child of the plugin config area \"%s\".\n", slapi_sdn_get_dn(group_dn), slapi_sdn_get_dn(automember_get_config_area())); @@ -1060,7 +1060,7 @@ automember_parse_regex_entry(struct configEntry *config, Slapi_Entry *e) PR_INSERT_LINK(&(rule->list), (PRCList *)config->inclusive_rules); } } else { - slapi_log_error(SLAPI_LOG_ERR, AUTOMEMBER_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_ERR, AUTOMEMBER_PLUGIN_SUBSYSTEM, "automember_parse_regex_entry - Skipping invalid inclusive " "regex rule in rule entry \"%s\" (rule = \"%s\").\n", slapi_entry_get_ndn(e), values[i]); @@ -1114,7 +1114,7 @@ automember_parse_regex_entry(struct configEntry *config, Slapi_Entry *e) PR_INSERT_LINK(&(rule->list), (PRCList *)config->exclusive_rules); } } else { - slapi_log_error(SLAPI_LOG_ERR, AUTOMEMBER_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_ERR, AUTOMEMBER_PLUGIN_SUBSYSTEM, "automember_parse_regex_entry - Skipping invalid exclusive " "regex rule in rule entry \"%s\" (rule = \"%s\").\n", slapi_entry_get_ndn(e), values[i]); @@ -1128,7 +1128,7 @@ automember_parse_regex_entry(struct configEntry *config, Slapi_Entry *e) bail: slapi_ch_free_string(&target_group); - slapi_log_error(SLAPI_LOG_TRACE, AUTOMEMBER_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_TRACE, AUTOMEMBER_PLUGIN_SUBSYSTEM, "<-- automember_parse_regex_entry\n"); } @@ -1153,7 +1153,7 @@ automember_parse_regex_rule(char *rule_string) /* A rule is in the form "attr=regex". */ /* Find the comparison attribute name. */ if ((p = strchr(rule_string, '=')) == NULL) { - slapi_log_error(SLAPI_LOG_ERR, AUTOMEMBER_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_ERR, AUTOMEMBER_PLUGIN_SUBSYSTEM, "automember_parse_regex_rule - Unable to parse " "regex rule (missing '=' delimeter).\n"); goto bail; @@ -1161,14 +1161,14 @@ automember_parse_regex_rule(char *rule_string) /* Make sure the attribute name is not empty. */ if (p == rule_string) { - slapi_log_error(SLAPI_LOG_ERR, AUTOMEMBER_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_ERR, AUTOMEMBER_PLUGIN_SUBSYSTEM, "automember_parse_regex_rule - Unable to parse " " regex rule (missing comparison attribute).\n"); goto bail; } if ((attr = strndup(rule_string, p - rule_string)) == NULL) { - slapi_log_error(SLAPI_LOG_ERR, AUTOMEMBER_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_ERR, AUTOMEMBER_PLUGIN_SUBSYSTEM, "automember_parse_regex_rule - Unable to allocate " "memory.\n"); goto bail; @@ -1177,7 +1177,7 @@ automember_parse_regex_rule(char *rule_string) /* Validate the attribute. */ for (p2 = attr; p2 && (*p2 != '\0'); p2++) { if (!IS_ATTRDESC_CHAR(*p2)) { - slapi_log_error(SLAPI_LOG_ERR, AUTOMEMBER_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_ERR, AUTOMEMBER_PLUGIN_SUBSYSTEM, "automember_parse_regex_rule - Invalid comparison " "attribute name \"%s\".\n", attr); goto bail; @@ -1187,7 +1187,7 @@ automember_parse_regex_rule(char *rule_string) /* Find the regex. */ p++; if (*p == '\0') { - slapi_log_error(SLAPI_LOG_ERR, AUTOMEMBER_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_ERR, AUTOMEMBER_PLUGIN_SUBSYSTEM, "automember_parse_regex_rule - Unable to parse " "regex rule (missing regex).\n"); goto bail; @@ -1196,7 +1196,7 @@ automember_parse_regex_rule(char *rule_string) /* Compile the regex to validate it. */ regex = slapi_re_comp(p, &recomp_result); if (!regex) { - slapi_log_error(SLAPI_LOG_ERR, AUTOMEMBER_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_ERR, AUTOMEMBER_PLUGIN_SUBSYSTEM, "automember_parse_regex_rule - Unable to parse " "regex rule (invalid regex). Error \"%s\".\n", recomp_result?recomp_result:"unknown"); @@ -1270,7 +1270,7 @@ automember_parse_grouping_attr(char *value, char **grouping_attr, char **groupin /* split out the type from the value (use the first ':') */ if ((p = strchr(value, ':')) == NULL) { - slapi_log_error(SLAPI_LOG_ERR, AUTOMEMBER_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_ERR, AUTOMEMBER_PLUGIN_SUBSYSTEM, "automember_parse_grouping_attr - Value for grouping attribute " "is not in the correct format. (value: \"%s\").\n", value); ret = 1; @@ -1279,7 +1279,7 @@ automember_parse_grouping_attr(char *value, char **grouping_attr, char **groupin /* Ensure the type is not empty. */ if (p == value) { - slapi_log_error(SLAPI_LOG_ERR, AUTOMEMBER_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_ERR, AUTOMEMBER_PLUGIN_SUBSYSTEM, "automember_parse_grouping_attr - Value for grouping attribute " "is not in the correct format. The grouping attribute is missing. " "(value: \"%s\").\n", value); @@ -1298,7 +1298,7 @@ automember_parse_grouping_attr(char *value, char **grouping_attr, char **groupin /* Ensure the value is not empty. */ if (*p == '\0') { - slapi_log_error(SLAPI_LOG_ERR, AUTOMEMBER_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_ERR, AUTOMEMBER_PLUGIN_SUBSYSTEM, "automember_parse_grouping_attr - Value for grouping attribute " "is not in the correct format. The grouping value is " "missing. (value: \"%s\").\n", value); @@ -1311,7 +1311,7 @@ automember_parse_grouping_attr(char *value, char **grouping_attr, char **groupin /* Ensure that memory was allocated successfully. */ if ((*grouping_attr == NULL) || (*grouping_value == NULL)) { - slapi_log_error(SLAPI_LOG_ERR, AUTOMEMBER_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_ERR, AUTOMEMBER_PLUGIN_SUBSYSTEM, "automember_parse_grouping_attr - Error allocating memory.\n"); ret = 1; goto bail; @@ -1320,7 +1320,7 @@ automember_parse_grouping_attr(char *value, char **grouping_attr, char **groupin /* Ensure that the grouping attr is a legal attr name. */ for (p = *grouping_attr; p && (*p != '\0'); p++) { if (!IS_ATTRDESC_CHAR(*p)) { - slapi_log_error(SLAPI_LOG_ERR, AUTOMEMBER_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_ERR, AUTOMEMBER_PLUGIN_SUBSYSTEM, "automember_parse_grouping_attr: Invalid value for " "grouping attribute. The grouping attribute type is " "illegal. (type: \"%s\").\n", *grouping_attr); @@ -1332,7 +1332,7 @@ automember_parse_grouping_attr(char *value, char **grouping_attr, char **groupin /* Ensure that the grouping value type is a legal attr name. */ for (p = *grouping_value; p && (*p != '\0'); p++) { if (!IS_ATTRDESC_CHAR(*p)) { - slapi_log_error(SLAPI_LOG_ERR, AUTOMEMBER_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_ERR, AUTOMEMBER_PLUGIN_SUBSYSTEM, "automember_parse_grouping_attr - Invalid value for " "grouping attribute. The grouping value type is " "illegal. (type: \"%s\").\n", *grouping_value); @@ -1374,7 +1374,7 @@ automember_update_membership(struct configEntry *config, Slapi_Entry *e, PRFileD return -1; } - slapi_log_error(SLAPI_LOG_PLUGIN, AUTOMEMBER_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_PLUGIN, AUTOMEMBER_PLUGIN_SUBSYSTEM, "automember_update_membership - Processing \"%s\" " "definition entry for candidate entry \"%s\".\n", config->dn, slapi_entry_get_dn(e)); @@ -1401,7 +1401,7 @@ automember_update_membership(struct configEntry *config, Slapi_Entry *e, PRFileD if (slapi_re_exec(curr_rule->regex, vals[i], -1) == 1) { /* Found a match. Add to end of the exclusion list * and set last as a hint to ourselves. */ - slapi_log_error(SLAPI_LOG_PLUGIN, AUTOMEMBER_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_PLUGIN, AUTOMEMBER_PLUGIN_SUBSYSTEM, "automember_update_membership - Adding \"%s\" " "to list of excluded groups for \"%s\" " "(matched: \"%s=%s\").\n", @@ -1476,7 +1476,7 @@ automember_update_membership(struct configEntry *config, Slapi_Entry *e, PRFileD if (slapi_re_exec(curr_rule->regex, vals[i], -1) == 1) { /* Found a match. Add to the end of the targets list * and set last as a hint to ourselves. */ - slapi_log_error(SLAPI_LOG_PLUGIN, AUTOMEMBER_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_PLUGIN, AUTOMEMBER_PLUGIN_SUBSYSTEM, "automember_update_membership - Adding \"%s\" " "to list of target groups for \"%s\" " "(matched: \"%s=%s\").\n", @@ -1601,7 +1601,7 @@ automember_add_member_value(Slapi_Entry *member_e, const char *group_dn, char *g mods[1] = 0; /* Perform the modify operation. */ - slapi_log_error(SLAPI_LOG_PLUGIN, AUTOMEMBER_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_PLUGIN, AUTOMEMBER_PLUGIN_SUBSYSTEM, "automember_add_member_value - Adding \"%s\" as " "a \"%s\" value to group \"%s\".\n", member_value, grouping_attr, group_dn); @@ -1612,7 +1612,7 @@ automember_add_member_value(Slapi_Entry *member_e, const char *group_dn, char *g slapi_pblock_get(mod_pb, SLAPI_PLUGIN_INTOP_RESULT, &result); if ((result != LDAP_SUCCESS) && (result != LDAP_TYPE_OR_VALUE_EXISTS)) { - slapi_log_error(SLAPI_LOG_ERR, AUTOMEMBER_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_ERR, AUTOMEMBER_PLUGIN_SUBSYSTEM, "automember_add_member_value - Unable to add \"%s\" as " "a \"%s\" value to group \"%s\" (%s).\n", member_value, grouping_attr, group_dn, @@ -1620,7 +1620,7 @@ automember_add_member_value(Slapi_Entry *member_e, const char *group_dn, char *g rc = result; } } else { - slapi_log_error(SLAPI_LOG_ERR, AUTOMEMBER_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_ERR, AUTOMEMBER_PLUGIN_SUBSYSTEM, "automember_add_member_value - Unable to find grouping " "value attribute \"%s\" in entry \"%s\".\n", grouping_value, slapi_entry_get_dn(member_e)); @@ -1658,7 +1658,7 @@ automember_pre_op(Slapi_PBlock * pb, int modop) char *errstr = NULL; int ret = SLAPI_PLUGIN_SUCCESS; - slapi_log_error(SLAPI_LOG_TRACE, AUTOMEMBER_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_TRACE, AUTOMEMBER_PLUGIN_SUBSYSTEM, "--> automember_pre_op\n"); if (0 == (sdn = automember_get_sdn(pb))) @@ -1733,7 +1733,7 @@ automember_pre_op(Slapi_PBlock * pb, int modop) slapi_entry_free(e); if (ret) { - slapi_log_error(SLAPI_LOG_PLUGIN, AUTOMEMBER_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_PLUGIN, AUTOMEMBER_PLUGIN_SUBSYSTEM, "automember_pre_op - Operation failure [%d]\n", ret); slapi_send_ldap_result(pb, ret, NULL, errstr, 0, NULL); slapi_ch_free((void **)&errstr); @@ -1741,7 +1741,7 @@ automember_pre_op(Slapi_PBlock * pb, int modop) ret = SLAPI_PLUGIN_FAILURE; } - slapi_log_error(SLAPI_LOG_TRACE, AUTOMEMBER_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_TRACE, AUTOMEMBER_PLUGIN_SUBSYSTEM, "<-- automember_pre_op\n"); return ret; @@ -1770,7 +1770,7 @@ automember_mod_post_op(Slapi_PBlock *pb) { Slapi_DN *sdn = NULL; - slapi_log_error(SLAPI_LOG_TRACE, AUTOMEMBER_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_TRACE, AUTOMEMBER_PLUGIN_SUBSYSTEM, "--> automember_mod_post_op\n"); if (automember_oktodo(pb) && (sdn = automember_get_sdn(pb))) { @@ -1780,7 +1780,7 @@ automember_mod_post_op(Slapi_PBlock *pb) } } - slapi_log_error(SLAPI_LOG_TRACE, AUTOMEMBER_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_TRACE, AUTOMEMBER_PLUGIN_SUBSYSTEM, "<-- automember_mod_post_op\n"); return SLAPI_PLUGIN_SUCCESS; @@ -1795,7 +1795,7 @@ automember_add_post_op(Slapi_PBlock *pb) PRCList *list = NULL; int rc = SLAPI_PLUGIN_SUCCESS; - slapi_log_error(SLAPI_LOG_TRACE, AUTOMEMBER_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_TRACE, AUTOMEMBER_PLUGIN_SUBSYSTEM, "--> automember_add_post_op\n"); /* Reload config if a config entry was added. */ @@ -1804,7 +1804,7 @@ automember_add_post_op(Slapi_PBlock *pb) automember_load_config(); } } else { - slapi_log_error(SLAPI_LOG_PLUGIN, AUTOMEMBER_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_PLUGIN, AUTOMEMBER_PLUGIN_SUBSYSTEM, "automember_add_post_op - Error retrieving dn\n"); rc = SLAPI_PLUGIN_FAILURE; @@ -1854,13 +1854,13 @@ automember_add_post_op(Slapi_PBlock *pb) automember_config_unlock(); } else { - slapi_log_error(SLAPI_LOG_PLUGIN, AUTOMEMBER_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_PLUGIN, AUTOMEMBER_PLUGIN_SUBSYSTEM, "automember_add_post_op - Error " "retrieving post-op entry %s\n", slapi_sdn_get_dn(sdn)); } bail: - slapi_log_error(SLAPI_LOG_TRACE, AUTOMEMBER_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_TRACE, AUTOMEMBER_PLUGIN_SUBSYSTEM, "<-- automember_add_post_op (%d)\n", rc); if(rc){ @@ -1885,7 +1885,7 @@ automember_del_post_op(Slapi_PBlock *pb) { Slapi_DN *sdn = NULL; - slapi_log_error(SLAPI_LOG_TRACE, AUTOMEMBER_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_TRACE, AUTOMEMBER_PLUGIN_SUBSYSTEM, "--> automember_del_post_op\n"); /* Reload config if a config entry was deleted. */ @@ -1893,11 +1893,11 @@ automember_del_post_op(Slapi_PBlock *pb) if (automember_dn_is_config(sdn)) automember_load_config(); } else { - slapi_log_error(SLAPI_LOG_PLUGIN, AUTOMEMBER_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_PLUGIN, AUTOMEMBER_PLUGIN_SUBSYSTEM, "automember_del_post_op - Error retrieving dn\n"); } - slapi_log_error(SLAPI_LOG_TRACE, AUTOMEMBER_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_TRACE, AUTOMEMBER_PLUGIN_SUBSYSTEM, "<-- automember_del_post_op\n"); return SLAPI_PLUGIN_SUCCESS; @@ -2076,7 +2076,7 @@ automember_task_add(Slapi_PBlock *pb, Slapi_Entry *e, Slapi_Entry *eAfter, (void *)task, PR_PRIORITY_NORMAL, PR_GLOBAL_THREAD, PR_UNJOINABLE_THREAD, SLAPD_DEFAULT_THREAD_STACKSIZE); if (thread == NULL){ - slapi_log_error(SLAPI_LOG_ERR, AUTOMEMBER_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_ERR, AUTOMEMBER_PLUGIN_SUBSYSTEM, "automember_task_add - Unable to create task thread!\n"); *returncode = LDAP_OPERATIONS_ERROR; slapi_task_finish(task, *returncode); @@ -2111,7 +2111,7 @@ void automember_rebuild_task_thread(void *arg) return; /* no task */ } slapi_task_inc_refcount(task); - slapi_log_error(SLAPI_LOG_PLUGIN, AUTOMEMBER_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_PLUGIN, AUTOMEMBER_PLUGIN_SUBSYSTEM, "automember_rebuild_task_thread - Refcount incremented.\n" ); /* * Fetch our task data from the task @@ -2141,7 +2141,7 @@ void automember_rebuild_task_thread(void *arg) slapi_task_log_status(task, "Automember rebuild membership task unable to search" " on base (%s) filter (%s) error (%d)\n", slapi_sdn_get_dn(td->base_dn), td->filter_str, result); - slapi_log_error(SLAPI_LOG_ERR, AUTOMEMBER_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_ERR, AUTOMEMBER_PLUGIN_SUBSYSTEM, "automember_rebuild_task_thread - Unable to search on base (%s) filter (%s) error (%d)\n", slapi_sdn_get_dn(td->base_dn), td->filter_str, result); goto out; @@ -2158,11 +2158,11 @@ void automember_rebuild_task_thread(void *arg) fixup_pb = slapi_pblock_new(); slapi_pblock_set(fixup_pb, SLAPI_BACKEND, be); if(slapi_back_transaction_begin(fixup_pb) != LDAP_SUCCESS){ - slapi_log_error(SLAPI_LOG_ERR, AUTOMEMBER_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_ERR, AUTOMEMBER_PLUGIN_SUBSYSTEM, "automember_rebuild_task_thread - Failed to start transaction\n"); } } else { - slapi_log_error(SLAPI_LOG_ERR, AUTOMEMBER_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_ERR, AUTOMEMBER_PLUGIN_SUBSYSTEM, "automember_rebuild_task_thread - Failed to get be backend from %s\n", slapi_sdn_get_dn(td->base_dn)); } @@ -2217,7 +2217,7 @@ out: slapi_task_inc_progress(task); slapi_task_finish(task, result); slapi_task_dec_refcount(task); - slapi_log_error(SLAPI_LOG_PLUGIN, AUTOMEMBER_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_PLUGIN, AUTOMEMBER_PLUGIN_SUBSYSTEM, "automember_rebuild_task_thread - Refcount decremented.\n" ); } @@ -2307,7 +2307,7 @@ automember_task_add_export_updates(Slapi_PBlock *pb, Slapi_Entry *e, Slapi_Entry (void *)task, PR_PRIORITY_NORMAL, PR_GLOBAL_THREAD, PR_UNJOINABLE_THREAD, SLAPD_DEFAULT_THREAD_STACKSIZE); if (thread == NULL){ - slapi_log_error(SLAPI_LOG_ERR, AUTOMEMBER_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_ERR, AUTOMEMBER_PLUGIN_SUBSYSTEM, "automember_task_add_export_updates - Unable to create export task thread!\n"); *returncode = LDAP_OPERATIONS_ERROR; rv = SLAPI_DSE_CALLBACK_ERROR; @@ -2338,7 +2338,7 @@ void automember_export_task_thread(void *arg) return; /* no task */ } slapi_task_inc_refcount(task); - slapi_log_error(SLAPI_LOG_PLUGIN, AUTOMEMBER_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_PLUGIN, AUTOMEMBER_PLUGIN_SUBSYSTEM, "automember_export_task_thread - Refcount incremented.\n" ); td = (task_data *)slapi_task_get_data(task); @@ -2353,7 +2353,7 @@ void automember_export_task_thread(void *arg) td->ldif_out, rc, slapi_system_strerror(rc)); slapi_task_log_status(task, "Automember export task could not open ldif file \"%s\" for writing, error %d (%s)\n", td->ldif_out, rc, slapi_system_strerror(rc) ); - slapi_log_error(SLAPI_LOG_ERR, AUTOMEMBER_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_ERR, AUTOMEMBER_PLUGIN_SUBSYSTEM, "automember_export_task_thread - Could not open ldif file \"%s\" for writing, error %d (%s)\n", td->ldif_out, rc, slapi_system_strerror(rc) ); result = SLAPI_DSE_CALLBACK_ERROR; @@ -2377,7 +2377,7 @@ void automember_export_task_thread(void *arg) slapi_sdn_get_dn(td->base_dn), td->filter_str, result); slapi_task_log_status(task, "Automember task failed to search on base (%s) filter (%s) error (%d)\n", slapi_sdn_get_dn(td->base_dn), td->filter_str, result); - slapi_log_error(SLAPI_LOG_ERR, AUTOMEMBER_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_ERR, AUTOMEMBER_PLUGIN_SUBSYSTEM, "automember_export_task_thread - Unable to search on base (%s) filter (%s) error (%d)\n", slapi_sdn_get_dn(td->base_dn), td->filter_str, result); goto out; @@ -2426,7 +2426,7 @@ out: slapi_task_inc_progress(task); slapi_task_finish(task, result); slapi_task_dec_refcount(task); - slapi_log_error(SLAPI_LOG_PLUGIN, AUTOMEMBER_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_PLUGIN, AUTOMEMBER_PLUGIN_SUBSYSTEM, "automember_export_task_thread - Refcount decremented.\n" ); } @@ -2494,7 +2494,7 @@ automember_task_add_map_entries(Slapi_PBlock *pb, Slapi_Entry *e, Slapi_Entry *e (void *)task, PR_PRIORITY_NORMAL, PR_GLOBAL_THREAD, PR_UNJOINABLE_THREAD, SLAPD_DEFAULT_THREAD_STACKSIZE); if (thread == NULL){ - slapi_log_error(SLAPI_LOG_ERR, AUTOMEMBER_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_ERR, AUTOMEMBER_PLUGIN_SUBSYSTEM, "automember_task_add_map_entries - Unable to create map task thread!\n"); *returncode = LDAP_OPERATIONS_ERROR; rv = SLAPI_DSE_CALLBACK_ERROR; @@ -2537,7 +2537,7 @@ void automember_map_task_thread(void *arg) return; /* no task */ } slapi_task_inc_refcount(task); - slapi_log_error(SLAPI_LOG_PLUGIN, AUTOMEMBER_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_PLUGIN, AUTOMEMBER_PLUGIN_SUBSYSTEM, "automember_map_task_thread - Refcount incremented.\n" ); td = (task_data *)slapi_task_get_data(task); slapi_task_begin(task, 1); @@ -2553,7 +2553,7 @@ void automember_map_task_thread(void *arg) td->ldif_out, rc, slapi_system_strerror(rc)); slapi_task_log_status(task, "The ldif file %s could not be accessed, error %d (%s). Aborting task.\n", td->ldif_out, rc, slapi_system_strerror(rc)); - slapi_log_error(SLAPI_LOG_ERR, AUTOMEMBER_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_ERR, AUTOMEMBER_PLUGIN_SUBSYSTEM, "automember_map_task_thread - Could not open ldif file \"%s\" for writing, error %d (%s)\n", td->ldif_out, rc, slapi_system_strerror(rc) ); result = SLAPI_DSE_CALLBACK_ERROR; @@ -2573,7 +2573,7 @@ void automember_map_task_thread(void *arg) td->ldif_in, rc, errstr); slapi_task_log_status(task, "The ldif file %s could not be accessed, error %d (%s). Aborting task.\n", td->ldif_in, rc, errstr); - slapi_log_error(SLAPI_LOG_ERR, AUTOMEMBER_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_ERR, AUTOMEMBER_PLUGIN_SUBSYSTEM, "automember_map_task_thread - Could not open ldif file \"%s\" for reading, error %d (%s)\n", td->ldif_in, rc, errstr ); result = SLAPI_DSE_CALLBACK_ERROR; @@ -2634,7 +2634,7 @@ out: slapi_task_inc_progress(task); slapi_task_finish(task, result); slapi_task_dec_refcount(task); - slapi_log_error(SLAPI_LOG_PLUGIN, AUTOMEMBER_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_PLUGIN, AUTOMEMBER_PLUGIN_SUBSYSTEM, "automember_map_task_thread - Refcount decremented.\n" ); } @@ -2654,7 +2654,7 @@ automember_modrdn_post_op(Slapi_PBlock *pb) PRCList *list = NULL; int rc = SLAPI_PLUGIN_SUCCESS; - slapi_log_error(SLAPI_LOG_TRACE, AUTOMEMBER_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_TRACE, AUTOMEMBER_PLUGIN_SUBSYSTEM, "--> automember_modrdn_post_op\n"); /* Just bail if we aren't ready to service requests yet. */ @@ -2671,7 +2671,7 @@ automember_modrdn_post_op(Slapi_PBlock *pb) if (post_e) { new_sdn = slapi_entry_get_sdn(post_e); } else { - slapi_log_error(SLAPI_LOG_PLUGIN, AUTOMEMBER_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_PLUGIN, AUTOMEMBER_PLUGIN_SUBSYSTEM, "automember_modrdn_post_op - Error " "retrieving post-op entry\n"); return SLAPI_PLUGIN_FAILURE; @@ -2682,7 +2682,7 @@ automember_modrdn_post_op(Slapi_PBlock *pb) automember_load_config(); } } else { - slapi_log_error(SLAPI_LOG_PLUGIN, AUTOMEMBER_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_PLUGIN, AUTOMEMBER_PLUGIN_SUBSYSTEM, "automember_modrdn_post_op - Error " "retrieving dn\n"); return SLAPI_PLUGIN_FAILURE; @@ -2729,7 +2729,7 @@ automember_modrdn_post_op(Slapi_PBlock *pb) slapi_pblock_set(pb, SLAPI_PB_RESULT_TEXT, &errtxt); } - slapi_log_error(SLAPI_LOG_TRACE, AUTOMEMBER_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_TRACE, AUTOMEMBER_PLUGIN_SUBSYSTEM, "<-- automember_modrdn_post_op (%d)\n", rc); return rc; diff --git a/ldap/servers/plugins/bitwise/bitwise.c b/ldap/servers/plugins/bitwise/bitwise.c index 3bedfa7..5ceffac 100644 --- a/ldap/servers/plugins/bitwise/bitwise.c +++ b/ldap/servers/plugins/bitwise/bitwise.c @@ -163,7 +163,7 @@ bitwise_filter_create (Slapi_PBlock* pb) } else if (strcmp(mrOID, "1.2.840.113556.1.4.804") == 0) { slapi_pblock_set (pb, SLAPI_PLUGIN_MR_FILTER_MATCH_FN, (void*)bitwise_filter_match_or); } else { /* this oid not handled by this plugin */ - LDAPDebug(LDAP_DEBUG_FILTER, "=> bitwise_filter_create OID (%s) not handled\n", mrOID, 0, 0); + slapi_log_err(SLAPI_LOG_FILTER, "bitwise_filter_create", "OID (%s) not handled\n", mrOID); return rc; } bmc = new_bitwise_match_cb(mrTYPE, mrVALUE); @@ -171,9 +171,9 @@ bitwise_filter_create (Slapi_PBlock* pb) slapi_pblock_set (pb, SLAPI_PLUGIN_DESTROY_FN, (void*)bitwise_filter_destroy); rc = LDAP_SUCCESS; } else { - LDAPDebug(LDAP_DEBUG_FILTER, "=> bitwise_filter_create missing parameter(s)\n", 0, 0, 0); + slapi_log_err(SLAPI_LOG_FILTER, "bitwise_filter_create", "missing parameter(s)\n"); } - LDAPDebug(LDAP_DEBUG_FILTER, "<= bitwise_filter_create %i\n", rc, 0, 0); + slapi_log_err(SLAPI_LOG_FILTER, "bitwise_filter_create", "%i\n", rc); return LDAP_SUCCESS; } @@ -189,6 +189,6 @@ bitwise_init (Slapi_PBlock* pb) if ( rc == 0 ) { rc = slapi_pblock_set( pb, SLAPI_PLUGIN_DESCRIPTION, (void *)&pdesc ); } - LDAPDebug(LDAP_DEBUG_FILTER, "bitwise_init %i\n", rc, 0, 0); + slapi_log_err(SLAPI_LOG_FILTER, "bitwise_init", "%i\n", rc); return rc; } diff --git a/ldap/servers/plugins/chainingdb/cb_add.c b/ldap/servers/plugins/chainingdb/cb_add.c index 48590a4..9c772ac 100644 --- a/ldap/servers/plugins/chainingdb/cb_add.c +++ b/ldap/servers/plugins/chainingdb/cb_add.c @@ -87,7 +87,7 @@ chaining_back_add ( Slapi_PBlock *pb ) if (LDAP_SUCCESS != rc) { static int warned_get_conn = 0; if (!warned_get_conn) { - slapi_log_error(SLAPI_LOG_ERR, CB_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_ERR, CB_PLUGIN_SUBSYSTEM, "chaining_back_add - cb_get_connection failed (%d) %s\n", rc, ldap_err2string(rc)); warned_get_conn = 1; @@ -121,7 +121,7 @@ chaining_back_add ( Slapi_PBlock *pb ) * Call the backend preoperation plugins */ if((rc = slapi_plugin_call_preop_be_plugins(pb, SLAPI_PLUGIN_ADD_OP))){ - slapi_log_error(SLAPI_LOG_ERR, CB_PLUGIN_SUBSYSTEM, "chaining_back_add - add (%s): pre betxn failed, error (%d)\n",dn,rc); + slapi_log_err(SLAPI_LOG_ERR, CB_PLUGIN_SUBSYSTEM, "chaining_back_add - add (%s): pre betxn failed, error (%d)\n",dn,rc); cb_release_op_connection(cb->pool,ld,0); ldap_mods_free(mods,1); ldap_controls_free(ctrls); @@ -138,7 +138,7 @@ chaining_back_add ( Slapi_PBlock *pb ) ldap_controls_free(ctrls); if ( rc != LDAP_SUCCESS ) { - slapi_log_error(SLAPI_LOG_ERR, CB_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_ERR, CB_PLUGIN_SUBSYSTEM, "ldap_add_ext failed -- %s\n", ldap_err2string(rc) ); cb_send_ldap_result( pb, LDAP_OPERATIONS_ERROR, NULL, ENDUSERMSG, 0, NULL ); @@ -199,7 +199,7 @@ chaining_back_add ( Slapi_PBlock *pb ) if ( parse_rc != LDAP_SUCCESS ) { static int warned_parse_rc = 0; if (!warned_parse_rc) { - slapi_log_error(SLAPI_LOG_ERR, CB_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_ERR, CB_PLUGIN_SUBSYSTEM, "chaining_back_add - %s%s%s\n", matched_msg?matched_msg:"", (matched_msg&&(*matched_msg!='\0'))?": ":"", @@ -220,7 +220,7 @@ chaining_back_add ( Slapi_PBlock *pb ) struct berval ** refs = referrals2berval(referrals); static int warned_rc = 0; if (!warned_rc && error_msg) { - slapi_log_error(SLAPI_LOG_ERR, CB_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_ERR, CB_PLUGIN_SUBSYSTEM, "chaining_back_add - %s%s%s\n", matched_msg?matched_msg:"", (matched_msg&&(*matched_msg!='\0'))?": ":"", @@ -245,7 +245,7 @@ chaining_back_add ( Slapi_PBlock *pb ) /* Call the backend postoperation plugins */ if((rc = slapi_plugin_call_postop_be_plugins(pb, SLAPI_PLUGIN_ADD_OP))){ - slapi_log_error(SLAPI_LOG_ERR, CB_PLUGIN_SUBSYSTEM, "chaining_back_add - add (%s): post betxn failed, error (%d)\n",dn,rc); + slapi_log_err(SLAPI_LOG_ERR, CB_PLUGIN_SUBSYSTEM, "chaining_back_add - add (%s): post betxn failed, error (%d)\n",dn,rc); } /* Add control response sent by the farm server */ diff --git a/ldap/servers/plugins/chainingdb/cb_bind.c b/ldap/servers/plugins/chainingdb/cb_bind.c index 2bf9cd8..663f5b0 100644 --- a/ldap/servers/plugins/chainingdb/cb_bind.c +++ b/ldap/servers/plugins/chainingdb/cb_bind.c @@ -91,7 +91,7 @@ cb_sasl_bind_once_s( cb_conn_pool *pool, const char *dn, ber_tag_t method, if (LDAP_SUCCESS != rc) { static int warned_get_conn = 0; if (!warned_get_conn) { - slapi_log_error(SLAPI_LOG_ERR, CB_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_ERR, CB_PLUGIN_SUBSYSTEM, "cb_sasl_bind_once_s - cb_get_connection failed (%d) %s\n", rc, ldap_err2string(rc)); warned_get_conn = 1; @@ -157,7 +157,7 @@ cb_sasl_bind_once_s( cb_conn_pool *pool, const char *dn, ber_tag_t method, static int warned_bind_once = 0; if (!warned_bind_once) { int hasmatched = (matcheddnp && *matcheddnp && (**matcheddnp != '\0')); - slapi_log_error(SLAPI_LOG_ERR, CB_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_ERR, CB_PLUGIN_SUBSYSTEM, "cb_sasl_bind_once_s - Failed (%s%s%s)\n", hasmatched ? *matcheddnp : "", hasmatched ? ": " : "", diff --git a/ldap/servers/plugins/chainingdb/cb_close.c b/ldap/servers/plugins/chainingdb/cb_close.c index ff3fc9c..4ef5ed5 100644 --- a/ldap/servers/plugins/chainingdb/cb_close.c +++ b/ldap/servers/plugins/chainingdb/cb_close.c @@ -72,7 +72,7 @@ int cb_back_close( Slapi_PBlock *pb ) { const char *betype = slapi_be_gettype(be); if (!betype || strcasecmp(betype,CB_CHAINING_BACKEND_TYPE)) { - slapi_log_error(SLAPI_LOG_ERR, CB_PLUGIN_SUBSYSTEM, "cb_back_close - Wrong database type.\n"); + slapi_log_err(SLAPI_LOG_ERR, CB_PLUGIN_SUBSYSTEM, "cb_back_close - Wrong database type.\n"); free_cb_backend(cb); return 0; } @@ -81,7 +81,7 @@ int cb_back_close( Slapi_PBlock *pb ) inst = cb_get_instance(be); CB_ASSERT( inst != NULL ); - slapi_log_error(SLAPI_LOG_PLUGIN, CB_PLUGIN_SUBSYSTEM,"cb_back_close - Stopping chaining database instance %s\n", + slapi_log_err(SLAPI_LOG_PLUGIN, CB_PLUGIN_SUBSYSTEM,"cb_back_close - Stopping chaining database instance %s\n", inst->configDn); /* * emulate a backend instance deletion to clean up everything diff --git a/ldap/servers/plugins/chainingdb/cb_compare.c b/ldap/servers/plugins/chainingdb/cb_compare.c index 522d23e..a54225a 100644 --- a/ldap/servers/plugins/chainingdb/cb_compare.c +++ b/ldap/servers/plugins/chainingdb/cb_compare.c @@ -93,7 +93,7 @@ chaining_back_compare ( Slapi_PBlock *pb ) if (LDAP_SUCCESS != rc) { static int warned_get_conn = 0; if (!warned_get_conn) { - slapi_log_error(SLAPI_LOG_ERR, CB_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_ERR, CB_PLUGIN_SUBSYSTEM, "chaining_back_compare - cb_get_connection failed (%d) %s\n", rc, ldap_err2string(rc)); warned_get_conn = 1; @@ -184,7 +184,7 @@ chaining_back_compare ( Slapi_PBlock *pb ) if ( parse_rc != LDAP_SUCCESS ) { static int warned_parse_rc = 0; if (!warned_parse_rc) { - slapi_log_error(SLAPI_LOG_ERR, CB_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_ERR, CB_PLUGIN_SUBSYSTEM, "chaining_back_compare - %s%s%s\n", matched_msg?matched_msg:"", (matched_msg&&(*matched_msg!='\0'))?": ":"", diff --git a/ldap/servers/plugins/chainingdb/cb_config.c b/ldap/servers/plugins/chainingdb/cb_config.c index ce7bbae..96e42da 100644 --- a/ldap/servers/plugins/chainingdb/cb_config.c +++ b/ldap/servers/plugins/chainingdb/cb_config.c @@ -42,7 +42,7 @@ int cb_config_add_dse_entries(cb_backend *cb, char **entries, char *string1, cha slapi_add_internal_pb(util_pb); slapi_pblock_get(util_pb, SLAPI_PLUGIN_INTOP_RESULT, &res); if ( LDAP_SUCCESS != res && LDAP_ALREADY_EXISTS != res ) { - slapi_log_error(SLAPI_LOG_ERR, CB_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_ERR, CB_PLUGIN_SUBSYSTEM, "cb_config_add_dse_entries - Unable to add config entry (%s) to the DSE: %s\n", slapi_entry_get_dn(e), ldap_err2string(res)); @@ -83,7 +83,7 @@ int cb_config_load_dse_info(Slapi_PBlock * pb) { if ( LDAP_SUCCESS == res ) { slapi_pblock_get(search_pb, SLAPI_PLUGIN_INTOP_SEARCH_ENTRIES, &entries); if (NULL == entries || entries[0] == NULL) { - slapi_log_error(SLAPI_LOG_PLUGIN, CB_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_PLUGIN, CB_PLUGIN_SUBSYSTEM, "cb_config_load_dse_info - Error accessing entry <%s>\n",cb->configDN); slapi_free_search_results_internal(search_pb); slapi_pblock_destroy(search_pb); @@ -97,7 +97,7 @@ int cb_config_load_dse_info(Slapi_PBlock * pb) { } else { slapi_free_search_results_internal(search_pb); slapi_pblock_destroy(search_pb); - slapi_log_error(SLAPI_LOG_PLUGIN, CB_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_PLUGIN, CB_PLUGIN_SUBSYSTEM, "cb_config_load_dse_info - Error accessing entry <%s> (%s)\n",cb->configDN,ldap_err2string(res)); return 1; } @@ -121,7 +121,7 @@ int cb_config_load_dse_info(Slapi_PBlock * pb) { slapi_search_internal_pb (search_pb); slapi_pblock_get(search_pb, SLAPI_PLUGIN_INTOP_RESULT, &res); if (res != LDAP_SUCCESS) { - slapi_log_error(SLAPI_LOG_PLUGIN, CB_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_PLUGIN, CB_PLUGIN_SUBSYSTEM, "cb_config_load_dse_info - Error accessing the config DSE (%s)\n",ldap_err2string(res)); slapi_free_search_results_internal(search_pb); slapi_pblock_destroy(search_pb); @@ -205,7 +205,7 @@ int cb_config_add_check_callback(Slapi_PBlock *pb, Slapi_Entry* e, Slapi_Entry* while (i != -1 ) { bval = (struct berval *) slapi_value_get_berval(sval); if (!cb_is_control_forwardable(cb,bval->bv_val)) { - slapi_log_error(SLAPI_LOG_PLUGIN,CB_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_PLUGIN,CB_PLUGIN_SUBSYSTEM, "cb_config_add_check_callback - Control %s can't be forwarded.\n",bval->bv_val); *returncode=LDAP_CONSTRAINT_VIOLATION; return SLAPI_DSE_CALLBACK_ERROR; @@ -245,7 +245,7 @@ cb_config_add_callback(Slapi_PBlock *pb, Slapi_Entry* e, Slapi_Entry* e2, int *r while (i != -1 ) { bval = (struct berval *) slapi_value_get_berval(sval); if (!cb_is_control_forwardable(cb,bval->bv_val)) { - slapi_log_error(SLAPI_LOG_PLUGIN,CB_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_PLUGIN,CB_PLUGIN_SUBSYSTEM, "cb_config_add_callback - control %s can't be forwarded.\n",bval->bv_val); *returncode=LDAP_CONSTRAINT_VIOLATION; return SLAPI_DSE_CALLBACK_ERROR; @@ -358,7 +358,7 @@ cb_config_modify_check_callback(Slapi_PBlock *pb, Slapi_Entry* entryBefore, Slap for (j = 0; mods[i]->mod_bvalues && mods[i]->mod_bvalues[j]; j++) { config_attr_value = (char *) mods[i]->mod_bvalues[j]->bv_val; if (!cb_is_control_forwardable(cb,config_attr_value)) { - slapi_log_error(SLAPI_LOG_PLUGIN,CB_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_PLUGIN,CB_PLUGIN_SUBSYSTEM, "cb_config_modify_check_callback - control %s can't be forwarded.\n",config_attr_value); *returncode=LDAP_CONSTRAINT_VIOLATION; return SLAPI_DSE_CALLBACK_ERROR; @@ -392,7 +392,7 @@ cb_config_modify_callback(Slapi_PBlock *pb, Slapi_Entry* entryBefore, Slapi_Entr for (j = 0; mods[i]->mod_bvalues && mods[i]->mod_bvalues[j]; j++) { config_attr_value = (char *) mods[i]->mod_bvalues[j]->bv_val; if (!cb_is_control_forwardable(cb,config_attr_value)) { - slapi_log_error(SLAPI_LOG_PLUGIN,CB_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_PLUGIN,CB_PLUGIN_SUBSYSTEM, "cb_config_modify_callback - control %s can't be forwarded.\n",config_attr_value); *returncode=LDAP_CONSTRAINT_VIOLATION; return SLAPI_DSE_CALLBACK_ERROR; diff --git a/ldap/servers/plugins/chainingdb/cb_conn_stateless.c b/ldap/servers/plugins/chainingdb/cb_conn_stateless.c index 4c568c0..499b3a7 100644 --- a/ldap/servers/plugins/chainingdb/cb_conn_stateless.c +++ b/ldap/servers/plugins/chainingdb/cb_conn_stateless.c @@ -91,7 +91,7 @@ void cb_close_conn_pool(cb_conn_pool * pool) { for (i=0; i< MAX_CONN_ARRAY; i++) { for (conn = pool->connarray[i]; conn != NULL; conn = nextconn) { if ( conn->status != CB_CONNSTATUS_OK ) { - slapi_log_error(SLAPI_LOG_PLUGIN, CB_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_PLUGIN, CB_PLUGIN_SUBSYSTEM, "cb_close_conn_pool - Unexpected connection state (%d)\n",conn->status); } nextconn=conn->next; @@ -102,7 +102,7 @@ void cb_close_conn_pool(cb_conn_pool * pool) { else { for ( conn = pool->conn.conn_list; conn != NULL; conn = nextconn ) { if ( conn->status != CB_CONNSTATUS_OK ) { - slapi_log_error(SLAPI_LOG_PLUGIN, CB_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_PLUGIN, CB_PLUGIN_SUBSYSTEM, "cb_close_conn_pool - Unexpected connection state (%d)\n",conn->status); } nextconn=conn->next; @@ -194,7 +194,7 @@ cb_get_connection(cb_conn_pool * pool, if (maxconnections <=0) { static int warned_maxconn = 0; if (!warned_maxconn) { - slapi_log_error(SLAPI_LOG_ERR, CB_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_ERR, CB_PLUGIN_SUBSYSTEM, "cb_get_connection - Error (no connection available)\n"); warned_maxconn = 1; } @@ -238,7 +238,7 @@ cb_get_connection(cb_conn_pool * pool, slapi_lock_mutex( pool->conn.conn_list_mutex ); if (cb_debug_on()) { - slapi_log_error(SLAPI_LOG_PLUGIN, CB_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_PLUGIN, CB_PLUGIN_SUBSYSTEM, "cb_get_connection - server %s conns: %d maxconns: %d\n", hostname, pool->conn.conn_list_count, maxconnections ); } @@ -248,7 +248,7 @@ cb_get_connection(cb_conn_pool * pool, /* time limit mgmt */ if (checktime) { if (current_time() > endbefore ) { - slapi_log_error(SLAPI_LOG_PLUGIN, CB_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_PLUGIN, CB_PLUGIN_SUBSYSTEM, "cb_get_connection - server %s expired.\n", hostname ); if ( errmsg ) { *errmsg = PR_smprintf(error1,"timelimit exceeded"); @@ -269,7 +269,7 @@ cb_get_connection(cb_conn_pool * pool, if ((conn->ThreadId == PR_MyThreadId()) && (conn->status == CB_CONNSTATUS_OK && conn->refcount < maxconcurrency)){ if (cb_debug_on()) { - slapi_log_error(SLAPI_LOG_PLUGIN, CB_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_PLUGIN, CB_PLUGIN_SUBSYSTEM, "cb_get_connection - server found conn 0x%p to use)\n", conn ); } goto unlock_and_return; /* found one */ @@ -280,7 +280,7 @@ cb_get_connection(cb_conn_pool * pool, connprev = NULL; for ( conn = pool->conn.conn_list; conn != NULL; conn = conn->next ) { if (cb_debug_on()) { - slapi_log_error(SLAPI_LOG_PLUGIN, CB_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_PLUGIN, CB_PLUGIN_SUBSYSTEM, "cb_get_connection - conn 0x%p status %d refcount %lu\n", conn, conn->status, conn->refcount ); } @@ -288,7 +288,7 @@ cb_get_connection(cb_conn_pool * pool, if ( conn->status == CB_CONNSTATUS_OK && conn->refcount < maxconcurrency ) { if (cb_debug_on()) { - slapi_log_error(SLAPI_LOG_PLUGIN, CB_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_PLUGIN, CB_PLUGIN_SUBSYSTEM, "cb_get_connection - server found conn 0x%p to use)\n", conn ); } goto unlock_and_return; /* found one */ @@ -311,7 +311,7 @@ cb_get_connection(cb_conn_pool * pool, if (NULL == ld) { static int warned_init = 0; if (!warned_init) { - slapi_log_error(SLAPI_LOG_ERR, CB_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_ERR, CB_PLUGIN_SUBSYSTEM, "cb_get_connection - Can't contact server <%s> port <%d>.\n", hostname, port ); warned_init = 1; @@ -340,7 +340,7 @@ cb_get_connection(cb_conn_pool * pool, rc=LDAP_SUCCESS; if (cb_debug_on()) { - slapi_log_error(SLAPI_LOG_PLUGIN, CB_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_PLUGIN, CB_PLUGIN_SUBSYSTEM, "cb_get_connection - Bind to to server <%s> port <%d> as <%s>\n", hostname, port, binddn); } @@ -352,7 +352,7 @@ cb_get_connection(cb_conn_pool * pool, { static int warned_pw = 0; if (!warned_pw) { - slapi_log_error(SLAPI_LOG_ERR, CB_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_ERR, CB_PLUGIN_SUBSYSTEM, "cb_get_connection - Internal credentials decoding error; " "password storage schemes do not match or " "encrypted password is corrupted.\n"); @@ -374,7 +374,7 @@ cb_get_connection(cb_conn_pool * pool, if ( rc == LDAP_TIMEOUT ) { static int warned_bind_timeout = 0; if (!warned_bind_timeout) { - slapi_log_error(SLAPI_LOG_ERR, CB_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_ERR, CB_PLUGIN_SUBSYSTEM, "cb_get_connection - Can't bind to server <%s> port <%d>. (%s)\n", hostname, port, "time-out expired"); warned_bind_timeout = 1; @@ -388,7 +388,7 @@ cb_get_connection(cb_conn_pool * pool, prerr=PR_GetError(); static int warned_bind_err = 0; if (!warned_bind_err) { - slapi_log_error(SLAPI_LOG_ERR, CB_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_ERR, CB_PLUGIN_SUBSYSTEM, "cb_get_connection - Can't bind to server <%s> port <%d>. " "(LDAP error %d - %s; " SLAPI_COMPONENT_NAME_NSPR " error %d - %s)\n", @@ -412,7 +412,7 @@ cb_get_connection(cb_conn_pool * pool, if ( !(strcmp( serverctrls[ i ]->ldctl_oid, LDAP_CONTROL_PWEXPIRED)) ) { /* Bind is successful but password has expired */ - slapi_log_error(SLAPI_LOG_ERR, CB_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_ERR, CB_PLUGIN_SUBSYSTEM, "cb_get_connection - Successfully bound as %s to remote server %s:%d, " "but password has expired.\n", binddn, hostname, port); @@ -424,7 +424,7 @@ cb_get_connection(cb_conn_pool * pool, (serverctrls[ i ]->ldctl_value.bv_len > 0) ) { int password_expiring = atoi( serverctrls[ i ]->ldctl_value.bv_val ); - slapi_log_error(SLAPI_LOG_ERR, CB_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_ERR, CB_PLUGIN_SUBSYSTEM, "cb_get_connection - Successfully bound as %s to remote server %s:%d, " "but password is expiring in %d seconds.\n", binddn, hostname, port, password_expiring); @@ -437,12 +437,12 @@ cb_get_connection(cb_conn_pool * pool, /* the start_tls operation is usually performed in slapi_ldap_bind, but since we are not binding we still need to start_tls */ if (cb_debug_on()) { - slapi_log_error(SLAPI_LOG_PLUGIN, CB_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_PLUGIN, CB_PLUGIN_SUBSYSTEM, "cb_get_connection - doing start_tls on connection 0x%p\n", conn ); } if ((rc = ldap_start_tls_s(ld, NULL, NULL))) { PRErrorCode prerr = PR_GetError(); - slapi_log_error(SLAPI_LOG_ERR, CB_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_ERR, CB_PLUGIN_SUBSYSTEM, "cb_get_connection - Unable to do start_tls on connection to %s:%d " "LDAP error %d:%s NSS error %d:%s\n", hostname, port, rc, ldap_err2string(rc), prerr, @@ -479,7 +479,7 @@ cb_get_connection(cb_conn_pool * pool, ++pool->conn.conn_list_count; if (cb_debug_on()) { - slapi_log_error(SLAPI_LOG_PLUGIN, CB_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_PLUGIN, CB_PLUGIN_SUBSYSTEM, "cb_get_connection - added new conn 0x%p, " "conn count now %d\n", conn->ld, pool->conn.conn_list_count ); } @@ -487,14 +487,14 @@ cb_get_connection(cb_conn_pool * pool, } if (cb_debug_on()) { - slapi_log_error(SLAPI_LOG_PLUGIN, CB_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_PLUGIN, CB_PLUGIN_SUBSYSTEM, "cb_get_connection - waiting for conn to free up\n" ); } if (!secure) slapi_wait_condvar( pool->conn.conn_list_cv, NULL ); if (cb_debug_on()) { - slapi_log_error(SLAPI_LOG_PLUGIN, CB_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_PLUGIN, CB_PLUGIN_SUBSYSTEM, "cb_get_connection - awake again\n" ); } } @@ -505,7 +505,7 @@ unlock_and_return: *lld=conn->ld; *cc=conn; if (cb_debug_on()) { - slapi_log_error(SLAPI_LOG_PLUGIN, CB_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_PLUGIN, CB_PLUGIN_SUBSYSTEM, "cb_get_connection - ld=0x%p (concurrency now %lu)\n",*lld, conn->refcount ); } @@ -515,7 +515,7 @@ unlock_and_return: } if (cb_debug_on()) { - slapi_log_error(SLAPI_LOG_PLUGIN, CB_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_PLUGIN, CB_PLUGIN_SUBSYSTEM, "cb_get_connection - error %d\n", rc ); } } @@ -558,14 +558,14 @@ void cb_release_op_connection(cb_conn_pool* pool, LDAP *lld, int dispose) { } if ( conn == NULL ) { /* ld not found -- unexpected */ - slapi_log_error(SLAPI_LOG_PLUGIN, CB_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_PLUGIN, CB_PLUGIN_SUBSYSTEM, "cb_release_op_connection - ld=0x%p not found\n", lld ); } else { --conn->refcount; if (cb_debug_on()) { - slapi_log_error(SLAPI_LOG_PLUGIN, CB_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_PLUGIN, CB_PLUGIN_SUBSYSTEM, "cb_release_op_connection - release conn 0x%p status %d refcount after release %lu\n", conn, conn->status, conn->refcount ); } @@ -648,7 +648,7 @@ static void cb_check_for_stale_connections(cb_conn_pool * pool) { (( connlifetime > 0) && (curtime - conn->opentime > connlifetime))) { if ( conn->refcount == 0 ) { if (cb_debug_on()) { - slapi_log_error(SLAPI_LOG_PLUGIN, CB_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_PLUGIN, CB_PLUGIN_SUBSYSTEM, "cb_check_for_stale_connections - conn 0x%p idle and stale\n",conn); } --pool->conn.conn_list_count; @@ -669,7 +669,7 @@ static void cb_check_for_stale_connections(cb_conn_pool * pool) { conn->status = CB_CONNSTATUS_STALE; } if (cb_debug_on()) { - slapi_log_error(SLAPI_LOG_PLUGIN, CB_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_PLUGIN, CB_PLUGIN_SUBSYSTEM, "cb_check_for_stale_connections - conn 0x%p stale\n",conn); } } @@ -693,7 +693,7 @@ static void cb_check_for_stale_connections(cb_conn_pool * pool) { connprev->next=conn->next; if (cb_debug_on()) { - slapi_log_error(SLAPI_LOG_PLUGIN, CB_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_PLUGIN, CB_PLUGIN_SUBSYSTEM, "cb_check_for_stale_connections - conn 0x%p idle and stale\n",conn); } --pool->conn.conn_list_count; @@ -709,7 +709,7 @@ static void cb_check_for_stale_connections(cb_conn_pool * pool) { conn->status = CB_CONNSTATUS_STALE; } if (cb_debug_on()) { - slapi_log_error(SLAPI_LOG_PLUGIN, CB_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_PLUGIN, CB_PLUGIN_SUBSYSTEM, "cb_check_for_stale_connections - conn 0x%p stale\n",conn); } } @@ -907,7 +907,7 @@ void cb_update_failed_conn_cpt ( cb_backend_instance *cb ) { cb->monitor_availability.unavailableTimeLimit = now + CB_UNAVAILABLE_PERIOD ; slapi_unlock_mutex(cb->monitor_availability.lock_timeLimit); cb->monitor_availability.farmserver_state = FARMSERVER_UNAVAILABLE ; - slapi_log_error(SLAPI_LOG_PLUGIN, CB_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_PLUGIN, CB_PLUGIN_SUBSYSTEM, "cb_update_failed_conn_cpt - Farm server unavailable"); } @@ -920,7 +920,7 @@ void cb_reset_conn_cpt( cb_backend_instance *cb ) { cb->monitor_availability.cpt = 0 ; if (cb->monitor_availability.farmserver_state == FARMSERVER_UNAVAILABLE) { cb->monitor_availability.farmserver_state = FARMSERVER_AVAILABLE ; - slapi_log_error(SLAPI_LOG_PLUGIN, CB_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_PLUGIN, CB_PLUGIN_SUBSYSTEM, "cb_reset_conn_cpt - Farm server is back"); } slapi_unlock_mutex(cb->monitor_availability.cpt_lock); @@ -942,7 +942,7 @@ int cb_check_availability( cb_backend_instance *cb, Slapi_PBlock *pb ) { cb_send_ldap_result( pb, LDAP_OPERATIONS_ERROR, NULL, "FARM SERVER TEMPORARY UNAVAILABLE", 0, NULL) ; return FARMSERVER_UNAVAILABLE ; } - slapi_log_error(SLAPI_LOG_PLUGIN, CB_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_PLUGIN, CB_PLUGIN_SUBSYSTEM, "cb_check_availability - ping the farm server and check if it's still unavailable"); if (cb_ping_farm(cb, NULL, 0) != LDAP_SUCCESS) { /* farm still unavailable... Just change the timelimit */ slapi_lock_mutex(cb->monitor_availability.lock_timeLimit); @@ -950,7 +950,7 @@ int cb_check_availability( cb_backend_instance *cb, Slapi_PBlock *pb ) { cb->monitor_availability.unavailableTimeLimit = now + CB_UNAVAILABLE_PERIOD ; slapi_unlock_mutex(cb->monitor_availability.lock_timeLimit); cb_send_ldap_result( pb, LDAP_OPERATIONS_ERROR, NULL, "FARM SERVER TEMPORARY UNAVAILABLE", 0, NULL) ; - slapi_log_error(SLAPI_LOG_PLUGIN, CB_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_PLUGIN, CB_PLUGIN_SUBSYSTEM, "cb_check_availability - Farm server still unavailable"); return FARMSERVER_UNAVAILABLE ; } diff --git a/ldap/servers/plugins/chainingdb/cb_controls.c b/ldap/servers/plugins/chainingdb/cb_controls.c index dd0bf7c..747f34b 100644 --- a/ldap/servers/plugins/chainingdb/cb_controls.c +++ b/ldap/servers/plugins/chainingdb/cb_controls.c @@ -158,7 +158,7 @@ int cb_update_controls( Slapi_PBlock * pb, /* we have to force remote acl checking if the associated backend to this chaining backend is disabled - disabled == no acl check possible */ if (!cb->local_acl && !cb->associated_be_is_disabled) { - slapi_log_error(SLAPI_LOG_PLUGIN,CB_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_PLUGIN,CB_PLUGIN_SUBSYSTEM, "local aci check required to handle proxied auth control. Deny access.\n"); rc= LDAP_INSUFFICIENT_ACCESS; break; @@ -177,7 +177,7 @@ int cb_update_controls( Slapi_PBlock * pb, slapi_dn_ignore_case(requestorCopy); if (!strcmp( requestorCopy, rootdn )) { /* UTF8- aware */ - slapi_log_error(SLAPI_LOG_PLUGIN,CB_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_PLUGIN,CB_PLUGIN_SUBSYSTEM, "Use of user <%s> incompatible with proxied auth. control\n", rootdn); rc = LDAP_UNAVAILABLE_CRITICAL_EXTENSION; @@ -202,7 +202,7 @@ int cb_update_controls( Slapi_PBlock * pb, ber = ber_init(&(reqControls[cCount]->ldctl_value)); if (LBER_ERROR == ber_scanf(ber,"i",&hops)) { - slapi_log_error(SLAPI_LOG_PLUGIN,CB_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_PLUGIN,CB_PLUGIN_SUBSYSTEM, "Unable to get number of hops from the chaining control\n"); } ber_free(ber,1); @@ -255,7 +255,7 @@ int cb_update_controls( Slapi_PBlock * pb, if ( slapi_ldap_create_proxyauth_control(ld, proxyDN, isabandon?0:1, 0, &ctrls[dCount] )) { ldap_controls_free(ctrls); - slapi_log_error(SLAPI_LOG_PLUGIN, CB_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_PLUGIN, CB_PLUGIN_SUBSYSTEM, "LDAP_CONTROL_PROXYAUTH control encoding failed.\n"); return LDAP_OPERATIONS_ERROR; } diff --git a/ldap/servers/plugins/chainingdb/cb_delete.c b/ldap/servers/plugins/chainingdb/cb_delete.c index 6c4adb0..7761b94 100644 --- a/ldap/servers/plugins/chainingdb/cb_delete.c +++ b/ldap/servers/plugins/chainingdb/cb_delete.c @@ -86,7 +86,7 @@ chaining_back_delete ( Slapi_PBlock *pb ) if (LDAP_SUCCESS != rc) { static int warned_get_conn = 0; if (!warned_get_conn) { - slapi_log_error(SLAPI_LOG_ERR, CB_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_ERR, CB_PLUGIN_SUBSYSTEM, "chaining_back_delete - connection failed (%d) %s\n", rc, ldap_err2string(rc)); warned_get_conn = 1; @@ -123,7 +123,7 @@ chaining_back_delete ( Slapi_PBlock *pb ) * Call the backend preoperation plugins */ if((rc = slapi_plugin_call_preop_be_plugins(pb, SLAPI_PLUGIN_DEL_OP))){ - slapi_log_error(SLAPI_LOG_ERR, CB_PLUGIN_SUBSYSTEM, "chaining_back_delete - delete (%s): pre betxn failed, error (%d)\n",dn,rc); + slapi_log_err(SLAPI_LOG_ERR, CB_PLUGIN_SUBSYSTEM, "chaining_back_delete - delete (%s): pre betxn failed, error (%d)\n",dn,rc); cb_release_op_connection(cb->pool,ld,0); ldap_controls_free(ctrls); return -1; @@ -176,7 +176,7 @@ chaining_back_delete ( Slapi_PBlock *pb ) if ( parse_rc != LDAP_SUCCESS ) { static int warned_parse_rc = 0; if (!warned_parse_rc) { - slapi_log_error(SLAPI_LOG_ERR, CB_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_ERR, CB_PLUGIN_SUBSYSTEM, "chaining_back_delete - %s%s%s\n", matched_msg?matched_msg:"", (matched_msg&&(*matched_msg!='\0'))?": ":"", @@ -197,7 +197,7 @@ chaining_back_delete ( Slapi_PBlock *pb ) struct berval ** refs = referrals2berval(referrals); static int warned_rc = 0; if (!warned_rc && error_msg) { - slapi_log_error(SLAPI_LOG_ERR, CB_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_ERR, CB_PLUGIN_SUBSYSTEM, "chaining_back_delete - %s%s%s\n", matched_msg?matched_msg:"", (matched_msg&&(*matched_msg!='\0'))?": ":"", @@ -219,7 +219,7 @@ chaining_back_delete ( Slapi_PBlock *pb ) /* Call the backend postoperation plugins */ if((rc = slapi_plugin_call_postop_be_plugins(pb, SLAPI_PLUGIN_DEL_OP))){ - slapi_log_error(SLAPI_LOG_ERR, CB_PLUGIN_SUBSYSTEM, "chaining_back_delete - delete (%s): post betxn failed, error (%d)\n",dn,rc); + slapi_log_err(SLAPI_LOG_ERR, CB_PLUGIN_SUBSYSTEM, "chaining_back_delete - delete (%s): post betxn failed, error (%d)\n",dn,rc); } /* Add control response sent by the farm server */ diff --git a/ldap/servers/plugins/chainingdb/cb_init.c b/ldap/servers/plugins/chainingdb/cb_init.c index f877bf2..b7b7df3 100644 --- a/ldap/servers/plugins/chainingdb/cb_init.c +++ b/ldap/servers/plugins/chainingdb/cb_init.c @@ -117,7 +117,7 @@ chaining_back_init( Slapi_PBlock *pb ) */ if ( rc != 0 ) { - slapi_log_error(SLAPI_LOG_ERR, CB_PLUGIN_SUBSYSTEM, "chaining_back_init - Failed\n"); + slapi_log_err(SLAPI_LOG_ERR, CB_PLUGIN_SUBSYSTEM, "chaining_back_init - Failed\n"); return( -1 ); } diff --git a/ldap/servers/plugins/chainingdb/cb_instance.c b/ldap/servers/plugins/chainingdb/cb_instance.c index 48e7601..1703501 100644 --- a/ldap/servers/plugins/chainingdb/cb_instance.c +++ b/ldap/servers/plugins/chainingdb/cb_instance.c @@ -502,7 +502,7 @@ cb_parse_instance_config_entry(cb_backend * cb, Slapi_Entry * e) attrValue = slapi_value_get_berval(sval); instname = attrValue->bv_val; } else { - slapi_log_error(SLAPI_LOG_PLUGIN, CB_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_PLUGIN, CB_PLUGIN_SUBSYSTEM, "cb_parse_instance_config_entry - Malformed backend instance (<%s> missing)>\n", CB_CONFIG_INSTNAME); return -1; } @@ -609,7 +609,7 @@ cb_instance_config_initialize(cb_backend_instance * inst, Slapi_Entry * e , int if (cb_instance_config_set((void *) inst, attr_name, cb_the_instance_config, bval, err_buf, phase, apply ) != LDAP_SUCCESS) { - slapi_log_error(SLAPI_LOG_ERR, CB_PLUGIN_SUBSYSTEM,"cb_instance_config_initialize - " + slapi_log_err(SLAPI_LOG_ERR, CB_PLUGIN_SUBSYSTEM,"cb_instance_config_initialize - " "Error with config attribute %s : %s\n", attr_name, err_buf); rc = -1; @@ -628,7 +628,7 @@ cb_instance_config_initialize(cb_backend_instance * inst, Slapi_Entry * e , int if (LDAP_SUCCESS == rc) { if (!urlfound) { - slapi_log_error(SLAPI_LOG_ERR, CB_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_ERR, CB_PLUGIN_SUBSYSTEM, "cb_instance_config_initialize - " "Malformed backend instance entry. Mandatory attr <%s> missing\n",CB_CONFIG_HOSTURL); rc = -1; @@ -652,7 +652,7 @@ cb_instance_config_initialize(cb_backend_instance * inst, Slapi_Entry * e , int if (inst->impersonate && inst->pool && inst->pool->binddn && !strcmp(inst->pool->binddn,rootdn)) { /* UTF8 aware */ - slapi_log_error(SLAPI_LOG_ERR, CB_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_ERR, CB_PLUGIN_SUBSYSTEM, "cb_instance_config_initialize - " "Error with config attribute %s (%s: forbidden value)\n", CB_CONFIG_BINDUSER, rootdn); rc= -1; @@ -1566,7 +1566,7 @@ void cb_instance_config_get(void *arg, cb_instance_config_info *config, char *bu } break; default: - slapi_log_error(SLAPI_LOG_PLUGIN, CB_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_PLUGIN, CB_PLUGIN_SUBSYSTEM, "cb_instance_config_get - Invalid attribute syntax.\n"); } @@ -1758,7 +1758,7 @@ int cb_instance_add_config_check_callback(Slapi_PBlock *pb, Slapi_Entry* e, Slap instname=attrValue->bv_val; } if ( instname == NULL ) { - slapi_log_error(SLAPI_LOG_PLUGIN, CB_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_PLUGIN, CB_PLUGIN_SUBSYSTEM, "cb_instance_add_config_check_callback - Malformed backend instance (<%s> missing)>\n", CB_CONFIG_INSTNAME); *returncode = LDAP_LOCAL_ERROR; return SLAPI_DSE_CALLBACK_ERROR; @@ -1771,7 +1771,7 @@ int cb_instance_add_config_check_callback(Slapi_PBlock *pb, Slapi_Entry* e, Slap /* the default instance config and the specific entry specified */ if ((rc=cb_build_backend_instance_config(inst,e,0)) != LDAP_SUCCESS) { - slapi_log_error(SLAPI_LOG_ERR, CB_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_ERR, CB_PLUGIN_SUBSYSTEM, "cb_instance_add_config_check_callback - Can't instantiate chaining backend instance %s.\n",inst->inst_name); *returncode=rc; cb_instance_free(inst); @@ -1814,7 +1814,7 @@ int cb_instance_add_config_callback(Slapi_PBlock *pb, Slapi_Entry* e, Slapi_Entr instname=attrValue->bv_val; } if ( instname == NULL ) { - slapi_log_error(SLAPI_LOG_PLUGIN, CB_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_PLUGIN, CB_PLUGIN_SUBSYSTEM, "cb_instance_add_config_callback - Malformed backend instance (<%s> missing)>\n", CB_CONFIG_INSTNAME); *returncode = LDAP_LOCAL_ERROR; return SLAPI_DSE_CALLBACK_ERROR; @@ -1827,7 +1827,7 @@ int cb_instance_add_config_callback(Slapi_PBlock *pb, Slapi_Entry* e, Slapi_Entr /* the default instance config and the specific entry specified */ if ((rc=cb_build_backend_instance_config(inst,e,0)) != LDAP_SUCCESS) { - slapi_log_error(SLAPI_LOG_ERR, CB_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_ERR, CB_PLUGIN_SUBSYSTEM, "cb_instance_add_config_callback - Can't instantiate chaining backend instance %s.\n",inst->inst_name); *returncode=rc; cb_instance_free(inst); @@ -1942,7 +1942,7 @@ int cb_create_default_backend_instance_config(cb_backend * cb) { slapi_add_internal_pb(pb); slapi_pblock_get(pb, SLAPI_PLUGIN_INTOP_RESULT, &rc); if ( LDAP_SUCCESS != rc ) { - slapi_log_error(SLAPI_LOG_PLUGIN, CB_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_PLUGIN, CB_PLUGIN_SUBSYSTEM, "cb_create_default_backend_instance_config - Add %s failed (%s)\n",defaultDn,ldap_err2string(rc)); } diff --git a/ldap/servers/plugins/chainingdb/cb_modify.c b/ldap/servers/plugins/chainingdb/cb_modify.c index c253937..411980d 100644 --- a/ldap/servers/plugins/chainingdb/cb_modify.c +++ b/ldap/servers/plugins/chainingdb/cb_modify.c @@ -64,7 +64,7 @@ chaining_back_modify ( Slapi_PBlock *pb ) dn = slapi_sdn_get_dn(sdn); if (cb_debug_on()) { - slapi_log_error(SLAPI_LOG_PLUGIN, CB_PLUGIN_SUBSYSTEM,"modify: target:<%s>\n",dn); + slapi_log_err(SLAPI_LOG_PLUGIN, CB_PLUGIN_SUBSYSTEM,"modify: target:<%s>\n",dn); } ctrls = serverctrls = NULL; @@ -92,7 +92,7 @@ chaining_back_modify ( Slapi_PBlock *pb ) if (LDAP_SUCCESS != rc) { static int warned_get_conn = 0; if (!warned_get_conn) { - slapi_log_error(SLAPI_LOG_ERR, CB_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_ERR, CB_PLUGIN_SUBSYSTEM, "chaining_back_modify - cb_get_connection failed (%d) %s\n", rc, ldap_err2string(rc)); warned_get_conn = 1; @@ -131,7 +131,7 @@ chaining_back_modify ( Slapi_PBlock *pb ) * Call the backend preoperation plugins */ if((rc = slapi_plugin_call_preop_be_plugins(pb, SLAPI_PLUGIN_MOD_OP))){ - slapi_log_error(SLAPI_LOG_ERR, CB_PLUGIN_SUBSYSTEM, "chaining_back_modify - modify (%s): pre betxn failed, error (%d)\n",dn,rc); + slapi_log_err(SLAPI_LOG_ERR, CB_PLUGIN_SUBSYSTEM, "chaining_back_modify - modify (%s): pre betxn failed, error (%d)\n",dn,rc); cb_release_op_connection(cb->pool,ld,0); ldap_controls_free(ctrls); return -1; @@ -185,7 +185,7 @@ chaining_back_modify ( Slapi_PBlock *pb ) if ( parse_rc != LDAP_SUCCESS ) { static int warned_parse_rc = 0; if (!warned_parse_rc) { - slapi_log_error(SLAPI_LOG_ERR, CB_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_ERR, CB_PLUGIN_SUBSYSTEM, "chaining_back_modify - %s%s%s\n", matched_msg?matched_msg:"", (matched_msg&&(*matched_msg!='\0'))?": ":"", @@ -206,7 +206,7 @@ chaining_back_modify ( Slapi_PBlock *pb ) struct berval ** refs = referrals2berval(referrals); static int warned_rc = 0; if (!warned_rc && error_msg) { - slapi_log_error(SLAPI_LOG_ERR, CB_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_ERR, CB_PLUGIN_SUBSYSTEM, "chaining_back_modify - %s%s%s\n", matched_msg?matched_msg:"", (matched_msg&&(*matched_msg!='\0'))?": ":"", @@ -228,7 +228,7 @@ chaining_back_modify ( Slapi_PBlock *pb ) /* Call the backend postoperation plugins */ if((rc = slapi_plugin_call_postop_be_plugins(pb, SLAPI_PLUGIN_MOD_OP))){ - slapi_log_error(SLAPI_LOG_ERR, CB_PLUGIN_SUBSYSTEM, "chaining_back_modify - modify (%s): post betxn failed, error (%d)\n",dn,rc); + slapi_log_err(SLAPI_LOG_ERR, CB_PLUGIN_SUBSYSTEM, "chaining_back_modify - modify (%s): post betxn failed, error (%d)\n",dn,rc); } /* Add control response sent by the farm server */ diff --git a/ldap/servers/plugins/chainingdb/cb_modrdn.c b/ldap/servers/plugins/chainingdb/cb_modrdn.c index 1e4acfd..00c598c 100644 --- a/ldap/servers/plugins/chainingdb/cb_modrdn.c +++ b/ldap/servers/plugins/chainingdb/cb_modrdn.c @@ -97,7 +97,7 @@ chaining_back_modrdn ( Slapi_PBlock *pb ) if (LDAP_SUCCESS != rc) { static int warned_get_conn = 0; if (!warned_get_conn) { - slapi_log_error(SLAPI_LOG_ERR, CB_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_ERR, CB_PLUGIN_SUBSYSTEM, "chaining_back_modrdn - cb_get_connection failed (%d) %s\n", rc, ldap_err2string(rc)); warned_get_conn = 1; @@ -135,7 +135,7 @@ chaining_back_modrdn ( Slapi_PBlock *pb ) * Call the backend preoperation plugins */ if((rc = slapi_plugin_call_preop_be_plugins(pb, SLAPI_PLUGIN_MODRDN_OP))){ - slapi_log_error(SLAPI_LOG_ERR, CB_PLUGIN_SUBSYSTEM, "chaining_back_modrdn - modrdn (%s): pre betxn failed, error (%d)\n",ndn,rc); + slapi_log_err(SLAPI_LOG_ERR, CB_PLUGIN_SUBSYSTEM, "chaining_back_modrdn - modrdn (%s): pre betxn failed, error (%d)\n",ndn,rc); cb_release_op_connection(cb->pool,ld,0); ldap_controls_free(ctrls); return -1; @@ -193,7 +193,7 @@ chaining_back_modrdn ( Slapi_PBlock *pb ) if ( parse_rc != LDAP_SUCCESS ) { static int warned_parse_rc = 0; if (!warned_parse_rc) { - slapi_log_error(SLAPI_LOG_ERR, CB_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_ERR, CB_PLUGIN_SUBSYSTEM, "chaining_back_modrdn - %s%s%s\n", matched_msg?matched_msg:"", (matched_msg&&(*matched_msg!='\0'))?": ":"", @@ -214,7 +214,7 @@ chaining_back_modrdn ( Slapi_PBlock *pb ) struct berval ** refs = referrals2berval(referrals); static int warned_rc = 0; if (!warned_rc && error_msg) { - slapi_log_error(SLAPI_LOG_ERR, CB_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_ERR, CB_PLUGIN_SUBSYSTEM, "chaining_back_modrdn - %s%s%s\n", matched_msg?matched_msg:"", (matched_msg&&(*matched_msg!='\0'))?": ":"", @@ -236,7 +236,7 @@ chaining_back_modrdn ( Slapi_PBlock *pb ) /* Call the backend postoperation plugins */ if((rc = slapi_plugin_call_postop_be_plugins(pb, SLAPI_PLUGIN_MODRDN_OP))){ - slapi_log_error(SLAPI_LOG_ERR, CB_PLUGIN_SUBSYSTEM, "chaining_back_modrdn - modrdn (%s): post betxn failed, error (%d)\n",ndn,rc); + slapi_log_err(SLAPI_LOG_ERR, CB_PLUGIN_SUBSYSTEM, "chaining_back_modrdn - modrdn (%s): post betxn failed, error (%d)\n",ndn,rc); } /* Add control response sent by the farm server */ diff --git a/ldap/servers/plugins/chainingdb/cb_monitor.c b/ldap/servers/plugins/chainingdb/cb_monitor.c index 95fa5aa..dbe67b3 100644 --- a/ldap/servers/plugins/chainingdb/cb_monitor.c +++ b/ldap/servers/plugins/chainingdb/cb_monitor.c @@ -212,7 +212,7 @@ cb_update_monitor_info(Slapi_PBlock * pb, cb_backend_instance * inst,int op) inst->monitor.searchsubtreecount++; break; default: - slapi_log_error(SLAPI_LOG_PLUGIN, CB_PLUGIN_SUBSYSTEM,"cb_update_monitor_info: invalid op type <%d>\n",op); + slapi_log_err(SLAPI_LOG_PLUGIN, CB_PLUGIN_SUBSYSTEM,"cb_update_monitor_info: invalid op type <%d>\n",op); } slapi_unlock_mutex(inst->monitor.mutex); } diff --git a/ldap/servers/plugins/chainingdb/cb_schema.c b/ldap/servers/plugins/chainingdb/cb_schema.c index 7fb017f..7b130fa 100644 --- a/ldap/servers/plugins/chainingdb/cb_schema.c +++ b/ldap/servers/plugins/chainingdb/cb_schema.c @@ -37,7 +37,7 @@ void cb_eliminate_illegal_attributes(cb_backend_instance * inst, Slapi_Entry * e slapi_attr_get_type(attr,&aType); if (aType && slapi_attr_types_equivalent(inst->illegal_attributes[j],aType)) { tobefreed=aType; - slapi_log_error(SLAPI_LOG_PLUGIN, CB_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_PLUGIN, CB_PLUGIN_SUBSYSTEM, "attribute <%s> not forwarded.\n",aType); } rc = slapi_entry_next_attr(e, attr, &attr); diff --git a/ldap/servers/plugins/chainingdb/cb_search.c b/ldap/servers/plugins/chainingdb/cb_search.c index 2143fd7..1059feb 100644 --- a/ldap/servers/plugins/chainingdb/cb_search.c +++ b/ldap/servers/plugins/chainingdb/cb_search.c @@ -64,7 +64,7 @@ chainingdb_build_candidate_list ( Slapi_PBlock *pb ) if ( LDAP_SUCCESS != (parse_rc=cb_forward_operation(pb) )) { /* Don't return errors */ if (cb_debug_on()) { - slapi_log_error(SLAPI_LOG_PLUGIN, CB_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_PLUGIN, CB_PLUGIN_SUBSYSTEM, "chainingdb_build_candidate_list - local search: base:<%s> scope:<%s> filter:<%s>\n",target, scope==LDAP_SCOPE_SUBTREE?"SUBTREE":scope==LDAP_SCOPE_ONELEVEL ? "ONE-LEVEL" : "BASE" , filter); } @@ -85,7 +85,7 @@ chainingdb_build_candidate_list ( Slapi_PBlock *pb ) } if (cb_debug_on()) { - slapi_log_error(SLAPI_LOG_PLUGIN, CB_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_PLUGIN, CB_PLUGIN_SUBSYSTEM, "chainingdb_build_candidate_list - chained search: base:<%s> scope:<%s> filter:<%s>\n",target, scope==LDAP_SCOPE_SUBTREE ? "SUBTREE": scope==LDAP_SCOPE_ONELEVEL ? "ONE-LEVEL" : "BASE", filter); @@ -183,7 +183,7 @@ chainingdb_build_candidate_list ( Slapi_PBlock *pb ) if (LDAP_SUCCESS != rc) { static int warned_get_conn = 0; if (!warned_get_conn) { - slapi_log_error(SLAPI_LOG_ERR, CB_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_ERR, CB_PLUGIN_SUBSYSTEM, "chainingdb_build_candidate_list - cb_get_connection failed (%d) %s\n", rc, ldap_err2string(rc)); warned_get_conn = 1; @@ -284,7 +284,7 @@ chainingdb_build_candidate_list ( Slapi_PBlock *pb ) /* Local timeout management */ if (timelimit != -1) { if (current_time() > endbefore) { - slapi_log_error(SLAPI_LOG_PLUGIN, CB_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_PLUGIN, CB_PLUGIN_SUBSYSTEM, "chainingdb_build_candidate_list - Local timeout expiration\n"); cb_send_ldap_result(pb,LDAP_TIMELIMIT_EXCEEDED, NULL,NULL, 0, NULL); @@ -329,7 +329,7 @@ chainingdb_build_candidate_list ( Slapi_PBlock *pb ) if ( parse_rc != LDAP_SUCCESS ) { static int warned_parse_rc = 0; if (!warned_parse_rc && error_msg) { - slapi_log_error(SLAPI_LOG_ERR, CB_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_ERR, CB_PLUGIN_SUBSYSTEM, "%s%s%s\n", matched_msg?matched_msg:"", (matched_msg&&(*matched_msg!='\0'))?": ":"", @@ -342,7 +342,7 @@ chainingdb_build_candidate_list ( Slapi_PBlock *pb ) static int warned_rc = 0; if (!warned_rc) { slapi_ldap_get_lderrno( ctx->ld, &matched_msg, &error_msg ); - slapi_log_error(SLAPI_LOG_ERR, CB_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_ERR, CB_PLUGIN_SUBSYSTEM, "%s%s%s\n", matched_msg?matched_msg:"", (matched_msg&&(*matched_msg!='\0'))?": ":"", @@ -426,7 +426,7 @@ chainingdb_next_search_entry ( Slapi_PBlock *pb ) /* End of local search */ slapi_pblock_set( pb, SLAPI_SEARCH_RESULT_SET,NULL); slapi_pblock_set( pb, SLAPI_SEARCH_RESULT_ENTRY,NULL); - slapi_log_error(SLAPI_LOG_PLUGIN, CB_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_PLUGIN, CB_PLUGIN_SUBSYSTEM, "chainingdb_next_search_entry - Unexpected NULL ctx in chainingdb_next_search_entry\n"); return 0; } @@ -584,7 +584,7 @@ chainingdb_next_search_entry ( Slapi_PBlock *pb ) /* The server sent one of the entries found by the search */ if ((entry = cb_LDAPMessage2Entry(ctx->ld,res,attrsonly)) == NULL) { - slapi_log_error(SLAPI_LOG_PLUGIN, CB_PLUGIN_SUBSYSTEM,"chainingdb_next_search_entry - Invalid entry received.\n"); + slapi_log_err(SLAPI_LOG_PLUGIN, CB_PLUGIN_SUBSYSTEM,"chainingdb_next_search_entry - Invalid entry received.\n"); slapi_pblock_set( pb, SLAPI_SEARCH_RESULT_SET,NULL); slapi_pblock_set( pb, SLAPI_SEARCH_RESULT_ENTRY,NULL); @@ -676,7 +676,7 @@ chainingdb_next_search_entry ( Slapi_PBlock *pb ) if ( parse_rc != LDAP_SUCCESS ) { static int warned_parse_rc = 0; if (!warned_parse_rc) { - slapi_log_error(SLAPI_LOG_ERR, CB_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_ERR, CB_PLUGIN_SUBSYSTEM, "%s%s%s\n", matched_msg?matched_msg:"", (matched_msg&&(*matched_msg!='\0'))?": ":"", @@ -691,7 +691,7 @@ chainingdb_next_search_entry ( Slapi_PBlock *pb ) static int warned_rc = 0; slapi_ldap_get_lderrno( ctx->ld, &matched_msg, &error_msg ); if (!warned_rc) { - slapi_log_error(SLAPI_LOG_ERR, CB_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_ERR, CB_PLUGIN_SUBSYSTEM, "%s%s%s\n", matched_msg?matched_msg:"", (matched_msg&&(*matched_msg!='\0'))?": ":"", @@ -722,7 +722,7 @@ chainingdb_next_search_entry ( Slapi_PBlock *pb ) return retcode; default: - slapi_log_error(SLAPI_LOG_PLUGIN, CB_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_PLUGIN, CB_PLUGIN_SUBSYSTEM, "chainingdb_next_search_entry - default case.\n"); } @@ -734,7 +734,7 @@ chainingdb_next_search_entry ( Slapi_PBlock *pb ) int chaining_back_entry_release ( Slapi_PBlock *pb ) { - slapi_log_error(SLAPI_LOG_PLUGIN, CB_PLUGIN_SUBSYSTEM, "chaining_back_entry_release\n"); + slapi_log_err(SLAPI_LOG_PLUGIN, CB_PLUGIN_SUBSYSTEM, "chaining_back_entry_release\n"); return 0; } @@ -743,7 +743,7 @@ chaining_back_search_results_release ( void **sr ) { cb_searchContext *ctx = (cb_searchContext *)(*sr); - slapi_log_error(SLAPI_LOG_PLUGIN, CB_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_PLUGIN, CB_PLUGIN_SUBSYSTEM, "chaining_back_search_results_release\n"); if (ctx->readahead != ctx->tobefreed) { slapi_entry_free(ctx->readahead); diff --git a/ldap/servers/plugins/chainingdb/cb_utils.c b/ldap/servers/plugins/chainingdb/cb_utils.c index 3635356..6d01c62 100644 --- a/ldap/servers/plugins/chainingdb/cb_utils.c +++ b/ldap/servers/plugins/chainingdb/cb_utils.c @@ -111,7 +111,7 @@ cb_forward_operation(Slapi_PBlock * pb) slapi_pblock_get (pb, SLAPI_OPERATION, &op); if (NULL == op) { - slapi_log_error(SLAPI_LOG_PLUGIN, CB_PLUGIN_SUBSYSTEM, "cb_forward_operation - No operation is set.\n"); + slapi_log_err(SLAPI_LOG_PLUGIN, CB_PLUGIN_SUBSYSTEM, "cb_forward_operation - No operation is set.\n"); return LDAP_UNWILLING_TO_PERFORM; } @@ -133,7 +133,7 @@ cb_forward_operation(Slapi_PBlock * pb) BerElement *ber = NULL; if ((ber = ber_init(ctl_value)) == NULL) { - slapi_log_error(SLAPI_LOG_PLUGIN, CB_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_PLUGIN, CB_PLUGIN_SUBSYSTEM, "cb_forward_operation - ber_init: Memory allocation failed"); if (iscritical) return LDAP_UNAVAILABLE_CRITICAL_EXTENSION; /* RFC 4511 4.1.11 */ @@ -142,7 +142,7 @@ cb_forward_operation(Slapi_PBlock * pb) } rc = ber_scanf(ber,"i",&hops); if (LBER_ERROR == rc) { - slapi_log_error(SLAPI_LOG_PLUGIN, CB_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_PLUGIN, CB_PLUGIN_SUBSYSTEM, "cb_forward_operation - Loop detection control badly encoded."); ber_free(ber,1); if (iscritical) @@ -152,7 +152,7 @@ cb_forward_operation(Slapi_PBlock * pb) } if (hops <= 0) { - slapi_log_error(SLAPI_LOG_PLUGIN, CB_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_PLUGIN, CB_PLUGIN_SUBSYSTEM, "cb_forward_operation - Max hop count exceeded. Loop detected.\n"); ber_free(ber,1); if (iscritical) @@ -170,14 +170,14 @@ cb_forward_operation(Slapi_PBlock * pb) slapi_pblock_get (pb, SLAPI_PLUGIN_IDENTITY, &cid); if ( cid == NULL ) { /* programming error in the front-end */ - slapi_log_error(SLAPI_LOG_ERR, CB_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_ERR, CB_PLUGIN_SUBSYSTEM, "cb_forward_operation - NULL component identity in an internal operation."); return LDAP_UNWILLING_TO_PERFORM; } pname=cid->sci_component_name; if (cb_debug_on()) { - slapi_log_error(SLAPI_LOG_PLUGIN, CB_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_PLUGIN, CB_PLUGIN_SUBSYSTEM, "cb_forward_operation - internal op received from %s component \n",pname ? pname : "NULL"); } @@ -352,7 +352,7 @@ cb_be_state_change (void *handle, char *be_name, int old_be_state, int new_be_st if (cbinst) { /* the backend is disabled if the state is not ON */ cbinst->associated_be_is_disabled = (new_be_state != SLAPI_BE_STATE_ON); - slapi_log_error(SLAPI_LOG_PLUGIN, CB_PLUGIN_SUBSYSTEM, "cb_be_state_change - Set the " + slapi_log_err(SLAPI_LOG_PLUGIN, CB_PLUGIN_SUBSYSTEM, "cb_be_state_change - Set the " "state of chainbe for %s to %d\n", slapi_sdn_get_dn(cbsuffix), (new_be_state != SLAPI_BE_STATE_ON)); } diff --git a/ldap/servers/plugins/collation/collate.c b/ldap/servers/plugins/collation/collate.c index 41ac74b..0e1d528 100644 --- a/ldap/servers/plugins/collation/collate.c +++ b/ldap/servers/plugins/collation/collate.c @@ -60,8 +60,8 @@ collation_config (size_t cargc, char** cargv, /* ignore - not needed anymore with ICU - was used to get path for NLS_Initialize */ } else if (!strcasecmp (cargv[0], "collation")) { if ( cargc < 7 ) { - LDAPDebug(LDAP_DEBUG_ERR, "collation_config - " - "%s: line %lu ignored: only %lu arguments (expected " + slapi_log_err(SLAPI_LOG_ERR, COLLATE_PLUGIN_SUBSYSTEM, + "collation_config - %s: line %lu ignored: only %lu arguments (expected " "collation language country variant strength decomposition oid ...)\n", fname, (unsigned long)lineno, (unsigned long)cargc ); } else { @@ -76,8 +76,8 @@ collation_config (size_t cargc, char** cargv, case 3: profile->strength = UCOL_TERTIARY; break; case 4: profile->strength = UCOL_IDENTICAL; break; default: profile->strength = UCOL_SECONDARY; - LDAPDebug(LDAP_DEBUG_ERR, "collation_config - " - "%s: line %lu: strength \"%s\" not supported (will use 2)\n", + slapi_log_err(SLAPI_LOG_ERR, COLLATE_PLUGIN_SUBSYSTEM, + "collation_config - %s: line %lu: strength \"%s\" not supported (will use 2)\n", fname, (unsigned long)lineno, cargv[4]); break; } @@ -86,8 +86,8 @@ collation_config (size_t cargc, char** cargv, case 2: profile->decomposition = UCOL_DEFAULT; /* no break here? fall through? wtf? */ case 3: profile->decomposition = UCOL_ON; break; default: profile->decomposition = UCOL_DEFAULT; - LDAPDebug(LDAP_DEBUG_ERR, "collation_config - " - "%s: line %lu: decomposition \"%s\" not supported (will use 2)\n", + slapi_log_err(SLAPI_LOG_ERR, COLLATE_PLUGIN_SUBSYSTEM, + "collation_config - %s: line %lu: decomposition \"%s\" not supported (will use 2)\n", fname, (unsigned long)lineno, cargv[5]); break; } @@ -326,8 +326,9 @@ collation_index (indexer_t* ix, struct berval** bvec, struct berval** prefixes) } memcpy(bk->bv_val + prefixLen, key, realLen); bk->bv_val[bk->bv_len] = '\0'; - LDAPDebug(LDAP_DEBUG_FILTER, "collation_index(%.*s) %lu bytes\n", - bk->bv_len, bk->bv_val, (unsigned long)bk->bv_len); + slapi_log_err(SLAPI_LOG_FILTER, COLLATE_PLUGIN_SUBSYSTEM, + "collation_index - %s - %lu bytes\n", + (char *)bk->bv_val, (unsigned long)bk->bv_len); keys = (struct berval**) slapi_ch_realloc ((void*)keys, sizeof(struct berval*) * (keyn + 2)); keys[keyn++] = bk; @@ -425,15 +426,15 @@ collation_indexer_create (const char* oid) ix = (indexer_t*) slapi_ch_calloc (1, sizeof (indexer_t)); ucol_setAttribute (coll, UCOL_STRENGTH, profile->strength, &err); if (U_FAILURE(err)) { - LDAPDebug(LDAP_DEBUG_ERR, "collation_indexer_create - " + slapi_log_err(SLAPI_LOG_ERR, COLLATE_PLUGIN_SUBSYSTEM, "collation_indexer_create - " "Could not set the collator strength for oid %s to %d: err %d\n", oid, profile->strength, err); } ucol_setAttribute (coll, UCOL_DECOMPOSITION_MODE, profile->decomposition, &err); if (U_FAILURE(err)) { - LDAPDebug(LDAP_DEBUG_ERR, "collation_indexer_create - Could not " - "set the collator decomposition mode for oid %s to %d: err %d\n", - oid, profile->decomposition, err); + slapi_log_err(SLAPI_LOG_ERR, COLLATE_PLUGIN_SUBSYSTEM, "collation_indexer_create - " + "Could not set the collator decomposition mode for oid %s to %d: err %d\n", + oid, profile->decomposition, err); } etc->collator = coll; for (id = collation_id; *id; ++id) { @@ -442,7 +443,8 @@ collation_indexer_create (const char* oid) } } if (!*id) { - LDAPDebug(LDAP_DEBUG_ERR, "collation_indexer_create - id not found\n", 0, 0, 0); + slapi_log_err(SLAPI_LOG_ERR, COLLATE_PLUGIN_SUBSYSTEM, + "collation_indexer_create - id not found\n"); goto error; } @@ -454,14 +456,15 @@ collation_indexer_create (const char* oid) /* free (etc); */ /* free (ix); */ } else if (err == U_USING_DEFAULT_WARNING) { - LDAPDebug(LDAP_DEBUG_FILTER, "collation_indexer_create - could not " - "create an indexer for OID %s for locale %s and could not " - "use default locale\n", - oid, (locale ? locale : "(default)"), NULL); + slapi_log_err(SLAPI_LOG_FILTER, COLLATE_PLUGIN_SUBSYSTEM, + "collation_indexer_create - Could not " + "create an indexer for OID %s for locale %s and could not " + "use default locale\n", oid, (locale ? locale : "(default)")); } else { /* error */ - LDAPDebug(LDAP_DEBUG_FILTER, "collation_indexer_create - could not " - "create an indexer for OID %s for locale %s: err = %d\n", - oid, (locale ? locale : "(default)"), err); + slapi_log_err(SLAPI_LOG_FILTER, COLLATE_PLUGIN_SUBSYSTEM, + "collation_indexer_create - Could not " + "create an indexer for OID %s for locale %s: err = %d\n", + oid, (locale ? locale : "(default)"), err); } if (coll) { ucol_close (coll); diff --git a/ldap/servers/plugins/collation/collate.h b/ldap/servers/plugins/collation/collate.h index 41974bf..2438b89 100644 --- a/ldap/servers/plugins/collation/collate.h +++ b/ldap/servers/plugins/collation/collate.h @@ -40,4 +40,6 @@ collation_config (size_t argc, char** argv, const char* fname, size_t lineno); extern indexer_t* collation_indexer_create (const char* oid); +#define COLLATE_PLUGIN_SUBSYSTEM "collation-plugin" + #endif diff --git a/ldap/servers/plugins/collation/config.c b/ldap/servers/plugins/collation/config.c index 2cc2944..5ff67c0 100644 --- a/ldap/servers/plugins/collation/config.c +++ b/ldap/servers/plugins/collation/config.c @@ -83,8 +83,8 @@ fp_parse_line( for ( token = strtok_quote( line, " \t" ); token != NULL; token = strtok_quote( NULL, " \t" ) ) { if ( *argcp == MAXARGS ) { - LDAPDebug(LDAP_DEBUG_ERR, "fp_parse_line - Too many tokens (max %d)\n", - MAXARGS, 0, 0 ); + slapi_log_err(SLAPI_LOG_ERR, COLLATE_PLUGIN_SUBSYSTEM, "fp_parse_line - Too many tokens (max %d)\n", + MAXARGS); exit( 1 ); } argv[(*argcp)++] = token; @@ -156,13 +156,13 @@ collation_read_config( char *fname ) fp = fopen( fname, "r" ); if ( fp == NULL ) { - LDAPDebug(LDAP_DEBUG_ERR, + slapi_log_err(SLAPI_LOG_ERR, COLLATE_PLUGIN_SUBSYSTEM, "collation_read_config - Could not open config file \"%s\" - absolute path?\n", - fname, 0, 0 ); + fname); return; /* Do not exit */ } - LDAPDebug(LDAP_DEBUG_CONFIG, "reading config file %s\n", fname, 0, 0 ); + slapi_log_err(SLAPI_LOG_CONFIG, "collation_read_config", "Reading config file %s\n", fname); fp_getline_init( &lineno ); while ( (line = fp_getline( fp, &lineno )) != NULL ) { @@ -170,12 +170,13 @@ collation_read_config( char *fname ) if ( line[0] == '#' || line[0] == '\0' ) { continue; } - LDAPDebug(LDAP_DEBUG_CONFIG, "line %d: %s\n", lineno, line, 0 ); + slapi_log_err(SLAPI_LOG_CONFIG, COLLATE_PLUGIN_SUBSYSTEM, + "collation_read_config - line %d: %s\n", lineno, line); fp_parse_line( line, &cargc, cargv ); if ( cargc < 1 ) { - LDAPDebug(LDAP_DEBUG_ERR, + slapi_log_err(SLAPI_LOG_ERR, COLLATE_PLUGIN_SUBSYSTEM, "collation_read_config - %s: line %d: bad config line (ignored)\n", - fname, lineno, 0 ); + fname, lineno); continue; } collation_config (cargc, cargv, fname, lineno); diff --git a/ldap/servers/plugins/collation/orfilter.c b/ldap/servers/plugins/collation/orfilter.c index 570f72c..866936a 100644 --- a/ldap/servers/plugins/collation/orfilter.c +++ b/ldap/servers/plugins/collation/orfilter.c @@ -64,7 +64,8 @@ static int or_filter_destroy (Slapi_PBlock* pb) { auto or_filter_t* or = or_filter_get (pb); - LDAPDebug(LDAP_DEBUG_FILTER, "or_filter_destroy(%p)\n", (void*)or, 0, 0); + slapi_log_err(SLAPI_LOG_FILTER, COLLATE_PLUGIN_SUBSYSTEM, + "or_filter_destroy - (%p)\n", (void*)or); if (or != NULL) { slapi_ch_free((void**)&or->or_type); slapi_ch_free((void**)&or->or_oid); @@ -458,105 +459,107 @@ static int or_filter_index (Slapi_PBlock* pb); static int or_filter_create (Slapi_PBlock* pb) { - auto int rc = LDAP_UNAVAILABLE_CRITICAL_EXTENSION; /* failed to initialize */ - auto char* mrOID = NULL; - auto char* mrTYPE = NULL; - auto struct berval* mrVALUE = NULL; - auto or_filter_t* or = NULL; - - if (!slapi_pblock_get (pb, SLAPI_PLUGIN_MR_OID, &mrOID) && mrOID != NULL && + auto int rc = LDAP_UNAVAILABLE_CRITICAL_EXTENSION; /* failed to initialize */ + auto char* mrOID = NULL; + auto char* mrTYPE = NULL; + auto struct berval* mrVALUE = NULL; + auto or_filter_t* or = NULL; + + if (!slapi_pblock_get (pb, SLAPI_PLUGIN_MR_OID, &mrOID) && mrOID != NULL && !slapi_pblock_get (pb, SLAPI_PLUGIN_MR_TYPE, &mrTYPE) && mrTYPE != NULL && !slapi_pblock_get (pb, SLAPI_PLUGIN_MR_VALUE, &mrVALUE) && mrVALUE != NULL) { - auto size_t len = mrVALUE->bv_len; - auto indexer_t* ix = NULL; - auto int op = SLAPI_OP_EQUAL; - auto struct berval bv; - auto int reusable = MRF_ANY_TYPE; - - LDAPDebug(LDAP_DEBUG_FILTER, "=> or_filter_create(oid %s; type %s)\n", - mrOID, mrTYPE, 0); - if (len > 1 && (ix = indexer_create (mrOID)) != NULL) { - auto char* val = mrVALUE->bv_val; - switch (val[0]) { - case '=': break; - case '<': op = (val[1] == '=') ? - SLAPI_OP_LESS_OR_EQUAL : SLAPI_OP_LESS; break; - case '>': op = (val[1] == '=') ? - SLAPI_OP_GREATER_OR_EQUAL : SLAPI_OP_GREATER; break; - case WILDCARD: op = SLAPI_OP_SUBSTRING; break; - default: - break; - } - for (; len > 0 && *val != ' '; ++val, --len); - if (len > 0) ++val, --len; /* skip the space */ - bv.bv_len = len; - bv.bv_val = (len > 0) ? val : NULL; - } else { /* mrOID does not identify an ordering rule. */ - /* Is it an ordering rule OID with a relational operator suffix? */ - auto size_t oidlen = strlen (mrOID); - if (oidlen > 2 && mrOID[oidlen-2] == '.') { - op = atoi (mrOID + oidlen - 1); - switch (op) { - case SLAPI_OP_LESS: - case SLAPI_OP_LESS_OR_EQUAL: - case SLAPI_OP_EQUAL: - case SLAPI_OP_GREATER_OR_EQUAL: - case SLAPI_OP_GREATER: - case SLAPI_OP_SUBSTRING: - { - auto char* or_oid = slapi_ch_strdup (mrOID); - or_oid [oidlen-2] = '\0'; - ix = indexer_create (or_oid); - if (ix != NULL) { - memcpy (&bv, mrVALUE, sizeof(struct berval)); - reusable |= MRF_ANY_VALUE; + auto size_t len = mrVALUE->bv_len; + auto indexer_t* ix = NULL; + auto int op = SLAPI_OP_EQUAL; + auto struct berval bv; + auto int reusable = MRF_ANY_TYPE; + + slapi_log_err(SLAPI_LOG_FILTER, COLLATE_PLUGIN_SUBSYSTEM, + "or_filter_create - (oid %s; type %s)\n", mrOID, mrTYPE); + if (len > 1 && (ix = indexer_create (mrOID)) != NULL) { + auto char* val = mrVALUE->bv_val; + switch (val[0]) { + case '=': break; + case '<': op = (val[1] == '=') ? + SLAPI_OP_LESS_OR_EQUAL : SLAPI_OP_LESS; break; + case '>': op = (val[1] == '=') ? + SLAPI_OP_GREATER_OR_EQUAL : SLAPI_OP_GREATER; break; + case WILDCARD: op = SLAPI_OP_SUBSTRING; break; + default: + break; + } + for (; len > 0 && *val != ' '; ++val, --len); + if (len > 0) ++val, --len; /* skip the space */ + bv.bv_len = len; + bv.bv_val = (len > 0) ? val : NULL; + } else { /* mrOID does not identify an ordering rule. */ + /* Is it an ordering rule OID with a relational operator suffix? */ + auto size_t oidlen = strlen (mrOID); + if (oidlen > 2 && mrOID[oidlen-2] == '.') { + op = atoi (mrOID + oidlen - 1); + switch (op) { + case SLAPI_OP_LESS: + case SLAPI_OP_LESS_OR_EQUAL: + case SLAPI_OP_EQUAL: + case SLAPI_OP_GREATER_OR_EQUAL: + case SLAPI_OP_GREATER: + case SLAPI_OP_SUBSTRING: + { + auto char* or_oid = slapi_ch_strdup (mrOID); + or_oid [oidlen-2] = '\0'; + ix = indexer_create (or_oid); + if (ix != NULL) { + memcpy (&bv, mrVALUE, sizeof(struct berval)); + reusable |= MRF_ANY_VALUE; + } + slapi_ch_free((void**)&or_oid); + } + break; + default: /* not a relational operator */ + break; + } } - slapi_ch_free((void**)&or_oid); - } - break; - default: /* not a relational operator */ - break; } - } - } - if (ix != NULL) { - or = (or_filter_t*) slapi_ch_calloc (1, sizeof (or_filter_t)); - or->or_type = slapi_ch_strdup (mrTYPE); - or->or_indexer = ix; - or->or_op = op; - if (op == SLAPI_OP_SUBSTRING) { - or->or_values = ss_filter_values (&bv, &(or->or_op)); - } else { - or->or_values = (struct berval**) - slapi_ch_malloc (2 * sizeof (struct berval*)); - or->or_values[0] = slapi_ch_bvdup0 (&bv); - or->or_values[1] = NULL; - } - { - auto struct berval** val = or->or_values; - if (val) for (; *val; ++val) { - LDAPDebug(LDAP_DEBUG_FILTER, "value \"%s\"\n", (*val)->bv_val, 0, 0); + if (ix != NULL) { + or = (or_filter_t*) slapi_ch_calloc (1, sizeof (or_filter_t)); + or->or_type = slapi_ch_strdup (mrTYPE); + or->or_indexer = ix; + or->or_op = op; + if (op == SLAPI_OP_SUBSTRING) { + or->or_values = ss_filter_values (&bv, &(or->or_op)); + } else { + or->or_values = (struct berval**) + slapi_ch_malloc (2 * sizeof (struct berval*)); + or->or_values[0] = slapi_ch_bvdup0 (&bv); + or->or_values[1] = NULL; + } + { + auto struct berval** val = or->or_values; + if (val) for (; *val; ++val) { + slapi_log_err(SLAPI_LOG_FILTER, COLLATE_PLUGIN_SUBSYSTEM, + "or_filter_create - value \"%s\"\n", (*val)->bv_val); + } + } + if (or->or_op == SLAPI_OP_SUBSTRING) { + or->or_match_keys = ss_filter_keys (ix, or->or_values); + } else { + or->or_match_keys = slapi_ch_bvecdup(ix->ix_index (ix, or->or_values, NULL)); + } + slapi_pblock_set (pb, SLAPI_PLUGIN_OBJECT, or); + slapi_pblock_set (pb, SLAPI_PLUGIN_DESTROY_FN, (void*)or_filter_destroy); + slapi_pblock_set (pb, SLAPI_PLUGIN_MR_FILTER_MATCH_FN, (void*)or_filter_match); + slapi_pblock_set (pb, SLAPI_PLUGIN_MR_FILTER_INDEX_FN, (void*)or_filter_index); + /* slapi_pblock_set (pb, SLAPI_PLUGIN_MR_FILTER_REUSABLE, &reusable); */ + /* slapi_pblock_set (pb, SLAPI_PLUGIN_MR_FILTER_RESET_FN, ?); to be implemented */ + rc = LDAP_SUCCESS; } - } - if (or->or_op == SLAPI_OP_SUBSTRING) { - or->or_match_keys = ss_filter_keys (ix, or->or_values); - } else { - or->or_match_keys = slapi_ch_bvecdup ( - ix->ix_index (ix, or->or_values, NULL)); - } - slapi_pblock_set (pb, SLAPI_PLUGIN_OBJECT, or); - slapi_pblock_set (pb, SLAPI_PLUGIN_DESTROY_FN, (void*)or_filter_destroy); - slapi_pblock_set (pb, SLAPI_PLUGIN_MR_FILTER_MATCH_FN, (void*)or_filter_match); - slapi_pblock_set (pb, SLAPI_PLUGIN_MR_FILTER_INDEX_FN, (void*)or_filter_index); -/* slapi_pblock_set (pb, SLAPI_PLUGIN_MR_FILTER_REUSABLE, &reusable); */ -/* slapi_pblock_set (pb, SLAPI_PLUGIN_MR_FILTER_RESET_FN, ?); to be implemented */ - rc = LDAP_SUCCESS; + } else { + slapi_log_err(SLAPI_LOG_FILTER, COLLATE_PLUGIN_SUBSYSTEM, + "or_filter_create - Missing parameter(s)\n"); } - } else { - LDAPDebug(LDAP_DEBUG_FILTER, "=> or_filter_create missing parameter(s)\n", 0, 0, 0); - } - LDAPDebug(LDAP_DEBUG_FILTER, "<= or_filter_create(%p) %i\n", (void*)or, rc, 0); - return rc; + slapi_log_err(SLAPI_LOG_FILTER, COLLATE_PLUGIN_SUBSYSTEM, + "or_filter_create - (%p) %i\n", (void*)or, rc); + return rc; } static indexer_t* @@ -573,7 +576,8 @@ static int op_indexer_destroy (Slapi_PBlock* pb) { auto indexer_t* ix = op_indexer_get (pb); - LDAPDebug(LDAP_DEBUG_FILTER, "op_indexer_destroy(%p)\n", (void*)ix, 0, 0); + slapi_log_err(SLAPI_LOG_FILTER, COLLATE_PLUGIN_SUBSYSTEM, + "op_indexer_destroy - (%p)\n", (void*)ix); if (ix != NULL) { indexer_free (ix); /* The keys were freed, but we need to reset the pblock pointer */ @@ -596,7 +600,8 @@ op_index_entry (Slapi_PBlock* pb) } else { rc = LDAP_OPERATIONS_ERROR; } - LDAPDebug(LDAP_DEBUG_FILTER, "op_index_entry(%p) %i\n", (void*)ix, rc, 0); + slapi_log_err(SLAPI_LOG_FILTER, COLLATE_PLUGIN_SUBSYSTEM, + "op_index_entry - (%p) %i\n", (void*)ix, rc); return rc; } @@ -604,22 +609,22 @@ static int op_index_search (Slapi_PBlock* pb) /* Compute collation keys (when searching for entries). */ { - auto or_filter_t* or = or_filter_get (pb); - auto int rc = LDAP_OPERATIONS_ERROR; - if (or != NULL) { - auto indexer_t* ix = or->or_indexer; - struct berval** values; - if (or->or_index_keys == NULL && ix != NULL && ix->ix_index != NULL && - !slapi_pblock_get (pb, SLAPI_PLUGIN_MR_VALUES, &values)) { - or->or_index_keys = slapi_ch_bvecdup ( - ix->ix_index (ix, values, NULL)); - } - if (or->or_index_keys) { - rc = slapi_pblock_set (pb, SLAPI_PLUGIN_MR_KEYS, or->or_index_keys); + auto or_filter_t* or = or_filter_get (pb); + auto int rc = LDAP_OPERATIONS_ERROR; + if (or != NULL) { + auto indexer_t* ix = or->or_indexer; + struct berval** values; + if (or->or_index_keys == NULL && ix != NULL && ix->ix_index != NULL && + !slapi_pblock_get (pb, SLAPI_PLUGIN_MR_VALUES, &values)) { + or->or_index_keys = slapi_ch_bvecdup(ix->ix_index (ix, values, NULL)); + } + if (or->or_index_keys) { + rc = slapi_pblock_set (pb, SLAPI_PLUGIN_MR_KEYS, or->or_index_keys); + } } - } - LDAPDebug(LDAP_DEBUG_FILTER, "op_index_search(%p) %i\n", (void*)or, rc, 0); - return rc; + slapi_log_err(SLAPI_LOG_FILTER, COLLATE_PLUGIN_SUBSYSTEM, + "op_index_search - (%p) %i\n", (void*)or, rc); + return rc; } typedef struct ss_indexer_t { @@ -652,7 +657,8 @@ static void ss_indexer_destroy (Slapi_PBlock* pb) { auto ss_indexer_t* ss = ss_indexer_get (pb); - LDAPDebug(LDAP_DEBUG_FILTER, "ss_indexer_destroy(%p)\n", (void*)ss, 0, 0); + slapi_log_err(SLAPI_LOG_FILTER, COLLATE_PLUGIN_SUBSYSTEM, + "ss_indexer_destroy - (%p)\n", (void*)ss); if (ss) { ss_indexer_free(ss); /* The keys were freed, but we need to reset the pblock pointer */ @@ -743,8 +749,9 @@ ss_index_entry (Slapi_PBlock* pb) slapi_ch_free((void**)&prefixes); } } - LDAPDebug(LDAP_DEBUG_FILTER, "ss_index_entry(%p) %i %lu substrings\n", - (void*)ss, rc, (unsigned long)substringsLen); + slapi_log_err(SLAPI_LOG_FILTER, COLLATE_PLUGIN_SUBSYSTEM, + "ss_index_entry - (%p) %i %lu substrings\n", + (void*)ss, rc, (unsigned long)substringsLen); return rc; } @@ -809,7 +816,8 @@ ss_index_search (Slapi_PBlock* pb) rc = slapi_pblock_set (pb, SLAPI_PLUGIN_MR_KEYS, or->or_index_keys); } } - LDAPDebug(LDAP_DEBUG_FILTER, "ss_index_search(%p) %i\n", (void*)or, rc, 0); + slapi_log_err(SLAPI_LOG_FILTER, COLLATE_PLUGIN_SUBSYSTEM, + "ss_index_search - (%p) %i\n", (void*)or, rc); return rc; } @@ -884,75 +892,76 @@ or_filter_index (Slapi_PBlock* pb) !(rc = slapi_pblock_set (pb, SLAPI_PLUGIN_MR_OID, mrOID))) { rc = slapi_pblock_set (pb, SLAPI_PLUGIN_MR_QUERY_OPERATOR, &mrQUERY_OPERATOR); } - LDAPDebug(LDAP_DEBUG_FILTER, "or_filter_index(%p) %i\n", - (void*)(or ? or->or_indexer : NULL), rc, 0); + slapi_log_err(SLAPI_LOG_FILTER, COLLATE_PLUGIN_SUBSYSTEM, + "or_filter_index - (%p) %i\n", + (void*)(or ? or->or_indexer : NULL), rc); return rc; } static int or_indexer_create (Slapi_PBlock* pb) { - auto int rc = LDAP_UNAVAILABLE_CRITICAL_EXTENSION; /* failed to initialize */ - auto char* mrOID = NULL; - auto void* mrOBJECT = NULL; - if (slapi_pblock_get (pb, SLAPI_PLUGIN_MR_OID, &mrOID) || mrOID == NULL) { - LDAPDebug(LDAP_DEBUG_FILTER, "=> or_indexer_create: no OID parameter\n", 0, 0, 0); - } else { - auto indexer_t* ix = indexer_create (mrOID); - auto char* mrTYPE = NULL; - slapi_pblock_get (pb, SLAPI_PLUGIN_MR_TYPE, &mrTYPE); - LDAPDebug(LDAP_DEBUG_FILTER, "=> or_indexer_create(oid %s; type %s)\n", - mrOID, mrTYPE ? mrTYPE : "", 0); - if (ix != NULL) { - if (ix->ix_index != NULL && - !slapi_pblock_set (pb, SLAPI_PLUGIN_OBJECT, ix) && - !slapi_pblock_set (pb, SLAPI_PLUGIN_MR_OID, ix->ix_oid) && - !slapi_pblock_set (pb, SLAPI_PLUGIN_MR_INDEX_FN, (void*)op_index_entry) && - !slapi_pblock_set (pb, SLAPI_PLUGIN_DESTROY_FN, (void*)op_indexer_destroy)) { - mrOBJECT = ix; - rc = 0; /* success */ - } else { - indexer_free (ix); - } - } else { /* mrOID does not identify an ordering rule. */ - /* Is it an ordering rule OID with the substring suffix? */ - auto size_t oidlen = strlen (mrOID); - if (oidlen > 2 && mrOID[oidlen-2] == '.' && - atoi (mrOID + oidlen - 1) == SLAPI_OP_SUBSTRING) { - auto char* or_oid = slapi_ch_strdup (mrOID); - or_oid [oidlen-2] = '\0'; - ix = indexer_create (or_oid); + auto int rc = LDAP_UNAVAILABLE_CRITICAL_EXTENSION; /* failed to initialize */ + auto char* mrOID = NULL; + auto void* mrOBJECT = NULL; + if (slapi_pblock_get (pb, SLAPI_PLUGIN_MR_OID, &mrOID) || mrOID == NULL) { + slapi_log_err(SLAPI_LOG_FILTER, COLLATE_PLUGIN_SUBSYSTEM, + "or_indexer_create - No OID parameter\n"); + } else { + auto indexer_t* ix = indexer_create (mrOID); + auto char* mrTYPE = NULL; + slapi_pblock_get (pb, SLAPI_PLUGIN_MR_TYPE, &mrTYPE); + slapi_log_err(SLAPI_LOG_FILTER, "or_indexer_create", "(oid %s; type %s)\n", + mrOID, mrTYPE ? mrTYPE : ""); if (ix != NULL) { - auto ss_indexer_t* ss = (ss_indexer_t*) slapi_ch_malloc (sizeof (ss_indexer_t)); - ss->ss_indexer = ix; - oidlen = strlen (ix->ix_oid); - ss->ss_oid = slapi_ch_malloc (oidlen + 3); - memcpy (ss->ss_oid, ix->ix_oid, oidlen); - sprintf (ss->ss_oid + oidlen, ".%1i", SLAPI_OP_SUBSTRING); - if (ix->ix_index != NULL && - !slapi_pblock_set (pb, SLAPI_PLUGIN_OBJECT, ss) && - !slapi_pblock_set (pb, SLAPI_PLUGIN_MR_OID, ss->ss_oid) && - !slapi_pblock_set (pb, SLAPI_PLUGIN_MR_INDEX_FN, (void*)ss_index_entry) && - !slapi_pblock_set (pb, SLAPI_PLUGIN_DESTROY_FN, (void*)ss_indexer_destroy)) { - mrOBJECT = ss; - rc = 0; /* success */ - } else { - ss_indexer_free (ss); - } + if (ix->ix_index != NULL && + !slapi_pblock_set (pb, SLAPI_PLUGIN_OBJECT, ix) && + !slapi_pblock_set (pb, SLAPI_PLUGIN_MR_OID, ix->ix_oid) && + !slapi_pblock_set (pb, SLAPI_PLUGIN_MR_INDEX_FN, (void*)op_index_entry) && + !slapi_pblock_set (pb, SLAPI_PLUGIN_DESTROY_FN, (void*)op_indexer_destroy)) { + mrOBJECT = ix; + rc = 0; /* success */ + } else { + indexer_free (ix); + } + } else { /* mrOID does not identify an ordering rule. */ + /* Is it an ordering rule OID with the substring suffix? */ + auto size_t oidlen = strlen (mrOID); + if (oidlen > 2 && mrOID[oidlen-2] == '.' && + atoi (mrOID + oidlen - 1) == SLAPI_OP_SUBSTRING) { + auto char* or_oid = slapi_ch_strdup (mrOID); + or_oid [oidlen-2] = '\0'; + ix = indexer_create (or_oid); + if (ix != NULL) { + auto ss_indexer_t* ss = (ss_indexer_t*) slapi_ch_malloc (sizeof (ss_indexer_t)); + ss->ss_indexer = ix; + oidlen = strlen (ix->ix_oid); + ss->ss_oid = slapi_ch_malloc (oidlen + 3); + memcpy (ss->ss_oid, ix->ix_oid, oidlen); + sprintf (ss->ss_oid + oidlen, ".%1i", SLAPI_OP_SUBSTRING); + if (ix->ix_index != NULL && + !slapi_pblock_set (pb, SLAPI_PLUGIN_OBJECT, ss) && + !slapi_pblock_set (pb, SLAPI_PLUGIN_MR_OID, ss->ss_oid) && + !slapi_pblock_set (pb, SLAPI_PLUGIN_MR_INDEX_FN, (void*)ss_index_entry) && + !slapi_pblock_set (pb, SLAPI_PLUGIN_DESTROY_FN, (void*)ss_indexer_destroy)) { + mrOBJECT = ss; + rc = 0; /* success */ + } else { + ss_indexer_free (ss); + } + } + slapi_ch_free((void**)&or_oid); + } } - slapi_ch_free((void**)&or_oid); - } } - } - LDAPDebug(LDAP_DEBUG_FILTER, "<= or_indexer_create(%p) %i\n", mrOBJECT, rc, 0); - return rc; + slapi_log_err(SLAPI_LOG_FILTER, COLLATE_PLUGIN_SUBSYSTEM, + "or_indexer_create - (%p) %i\n", mrOBJECT, rc); + return rc; } static Slapi_PluginDesc pdesc = { "orderingrule", VENDOR, DS_PACKAGE_VERSION, "internationalized ordering rule plugin" }; -#define SLAPI_ORPLUGIN_NAME pdesc.spd_description - int /* LDAP error code */ orderingRule_init (Slapi_PBlock* pb) { @@ -977,24 +986,22 @@ orderingRule_init (Slapi_PBlock* pb) #endif if ( slapi_pblock_get( pb, SLAPI_CONFIG_DIRECTORY, &cfgpath ) != 0 ) { - slapi_log_error(SLAPI_LOG_ERR, SLAPI_ORPLUGIN_NAME, - "orderingRule_init - Unable to retrieve slapd configuration pathname; using default\n" ); - cfgpath = NULL; + slapi_log_err(SLAPI_LOG_ERR, COLLATE_PLUGIN_SUBSYSTEM, + "orderingRule_init - Unable to retrieve slapd configuration pathname; using default\n"); + cfgpath = NULL; } collation_init( cfgpath ); if (!slapi_pblock_get (pb, SLAPI_PLUGIN_ARGC, &argc) && - !slapi_pblock_get (pb, SLAPI_PLUGIN_ARGV, &argv) && - argc > 0) { - collation_read_config (argv[0]); - } - { - slapi_pblock_set (pb, SLAPI_PLUGIN_MR_INDEXER_CREATE_FN, (void*)or_indexer_create); - rc = slapi_pblock_set (pb, SLAPI_PLUGIN_MR_FILTER_CREATE_FN, (void*)or_filter_create); + !slapi_pblock_get (pb, SLAPI_PLUGIN_ARGV, &argv) && + argc > 0) { + collation_read_config (argv[0]); } + slapi_pblock_set (pb, SLAPI_PLUGIN_MR_INDEXER_CREATE_FN, (void*)or_indexer_create); + rc = slapi_pblock_set (pb, SLAPI_PLUGIN_MR_FILTER_CREATE_FN, (void*)or_filter_create); if ( rc == 0 ) { - rc = slapi_pblock_set( pb, SLAPI_PLUGIN_DESCRIPTION, (void *)&pdesc ); + rc = slapi_pblock_set( pb, SLAPI_PLUGIN_DESCRIPTION, (void *)&pdesc ); } - LDAPDebug(LDAP_DEBUG_FILTER, "orderingRule_init %i\n", rc, 0, 0); + slapi_log_err(SLAPI_LOG_FILTER, COLLATE_PLUGIN_SUBSYSTEM, "orderingRule_init - %i\n", rc); return rc; } diff --git a/ldap/servers/plugins/cos/cos.c b/ldap/servers/plugins/cos/cos.c index e92b6e1..5234b2b 100644 --- a/ldap/servers/plugins/cos/cos.c +++ b/ldap/servers/plugins/cos/cos.c @@ -103,7 +103,7 @@ cos_postop_init ( Slapi_PBlock *pb ) slapi_pblock_set(pb, SLAPI_PLUGIN_POST_MODIFY_FN, (void *)cos_post_op ) != 0 || slapi_pblock_set(pb, SLAPI_PLUGIN_POST_MODRDN_FN, (void *)cos_post_op ) != 0 ) { - slapi_log_error(SLAPI_LOG_ERR, COS_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_ERR, COS_PLUGIN_SUBSYSTEM, "cos_postop_init - Failed to register plugin\n" ); rc = -1; } @@ -126,7 +126,7 @@ cos_internalpostop_init ( Slapi_PBlock *pb ) slapi_pblock_set(pb, SLAPI_PLUGIN_INTERNAL_POST_DELETE_FN, (void *) cos_post_op ) != 0 ) { - slapi_log_error(SLAPI_LOG_ERR, COS_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_ERR, COS_PLUGIN_SUBSYSTEM, "cos_internalpostop_init - Failed to register plugin\n" ); rc = -1; } @@ -143,7 +143,7 @@ int cos_init( Slapi_PBlock *pb ) int ret = 0; void * plugin_identity=NULL; - slapi_log_error(SLAPI_LOG_TRACE, COS_PLUGIN_SUBSYSTEM, "--> cos_init\n"); + slapi_log_err(SLAPI_LOG_TRACE, COS_PLUGIN_SUBSYSTEM, "--> cos_init\n"); /* ** Store the plugin identity for later use. @@ -159,7 +159,7 @@ int cos_init( Slapi_PBlock *pb ) slapi_pblock_set(pb, SLAPI_PLUGIN_CLOSE_FN, (void *) cos_close ) != 0 || slapi_pblock_set( pb, SLAPI_PLUGIN_DESCRIPTION, (void *)&pdesc ) != 0 ) { - slapi_log_error(SLAPI_LOG_ERR, COS_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_ERR, COS_PLUGIN_SUBSYSTEM, "cos_init - Failed to register plugin\n" ); ret = -1; goto bailout; @@ -178,7 +178,7 @@ int cos_init( Slapi_PBlock *pb ) plugin_identity); bailout: - slapi_log_error(SLAPI_LOG_TRACE, COS_PLUGIN_SUBSYSTEM, "<-- cos_init\n"); + slapi_log_err(SLAPI_LOG_TRACE, COS_PLUGIN_SUBSYSTEM, "<-- cos_init\n"); return ret; } @@ -193,22 +193,22 @@ int cos_start( Slapi_PBlock *pb ) { int ret = 0; - slapi_log_error(SLAPI_LOG_TRACE, COS_PLUGIN_SUBSYSTEM, "--> cos_start\n"); + slapi_log_err(SLAPI_LOG_TRACE, COS_PLUGIN_SUBSYSTEM, "--> cos_start\n"); if( !cos_cache_init() ) { - slapi_log_error(SLAPI_LOG_PLUGIN, COS_PLUGIN_SUBSYSTEM, "cos_start - Ready for service\n"); + slapi_log_err(SLAPI_LOG_PLUGIN, COS_PLUGIN_SUBSYSTEM, "cos_start - Ready for service\n"); } else { /* problems we are hosed */ cos_cache_stop(); - slapi_log_error(SLAPI_LOG_ERR, COS_PLUGIN_SUBSYSTEM, "cos_start - Failed to initialise\n"); + slapi_log_err(SLAPI_LOG_ERR, COS_PLUGIN_SUBSYSTEM, "cos_start - Failed to initialise\n"); ret = -1; } - slapi_log_error(SLAPI_LOG_TRACE, COS_PLUGIN_SUBSYSTEM, "<-- cos_start\n"); + slapi_log_err(SLAPI_LOG_TRACE, COS_PLUGIN_SUBSYSTEM, "<-- cos_start\n"); return ret; } @@ -219,11 +219,11 @@ int cos_start( Slapi_PBlock *pb ) */ int cos_close( Slapi_PBlock *pb ) { - slapi_log_error(SLAPI_LOG_TRACE, COS_PLUGIN_SUBSYSTEM, "--> cos_close\n"); + slapi_log_err(SLAPI_LOG_TRACE, COS_PLUGIN_SUBSYSTEM, "--> cos_close\n"); cos_cache_stop(); - slapi_log_error(SLAPI_LOG_TRACE, COS_PLUGIN_SUBSYSTEM, "<-- cos_close\n"); + slapi_log_err(SLAPI_LOG_TRACE, COS_PLUGIN_SUBSYSTEM, "<-- cos_close\n"); return 0; } @@ -260,11 +260,11 @@ int cos_compute(computed_attr_context *c,char* type,Slapi_Entry *e,slapi_compute */ int cos_post_op( Slapi_PBlock *pb ) { - slapi_log_error(SLAPI_LOG_TRACE, COS_PLUGIN_SUBSYSTEM, "--> cos_post_op\n"); + slapi_log_err(SLAPI_LOG_TRACE, COS_PLUGIN_SUBSYSTEM, "--> cos_post_op\n"); cos_cache_change_notify(pb); - slapi_log_error(SLAPI_LOG_TRACE, COS_PLUGIN_SUBSYSTEM, "<-- cos_post_op\n"); + slapi_log_err(SLAPI_LOG_TRACE, COS_PLUGIN_SUBSYSTEM, "<-- cos_post_op\n"); return SLAPI_PLUGIN_SUCCESS; /* always succeed */ } diff --git a/ldap/servers/plugins/cos/cos_cache.c b/ldap/servers/plugins/cos/cos_cache.c index 4c91136..5522d6e 100644 --- a/ldap/servers/plugins/cos/cos_cache.c +++ b/ldap/servers/plugins/cos/cos_cache.c @@ -288,7 +288,7 @@ int cos_cache_init(void) { int ret = 0; - slapi_log_error(SLAPI_LOG_TRACE, COS_PLUGIN_SUBSYSTEM, "--> cos_cache_init\n"); + slapi_log_err(SLAPI_LOG_TRACE, COS_PLUGIN_SUBSYSTEM, "--> cos_cache_init\n"); slapi_vattrcache_cache_none(); cache_lock = slapi_new_mutex(); @@ -308,7 +308,7 @@ int cos_cache_init(void) start_cond == NULL || something_changed == NULL) { - slapi_log_error(SLAPI_LOG_ERR, COS_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_ERR, COS_PLUGIN_SUBSYSTEM, "cos_cache_init - Cannot create mutexes\n" ); ret = -1; goto out; @@ -326,7 +326,7 @@ int cos_cache_init(void) cos_cache_vattr_compare, cos_cache_vattr_types) != 0) { - slapi_log_error(SLAPI_LOG_ERR, COS_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_ERR, COS_PLUGIN_SUBSYSTEM, "cos_cache_init - Cannot register as service provider\n" ); ret = -1; goto out; @@ -340,7 +340,7 @@ int cos_cache_init(void) PR_UNJOINABLE_THREAD, SLAPD_DEFAULT_THREAD_STACKSIZE) == NULL ) { - slapi_log_error(SLAPI_LOG_ERR, COS_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_ERR, COS_PLUGIN_SUBSYSTEM, "cos_cache_init - PR_CreateThread failed\n" ); ret = -1; goto out; @@ -357,7 +357,7 @@ int cos_cache_init(void) out: - slapi_log_error(SLAPI_LOG_TRACE, COS_PLUGIN_SUBSYSTEM, "<-- cos_cache_init\n"); + slapi_log_err(SLAPI_LOG_TRACE, COS_PLUGIN_SUBSYSTEM, "<-- cos_cache_init\n"); return ret; } @@ -375,7 +375,7 @@ out: */ static void cos_cache_wait_on_change(void *arg) { - slapi_log_error(SLAPI_LOG_TRACE, COS_PLUGIN_SUBSYSTEM, "--> cos_cache_wait_on_change thread\n"); + slapi_log_err(SLAPI_LOG_TRACE, COS_PLUGIN_SUBSYSTEM, "--> cos_cache_wait_on_change thread\n"); slapi_lock_mutex(stop_lock); slapi_lock_mutex(change_lock); @@ -428,7 +428,7 @@ static void cos_cache_wait_on_change(void *arg) slapi_unlock_mutex(change_lock); slapi_unlock_mutex(stop_lock); - slapi_log_error(SLAPI_LOG_TRACE, COS_PLUGIN_SUBSYSTEM, "<-- cos_cache_wait_on_change thread exit\n"); + slapi_log_err(SLAPI_LOG_TRACE, COS_PLUGIN_SUBSYSTEM, "<-- cos_cache_wait_on_change thread exit\n"); } /* @@ -446,7 +446,7 @@ static int cos_cache_create(void) static int firstTime = 1; int cache_built = 0; - slapi_log_error(SLAPI_LOG_TRACE, COS_PLUGIN_SUBSYSTEM, "--> cos_cache_create\n"); + slapi_log_err(SLAPI_LOG_TRACE, COS_PLUGIN_SUBSYSTEM, "--> cos_cache_create\n"); pNewCache = (cosCache*)slapi_ch_malloc(sizeof(cosCache)); if(pNewCache) @@ -509,21 +509,21 @@ static int cos_cache_create(void) { /* we should not go on without proper schema checking */ cos_cache_release(pNewCache); - slapi_log_error(SLAPI_LOG_ERR, COS_PLUGIN_SUBSYSTEM, "cos_cache_create - Failed to cache the schema\n"); + slapi_log_err(SLAPI_LOG_ERR, COS_PLUGIN_SUBSYSTEM, "cos_cache_create - Failed to cache the schema\n"); } } else { /* currently we cannot go on without the indexes */ cos_cache_release(pNewCache); - slapi_log_error(SLAPI_LOG_ERR, COS_PLUGIN_SUBSYSTEM, "cos_cache_create - Failed to index cache\n"); + slapi_log_err(SLAPI_LOG_ERR, COS_PLUGIN_SUBSYSTEM, "cos_cache_create - Failed to index cache\n"); } } else { if(firstTime) { - slapi_log_error(SLAPI_LOG_PLUGIN, COS_PLUGIN_SUBSYSTEM, "cos_cache_create - cos disabled\n"); + slapi_log_err(SLAPI_LOG_PLUGIN, COS_PLUGIN_SUBSYSTEM, "cos_cache_create - cos disabled\n"); firstTime = 0; } @@ -531,7 +531,7 @@ static int cos_cache_create(void) } } else - slapi_log_error(SLAPI_LOG_ERR, COS_PLUGIN_SUBSYSTEM, "cos_cache_create - Memory allocation failure\n"); + slapi_log_err(SLAPI_LOG_ERR, COS_PLUGIN_SUBSYSTEM, "cos_cache_create - Memory allocation failure\n"); /* make sure we have a new cache */ @@ -563,7 +563,7 @@ static int cos_cache_create(void) } - slapi_log_error(SLAPI_LOG_TRACE, COS_PLUGIN_SUBSYSTEM, "<-- cos_cache_create\n"); + slapi_log_err(SLAPI_LOG_TRACE, COS_PLUGIN_SUBSYSTEM, "<-- cos_cache_create\n"); return ret; } @@ -587,7 +587,7 @@ static int cos_cache_build_definition_list(cosDefinitions **pDefs, int *vattr_ca int cos_def_available = 0; static int firstTime = 1; - slapi_log_error(SLAPI_LOG_TRACE, COS_PLUGIN_SUBSYSTEM, "--> cos_cache_build_definition_list\n"); + slapi_log_err(SLAPI_LOG_TRACE, COS_PLUGIN_SUBSYSTEM, "--> cos_cache_build_definition_list\n"); /* * The class of service definitions may be anywhere in the DIT, @@ -597,7 +597,7 @@ static int cos_cache_build_definition_list(cosDefinitions **pDefs, int *vattr_ca attrs[0] = "namingcontexts"; attrs[1] = 0; - slapi_log_error(SLAPI_LOG_PLUGIN, COS_PLUGIN_SUBSYSTEM, "cos_cache_build_definition_list - " + slapi_log_err(SLAPI_LOG_PLUGIN, COS_PLUGIN_SUBSYSTEM, "cos_cache_build_definition_list - " "Building class of service cache after status change.\n"); /* @@ -610,7 +610,7 @@ static int cos_cache_build_definition_list(cosDefinitions **pDefs, int *vattr_ca slapi_pblock_get( pSuffixSearch, SLAPI_PLUGIN_INTOP_RESULT, &ret); if(!pSuffixSearch || ret != LDAP_SUCCESS) { - slapi_log_error(SLAPI_LOG_ERR, COS_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_ERR, COS_PLUGIN_SUBSYSTEM, "cos_cache_build_definition_list - Failed to find suffixes\n"); ret = -1; goto next; @@ -665,7 +665,7 @@ next: { if(firstTime) { - slapi_log_error(SLAPI_LOG_PLUGIN, COS_PLUGIN_SUBSYSTEM, "cos_cache_build_definition_list - " + slapi_log_err(SLAPI_LOG_PLUGIN, COS_PLUGIN_SUBSYSTEM, "cos_cache_build_definition_list - " "Found no cos definitions, cos disabled while waiting for updates\n"); firstTime = 0; } @@ -673,7 +673,7 @@ next: ret = -1; } else - slapi_log_error(SLAPI_LOG_PLUGIN, COS_PLUGIN_SUBSYSTEM, "cos_cache_build_definition_list - " + slapi_log_err(SLAPI_LOG_PLUGIN, COS_PLUGIN_SUBSYSTEM, "cos_cache_build_definition_list - " "Class of service cache built.\n"); /* clean up */ @@ -683,7 +683,7 @@ next: slapi_pblock_destroy(pSuffixSearch); } - slapi_log_error(SLAPI_LOG_TRACE, COS_PLUGIN_SUBSYSTEM, "<-- cos_cache_build_definition_list\n"); + slapi_log_err(SLAPI_LOG_TRACE, COS_PLUGIN_SUBSYSTEM, "<-- cos_cache_build_definition_list\n"); return ret; } @@ -871,7 +871,7 @@ cos_dn_defs_cb (Slapi_Entry* e, void *callback_data) parent = slapi_create_dn_string("%s", orig); if (!parent) { parent = orig; - slapi_log_error(SLAPI_LOG_ERR, COS_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_ERR, COS_PLUGIN_SUBSYSTEM, "cos_dn_defs_cb - " "Failed to normalize parent dn %s. " "Adding the pre normalized dn.\n", @@ -888,18 +888,18 @@ cos_dn_defs_cb (Slapi_Entry* e, void *callback_data) } slapi_ch_free_string(&orig); } else { - slapi_log_error(SLAPI_LOG_ERR, COS_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_ERR, COS_PLUGIN_SUBSYSTEM, "cos_dn_defs_cb - " "Failed to get parent dn of cos definition %s.\n", pDn->val); if (!pCosTemplateDn) { if (!pCosTargetTree) { - slapi_log_error(SLAPI_LOG_ERR, COS_PLUGIN_SUBSYSTEM, "cos_dn_defs_cb - cosTargetTree and cosTemplateDn are not set.\n"); + slapi_log_err(SLAPI_LOG_ERR, COS_PLUGIN_SUBSYSTEM, "cos_dn_defs_cb - cosTargetTree and cosTemplateDn are not set.\n"); } else { - slapi_log_error(SLAPI_LOG_ERR, COS_PLUGIN_SUBSYSTEM, "cos_dn_defs_cb - cosTemplateDn is not set.\n"); + slapi_log_err(SLAPI_LOG_ERR, COS_PLUGIN_SUBSYSTEM, "cos_dn_defs_cb - cosTemplateDn is not set.\n"); } } else if (!pCosTargetTree) { - slapi_log_error(SLAPI_LOG_ERR, COS_PLUGIN_SUBSYSTEM, "cos_dn_defs_cb - cosTargetTree is not set.\n"); + slapi_log_err(SLAPI_LOG_ERR, COS_PLUGIN_SUBSYSTEM, "cos_dn_defs_cb - cosTargetTree is not set.\n"); } } } @@ -979,11 +979,11 @@ cos_dn_defs_cb (Slapi_Entry* e, void *callback_data) * Don't reset info->ret....it keeps track of any success */ if ( rc == COS_DEF_ERROR_NO_TEMPLATES) { - slapi_log_error(SLAPI_LOG_ERR, COS_PLUGIN_SUBSYSTEM, "cos_dn_defs_cb - Skipping CoS Definition %s" + slapi_log_err(SLAPI_LOG_ERR, COS_PLUGIN_SUBSYSTEM, "cos_dn_defs_cb - Skipping CoS Definition %s" "--no CoS Templates found, which should be added before the CoS Definition.\n", pTmpDn); } else { - slapi_log_error(SLAPI_LOG_ERR, COS_PLUGIN_SUBSYSTEM, "cos_dn_defs_cb - Skipping CoS Definition %s\n" + slapi_log_err(SLAPI_LOG_ERR, COS_PLUGIN_SUBSYSTEM, "cos_dn_defs_cb - Skipping CoS Definition %s\n" "--error(%d)\n", pTmpDn, rc); } @@ -1000,11 +1000,11 @@ cos_dn_defs_cb (Slapi_Entry* e, void *callback_data) */ if(pDn) { - slapi_log_error(SLAPI_LOG_ERR, COS_PLUGIN_SUBSYSTEM, "cos_dn_defs_cb - " + slapi_log_err(SLAPI_LOG_ERR, COS_PLUGIN_SUBSYSTEM, "cos_dn_defs_cb - " "Incomplete cos definition detected in %s, discarding from cache.\n",pDn->val); } else - slapi_log_error(SLAPI_LOG_ERR, COS_PLUGIN_SUBSYSTEM, "cos_dn_defs_cb - " + slapi_log_err(SLAPI_LOG_ERR, COS_PLUGIN_SUBSYSTEM, "cos_dn_defs_cb - " "Incomplete cos definition detected, no DN to report, discarding from cache.\n"); if(pCosTargetTree) @@ -1202,7 +1202,7 @@ static int cos_dn_tmpl_entries_cb (Slapi_Entry* e, void *callback_data) { info->ret = 0; /* we have succeed to add the tmpl */ } else { /* Don't reset info->ret....it keeps track of any success */ - slapi_log_error(SLAPI_LOG_ERR, COS_PLUGIN_SUBSYSTEM, "cos_dn_tmpl_entries_cb - " + slapi_log_err(SLAPI_LOG_ERR, COS_PLUGIN_SUBSYSTEM, "cos_dn_tmpl_entries_cb - " "Could not cache cos template %s\n",pDn->val); } } @@ -1218,11 +1218,11 @@ static int cos_dn_tmpl_entries_cb (Slapi_Entry* e, void *callback_data) { */ if(pDn) { - slapi_log_error(SLAPI_LOG_PLUGIN, COS_PLUGIN_SUBSYSTEM, "cos_cache_add_dn_tmpls - " + slapi_log_err(SLAPI_LOG_PLUGIN, COS_PLUGIN_SUBSYSTEM, "cos_cache_add_dn_tmpls - " "Incomplete cos template detected in %s, discarding from cache.\n",pDn->val); } else - slapi_log_error(SLAPI_LOG_PLUGIN, COS_PLUGIN_SUBSYSTEM, "cos_cache_add_dn_tmpls - " + slapi_log_err(SLAPI_LOG_PLUGIN, COS_PLUGIN_SUBSYSTEM, "cos_cache_add_dn_tmpls - " "Incomplete cos template detected, no DN to report, discarding from cache.\n"); if(pObjectclass) @@ -1264,7 +1264,7 @@ static int cos_cache_add_dn_tmpls(char *dn, cosAttrValue *pCosSpecifier, cosAttr struct tmpl_info info = {NULL, 0, 0, 0}; Slapi_PBlock *pDnSearch = 0; - slapi_log_error(SLAPI_LOG_TRACE, COS_PLUGIN_SUBSYSTEM, "--> cos_cache_add_dn_tmpls\n"); + slapi_log_err(SLAPI_LOG_TRACE, COS_PLUGIN_SUBSYSTEM, "--> cos_cache_add_dn_tmpls\n"); /* no cos specifier means this is an indirect scheme */ if(pCosSpecifier) @@ -1336,17 +1336,17 @@ static int cos_cache_add_defn( cosAttributes *pDummyAttributes = 0; cosAttrValue *pSpecsIter = 0; - slapi_log_error(SLAPI_LOG_TRACE, COS_PLUGIN_SUBSYSTEM, "--> cos_cache_add_defn\n"); + slapi_log_err(SLAPI_LOG_TRACE, COS_PLUGIN_SUBSYSTEM, "--> cos_cache_add_defn\n"); if (!spec) { - slapi_log_error(SLAPI_LOG_ERR, COS_PLUGIN_SUBSYSTEM, "cos_cache_add_defn - Missing spec\n"); + slapi_log_err(SLAPI_LOG_ERR, COS_PLUGIN_SUBSYSTEM, "cos_cache_add_defn - Missing spec\n"); ret = -1; goto out; } pSpecsIter = *spec; if (!tmpDn) { - slapi_log_error(SLAPI_LOG_ERR, COS_PLUGIN_SUBSYSTEM, "cos_cache_add_defn - Missing tmpDn\n"); + slapi_log_err(SLAPI_LOG_ERR, COS_PLUGIN_SUBSYSTEM, "cos_cache_add_defn - Missing tmpDn\n"); ret = -1; goto out; } @@ -1358,7 +1358,7 @@ static int cos_cache_add_defn( if( cos_cache_attrval_exists(*pAttrs, pSpecsIter->val ) ) { /* no, this is not sane, lets reject the whole darn scheme in disgust */ - slapi_log_error(SLAPI_LOG_ERR, COS_PLUGIN_SUBSYSTEM, "cos_cache_add_defn - " + slapi_log_err(SLAPI_LOG_ERR, COS_PLUGIN_SUBSYSTEM, "cos_cache_add_defn - " "cos definition %s supplies its own cosspecifier, rejecting scheme\n",(*dn)->val); ret = -1; } @@ -1376,7 +1376,7 @@ static int cos_cache_add_defn( /* process each template in turn */ - slapi_log_error(SLAPI_LOG_PLUGIN, COS_PLUGIN_SUBSYSTEM, "cos_cache_add_defn - " + slapi_log_err(SLAPI_LOG_PLUGIN, COS_PLUGIN_SUBSYSTEM, "cos_cache_add_defn - " "Processing cosDefinition %s\n",(*dn)->val); while(pTmpTmplDn && cosType != COSTYPE_INDIRECT) @@ -1391,7 +1391,7 @@ static int cos_cache_add_defn( if(tmplCount == 0 && cosType != COSTYPE_INDIRECT) { /* without our golden templates we are nothing - slapi_log_error(SLAPI_LOG_ERR, COS_PLUGIN_SUBSYSTEM, "cos_cache_add_defn -" + slapi_log_err(SLAPI_LOG_ERR, COS_PLUGIN_SUBSYSTEM, "cos_cache_add_defn -" "no templates for cos definition at %s.\n",(*dn)->val);*/ ret = COS_DEF_ERROR_NO_TEMPLATES; } @@ -1436,7 +1436,7 @@ static int cos_cache_add_defn( theDef->pCosOpDefault = *pCosOpDefault; cos_cache_add_ll_entry((void**)pDefs, theDef, NULL); - slapi_log_error(SLAPI_LOG_PLUGIN, COS_PLUGIN_SUBSYSTEM, "cos_cache_add_defn - " + slapi_log_err(SLAPI_LOG_PLUGIN, COS_PLUGIN_SUBSYSTEM, "cos_cache_add_defn - " "Added cosDefinition %s\n",(*dn)->val); } } @@ -1461,7 +1461,7 @@ out: cos_cache_del_attrval_list(pAttrs); } - slapi_log_error(SLAPI_LOG_TRACE, COS_PLUGIN_SUBSYSTEM, "<-- cos_cache_add_defn\n"); + slapi_log_err(SLAPI_LOG_TRACE, COS_PLUGIN_SUBSYSTEM, "<-- cos_cache_add_defn\n"); return ret; } @@ -1472,7 +1472,7 @@ out: */ static void cos_cache_del_attrval_list(cosAttrValue **pVal) { - slapi_log_error(SLAPI_LOG_TRACE, COS_PLUGIN_SUBSYSTEM, "--> cos_cache_del_attrval_list\n"); + slapi_log_err(SLAPI_LOG_TRACE, COS_PLUGIN_SUBSYSTEM, "--> cos_cache_del_attrval_list\n"); while(*pVal) { @@ -1483,7 +1483,7 @@ static void cos_cache_del_attrval_list(cosAttrValue **pVal) *pVal = pTmp; } - slapi_log_error(SLAPI_LOG_TRACE, COS_PLUGIN_SUBSYSTEM, "<-- cos_cache_del_attrval_list\n"); + slapi_log_err(SLAPI_LOG_TRACE, COS_PLUGIN_SUBSYSTEM, "<-- cos_cache_del_attrval_list\n"); } @@ -1498,7 +1498,7 @@ cos_cache_add_attrval(cosAttrValue **attrval, char *val) int ret = 0; cosAttrValue *theVal; - slapi_log_error(SLAPI_LOG_TRACE, COS_PLUGIN_SUBSYSTEM, "--> cos_cache_add_attrval\n"); + slapi_log_err(SLAPI_LOG_TRACE, COS_PLUGIN_SUBSYSTEM, "--> cos_cache_add_attrval\n"); /* create the attrvalue */ theVal = (cosAttrValue*) slapi_ch_malloc(sizeof(cosAttrValue)); @@ -1512,17 +1512,17 @@ cos_cache_add_attrval(cosAttrValue **attrval, char *val) else { slapi_ch_free((void**)&theVal); - slapi_log_error(SLAPI_LOG_ERR, COS_PLUGIN_SUBSYSTEM, "cos_cache_add_attrval - Failed to allocate memory\n"); + slapi_log_err(SLAPI_LOG_ERR, COS_PLUGIN_SUBSYSTEM, "cos_cache_add_attrval - Failed to allocate memory\n"); ret = -1; } } else { - slapi_log_error(SLAPI_LOG_ERR, COS_PLUGIN_SUBSYSTEM, "cos_cache_add_attrval - Failed to allocate memory\n"); + slapi_log_err(SLAPI_LOG_ERR, COS_PLUGIN_SUBSYSTEM, "cos_cache_add_attrval - Failed to allocate memory\n"); ret = -1; } - slapi_log_error(SLAPI_LOG_TRACE, COS_PLUGIN_SUBSYSTEM, "<-- cos_cache_add_attrval\n"); + slapi_log_err(SLAPI_LOG_TRACE, COS_PLUGIN_SUBSYSTEM, "<-- cos_cache_add_attrval\n"); return ret; } @@ -1559,7 +1559,7 @@ static void cos_cache_add_ll_entry(void** attrval, void *theVal, int ( *compare static int call_count = 0; call_count++; - slapi_log_error(SLAPI_LOG_TRACE, COS_PLUGIN_SUBSYSTEM, "--> cos_cache_add_ll_entry - " + slapi_log_err(SLAPI_LOG_TRACE, COS_PLUGIN_SUBSYSTEM, "--> cos_cache_add_ll_entry - " "recursion level %d\n",call_count); @@ -1623,7 +1623,7 @@ static void cos_cache_add_ll_entry(void** attrval, void *theVal, int ( *compare *attrval = theVal; } - slapi_log_error(SLAPI_LOG_TRACE, COS_PLUGIN_SUBSYSTEM, "<-- cos_cache_add_ll_entry - recursion level %d\n",call_count); + slapi_log_err(SLAPI_LOG_TRACE, COS_PLUGIN_SUBSYSTEM, "<-- cos_cache_add_ll_entry - recursion level %d\n",call_count); call_count--; } @@ -1639,7 +1639,7 @@ int cos_cache_getref(cos_cache **pptheCache) static int first_time = 1; cosCache **ppCache = (cosCache**)pptheCache; - slapi_log_error(SLAPI_LOG_TRACE, COS_PLUGIN_SUBSYSTEM, "--> cos_cache_getref\n"); + slapi_log_err(SLAPI_LOG_TRACE, COS_PLUGIN_SUBSYSTEM, "--> cos_cache_getref\n"); if(first_time) { @@ -1651,7 +1651,7 @@ int cos_cache_getref(cos_cache **pptheCache) if(cos_cache_create()) { /* there was a problem or no COS definitions were found */ - slapi_log_error(SLAPI_LOG_PLUGIN, COS_PLUGIN_SUBSYSTEM, "cos_cache_getref - No cos cache created\n"); + slapi_log_err(SLAPI_LOG_PLUGIN, COS_PLUGIN_SUBSYSTEM, "cos_cache_getref - No cos cache created\n"); } } slapi_unlock_mutex(change_lock); @@ -1668,7 +1668,7 @@ int cos_cache_getref(cos_cache **pptheCache) - slapi_log_error(SLAPI_LOG_TRACE, COS_PLUGIN_SUBSYSTEM, "<-- cos_cache_getref\n"); + slapi_log_err(SLAPI_LOG_TRACE, COS_PLUGIN_SUBSYSTEM, "<-- cos_cache_getref\n"); return ret; } @@ -1682,7 +1682,7 @@ int cos_cache_addref(cos_cache *ptheCache) int ret = 0; cosCache *pCache = (cosCache*)ptheCache; - slapi_log_error(SLAPI_LOG_TRACE, COS_PLUGIN_SUBSYSTEM, "--> cos_cache_addref\n"); + slapi_log_err(SLAPI_LOG_TRACE, COS_PLUGIN_SUBSYSTEM, "--> cos_cache_addref\n"); slapi_lock_mutex(cache_lock); @@ -1691,7 +1691,7 @@ int cos_cache_addref(cos_cache *ptheCache) slapi_unlock_mutex(cache_lock); - slapi_log_error(SLAPI_LOG_TRACE, COS_PLUGIN_SUBSYSTEM, "<-- cos_cache_addref\n"); + slapi_log_err(SLAPI_LOG_TRACE, COS_PLUGIN_SUBSYSTEM, "<-- cos_cache_addref\n"); return ret; } @@ -1709,7 +1709,7 @@ int cos_cache_release(cos_cache *ptheCache) int destroy = 0; cosCache *pOldCache = (cosCache*)ptheCache; - slapi_log_error(SLAPI_LOG_TRACE, COS_PLUGIN_SUBSYSTEM, "--> cos_cache_release\n"); + slapi_log_err(SLAPI_LOG_TRACE, COS_PLUGIN_SUBSYSTEM, "--> cos_cache_release\n"); slapi_lock_mutex(cache_lock); @@ -1779,7 +1779,7 @@ int cos_cache_release(cos_cache *ptheCache) slapi_ch_free((void**)&pOldCache); } - slapi_log_error(SLAPI_LOG_TRACE, COS_PLUGIN_SUBSYSTEM, "<-- cos_cache_release\n"); + slapi_log_err(SLAPI_LOG_TRACE, COS_PLUGIN_SUBSYSTEM, "<-- cos_cache_release\n"); return ret; } @@ -1792,7 +1792,7 @@ int cos_cache_release(cos_cache *ptheCache) */ static void cos_cache_del_attr_list(cosAttributes **pAttrs) { - slapi_log_error(SLAPI_LOG_TRACE, COS_PLUGIN_SUBSYSTEM, "--> cos_cache_del_attr_list\n"); + slapi_log_err(SLAPI_LOG_TRACE, COS_PLUGIN_SUBSYSTEM, "--> cos_cache_del_attr_list\n"); while(*pAttrs) { @@ -1805,7 +1805,7 @@ static void cos_cache_del_attr_list(cosAttributes **pAttrs) } - slapi_log_error(SLAPI_LOG_TRACE, COS_PLUGIN_SUBSYSTEM, "<-- cos_cache_del_attr_list\n"); + slapi_log_err(SLAPI_LOG_TRACE, COS_PLUGIN_SUBSYSTEM, "<-- cos_cache_del_attr_list\n"); } @@ -1819,7 +1819,7 @@ static void cos_cache_del_schema(cosCache *pCache) char *pLastName = 0; int attr_index = 0; - slapi_log_error(SLAPI_LOG_TRACE, COS_PLUGIN_SUBSYSTEM, "--> cos_cache_del_schema\n"); + slapi_log_err(SLAPI_LOG_TRACE, COS_PLUGIN_SUBSYSTEM, "--> cos_cache_del_schema\n"); if(pCache && pCache->attrCount && pCache->ppAttrIndex) { @@ -1840,7 +1840,7 @@ static void cos_cache_del_schema(cosCache *pCache) cos_cache_del_attrval_list(&(pCache->ppAttrIndex[0]->pObjectclasses)); } - slapi_log_error(SLAPI_LOG_TRACE, COS_PLUGIN_SUBSYSTEM, "<-- cos_cache_del_schema\n"); + slapi_log_err(SLAPI_LOG_TRACE, COS_PLUGIN_SUBSYSTEM, "<-- cos_cache_del_schema\n"); } @@ -1854,7 +1854,7 @@ static int cos_cache_add_attr(cosAttributes **pAttrs, char *name, cosAttrValue * int ret =0; cosAttributes *theAttr; - slapi_log_error(SLAPI_LOG_TRACE, COS_PLUGIN_SUBSYSTEM, "--> cos_cache_add_attr\n"); + slapi_log_err(SLAPI_LOG_TRACE, COS_PLUGIN_SUBSYSTEM, "--> cos_cache_add_attr\n"); /* create the attribute */ theAttr = (cosAttributes*) slapi_ch_malloc(sizeof(cosAttributes)); @@ -1866,22 +1866,22 @@ static int cos_cache_add_attr(cosAttributes **pAttrs, char *name, cosAttrValue * if(theAttr->pAttrName) { cos_cache_add_ll_entry((void**)pAttrs, theAttr, NULL); - slapi_log_error(SLAPI_LOG_PLUGIN, COS_PLUGIN_SUBSYSTEM, "cos_cache_add_attr - Added attribute %s\n",name); + slapi_log_err(SLAPI_LOG_PLUGIN, COS_PLUGIN_SUBSYSTEM, "cos_cache_add_attr - Added attribute %s\n",name); } else { slapi_ch_free((void**)&theAttr); - slapi_log_error(SLAPI_LOG_ERR, COS_PLUGIN_SUBSYSTEM, "cos_cache_add_attr - Failed to allocate memory\n"); + slapi_log_err(SLAPI_LOG_ERR, COS_PLUGIN_SUBSYSTEM, "cos_cache_add_attr - Failed to allocate memory\n"); ret = -1; } } else { - slapi_log_error(SLAPI_LOG_ERR, COS_PLUGIN_SUBSYSTEM, "cos_cache_add_attr - Failed to allocate memory\n"); + slapi_log_err(SLAPI_LOG_ERR, COS_PLUGIN_SUBSYSTEM, "cos_cache_add_attr - Failed to allocate memory\n"); ret = -1; } - slapi_log_error(SLAPI_LOG_TRACE, COS_PLUGIN_SUBSYSTEM, "<-- cos_cache_add_attr\n"); + slapi_log_err(SLAPI_LOG_TRACE, COS_PLUGIN_SUBSYSTEM, "<-- cos_cache_add_attr\n"); return ret; } @@ -1896,7 +1896,7 @@ static int cos_cache_add_tmpl(cosTemplates **pTemplates, cosAttrValue *dn, cosAt int ret =0; cosTemplates *theTemp; - slapi_log_error(SLAPI_LOG_TRACE, COS_PLUGIN_SUBSYSTEM, "--> cos_cache_add_tmpl\n"); + slapi_log_err(SLAPI_LOG_TRACE, COS_PLUGIN_SUBSYSTEM, "--> cos_cache_add_tmpl\n"); /* create the attribute */ theTemp = (cosTemplates*) slapi_ch_malloc(sizeof(cosTemplates)); @@ -1912,7 +1912,7 @@ static int cos_cache_add_tmpl(cosTemplates **pTemplates, cosAttrValue *dn, cosAt slapi_ch_free_string(&dn->val); dn->val = normed; } else { - slapi_log_error(SLAPI_LOG_ERR, COS_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_ERR, COS_PLUGIN_SUBSYSTEM, "cos_cache_add_tmpl - Failed to normalize dn %s. " "Processing the pre normalized dn.\n", dn->val); @@ -2006,7 +2006,7 @@ static int cos_cache_add_tmpl(cosTemplates **pTemplates, cosAttrValue *dn, cosAt else { /* mmm, should never get here, it means the dn is whacky */ - slapi_log_error(SLAPI_LOG_ERR, COS_PLUGIN_SUBSYSTEM, "cos_cache_add_tmpl - Malformed dn detected: %s\n",dn->val); + slapi_log_err(SLAPI_LOG_ERR, COS_PLUGIN_SUBSYSTEM, "cos_cache_add_tmpl - Malformed dn detected: %s\n",dn->val); grade[0] = '\0'; } @@ -2025,17 +2025,17 @@ static int cos_cache_add_tmpl(cosTemplates **pTemplates, cosAttrValue *dn, cosAt } cos_cache_add_ll_entry((void**)pTemplates, theTemp, NULL); - slapi_log_error(SLAPI_LOG_PLUGIN, COS_PLUGIN_SUBSYSTEM, "cos_cache_add_tmpl - Added template %s\n",dn->val); + slapi_log_err(SLAPI_LOG_PLUGIN, COS_PLUGIN_SUBSYSTEM, "cos_cache_add_tmpl - Added template %s\n",dn->val); slapi_ch_free((void**)&grade); } else { - slapi_log_error(SLAPI_LOG_ERR, COS_PLUGIN_SUBSYSTEM, "cos_cache_add_tmpl - Failed to allocate memory\n"); + slapi_log_err(SLAPI_LOG_ERR, COS_PLUGIN_SUBSYSTEM, "cos_cache_add_tmpl - Failed to allocate memory\n"); ret = -1; } - slapi_log_error(SLAPI_LOG_TRACE, COS_PLUGIN_SUBSYSTEM, "<-- cos_cache_add_tmpl\n"); + slapi_log_err(SLAPI_LOG_TRACE, COS_PLUGIN_SUBSYSTEM, "<-- cos_cache_add_tmpl\n"); return ret; } @@ -2054,7 +2054,7 @@ static int cos_cache_attrval_exists(cosAttrValue *pAttrs, const char *val) { int ret = 0; - slapi_log_error(SLAPI_LOG_TRACE, COS_PLUGIN_SUBSYSTEM, "--> cos_cache_attrval_exists\n"); + slapi_log_err(SLAPI_LOG_TRACE, COS_PLUGIN_SUBSYSTEM, "--> cos_cache_attrval_exists\n"); while(pAttrs) { @@ -2067,7 +2067,7 @@ static int cos_cache_attrval_exists(cosAttrValue *pAttrs, const char *val) pAttrs = pAttrs->list.pNext; } - slapi_log_error(SLAPI_LOG_TRACE, COS_PLUGIN_SUBSYSTEM, "<-- cos_cache_attrval_exists\n"); + slapi_log_err(SLAPI_LOG_TRACE, COS_PLUGIN_SUBSYSTEM, "<-- cos_cache_attrval_exists\n"); return ret; } @@ -2079,12 +2079,12 @@ static int cos_cache_vattr_get(vattr_sp_handle *handle, vattr_context *c, Slapi_ int indirect_cos = 0; int ret = -1; - slapi_log_error(SLAPI_LOG_TRACE, COS_PLUGIN_SUBSYSTEM, "--> cos_cache_vattr_get\n"); + slapi_log_err(SLAPI_LOG_TRACE, COS_PLUGIN_SUBSYSTEM, "--> cos_cache_vattr_get\n"); if(cos_cache_getref(&pCache) < 1) { /* problems we are hosed */ - slapi_log_error(SLAPI_LOG_PLUGIN, COS_PLUGIN_SUBSYSTEM, "cos_cache_vattr_get - " + slapi_log_err(SLAPI_LOG_PLUGIN, COS_PLUGIN_SUBSYSTEM, "cos_cache_vattr_get - " "Failed to get class of service reference\n"); goto bail; } @@ -2105,7 +2105,7 @@ static int cos_cache_vattr_get(vattr_sp_handle *handle, vattr_context *c, Slapi_ bail: - slapi_log_error(SLAPI_LOG_TRACE, COS_PLUGIN_SUBSYSTEM, "<-- cos_cache_vattr_get\n"); + slapi_log_err(SLAPI_LOG_TRACE, COS_PLUGIN_SUBSYSTEM, "<-- cos_cache_vattr_get\n"); return ret; } @@ -2115,12 +2115,12 @@ static int cos_cache_vattr_compare(vattr_sp_handle *handle, vattr_context *c, Sl int ret = -1; cos_cache *pCache = 0; - slapi_log_error(SLAPI_LOG_TRACE, COS_PLUGIN_SUBSYSTEM, "--> cos_cache_vattr_compare\n"); + slapi_log_err(SLAPI_LOG_TRACE, COS_PLUGIN_SUBSYSTEM, "--> cos_cache_vattr_compare\n"); if(cos_cache_getref(&pCache) < 1) { /* problems we are hosed */ - slapi_log_error(SLAPI_LOG_PLUGIN, COS_PLUGIN_SUBSYSTEM, "cos_cache_vattr_compare - Failed to get class of service reference\n"); + slapi_log_err(SLAPI_LOG_PLUGIN, COS_PLUGIN_SUBSYSTEM, "cos_cache_vattr_compare - Failed to get class of service reference\n"); goto bail; } @@ -2130,7 +2130,7 @@ static int cos_cache_vattr_compare(vattr_sp_handle *handle, vattr_context *c, Sl bail: - slapi_log_error(SLAPI_LOG_TRACE, COS_PLUGIN_SUBSYSTEM, "<-- cos_cache_vattr_compare\n"); + slapi_log_err(SLAPI_LOG_TRACE, COS_PLUGIN_SUBSYSTEM, "<-- cos_cache_vattr_compare\n"); return ret; } @@ -2147,12 +2147,12 @@ static int cos_cache_vattr_types(vattr_sp_handle *handle,Slapi_Entry *e, char *lastattr = "thisisfakeforcos"; int props = 0; - slapi_log_error(SLAPI_LOG_TRACE, COS_PLUGIN_SUBSYSTEM, "--> cos_cache_vattr_types\n"); + slapi_log_err(SLAPI_LOG_TRACE, COS_PLUGIN_SUBSYSTEM, "--> cos_cache_vattr_types\n"); if(cos_cache_getref((cos_cache **)&pCache) < 1) { /* problems we are hosed */ - slapi_log_error(SLAPI_LOG_PLUGIN, COS_PLUGIN_SUBSYSTEM, "cos_cache_vattr_types - Failed to get class of service reference\n"); + slapi_log_err(SLAPI_LOG_PLUGIN, COS_PLUGIN_SUBSYSTEM, "cos_cache_vattr_types - Failed to get class of service reference\n"); goto bail; } @@ -2182,7 +2182,7 @@ static int cos_cache_vattr_types(vattr_sp_handle *handle,Slapi_Entry *e, bail: -slapi_log_error(SLAPI_LOG_TRACE, COS_PLUGIN_SUBSYSTEM, "<-- cos_cache_vattr_types\n"); +slapi_log_err(SLAPI_LOG_TRACE, COS_PLUGIN_SUBSYSTEM, "<-- cos_cache_vattr_types\n"); return ret; } @@ -2229,7 +2229,7 @@ static int cos_cache_query_attr(cos_cache *ptheCache, vattr_context *context, int entry_has_value = 0; int merge_mode = 0; - slapi_log_error(SLAPI_LOG_TRACE, COS_PLUGIN_SUBSYSTEM, "--> cos_cache_query_attr\n"); + slapi_log_err(SLAPI_LOG_TRACE, COS_PLUGIN_SUBSYSTEM, "--> cos_cache_query_attr\n"); if(out_attr) @@ -2292,7 +2292,7 @@ static int cos_cache_query_attr(cos_cache *ptheCache, vattr_context *context, if(pDn == 0) { - slapi_log_error(SLAPI_LOG_ERR, COS_PLUGIN_SUBSYSTEM, "cos_cache_query_attr - Failed to get entry dn\n"); + slapi_log_err(SLAPI_LOG_ERR, COS_PLUGIN_SUBSYSTEM, "cos_cache_query_attr - Failed to get entry dn\n"); ret = 1; goto bail; } @@ -2307,13 +2307,13 @@ static int cos_cache_query_attr(cos_cache *ptheCache, vattr_context *context, if(slapi_entry_attr_find( e, "objectclass", &pObjclasses )) { - slapi_log_error(SLAPI_LOG_ERR, COS_PLUGIN_SUBSYSTEM, "cos_cache_query_attr - Failed to get objectclass from %s\n",pDn); + slapi_log_err(SLAPI_LOG_ERR, COS_PLUGIN_SUBSYSTEM, "cos_cache_query_attr - Failed to get objectclass from %s\n",pDn); goto bail; } if(!cos_cache_schema_check(pCache, attr_index, pObjclasses)) { - slapi_log_error(SLAPI_LOG_ERR, COS_PLUGIN_SUBSYSTEM, "cos_cache_query_attr - cos attribute %s failed schema check on dn: %s\n",type,pDn); + slapi_log_err(SLAPI_LOG_ERR, COS_PLUGIN_SUBSYSTEM, "cos_cache_query_attr - cos attribute %s failed schema check on dn: %s\n",type,pDn); goto bail; } } @@ -2481,7 +2481,7 @@ static int cos_cache_query_attr(cos_cache *ptheCache, vattr_context *context, hit = 1; else { - slapi_log_error(SLAPI_LOG_ERR, COS_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_ERR, COS_PLUGIN_SUBSYSTEM, "cos_cache_query_attr - Could not create values to return\n"); goto bail; } @@ -2565,7 +2565,7 @@ static int cos_cache_query_attr(cos_cache *ptheCache, vattr_context *context, hit = 1; else { - slapi_log_error(SLAPI_LOG_ERR, COS_PLUGIN_SUBSYSTEM, "cos_cache_query_attr - " + slapi_log_err(SLAPI_LOG_ERR, COS_PLUGIN_SUBSYSTEM, "cos_cache_query_attr - " "Could not create values to return\n"); goto bail; } @@ -2611,7 +2611,7 @@ static int cos_cache_query_attr(cos_cache *ptheCache, vattr_context *context, bail: - slapi_log_error(SLAPI_LOG_TRACE, COS_PLUGIN_SUBSYSTEM, "<-- cos_cache_query_attr\n"); + slapi_log_err(SLAPI_LOG_TRACE, COS_PLUGIN_SUBSYSTEM, "<-- cos_cache_query_attr\n"); return ret; } @@ -2627,7 +2627,7 @@ static int cos_cache_find_attr(cosCache *pCache, char *type) int ret = -1; /* assume failure */ cosAttributes attr; - slapi_log_error(SLAPI_LOG_TRACE, COS_PLUGIN_SUBSYSTEM, "--> cos_cache_find_attr\n"); + slapi_log_err(SLAPI_LOG_TRACE, COS_PLUGIN_SUBSYSTEM, "--> cos_cache_find_attr\n"); attr.pAttrName = type; @@ -2642,7 +2642,7 @@ static int cos_cache_find_attr(cosCache *pCache, char *type) } } - slapi_log_error(SLAPI_LOG_TRACE, COS_PLUGIN_SUBSYSTEM, "<-- cos_cache_find_attr\n"); + slapi_log_err(SLAPI_LOG_TRACE, COS_PLUGIN_SUBSYSTEM, "<-- cos_cache_find_attr\n"); return ret; } @@ -2661,7 +2661,7 @@ static int cos_cache_schema_check(cosCache *pCache, int attr_index, Slapi_Attr * Slapi_Value *val; int hint; - slapi_log_error(SLAPI_LOG_TRACE, COS_PLUGIN_SUBSYSTEM, "--> cos_cache_schema_check\n"); + slapi_log_err(SLAPI_LOG_TRACE, COS_PLUGIN_SUBSYSTEM, "--> cos_cache_schema_check\n"); hint = slapi_attr_first_value( pObjclasses, &val ); while(hint != -1) @@ -2673,7 +2673,7 @@ static int cos_cache_schema_check(cosCache *pCache, int attr_index, Slapi_Attr * hint = slapi_attr_next_value( pObjclasses, hint, &val ); } - slapi_log_error(SLAPI_LOG_TRACE, COS_PLUGIN_SUBSYSTEM, "<-- cos_cache_schema_check\n"); + slapi_log_err(SLAPI_LOG_TRACE, COS_PLUGIN_SUBSYSTEM, "<-- cos_cache_schema_check\n"); return ret; } @@ -2691,7 +2691,7 @@ static int cos_cache_schema_build(cosCache *pCache) cosAttrValue *pLastRef = 0; int attr_index = 0; - slapi_log_error(SLAPI_LOG_TRACE, COS_PLUGIN_SUBSYSTEM, "--> cos_cache_schema_build\n"); + slapi_log_err(SLAPI_LOG_TRACE, COS_PLUGIN_SUBSYSTEM, "--> cos_cache_schema_build\n"); if(!config_get_schemacheck()) ret = 0; @@ -2771,7 +2771,7 @@ static int cos_cache_schema_build(cosCache *pCache) } } - slapi_log_error(SLAPI_LOG_TRACE, COS_PLUGIN_SUBSYSTEM, "<-- cos_cache_schema_build\n"); + slapi_log_err(SLAPI_LOG_TRACE, COS_PLUGIN_SUBSYSTEM, "<-- cos_cache_schema_build\n"); return ret; } @@ -2797,7 +2797,7 @@ static int cos_cache_index_all(cosCache *pCache) { int ret = -1; - slapi_log_error(SLAPI_LOG_TRACE, COS_PLUGIN_SUBSYSTEM, "--> cos_cache_index_all\n"); + slapi_log_err(SLAPI_LOG_TRACE, COS_PLUGIN_SUBSYSTEM, "--> cos_cache_index_all\n"); /* first fixup the index array so we can use qsort() @@ -2886,7 +2886,7 @@ static int cos_cache_index_all(cosCache *pCache) slapi_ch_free_string(&pAttrVal->val); pAttrVal->val = normed; } else { - slapi_log_error(SLAPI_LOG_ERR, COS_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_ERR, COS_PLUGIN_SUBSYSTEM, "cos_cache_index_all - Failed to normalize dn %s. " "Processing the pre normalized dn.\n", pAttrVal->val); @@ -2958,7 +2958,7 @@ static int cos_cache_index_all(cosCache *pCache) pCache->templateCount = actualCount; - slapi_log_error(SLAPI_LOG_PLUGIN, COS_PLUGIN_SUBSYSTEM, "cos_cache_index_all - cos cache index built\n"); + slapi_log_err(SLAPI_LOG_PLUGIN, COS_PLUGIN_SUBSYSTEM, "cos_cache_index_all - cos cache index built\n"); ret = 0; } @@ -2970,14 +2970,14 @@ static int cos_cache_index_all(cosCache *pCache) if(pCache->ppTemplateList) slapi_ch_free((void**)(&pCache->ppTemplateList)); - slapi_log_error(SLAPI_LOG_ERR, COS_PLUGIN_SUBSYSTEM, "cos_cache_index_all - " + slapi_log_err(SLAPI_LOG_ERR, COS_PLUGIN_SUBSYSTEM, "cos_cache_index_all - " "Failed to allocate index memory\n"); } } else - slapi_log_error(SLAPI_LOG_PLUGIN, COS_PLUGIN_SUBSYSTEM, "cos_cache_index_all - No attributes to index\n"); + slapi_log_err(SLAPI_LOG_PLUGIN, COS_PLUGIN_SUBSYSTEM, "cos_cache_index_all - No attributes to index\n"); - slapi_log_error(SLAPI_LOG_TRACE, COS_PLUGIN_SUBSYSTEM, "<-- cos_cache_index_all\n"); + slapi_log_err(SLAPI_LOG_TRACE, COS_PLUGIN_SUBSYSTEM, "<-- cos_cache_index_all\n"); return ret; } @@ -3005,7 +3005,7 @@ static int cos_cache_total_attr_count(cosCache *pCache) int count = 0; cosDefinitions *pDef = pCache->pDefs; - slapi_log_error(SLAPI_LOG_TRACE, COS_PLUGIN_SUBSYSTEM, "--> cos_cache_total_attr_count\n"); + slapi_log_err(SLAPI_LOG_TRACE, COS_PLUGIN_SUBSYSTEM, "--> cos_cache_total_attr_count\n"); pCache->templateCount = 0; @@ -3030,7 +3030,7 @@ static int cos_cache_total_attr_count(cosCache *pCache) pDef = pDef->list.pNext; } - slapi_log_error(SLAPI_LOG_TRACE, COS_PLUGIN_SUBSYSTEM, "<-- cos_cache_total_attr_count\n"); + slapi_log_err(SLAPI_LOG_TRACE, COS_PLUGIN_SUBSYSTEM, "<-- cos_cache_total_attr_count\n"); return count; } @@ -3097,7 +3097,7 @@ static int cos_cache_template_index_bsearch(const char *dn) int ret = 0; cosCache *pCache; - slapi_log_error(SLAPI_LOG_TRACE, COS_PLUGIN_SUBSYSTEM, "--> cos_cache_template_index_bsearch\n"); + slapi_log_err(SLAPI_LOG_TRACE, COS_PLUGIN_SUBSYSTEM, "--> cos_cache_template_index_bsearch\n"); if(-1 != cos_cache_getref((cos_cache**)&pCache)) { @@ -3107,7 +3107,7 @@ static int cos_cache_template_index_bsearch(const char *dn) cos_cache_release((cos_cache*)pCache); } - slapi_log_error(SLAPI_LOG_TRACE, COS_PLUGIN_SUBSYSTEM, "<-- cos_cache_template_index_bsearch\n"); + slapi_log_err(SLAPI_LOG_TRACE, COS_PLUGIN_SUBSYSTEM, "<-- cos_cache_template_index_bsearch\n"); return ret; } @@ -3125,7 +3125,7 @@ static int cos_cache_attr_index_bsearch( const cosCache *pCache, const cosAttrib int ret = -1; int index = 0; - slapi_log_error(SLAPI_LOG_TRACE, COS_PLUGIN_SUBSYSTEM, "--> cos_cache_attr_index_bsearch\n"); + slapi_log_err(SLAPI_LOG_TRACE, COS_PLUGIN_SUBSYSTEM, "--> cos_cache_attr_index_bsearch\n"); if(upper >= lower) { @@ -3169,7 +3169,7 @@ static int cos_cache_attr_index_bsearch( const cosCache *pCache, const cosAttrib else index = -1; - slapi_log_error(SLAPI_LOG_TRACE, COS_PLUGIN_SUBSYSTEM, "<-- cos_cache_attr_index_bsearch\n"); + slapi_log_err(SLAPI_LOG_TRACE, COS_PLUGIN_SUBSYSTEM, "<-- cos_cache_attr_index_bsearch\n"); return index; } @@ -3181,7 +3181,7 @@ static int cos_cache_cmp_attr(cosAttributes *pAttr, Slapi_Value *test_this, int cosAttrValue *pAttrVal = pAttr->pAttrValue; char *the_cmp = (char *)slapi_value_get_string(test_this); - slapi_log_error(SLAPI_LOG_TRACE, COS_PLUGIN_SUBSYSTEM, "--> cos_cache_cmp_attr\n"); + slapi_log_err(SLAPI_LOG_TRACE, COS_PLUGIN_SUBSYSTEM, "--> cos_cache_cmp_attr\n"); *result = 0; @@ -3199,7 +3199,7 @@ static int cos_cache_cmp_attr(cosAttributes *pAttr, Slapi_Value *test_this, int index++; } - slapi_log_error(SLAPI_LOG_TRACE, COS_PLUGIN_SUBSYSTEM, "<-- cos_cache_cmp_attr\n"); + slapi_log_err(SLAPI_LOG_TRACE, COS_PLUGIN_SUBSYSTEM, "<-- cos_cache_cmp_attr\n"); return ret; } @@ -3218,7 +3218,7 @@ static int cos_cache_cos_2_slapi_valueset(cosAttributes *pAttr, Slapi_ValueSet * static Slapi_Attr *attr = 0; /* allocated once, never freed */ static int done_once = 0; - slapi_log_error(SLAPI_LOG_TRACE, COS_PLUGIN_SUBSYSTEM, "--> cos_cache_cos_2_slapi_valueset\n"); + slapi_log_err(SLAPI_LOG_TRACE, COS_PLUGIN_SUBSYSTEM, "--> cos_cache_cos_2_slapi_valueset\n"); /* test out_vs for existing values */ if(*out_vs) @@ -3252,7 +3252,7 @@ static int cos_cache_cos_2_slapi_valueset(cosAttributes *pAttr, Slapi_ValueSet * } else { - slapi_log_error(SLAPI_LOG_ERR, COS_PLUGIN_SUBSYSTEM, "cos_cache_cos_2_slapi_valueset - " + slapi_log_err(SLAPI_LOG_ERR, COS_PLUGIN_SUBSYSTEM, "cos_cache_cos_2_slapi_valueset - " "Memory allocation error\n"); ret = -1; goto bail; @@ -3264,14 +3264,14 @@ static int cos_cache_cos_2_slapi_valueset(cosAttributes *pAttr, Slapi_ValueSet * } else { - slapi_log_error(SLAPI_LOG_ERR, COS_PLUGIN_SUBSYSTEM, "cos_cache_cos_2_slapi_valueset - " + slapi_log_err(SLAPI_LOG_ERR, COS_PLUGIN_SUBSYSTEM, "cos_cache_cos_2_slapi_valueset - " "Memory allocation error\n"); ret = -1; } bail: - slapi_log_error(SLAPI_LOG_TRACE, COS_PLUGIN_SUBSYSTEM, "<-- cos_cache_cos_2_slapi_valueset\n"); + slapi_log_err(SLAPI_LOG_TRACE, COS_PLUGIN_SUBSYSTEM, "<-- cos_cache_cos_2_slapi_valueset\n"); return ret; } @@ -3307,7 +3307,7 @@ void cos_cache_change_notify(Slapi_PBlock *pb) int rc = 0; int optype = -1; - slapi_log_error(SLAPI_LOG_TRACE, COS_PLUGIN_SUBSYSTEM, "--> cos_cache_change_notify\n"); + slapi_log_err(SLAPI_LOG_TRACE, COS_PLUGIN_SUBSYSTEM, "--> cos_cache_change_notify\n"); /* Don't update local cache when remote entries are updated. */ slapi_pblock_get( pb, SLAPI_BACKEND, &be ); @@ -3318,7 +3318,7 @@ void cos_cache_change_notify(Slapi_PBlock *pb) /* need to work out if a cache rebuild is necessary */ if(slapi_pblock_get( pb, SLAPI_TARGET_SDN, &sdn )) { - slapi_log_error(SLAPI_LOG_ERR, COS_PLUGIN_SUBSYSTEM, "cos_cache_change_notify - " + slapi_log_err(SLAPI_LOG_ERR, COS_PLUGIN_SUBSYSTEM, "cos_cache_change_notify - " "Failed to get dn of changed entry\n"); goto bail; } @@ -3373,7 +3373,7 @@ void cos_cache_change_notify(Slapi_PBlock *pb) * stays lean in the face of errors. */ if( !do_update && cos_cache_template_index_bsearch(dn)) { - slapi_log_error(SLAPI_LOG_PLUGIN, COS_PLUGIN_SUBSYSTEM, "cos_cache_change_notify - " + slapi_log_err(SLAPI_LOG_PLUGIN, COS_PLUGIN_SUBSYSTEM, "cos_cache_change_notify - " "Updating due to indirect template change(%s)\n", dn); do_update = 1; } @@ -3388,7 +3388,7 @@ void cos_cache_change_notify(Slapi_PBlock *pb) } bail: - slapi_log_error(SLAPI_LOG_TRACE, COS_PLUGIN_SUBSYSTEM, "<-- cos_cache_change_notify\n"); + slapi_log_err(SLAPI_LOG_TRACE, COS_PLUGIN_SUBSYSTEM, "<-- cos_cache_change_notify\n"); } /* @@ -3398,7 +3398,7 @@ bail: */ void cos_cache_stop(void) { - slapi_log_error(SLAPI_LOG_TRACE, COS_PLUGIN_SUBSYSTEM, "--> cos_cache_stop\n"); + slapi_log_err(SLAPI_LOG_TRACE, COS_PLUGIN_SUBSYSTEM, "--> cos_cache_stop\n"); /* first deregister our state change func */ slapi_unregister_backend_state_change((void *)cos_cache_backend_state_change); @@ -3423,7 +3423,7 @@ void cos_cache_stop(void) slapi_destroy_condvar(start_cond); start_cond = NULL; slapi_destroy_mutex(start_lock); start_lock = NULL; - slapi_log_error(SLAPI_LOG_TRACE, COS_PLUGIN_SUBSYSTEM, "<-- cos_cache_stop\n"); + slapi_log_err(SLAPI_LOG_TRACE, COS_PLUGIN_SUBSYSTEM, "<-- cos_cache_stop\n"); } /* @@ -3443,7 +3443,7 @@ static int cos_cache_backwards_stricmp_and_clip(char*s1,char*s2) s1len = strlen(s1); s2len = strlen(s2); - slapi_log_error(SLAPI_LOG_TRACE, COS_PLUGIN_SUBSYSTEM, "--> cos_cache_backwards_stricmp_and_clip - s1 %d s2 %d\n",s1len,s2len); + slapi_log_err(SLAPI_LOG_TRACE, COS_PLUGIN_SUBSYSTEM, "--> cos_cache_backwards_stricmp_and_clip - s1 %d s2 %d\n",s1len,s2len); if(s1len > s2len && s2len > 0) { @@ -3470,7 +3470,7 @@ static int cos_cache_backwards_stricmp_and_clip(char*s1,char*s2) } } - slapi_log_error(SLAPI_LOG_TRACE, COS_PLUGIN_SUBSYSTEM, "<-- cos_cache_backwards_stricmp_and_clip\n"); + slapi_log_err(SLAPI_LOG_TRACE, COS_PLUGIN_SUBSYSTEM, "<-- cos_cache_backwards_stricmp_and_clip\n"); return ret; } @@ -3580,14 +3580,14 @@ static int cos_cache_entry_is_cos_related( Slapi_Entry *e) { Slapi_Attr *pObjclasses = NULL; if ( e == NULL ) { - slapi_log_error(SLAPI_LOG_ERR, COS_PLUGIN_SUBSYSTEM, "cos_cache_entry_is_cos_related - " + slapi_log_err(SLAPI_LOG_ERR, COS_PLUGIN_SUBSYSTEM, "cos_cache_entry_is_cos_related - " "Modified entry is NULL--updating cache just in case\n"); rc = 1; } else { if(slapi_entry_attr_find( e, "objectclass", &pObjclasses )) { - slapi_log_error(SLAPI_LOG_ERR, COS_PLUGIN_SUBSYSTEM, "cos_cache_entry_is_cos_related - " + slapi_log_err(SLAPI_LOG_ERR, COS_PLUGIN_SUBSYSTEM, "cos_cache_entry_is_cos_related - " "Failed to get objectclass from %s\n", slapi_entry_get_dn(e)); rc = 0; diff --git a/ldap/servers/plugins/cos/cos_cache.h b/ldap/servers/plugins/cos/cos_cache.h index 34bcd59..0151f66 100644 --- a/ldap/servers/plugins/cos/cos_cache.h +++ b/ldap/servers/plugins/cos/cos_cache.h @@ -11,8 +11,6 @@ # include #endif -#include "ldaplog.h" - #if !defined( _COS_CACHE_H ) #define _COS_CACHE_H diff --git a/ldap/servers/plugins/deref/deref.c b/ldap/servers/plugins/deref/deref.c index a23ece3..b5dec11 100644 --- a/ldap/servers/plugins/deref/deref.c +++ b/ldap/servers/plugins/deref/deref.c @@ -157,7 +157,7 @@ deref_init(Slapi_PBlock *pb) int status = 0; char *plugin_identity = NULL; - slapi_log_error(SLAPI_LOG_TRACE, DEREF_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_TRACE, DEREF_PLUGIN_SUBSYSTEM, "--> deref_init\n"); /* Store the plugin identity for later use. @@ -181,7 +181,7 @@ deref_init(Slapi_PBlock *pb) (void *) deref_pre_entry) != 0 || deref_register_operation_extension() ) { - slapi_log_error(SLAPI_LOG_ERR, DEREF_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_ERR, DEREF_PLUGIN_SUBSYSTEM, "deref_init - Failed to register plugin\n"); status = -1; } @@ -190,7 +190,7 @@ deref_init(Slapi_PBlock *pb) slapi_register_supported_control(LDAP_CONTROL_X_DEREF, SLAPI_OPERATION_SEARCH); } - slapi_log_error(SLAPI_LOG_TRACE, DEREF_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_TRACE, DEREF_PLUGIN_SUBSYSTEM, "<-- deref_init\n"); return status; } @@ -204,13 +204,13 @@ deref_init(Slapi_PBlock *pb) static int deref_start(Slapi_PBlock * pb) { - slapi_log_error(SLAPI_LOG_TRACE, DEREF_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_TRACE, DEREF_PLUGIN_SUBSYSTEM, "--> deref_start\n"); - slapi_log_error(SLAPI_LOG_PLUGIN, DEREF_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_PLUGIN, DEREF_PLUGIN_SUBSYSTEM, "deref_start - Ready for service\n"); - slapi_log_error(SLAPI_LOG_TRACE, DEREF_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_TRACE, DEREF_PLUGIN_SUBSYSTEM, "<-- deref_start\n"); return 0; @@ -224,10 +224,10 @@ deref_start(Slapi_PBlock * pb) static int deref_close(Slapi_PBlock * pb) { - slapi_log_error(SLAPI_LOG_TRACE, DEREF_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_TRACE, DEREF_PLUGIN_SUBSYSTEM, "--> deref_close\n"); - slapi_log_error(SLAPI_LOG_TRACE, DEREF_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_TRACE, DEREF_PLUGIN_SUBSYSTEM, "<-- deref_close\n"); return 0; @@ -414,7 +414,7 @@ deref_pre_search(Slapi_PBlock *pb) int ii; int iscritical = 0; - slapi_log_error(SLAPI_LOG_TRACE, DEREF_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_TRACE, DEREF_PLUGIN_SUBSYSTEM, "--> deref_pre_search\n"); /* see if the deref request control is in the list of @@ -424,25 +424,25 @@ deref_pre_search(Slapi_PBlock *pb) const LDAPControl *ctrl = reqctrls[ii]; if (!strcmp(ctrl->ldctl_oid, LDAP_CONTROL_X_DEREF)) { if (derefctrl) { /* already specified */ - slapi_log_error(SLAPI_LOG_ERR, DEREF_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_ERR, DEREF_PLUGIN_SUBSYSTEM, "deref_pre_search - The dereference control was specified more than once - it must be specified only once in the search request\n"); ldapcode = LDAP_PROTOCOL_ERROR; ldaperrtext = "The dereference control cannot be specified more than once"; derefctrl = NULL; } else if (!ctrl->ldctl_value.bv_len) { - slapi_log_error(SLAPI_LOG_ERR, DEREF_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_ERR, DEREF_PLUGIN_SUBSYSTEM, "deref_pre_search - No control value specified for dereference control\n"); ldapcode = LDAP_PROTOCOL_ERROR; ldaperrtext = "The dereference control must have a value"; iscritical = ctrl->ldctl_iscritical; } else if (!ctrl->ldctl_value.bv_val) { - slapi_log_error(SLAPI_LOG_ERR, DEREF_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_ERR, DEREF_PLUGIN_SUBSYSTEM, "deref_pre_search - No control value specified for dereference control\n"); ldapcode = LDAP_PROTOCOL_ERROR; ldaperrtext = "The dereference control must have a value"; iscritical = ctrl->ldctl_iscritical; } else if (!ctrl->ldctl_value.bv_val[0] || !ctrl->ldctl_value.bv_len) { - slapi_log_error(SLAPI_LOG_ERR, DEREF_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_ERR, DEREF_PLUGIN_SUBSYSTEM, "deref_pre_search - Empty control value specified for dereference control\n"); ldapcode = LDAP_PROTOCOL_ERROR; ldaperrtext = "The dereference control must have a non-empty value"; @@ -457,7 +457,7 @@ deref_pre_search(Slapi_PBlock *pb) } if (derefctrl && incompatible) { - slapi_log_error(SLAPI_LOG_ERR, DEREF_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_ERR, DEREF_PLUGIN_SUBSYSTEM, "deref_pre_search - Cannot use the dereference control and control [%s] for the same search operation\n", incompatible); /* not sure if this is a hard failure - the current spec says: @@ -495,7 +495,7 @@ deref_pre_search(Slapi_PBlock *pb) deref_set_operation_extension(pb, speclist); } - slapi_log_error(SLAPI_LOG_TRACE, DEREF_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_TRACE, DEREF_PLUGIN_SUBSYSTEM, "<-- deref_pre_search\n"); return ldapcode; @@ -529,7 +529,7 @@ deref_check_access(Slapi_PBlock *pb, const Slapi_Entry *ent, const char *entdn, /* first, check access control - see if client can read the requested attribute */ int ret = slapi_access_allowed(pb, etest, (char *)attrname, NULL, rights); if (ret != LDAP_SUCCESS) { - slapi_log_error(SLAPI_LOG_PLUGIN, DEREF_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_PLUGIN, DEREF_PLUGIN_SUBSYSTEM, "deref_check_access - The client does not have permission to read attribute %s in entry %s\n", attrname, slapi_entry_get_dn_const(etest)); } else { @@ -589,7 +589,7 @@ deref_do_deref_attr(Slapi_PBlock *pb, BerElement *ctrlber, const char *derefdn, if (entries) { if (entries[1]) { /* too many entries */ - slapi_log_error(SLAPI_LOG_PLUGIN, DEREF_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_PLUGIN, DEREF_PLUGIN_SUBSYSTEM, "deref_do_deref_attr - More than one entry matching DN [%s]\n", derefdn); } else { @@ -597,7 +597,7 @@ deref_do_deref_attr(Slapi_PBlock *pb, BerElement *ctrlber, const char *derefdn, int needattrvals = 1; /* need attrvals sequence? */ if (deref_check_access(pb, entries[0], derefdn, attrs, &retattrs, (SLAPI_ACL_SEARCH|SLAPI_ACL_READ))) { - slapi_log_error(SLAPI_LOG_PLUGIN, DEREF_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_PLUGIN, DEREF_PLUGIN_SUBSYSTEM, "deref_do_deref_attr - The client does not have permission to read the requested " "attributes in entry %s\n", derefdn); } else { @@ -615,7 +615,7 @@ deref_do_deref_attr(Slapi_PBlock *pb, BerElement *ctrlber, const char *derefdn, #if defined(USE_OLD_UNHASHED) if (is_type_forbidden(retattrs[ii])) { - slapi_log_error(SLAPI_LOG_PLUGIN, DEREF_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_PLUGIN, DEREF_PLUGIN_SUBSYSTEM, "deref_do_deref_attr - skip forbidden attribute [%s]\n", derefdn); continue; } @@ -663,12 +663,12 @@ deref_do_deref_attr(Slapi_PBlock *pb, BerElement *ctrlber, const char *derefdn, } } } else { /* nothing */ - slapi_log_error(SLAPI_LOG_PLUGIN, DEREF_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_PLUGIN, DEREF_PLUGIN_SUBSYSTEM, "deref_do_deref_attr - No entries matching [%s]\n", derefdn); } } else { /* handle error */ - slapi_log_error(SLAPI_LOG_PLUGIN, DEREF_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_PLUGIN, DEREF_PLUGIN_SUBSYSTEM, "deref_do_deref_attr - Could not read entry with DN [%s]: error %d:%s\n", derefdn, rc, ldap_err2string(rc)); } @@ -715,7 +715,7 @@ deref_pre_entry(Slapi_PBlock *pb) if (deref_check_access(pb, ent, NULL, attrs, &retattrs, (SLAPI_ACL_SEARCH|SLAPI_ACL_READ))) { - slapi_log_error(SLAPI_LOG_PLUGIN, DEREF_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_PLUGIN, DEREF_PLUGIN_SUBSYSTEM, "deref_pre_entry - The client does not have permission to read attribute %s in entry %s\n", spec->derefattr, slapi_entry_get_dn_const(ent)); continue; diff --git a/ldap/servers/plugins/dna/dna.c b/ldap/servers/plugins/dna/dna.c index e5556e2..54bbe86 100644 --- a/ldap/servers/plugins/dna/dna.c +++ b/ldap/servers/plugins/dna/dna.c @@ -438,7 +438,7 @@ dna_init(Slapi_PBlock *pb) int preadd = SLAPI_PLUGIN_BE_PRE_ADD_FN; int premod = SLAPI_PLUGIN_BE_PRE_MODIFY_FN; - slapi_log_error(SLAPI_LOG_TRACE, DNA_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_TRACE, DNA_PLUGIN_SUBSYSTEM, "--> dna_init\n"); /** @@ -460,7 +460,7 @@ dna_init(Slapi_PBlock *pb) (void *) &pdesc) != 0 || slapi_pblock_set(pb, premod, (void *) dna_mod_pre_op) != 0 || slapi_pblock_set(pb, preadd, (void *) dna_add_pre_op) != 0) { - slapi_log_error(SLAPI_LOG_ERR, DNA_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_ERR, DNA_PLUGIN_SUBSYSTEM, "dna_init - Failed to register plugin\n"); status = DNA_FAILURE; } @@ -476,7 +476,7 @@ dna_init(Slapi_PBlock *pb) NULL, /* ? */ plugin_identity /* access control */ )) { - slapi_log_error(SLAPI_LOG_ERR, DNA_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_ERR, DNA_PLUGIN_SUBSYSTEM, "dna_init - Failed to register postop plugin\n"); status = DNA_FAILURE; } @@ -493,7 +493,7 @@ dna_init(Slapi_PBlock *pb) plugin_identity /* access control */ ) ) { - slapi_log_error(SLAPI_LOG_ERR, DNA_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_ERR, DNA_PLUGIN_SUBSYSTEM, "dna_init - Failed to register plugin\n"); status = DNA_FAILURE; } @@ -510,13 +510,13 @@ dna_init(Slapi_PBlock *pb) NULL, /* ? */ plugin_identity /* access control */ )) { - slapi_log_error(SLAPI_LOG_ERR, DNA_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_ERR, DNA_PLUGIN_SUBSYSTEM, "dna_init - Failed to register be_txn_pre_op plugin\n"); status = DNA_FAILURE; } } - slapi_log_error(SLAPI_LOG_TRACE, DNA_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_TRACE, DNA_PLUGIN_SUBSYSTEM, "<-- dna_init\n"); return status; } @@ -537,7 +537,7 @@ dna_postop_init(Slapi_PBlock *pb) slapi_pblock_set(pb, mdnfn, (void *) dna_config_check_post_op) != 0 || slapi_pblock_set(pb, delfn, (void *) dna_config_check_post_op) != 0 || slapi_pblock_set(pb, modfn, (void *) dna_config_check_post_op) != 0) { - slapi_log_error(SLAPI_LOG_ERR, DNA_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_ERR, DNA_PLUGIN_SUBSYSTEM, "dna_postop_init - Failed to register plugin\n"); status = DNA_FAILURE; } @@ -561,7 +561,7 @@ dna_exop_init(Slapi_PBlock * pb) (void *) dna_extend_exop) != 0 || slapi_pblock_set(pb, SLAPI_PLUGIN_EXT_OP_BACKEND_FN, (void *) dna_extend_exop_backend) != 0) { - slapi_log_error(SLAPI_LOG_ERR, DNA_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_ERR, DNA_PLUGIN_SUBSYSTEM, "dna_exop_init - Failed to register plugin\n"); status = DNA_FAILURE; } @@ -577,7 +577,7 @@ dna_be_txn_preop_init(Slapi_PBlock *pb){ slapi_pblock_set(pb, SLAPI_PLUGIN_DESCRIPTION, (void *) &pdesc) != 0 || slapi_pblock_set(pb, SLAPI_PLUGIN_BE_TXN_PRE_ADD_FN, (void *)dna_be_txn_add_pre_op) != 0 || slapi_pblock_set(pb, SLAPI_PLUGIN_BE_TXN_PRE_MODIFY_FN, (void *)dna_be_txn_mod_pre_op) != 0){ - slapi_log_error(SLAPI_LOG_ERR, DNA_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_ERR, DNA_PLUGIN_SUBSYSTEM, "dna_init - Failed to register be_txn_pre_op plugin\n"); status = DNA_FAILURE; } @@ -597,19 +597,19 @@ dna_start(Slapi_PBlock * pb) Slapi_DN *pluginsdn = NULL; const char *plugindn = NULL; - slapi_log_error(SLAPI_LOG_TRACE, DNA_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_TRACE, DNA_PLUGIN_SUBSYSTEM, "--> dna_start\n"); g_dna_cache_lock = slapi_new_rwlock(); if (!g_dna_cache_lock) { - slapi_log_error(SLAPI_LOG_ERR, DNA_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_ERR, DNA_PLUGIN_SUBSYSTEM, "dna_start - Global config lock creation failed\n"); return DNA_FAILURE; } g_dna_cache_server_lock = slapi_new_rwlock(); if (!g_dna_cache_server_lock) { - slapi_log_error(SLAPI_LOG_ERR, DNA_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_ERR, DNA_PLUGIN_SUBSYSTEM, "dna_start - Global server lock creation failed\n"); return DNA_FAILURE; } @@ -621,12 +621,12 @@ dna_start(Slapi_PBlock * pb) */ slapi_pblock_get(pb, SLAPI_TARGET_SDN, &pluginsdn); if (NULL == pluginsdn || 0 == slapi_sdn_get_ndn_len(pluginsdn)) { - slapi_log_error(SLAPI_LOG_PLUGIN, DNA_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_PLUGIN, DNA_PLUGIN_SUBSYSTEM, "dna_start - Had to use hard coded config dn\n"); plugindn = DNA_DN; } else { plugindn = slapi_sdn_get_dn(pluginsdn); - slapi_log_error(SLAPI_LOG_PLUGIN, DNA_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_PLUGIN, DNA_PLUGIN_SUBSYSTEM, "dna_start - Config at %s\n", plugindn); } @@ -637,7 +637,7 @@ dna_start(Slapi_PBlock * pb) * in case shared config is enabled for any of the * ranges we are managing. */ if (dna_load_host_port() != DNA_SUCCESS) { - slapi_log_error(SLAPI_LOG_ERR, DNA_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_ERR, DNA_PLUGIN_SUBSYSTEM, "dna_start - Unable to load host and port information\n"); } @@ -649,7 +649,7 @@ dna_start(Slapi_PBlock * pb) PR_INIT_CLIST(dna_global_config); if (dna_load_plugin_config(pb, 1/* use eventq */) != DNA_SUCCESS) { - slapi_log_error(SLAPI_LOG_ERR, DNA_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_ERR, DNA_PLUGIN_SUBSYSTEM, "dna_start - Unable to load plug-in configuration\n"); return DNA_FAILURE; } @@ -658,14 +658,14 @@ dna_start(Slapi_PBlock * pb) * Load all shared server configs */ if (dna_load_shared_servers() ) { - slapi_log_error(SLAPI_LOG_ERR, DNA_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_ERR, DNA_PLUGIN_SUBSYSTEM, "dna_start - Shared config server initialization failed.\n"); return DNA_FAILURE; } - slapi_log_error(SLAPI_LOG_PLUGIN, DNA_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_PLUGIN, DNA_PLUGIN_SUBSYSTEM, "dna_start - Ready for service\n"); - slapi_log_error(SLAPI_LOG_TRACE, DNA_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_TRACE, DNA_PLUGIN_SUBSYSTEM, "<-- dna_start\n"); return DNA_SUCCESS; @@ -679,7 +679,7 @@ dna_start(Slapi_PBlock * pb) static int dna_close(Slapi_PBlock * pb) { - slapi_log_error(SLAPI_LOG_TRACE, DNA_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_TRACE, DNA_PLUGIN_SUBSYSTEM, "--> dna_close\n"); slapi_eq_cancel(eq_ctx); @@ -696,7 +696,7 @@ dna_close(Slapi_PBlock * pb) slapi_ch_free_string(&portnum); slapi_ch_free_string(&secureportnum); - slapi_log_error(SLAPI_LOG_TRACE, DNA_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_TRACE, DNA_PLUGIN_SUBSYSTEM, "<-- dna_close\n"); return DNA_SUCCESS; @@ -710,20 +710,20 @@ dna_parse_exop_ber(Slapi_PBlock *pb, char **shared_dn) struct berval *reqdata = NULL; BerElement *tmp_bere = NULL; - slapi_log_error(SLAPI_LOG_TRACE, DNA_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_TRACE, DNA_PLUGIN_SUBSYSTEM, "----> dna_parse_exop_ber\n"); /* Fetch the request OID */ slapi_pblock_get(pb, SLAPI_EXT_OP_REQ_OID, &oid); if (!oid) { - slapi_log_error(SLAPI_LOG_ERR, DNA_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_ERR, DNA_PLUGIN_SUBSYSTEM, "dna_parse_exop_ber - Unable to retrieve request OID.\n"); goto out; } /* Make sure the request OID is correct. */ if (strcmp(oid, DNA_EXTEND_EXOP_REQUEST_OID) != 0) { - slapi_log_error(SLAPI_LOG_ERR, DNA_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_ERR, DNA_PLUGIN_SUBSYSTEM, "dna_parse_exop_ber - Received incorrect request OID.\n"); goto out; } @@ -731,7 +731,7 @@ dna_parse_exop_ber(Slapi_PBlock *pb, char **shared_dn) /* Fetch the request data */ slapi_pblock_get(pb, SLAPI_EXT_OP_REQ_VALUE, &reqdata); if (!BV_HAS_DATA(reqdata)) { - slapi_log_error(SLAPI_LOG_ERR, DNA_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_ERR, DNA_PLUGIN_SUBSYSTEM, "dna_parse_exop_ber - No request data received.\n"); goto out; } @@ -755,7 +755,7 @@ out: tmp_bere = NULL; } - slapi_log_error(SLAPI_LOG_TRACE, DNA_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_TRACE, DNA_PLUGIN_SUBSYSTEM, "<---- dna_parse_exop_ber %s\n", *shared_dn); return ret; } @@ -858,7 +858,7 @@ dna_load_plugin_config(Slapi_PBlock *pb, int use_eventq) Slapi_PBlock *search_pb; Slapi_Entry **entries = NULL; - slapi_log_error(SLAPI_LOG_TRACE, DNA_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_TRACE, DNA_PLUGIN_SUBSYSTEM, "--> dna_load_plugin_config %s\n", use_eventq?"using event queue":""); @@ -911,7 +911,7 @@ dna_load_plugin_config(Slapi_PBlock *pb, int use_eventq) cleanup: slapi_free_search_results_internal(search_pb); slapi_pblock_destroy(search_pb); - slapi_log_error(SLAPI_LOG_TRACE, DNA_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_TRACE, DNA_PLUGIN_SUBSYSTEM, "<-- dna_load_plugin_config\n"); return status; @@ -940,7 +940,7 @@ dna_parse_config_entry(Slapi_PBlock *pb, Slapi_Entry * e, int apply) int ret = DNA_SUCCESS; char **plugin_attr_values; - slapi_log_error(SLAPI_LOG_TRACE, DNA_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_TRACE, DNA_PLUGIN_SUBSYSTEM, "--> dna_parse_config_entry\n"); /* If this is the main DNA plug-in @@ -957,12 +957,12 @@ dna_parse_config_entry(Slapi_PBlock *pb, Slapi_Entry * e, int apply) entry->dn = slapi_ch_strdup(value); } - slapi_log_error(SLAPI_LOG_CONFIG, DNA_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_CONFIG, DNA_PLUGIN_SUBSYSTEM, "dna_parse_config_entry - dn [%s]\n", entry->dn); entry->types = slapi_entry_attr_get_charray(e, DNA_TYPE); if (entry->types == NULL) { - slapi_log_error(SLAPI_LOG_ERR, DNA_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_ERR, DNA_PLUGIN_SUBSYSTEM, "dna_parse_config_entry - The %s config " "setting is required for range %s.\n", DNA_TYPE, entry->dn); @@ -972,14 +972,14 @@ dna_parse_config_entry(Slapi_PBlock *pb, Slapi_Entry * e, int apply) for (i = 0; entry->types && entry->types[i]; i++) { if (!slapi_attr_syntax_exists(entry->types[i])){ - slapi_log_error(SLAPI_LOG_ERR, DNA_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_ERR, DNA_PLUGIN_SUBSYSTEM, "dna_parse_config_entry - dnaType (%s) does " "not exist.\n", entry->types[i]); ret = DNA_FAILURE; goto bail; } - slapi_log_error(SLAPI_LOG_CONFIG, DNA_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_CONFIG, DNA_PLUGIN_SUBSYSTEM, "----------> %s [%s]\n", DNA_TYPE, entry->types[i]); } @@ -988,7 +988,7 @@ dna_parse_config_entry(Slapi_PBlock *pb, Slapi_Entry * e, int apply) entry->nextval = strtoull(value, 0, 0); slapi_ch_free_string(&value); } else { - slapi_log_error(SLAPI_LOG_ERR, DNA_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_ERR, DNA_PLUGIN_SUBSYSTEM, "dna_parse_config_entry - The %s config " "setting is required for range %s.\n", DNA_NEXTVAL, entry->dn); @@ -996,7 +996,7 @@ dna_parse_config_entry(Slapi_PBlock *pb, Slapi_Entry * e, int apply) goto bail; } - slapi_log_error(SLAPI_LOG_CONFIG, DNA_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_CONFIG, DNA_PLUGIN_SUBSYSTEM, "dna_parse_config_entry - %s [%" NSPRIu64 "]\n", DNA_NEXTVAL, entry->nextval); @@ -1012,7 +1012,7 @@ dna_parse_config_entry(Slapi_PBlock *pb, Slapi_Entry * e, int apply) slapi_ch_free_string(&value); } - slapi_log_error(SLAPI_LOG_CONFIG, DNA_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_CONFIG, DNA_PLUGIN_SUBSYSTEM, "dna_parse_config_entry - %s [%s]\n", DNA_PREFIX, entry->prefix); /* Set the default interval to 1 */ @@ -1025,14 +1025,14 @@ dna_parse_config_entry(Slapi_PBlock *pb, Slapi_Entry * e, int apply) slapi_ch_free_string(&value); } - slapi_log_error(SLAPI_LOG_CONFIG, DNA_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_CONFIG, DNA_PLUGIN_SUBSYSTEM, "dna_parse_config_entry - %s [%" NSPRIu64 "]\n", DNA_INTERVAL, entry->interval); #endif value = slapi_entry_attr_get_charptr(e, DNA_GENERATE); if (value) { entry->generate = value; - slapi_log_error(SLAPI_LOG_CONFIG, DNA_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_CONFIG, DNA_PLUGIN_SUBSYSTEM, "dna_parse_config_entry - %s [%s]\n", DNA_GENERATE, entry->generate); } @@ -1040,14 +1040,14 @@ dna_parse_config_entry(Slapi_PBlock *pb, Slapi_Entry * e, int apply) if (value) { entry->filter = value; if (NULL == (entry->slapi_filter = slapi_str2filter(value))) { - slapi_log_error(SLAPI_LOG_ERR, DNA_PLUGIN_SUBSYSTEM , + slapi_log_err(SLAPI_LOG_ERR, DNA_PLUGIN_SUBSYSTEM , "dna_parse_config_entry - Invalid search filter in entry [%s]: [%s]\n", entry->dn, value); ret = DNA_FAILURE; goto bail; } } else { - slapi_log_error(SLAPI_LOG_ERR, DNA_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_ERR, DNA_PLUGIN_SUBSYSTEM, "dna_parse_config_entry - The %s config " "setting is required for range %s.\n", DNA_FILTER, entry->dn); @@ -1055,7 +1055,7 @@ dna_parse_config_entry(Slapi_PBlock *pb, Slapi_Entry * e, int apply) goto bail; } - slapi_log_error(SLAPI_LOG_CONFIG, DNA_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_CONFIG, DNA_PLUGIN_SUBSYSTEM, "dna_parse_config_entry - %s [%s]\n", DNA_FILTER, value); value = slapi_entry_attr_get_charptr(e, DNA_SCOPE); @@ -1070,7 +1070,7 @@ dna_parse_config_entry(Slapi_PBlock *pb, Slapi_Entry * e, int apply) * RDN elements to still work. */ test_dn = slapi_sdn_new_dn_byref(value); if (slapi_dn_syntax_check(NULL, (char *)slapi_sdn_get_ndn(test_dn), 1) == 1) { - slapi_log_error(SLAPI_LOG_ERR, DNA_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_ERR, DNA_PLUGIN_SUBSYSTEM, "dna_parse_config_entry - Invalid DN used as scope in entry [%s]: [%s]\n", entry->dn, value); ret = DNA_FAILURE; @@ -1079,7 +1079,7 @@ dna_parse_config_entry(Slapi_PBlock *pb, Slapi_Entry * e, int apply) } slapi_sdn_free(&test_dn); } else { - slapi_log_error(SLAPI_LOG_ERR, DNA_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_ERR, DNA_PLUGIN_SUBSYSTEM, "dna_parse_config_entry - The %s config " "config setting is required for range %s.\n", DNA_SCOPE, entry->dn); @@ -1087,7 +1087,7 @@ dna_parse_config_entry(Slapi_PBlock *pb, Slapi_Entry * e, int apply) goto bail; } - slapi_log_error(SLAPI_LOG_CONFIG, DNA_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_CONFIG, DNA_PLUGIN_SUBSYSTEM, "dna_parse_config_entry - %s [%s]\n", DNA_SCOPE, entry->scope); plugin_attr_values = slapi_entry_attr_get_charray(e, DNA_EXCLUDE_SCOPE); @@ -1101,7 +1101,7 @@ dna_parse_config_entry(Slapi_PBlock *pb, Slapi_Entry * e, int apply) /* Copy them in the config at the condition they are valid DN */ for (i = 0; plugin_attr_values[i]; i++) { if (slapi_dn_syntax_check(NULL, plugin_attr_values[i], 1) == 1) { - slapi_log_error(SLAPI_LOG_ERR, DNA_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_ERR, DNA_PLUGIN_SUBSYSTEM, "dna_parse_config_entry - Ignoring invalid DN used as excluded scope: [%s]\n", plugin_attr_values[i]); slapi_ch_free_string(&plugin_attr_values[i]); } else { @@ -1111,7 +1111,7 @@ dna_parse_config_entry(Slapi_PBlock *pb, Slapi_Entry * e, int apply) slapi_ch_free((void**) &plugin_attr_values); } for (i = 0; entry->excludescope && entry->excludescope[i]; i++) { - slapi_log_error(SLAPI_LOG_CONFIG, DNA_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_CONFIG, DNA_PLUGIN_SUBSYSTEM, "dna_parse_config_entry - %s[%d] [%s]\n", DNA_EXCLUDE_SCOPE, i, slapi_sdn_get_dn(entry->excludescope[i])); } @@ -1125,7 +1125,7 @@ dna_parse_config_entry(Slapi_PBlock *pb, Slapi_Entry * e, int apply) entry->maxval = -1; } - slapi_log_error(SLAPI_LOG_CONFIG, DNA_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_CONFIG, DNA_PLUGIN_SUBSYSTEM, "dna_parse_config_entry - %s [%" NSPRIu64 "]\n", DNA_MAXVAL, entry->maxval); @@ -1137,7 +1137,7 @@ dna_parse_config_entry(Slapi_PBlock *pb, Slapi_Entry * e, int apply) sdn = slapi_sdn_new_dn_passin(value); if (!sdn) { - slapi_log_error(SLAPI_LOG_ERR, DNA_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_ERR, DNA_PLUGIN_SUBSYSTEM, "dna_parse_config_entry - Unable to create " "slapi_dn from dnaRemoteBindDN (%s)\n", value); ret = DNA_FAILURE; @@ -1146,7 +1146,7 @@ dna_parse_config_entry(Slapi_PBlock *pb, Slapi_Entry * e, int apply) } normdn = (char *)slapi_sdn_get_dn(sdn); if (NULL == normdn) { - slapi_log_error(SLAPI_LOG_ERR, DNA_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_ERR, DNA_PLUGIN_SUBSYSTEM, "dna_parse_config_entry - Failed to normalize dn: " "%s\n", value); ret = DNA_FAILURE; @@ -1162,7 +1162,7 @@ dna_parse_config_entry(Slapi_PBlock *pb, Slapi_Entry * e, int apply) /* validate that we have both a bind dn or password, or we have none */ if((entry->remote_bindpw != NULL && entry->remote_binddn == NULL) || (entry->remote_binddn != NULL && entry->remote_bindpw == NULL)){ - slapi_log_error(SLAPI_LOG_ERR, DNA_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_ERR, DNA_PLUGIN_SUBSYSTEM, "dna_parse_config_entry - Invalid remote bind DN and password settings.\n"); ret = DNA_FAILURE; goto bail; @@ -1178,7 +1178,7 @@ dna_parse_config_entry(Slapi_PBlock *pb, Slapi_Entry * e, int apply) sdn = slapi_sdn_new_dn_passin(value); if (!sdn) { - slapi_log_error(SLAPI_LOG_ERR, DNA_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_ERR, DNA_PLUGIN_SUBSYSTEM, "dna_parse_config_entry - Unable to create " "slapi_dn (%s)\n", value); ret = DNA_FAILURE; @@ -1194,7 +1194,7 @@ dna_parse_config_entry(Slapi_PBlock *pb, Slapi_Entry * e, int apply) if (!shared_e) { /* We didn't locate the shared config container entry. Log * a message and skip this config entry. */ - slapi_log_error(SLAPI_LOG_ERR, DNA_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_ERR, DNA_PLUGIN_SUBSYSTEM, "dna_parse_config_entry - Unable to locate " "shared configuration entry (%s)\n", value); ret = DNA_FAILURE; @@ -1207,7 +1207,7 @@ dna_parse_config_entry(Slapi_PBlock *pb, Slapi_Entry * e, int apply) normdn = (char *)slapi_sdn_get_dn(sdn); if (NULL == normdn) { - slapi_log_error(SLAPI_LOG_ERR, DNA_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_ERR, DNA_PLUGIN_SUBSYSTEM, "dna_parse_config_entry - Failed to normalize dn: " "%s\n", value); ret = DNA_FAILURE; @@ -1223,7 +1223,7 @@ dna_parse_config_entry(Slapi_PBlock *pb, Slapi_Entry * e, int apply) hostname, DNA_PORTNUM, portnum, entry->shared_cfg_base); if (NULL == normdn) { - slapi_log_error(SLAPI_LOG_ERR, DNA_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_ERR, DNA_PLUGIN_SUBSYSTEM, "dna_parse_config_entry - Failed to create dn: " "%s=%s+%s=%s,%s", DNA_HOSTNAME, hostname, DNA_PORTNUM, portnum, value); @@ -1232,7 +1232,7 @@ dna_parse_config_entry(Slapi_PBlock *pb, Slapi_Entry * e, int apply) } entry->shared_cfg_dn = normdn; - slapi_log_error(SLAPI_LOG_CONFIG, DNA_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_CONFIG, DNA_PLUGIN_SUBSYSTEM, "dna_parse_config_entry - %s [%s]\n", DNA_SHARED_CFG_DN, entry->shared_cfg_base); } @@ -1241,12 +1241,12 @@ dna_parse_config_entry(Slapi_PBlock *pb, Slapi_Entry * e, int apply) if (value) { entry->threshold = strtoull(value, 0, 0); - slapi_log_error(SLAPI_LOG_CONFIG, DNA_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_CONFIG, DNA_PLUGIN_SUBSYSTEM, "dna_parse_config_entry - %s [%s]\n", DNA_THRESHOLD, value); if (entry->threshold <= 0) { entry->threshold = 1; - slapi_log_error(SLAPI_LOG_ERR, DNA_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_ERR, DNA_PLUGIN_SUBSYSTEM, "----------> %s too low, setting to [%s]\n", DNA_THRESHOLD, value); } @@ -1255,7 +1255,7 @@ dna_parse_config_entry(Slapi_PBlock *pb, Slapi_Entry * e, int apply) entry->threshold = 1; } - slapi_log_error(SLAPI_LOG_CONFIG, DNA_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_CONFIG, DNA_PLUGIN_SUBSYSTEM, "dna_parse_config_entry - %s [%" NSPRIu64 "]\n", DNA_THRESHOLD, entry->threshold); @@ -1267,7 +1267,7 @@ dna_parse_config_entry(Slapi_PBlock *pb, Slapi_Entry * e, int apply) entry->timeout = DNA_DEFAULT_TIMEOUT; } - slapi_log_error(SLAPI_LOG_CONFIG, DNA_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_CONFIG, DNA_PLUGIN_SUBSYSTEM, "dna_parse_config_entry - %s [%" NSPRIu64 "]\n", DNA_RANGE_REQUEST_TIMEOUT, entry->timeout); @@ -1284,7 +1284,7 @@ dna_parse_config_entry(Slapi_PBlock *pb, Slapi_Entry * e, int apply) /* validate that upper is greater than lower */ if (entry->next_range_upper <= entry->next_range_lower) { - slapi_log_error(SLAPI_LOG_ERR, DNA_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_ERR, DNA_PLUGIN_SUBSYSTEM, "dna_parse_config_entry: Illegal %s " "setting specified for range %s. Legal " "format is -.\n", @@ -1300,7 +1300,7 @@ dna_parse_config_entry(Slapi_PBlock *pb, Slapi_Entry * e, int apply) (entry->next_range_upper >= entry->nextval)) || ((entry->next_range_lower <= entry->maxval) && (entry->next_range_lower >= entry->nextval))) { - slapi_log_error(SLAPI_LOG_ERR, DNA_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_ERR, DNA_PLUGIN_SUBSYSTEM, "dna_parse_config_entry: Illegal %s " "setting specified for range %s. %s " "overlaps with the active range.\n", @@ -1310,7 +1310,7 @@ dna_parse_config_entry(Slapi_PBlock *pb, Slapi_Entry * e, int apply) entry->next_range_upper = 0; } } else { - slapi_log_error(SLAPI_LOG_ERR, DNA_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_ERR, DNA_PLUGIN_SUBSYSTEM, "dna_parse_config_entry: Illegal %s " "setting specified for range %s. Legal " "format is -.\n", @@ -1342,7 +1342,7 @@ dna_parse_config_entry(Slapi_PBlock *pb, Slapi_Entry * e, int apply) /* create the new value lock for this range */ entry->lock = slapi_new_mutex(); if (!entry->lock) { - slapi_log_error(SLAPI_LOG_ERR, DNA_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_ERR, DNA_PLUGIN_SUBSYSTEM, "dna_parse_config_entry: Unable to create lock " "for range %s.\n", entry->dn); ret = DNA_FAILURE; @@ -1354,7 +1354,7 @@ dna_parse_config_entry(Slapi_PBlock *pb, Slapi_Entry * e, int apply) if (entry->slapi_filter) { ret = slapi_vattr_filter_test(pb, e, entry->slapi_filter, 0); if (LDAP_SUCCESS == ret) { - slapi_log_error(SLAPI_LOG_ERR, DNA_PLUGIN_SUBSYSTEM, "dna_parse_config_entry - " + slapi_log_err(SLAPI_LOG_ERR, DNA_PLUGIN_SUBSYSTEM, "dna_parse_config_entry - " "Shared config entry (%s) matches scope \"%s\", and filter \"%s\" " "of the DNA config entry (%s).\n", entry->shared_cfg_base, entry->scope, entry->filter, entry->dn); @@ -1378,7 +1378,7 @@ dna_parse_config_entry(Slapi_PBlock *pb, Slapi_Entry * e, int apply) if (slapi_dn_issuffix(entry->scope, config_entry->scope)) { PR_INSERT_BEFORE(&(entry->list), list); - slapi_log_error(SLAPI_LOG_CONFIG, + slapi_log_err(SLAPI_LOG_CONFIG, DNA_PLUGIN_SUBSYSTEM, "dna_parse_config_entry - store [%s] before [%s] \n", entry->scope, config_entry->scope); @@ -1391,7 +1391,7 @@ dna_parse_config_entry(Slapi_PBlock *pb, Slapi_Entry * e, int apply) if (dna_global_config == list) { /* add to tail */ PR_INSERT_BEFORE(&(entry->list), list); - slapi_log_error(SLAPI_LOG_CONFIG, DNA_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_CONFIG, DNA_PLUGIN_SUBSYSTEM, "dna_parse_config_entry - store [%s] at tail\n", entry->scope); entry_added = 1; break; @@ -1400,7 +1400,7 @@ dna_parse_config_entry(Slapi_PBlock *pb, Slapi_Entry * e, int apply) } else { /* first entry */ PR_INSERT_LINK(&(entry->list), dna_global_config); - slapi_log_error(SLAPI_LOG_CONFIG, DNA_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_CONFIG, DNA_PLUGIN_SUBSYSTEM, "dna_parse_config_entry - store [%s] at head \n", entry->scope); entry_added = 1; } @@ -1409,7 +1409,7 @@ bail: if (0 == entry_added) { /* Don't log error if we weren't asked to apply config */ if ((apply != 0) && (entry != NULL)) { - slapi_log_error(SLAPI_LOG_ERR, DNA_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_ERR, DNA_PLUGIN_SUBSYSTEM, "dna_parse_config_entry - Invalid config entry " "[%s] skipped\n", entry->dn); } @@ -1418,7 +1418,7 @@ bail: ret = DNA_SUCCESS; } - slapi_log_error(SLAPI_LOG_TRACE, DNA_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_TRACE, DNA_PLUGIN_SUBSYSTEM, "<-- dna_parse_config_entry\n"); return ret; @@ -1434,7 +1434,7 @@ dna_free_config_entry(struct configEntry ** entry) e = *entry; if (e->dn) { - slapi_log_error(SLAPI_LOG_CONFIG, DNA_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_CONFIG, DNA_PLUGIN_SUBSYSTEM, "dna_free_config_entry - Freeing config entry [%s]\n", e->dn); slapi_ch_free_string(&e->dn); } @@ -1528,7 +1528,7 @@ dna_load_host_port(void) Slapi_DN *config_dn = NULL; char *attrs[4]; - slapi_log_error(SLAPI_LOG_TRACE, DNA_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_TRACE, DNA_PLUGIN_SUBSYSTEM, "--> dna_load_host_port\n"); attrs[0] = "nsslapd-localhost"; @@ -1553,7 +1553,7 @@ dna_load_host_port(void) status = DNA_FAILURE; } - slapi_log_error(SLAPI_LOG_TRACE, DNA_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_TRACE, DNA_PLUGIN_SUBSYSTEM, "<-- dna_load_host_port\n"); return status; @@ -1627,14 +1627,14 @@ dna_update_config_event(time_t event_time, void *arg) slapi_back_transaction_commit(dna_pb); } else { if (slapi_back_transaction_abort(dna_pb) != 0) { - slapi_log_error(SLAPI_LOG_ERR, DNA_PLUGIN_SUBSYSTEM, "dna_update_config_event - " + slapi_log_err(SLAPI_LOG_ERR, DNA_PLUGIN_SUBSYSTEM, "dna_update_config_event - " "Failed to abort transaction!\n"); } } slapi_pblock_destroy(dna_pb); slapi_pblock_init(pb); } else { - slapi_log_error(SLAPI_LOG_ERR, DNA_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_ERR, DNA_PLUGIN_SUBSYSTEM, "dna_update_config_event - Failed to start transaction\n"); } } @@ -1687,7 +1687,7 @@ static int dna_fix_maxval(struct configEntry *config_entry, if (config_entry->next_range_lower != 0) { ret = dna_activate_next_range(config_entry); if (ret != 0) { - slapi_log_error(SLAPI_LOG_ERR, DNA_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_ERR, DNA_PLUGIN_SUBSYSTEM, "dna_fix_maxval - Unable to activate the " "next range for range %s.\n", config_entry->dn); } @@ -1760,7 +1760,7 @@ dna_notice_allocation(struct configEntry *config_entry, PRUint64 new, if (config_entry->next_range_lower != 0) { /* Make the next range active */ if (dna_activate_next_range(config_entry) != 0) { - slapi_log_error(SLAPI_LOG_ERR, DNA_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_ERR, DNA_PLUGIN_SUBSYSTEM, "dna_notice_allocation - Unable to activate " "the next range for range %s.\n", config_entry->dn); } @@ -1818,7 +1818,7 @@ dna_get_shared_servers(struct configEntry *config_entry, PRCList **servers, int slapi_pblock_get(pb, SLAPI_PLUGIN_INTOP_RESULT, &ret); if (LDAP_SUCCESS != ret) { - slapi_log_error(SLAPI_LOG_ERR, DNA_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_ERR, DNA_PLUGIN_SUBSYSTEM, "dna_get_shared_servers - Search failed for shared " "config: %s [error %d]\n", config_entry->shared_cfg_base, ret); @@ -1862,7 +1862,7 @@ dna_get_shared_servers(struct configEntry *config_entry, PRCList **servers, int if (!server->host || (server->port == 0 && server->secureport == 0)) { /* free and skip this one */ - slapi_log_error(SLAPI_LOG_PLUGIN, DNA_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_PLUGIN, DNA_PLUGIN_SUBSYSTEM, "dna_get_shared_servers - Skipping invalid " "shared config entry (%s)\n", slapi_entry_get_dn(entries[i])); dna_free_shared_server(&server); @@ -1892,7 +1892,7 @@ dna_get_shared_servers(struct configEntry *config_entry, PRCList **servers, int } } if(err){ - slapi_log_error(SLAPI_LOG_PLUGIN, DNA_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_PLUGIN, DNA_PLUGIN_SUBSYSTEM, "dna_get_shared_servers - Skipping invalid " "shared config entry (%s). Reason: %s\n", slapi_entry_get_dn(entries[i]), reason); @@ -1987,7 +1987,7 @@ static int dna_request_range(struct configEntry *config_entry, slapi_lock_mutex(config_entry->extend_lock); if (config_entry->extend_in_progress) { /* We're already processing a range extention, so bail. */ - slapi_log_error(SLAPI_LOG_PLUGIN, DNA_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_PLUGIN, DNA_PLUGIN_SUBSYSTEM, "dna_request_range - Already processing a " "range extension request. Skipping request.\n"); slapi_unlock_mutex(config_entry->extend_lock); @@ -2003,21 +2003,21 @@ static int dna_request_range(struct configEntry *config_entry, if (dna_get_replica_bind_creds(config_entry->shared_cfg_base, server, &bind_dn, &bind_passwd, &bind_method, &is_ssl, &port) != 0) { - slapi_log_error(SLAPI_LOG_ERR, DNA_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_ERR, DNA_PLUGIN_SUBSYSTEM, "dna_request_range: Unable to retrieve " "replica bind credentials.\n"); goto bail; } if ((request = dna_create_range_request(config_entry->shared_cfg_base)) == NULL) { - slapi_log_error(SLAPI_LOG_ERR, DNA_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_ERR, DNA_PLUGIN_SUBSYSTEM, "dna_request_range - Failed to create " "range extension extended operation request.\n"); goto bail; } if ((ld = slapi_ldap_init(server->host, port, is_ssl, 0)) == NULL) { - slapi_log_error(SLAPI_LOG_ERR, DNA_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_ERR, DNA_PLUGIN_SUBSYSTEM, "dna_request_range - Unable to " "initialize LDAP session to server %s:%u.\n", server->host, server->port); @@ -2040,7 +2040,7 @@ static int dna_request_range(struct configEntry *config_entry, NULL, NULL, NULL, NULL); if (ret != LDAP_SUCCESS) { - slapi_log_error(SLAPI_LOG_PLUGIN, DNA_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_PLUGIN, DNA_PLUGIN_SUBSYSTEM, "dna_request_range - Error binding " " to replica server %s:%u. [error %d]\n", server->host, server->port, ret); @@ -2052,7 +2052,7 @@ static int dna_request_range(struct configEntry *config_entry, request, NULL, NULL, &retoid, &responsedata); if (ret != LDAP_SUCCESS) { - slapi_log_error(SLAPI_LOG_ERR, DNA_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_ERR, DNA_PLUGIN_SUBSYSTEM, "dna_request_range - Error sending " "range extension extended operation request " "to server %s:%u [error %d]\n", server->host, @@ -2063,7 +2063,7 @@ static int dna_request_range(struct configEntry *config_entry, /* Verify that the OID is correct. */ if (strcmp(retoid, DNA_EXTEND_EXOP_RESPONSE_OID) != 0) { ret = LDAP_OPERATIONS_ERROR; - slapi_log_error(SLAPI_LOG_ERR, DNA_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_ERR, DNA_PLUGIN_SUBSYSTEM, "dna_request_range - Received incorrect response OID.\n"); goto bail; } @@ -2121,21 +2121,21 @@ static struct berval *dna_create_range_request(char *range_dn) shared_dn.bv_len = strlen(shared_dn.bv_val); if((ber = ber_alloc()) == NULL) { - slapi_log_error(SLAPI_LOG_ERR, DNA_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_ERR, DNA_PLUGIN_SUBSYSTEM, "dna_create_range_request - Error " "allocating request data.\n"); goto bail; } if (LBER_ERROR == (ber_printf(ber, "{o}", shared_dn.bv_val, shared_dn.bv_len))) { - slapi_log_error(SLAPI_LOG_ERR, DNA_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_ERR, DNA_PLUGIN_SUBSYSTEM, "dna_create_range_request - Error " "encoding request data.\n"); goto bail; } if (ber_flatten(ber, &requestdata) == -1) { - slapi_log_error(SLAPI_LOG_ERR, DNA_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_ERR, DNA_PLUGIN_SUBSYSTEM, "dna_create_range_request - Error " "encoding request data.\n"); goto bail; @@ -2154,17 +2154,17 @@ bail: static char *dna_get_dn(Slapi_PBlock * pb) { Slapi_DN *sdn = 0; - slapi_log_error(SLAPI_LOG_TRACE, DNA_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_TRACE, DNA_PLUGIN_SUBSYSTEM, "--> dna_get_dn\n"); if (slapi_pblock_get(pb, SLAPI_TARGET_SDN, &sdn)) { - slapi_log_error(SLAPI_LOG_ERR, DNA_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_ERR, DNA_PLUGIN_SUBSYSTEM, "dna_get_dn - Failed to get dn of changed entry"); goto bail; } bail: - slapi_log_error(SLAPI_LOG_TRACE, DNA_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_TRACE, DNA_PLUGIN_SUBSYSTEM, "<-- dna_get_dn\n"); return (char *)slapi_sdn_get_dn(sdn); @@ -2177,14 +2177,14 @@ static int dna_dn_is_config(char *dn) { int ret = 0; - slapi_log_error(SLAPI_LOG_TRACE, DNA_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_TRACE, DNA_PLUGIN_SUBSYSTEM, "--> dna_is_config %s\n", dn); if (slapi_dn_issuffix(dn, getPluginDN())) { ret = 1; } - slapi_log_error(SLAPI_LOG_TRACE, DNA_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_TRACE, DNA_PLUGIN_SUBSYSTEM, "<-- dna_is_config\n"); return ret; @@ -2455,7 +2455,7 @@ static int dna_get_next_value(struct configEntry *config_entry, PRUint64 nextval = 0; int ret; - slapi_log_error(SLAPI_LOG_TRACE, DNA_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_TRACE, DNA_PLUGIN_SUBSYSTEM, "--> dna_get_next_value\n"); /* get the lock to prevent contention with other threads over @@ -2474,7 +2474,7 @@ static int dna_get_next_value(struct configEntry *config_entry, * while within a transaction. */ ret = dna_fix_maxval(config_entry, 1 /* skip range transfer request */ ); if (LDAP_SUCCESS != ret) { - slapi_log_error(SLAPI_LOG_ERR, DNA_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_ERR, DNA_PLUGIN_SUBSYSTEM, "dna_get_next_value - No more values available!!\n"); goto done; } @@ -2485,7 +2485,7 @@ static int dna_get_next_value(struct configEntry *config_entry, goto done; } else { /* dna_first_free_value() failed for some unknown reason */ - slapi_log_error(SLAPI_LOG_ERR, DNA_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_ERR, DNA_PLUGIN_SUBSYSTEM, "dna_get_next_value - Failed to allocate a new ID!!\n"); goto done; } @@ -2541,7 +2541,7 @@ static int dna_get_next_value(struct configEntry *config_entry, slapi_pblock_destroy(pb); } - slapi_log_error(SLAPI_LOG_TRACE, DNA_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_TRACE, DNA_PLUGIN_SUBSYSTEM, "<-- dna_get_next_value\n"); return ret; @@ -2674,7 +2674,7 @@ dna_update_shared_config(struct configEntry *config_entry) } if (ret != LDAP_SUCCESS) { - slapi_log_error(SLAPI_LOG_ERR, DNA_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_ERR, DNA_PLUGIN_SUBSYSTEM, "dna_update_shared_config - Unable to update shared config entry: %s [error %d]\n", config_entry->shared_cfg_dn, ret); } @@ -2738,7 +2738,7 @@ dna_update_next_range(struct configEntry *config_entry, pb = NULL; if (ret != LDAP_SUCCESS) { - slapi_log_error(SLAPI_LOG_ERR, DNA_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_ERR, DNA_PLUGIN_SUBSYSTEM, "dna_update_next_range - Error updating " "configuration entry [err=%d]\n", ret); } else { @@ -2820,7 +2820,7 @@ dna_activate_next_range(struct configEntry *config_entry) pb = NULL; if (ret != LDAP_SUCCESS) { - slapi_log_error(SLAPI_LOG_ERR, DNA_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_ERR, DNA_PLUGIN_SUBSYSTEM, "dna_activate_next_range - Error updating " "configuration entry [err=%d]\n", ret); } else { @@ -2871,7 +2871,7 @@ static int dna_is_replica_bind_dn(char *range_dn, char *bind_dn) /* This function converts the old DN style to the new one. */ replica_dn = slapi_create_dn_string("cn=replica,cn=\"%s\",cn=mapping tree,cn=config", be_suffix); if (NULL == replica_dn) { - slapi_log_error(SLAPI_LOG_PLUGIN, DNA_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_PLUGIN, DNA_PLUGIN_SUBSYSTEM, "dna_is_replica_bind_dn - Failed to create " "replica dn for %s\n", be_suffix); ret = 1; @@ -2920,7 +2920,7 @@ static int dna_is_replica_bind_dn(char *range_dn, char *bind_dn) } slapi_value_free(&bind_dn_sv); } else { - slapi_log_error(SLAPI_LOG_PLUGIN, DNA_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_PLUGIN, DNA_PLUGIN_SUBSYSTEM, "dna_is_replica_bind_dn - Failed to fetch replica entry " "for range %s\n", range_dn); } @@ -2961,7 +2961,7 @@ static int dna_get_replica_bind_creds(char *range_dn, struct dnaServer *server, /* This function converts the old DN style to the new one. */ replica_dn = slapi_create_dn_string("cn=replica,cn=\"%s\",cn=mapping tree,cn=config", be_suffix); if (NULL == replica_dn) { - slapi_log_error(SLAPI_LOG_PLUGIN, DNA_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_PLUGIN, DNA_PLUGIN_SUBSYSTEM, "dna_get_replica_bind_creds - Failed to create " "replica dn for %s\n", be_suffix); ret = LDAP_PARAM_ERROR; @@ -2981,7 +2981,7 @@ static int dna_get_replica_bind_creds(char *range_dn, struct dnaServer *server, pb = slapi_pblock_new(); if (NULL == pb) { - slapi_log_error(SLAPI_LOG_ERR, DNA_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_ERR, DNA_PLUGIN_SUBSYSTEM, "dna_get_replica_bind_creds - Failed to " "allocate pblock\n"); goto bail; @@ -2994,7 +2994,7 @@ static int dna_get_replica_bind_creds(char *range_dn, struct dnaServer *server, slapi_pblock_get(pb, SLAPI_PLUGIN_INTOP_RESULT, &ret); if (LDAP_SUCCESS != ret) { - slapi_log_error(SLAPI_LOG_ERR, DNA_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_ERR, DNA_PLUGIN_SUBSYSTEM, "dna_get_replica_bind_creds - Failed to fetch replica " "bind credentials for range %s, server %s, port %u [error %d]\n", range_dn, server->host, @@ -3014,7 +3014,7 @@ static int dna_get_replica_bind_creds(char *range_dn, struct dnaServer *server, ret = dna_get_remote_config_info(server, bind_dn, bind_passwd, bind_method, is_ssl, port); goto bail; } - slapi_log_error(SLAPI_LOG_PLUGIN, DNA_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_PLUGIN, DNA_PLUGIN_SUBSYSTEM, "dna_get_replica_bind_creds - Failed to fetch replication " "agreement for range %s, server %s, port %u\n", range_dn, server->host, server->port ? server->port : server->secureport); @@ -3065,7 +3065,7 @@ static int dna_get_replica_bind_creds(char *range_dn, struct dnaServer *server, pw_ret = pw_rever_decode(bind_cred, bind_passwd, DNA_REPL_CREDS); if (pw_ret == -1) { - slapi_log_error(SLAPI_LOG_ERR, DNA_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_ERR, DNA_PLUGIN_SUBSYSTEM, "dna_get_replica_bind_creds - Failed to decode " "replica bind credentials for range %s, server %s, " "port %u\n", range_dn, server->host, server->port); @@ -3135,7 +3135,7 @@ dna_get_remote_config_info( struct dnaServer *server, char **bind_dn, char **bin if (server->secureport){ *port = server->secureport; } else { - slapi_log_error(SLAPI_LOG_ERR, DNA_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_ERR, DNA_PLUGIN_SUBSYSTEM, "dna_get_remote_config_info - Using SSL protocol, but the secure " "port is not defined.\n"); return -1; @@ -3144,7 +3144,7 @@ dna_get_remote_config_info( struct dnaServer *server, char **bind_dn, char **bin if(server->port){ *port = server->port; } else { - slapi_log_error(SLAPI_LOG_ERR, DNA_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_ERR, DNA_PLUGIN_SUBSYSTEM, "dna_get_remote_config_info - Using %s protocol, but the non-secure " "port is not defined.\n", server->remote_conn_prot); return -1; @@ -3160,7 +3160,7 @@ dna_get_remote_config_info( struct dnaServer *server, char **bind_dn, char **bin pw_ret = pw_rever_decode(bind_cred, bind_passwd, DNA_REPL_CREDS); if (pw_ret == -1) { - slapi_log_error(SLAPI_LOG_ERR, DNA_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_ERR, DNA_PLUGIN_SUBSYSTEM, "dna_get_remote_config_info - Failed to decode " "replica bind credentials for server %s, " "port %u\n", server->host, @@ -3411,21 +3411,21 @@ _dna_pre_op_add(Slapi_PBlock *pb, Slapi_Entry *e, char **errstr) /* Did we already service all of these configured types? */ if (dna_list_contains_types(generated_types, config_entry->types)) { - slapi_log_error(SLAPI_LOG_PLUGIN, DNA_PLUGIN_SUBSYSTEM, "_dna_pre_op_add - No types to act upon.\n"); + slapi_log_err(SLAPI_LOG_PLUGIN, DNA_PLUGIN_SUBSYSTEM, "_dna_pre_op_add - No types to act upon.\n"); goto next; } /* is the entry in scope? */ if (config_entry->scope && !slapi_dn_issuffix(dn, config_entry->scope)) { - slapi_log_error(SLAPI_LOG_PLUGIN, DNA_PLUGIN_SUBSYSTEM, " dn not in scope\n"); + slapi_log_err(SLAPI_LOG_PLUGIN, DNA_PLUGIN_SUBSYSTEM, " dn not in scope\n"); goto next; } /* is this entry in an excluded scope? */ for (i = 0; config_entry->excludescope && config_entry->excludescope[i]; i++) { if (slapi_dn_issuffix(dn, slapi_sdn_get_dn(config_entry->excludescope[i]))) { - slapi_log_error(SLAPI_LOG_PLUGIN, DNA_PLUGIN_SUBSYSTEM, "_dna_pre_op_add - dn in excluded scope\n"); + slapi_log_err(SLAPI_LOG_PLUGIN, DNA_PLUGIN_SUBSYSTEM, "_dna_pre_op_add - dn in excluded scope\n"); goto next; } } @@ -3434,7 +3434,7 @@ _dna_pre_op_add(Slapi_PBlock *pb, Slapi_Entry *e, char **errstr) if (config_entry->slapi_filter) { ret = slapi_vattr_filter_test(pb, e, config_entry->slapi_filter, 0); if (LDAP_SUCCESS != ret) { - slapi_log_error(SLAPI_LOG_PLUGIN, DNA_PLUGIN_SUBSYSTEM, "_dna_pre_op_add - dn does not match filter\n"); + slapi_log_err(SLAPI_LOG_PLUGIN, DNA_PLUGIN_SUBSYSTEM, "_dna_pre_op_add - dn does not match filter\n"); goto next; } } @@ -3466,7 +3466,7 @@ _dna_pre_op_add(Slapi_PBlock *pb, Slapi_Entry *e, char **errstr) if (types_to_generate && types_to_generate[0]) { - slapi_log_error(SLAPI_LOG_PLUGIN, DNA_PLUGIN_SUBSYSTEM, "_dna_pre_op_add - adding %s to %s as -2\n", types_to_generate[0], dn); + slapi_log_err(SLAPI_LOG_PLUGIN, DNA_PLUGIN_SUBSYSTEM, "_dna_pre_op_add - adding %s to %s as -2\n", types_to_generate[0], dn); /* add - add to entry */ for (i = 0; types_to_generate && types_to_generate[i]; i++) { slapi_entry_attr_set_charptr(e, types_to_generate[i], @@ -3505,14 +3505,14 @@ _dna_pre_op_add(Slapi_PBlock *pb, Slapi_Entry *e, char **errstr) slapi_lock_mutex(config_entry->lock); ret = dna_first_free_value(config_entry, &setval); - slapi_log_error(SLAPI_LOG_PLUGIN, DNA_PLUGIN_SUBSYSTEM, "_dna_pre_op_add - retrieved value %" PRIu64 " ret %d\n", setval, ret); + slapi_log_err(SLAPI_LOG_PLUGIN, DNA_PLUGIN_SUBSYSTEM, "_dna_pre_op_add - retrieved value %" PRIu64 " ret %d\n", setval, ret); if (LDAP_SUCCESS != ret) { /* check if we overflowed the configured range */ if (setval > config_entry->maxval) { /* try for a new range or fail */ ret = dna_fix_maxval(config_entry, 0); if (LDAP_SUCCESS != ret) { - slapi_log_error(SLAPI_LOG_ERR, DNA_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_ERR, DNA_PLUGIN_SUBSYSTEM, "_dna_pre_op_add - No more values available!!\n"); /* Set an error string to be returned to the client. */ *errstr = slapi_ch_smprintf("Allocation of a new value for range" @@ -3525,7 +3525,7 @@ _dna_pre_op_add(Slapi_PBlock *pb, Slapi_Entry *e, char **errstr) /* Make sure dna_first_free_value() doesn't error out */ ret = dna_first_free_value(config_entry, &setval); if (LDAP_SUCCESS != ret){ - slapi_log_error(SLAPI_LOG_ERR, DNA_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_ERR, DNA_PLUGIN_SUBSYSTEM, "_dna_pre_op_add - Failed to allocate a new ID 1\n"); /* Set an error string to be returned to the client. */ *errstr = slapi_ch_smprintf("Allocation of a new value for range" @@ -3536,7 +3536,7 @@ _dna_pre_op_add(Slapi_PBlock *pb, Slapi_Entry *e, char **errstr) } } else { /* dna_first_free_value() failed for some unknown reason */ - slapi_log_error(SLAPI_LOG_ERR, DNA_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_ERR, DNA_PLUGIN_SUBSYSTEM, "_dna_pre_op_add - Failed to allocate a new ID!! 2\n"); /* Set an error string to be returned to the client. */ *errstr = slapi_ch_smprintf("Allocation of a new value for range" @@ -3554,7 +3554,7 @@ _dna_pre_op_add(Slapi_PBlock *pb, Slapi_Entry *e, char **errstr) * really a soft failure. */ if ((config_entry->next_range_lower == 0) && (config_entry->remaining <= config_entry->threshold)) { - slapi_log_error(SLAPI_LOG_PLUGIN, DNA_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_PLUGIN, DNA_PLUGIN_SUBSYSTEM, "_dna_pre_op_add - Passed threshold of %" NSPRIu64 " remaining values " "for range %s. (%" NSPRIu64 " values remain)\n", @@ -3784,7 +3784,7 @@ _dna_pre_op_modify(Slapi_PBlock *pb, Slapi_Entry *e, Slapi_Mods *smods, char **e /* try for a new range or fail */ ret = dna_fix_maxval(config_entry, 0); if (LDAP_SUCCESS != ret) { - slapi_log_error(SLAPI_LOG_ERR, DNA_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_ERR, DNA_PLUGIN_SUBSYSTEM, "_dna_pre_op_modify - No more values available!!\n"); /* Set an error string to be returned to the client. */ *errstr = slapi_ch_smprintf("Allocation of a new value for range" @@ -3797,7 +3797,7 @@ _dna_pre_op_modify(Slapi_PBlock *pb, Slapi_Entry *e, Slapi_Mods *smods, char **e /* Make sure dna_first_free_value() doesn't error out */ ret = dna_first_free_value(config_entry, &setval); if (LDAP_SUCCESS != ret){ - slapi_log_error(SLAPI_LOG_ERR, DNA_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_ERR, DNA_PLUGIN_SUBSYSTEM, "_dna_pre_op_modify - Failed to allocate a new ID\n"); /* Set an error string to be returned to the client. */ *errstr = slapi_ch_smprintf("Allocation of a new value for range" @@ -3808,7 +3808,7 @@ _dna_pre_op_modify(Slapi_PBlock *pb, Slapi_Entry *e, Slapi_Mods *smods, char **e } } else { /* dna_first_free_value() failed for some unknown reason */ - slapi_log_error(SLAPI_LOG_ERR, DNA_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_ERR, DNA_PLUGIN_SUBSYSTEM, "_dna_pre_op_modify - Failed to allocate a new ID!!\n"); /* Set an error string to be returned to the client. */ *errstr = slapi_ch_smprintf("Allocation of a new value for range" @@ -3826,7 +3826,7 @@ _dna_pre_op_modify(Slapi_PBlock *pb, Slapi_Entry *e, Slapi_Mods *smods, char **e * really a soft failure. */ if ((config_entry->next_range_lower == 0) && (config_entry->remaining <= config_entry->threshold)) { - slapi_log_error(SLAPI_LOG_ERR, DNA_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_ERR, DNA_PLUGIN_SUBSYSTEM, "_dna_pre_op_modify - Passed threshold of %" NSPRIu64 " remaining values " "for range %s. (%" NSPRIu64 " values remain)\n", @@ -3869,7 +3869,7 @@ dna_pre_op(Slapi_PBlock * pb, int modtype) LDAPMod **mods; int ret = 0; - slapi_log_error(SLAPI_LOG_TRACE, DNA_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_TRACE, DNA_PLUGIN_SUBSYSTEM, "--> dna_pre_op\n"); if (0 == (dn = dna_get_dn(pb))) { @@ -3884,14 +3884,14 @@ dna_pre_op(Slapi_PBlock * pb, int modtype) if (LDAP_CHANGETYPE_ADD == modtype) { slapi_pblock_get(pb, SLAPI_ADD_ENTRY, &e); if (NULL == e) { - slapi_log_error(SLAPI_LOG_PLUGIN, DNA_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_PLUGIN, DNA_PLUGIN_SUBSYSTEM, "dna_pre_op - No add entry set for add\n"); goto bail; } } else { slapi_pblock_get(pb, SLAPI_MODIFY_EXISTING_ENTRY, &e); if (NULL == e) { - slapi_log_error(SLAPI_LOG_PLUGIN, DNA_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_PLUGIN, DNA_PLUGIN_SUBSYSTEM, "dna_pre_op - No pre op entry set for modify\n"); goto bail; } @@ -3960,7 +3960,7 @@ bail: slapi_mods_free(&smods); if (ret) { - slapi_log_error(SLAPI_LOG_PLUGIN, DNA_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_PLUGIN, DNA_PLUGIN_SUBSYSTEM, "dna_pre_op - Operation failure [%d]\n", ret); slapi_send_ldap_result(pb, ret, NULL, errstr, 0, NULL); slapi_ch_free((void **)&errstr); @@ -3968,7 +3968,7 @@ bail: ret = DNA_FAILURE; } - slapi_log_error(SLAPI_LOG_TRACE, DNA_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_TRACE, DNA_PLUGIN_SUBSYSTEM, "<-- dna_pre_op\n"); return ret; @@ -4032,26 +4032,26 @@ static int dna_be_txn_pre_op(Slapi_PBlock *pb, int modtype) int numvals, e_numvals = 0; int i, len, ret = DNA_SUCCESS; - slapi_log_error(SLAPI_LOG_TRACE, DNA_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_TRACE, DNA_PLUGIN_SUBSYSTEM, "--> dna_be_txn_pre_op\n"); if (!slapi_plugin_running(pb)) { - slapi_log_error(SLAPI_LOG_TRACE, DNA_PLUGIN_SUBSYSTEM, "dna_be_txn_pre_op - Bailing, plugin not running\n"); + slapi_log_err(SLAPI_LOG_TRACE, DNA_PLUGIN_SUBSYSTEM, "dna_be_txn_pre_op - Bailing, plugin not running\n"); goto bail; } if (0 == (dn = dna_get_dn(pb))) { - slapi_log_error(SLAPI_LOG_TRACE, DNA_PLUGIN_SUBSYSTEM, "dna_be_txn_pre_op - Bailing, is dna dn\n"); + slapi_log_err(SLAPI_LOG_TRACE, DNA_PLUGIN_SUBSYSTEM, "dna_be_txn_pre_op - Bailing, is dna dn\n"); goto bail; } if (dna_dn_is_config(dn)) { - slapi_log_error(SLAPI_LOG_TRACE, DNA_PLUGIN_SUBSYSTEM, "dna_be_txn_pre_op - Bailing is dna config dn\n"); + slapi_log_err(SLAPI_LOG_TRACE, DNA_PLUGIN_SUBSYSTEM, "dna_be_txn_pre_op - Bailing is dna config dn\n"); goto bail; } if (dna_isrepl(pb)) { - slapi_log_error(SLAPI_LOG_TRACE, DNA_PLUGIN_SUBSYSTEM, "dna_be_txn_pre_op - Bailing replicated operation\n"); + slapi_log_err(SLAPI_LOG_TRACE, DNA_PLUGIN_SUBSYSTEM, "dna_be_txn_pre_op - Bailing replicated operation\n"); /* if repl, the dna values should be already in the entry. */ goto bail; } @@ -4063,7 +4063,7 @@ static int dna_be_txn_pre_op(Slapi_PBlock *pb, int modtype) } if (e == NULL) { - slapi_log_error(SLAPI_LOG_TRACE, DNA_PLUGIN_SUBSYSTEM, "dna_be_txn_pre_op - Bailing entry is NULL\n"); + slapi_log_err(SLAPI_LOG_TRACE, DNA_PLUGIN_SUBSYSTEM, "dna_be_txn_pre_op - Bailing entry is NULL\n"); goto bail; } else if (LDAP_CHANGETYPE_MODIFY == modtype) { slapi_pblock_get(pb, SLAPI_MODIFY_MODS, &mods); @@ -4075,21 +4075,21 @@ static int dna_be_txn_pre_op(Slapi_PBlock *pb, int modtype) if (!PR_CLIST_IS_EMPTY(dna_global_config)) { list = PR_LIST_HEAD(dna_global_config); - slapi_log_error(SLAPI_LOG_TRACE, DNA_PLUGIN_SUBSYSTEM, "dna_be_txn_pre_op - Using global config...\n"); + slapi_log_err(SLAPI_LOG_TRACE, DNA_PLUGIN_SUBSYSTEM, "dna_be_txn_pre_op - Using global config...\n"); while (list != dna_global_config && LDAP_SUCCESS == ret) { config_entry = (struct configEntry *) list; /* Did we already service all of these configured types? */ if (dna_list_contains_types(generated_types, config_entry->types)) { - slapi_log_error(SLAPI_LOG_TRACE, DNA_PLUGIN_SUBSYSTEM, "dna_be_txn_pre_op - All types already serviced\n"); + slapi_log_err(SLAPI_LOG_TRACE, DNA_PLUGIN_SUBSYSTEM, "dna_be_txn_pre_op - All types already serviced\n"); goto next; } /* is the entry in scope? */ if (config_entry->scope) { if (!slapi_dn_issuffix(dn, config_entry->scope)) { - slapi_log_error(SLAPI_LOG_PLUGIN, DNA_PLUGIN_SUBSYSTEM, "dna_be_txn_pre_op - Entry not in scope of dnaScope!\n"); + slapi_log_err(SLAPI_LOG_PLUGIN, DNA_PLUGIN_SUBSYSTEM, "dna_be_txn_pre_op - Entry not in scope of dnaScope!\n"); goto next; } } @@ -4097,7 +4097,7 @@ static int dna_be_txn_pre_op(Slapi_PBlock *pb, int modtype) /* is this entry in an excluded scope? */ for (i = 0; config_entry->excludescope && config_entry->excludescope[i]; i++) { if (slapi_dn_issuffix(dn, slapi_sdn_get_dn(config_entry->excludescope[i]))) { - slapi_log_error(SLAPI_LOG_PLUGIN, DNA_PLUGIN_SUBSYSTEM, "dna_be_txn_pre_op - Entry in excluded scope, next\n"); + slapi_log_err(SLAPI_LOG_PLUGIN, DNA_PLUGIN_SUBSYSTEM, "dna_be_txn_pre_op - Entry in excluded scope, next\n"); goto next; } } @@ -4105,7 +4105,7 @@ static int dna_be_txn_pre_op(Slapi_PBlock *pb, int modtype) /* does the entry match the filter? */ if (config_entry->slapi_filter) { if(LDAP_SUCCESS != slapi_vattr_filter_test(pb,e,config_entry->slapi_filter, 0)) { - slapi_log_error(SLAPI_LOG_PLUGIN, DNA_PLUGIN_SUBSYSTEM, "dna_be_txn_pre_op - Entry does not match filter\n"); + slapi_log_err(SLAPI_LOG_PLUGIN, DNA_PLUGIN_SUBSYSTEM, "dna_be_txn_pre_op - Entry does not match filter\n"); goto next; } } @@ -4291,7 +4291,7 @@ bail: slapi_ch_array_free(generated_types); if (ret) { - slapi_log_error(SLAPI_LOG_PLUGIN, DNA_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_PLUGIN, DNA_PLUGIN_SUBSYSTEM, "dna_be_txn_pre_op - Operation failure [%d]\n", ret); slapi_send_ldap_result(pb, ret, NULL, errstr, 0, NULL); slapi_ch_free((void **)&errstr); @@ -4299,7 +4299,7 @@ bail: ret = DNA_FAILURE; } - slapi_log_error(SLAPI_LOG_TRACE, DNA_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_TRACE, DNA_PLUGIN_SUBSYSTEM, "<-- dna_be_txn_pre_op\n"); return ret; @@ -4313,7 +4313,7 @@ static int dna_config_check_post_op(Slapi_PBlock * pb) return DNA_SUCCESS; } - slapi_log_error(SLAPI_LOG_TRACE, DNA_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_TRACE, DNA_PLUGIN_SUBSYSTEM, "--> dna_config_check_post_op\n"); @@ -4328,7 +4328,7 @@ static int dna_config_check_post_op(Slapi_PBlock * pb) } } - slapi_log_error(SLAPI_LOG_TRACE, DNA_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_TRACE, DNA_PLUGIN_SUBSYSTEM, "<-- dna_config_check_post_op\n"); return DNA_SUCCESS; @@ -4340,7 +4340,7 @@ static int dna_config_check_post_op(Slapi_PBlock * pb) ***************************************************/ static int dna_extend_exop_backend(Slapi_PBlock *pb, Slapi_Backend **target) { - slapi_log_error(SLAPI_LOG_TRACE, DNA_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_TRACE, DNA_PLUGIN_SUBSYSTEM, "--> dna_parse_exop_backend\n"); Slapi_DN *shared_sdn = NULL; char *shared_dn = NULL; @@ -4357,7 +4357,7 @@ static int dna_extend_exop_backend(Slapi_PBlock *pb, Slapi_Backend **target) } res = LDAP_SUCCESS; - slapi_log_error(SLAPI_LOG_TRACE, DNA_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_TRACE, DNA_PLUGIN_SUBSYSTEM, "<-- dna_parse_exop_backend %d\n", res); return res; } @@ -4378,14 +4378,14 @@ static int dna_extend_exop(Slapi_PBlock *pb) return ret; } - slapi_log_error(SLAPI_LOG_TRACE, DNA_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_TRACE, DNA_PLUGIN_SUBSYSTEM, "--> dna_extend_exop\n"); if(dna_parse_exop_ber(pb, &shared_dn) != LDAP_SUCCESS) { return ret; } - slapi_log_error(SLAPI_LOG_PLUGIN, DNA_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_PLUGIN, DNA_PLUGIN_SUBSYSTEM, "dna_extend_exop - Received range extension " "request for range [%s]\n", shared_dn); @@ -4426,7 +4426,7 @@ static int dna_extend_exop(Slapi_PBlock *pb) if (LBER_ERROR == (ber_printf(respber, "{oo}", range_low.bv_val, range_low.bv_len, range_high.bv_val, range_high.bv_len))) { - slapi_log_error(SLAPI_LOG_ERR, DNA_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_ERR, DNA_PLUGIN_SUBSYSTEM, "dna_extend_exop - Unable to encode exop response.\n"); ber_free(respber, 1); ret = LDAP_ENCODING_ERROR; @@ -4444,7 +4444,7 @@ static int dna_extend_exop(Slapi_PBlock *pb) ret = SLAPI_PLUGIN_EXTENDED_SENT_RESULT; ber_bvfree(respdata); - slapi_log_error(SLAPI_LOG_PLUGIN, DNA_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_PLUGIN, DNA_PLUGIN_SUBSYSTEM, "dna_extend_exop - Released range %" NSPRIu64 "-%" NSPRIu64 ".\n", lower, upper); } @@ -4453,7 +4453,7 @@ static int dna_extend_exop(Slapi_PBlock *pb) slapi_ch_free_string(&shared_dn); slapi_ch_free_string(&bind_dn); - slapi_log_error(SLAPI_LOG_TRACE, DNA_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_TRACE, DNA_PLUGIN_SUBSYSTEM, "<-- dna_extend_exop\n"); return ret; @@ -4476,7 +4476,7 @@ dna_release_range(char *range_dn, PRUint64 *lower, PRUint64 *upper) struct configEntry *config_entry = NULL; int set_extend_flag = 0; - slapi_log_error(SLAPI_LOG_TRACE, DNA_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_TRACE, DNA_PLUGIN_SUBSYSTEM, "--> dna_release_range\n"); if (range_dn) { @@ -4526,7 +4526,7 @@ dna_release_range(char *range_dn, PRUint64 *lower, PRUint64 *upper) slapi_lock_mutex(config_entry->extend_lock); if (config_entry->extend_in_progress) { /* We're already processing a range extention, so bail. */ - slapi_log_error(SLAPI_LOG_PLUGIN, DNA_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_PLUGIN, DNA_PLUGIN_SUBSYSTEM, "dna_release_range - Already processing a " "range extension request. Skipping request.\n"); slapi_unlock_mutex(config_entry->extend_lock); @@ -4628,7 +4628,7 @@ dna_release_range(char *range_dn, PRUint64 *lower, PRUint64 *upper) * want to give the caller any range */ *lower = 0; *upper = 0; - slapi_log_error(SLAPI_LOG_ERR, DNA_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_ERR, DNA_PLUGIN_SUBSYSTEM, "dna_release_range - Error updating " "configuration entry [err=%d]\n", ret); } @@ -4649,7 +4649,7 @@ bail: dna_unlock(); } - slapi_log_error(SLAPI_LOG_TRACE, DNA_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_TRACE, DNA_PLUGIN_SUBSYSTEM, "<-- dna_release_range\n"); return ret; diff --git a/ldap/servers/plugins/http/http_client.c b/ldap/servers/plugins/http/http_client.c index 803436d..719add0 100644 --- a/ldap/servers/plugins/http/http_client.c +++ b/ldap/servers/plugins/http/http_client.c @@ -26,28 +26,6 @@ #include "http_impl.h" #include - -/*** from proto-slap.h ***/ - -int slapd_log_error_proc( char *subsystem, int sev_level, char *fmt, ... ); - -/*** from ldaplog.h ***/ - -/* edited ldaplog.h for LDAPDebug()*/ -#ifndef _LDAPLOG_H -#define _LDAPLOG_H - -#ifdef __cplusplus -extern "C" { -#endif - - -#ifdef __cplusplus -} -#endif - -#endif /* _LDAP_H */ - #define HTTP_PLUGIN_SUBSYSTEM "http-client-plugin" /* used for logging */ #define HTTP_PLUGIN_VERSION 0x00050050 @@ -101,7 +79,7 @@ int http_client_version(void) int http_client_init(Slapi_PBlock *pb) { int status = HTTP_SUCCESS; - slapi_log_error(SLAPI_LOG_PLUGIN, HTTP_PLUGIN_SUBSYSTEM,"http_client_init - BEGIN\n"); + slapi_log_err(SLAPI_LOG_PLUGIN, HTTP_PLUGIN_SUBSYSTEM,"http_client_init - BEGIN\n"); if ( slapi_pblock_set( pb, SLAPI_PLUGIN_VERSION, SLAPI_PLUGIN_VERSION_01 ) != 0 || @@ -112,7 +90,7 @@ int http_client_init(Slapi_PBlock *pb) slapi_pblock_set( pb, SLAPI_PLUGIN_DESCRIPTION, (void *)&pdesc ) != 0 ) { - slapi_log_error(SLAPI_LOG_ERR, HTTP_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_ERR, HTTP_PLUGIN_SUBSYSTEM, "http_client_init - Failed to register plugin\n" ); status = HTTP_FAILURE; } @@ -120,12 +98,12 @@ int http_client_init(Slapi_PBlock *pb) /* Retrieve and save the plugin identity to later pass to internal operations */ if (slapi_pblock_get(pb, SLAPI_PLUGIN_IDENTITY, &plugin_id) != 0) { - slapi_log_error(SLAPI_LOG_ERR, HTTP_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_ERR, HTTP_PLUGIN_SUBSYSTEM, "http_client_init - Failed to retrieve SLAPI_PLUGIN_IDENTITY\n"); return HTTP_FAILURE; } - slapi_log_error(SLAPI_LOG_PLUGIN, HTTP_PLUGIN_SUBSYSTEM, "http_client_init - END\n"); + slapi_log_err(SLAPI_LOG_PLUGIN, HTTP_PLUGIN_SUBSYSTEM, "http_client_init - END\n"); return status; } @@ -135,7 +113,7 @@ static int http_client_start(Slapi_PBlock *pb) /** * do some init work here */ - slapi_log_error(SLAPI_LOG_PLUGIN, HTTP_PLUGIN_SUBSYSTEM,"http_client_start - BEGIN\n"); + slapi_log_err(SLAPI_LOG_PLUGIN, HTTP_PLUGIN_SUBSYSTEM,"http_client_start - BEGIN\n"); api[0] = 0; /* reserved for api broker use, must be zero */ api[1] = (void *)_http_init; @@ -146,14 +124,14 @@ static int http_client_start(Slapi_PBlock *pb) api[6] = (void *)_http_post; if( slapi_apib_register(HTTP_v1_0_GUID, api) ) { - slapi_log_error(SLAPI_LOG_ERR, HTTP_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_ERR, HTTP_PLUGIN_SUBSYSTEM, "http_client_start: failed to register functions\n" ); status = HTTP_FAILURE; } _http_init(plugin_id); - slapi_log_error(SLAPI_LOG_PLUGIN, HTTP_PLUGIN_SUBSYSTEM, "http_client_start - END\n"); + slapi_log_err(SLAPI_LOG_PLUGIN, HTTP_PLUGIN_SUBSYSTEM, "http_client_start - END\n"); return status; } @@ -163,11 +141,11 @@ static int http_client_close(Slapi_PBlock *pb) /** * do cleanup */ - slapi_log_error(SLAPI_LOG_PLUGIN, HTTP_PLUGIN_SUBSYSTEM, "http_client_close - BEGIN\n"); + slapi_log_err(SLAPI_LOG_PLUGIN, HTTP_PLUGIN_SUBSYSTEM, "http_client_close - BEGIN\n"); slapi_apib_unregister(HTTP_v1_0_GUID); - slapi_log_error(SLAPI_LOG_PLUGIN, HTTP_PLUGIN_SUBSYSTEM, "http_client_close - END\n"); + slapi_log_err(SLAPI_LOG_PLUGIN, HTTP_PLUGIN_SUBSYSTEM, "http_client_close - END\n"); return status; } @@ -177,11 +155,11 @@ static int http_client_close(Slapi_PBlock *pb) */ static void _http_init(Slapi_ComponentId *plugin_id) { - slapi_log_error(SLAPI_LOG_PLUGIN, HTTP_PLUGIN_SUBSYSTEM, "_http_init - BEGIN\n"); + slapi_log_err(SLAPI_LOG_PLUGIN, HTTP_PLUGIN_SUBSYSTEM, "_http_init - BEGIN\n"); http_impl_init(plugin_id); - slapi_log_error(SLAPI_LOG_PLUGIN, HTTP_PLUGIN_SUBSYSTEM, "_http_init - END\n"); + slapi_log_err(SLAPI_LOG_PLUGIN, HTTP_PLUGIN_SUBSYSTEM, "_http_init - END\n"); } /** @@ -191,11 +169,11 @@ static void _http_init(Slapi_ComponentId *plugin_id) static int _http_get_text(char *url, char **data, int *bytesRead) { int status = HTTP_SUCCESS; - slapi_log_error(SLAPI_LOG_PLUGIN, HTTP_PLUGIN_SUBSYSTEM, "_http_get_text - BEGIN\n"); + slapi_log_err(SLAPI_LOG_PLUGIN, HTTP_PLUGIN_SUBSYSTEM, "_http_get_text - BEGIN\n"); status = http_impl_get_text(url, data, bytesRead); - slapi_log_error(SLAPI_LOG_PLUGIN, HTTP_PLUGIN_SUBSYSTEM, "_http_get_text - END\n"); + slapi_log_err(SLAPI_LOG_PLUGIN, HTTP_PLUGIN_SUBSYSTEM, "_http_get_text - END\n"); return status; } @@ -206,11 +184,11 @@ static int _http_get_text(char *url, char **data, int *bytesRead) static int _http_get_binary(char *url, char **data, int *bytesRead) { int status = HTTP_SUCCESS; - slapi_log_error(SLAPI_LOG_PLUGIN, HTTP_PLUGIN_SUBSYSTEM, "_http_get_binary - BEGIN\n"); + slapi_log_err(SLAPI_LOG_PLUGIN, HTTP_PLUGIN_SUBSYSTEM, "_http_get_binary - BEGIN\n"); status = http_impl_get_binary(url, data, bytesRead); - slapi_log_error(SLAPI_LOG_PLUGIN, HTTP_PLUGIN_SUBSYSTEM, "_http_get_binary - END\n"); + slapi_log_err(SLAPI_LOG_PLUGIN, HTTP_PLUGIN_SUBSYSTEM, "_http_get_binary - END\n"); return status; } @@ -221,11 +199,11 @@ static int _http_get_binary(char *url, char **data, int *bytesRead) static int _http_get_redirected_uri(char *url, char **data, int *bytesRead) { int status = HTTP_SUCCESS; - slapi_log_error(SLAPI_LOG_PLUGIN, HTTP_PLUGIN_SUBSYSTEM, "_http_get_redirected_uri -- BEGIN\n"); + slapi_log_err(SLAPI_LOG_PLUGIN, HTTP_PLUGIN_SUBSYSTEM, "_http_get_redirected_uri -- BEGIN\n"); status = http_impl_get_redirected_uri(url, data, bytesRead); - slapi_log_error(SLAPI_LOG_PLUGIN, HTTP_PLUGIN_SUBSYSTEM, "_http_get_redirected_uri -- END\n"); + slapi_log_err(SLAPI_LOG_PLUGIN, HTTP_PLUGIN_SUBSYSTEM, "_http_get_redirected_uri -- END\n"); return status; } @@ -235,11 +213,11 @@ static int _http_get_redirected_uri(char *url, char **data, int *bytesRead) static int _http_post(char *url, httpheader ** httpheaderArray, char *body, char **data, int *bytesRead) { int status = HTTP_SUCCESS; - slapi_log_error(SLAPI_LOG_PLUGIN, HTTP_PLUGIN_SUBSYSTEM, "_http_post - BEGIN\n"); + slapi_log_err(SLAPI_LOG_PLUGIN, HTTP_PLUGIN_SUBSYSTEM, "_http_post - BEGIN\n"); status = http_impl_post(url, httpheaderArray, body, data, bytesRead); - slapi_log_error(SLAPI_LOG_PLUGIN, HTTP_PLUGIN_SUBSYSTEM, "_http_post - END\n"); + slapi_log_err(SLAPI_LOG_PLUGIN, HTTP_PLUGIN_SUBSYSTEM, "_http_post - END\n"); return status; } @@ -248,10 +226,10 @@ static int _http_post(char *url, httpheader ** httpheaderArray, char *body, char */ static void _http_shutdown( void ) { - slapi_log_error(SLAPI_LOG_PLUGIN, HTTP_PLUGIN_SUBSYSTEM, "_http_shutdown - BEGIN\n"); + slapi_log_err(SLAPI_LOG_PLUGIN, HTTP_PLUGIN_SUBSYSTEM, "_http_shutdown - BEGIN\n"); http_impl_shutdown(); - slapi_log_error(SLAPI_LOG_PLUGIN, HTTP_PLUGIN_SUBSYSTEM, "_http_shutdown - END\n"); + slapi_log_err(SLAPI_LOG_PLUGIN, HTTP_PLUGIN_SUBSYSTEM, "_http_shutdown - END\n"); } diff --git a/ldap/servers/plugins/http/http_impl.c b/ldap/servers/plugins/http/http_impl.c index a3d2d6e..a03c5f2 100644 --- a/ldap/servers/plugins/http/http_impl.c +++ b/ldap/servers/plugins/http/http_impl.c @@ -33,45 +33,19 @@ #include "slapi-plugin-compat4.h" #include -/*** from proto-slap.h ***/ - -int slapd_log_error_proc( int loglevel, char *subsystem, char *fmt, ... ); - -/*** from ldaplog.h ***/ - -/* edited ldaplog.h for LDAPDebug()*/ -#ifndef _LDAPLOG_H -#define _LDAPLOG_H - #ifdef __cplusplus extern "C" { #endif #ifdef BUILD_STANDALONE -#define slapi_log_error(a,b,c,d) printf((c),(d)) +#define slapi_log_err(a,b,c,d) printf((c),(d)) #define stricmp strcasecmp #endif -#define LDAP_DEBUG_TRACE 0x00001 /* 1 */ -#define LDAP_DEBUG_ANY 0x04000 /* 16384 */ -#define LDAP_DEBUG_PLUGIN 0x10000 /* 65536 */ - -/* debugging stuff */ - -extern int slapd_ldap_debug; -#define LDAPDebug( level, fmt, arg1, arg2, arg3 ) \ -{ \ - if ( slapd_ldap_debug & level ) { \ - slapd_log_error_proc( level, NULL, fmt, arg1, arg2, arg3 ); \ - } \ -} - #ifdef __cplusplus } #endif -#endif /* _LDAP_H */ - #define HTTP_PLUGIN_SUBSYSTEM "http-client-plugin" /* used for logging */ #define HTTP_IMPL_SUCCESS 0 @@ -182,14 +156,14 @@ static int doRequestRetry(const char *url, httpheader **httpheaderArray, char *b retrycnt = httpConfig->retryCount; if (retrycnt == 0) { - slapi_log_error(SLAPI_LOG_PLUGIN, HTTP_PLUGIN_SUBSYSTEM, "doRequestRetry - Retry Count cannot be read. Setting to default value of 3\n"); + slapi_log_err(SLAPI_LOG_PLUGIN, HTTP_PLUGIN_SUBSYSTEM, "doRequestRetry - Retry Count cannot be read. Setting to default value of 3\n"); retrycnt = 3; } status = doRequest(url, httpheaderArray, body, buf, bytesRead, reqType); if (status != HTTP_IMPL_SUCCESS) { - slapi_log_error(SLAPI_LOG_PLUGIN, HTTP_PLUGIN_SUBSYSTEM, "doRequestRetry - Failed to perform http request \n"); + slapi_log_err(SLAPI_LOG_PLUGIN, HTTP_PLUGIN_SUBSYSTEM, "doRequestRetry - Failed to perform http request \n"); while (retrycnt > 0) { - slapi_log_error(SLAPI_LOG_PLUGIN, HTTP_PLUGIN_SUBSYSTEM, "doRequestRetry - Retrying http request %d.\n", i); + slapi_log_err(SLAPI_LOG_PLUGIN, HTTP_PLUGIN_SUBSYSTEM, "doRequestRetry - Retrying http request %d.\n", i); status = doRequest(url, httpheaderArray, body, buf, bytesRead, reqType); if (status == HTTP_IMPL_SUCCESS) { break; @@ -198,8 +172,8 @@ static int doRequestRetry(const char *url, httpheader **httpheaderArray, char *b i++; } if (status != HTTP_IMPL_SUCCESS) { - slapi_log_error(SLAPI_LOG_ERR, HTTP_PLUGIN_SUBSYSTEM, "doRequestRetry - Failed to perform http request after %d attempts.\n", i); - slapi_log_error(SLAPI_LOG_ERR, HTTP_PLUGIN_SUBSYSTEM, "doRequestRetry - Verify plugin URI configuration and contact Directory Administrator.\n"); + slapi_log_err(SLAPI_LOG_ERR, HTTP_PLUGIN_SUBSYSTEM, "doRequestRetry - Failed to perform http request after %d attempts.\n", i); + slapi_log_err(SLAPI_LOG_ERR, HTTP_PLUGIN_SUBSYSTEM, "doRequestRetry - Verify plugin URI configuration and contact Directory Administrator.\n"); } } @@ -219,18 +193,18 @@ static int doRequest(const char *url, httpheader **httpheaderArray, char *body, PRInt32 http_connection_time_out = 0; PRInt32 sslOn = 0; - slapi_log_error(SLAPI_LOG_PLUGIN, HTTP_PLUGIN_SUBSYSTEM, "doRequest - BEGIN\n"); - slapi_log_error(SLAPI_LOG_PLUGIN, HTTP_PLUGIN_SUBSYSTEM, "doRequest - url=[%s] \n",url); + slapi_log_err(SLAPI_LOG_PLUGIN, HTTP_PLUGIN_SUBSYSTEM, "doRequest - BEGIN\n"); + slapi_log_err(SLAPI_LOG_PLUGIN, HTTP_PLUGIN_SUBSYSTEM, "doRequest - url=[%s] \n",url); /* Parse the URL and initialize the host, port, path */ if (parseURI(url, &host, &port, &path, &sslOn) == PR_FAILURE) { - slapi_log_error(SLAPI_LOG_ERR, HTTP_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_ERR, HTTP_PLUGIN_SUBSYSTEM, "doRequest: %s \n", HTTP_ERROR_BAD_URL); status = PR_FAILURE; goto bail; } - slapi_log_error(SLAPI_LOG_PLUGIN, HTTP_PLUGIN_SUBSYSTEM, "doRequest - host=[%s] port[%d] path[%s] \n",host,port,path); + slapi_log_err(SLAPI_LOG_PLUGIN, HTTP_PLUGIN_SUBSYSTEM, "doRequest - host=[%s] port[%d] path[%s] \n",host,port,path); /* Initialize the Net Addr */ if (PR_StringToNetAddr(host, &addr) == PR_FAILURE) { @@ -241,7 +215,7 @@ static int doRequest(const char *url, httpheader **httpheaderArray, char *body, if (status == PR_SUCCESS) { PR_EnumerateHostEnt(0, &ent, (PRUint16)port, &addr); } else { - slapi_log_error(SLAPI_LOG_ERR, HTTP_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_ERR, HTTP_PLUGIN_SUBSYSTEM, "doRequest - %s\n", HTTP_ERROR_NET_ADDR); status = HTTP_CLIENT_ERROR_NET_ADDR; goto bail; @@ -250,18 +224,18 @@ static int doRequest(const char *url, httpheader **httpheaderArray, char *body, addr.inet.port = (PRUint16)port; } - slapi_log_error(SLAPI_LOG_PLUGIN, HTTP_PLUGIN_SUBSYSTEM, "doRequest - Successfully created NetAddr \n"); + slapi_log_err(SLAPI_LOG_PLUGIN, HTTP_PLUGIN_SUBSYSTEM, "doRequest - Successfully created NetAddr \n"); /* open a TCP connection to the server */ fd = PR_NewTCPSocket(); if (!fd) { - slapi_log_error(SLAPI_LOG_ERR, HTTP_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_ERR, HTTP_PLUGIN_SUBSYSTEM, "doRequest - %s\n", HTTP_ERROR_SOCKET_CREATE); status = HTTP_CLIENT_ERROR_SOCKET_CREATE; goto bail; } - slapi_log_error(SLAPI_LOG_PLUGIN, HTTP_PLUGIN_SUBSYSTEM, "doRequest - Successfully created New TCP Socket \n"); + slapi_log_err(SLAPI_LOG_PLUGIN, HTTP_PLUGIN_SUBSYSTEM, "doRequest - Successfully created New TCP Socket \n"); /* immediately send the response */ setTCPNoDelay(fd); @@ -269,7 +243,7 @@ static int doRequest(const char *url, httpheader **httpheaderArray, char *body, if (sslOn) { fd = setupSSLSocket(fd); if (fd == NULL) { - slapi_log_error(SLAPI_LOG_ERR, HTTP_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_ERR, HTTP_PLUGIN_SUBSYSTEM, "doRequest - %s\n", HTTP_ERROR_SSLSOCKET_CREATE); status = HTTP_CLIENT_ERROR_SSLSOCKET_CREATE; goto bail; @@ -277,7 +251,7 @@ static int doRequest(const char *url, httpheader **httpheaderArray, char *body, if (SSL_SetURL(fd, host) != 0) { errcode = PR_GetError(); - slapi_log_error(SLAPI_LOG_ERR, HTTP_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_ERR, HTTP_PLUGIN_SUBSYSTEM, "doRequest - SSL_SetURL -> NSPR Error code (%d) \n", errcode); status = HTTP_CLIENT_ERROR_SSLSOCKET_CREATE; goto bail; @@ -289,19 +263,19 @@ static int doRequest(const char *url, httpheader **httpheaderArray, char *body, /* connect to the host */ if (PR_Connect(fd, &addr, PR_MillisecondsToInterval(http_connection_time_out)) == PR_FAILURE) { errcode = PR_GetError(); - slapi_log_error(SLAPI_LOG_ERR, HTTP_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_ERR, HTTP_PLUGIN_SUBSYSTEM, "doRequest - %s (%s:%d) -> NSPR Error code (%d)\n", HTTP_ERROR_CONNECT_FAILED, host, addr.inet.port, errcode); status = HTTP_CLIENT_ERROR_CONNECT_FAILED; goto bail; } - LDAPDebug(LDAP_DEBUG_PLUGIN, "----------> Successfully connected to host [%s] \n",host,0,0); + slapi_log_err(SLAPI_LOG_PLUGIN, HTTP_PLUGIN_SUBSYSTEM, "doRequest - Successfully connected to host [%s] \n",host); /* send the request to the server */ if (reqType == HTTP_REQ_TYPE_POST) { if (sendPostReq(fd, path, httpheaderArray, body) == PR_FAILURE) { - slapi_log_error(SLAPI_LOG_ERR, HTTP_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_ERR, HTTP_PLUGIN_SUBSYSTEM, "doRequest - sendPostReq: %s (%s)\n", HTTP_ERROR_SEND_REQ, path); status = HTTP_CLIENT_ERROR_SEND_REQ; goto bail; @@ -309,23 +283,23 @@ static int doRequest(const char *url, httpheader **httpheaderArray, char *body, } else { if (sendGetReq(fd, path) == PR_FAILURE) { - slapi_log_error(SLAPI_LOG_ERR, HTTP_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_ERR, HTTP_PLUGIN_SUBSYSTEM, "doRequest - sendGetReq: %s (%s)\n", HTTP_ERROR_SEND_REQ, path); status = HTTP_CLIENT_ERROR_SEND_REQ; goto bail; } } - slapi_log_error(SLAPI_LOG_PLUGIN, HTTP_PLUGIN_SUBSYSTEM, "doRequest - Successfully sent the request [%s] \n",path); + slapi_log_err(SLAPI_LOG_PLUGIN, HTTP_PLUGIN_SUBSYSTEM, "doRequest - Successfully sent the request [%s] \n",path); /* read the response */ if (processResponse(fd, buf, bytesRead, reqType) == PR_FAILURE) { - slapi_log_error(SLAPI_LOG_ERR, HTTP_PLUGIN_SUBSYSTEM, - "doRequest: %s (%s)\n", HTTP_ERROR_BAD_RESPONSE, url); + slapi_log_err(SLAPI_LOG_ERR, HTTP_PLUGIN_SUBSYSTEM, + "doRequest - %s (%s)\n", HTTP_ERROR_BAD_RESPONSE, url); status = HTTP_CLIENT_ERROR_BAD_RESPONSE; goto bail; } - slapi_log_error(SLAPI_LOG_PLUGIN, HTTP_PLUGIN_SUBSYSTEM, "doRequest - Successfully read the response\n"); + slapi_log_err(SLAPI_LOG_PLUGIN, HTTP_PLUGIN_SUBSYSTEM, "doRequest - Successfully read the response\n"); bail: if (host) { PR_Free(host); @@ -337,7 +311,7 @@ bail: PR_Close(fd); fd = NULL; } - slapi_log_error(SLAPI_LOG_PLUGIN, HTTP_PLUGIN_SUBSYSTEM, "doRequest - END\n"); + slapi_log_err(SLAPI_LOG_PLUGIN, HTTP_PLUGIN_SUBSYSTEM, "doRequest - END\n"); return status; } @@ -367,7 +341,7 @@ static PRStatus processResponse(PRFileDesc *fd, char **resBUF, int *bytesRead, i * the HTTP_DEFAULT_BUFFER_SIZE, it will cause the server to crash. A 4k * buffer should be good enough. */ - slapi_log_error(SLAPI_LOG_PLUGIN, HTTP_PLUGIN_SUBSYSTEM, "processResponse - BEGIN\n"); + slapi_log_err(SLAPI_LOG_PLUGIN, HTTP_PLUGIN_SUBSYSTEM, "processResponse - BEGIN\n"); headers = (char *)PR_Calloc(1, 4 * HTTP_DEFAULT_BUFFER_SIZE); /* Get protocol string */ @@ -389,7 +363,7 @@ static PRStatus processResponse(PRFileDesc *fd, char **resBUF, int *bytesRead, i tmp[index] = '\0'; protocol = PL_strdup(tmp); - slapi_log_error(SLAPI_LOG_PLUGIN, HTTP_PLUGIN_SUBSYSTEM, "processResponse - protocol=[%s] \n",protocol); + slapi_log_err(SLAPI_LOG_PLUGIN, HTTP_PLUGIN_SUBSYSTEM, "processResponse - protocol=[%s] \n",protocol); /* Get status num */ index = 0; @@ -411,7 +385,7 @@ static PRStatus processResponse(PRFileDesc *fd, char **resBUF, int *bytesRead, i statusNum = PL_strdup(tmp); retcode=atoi(tmp); - slapi_log_error(SLAPI_LOG_PLUGIN, HTTP_PLUGIN_SUBSYSTEM, "processResponse - statusNum=[%s] \n",statusNum); + slapi_log_err(SLAPI_LOG_PLUGIN, HTTP_PLUGIN_SUBSYSTEM, "processResponse - statusNum=[%s] \n",statusNum); if (HTTP_RESPONSE_REDIRECT && (reqType == HTTP_REQ_TYPE_REDIRECT)) { isRedirect = PR_TRUE; @@ -432,7 +406,7 @@ static PRStatus processResponse(PRFileDesc *fd, char **resBUF, int *bytesRead, i } tmp[index] = '\0'; statusString = PL_strdup(tmp); - slapi_log_error(SLAPI_LOG_PLUGIN, HTTP_PLUGIN_SUBSYSTEM, "processResponse - statusString [%s] \n",statusString); + slapi_log_err(SLAPI_LOG_PLUGIN, HTTP_PLUGIN_SUBSYSTEM, "processResponse - statusString [%s] \n",statusString); } /** @@ -506,7 +480,7 @@ static PRStatus processResponse(PRFileDesc *fd, char **resBUF, int *bytesRead, i value[index] = '\0'; index = 0; inName = PR_TRUE; - slapi_log_error(SLAPI_LOG_PLUGIN, HTTP_PLUGIN_SUBSYSTEM, "processResponse - name=[%s] value=[%s]\n",name,value); + slapi_log_err(SLAPI_LOG_PLUGIN, HTTP_PLUGIN_SUBSYSTEM, "processResponse - name=[%s] value=[%s]\n",name,value); if (isRedirect && !PL_strcasecmp(name,"location")) { location = PL_strdup(value); } @@ -529,7 +503,7 @@ static PRStatus processResponse(PRFileDesc *fd, char **resBUF, int *bytesRead, i *resBUF = PL_strdup(location); *bytesRead = strlen(location); } - slapi_log_error(SLAPI_LOG_PLUGIN, HTTP_PLUGIN_SUBSYSTEM, "processResponse - Response Buffer=[%s] bytesRead=[%d] \n",*resBUF,*bytesRead); + slapi_log_err(SLAPI_LOG_PLUGIN, HTTP_PLUGIN_SUBSYSTEM, "processResponse -Response Buffer=[%s] bytesRead=[%d] \n",*resBUF,*bytesRead); bail: @@ -549,7 +523,7 @@ bail: PL_strfree(location); } - slapi_log_error(SLAPI_LOG_PLUGIN, HTTP_PLUGIN_SUBSYSTEM, "processResponse - END\n"); + slapi_log_err(SLAPI_LOG_PLUGIN, HTTP_PLUGIN_SUBSYSTEM, "processResponse - END\n"); return status; } @@ -601,10 +575,10 @@ static PRStatus sendFullData( PRFileDesc *fd, char *buf, int timeOut) else { errcode = PR_GetError(); - slapi_log_error(SLAPI_LOG_ERR, HTTP_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_ERR, HTTP_PLUGIN_SUBSYSTEM, "sendFullData - dataSent=%d bufLen=%d -> NSPR Error code (%d)\n", dataSent, bufLen, errcode); - slapi_log_error(SLAPI_LOG_PLUGIN, HTTP_PLUGIN_SUBSYSTEM, "sendFullData - NSPR Error code (%d) \n", errcode); + slapi_log_err(SLAPI_LOG_PLUGIN, HTTP_PLUGIN_SUBSYSTEM, "sendFullData - NSPR Error code (%d) \n", errcode); return PR_FAILURE; } } @@ -674,7 +648,7 @@ static PRStatus sendPostReq(PRFileDesc *fd, const char *path, httpheader **httph } strcat(reqBUF, "\0"); - slapi_log_error(SLAPI_LOG_PLUGIN, HTTP_PLUGIN_SUBSYSTEM, "sendPostRequest - reqBUF is %s \n",reqBUF); + slapi_log_err(SLAPI_LOG_PLUGIN, HTTP_PLUGIN_SUBSYSTEM, "sendPostReq - reqBUF is %s \n",reqBUF); http_connection_time_out = httpConfig->connectionTimeOut; status = sendFullData( fd, reqBUF, http_connection_time_out); @@ -692,7 +666,7 @@ static PRStatus getChar(PRFileDesc *fd, char *buf) PRInt32 bytesRead = http_read(fd, buf, 1); if (bytesRead <=0) { PRInt32 errcode = PR_GetError(); - slapi_log_error(SLAPI_LOG_ERR, HTTP_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_ERR, HTTP_PLUGIN_SUBSYSTEM, "sendPostReq - " "getChar - NSPR Error code (%d)\n", errcode); return PR_FAILURE; } @@ -962,32 +936,32 @@ PRFileDesc* setupSSLSocket(PRFileDesc* fd) socketOption.option = PR_SockOpt_Nonblocking; socketOption.value.non_blocking = PR_FALSE; if( PR_SetSocketOption(fd, &socketOption) != 0) { - slapi_log_error(SLAPI_LOG_PLUGIN, HTTP_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_PLUGIN, HTTP_PLUGIN_SUBSYSTEM, "setupSSLSocket - Cannot set socket option NSS \n"); return NULL; } sslSocket = SSL_ImportFD(NULL, fd); if (!sslSocket) { - slapi_log_error(SLAPI_LOG_PLUGIN, HTTP_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_PLUGIN, HTTP_PLUGIN_SUBSYSTEM, "setupSSLSocket - Cannot import to SSL Socket\n" ); goto sslbail; } - slapi_log_error(SLAPI_LOG_ERR, HTTP_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_ERR, HTTP_PLUGIN_SUBSYSTEM, "setupSSLSocket - setupssl socket created\n" ); secStatus = SSL_OptionSet(sslSocket, SSL_SECURITY, 1); if (SECSuccess != secStatus) { - slapi_log_error(SLAPI_LOG_PLUGIN, HTTP_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_PLUGIN, HTTP_PLUGIN_SUBSYSTEM, "setupSSLSocket - Cannot set SSL_SECURITY option\n"); goto sslbail; } secStatus = SSL_OptionSet(sslSocket, SSL_HANDSHAKE_AS_CLIENT, 1); if (SECSuccess != secStatus) { - slapi_log_error(SLAPI_LOG_PLUGIN, HTTP_PLUGIN_SUBSYSTEM, - "setupSSLSocket - CAnnot set SSL_HANDSHAKE_AS_CLIENT option\n"); + slapi_log_err(SLAPI_LOG_PLUGIN, HTTP_PLUGIN_SUBSYSTEM, + "setupSSLSocket - Cannot set SSL_HANDSHAKE_AS_CLIENT option\n"); goto sslbail; } @@ -997,8 +971,8 @@ PRFileDesc* setupSSLSocket(PRFileDesc* fd) (SSLGetClientAuthData) getClientAuthData, (void *)certNickname); if (secStatus != SECSuccess) { - slapi_log_error(SLAPI_LOG_PLUGIN, HTTP_PLUGIN_SUBSYSTEM, - "setupSSLSocket: SSL_GetClientAuthDataHook Failed\n"); + slapi_log_err(SLAPI_LOG_PLUGIN, HTTP_PLUGIN_SUBSYSTEM, + "setupSSLSocket - SSL_GetClientAuthDataHook Failed\n"); goto sslbail; } @@ -1006,7 +980,7 @@ PRFileDesc* setupSSLSocket(PRFileDesc* fd) (SSLAuthCertificate) authCertificate, (void *)CERT_GetDefaultCertDB()); if (secStatus != SECSuccess) { - slapi_log_error(SLAPI_LOG_PLUGIN, HTTP_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_PLUGIN, HTTP_PLUGIN_SUBSYSTEM, "setupSSLSocket - SSL_AuthCertificateHook Failed\n"); goto sslbail; } @@ -1014,7 +988,7 @@ PRFileDesc* setupSSLSocket(PRFileDesc* fd) secStatus = SSL_BadCertHook(sslSocket, (SSLBadCertHandler) badCertHandler, NULL); if (secStatus != SECSuccess) { - slapi_log_error(SLAPI_LOG_PLUGIN, HTTP_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_PLUGIN, HTTP_PLUGIN_SUBSYSTEM, "setupSSLSocket - SSL_BadCertHook Failed\n"); goto sslbail; } @@ -1022,7 +996,7 @@ PRFileDesc* setupSSLSocket(PRFileDesc* fd) secStatus = SSL_HandshakeCallback(sslSocket, (SSLHandshakeCallback) handshakeCallback, NULL); if (secStatus != SECSuccess) { - slapi_log_error(SLAPI_LOG_PLUGIN, HTTP_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_PLUGIN, HTTP_PLUGIN_SUBSYSTEM, "setupSSLSocket - SSL_HandshakeCallback Failed\n"); goto sslbail; } @@ -1046,7 +1020,7 @@ authCertificate(void *arg, PRFileDesc *socket, SECStatus secStatus; if (!arg || !socket) { - slapi_log_error(SLAPI_LOG_PLUGIN, HTTP_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_PLUGIN, HTTP_PLUGIN_SUBSYSTEM, "authCertificate - Faulty socket in callback function\n"); return SECFailure; } @@ -1121,7 +1095,7 @@ badCertHandler(void *arg, PRFileDesc *socket) break; } - slapi_log_error(SLAPI_LOG_PLUGIN, HTTP_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_PLUGIN, HTTP_PLUGIN_SUBSYSTEM, "badCertHandler - Bad certificate: %d\n", err); return secStatus; @@ -1199,7 +1173,7 @@ SECStatus SECStatus handshakeCallback(PRFileDesc *socket, void *arg) { - slapi_log_error(SLAPI_LOG_PLUGIN, HTTP_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_PLUGIN, HTTP_PLUGIN_SUBSYSTEM, "handshakeCallback - Handshake has completed, ready to send data securely.\n"); return SECSuccess; } @@ -1211,28 +1185,28 @@ handshakeCallback(PRFileDesc *socket, void *arg) int http_impl_init(Slapi_ComponentId *plugin_id) { int status = HTTP_IMPL_SUCCESS; - slapi_log_error(SLAPI_LOG_PLUGIN, HTTP_PLUGIN_SUBSYSTEM, - "-> http_impl_init \n"); + slapi_log_err(SLAPI_LOG_PLUGIN, HTTP_PLUGIN_SUBSYSTEM, + "-> http_impl_init\n"); httpConfig = NULL; httpConfig = (httpPluginConfig *) slapi_ch_calloc(1, sizeof(httpPluginConfig)); status = readConfigLDAPurl(plugin_id, HTTP_PLUGIN_DN); if (status != 0) { - slapi_log_error(SLAPI_LOG_ERR, HTTP_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_ERR, HTTP_PLUGIN_SUBSYSTEM, "http_impl_init - Unable to get HTTP config information \n"); return HTTP_IMPL_FAILURE; } status = readConfigLDAPurl(plugin_id, CONFIG_DN); if (status != 0) { - slapi_log_error(SLAPI_LOG_ERR, HTTP_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_ERR, HTTP_PLUGIN_SUBSYSTEM, "http_impl_init - Unable to get config information \n"); return HTTP_IMPL_FAILURE; } - slapi_log_error(SLAPI_LOG_PLUGIN, HTTP_PLUGIN_SUBSYSTEM, - "<- http_impl_init \n"); + slapi_log_err(SLAPI_LOG_PLUGIN, HTTP_PLUGIN_SUBSYSTEM, + "<- http_impl_init\n"); return status; @@ -1285,14 +1259,14 @@ static int readConfigLDAPurl(Slapi_ComponentId *plugin_id, char *plugindn) { rc = slapi_search_internal_get_entry(sdn, NULL, &entry, plugin_id); slapi_sdn_free(&sdn); if (rc != LDAP_SUCCESS) { - slapi_log_error(SLAPI_LOG_PLUGIN, HTTP_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_PLUGIN, HTTP_PLUGIN_SUBSYSTEM, "readConfigLDAPurl - Could not find entry %s (error %d)\n", plugindn, rc); status = HTTP_IMPL_FAILURE; return status; } if (NULL == entry) { - slapi_log_error(SLAPI_LOG_PLUGIN, HTTP_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_PLUGIN, HTTP_PLUGIN_SUBSYSTEM, "readConfigLDAPurl - No entries found for <%s>\n", plugindn); status = HTTP_IMPL_FAILURE; @@ -1342,7 +1316,7 @@ static int parseHTTPConfigEntry(Slapi_Entry *e) httpConfig->connectionTimeOut = value; } else { - LDAPDebug(LDAP_DEBUG_PLUGIN, "parseHTTPConfigEntry - HTTP Connection Time Out cannot be read. Setting to default value of 5000 ms \n", 0,0,0); + slapi_log_err(SLAPI_LOG_PLUGIN, HTTP_PLUGIN_SUBSYSTEM, "parseHTTPConfigEntry - HTTP Connection Time Out cannot be read. Setting to default value of 5000 ms \n"); httpConfig->connectionTimeOut = 5000; } @@ -1352,7 +1326,7 @@ static int parseHTTPConfigEntry(Slapi_Entry *e) httpConfig->readTimeOut = value; } else { - LDAPDebug(LDAP_DEBUG_PLUGIN, "parseHTTPConfigEntry - HTTP Read Time Out cannot be read. Setting to default value of 5000 ms \n", 0,0,0); + slapi_log_err(SLAPI_LOG_PLUGIN, HTTP_PLUGIN_SUBSYSTEM, "parseHTTPConfigEntry - HTTP Read Time Out cannot be read. Setting to default value of 5000 ms \n"); httpConfig->readTimeOut = 5000; } diff --git a/ldap/servers/plugins/linkedattrs/fixup_task.c b/ldap/servers/plugins/linkedattrs/fixup_task.c index befc6cd..5648db0 100644 --- a/ldap/servers/plugins/linkedattrs/fixup_task.c +++ b/ldap/servers/plugins/linkedattrs/fixup_task.c @@ -71,7 +71,7 @@ linked_attrs_fixup_task_add(Slapi_PBlock *pb, Slapi_Entry *e, (void *)task, PR_PRIORITY_NORMAL, PR_GLOBAL_THREAD, PR_UNJOINABLE_THREAD, SLAPD_DEFAULT_THREAD_STACKSIZE); if (thread == NULL) { - slapi_log_error(SLAPI_LOG_ERR, LINK_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_ERR, LINK_PLUGIN_SUBSYSTEM, "linked_attrs_fixup_task_add - Unable to create task thread!\n"); *returncode = LDAP_OPERATIONS_ERROR; slapi_task_finish(task, *returncode); @@ -116,7 +116,7 @@ linked_attrs_fixup_task_thread(void *arg) return; /* no task */ } slapi_task_inc_refcount(task); - slapi_log_error(SLAPI_LOG_PLUGIN, LINK_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_PLUGIN, LINK_PLUGIN_SUBSYSTEM, "linked_attrs_fixup_task_thread --> refcount incremented.\n" ); /* Fetch our task data from the task */ td = (task_data *)slapi_task_get_data(task); @@ -128,7 +128,7 @@ linked_attrs_fixup_task_thread(void *arg) slapi_task_begin(task, 1); slapi_task_log_notice(task, "Linked attributes fixup task starting (link dn: \"%s\") ...\n", td->linkdn ? td->linkdn : ""); - slapi_log_error(SLAPI_LOG_INFO, LINK_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_INFO, LINK_PLUGIN_SUBSYSTEM, "linked_attrs_fixup_task_thread - Syntax validate task starting (link dn: \"%s\") ...\n", td->linkdn ? td->linkdn : ""); @@ -147,7 +147,7 @@ linked_attrs_fixup_task_thread(void *arg) found_config = 1; slapi_task_log_notice(task, "Fixing up linked attribute pair (%s)\n", config_entry->dn); - slapi_log_error(SLAPI_LOG_INFO, LINK_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_INFO, LINK_PLUGIN_SUBSYSTEM, "linked_attrs_fixup_task_thread - Fixing up linked attribute pair (%s)\n", config_entry->dn); linked_attrs_fixup_links(config_entry); @@ -157,7 +157,7 @@ linked_attrs_fixup_task_thread(void *arg) /* No config DN was supplied, so fix up all configured links. */ slapi_task_log_notice(task, "Fixing up linked attribute pair (%s)\n", config_entry->dn); - slapi_log_error(SLAPI_LOG_INFO, LINK_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_INFO, LINK_PLUGIN_SUBSYSTEM, "linked_attrs_fixup_task_thread - Fixing up linked attribute pair (%s)\n", config_entry->dn); linked_attrs_fixup_links(config_entry); @@ -171,7 +171,7 @@ linked_attrs_fixup_task_thread(void *arg) if (td->linkdn && !found_config) { slapi_task_log_notice(task, "Requested link config DN not found (%s)\n", td->linkdn); - slapi_log_error(SLAPI_LOG_ERR, LINK_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_ERR, LINK_PLUGIN_SUBSYSTEM, "linked_attrs_fixup_task_thread - Requested link config DN not found (%s)\n", td->linkdn); } @@ -180,14 +180,14 @@ linked_attrs_fixup_task_thread(void *arg) /* Log finished message. */ slapi_task_log_notice(task, "Linked attributes fixup task complete."); slapi_task_log_status(task, "Linked attributes fixup task complete."); - slapi_log_error(SLAPI_LOG_INFO, LINK_PLUGIN_SUBSYSTEM, "linked_attrs_fixup_task_thread - Linked attributes fixup task complete.\n"); + slapi_log_err(SLAPI_LOG_INFO, LINK_PLUGIN_SUBSYSTEM, "linked_attrs_fixup_task_thread - Linked attributes fixup task complete.\n"); slapi_task_inc_progress(task); /* this will queue the destruction of the task */ slapi_task_finish(task, rc); slapi_task_dec_refcount(task); - slapi_log_error(SLAPI_LOG_PLUGIN, LINK_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_PLUGIN, LINK_PLUGIN_SUBSYSTEM, "linked_attrs_fixup_task_thread <-- refcount decremented.\n"); } @@ -219,11 +219,11 @@ linked_attrs_fixup_links(struct configEntry *config) fixup_pb = slapi_pblock_new(); slapi_pblock_set(fixup_pb, SLAPI_BACKEND, be); if(slapi_back_transaction_begin(fixup_pb) != LDAP_SUCCESS){ - slapi_log_error(SLAPI_LOG_ERR, LINK_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_ERR, LINK_PLUGIN_SUBSYSTEM, "linked_attrs_fixup_links - Failed to start transaction\n"); } } else { - slapi_log_error(SLAPI_LOG_ERR, LINK_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_ERR, LINK_PLUGIN_SUBSYSTEM, "linked_attrs_fixup_link - Failed to get be backend from %s\n", config->scope); } @@ -276,11 +276,11 @@ linked_attrs_fixup_links(struct configEntry *config) fixup_pb = slapi_pblock_new(); slapi_pblock_set(fixup_pb, SLAPI_BACKEND, be); if(slapi_back_transaction_begin(fixup_pb) != LDAP_SUCCESS){ - slapi_log_error(SLAPI_LOG_ERR, LINK_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_ERR, LINK_PLUGIN_SUBSYSTEM, "linked_attrs_fixup_links: failed to start transaction\n"); } } else { - slapi_log_error(SLAPI_LOG_ERR, LINK_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_ERR, LINK_PLUGIN_SUBSYSTEM, "linked_attrs_fixup_links: failed to get be backend from %s\n", slapi_sdn_get_dn(config->suffix)); } @@ -361,7 +361,7 @@ linked_attrs_remove_backlinks_callback(Slapi_Entry *e, void *callback_data) mods[0] = &mod; mods[1] = 0; - slapi_log_error(SLAPI_LOG_PLUGIN, LINK_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_PLUGIN, LINK_PLUGIN_SUBSYSTEM, "linked_attrs_remove_backlinks_callback - Removing backpointer attribute (%s) from entry (%s)\n", type, slapi_sdn_get_dn(sdn)); @@ -436,7 +436,7 @@ linked_attrs_add_backlinks_callback(Slapi_Entry *e, void *callback_data) } if (perform_update) { - slapi_log_error(SLAPI_LOG_PLUGIN, LINK_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_PLUGIN, LINK_PLUGIN_SUBSYSTEM, "linked_attrs_add_backlinks_callback - Adding backpointer (%s) in entry (%s)\n", linkdn, targetdn); diff --git a/ldap/servers/plugins/linkedattrs/linked_attrs.c b/ldap/servers/plugins/linkedattrs/linked_attrs.c index 0f761dd..b5adb21 100644 --- a/ldap/servers/plugins/linkedattrs/linked_attrs.c +++ b/ldap/servers/plugins/linkedattrs/linked_attrs.c @@ -148,7 +148,7 @@ linked_attrs_init(Slapi_PBlock *pb) int preadd = SLAPI_PLUGIN_PRE_ADD_FN; int premod = SLAPI_PLUGIN_PRE_MODIFY_FN; - slapi_log_error(SLAPI_LOG_TRACE, LINK_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_TRACE, LINK_PLUGIN_SUBSYSTEM, "--> linked_attrs_init\n"); if ((slapi_pblock_get(pb, SLAPI_PLUGIN_CONFIG_ENTRY, &plugin_entry) == 0) && @@ -178,7 +178,7 @@ linked_attrs_init(Slapi_PBlock *pb) (void *) &pdesc) != 0 || slapi_pblock_set(pb, premod, (void *) linked_attrs_mod_pre_op) != 0 || slapi_pblock_set(pb, preadd, (void *) linked_attrs_add_pre_op) != 0) { - slapi_log_error(SLAPI_LOG_ERR, LINK_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_ERR, LINK_PLUGIN_SUBSYSTEM, "linked_attrs_init - Failed to register plugin\n"); status = -1; } @@ -192,7 +192,7 @@ linked_attrs_init(Slapi_PBlock *pb) NULL, /* ? */ plugin_identity /* access control */ )) { - slapi_log_error(SLAPI_LOG_ERR, LINK_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_ERR, LINK_PLUGIN_SUBSYSTEM, "linked_attrs_init - Failed to register internalpostoperation plugin\n"); status = -1; } @@ -210,13 +210,13 @@ linked_attrs_init(Slapi_PBlock *pb) NULL, /* ? */ plugin_identity /* access control */ )) { - slapi_log_error(SLAPI_LOG_ERR, LINK_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_ERR, LINK_PLUGIN_SUBSYSTEM, "linked_attrs_init - Failed to register postop plugin\n"); status = -1; } } - slapi_log_error(SLAPI_LOG_TRACE, LINK_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_TRACE, LINK_PLUGIN_SUBSYSTEM, "<-- linked_attrs_init\n"); return status; } @@ -239,7 +239,7 @@ linked_attrs_internal_postop_init(Slapi_PBlock *pb) (void *) linked_attrs_mod_post_op) != 0 || slapi_pblock_set(pb, SLAPI_PLUGIN_INTERNAL_POST_MODRDN_FN, (void *) linked_attrs_modrdn_post_op) != 0) { - slapi_log_error(SLAPI_LOG_ERR, LINK_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_ERR, LINK_PLUGIN_SUBSYSTEM, "linked_attrs_internal_postop_init - Failed to register plugin\n"); status = -1; } @@ -271,7 +271,7 @@ linked_attrs_postop_init(Slapi_PBlock *pb) slapi_pblock_set(pb, delfn, (void *) linked_attrs_del_post_op) != 0 || slapi_pblock_set(pb, modfn, (void *) linked_attrs_mod_post_op) != 0 || slapi_pblock_set(pb, mdnfn, (void *) linked_attrs_modrdn_post_op) != 0) { - slapi_log_error(SLAPI_LOG_ERR, LINK_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_ERR, LINK_PLUGIN_SUBSYSTEM, "linked_attrs_postop_init - Failed to register plugin\n"); status = -1; } @@ -290,13 +290,13 @@ linked_attrs_start(Slapi_PBlock * pb) { Slapi_DN *plugindn = NULL; - slapi_log_error(SLAPI_LOG_TRACE, LINK_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_TRACE, LINK_PLUGIN_SUBSYSTEM, "--> linked_attrs_start\n"); g_config_lock = slapi_new_rwlock(); if (!g_config_lock) { - slapi_log_error(SLAPI_LOG_ERR, LINK_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_ERR, LINK_PLUGIN_SUBSYSTEM, "linked_attrs_start - Lock creation failed\n"); return -1; @@ -307,7 +307,7 @@ linked_attrs_start(Slapi_PBlock * pb) * and store it for future use. */ slapi_pblock_get(pb, SLAPI_TARGET_SDN, &plugindn); if (NULL == plugindn || 0 == slapi_sdn_get_ndn_len(plugindn)) { - slapi_log_error(SLAPI_LOG_PLUGIN, LINK_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_PLUGIN, LINK_PLUGIN_SUBSYSTEM, "linked_attrs_start - Unable to retrieve plugin dn\n"); return -1; } @@ -323,7 +323,7 @@ linked_attrs_start(Slapi_PBlock * pb) PR_INIT_CLIST(g_managed_config_index); if (linked_attrs_load_config() != 0) { - slapi_log_error(SLAPI_LOG_ERR, LINK_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_ERR, LINK_PLUGIN_SUBSYSTEM, "linked_attrs_start - Unable to load plug-in configuration\n"); return -1; } @@ -333,9 +333,9 @@ linked_attrs_start(Slapi_PBlock * pb) */ slapi_plugin_task_register_handler("fixup linked attributes", linked_attrs_fixup_task_add, pb); - slapi_log_error(SLAPI_LOG_PLUGIN, LINK_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_PLUGIN, LINK_PLUGIN_SUBSYSTEM, "linked_attrs_start: ready for service\n"); - slapi_log_error(SLAPI_LOG_TRACE, LINK_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_TRACE, LINK_PLUGIN_SUBSYSTEM, "<-- linked_attrs_start\n"); return 0; @@ -349,7 +349,7 @@ linked_attrs_start(Slapi_PBlock * pb) static int linked_attrs_close(Slapi_PBlock * pb) { - slapi_log_error(SLAPI_LOG_TRACE, LINK_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_TRACE, LINK_PLUGIN_SUBSYSTEM, "--> linked_attrs_close\n"); slapi_plugin_task_unregister_handler("fixup linked attributes", linked_attrs_fixup_task_add); @@ -360,7 +360,7 @@ linked_attrs_close(Slapi_PBlock * pb) slapi_ch_free((void **)&g_link_config); slapi_ch_free((void **)&g_managed_config_index); - slapi_log_error(SLAPI_LOG_TRACE, LINK_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_TRACE, LINK_PLUGIN_SUBSYSTEM, "<-- linked_attrs_close\n"); return 0; @@ -388,7 +388,7 @@ linked_attrs_load_config(void) Slapi_PBlock *search_pb; Slapi_Entry **entries = NULL; - slapi_log_error(SLAPI_LOG_TRACE, LINK_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_TRACE, LINK_PLUGIN_SUBSYSTEM, "--> linked_attrs_load_config\n"); /* Clear out any old config. */ @@ -427,7 +427,7 @@ linked_attrs_load_config(void) slapi_free_search_results_internal(search_pb); slapi_pblock_destroy(search_pb); linked_attrs_unlock(); - slapi_log_error(SLAPI_LOG_TRACE, LINK_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_TRACE, LINK_PLUGIN_SUBSYSTEM, "<-- linked_attrs_load_config\n"); return status; @@ -453,7 +453,7 @@ linked_attrs_parse_config_entry(Slapi_Entry * e, int apply) int entry_added = 0; int ret = 0; - slapi_log_error(SLAPI_LOG_TRACE, LINK_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_TRACE, LINK_PLUGIN_SUBSYSTEM, "--> linked_attrs_parse_config_entry\n"); /* If this is the main plug-in @@ -473,14 +473,14 @@ linked_attrs_parse_config_entry(Slapi_Entry * e, int apply) if (value) { entry->dn = slapi_ch_strdup(value); } else { - slapi_log_error(SLAPI_LOG_ERR, LINK_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_ERR, LINK_PLUGIN_SUBSYSTEM, "linked_attrs_parse_config_entry - Error " "reading dn from config entry\n"); ret = -1; goto bail; } - slapi_log_error(SLAPI_LOG_CONFIG, LINK_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_CONFIG, LINK_PLUGIN_SUBSYSTEM, "----------> dn [%s]\n", entry->dn); value = slapi_entry_attr_get_charptr(e, LINK_LINK_TYPE); @@ -502,14 +502,14 @@ linked_attrs_parse_config_entry(Slapi_Entry * e, int apply) /* Check if the link type's syntax is Distinguished Name. * We only treat this as a warning. */ if (not_dn_syntax) { - slapi_log_error(SLAPI_LOG_ERR, LINK_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_ERR, LINK_PLUGIN_SUBSYSTEM, "linked_attrs_parse_config_entry - The %s config " "setting must be set to an attribute with the " "Distinguished Name syntax for linked attribute " "pair \"%s\" attribute \"%s\".\n", LINK_LINK_TYPE, entry->dn, value); } } else { - slapi_log_error(SLAPI_LOG_ERR, LINK_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_ERR, LINK_PLUGIN_SUBSYSTEM, "linked_attrs_parse_config_entry - The %s config " "setting is required for linked attribute pair \"%s\".\n", LINK_LINK_TYPE, entry->dn); @@ -517,7 +517,7 @@ linked_attrs_parse_config_entry(Slapi_Entry * e, int apply) goto bail; } - slapi_log_error(SLAPI_LOG_CONFIG, LINK_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_CONFIG, LINK_PLUGIN_SUBSYSTEM, "linked_attrs_parse_config_entry - %s [%s]\n", LINK_LINK_TYPE, entry->linktype); value = slapi_entry_attr_get_charptr(e, LINK_MANAGED_TYPE); @@ -540,7 +540,7 @@ linked_attrs_parse_config_entry(Slapi_Entry * e, int apply) /* Ensure that the managed type is a multi-valued attribute. */ if (single_valued) { - slapi_log_error(SLAPI_LOG_ERR, LINK_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_ERR, LINK_PLUGIN_SUBSYSTEM, "linked_attrs_parse_config_entry - The %s config " "setting must be set to a multi-valued attribute " "for linked attribute pair \"%s\".\n", @@ -550,14 +550,14 @@ linked_attrs_parse_config_entry(Slapi_Entry * e, int apply) /* Check if the link type's syntax is Distinguished Name. * We only treat this as a warning. */ } else if (not_dn_syntax) { - slapi_log_error(SLAPI_LOG_ERR, LINK_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_ERR, LINK_PLUGIN_SUBSYSTEM, "linked_attrs_parse_config_entry - The %s config " "setting must be set to an attribute with the " "Distinguished Name syntax for linked attribute " "pair \"%s\".\n", LINK_MANAGED_TYPE, entry->dn); } } else { - slapi_log_error(SLAPI_LOG_ERR, LINK_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_ERR, LINK_PLUGIN_SUBSYSTEM, "linked_attrs_parse_config_entry - The %s config " "setting is required for linked attribute pair \"%s\".\n", LINK_MANAGED_TYPE, entry->dn); @@ -565,7 +565,7 @@ linked_attrs_parse_config_entry(Slapi_Entry * e, int apply) goto bail; } - slapi_log_error(SLAPI_LOG_CONFIG, LINK_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_CONFIG, LINK_PLUGIN_SUBSYSTEM, "linked_attrs_parse_config_entry - %s [%s]\n", LINK_MANAGED_TYPE, entry->managedtype); @@ -576,14 +576,14 @@ linked_attrs_parse_config_entry(Slapi_Entry * e, int apply) entry->scope = value; } - slapi_log_error(SLAPI_LOG_CONFIG, LINK_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_CONFIG, LINK_PLUGIN_SUBSYSTEM, "----------> %s [%s]\n", LINK_SCOPE, entry->scope ? entry->scope : "NULL"); /* Check if config already exists for * the link type at the same scope. */ if (linked_attrs_config_exists(entry)) { - slapi_log_error(SLAPI_LOG_ERR, LINK_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_ERR, LINK_PLUGIN_SUBSYSTEM, "linked_attrs_parse_config_entry - A config " "entry for the link attribute %s already " "exists at a scope of \"%s\".\n", entry->linktype, @@ -595,7 +595,7 @@ linked_attrs_parse_config_entry(Slapi_Entry * e, int apply) /* Check if config already exists for * the managed type at the same scope. */ if (linked_attrs_config_exists_reverse(entry)) { - slapi_log_error(SLAPI_LOG_ERR, LINK_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_ERR, LINK_PLUGIN_SUBSYSTEM, "linked_attrs_parse_config_entry - A config " "entry for the managed attribute %s already " "exists at a scope of \"%s\".\n", entry->managedtype, @@ -613,7 +613,7 @@ linked_attrs_parse_config_entry(Slapi_Entry * e, int apply) /* Create a lock for this attribute pair. */ entry->lock = slapi_new_mutex(); if (!entry->lock) { - slapi_log_error(SLAPI_LOG_ERR, LINK_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_ERR, LINK_PLUGIN_SUBSYSTEM, "linked_attrs_parse_config_entry - Unable to create " "lock for linked attribute pair \"%s\".\n", entry->dn); ret = -1; @@ -631,7 +631,7 @@ linked_attrs_parse_config_entry(Slapi_Entry * e, int apply) * entries for the same link type together. */ if (slapi_attr_type_cmp(config_entry->linktype, entry->linktype, 1) == 0) { PR_INSERT_BEFORE(&(entry->list), list); - slapi_log_error(SLAPI_LOG_CONFIG, LINK_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_CONFIG, LINK_PLUGIN_SUBSYSTEM, "linked_attrs_parse_config_entry - store [%s] before [%s] \n", entry->dn, config_entry->dn); @@ -647,7 +647,7 @@ linked_attrs_parse_config_entry(Slapi_Entry * e, int apply) if (g_link_config == list) { /* add to tail */ PR_INSERT_BEFORE(&(entry->list), list); - slapi_log_error(SLAPI_LOG_CONFIG, LINK_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_CONFIG, LINK_PLUGIN_SUBSYSTEM, "linked_attrs_parse_config_entry - store [%s] at tail\n", entry->dn); /* add to managed type index */ @@ -660,7 +660,7 @@ linked_attrs_parse_config_entry(Slapi_Entry * e, int apply) } else { /* first entry */ PR_INSERT_LINK(&(entry->list), g_link_config); - slapi_log_error(SLAPI_LOG_CONFIG, LINK_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_CONFIG, LINK_PLUGIN_SUBSYSTEM, "linked_attrs_parse_config_entry - store [%s] at head \n", entry->dn); /* add to managed type index */ @@ -673,7 +673,7 @@ linked_attrs_parse_config_entry(Slapi_Entry * e, int apply) if (0 == entry_added) { /* Don't log error if we weren't asked to apply config */ if ((apply != 0) && (entry != NULL)) { - slapi_log_error(SLAPI_LOG_ERR, LINK_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_ERR, LINK_PLUGIN_SUBSYSTEM, "linked_attrs_parse_config_entry - Invalid config entry " "[%s] skipped\n", entry->dn); } @@ -682,7 +682,7 @@ linked_attrs_parse_config_entry(Slapi_Entry * e, int apply) ret = 0; } - slapi_log_error(SLAPI_LOG_TRACE, LINK_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_TRACE, LINK_PLUGIN_SUBSYSTEM, "<-- linked_attrs_parse_config_entry\n"); return ret; @@ -716,7 +716,7 @@ linked_attrs_insert_config_index(struct configEntry *entry) /* See if the types match. */ if (slapi_attr_type_cmp(config_entry->managedtype, entry->managedtype, 1) == 0) { PR_INSERT_BEFORE(&(index_entry->list), list); - slapi_log_error(SLAPI_LOG_CONFIG, LINK_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_CONFIG, LINK_PLUGIN_SUBSYSTEM, "linked_attrs_insert_config_index - store [%s] before [%s] \n", entry->dn, config_entry->dn); inserted = 1; @@ -728,7 +728,7 @@ linked_attrs_insert_config_index(struct configEntry *entry) if (g_managed_config_index == list) { /* add to tail */ PR_INSERT_BEFORE(&(index_entry->list), list); - slapi_log_error(SLAPI_LOG_CONFIG, LINK_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_CONFIG, LINK_PLUGIN_SUBSYSTEM, "linked_attrs_insert_config_index - store [%s] at tail\n", entry->dn); inserted = 1; break; @@ -736,7 +736,7 @@ linked_attrs_insert_config_index(struct configEntry *entry) } } else { /* first entry */ - slapi_log_error(SLAPI_LOG_CONFIG, LINK_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_CONFIG, LINK_PLUGIN_SUBSYSTEM, "linked_attrs_insert_config_index - store [%s] at head \n", entry->dn); PR_INSERT_LINK(&(index_entry->list), g_managed_config_index); inserted = 1; @@ -755,7 +755,7 @@ linked_attrs_free_config_entry(struct configEntry ** entry) return; if (e->dn) { - slapi_log_error(SLAPI_LOG_CONFIG, LINK_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_CONFIG, LINK_PLUGIN_SUBSYSTEM, "linked_attrs_free_config_entry - freeing config entry [%s]\n", e->dn); slapi_ch_free_string(&e->dn); } @@ -812,18 +812,18 @@ linked_attrs_get_dn(Slapi_PBlock * pb) { const char *dn = 0; Slapi_DN *sdn = NULL; - slapi_log_error(SLAPI_LOG_TRACE, LINK_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_TRACE, LINK_PLUGIN_SUBSYSTEM, "--> linked_attrs_get_dn\n"); if (slapi_pblock_get(pb, SLAPI_TARGET_SDN, &sdn)) { - slapi_log_error(SLAPI_LOG_ERR, LINK_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_ERR, LINK_PLUGIN_SUBSYSTEM, "linked_attrs_get_dn - Failed to get dn of changed entry"); goto bail; } dn = slapi_sdn_get_dn(sdn); bail: - slapi_log_error(SLAPI_LOG_TRACE, LINK_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_TRACE, LINK_PLUGIN_SUBSYSTEM, "<-- linked_attrs_get_dn\n"); return (char *)dn; @@ -833,10 +833,10 @@ static Slapi_DN * linked_attrs_get_sdn(Slapi_PBlock * pb) { Slapi_DN *sdn = 0; - slapi_log_error(SLAPI_LOG_TRACE, LINK_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_TRACE, LINK_PLUGIN_SUBSYSTEM, "--> linked_attrs_get_sdn\n"); slapi_pblock_get(pb, SLAPI_TARGET_SDN, &sdn); - slapi_log_error(SLAPI_LOG_TRACE, LINK_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_TRACE, LINK_PLUGIN_SUBSYSTEM, "<-- linked_attrs_get_sdn\n"); return sdn; @@ -852,7 +852,7 @@ linked_attrs_dn_is_config(char *dn) { int ret = 0; - slapi_log_error(SLAPI_LOG_TRACE, LINK_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_TRACE, LINK_PLUGIN_SUBSYSTEM, "--> linked_attrs_dn_is_config\n"); /* Return 1 if the passed in dn is a child of the main @@ -862,7 +862,7 @@ linked_attrs_dn_is_config(char *dn) ret = 1; } - slapi_log_error(SLAPI_LOG_TRACE, LINK_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_TRACE, LINK_PLUGIN_SUBSYSTEM, "<-- linked_attrs_dn_is_config\n"); return ret; @@ -1140,12 +1140,12 @@ linked_attrs_oktodo(Slapi_PBlock *pb) int ret = 1; int oprc = 0; - slapi_log_error(SLAPI_LOG_TRACE, LINK_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_TRACE, LINK_PLUGIN_SUBSYSTEM, "--> linked_attrs_oktodo\n" ); if(slapi_pblock_get(pb, SLAPI_PLUGIN_OPRETURN, &oprc) != 0) { - slapi_log_error(SLAPI_LOG_ERR, LINK_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_ERR, LINK_PLUGIN_SUBSYSTEM, "linked_attrs_oktodo - Could not get parameters\n" ); ret = -1; } @@ -1156,7 +1156,7 @@ linked_attrs_oktodo(Slapi_PBlock *pb) ret = 0; } - slapi_log_error(SLAPI_LOG_TRACE, LINK_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_TRACE, LINK_PLUGIN_SUBSYSTEM, "<-- linked_attrs_oktodo\n" ); return ret; @@ -1453,7 +1453,7 @@ linked_attrs_mod_backpointers(Slapi_PBlock *pb, char *linkdn, char *type, } if (perform_update) { - slapi_log_error(SLAPI_LOG_PLUGIN, LINK_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_PLUGIN, LINK_PLUGIN_SUBSYSTEM, "linked_attrs_mod_backpointers - %s backpointer (%s) in entry (%s)\n", (modop == LDAP_MOD_ADD) ? "Adding" : "Removing", linkdn, targetdn); @@ -1474,13 +1474,13 @@ linked_attrs_mod_backpointers(Slapi_PBlock *pb, char *linkdn, char *type, } else if (rc != LDAP_SUCCESS) { char *err_msg = NULL; - slapi_log_error(SLAPI_LOG_ERR, LINK_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_ERR, LINK_PLUGIN_SUBSYSTEM, "linked_attrs_mod_backpointers - Failed to update link to target entry (%s) error %d", targetdn, rc); err_msg = PR_smprintf("linked_attrs_mod_backpointers - Failed to update " "link to target entry (%s) error %d", targetdn, rc); - slapi_log_error(SLAPI_LOG_PLUGIN, LINK_PLUGIN_SUBSYSTEM, "%s\n", err_msg); + slapi_log_err(SLAPI_LOG_PLUGIN, LINK_PLUGIN_SUBSYSTEM, "%s\n", err_msg); slapi_pblock_set(pb, SLAPI_PB_RESULT_TEXT, err_msg); PR_smprintf_free(err_msg); slapi_sdn_free(&targetsdn); @@ -1538,7 +1538,7 @@ linked_attrs_pre_op(Slapi_PBlock * pb, int modop) char *errstr = NULL; int ret = SLAPI_PLUGIN_SUCCESS; - slapi_log_error(SLAPI_LOG_TRACE, LINK_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_TRACE, LINK_PLUGIN_SUBSYSTEM, "--> linked_attrs_pre_op\n"); if (0 == (dn = linked_attrs_get_dn(pb))) @@ -1595,7 +1595,7 @@ linked_attrs_pre_op(Slapi_PBlock * pb, int modop) slapi_entry_free(e); if (ret) { - slapi_log_error(SLAPI_LOG_PLUGIN, LINK_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_PLUGIN, LINK_PLUGIN_SUBSYSTEM, "linked_attrs_pre_op - Operation failure [%d]\n", ret); slapi_send_ldap_result(pb, ret, NULL, errstr, 0, NULL); slapi_ch_free((void **)&errstr); @@ -1603,7 +1603,7 @@ linked_attrs_pre_op(Slapi_PBlock * pb, int modop) ret = SLAPI_PLUGIN_FAILURE; } - slapi_log_error(SLAPI_LOG_TRACE, LINK_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_TRACE, LINK_PLUGIN_SUBSYSTEM, "<-- linked_attrs_pre_op\n"); return ret; @@ -1633,7 +1633,7 @@ linked_attrs_mod_post_op(Slapi_PBlock *pb) void *caller_id = NULL; int rc = SLAPI_PLUGIN_SUCCESS; - slapi_log_error(SLAPI_LOG_TRACE, LINK_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_TRACE, LINK_PLUGIN_SUBSYSTEM, "--> linked_attrs_mod_post_op\n"); /* We don't want to process internal modify @@ -1702,7 +1702,7 @@ linked_attrs_mod_post_op(Slapi_PBlock *pb) rc = linked_attrs_replace_backpointers(pb, dn, config, smod); break; default: - slapi_log_error(SLAPI_LOG_PLUGIN, LINK_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_PLUGIN, LINK_PLUGIN_SUBSYSTEM, "linked_attrs_mod_post_op - Unknown mod type\n" ); rc = SLAPI_PLUGIN_FAILURE; break; @@ -1710,7 +1710,7 @@ linked_attrs_mod_post_op(Slapi_PBlock *pb) slapi_unlock_mutex(config->lock); if(rc != LDAP_SUCCESS){ - slapi_log_error(SLAPI_LOG_ERR, LINK_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_ERR, LINK_PLUGIN_SUBSYSTEM, "linked_attrs_mod_post_op - Update failed (%d)\n",rc); linked_attrs_unlock(); slapi_mod_done(next_mod); @@ -1733,7 +1733,7 @@ linked_attrs_mod_post_op(Slapi_PBlock *pb) slapi_pblock_set(pb, SLAPI_RESULT_CODE, &rc); rc = SLAPI_PLUGIN_FAILURE; } - slapi_log_error(SLAPI_LOG_TRACE, LINK_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_TRACE, LINK_PLUGIN_SUBSYSTEM, "<-- linked_attrs_mod_post_op (%d)\n", rc); return rc; @@ -1746,7 +1746,7 @@ linked_attrs_add_post_op(Slapi_PBlock *pb) char *dn = NULL; int rc = SLAPI_PLUGIN_SUCCESS; - slapi_log_error(SLAPI_LOG_TRACE, LINK_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_TRACE, LINK_PLUGIN_SUBSYSTEM, "--> linked_attrs_add_post_op\n"); /* Reload config if a config entry was added. */ @@ -1754,7 +1754,7 @@ linked_attrs_add_post_op(Slapi_PBlock *pb) if (linked_attrs_dn_is_config(dn)) linked_attrs_load_config(); } else { - slapi_log_error(SLAPI_LOG_PLUGIN, LINK_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_PLUGIN, LINK_PLUGIN_SUBSYSTEM, "linked_attrs_add_post_op - Error " "retrieving dn\n"); } @@ -1795,7 +1795,7 @@ linked_attrs_add_post_op(Slapi_PBlock *pb) slapi_unlock_mutex(config->lock); slapi_valueset_free(vals); if(rc != LDAP_SUCCESS){ - slapi_log_error(SLAPI_LOG_ERR, LINK_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_ERR, LINK_PLUGIN_SUBSYSTEM, "linked_attrs_add_post_op - Update failed (%d)\n",rc); linked_attrs_unlock(); break; @@ -1808,7 +1808,7 @@ linked_attrs_add_post_op(Slapi_PBlock *pb) slapi_entry_next_attr(e, attr, &attr); } } else { - slapi_log_error(SLAPI_LOG_PLUGIN, LINK_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_PLUGIN, LINK_PLUGIN_SUBSYSTEM, "linked_attrs_add_post_op - Error " "retrieving post-op entry %s\n", dn); } @@ -1817,7 +1817,7 @@ linked_attrs_add_post_op(Slapi_PBlock *pb) slapi_pblock_set(pb, SLAPI_RESULT_CODE, &rc); rc = SLAPI_PLUGIN_FAILURE; } - slapi_log_error(SLAPI_LOG_TRACE, LINK_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_TRACE, LINK_PLUGIN_SUBSYSTEM, "<-- linked_attrs_add_post_op\n"); return rc; @@ -1830,7 +1830,7 @@ linked_attrs_del_post_op(Slapi_PBlock *pb) Slapi_Entry *e = NULL; int rc = SLAPI_PLUGIN_SUCCESS; - slapi_log_error(SLAPI_LOG_TRACE, LINK_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_TRACE, LINK_PLUGIN_SUBSYSTEM, "--> linked_attrs_del_post_op\n"); /* Just bail if we aren't ready to service requests yet. */ @@ -1843,7 +1843,7 @@ linked_attrs_del_post_op(Slapi_PBlock *pb) if (linked_attrs_dn_is_config(dn)) linked_attrs_load_config(); } else { - slapi_log_error(SLAPI_LOG_PLUGIN, LINK_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_PLUGIN, LINK_PLUGIN_SUBSYSTEM, "linked_attrs_del_post_op - Error " "retrieving dn\n"); } @@ -1884,7 +1884,7 @@ linked_attrs_del_post_op(Slapi_PBlock *pb) slapi_unlock_mutex(config->lock); slapi_valueset_free(vals); if (rc != LDAP_SUCCESS){ - slapi_log_error(SLAPI_LOG_ERR, LINK_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_ERR, LINK_PLUGIN_SUBSYSTEM, "linked_attrs_del_post_op - Update failed (%d)\n",rc); linked_attrs_unlock(); break; @@ -1919,7 +1919,7 @@ linked_attrs_del_post_op(Slapi_PBlock *pb) slapi_valueset_free(vals); config = NULL; if(rc != LDAP_SUCCESS){ - slapi_log_error(SLAPI_LOG_ERR, LINK_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_ERR, LINK_PLUGIN_SUBSYSTEM, "linked_attrs_del_post_op - Update failed (%d)\n",rc); linked_attrs_unlock(); goto bail; @@ -1935,7 +1935,7 @@ linked_attrs_del_post_op(Slapi_PBlock *pb) slapi_entry_next_attr(e, attr, &attr); } } else { - slapi_log_error(SLAPI_LOG_ERR, LINK_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_ERR, LINK_PLUGIN_SUBSYSTEM, "linked_attrs_del_post_op - Error " "retrieving pre-op entry %s\n", dn); rc = SLAPI_PLUGIN_FAILURE; @@ -1946,7 +1946,7 @@ bail: slapi_pblock_set(pb, SLAPI_RESULT_CODE, &rc); rc = SLAPI_PLUGIN_FAILURE; } - slapi_log_error(SLAPI_LOG_TRACE, LINK_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_TRACE, LINK_PLUGIN_SUBSYSTEM, "<-- linked_attrs_del_post_op\n"); return rc; @@ -1963,7 +1963,7 @@ linked_attrs_modrdn_post_op(Slapi_PBlock *pb) struct configEntry *config = NULL; int rc = SLAPI_PLUGIN_SUCCESS; - slapi_log_error(SLAPI_LOG_TRACE, LINK_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_TRACE, LINK_PLUGIN_SUBSYSTEM, "--> linked_attrs_modrdn_post_op\n"); /* Just bail if we aren't ready to service requests yet. */ @@ -1978,7 +1978,7 @@ linked_attrs_modrdn_post_op(Slapi_PBlock *pb) if (post_e) { new_dn = slapi_entry_get_ndn(post_e); } else { - slapi_log_error(SLAPI_LOG_PLUGIN, LINK_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_PLUGIN, LINK_PLUGIN_SUBSYSTEM, "linked_attrs_modrdn_post_op - Error " "retrieving post-op entry\n"); rc = LDAP_OPERATIONS_ERROR; @@ -1989,7 +1989,7 @@ linked_attrs_modrdn_post_op(Slapi_PBlock *pb) if (linked_attrs_dn_is_config(old_dn) || linked_attrs_dn_is_config(new_dn)) linked_attrs_load_config(); } else { - slapi_log_error(SLAPI_LOG_PLUGIN, LINK_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_PLUGIN, LINK_PLUGIN_SUBSYSTEM, "linked_attrs_modrdn_post_op - Error " "retrieving dn\n"); rc = LDAP_OPERATIONS_ERROR; @@ -2028,7 +2028,7 @@ linked_attrs_modrdn_post_op(Slapi_PBlock *pb) slapi_valueset_free(vals); config = NULL; if(rc != LDAP_SUCCESS){ - slapi_log_error(SLAPI_LOG_ERR, LINK_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_ERR, LINK_PLUGIN_SUBSYSTEM, "linked_attrs_modrdn_post_op - Update failed(old type) (%d)\n",rc); linked_attrs_unlock(); break; @@ -2055,7 +2055,7 @@ linked_attrs_modrdn_post_op(Slapi_PBlock *pb) slapi_valueset_free(vals); config = NULL; if(rc != LDAP_SUCCESS){ - slapi_log_error(SLAPI_LOG_ERR, LINK_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_ERR, LINK_PLUGIN_SUBSYSTEM, "linked_attrs_modrdn_post_op - Update failed(new type) (%d)\n",rc); linked_attrs_unlock(); break; @@ -2085,7 +2085,7 @@ linked_attrs_modrdn_post_op(Slapi_PBlock *pb) rc = linked_attrs_mod_backpointers(pb, old_dn, config->linktype, config->scope, LDAP_MOD_DELETE, vals); if(rc != LDAP_SUCCESS){ - slapi_log_error(SLAPI_LOG_ERR, LINK_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_ERR, LINK_PLUGIN_SUBSYSTEM, "linked_attrs_modrdn_post_op - Update failed(old dn) (%d)\n",rc); slapi_unlock_mutex(config->lock); slapi_valueset_free(vals); @@ -2101,7 +2101,7 @@ linked_attrs_modrdn_post_op(Slapi_PBlock *pb) slapi_valueset_free(vals); config = NULL; if(rc != LDAP_SUCCESS){ - slapi_log_error(SLAPI_LOG_ERR, LINK_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_ERR, LINK_PLUGIN_SUBSYSTEM, "linked_attrs_modrdn_post_op - Update failed(new dn) (%d)\n",rc); linked_attrs_unlock(); goto done; @@ -2118,7 +2118,7 @@ linked_attrs_modrdn_post_op(Slapi_PBlock *pb) } done: - slapi_log_error(SLAPI_LOG_TRACE, LINK_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_TRACE, LINK_PLUGIN_SUBSYSTEM, "<-- linked_attrs_modrdn_post_op\n"); if (rc) { slapi_pblock_set(pb, SLAPI_RESULT_CODE, &rc); @@ -2172,14 +2172,14 @@ linked_attrs_dump_config_index() void linked_attrs_dump_config_entry(struct configEntry * entry) { - slapi_log_error(SLAPI_LOG_DEBUG, LINK_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_DEBUG, LINK_PLUGIN_SUBSYSTEM, "<==== Linked Attribute Pair =====>\n"); - slapi_log_error(SLAPI_LOG_DEBUG, LINK_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_DEBUG, LINK_PLUGIN_SUBSYSTEM, "<---- config entry dn -----> %s\n", entry->dn); - slapi_log_error(SLAPI_LOG_DEBUG, LINK_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_DEBUG, LINK_PLUGIN_SUBSYSTEM, "<---- link type -----------> %s\n", entry->linktype); - slapi_log_error(SLAPI_LOG_DEBUG, LINK_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_DEBUG, LINK_PLUGIN_SUBSYSTEM, "<---- managed type --------> %s\n", entry->managedtype); - slapi_log_error(SLAPI_LOG_DEBUG, LINK_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_DEBUG, LINK_PLUGIN_SUBSYSTEM, "<---- scope ---------------> %s\n", entry->scope); } diff --git a/ldap/servers/plugins/memberof/memberof.c b/ldap/servers/plugins/memberof/memberof.c index f796f3a..9af9082 100644 --- a/ldap/servers/plugins/memberof/memberof.c +++ b/ldap/servers/plugins/memberof/memberof.c @@ -172,7 +172,7 @@ memberof_postop_init(Slapi_PBlock *pb) int modfn = SLAPI_PLUGIN_POST_MODIFY_FN; int addfn = SLAPI_PLUGIN_POST_ADD_FN; - slapi_log_error(SLAPI_LOG_TRACE, MEMBEROF_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_TRACE, MEMBEROF_PLUGIN_SUBSYSTEM, "--> memberof_postop_init\n" ); /* get args */ @@ -227,13 +227,13 @@ memberof_postop_init(Slapi_PBlock *pb) NULL, /* ? */ memberof_plugin_identity /* access control */)) { - slapi_log_error(SLAPI_LOG_ERR, MEMBEROF_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_ERR, MEMBEROF_PLUGIN_SUBSYSTEM, "memberof_postop_init - Failed\n" ); ret = -1; } else if (ret) { - slapi_log_error(SLAPI_LOG_ERR, MEMBEROF_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_ERR, MEMBEROF_PLUGIN_SUBSYSTEM, "memberof_postop_init - Failed\n" ); ret = -1; } @@ -248,18 +248,18 @@ memberof_postop_init(Slapi_PBlock *pb) NULL, /* ? */ memberof_plugin_identity /* access control */)) { - slapi_log_error(SLAPI_LOG_ERR, MEMBEROF_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_ERR, MEMBEROF_PLUGIN_SUBSYSTEM, "memberof_preop_init - Failed\n" ); ret = -1; } else if (ret) { - slapi_log_error(SLAPI_LOG_ERR, MEMBEROF_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_ERR, MEMBEROF_PLUGIN_SUBSYSTEM, "memberof_preop_init - Failed\n"); ret = -1; } - slapi_log_error(SLAPI_LOG_TRACE, MEMBEROF_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_TRACE, MEMBEROF_PLUGIN_SUBSYSTEM, "<-- memberof_postop_init\n" ); return ret; @@ -274,7 +274,7 @@ memberof_preop_init(Slapi_PBlock *pb) slapi_pblock_set(pb, SLAPI_PLUGIN_DESCRIPTION, (void *) &pdesc) != 0 || slapi_pblock_set(pb, premodfn, (void *)memberof_shared_config_validate) != 0) { - slapi_log_error(SLAPI_LOG_ERR, MEMBEROF_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_ERR, MEMBEROF_PLUGIN_SUBSYSTEM, "memberof_preop_init: Failed to register plugin\n"); status = -1; } @@ -299,7 +299,7 @@ memberof_internal_postop_init(Slapi_PBlock *pb) (void *) memberof_postop_modify ) != 0 || slapi_pblock_set( pb, SLAPI_PLUGIN_INTERNAL_POST_ADD_FN, (void *) memberof_postop_add ) != 0) { - slapi_log_error(SLAPI_LOG_ERR, MEMBEROF_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_ERR, MEMBEROF_PLUGIN_SUBSYSTEM, "memberof_internal_postop_init - Failed to register plugin\n"); status = -1; } @@ -322,7 +322,7 @@ int memberof_postop_start(Slapi_PBlock *pb) int result = 0; int rc = 0; - slapi_log_error(SLAPI_LOG_TRACE, MEMBEROF_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_TRACE, MEMBEROF_PLUGIN_SUBSYSTEM, "--> memberof_postop_start\n" ); memberof_operation_lock = PR_NewMonitor(); @@ -350,7 +350,7 @@ int memberof_postop_start(Slapi_PBlock *pb) if (LDAP_SUCCESS != result) { if (result == LDAP_NO_SUCH_OBJECT) { /* log an error and use the plugin entry for the config */ - slapi_log_error(SLAPI_LOG_PLUGIN, MEMBEROF_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_PLUGIN, MEMBEROF_PLUGIN_SUBSYSTEM, "memberof_postop_start - Config entry \"%s\" does " "not exist.\n", config_area); rc = -1; @@ -361,7 +361,7 @@ int memberof_postop_start(Slapi_PBlock *pb) if(entries && entries[0]){ config_e = entries[0]; } else { - slapi_log_error(SLAPI_LOG_PLUGIN, MEMBEROF_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_PLUGIN, MEMBEROF_PLUGIN_SUBSYSTEM, "memberof_postop_start - Config entry \"%s\" was " "not located.\n", config_area); rc = -1; @@ -371,7 +371,7 @@ int memberof_postop_start(Slapi_PBlock *pb) } else { /* The plugin entry itself contains the config */ if ( slapi_pblock_get( pb, SLAPI_ADD_ENTRY, &config_e ) != 0 ) { - slapi_log_error(SLAPI_LOG_ERR, MEMBEROF_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_ERR, MEMBEROF_PLUGIN_SUBSYSTEM, "memberof_postop_start - Missing config entry\n" ); rc = -1; goto bail; @@ -380,7 +380,7 @@ int memberof_postop_start(Slapi_PBlock *pb) memberof_set_config_area(slapi_entry_get_sdn(config_e)); if (( rc = memberof_config( config_e, pb )) != LDAP_SUCCESS ) { - slapi_log_error(SLAPI_LOG_ERR, MEMBEROF_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_ERR, MEMBEROF_PLUGIN_SUBSYSTEM, "memberof_postop_start - Configuration failed (%s)\n", ldap_err2string( rc )); rc = -1; goto bail; @@ -406,7 +406,7 @@ bail: slapi_free_search_results_internal(search_pb); slapi_pblock_destroy(search_pb); - slapi_log_error(SLAPI_LOG_TRACE, MEMBEROF_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_TRACE, MEMBEROF_PLUGIN_SUBSYSTEM, "<-- memberof_postop_start\n" ); return rc; @@ -420,7 +420,7 @@ bail: */ int memberof_postop_close(Slapi_PBlock *pb) { - slapi_log_error(SLAPI_LOG_TRACE, MEMBEROF_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_TRACE, MEMBEROF_PLUGIN_SUBSYSTEM, "--> memberof_postop_close\n" ); slapi_plugin_task_unregister_handler("memberof task", memberof_task_add); @@ -432,7 +432,7 @@ int memberof_postop_close(Slapi_PBlock *pb) PR_DestroyMonitor(memberof_operation_lock); memberof_operation_lock = NULL; - slapi_log_error(SLAPI_LOG_TRACE, MEMBEROF_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_TRACE, MEMBEROF_PLUGIN_SUBSYSTEM, "<-- memberof_postop_close\n" ); return 0; } @@ -496,7 +496,7 @@ int memberof_postop_del(Slapi_PBlock *pb) Slapi_DN *sdn; void *caller_id = NULL; - slapi_log_error(SLAPI_LOG_TRACE, MEMBEROF_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_TRACE, MEMBEROF_PLUGIN_SUBSYSTEM, "--> memberof_postop_del\n" ); /* We don't want to process internal modify @@ -529,7 +529,7 @@ int memberof_postop_del(Slapi_PBlock *pb) * membership lists of groups */ if((ret = memberof_del_dn_from_groups(pb, &configCopy, sdn))){ - slapi_log_error(SLAPI_LOG_ERR, MEMBEROF_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_ERR, MEMBEROF_PLUGIN_SUBSYSTEM, "memberof_postop_del - Error deleting dn (%s) from group. Error (%d)\n", slapi_sdn_get_dn(sdn),ret); memberof_unlock(); @@ -548,7 +548,7 @@ int memberof_postop_del(Slapi_PBlock *pb) if (0 == slapi_entry_attr_find(e, configCopy.groupattrs[i], &attr)) { if((ret = memberof_del_attr_list(pb, &configCopy, sdn, attr))){ - slapi_log_error(SLAPI_LOG_ERR, MEMBEROF_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_ERR, MEMBEROF_PLUGIN_SUBSYSTEM, "memberof_postop_del - Error deleting attr list - dn (%s). Error (%d)\n", slapi_sdn_get_dn(sdn),ret); } @@ -565,7 +565,7 @@ bail: slapi_pblock_set(pb, SLAPI_RESULT_CODE, &ret); ret = SLAPI_PLUGIN_FAILURE; } - slapi_log_error(SLAPI_LOG_TRACE, MEMBEROF_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_TRACE, MEMBEROF_PLUGIN_SUBSYSTEM, "<-- memberof_postop_del\n" ); return ret; } @@ -806,7 +806,7 @@ int memberof_postop_modrdn(Slapi_PBlock *pb) int ret = SLAPI_PLUGIN_SUCCESS; void *caller_id = NULL; - slapi_log_error(SLAPI_LOG_TRACE, MEMBEROF_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_TRACE, MEMBEROF_PLUGIN_SUBSYSTEM, "--> memberof_postop_modrdn\n" ); /* We don't want to process internal modify @@ -866,7 +866,7 @@ int memberof_postop_modrdn(Slapi_PBlock *pb) if((ret = memberof_moddn_attr_list(pb, &configCopy, pre_sdn, post_sdn, attr) != 0)) { - slapi_log_error(SLAPI_LOG_ERR, MEMBEROF_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_ERR, MEMBEROF_PLUGIN_SUBSYSTEM, "memberof_postop_modrdn - Update failed for (%s), error (%d)\n", slapi_sdn_get_dn(pre_sdn), ret); break; @@ -881,7 +881,7 @@ int memberof_postop_modrdn(Slapi_PBlock *pb) if (ret == LDAP_SUCCESS && pre_sdn && post_sdn) { if (!memberof_entry_in_scope(&configCopy, post_sdn)){ if((ret = memberof_del_dn_from_groups(pb, &configCopy, pre_sdn))){ - slapi_log_error(SLAPI_LOG_ERR, MEMBEROF_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_ERR, MEMBEROF_PLUGIN_SUBSYSTEM, "memberof_postop_modrdn - Delete dn failed for (%s), error (%d)\n", slapi_sdn_get_dn(pre_sdn), ret); } @@ -896,7 +896,7 @@ int memberof_postop_modrdn(Slapi_PBlock *pb) for (i = 0; configCopy.groupattrs[i] && ret == LDAP_SUCCESS; i++) { if (0 == slapi_entry_attr_find(pre_e, configCopy.groupattrs[i], &attr)) { if((ret = memberof_del_attr_list(pb, &configCopy, pre_sdn, attr))){ - slapi_log_error(SLAPI_LOG_ERR, MEMBEROF_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_ERR, MEMBEROF_PLUGIN_SUBSYSTEM, "memberof_postop_modrdn - Error deleting attr list - dn (%s). Error (%d)\n", slapi_sdn_get_dn(pre_sdn),ret); } @@ -907,14 +907,14 @@ int memberof_postop_modrdn(Slapi_PBlock *pb) if(ret == LDAP_SUCCESS) { memberof_del_dn_data del_data = {0, configCopy.memberof_attr}; if((ret = memberof_del_dn_type_callback(post_e, &del_data))){ - slapi_log_error(SLAPI_LOG_ERR, MEMBEROF_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_ERR, MEMBEROF_PLUGIN_SUBSYSTEM, "memberof_postop_modrdn - Delete dn callback failed for (%s), error (%d)\n", slapi_entry_get_dn(post_e), ret); } } } else { if((ret = memberof_replace_dn_from_groups(pb, &configCopy, pre_sdn, post_sdn))){ - slapi_log_error(SLAPI_LOG_ERR, MEMBEROF_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_ERR, MEMBEROF_PLUGIN_SUBSYSTEM, "memberof_postop_modrdn - Replace dn failed for (%s), error (%d)\n", slapi_sdn_get_dn(pre_sdn), ret); } @@ -929,7 +929,7 @@ bail: slapi_pblock_set(pb, SLAPI_RESULT_CODE, &ret); ret = SLAPI_PLUGIN_FAILURE; } - slapi_log_error(SLAPI_LOG_TRACE, MEMBEROF_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_TRACE, MEMBEROF_PLUGIN_SUBSYSTEM, "<-- memberof_postop_modrdn\n" ); return ret; } @@ -1039,7 +1039,7 @@ int memberof_postop_modify(Slapi_PBlock *pb) Slapi_Mod *next_mod = 0; void *caller_id = NULL; - slapi_log_error(SLAPI_LOG_TRACE, MEMBEROF_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_TRACE, MEMBEROF_PLUGIN_SUBSYSTEM, "--> memberof_postop_modify\n" ); /* We don't want to process internal modify @@ -1061,7 +1061,7 @@ int memberof_postop_modify(Slapi_PBlock *pb) slapi_pblock_get(pb, SLAPI_ENTRY_POST_OP, &entry); if(entry){ if( SLAPI_DSE_CALLBACK_ERROR == memberof_apply_config (pb, NULL, entry, &result, returntext, NULL)){ - slapi_log_error(SLAPI_LOG_ERR, MEMBEROF_PLUGIN_SUBSYSTEM, "%s", returntext); + slapi_log_err(SLAPI_LOG_ERR, MEMBEROF_PLUGIN_SUBSYSTEM, "%s", returntext); ret = SLAPI_PLUGIN_FAILURE; goto done; } @@ -1134,7 +1134,7 @@ int memberof_postop_modify(Slapi_PBlock *pb) { /* add group DN to targets */ if((ret = memberof_add_smod_list(pb, &configCopy, sdn, smod))){ - slapi_log_error(SLAPI_LOG_ERR, MEMBEROF_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_ERR, MEMBEROF_PLUGIN_SUBSYSTEM, "memberof_postop_modify - Failed to add dn (%s) to target. " "Error (%d)\n", slapi_sdn_get_dn(sdn), ret ); slapi_mod_done(next_mod); @@ -1153,7 +1153,7 @@ int memberof_postop_modify(Slapi_PBlock *pb) if (slapi_mod_get_num_values(smod) == 0) { if((ret = memberof_replace_list(pb, &configCopy, sdn))){ - slapi_log_error(SLAPI_LOG_ERR, MEMBEROF_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_ERR, MEMBEROF_PLUGIN_SUBSYSTEM, "memberof_postop_modify - Failed to replace list (%s). " "Error (%d)\n", slapi_sdn_get_dn(sdn), ret ); slapi_mod_done(next_mod); @@ -1165,7 +1165,7 @@ int memberof_postop_modify(Slapi_PBlock *pb) { /* remove group DN from target values in smod*/ if((ret = memberof_del_smod_list(pb, &configCopy, sdn, smod))){ - slapi_log_error(SLAPI_LOG_ERR, MEMBEROF_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_ERR, MEMBEROF_PLUGIN_SUBSYSTEM, "memberof_postop_modify: failed to remove dn (%s). " "Error (%d)\n", slapi_sdn_get_dn(sdn), ret ); slapi_mod_done(next_mod); @@ -1180,7 +1180,7 @@ int memberof_postop_modify(Slapi_PBlock *pb) { /* replace current values */ if((ret = memberof_replace_list(pb, &configCopy, sdn))){ - slapi_log_error(SLAPI_LOG_ERR, MEMBEROF_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_ERR, MEMBEROF_PLUGIN_SUBSYSTEM, "memberof_postop_modify - Failed to replace values in dn (%s). " "Error (%d)\n", slapi_sdn_get_dn(sdn), ret ); slapi_mod_done(next_mod); @@ -1192,7 +1192,7 @@ int memberof_postop_modify(Slapi_PBlock *pb) default: { - slapi_log_error( + slapi_log_err( SLAPI_LOG_ERR, MEMBEROF_PLUGIN_SUBSYSTEM, "memberof_postop_modify - Unknown mod type\n" ); @@ -1223,7 +1223,7 @@ done: ret = SLAPI_PLUGIN_FAILURE; } - slapi_log_error(SLAPI_LOG_TRACE, MEMBEROF_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_TRACE, MEMBEROF_PLUGIN_SUBSYSTEM, "<-- memberof_postop_modify\n" ); return ret; } @@ -1242,7 +1242,7 @@ int memberof_postop_add(Slapi_PBlock *pb) Slapi_DN *sdn = 0; void *caller_id = NULL; - slapi_log_error(SLAPI_LOG_TRACE, MEMBEROF_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_TRACE, MEMBEROF_PLUGIN_SUBSYSTEM, "--> memberof_postop_add\n" ); /* We don't want to process internal modify @@ -1289,7 +1289,7 @@ int memberof_postop_add(Slapi_PBlock *pb) if(0 == slapi_entry_attr_find(e, configCopy.groupattrs[i], &attr)) { if((ret = memberof_add_attr_list(pb, &configCopy, sdn, attr))){ - slapi_log_error(SLAPI_LOG_ERR, MEMBEROF_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_ERR, MEMBEROF_PLUGIN_SUBSYSTEM, "memberof_postop_add - Failed to add dn(%s), error (%d)\n", slapi_sdn_get_dn(sdn), ret); break; @@ -1308,7 +1308,7 @@ bail: ret = SLAPI_PLUGIN_FAILURE; } - slapi_log_error(SLAPI_LOG_TRACE, MEMBEROF_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_TRACE, MEMBEROF_PLUGIN_SUBSYSTEM, "<-- memberof_postop_add\n" ); return ret; @@ -1331,7 +1331,7 @@ int memberof_oktodo(Slapi_PBlock *pb) int ret = 1; int oprc = 0; - slapi_log_error(SLAPI_LOG_TRACE, MEMBEROF_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_TRACE, MEMBEROF_PLUGIN_SUBSYSTEM, "--> memberof_oktodo\n" ); if (!slapi_plugin_running(pb)) { @@ -1341,7 +1341,7 @@ int memberof_oktodo(Slapi_PBlock *pb) if(slapi_pblock_get(pb, SLAPI_PLUGIN_OPRETURN, &oprc) != 0) { - slapi_log_error(SLAPI_LOG_ERR, MEMBEROF_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_ERR, MEMBEROF_PLUGIN_SUBSYSTEM, "memberof_oktodo - Could not get parameters\n" ); ret = -1; } @@ -1353,7 +1353,7 @@ int memberof_oktodo(Slapi_PBlock *pb) } bail: - slapi_log_error(SLAPI_LOG_TRACE, MEMBEROF_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_TRACE, MEMBEROF_PLUGIN_SUBSYSTEM, "<-- memberof_oktodo\n" ); return ret; @@ -1468,14 +1468,14 @@ memberof_modop_one_replace_r(Slapi_PBlock *pb, MemberOfConfig *config, } if(to_dn_val == NULL){ const char *udn = op_to_sdn ? slapi_sdn_get_udn(op_to_sdn) : ""; - slapi_log_error(SLAPI_LOG_ERR, MEMBEROF_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_ERR, MEMBEROF_PLUGIN_SUBSYSTEM, "memberof_modop_one_replace_r - Failed to get DN value from " "member value (%s)\n", udn); goto bail; } if(this_dn_val == NULL){ const char *udn = op_this_sdn ? slapi_sdn_get_udn(op_this_sdn) : ""; - slapi_log_error(SLAPI_LOG_ERR, MEMBEROF_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_ERR, MEMBEROF_PLUGIN_SUBSYSTEM, "memberof_modop_one_replace_r - Failed to get DN value from" "group (%s)\n", udn); goto bail; @@ -1485,7 +1485,7 @@ memberof_modop_one_replace_r(Slapi_PBlock *pb, MemberOfConfig *config, slapi_value_set_flags(to_dn_val, SLAPI_ATTR_FLAG_NORMALIZED_CIS); if (config == NULL) { - slapi_log_error(SLAPI_LOG_ERR, MEMBEROF_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_ERR, MEMBEROF_PLUGIN_SUBSYSTEM, "memberof_modop_one_replace_r - NULL config parameter\n"); goto bail; } @@ -1546,7 +1546,7 @@ memberof_modop_one_replace_r(Slapi_PBlock *pb, MemberOfConfig *config, /* get result and log an error */ int res = 0; slapi_pblock_get(search_pb, SLAPI_PLUGIN_INTOP_RESULT, &res); - slapi_log_error(SLAPI_LOG_ERR, MEMBEROF_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_ERR, MEMBEROF_PLUGIN_SUBSYSTEM, "memberof_modop_one_replace_r - Error searching for members: %d\n", res); } else { slapi_pblock_get(search_pb, SLAPI_NENTRIES, &n_entries); @@ -1592,7 +1592,7 @@ memberof_modop_one_replace_r(Slapi_PBlock *pb, MemberOfConfig *config, op_str = "UNKNOWN"; } - slapi_log_error(SLAPI_LOG_PLUGIN, MEMBEROF_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_PLUGIN, MEMBEROF_PLUGIN_SUBSYSTEM, "memberof_modop_one_replace_r - %s %s in %s\n" ,op_str, op_this, op_to); @@ -1618,7 +1618,7 @@ memberof_modop_one_replace_r(Slapi_PBlock *pb, MemberOfConfig *config, /* someone set up infinitely recursive groups - bail out */ - slapi_log_error(SLAPI_LOG_PLUGIN, + slapi_log_err(SLAPI_LOG_PLUGIN, MEMBEROF_PLUGIN_SUBSYSTEM, "memberof_modop_one_replace_r - Group recursion" " detected in %s\n" @@ -1631,7 +1631,7 @@ memberof_modop_one_replace_r(Slapi_PBlock *pb, MemberOfConfig *config, } /* do op on group */ - slapi_log_error(SLAPI_LOG_PLUGIN, + slapi_log_err(SLAPI_LOG_PLUGIN, MEMBEROF_PLUGIN_SUBSYSTEM, "memberof_modop_one_replace_r - Descending into group %s\n", op_to); @@ -1675,7 +1675,7 @@ memberof_modop_one_replace_r(Slapi_PBlock *pb, MemberOfConfig *config, if (this_dn_val) { strval = slapi_value_get_string(this_dn_val); } - slapi_log_error(SLAPI_LOG_PLUGIN, + slapi_log_err(SLAPI_LOG_PLUGIN, MEMBEROF_PLUGIN_SUBSYSTEM, "memberof_modop_one_replace_r - Not processing memberOf " "operations on self entry: %s\n", strval); @@ -2074,7 +2074,7 @@ int memberof_get_groups_callback(Slapi_Entry *e, void *callback_data) if (!groupvals || !group_norm_vals) { - slapi_log_error(SLAPI_LOG_PLUGIN, MEMBEROF_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_PLUGIN, MEMBEROF_PLUGIN_SUBSYSTEM, "memberof_get_groups_callback - NULL groupvals or group_norm_vals\n"); rc = -1; goto bail; @@ -2092,7 +2092,7 @@ int memberof_get_groups_callback(Slapi_Entry *e, void *callback_data) /* A recursive group caused us to find our original * entry we passed to memberof_get_groups(). We just * skip processing this entry. */ - slapi_log_error(SLAPI_LOG_PLUGIN, MEMBEROF_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_PLUGIN, MEMBEROF_PLUGIN_SUBSYSTEM, "memberof_get_groups_callback - Group recursion" " detected in %s\n" ,group_ndn); slapi_value_free(&group_ndn_val); @@ -2111,7 +2111,7 @@ int memberof_get_groups_callback(Slapi_Entry *e, void *callback_data) * a member of a group through multiple paths. Either * way, we can just skip processing this entry since we've * already gone through this part of the grouping hierarchy. */ - slapi_log_error(SLAPI_LOG_PLUGIN, MEMBEROF_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_PLUGIN, MEMBEROF_PLUGIN_SUBSYSTEM, "memberof_get_groups_callback - Possible group recursion" " detected in %s\n" ,group_ndn); slapi_value_free(&group_ndn_val); @@ -2644,7 +2644,7 @@ void memberof_fixup_task_thread(void *arg) return; /* no task */ } slapi_task_inc_refcount(task); - slapi_log_error(SLAPI_LOG_PLUGIN, MEMBEROF_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_PLUGIN, MEMBEROF_PLUGIN_SUBSYSTEM, "memberof_fixup_task_thread - refcount incremented.\n" ); /* Fetch our task data from the task */ td = (task_data *)slapi_task_get_data(task); @@ -2655,7 +2655,7 @@ void memberof_fixup_task_thread(void *arg) slapi_task_begin(task, 1); slapi_task_log_notice(task, "Memberof task starts (arg: %s) ...\n", td->filter_str); - slapi_log_error(SLAPI_LOG_INFO, MEMBEROF_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_INFO, MEMBEROF_PLUGIN_SUBSYSTEM, "memberof_fixup_task_thread - Memberof task starts (arg: %s) ...\n", td->filter_str); /* We need to get the config lock first. Trying to get the @@ -2678,11 +2678,11 @@ void memberof_fixup_task_thread(void *arg) slapi_pblock_set(fixup_pb, SLAPI_BACKEND, be); rc = slapi_back_transaction_begin(fixup_pb); if (rc) { - slapi_log_error(SLAPI_LOG_ERR, MEMBEROF_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_ERR, MEMBEROF_PLUGIN_SUBSYSTEM, "memberof_fixup_task_thread - Failed to start transaction\n"); } } else { - slapi_log_error(SLAPI_LOG_ERR, MEMBEROF_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_ERR, MEMBEROF_PLUGIN_SUBSYSTEM, "memberof_fixup_task_thread - Failed to get be backend from %s\n", td->dn); } @@ -2710,13 +2710,13 @@ void memberof_fixup_task_thread(void *arg) slapi_task_log_notice(task, "Memberof task finished."); slapi_task_log_status(task, "Memberof task finished."); slapi_task_inc_progress(task); - slapi_log_error(SLAPI_LOG_INFO, MEMBEROF_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_INFO, MEMBEROF_PLUGIN_SUBSYSTEM, "memberof_fixup_task_thread - Memberof task finished (arg: %s) ...\n", td->filter_str); /* this will queue the destruction of the task */ slapi_task_finish(task, rc); slapi_task_dec_refcount(task); - slapi_log_error(SLAPI_LOG_PLUGIN, MEMBEROF_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_PLUGIN, MEMBEROF_PLUGIN_SUBSYSTEM, "memberof_fixup_task_thread - refcount decremented.\n"); } @@ -2793,7 +2793,7 @@ int memberof_task_add(Slapi_PBlock *pb, Slapi_Entry *e, PR_UNJOINABLE_THREAD, SLAPD_DEFAULT_THREAD_STACKSIZE); if (thread == NULL) { - slapi_log_error(SLAPI_LOG_ERR, MEMBEROF_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_ERR, MEMBEROF_PLUGIN_SUBSYSTEM, "unable to create task thread!\n"); *returncode = LDAP_OPERATIONS_ERROR; slapi_task_finish(task, *returncode); @@ -2809,7 +2809,7 @@ out: void memberof_task_destructor(Slapi_Task *task) { - slapi_log_error(SLAPI_LOG_PLUGIN, MEMBEROF_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_PLUGIN, MEMBEROF_PLUGIN_SUBSYSTEM, "memberof_task_destructor -->\n" ); if (task) { task_data *mydata = (task_data *)slapi_task_get_data(task); @@ -2825,7 +2825,7 @@ memberof_task_destructor(Slapi_Task *task) slapi_ch_free((void **)&mydata); } } - slapi_log_error(SLAPI_LOG_PLUGIN, MEMBEROF_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_PLUGIN, MEMBEROF_PLUGIN_SUBSYSTEM, "memberof_task_destructor <--\n" ); } @@ -2992,7 +2992,7 @@ memberof_add_objectclass(char *auto_add_oc, const char *dn) slapi_pblock_get(mod_pb, SLAPI_PLUGIN_INTOP_RESULT, &rc); if (rc){ - slapi_log_error(SLAPI_LOG_ERR, MEMBEROF_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_ERR, MEMBEROF_PLUGIN_SUBSYSTEM, "memberof_add_objectclass - Failed to add objectclass (%s) to entry (%s)\n", auto_add_oc, dn); } diff --git a/ldap/servers/plugins/memberof/memberof_config.c b/ldap/servers/plugins/memberof/memberof_config.c index 9dac108..c3474bf 100644 --- a/ldap/servers/plugins/memberof/memberof_config.c +++ b/ldap/servers/plugins/memberof/memberof_config.c @@ -89,7 +89,7 @@ memberof_config(Slapi_Entry *config_e, Slapi_PBlock *pb) char returntext[SLAPI_DSE_RETURNTEXT_SIZE]; if ( inited ) { - slapi_log_error(SLAPI_LOG_ERR, MEMBEROF_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_ERR, MEMBEROF_PLUGIN_SUBSYSTEM, "memberof_config - Only one memberOf plugin instance can be used\n" ); return( LDAP_PARAM_ERROR ); } @@ -130,7 +130,7 @@ memberof_config(Slapi_Entry *config_e, Slapi_PBlock *pb) inited = 1; if (returncode != LDAP_SUCCESS) { - slapi_log_error(SLAPI_LOG_ERR, MEMBEROF_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_ERR, MEMBEROF_PLUGIN_SUBSYSTEM, "memberof_config - Error %d: %s\n", returncode, returntext); } @@ -297,7 +297,7 @@ memberof_validate_config (Slapi_PBlock *pb, Slapi_Entry* entryBefore, Slapi_Entr rc = slapi_dn_syntax_check(pb, config_dn, 1); if (rc) { /* syntax check failed */ - slapi_log_error(SLAPI_LOG_ERR, MEMBEROF_PLUGIN_SUBSYSTEM, "memberof_validate_config - " + slapi_log_err(SLAPI_LOG_ERR, MEMBEROF_PLUGIN_SUBSYSTEM, "memberof_validate_config - " "%s does not contain a valid DN (%s)\n", SLAPI_PLUGIN_SHARED_CONFIG_AREA, config_dn); *returncode = LDAP_INVALID_DN_SYNTAX; @@ -483,7 +483,7 @@ memberof_apply_config (Slapi_PBlock *pb, Slapi_Entry* entryBefore, Slapi_Entry* PR_snprintf(returntext, SLAPI_DSE_RETURNTEXT_SIZE, "memberof_apply_config - Failed to locate shared config entry (%s)", sharedcfg); - slapi_log_error(SLAPI_LOG_ERR, MEMBEROF_PLUGIN_SUBSYSTEM,"%s\n",returntext); + slapi_log_err(SLAPI_LOG_ERR, MEMBEROF_PLUGIN_SUBSYSTEM,"%s\n",returntext); *returncode = LDAP_UNWILLING_TO_PERFORM; goto done; } @@ -586,7 +586,7 @@ memberof_apply_config (Slapi_PBlock *pb, Slapi_Entry* entryBefore, Slapi_Entry* */ if ((theConfig.group_filter = slapi_str2filter(filter_str)) == NULL) { - slapi_log_error(SLAPI_LOG_ERR, MEMBEROF_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_ERR, MEMBEROF_PLUGIN_SUBSYSTEM, "memberof_apply_config - Unable to create the group check filter. The memberOf " "plug-in will not operate on changes to groups. Please check " "your %s configuration settings. (filter: %s)\n", @@ -988,7 +988,7 @@ bail: if (ret){ slapi_pblock_set(pb, SLAPI_RESULT_CODE, &ret); slapi_pblock_set(pb, SLAPI_PB_RESULT_TEXT, returntext); - slapi_log_error(SLAPI_LOG_ERR, MEMBEROF_PLUGIN_SUBSYSTEM, "memberof_shared_config_validate - %s/n", + slapi_log_err(SLAPI_LOG_ERR, MEMBEROF_PLUGIN_SUBSYSTEM, "memberof_shared_config_validate - %s/n", returntext); } slapi_sdn_free(&config_sdn); diff --git a/ldap/servers/plugins/mep/mep.c b/ldap/servers/plugins/mep/mep.c index 1c4aed8..7c4c8a1 100644 --- a/ldap/servers/plugins/mep/mep.c +++ b/ldap/servers/plugins/mep/mep.c @@ -159,7 +159,7 @@ mep_init(Slapi_PBlock *pb) int predel = SLAPI_PLUGIN_PRE_DELETE_FN; int premdn = SLAPI_PLUGIN_PRE_MODRDN_FN; - slapi_log_error(SLAPI_LOG_TRACE, MEP_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_TRACE, MEP_PLUGIN_SUBSYSTEM, "--> mep_init\n"); if ((slapi_pblock_get(pb, SLAPI_PLUGIN_CONFIG_ENTRY, &plugin_entry) == 0) && @@ -193,7 +193,7 @@ mep_init(Slapi_PBlock *pb) slapi_pblock_set(pb, preadd, (void *) mep_add_pre_op) != 0 || slapi_pblock_set(pb, predel, (void *) mep_del_pre_op) != 0 || slapi_pblock_set(pb, premdn, (void *) mep_modrdn_pre_op) != 0) { - slapi_log_error(SLAPI_LOG_ERR, MEP_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_ERR, MEP_PLUGIN_SUBSYSTEM, "mep_init - Failed to register plugin\n"); status = -1; } @@ -207,7 +207,7 @@ mep_init(Slapi_PBlock *pb) NULL, /* ? */ plugin_identity /* access control */ )) { - slapi_log_error(SLAPI_LOG_ERR, MEP_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_ERR, MEP_PLUGIN_SUBSYSTEM, "mep_init - Failed to register internalpostoperation plugin\n"); status = -1; } @@ -222,13 +222,13 @@ mep_init(Slapi_PBlock *pb) NULL, /* ? */ plugin_identity /* access control */ )) { - slapi_log_error(SLAPI_LOG_ERR, MEP_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_ERR, MEP_PLUGIN_SUBSYSTEM, "mep_init - Failed to register plugin\n"); status = -1; } } - slapi_log_error(SLAPI_LOG_TRACE, MEP_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_TRACE, MEP_PLUGIN_SUBSYSTEM, "<-- mep_init\n"); return status; } @@ -251,7 +251,7 @@ mep_internal_postop_init(Slapi_PBlock *pb) (void *) mep_mod_post_op) != 0 || slapi_pblock_set(pb, SLAPI_PLUGIN_INTERNAL_POST_MODRDN_FN, (void *) mep_modrdn_post_op) != 0) { - slapi_log_error(SLAPI_LOG_ERR, MEP_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_ERR, MEP_PLUGIN_SUBSYSTEM, "mep_internal_postop_init - Failed to register plugin\n"); status = -1; } @@ -283,7 +283,7 @@ mep_postop_init(Slapi_PBlock *pb) slapi_pblock_set(pb, delfn, (void *) mep_del_post_op) != 0 || slapi_pblock_set(pb, modfn, (void *) mep_mod_post_op) != 0 || slapi_pblock_set(pb, mdnfn, (void *) mep_modrdn_post_op) != 0) { - slapi_log_error(SLAPI_LOG_ERR, MEP_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_ERR, MEP_PLUGIN_SUBSYSTEM, "mep_postop_init - Failed to register plugin\n"); status = -1; } @@ -303,13 +303,13 @@ mep_start(Slapi_PBlock * pb) Slapi_DN *plugindn = NULL; char *config_area = NULL; - slapi_log_error(SLAPI_LOG_TRACE, MEP_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_TRACE, MEP_PLUGIN_SUBSYSTEM, "--> mep_start\n"); g_mep_config_lock = slapi_new_rwlock(); if (!g_mep_config_lock) { - slapi_log_error(SLAPI_LOG_ERR, MEP_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_ERR, MEP_PLUGIN_SUBSYSTEM, "mep_start - Lock creation failed\n"); return -1; @@ -320,7 +320,7 @@ mep_start(Slapi_PBlock * pb) * and store it for future use. */ slapi_pblock_get(pb, SLAPI_TARGET_SDN, &plugindn); if (NULL == plugindn || 0 == slapi_sdn_get_ndn_len(plugindn)) { - slapi_log_error(SLAPI_LOG_PLUGIN, MEP_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_PLUGIN, MEP_PLUGIN_SUBSYSTEM, "mep_start - Unable to retrieve plugin dn\n"); return -1; } @@ -340,14 +340,14 @@ mep_start(Slapi_PBlock * pb) PR_INIT_CLIST(g_mep_config); if (mep_load_config() != 0) { - slapi_log_error(SLAPI_LOG_ERR, MEP_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_ERR, MEP_PLUGIN_SUBSYSTEM, "mep_start - Unable to load plug-in configuration\n"); return -1; } - slapi_log_error(SLAPI_LOG_PLUGIN, MEP_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_PLUGIN, MEP_PLUGIN_SUBSYSTEM, "mep_start - Ready for service\n"); - slapi_log_error(SLAPI_LOG_TRACE, MEP_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_TRACE, MEP_PLUGIN_SUBSYSTEM, "<-- mep_start\n"); return 0; @@ -361,7 +361,7 @@ mep_start(Slapi_PBlock * pb) static int mep_close(Slapi_PBlock * pb) { - slapi_log_error(SLAPI_LOG_TRACE, MEP_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_TRACE, MEP_PLUGIN_SUBSYSTEM, "--> mep_close\n"); mep_delete_config(); @@ -371,7 +371,7 @@ mep_close(Slapi_PBlock * pb) slapi_sdn_free(&_PluginDN); slapi_sdn_free(&_ConfigAreaDN); - slapi_log_error(SLAPI_LOG_TRACE, MEP_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_TRACE, MEP_PLUGIN_SUBSYSTEM, "<-- mep_close\n"); return 0; @@ -398,7 +398,7 @@ mep_load_config(void) Slapi_PBlock *search_pb; Slapi_Entry **entries = NULL; - slapi_log_error(SLAPI_LOG_TRACE, MEP_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_TRACE, MEP_PLUGIN_SUBSYSTEM, "--> mep_load_config\n"); /* Clear out any old config. */ @@ -413,7 +413,7 @@ mep_load_config(void) * config entry. */ if (mep_get_config_area()) { /* Find the config entries beneath the alternate config area. */ - slapi_log_error(SLAPI_LOG_PLUGIN, MEP_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_PLUGIN, MEP_PLUGIN_SUBSYSTEM, "mep_load_config - Looking for config entries " "beneath \"%s\".\n", slapi_sdn_get_ndn(mep_get_config_area())); slapi_search_internal_set_pb(search_pb, slapi_sdn_get_ndn(mep_get_config_area()), @@ -421,7 +421,7 @@ mep_load_config(void) NULL, 0, NULL, NULL, mep_get_plugin_id(), 0); } else { /* Find the config entries beneath our plugin entry. */ - slapi_log_error(SLAPI_LOG_PLUGIN, MEP_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_PLUGIN, MEP_PLUGIN_SUBSYSTEM, "mep_load_config - Looking for config entries " "beneath \"%s\".\n", slapi_sdn_get_ndn(mep_get_plugin_sdn())); @@ -436,7 +436,7 @@ mep_load_config(void) if (LDAP_SUCCESS != result) { if (mep_get_config_area() && (result == LDAP_NO_SUCH_OBJECT)) { - slapi_log_error(SLAPI_LOG_PLUGIN, MEP_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_PLUGIN, MEP_PLUGIN_SUBSYSTEM, "mep_load_config - Config container \"%s\" does " "not exist.\n", slapi_sdn_get_ndn(mep_get_config_area())); goto cleanup; @@ -461,7 +461,7 @@ mep_load_config(void) slapi_free_search_results_internal(search_pb); slapi_pblock_destroy(search_pb); mep_config_unlock(); - slapi_log_error(SLAPI_LOG_TRACE, MEP_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_TRACE, MEP_PLUGIN_SUBSYSTEM, "<-- mep_load_config\n"); return status; @@ -487,7 +487,7 @@ mep_parse_config_entry(Slapi_Entry * e, int apply) int entry_added = 0; int ret = 0; - slapi_log_error(SLAPI_LOG_TRACE, MEP_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_TRACE, MEP_PLUGIN_SUBSYSTEM, "--> mep_parse_config_entry\n"); /* If this is the main plug-in @@ -507,14 +507,14 @@ mep_parse_config_entry(Slapi_Entry * e, int apply) entry->sdn = slapi_sdn_dup(slapi_entry_get_sdn(e)); if(entry->sdn == NULL){ - slapi_log_error(SLAPI_LOG_ERR, MEP_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_ERR, MEP_PLUGIN_SUBSYSTEM, "mep_parse_config_entry - Error " "reading dn from config entry\n"); ret = -1; goto bail; } - slapi_log_error(SLAPI_LOG_CONFIG, MEP_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_CONFIG, MEP_PLUGIN_SUBSYSTEM, "----------> dn [%s]\n", slapi_sdn_get_dn(entry->sdn)); /* Load the origin scope */ @@ -522,7 +522,7 @@ mep_parse_config_entry(Slapi_Entry * e, int apply) if (value) { entry->origin_scope = value; } else { - slapi_log_error(SLAPI_LOG_ERR, MEP_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_ERR, MEP_PLUGIN_SUBSYSTEM, "mep_parse_config_entry - The %s config " "setting is required for config entry \"%s\".\n", MEP_SCOPE_TYPE, slapi_sdn_get_dn(entry->sdn)); @@ -535,7 +535,7 @@ mep_parse_config_entry(Slapi_Entry * e, int apply) if (value) { /* Convert to a Slapi_Filter to improve performance. */ if (NULL == (entry->origin_filter = slapi_str2filter(value))) { - slapi_log_error(SLAPI_LOG_ERR, MEP_PLUGIN_SUBSYSTEM , + slapi_log_err(SLAPI_LOG_ERR, MEP_PLUGIN_SUBSYSTEM , "mep_parse_config_entry - Invalid search filter in " "%s config setting for config entry \"%s\" " "(filter = \"%s\").\n", MEP_FILTER_TYPE, slapi_sdn_get_dn(entry->sdn), value); @@ -548,7 +548,7 @@ mep_parse_config_entry(Slapi_Entry * e, int apply) goto bail; } } else { - slapi_log_error(SLAPI_LOG_ERR, MEP_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_ERR, MEP_PLUGIN_SUBSYSTEM, "mep_parse_config_entry - The %s config " "setting is required for config entry \"%s\".\n", MEP_FILTER_TYPE, slapi_sdn_get_dn(entry->sdn)); @@ -561,7 +561,7 @@ mep_parse_config_entry(Slapi_Entry * e, int apply) if (value) { entry->managed_base = value; } else { - slapi_log_error(SLAPI_LOG_ERR, MEP_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_ERR, MEP_PLUGIN_SUBSYSTEM, "mep_parse_config_entry - The %s config " "setting is required for config entry \"%s\".\n", MEP_MANAGED_BASE_TYPE, slapi_sdn_get_dn(entry->sdn)); @@ -582,7 +582,7 @@ mep_parse_config_entry(Slapi_Entry * e, int apply) &entry->template_entry, mep_get_plugin_id()); if (entry->template_entry == NULL) { - slapi_log_error(SLAPI_LOG_ERR, MEP_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_ERR, MEP_PLUGIN_SUBSYSTEM, "mep_parse_config_entry - The managed entry " "template \"%s\" does not exist. Please " "add it or correct the %s config setting for " @@ -596,7 +596,7 @@ mep_parse_config_entry(Slapi_Entry * e, int apply) * entry and running a schema check on it */ test_entry = mep_create_managed_entry(entry, NULL); if (test_entry == NULL) { - slapi_log_error(SLAPI_LOG_ERR, MEP_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_ERR, MEP_PLUGIN_SUBSYSTEM, "mep_parse_config_entry - Unable to create " "a test managed entry from managed entry " "template \"%s\". Please check the template " @@ -607,7 +607,7 @@ mep_parse_config_entry(Slapi_Entry * e, int apply) /* Check the schema */ if (slapi_entry_schema_check(NULL, test_entry) != 0) { - slapi_log_error(SLAPI_LOG_ERR, MEP_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_ERR, MEP_PLUGIN_SUBSYSTEM, "mep_parse_config_entry - Test managed " "entry created from managed entry template " "\"%s\" violates the schema. Please check " @@ -627,7 +627,7 @@ mep_parse_config_entry(Slapi_Entry * e, int apply) slapi_entry_free(test_entry); } else { - slapi_log_error(SLAPI_LOG_ERR, MEP_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_ERR, MEP_PLUGIN_SUBSYSTEM, "mep_parse_config_entry - The %s config " "setting is required for config entry \"%s\".\n", MEP_MANAGED_TEMPLATE_TYPE, slapi_sdn_get_dn(entry->sdn)); @@ -652,7 +652,7 @@ mep_parse_config_entry(Slapi_Entry * e, int apply) * the entry before that list item. */ if (slapi_dn_issuffix(entry->origin_scope, config_entry->origin_scope)) { PR_INSERT_BEFORE(&(entry->list), list); - slapi_log_error(SLAPI_LOG_CONFIG, MEP_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_CONFIG, MEP_PLUGIN_SUBSYSTEM, "mep_parse_config_entry - store [%s] before [%s] \n", slapi_sdn_get_dn(entry->sdn), slapi_sdn_get_dn(config_entry->sdn)); @@ -665,7 +665,7 @@ mep_parse_config_entry(Slapi_Entry * e, int apply) /* If we hit the end of the list, add to the tail. */ if (g_mep_config == list) { PR_INSERT_BEFORE(&(entry->list), list); - slapi_log_error(SLAPI_LOG_CONFIG, MEP_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_CONFIG, MEP_PLUGIN_SUBSYSTEM, "mep_parse_config_entry - store [%s] at tail\n", slapi_sdn_get_dn(entry->sdn)); entry_added = 1; @@ -675,7 +675,7 @@ mep_parse_config_entry(Slapi_Entry * e, int apply) } else { /* first entry */ PR_INSERT_LINK(&(entry->list), g_mep_config); - slapi_log_error(SLAPI_LOG_CONFIG, MEP_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_CONFIG, MEP_PLUGIN_SUBSYSTEM, "mep_parse_config_entry - store [%s] at head \n", slapi_sdn_get_dn(entry->sdn)); entry_added = 1; @@ -685,7 +685,7 @@ mep_parse_config_entry(Slapi_Entry * e, int apply) if (0 == entry_added) { /* Don't log error if we weren't asked to apply config */ if ((apply != 0) && (entry != NULL)) { - slapi_log_error(SLAPI_LOG_ERR, MEP_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_ERR, MEP_PLUGIN_SUBSYSTEM, "mep_parse_config_entry - Invalid config entry " "[%s] skipped\n", slapi_sdn_get_dn(entry->sdn)); } @@ -694,7 +694,7 @@ mep_parse_config_entry(Slapi_Entry * e, int apply) ret = 0; } - slapi_log_error(SLAPI_LOG_TRACE, MEP_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_TRACE, MEP_PLUGIN_SUBSYSTEM, "<-- mep_parse_config_entry\n"); return ret; @@ -709,7 +709,7 @@ mep_free_config_entry(struct configEntry ** entry) return; if (e->sdn) { - slapi_log_error(SLAPI_LOG_CONFIG, MEP_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_CONFIG, MEP_PLUGIN_SUBSYSTEM, "mep_free_config_entry - Freeing config entry [%s]\n", slapi_sdn_get_dn(e->sdn)); slapi_sdn_free(&e->sdn); } @@ -789,7 +789,7 @@ mep_parse_mapped_origin_attr(char *mapping, char **origin_type) /* split out the type from the value (use the first ':') */ if ((p = strchr(mapping, ':')) == NULL) { - slapi_log_error(SLAPI_LOG_ERR, MEP_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_ERR, MEP_PLUGIN_SUBSYSTEM, "mep_parse_mapped_origin_attr - Value for mapped attribute " "is not in the correct format. (value: \"%s\").\n", mapping); @@ -799,7 +799,7 @@ mep_parse_mapped_origin_attr(char *mapping, char **origin_type) /* Ensure the type is not empty. */ if (p == mapping) { - slapi_log_error(SLAPI_LOG_ERR, MEP_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_ERR, MEP_PLUGIN_SUBSYSTEM, "mep_parse_mapped_origin_attr - Value for mapped attribute " "is not in the correct format. The type is missing. " "(value: \"%s\").\n", @@ -824,7 +824,7 @@ mep_parse_mapped_origin_attr(char *mapping, char **origin_type) for (; p <= end; p++) { if (*p == '$') { if (p == end) { - slapi_log_error(SLAPI_LOG_ERR, MEP_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_ERR, MEP_PLUGIN_SUBSYSTEM, "mep_parse_mapped_origin_attr - Invalid mapped " "attribute value for type \"%s\".\n", mapping); ret = 1; @@ -853,7 +853,7 @@ mep_parse_mapped_origin_attr(char *mapping, char **origin_type) if (p < end) { p++; } else { - slapi_log_error(SLAPI_LOG_ERR, MEP_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_ERR, MEP_PLUGIN_SUBSYSTEM, "mep_parse_mapped_origin_attr - Invalid mapped " "attribute value for type \"%s\".\n", mapping); ret = 1; @@ -874,7 +874,7 @@ mep_parse_mapped_origin_attr(char *mapping, char **origin_type) /* If the variable is quoted and this is not a closing * brace, there is a syntax error in the mapping rule. */ if (quoted && (*p != '}')) { - slapi_log_error(SLAPI_LOG_ERR, MEP_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_ERR, MEP_PLUGIN_SUBSYSTEM, "mep_parse_mapped_origin_attr - Invalid mapped " "attribute value for type \"%s\".\n", mapping); ret = 1; @@ -974,10 +974,10 @@ static Slapi_DN * mep_get_sdn(Slapi_PBlock * pb) { Slapi_DN *sdn = 0; - slapi_log_error(SLAPI_LOG_TRACE, MEP_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_TRACE, MEP_PLUGIN_SUBSYSTEM, "--> mep_get_sdn\n"); slapi_pblock_get(pb, SLAPI_TARGET_SDN, &sdn); - slapi_log_error(SLAPI_LOG_TRACE, MEP_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_TRACE, MEP_PLUGIN_SUBSYSTEM, "<-- mep_get_sdn\n"); return sdn; @@ -1005,7 +1005,7 @@ mep_dn_is_config(Slapi_DN *sdn) { int ret = 0; - slapi_log_error(SLAPI_LOG_TRACE, MEP_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_TRACE, MEP_PLUGIN_SUBSYSTEM, "--> mep_dn_is_config\n"); if (sdn == NULL) { @@ -1029,7 +1029,7 @@ mep_dn_is_config(Slapi_DN *sdn) } bail: - slapi_log_error(SLAPI_LOG_TRACE, MEP_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_TRACE, MEP_PLUGIN_SUBSYSTEM, "<-- mep_dn_is_config\n"); return ret; @@ -1155,11 +1155,11 @@ mep_oktodo(Slapi_PBlock *pb) int ret = 1; int oprc = 0; - slapi_log_error(SLAPI_LOG_TRACE, MEP_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_TRACE, MEP_PLUGIN_SUBSYSTEM, "--> mep_oktodo\n" ); if(slapi_pblock_get(pb, SLAPI_PLUGIN_OPRETURN, &oprc) != 0) { - slapi_log_error(SLAPI_LOG_ERR, MEP_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_ERR, MEP_PLUGIN_SUBSYSTEM, "mep_oktodo: Could not get parameters\n" ); ret = -1; } @@ -1169,7 +1169,7 @@ mep_oktodo(Slapi_PBlock *pb) ret = 0; } - slapi_log_error(SLAPI_LOG_TRACE, MEP_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_TRACE, MEP_PLUGIN_SUBSYSTEM, "<-- mep_oktodo\n" ); return ret; @@ -1186,12 +1186,12 @@ mep_isrepl(Slapi_PBlock *pb) { int is_repl = 0; - slapi_log_error(SLAPI_LOG_TRACE, MEP_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_TRACE, MEP_PLUGIN_SUBSYSTEM, "--> mep_isrepl\n" ); slapi_pblock_get(pb, SLAPI_IS_REPLICATED_OPERATION, &is_repl); - slapi_log_error(SLAPI_LOG_TRACE, MEP_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_TRACE, MEP_PLUGIN_SUBSYSTEM, "<-- mep_isrepl\n" ); return is_repl; @@ -1229,7 +1229,7 @@ mep_create_managed_entry(struct configEntry *config, Slapi_Entry *origin) /* Ensure that a RDN type was specified in the template. */ if ((rdn_type = slapi_entry_attr_get_charptr(template, MEP_RDN_ATTR_TYPE)) == NULL) { - slapi_log_error(SLAPI_LOG_ERR, MEP_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_ERR, MEP_PLUGIN_SUBSYSTEM, "mep_create_managed_entry - The %s config attribute " "was not found in template \"%s\". This attribute " "is required.\n", MEP_RDN_ATTR_TYPE, slapi_sdn_get_dn(config->template_sdn)); @@ -1248,7 +1248,7 @@ mep_create_managed_entry(struct configEntry *config, Slapi_Entry *origin) struct berval bvtype = {0, NULL}, bvvalue = {0, NULL}; int freeval = 0; if (slapi_ldif_parse_line(vals[i], &bvtype, &bvvalue, &freeval) != 0) { - slapi_log_error(SLAPI_LOG_ERR, MEP_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_ERR, MEP_PLUGIN_SUBSYSTEM, "mep_create_managed_entry - Value for %s config setting " "is not in the correct format in template \"%s\". " "(value: \"%s\")\n", MEP_STATIC_ATTR_TYPE, @@ -1289,7 +1289,7 @@ mep_create_managed_entry(struct configEntry *config, Slapi_Entry *origin) slapi_ch_free_string(&type); slapi_ch_free_string(&value); } else { - slapi_log_error(SLAPI_LOG_ERR, MEP_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_ERR, MEP_PLUGIN_SUBSYSTEM, "mep_create_managed_entry - Error parsing mapped attribute " "in template \"%s\".\n", slapi_sdn_get_dn(config->template_sdn)); err = 1; @@ -1300,7 +1300,7 @@ mep_create_managed_entry(struct configEntry *config, Slapi_Entry *origin) /* The RDN attribute must be a mapped attribute. If we didn't find it, * we need to bail. */ if (!found_rdn_map) { - slapi_log_error(SLAPI_LOG_ERR, MEP_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_ERR, MEP_PLUGIN_SUBSYSTEM, "mep_create_managed_entry - The RDN type \"%s\" " "was not found as a mapped attribute in template " "\"%s\". It must be a mapped attribute.\n", @@ -1336,7 +1336,7 @@ mep_create_managed_entry(struct configEntry *config, Slapi_Entry *origin) if (dn != NULL) { slapi_sdn_set_dn_passin(slapi_entry_get_sdn(managed_entry), dn); } else { - slapi_log_error(SLAPI_LOG_ERR, MEP_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_ERR, MEP_PLUGIN_SUBSYSTEM, "mep_create_managed_entry - Error setting DN " "in managed entry based off of template entry " "\"%s\" (origin entry \"%s\").\n", @@ -1385,14 +1385,14 @@ mep_add_managed_entry(struct configEntry *config, int result = LDAP_SUCCESS; /* Create the managed entry */ - slapi_log_error(SLAPI_LOG_PLUGIN, MEP_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_PLUGIN, MEP_PLUGIN_SUBSYSTEM, "mep_add_managed_entry - Creating a managed " "entry from origin entry \"%s\" using " "config \"%s\".\n", slapi_entry_get_dn(origin), slapi_sdn_get_dn(config->sdn)); managed_entry = mep_create_managed_entry(config, origin); if (managed_entry == NULL) { - slapi_log_error(SLAPI_LOG_ERR, MEP_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_ERR, MEP_PLUGIN_SUBSYSTEM, "mep_add_managed_entry - Unable to create a managed " "entry from origin entry \"%s\" using config " "\"%s\".\n", slapi_entry_get_dn(origin), slapi_sdn_get_dn(config->sdn)); @@ -1404,7 +1404,7 @@ mep_add_managed_entry(struct configEntry *config, managed_dn = slapi_ch_strdup(slapi_entry_get_dn(managed_entry)); /* Add managed entry to db. The entry will be consumed. */ - slapi_log_error(SLAPI_LOG_PLUGIN, MEP_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_PLUGIN, MEP_PLUGIN_SUBSYSTEM, "mep_add_managed_entry - Adding managed entry \"%s\" for origin " "entry \"%s\"\n.", managed_dn, slapi_entry_get_dn(origin)); slapi_add_entry_internal_set_pb(mod_pb, managed_entry, NULL, @@ -1413,7 +1413,7 @@ mep_add_managed_entry(struct configEntry *config, slapi_pblock_get(mod_pb, SLAPI_PLUGIN_INTOP_RESULT, &result); if (result != LDAP_SUCCESS) { - slapi_log_error(SLAPI_LOG_ERR, MEP_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_ERR, MEP_PLUGIN_SUBSYSTEM, "mep_add_managed_entry - Unable to add managed " "entry \"%s\" for origin entry \"%s\" (%s).\n", managed_dn, slapi_entry_get_dn(origin), @@ -1448,7 +1448,7 @@ mep_add_managed_entry(struct configEntry *config, slapi_modify_internal_pb(mod_pb); slapi_pblock_get(mod_pb, SLAPI_PLUGIN_INTOP_RESULT, &result); if (result != LDAP_SUCCESS && result != LDAP_TYPE_OR_VALUE_EXISTS){ - slapi_log_error(SLAPI_LOG_ERR, MEP_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_ERR, MEP_PLUGIN_SUBSYSTEM, "mep_add_managed_entry - Failed to add managed entry " "objectclass in origin entry \"%s\", error (%s)\n", slapi_entry_get_dn(origin), ldap_err2string(result)); @@ -1467,7 +1467,7 @@ mep_add_managed_entry(struct configEntry *config, mods[0] = &pointer_mod; mods[1] = NULL; - slapi_log_error(SLAPI_LOG_PLUGIN, MEP_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_PLUGIN, MEP_PLUGIN_SUBSYSTEM, "mep_add_managed_entry - Adding %s pointer to \"%s\" in entry \"%s\"\n.", MEP_MANAGED_ENTRY_TYPE, managed_dn, slapi_entry_get_dn(origin)); @@ -1477,7 +1477,7 @@ mep_add_managed_entry(struct configEntry *config, slapi_pblock_get(mod_pb, SLAPI_PLUGIN_INTOP_RESULT, &result); if (result != LDAP_SUCCESS) { - slapi_log_error(SLAPI_LOG_ERR, MEP_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_ERR, MEP_PLUGIN_SUBSYSTEM, "mep_add_managed_entry - Unable to add pointer to " "managed entry \"%s\" in origin entry \"%s\" " "(%s).\n", managed_dn, slapi_entry_get_dn(origin), @@ -1524,7 +1524,7 @@ mep_rename_managed_entry(Slapi_Entry *origin, slapi_pblock_get(mep_pb, SLAPI_PLUGIN_INTOP_RESULT, &result); if (result != LDAP_SUCCESS) { - slapi_log_error(SLAPI_LOG_ERR, MEP_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_ERR, MEP_PLUGIN_SUBSYSTEM, "mep_rename_managed_entry - Unable to rename managed " "entry \"%s\" to \"%s\" (%s).\n", slapi_sdn_get_dn(old_dn), slapi_sdn_get_dn(new_dn), ldap_err2string(result)); @@ -1542,7 +1542,7 @@ mep_rename_managed_entry(Slapi_Entry *origin, mods[1] = 0; /* Perform the modify operation. */ - slapi_log_error(SLAPI_LOG_PLUGIN, MEP_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_PLUGIN, MEP_PLUGIN_SUBSYSTEM, "mep_rename_managed_entry - Updating %s pointer to " "\"%s\" in entry \"%s\"\n.", MEP_MANAGED_ENTRY_TYPE, vals[0], slapi_entry_get_dn(origin)); @@ -1552,7 +1552,7 @@ mep_rename_managed_entry(Slapi_Entry *origin, slapi_pblock_get(mep_pb, SLAPI_PLUGIN_INTOP_RESULT, &result); if (result != LDAP_SUCCESS) { - slapi_log_error(SLAPI_LOG_ERR, MEP_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_ERR, MEP_PLUGIN_SUBSYSTEM, "mep_rename_managed_entry - Unable to update %s " "pointer in entry \"%s\" (%s).\n", MEP_MANAGED_ENTRY_TYPE, slapi_entry_get_dn(origin), ldap_err2string(result)); @@ -1603,7 +1603,7 @@ static Slapi_Mods *mep_get_mapped_mods(struct configEntry *config, /* Find the the RDN type for the managed entry. */ if ((rdn_type = slapi_entry_attr_get_charptr(template, MEP_RDN_ATTR_TYPE)) == NULL) { - slapi_log_error(SLAPI_LOG_ERR, MEP_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_ERR, MEP_PLUGIN_SUBSYSTEM, "mep_get_mapped_mods - Error getting RDN type from tempate " "\"%s\".\n", slapi_sdn_get_dn(config->template_sdn)); slapi_mods_free(&smods); @@ -1629,7 +1629,7 @@ static Slapi_Mods *mep_get_mapped_mods(struct configEntry *config, slapi_ch_free_string(&type); slapi_ch_free_string(&value); } else { - slapi_log_error(SLAPI_LOG_ERR, MEP_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_ERR, MEP_PLUGIN_SUBSYSTEM, "mep_get_mapped_mods - Error parsing mapped attribute " "in template \"%s\".\n", slapi_sdn_get_dn(config->template_sdn)); slapi_mods_free(&smods); @@ -1670,7 +1670,7 @@ mep_parse_mapped_attr(char *mapping, Slapi_Entry *origin, /* split out the type from the value (use the first ':') */ if ((p = strchr(mapping, ':')) == NULL) { - slapi_log_error(SLAPI_LOG_ERR, MEP_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_ERR, MEP_PLUGIN_SUBSYSTEM, "mep_parse_mapped_attr - Value for mapped attribute " "is not in the correct format. (value: \"%s\").\n", mapping); @@ -1680,7 +1680,7 @@ mep_parse_mapped_attr(char *mapping, Slapi_Entry *origin, /* Ensure the type is not empty. */ if (p == mapping) { - slapi_log_error(SLAPI_LOG_ERR, MEP_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_ERR, MEP_PLUGIN_SUBSYSTEM, "mep_parse_mapped_attr - Value for mapped attribute " "is not in the correct format. The type is missing. " "(value: \"%s\").\n", @@ -1710,7 +1710,7 @@ mep_parse_mapped_attr(char *mapping, Slapi_Entry *origin, for (; p <= end; p++) { if (*p == '$') { if (p == end) { - slapi_log_error(SLAPI_LOG_ERR, MEP_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_ERR, MEP_PLUGIN_SUBSYSTEM, "mep_parse_mapped_attr - Invalid mapped " "attribute value for type \"%s\".\n", mapping); ret = 1; @@ -1739,7 +1739,7 @@ mep_parse_mapped_attr(char *mapping, Slapi_Entry *origin, if (p < end) { p++; } else { - slapi_log_error(SLAPI_LOG_ERR, MEP_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_ERR, MEP_PLUGIN_SUBSYSTEM, "mep_parse_mapped_attr - Invalid mapped " "attribute value for type \"%s\".\n", mapping); ret = 1; @@ -1760,7 +1760,7 @@ mep_parse_mapped_attr(char *mapping, Slapi_Entry *origin, /* If the variable is quoted and this is not a closing * brace, there is a syntax error in the mapping rule. */ if (quoted && (*p != '}')) { - slapi_log_error(SLAPI_LOG_ERR, MEP_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_ERR, MEP_PLUGIN_SUBSYSTEM, "mep_parse_mapped_attr - Invalid mapped " "attribute value for type \"%s\".\n", mapping); ret = 1; @@ -1805,7 +1805,7 @@ mep_parse_mapped_attr(char *mapping, Slapi_Entry *origin, for (p = post_str; p && (p <= end); p++) { if (*p == '$') { if ((p == end) || (*(p+1) != '$')) { - slapi_log_error(SLAPI_LOG_ERR, MEP_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_ERR, MEP_PLUGIN_SUBSYSTEM, "mep_parse_mapped_attr - Invalid mapped " "attribute value for type \"%s\".\n", mapping); ret = 1; @@ -1847,7 +1847,7 @@ mep_parse_mapped_attr(char *mapping, Slapi_Entry *origin, slapi_ch_free_string(&map_val); } } else { - slapi_log_error(SLAPI_LOG_ERR, MEP_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_ERR, MEP_PLUGIN_SUBSYSTEM, "mep_parse_mapped_attr - Mapped attribute \"%s\" " "is not present in origin entry \"%s\". Please " "correct template to only map attributes " @@ -1862,7 +1862,7 @@ mep_parse_mapped_attr(char *mapping, Slapi_Entry *origin, post_str); } } else { - slapi_log_error(SLAPI_LOG_ERR, MEP_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_ERR, MEP_PLUGIN_SUBSYSTEM, "mep_parse_mapped_attr - No variable found in " "mapped attribute value for type \"%s\".\n", mapping); @@ -1969,7 +1969,7 @@ mep_pre_op(Slapi_PBlock * pb, int modop) void *caller_id = NULL; int ret = SLAPI_PLUGIN_SUCCESS; - slapi_log_error(SLAPI_LOG_TRACE, MEP_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_TRACE, MEP_PLUGIN_SUBSYSTEM, "--> mep_pre_op\n"); /* See if we're calling ourselves. */ @@ -2198,7 +2198,7 @@ mep_pre_op(Slapi_PBlock * pb, int modop) slapi_mod_free(&next_mod); } else { - slapi_log_error(SLAPI_LOG_ERR, MEP_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_ERR, MEP_PLUGIN_SUBSYSTEM, "mep_pre_op - Unable to fetch config for " "origin entry \"%s\".\n", origin_dn); } @@ -2210,11 +2210,11 @@ mep_pre_op(Slapi_PBlock * pb, int modop) slapi_pblock_get(pb, SLAPI_OPERATION, &op); if(operation_is_flag_set(op, OP_FLAG_INTERNAL)){ - slapi_log_error(SLAPI_LOG_PLUGIN, MEP_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_PLUGIN, MEP_PLUGIN_SUBSYSTEM, "mep_pre_op - (internal operation) Unable to fetch " "origin entry \"%s\".\n", origin_dn); } else { - slapi_log_error(SLAPI_LOG_ERR, MEP_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_ERR, MEP_PLUGIN_SUBSYSTEM, "mep_pre_op - Unable to fetch origin entry " "\"%s\".\n", origin_dn); } @@ -2243,7 +2243,7 @@ mep_pre_op(Slapi_PBlock * pb, int modop) slapi_entry_free(e); if (ret) { - slapi_log_error(SLAPI_LOG_PLUGIN, MEP_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_PLUGIN, MEP_PLUGIN_SUBSYSTEM, "mep_pre_op - Operation failure [%d]\n", ret); slapi_send_ldap_result(pb, ret, NULL, errstr, 0, NULL); slapi_ch_free((void **)&errstr); @@ -2251,7 +2251,7 @@ mep_pre_op(Slapi_PBlock * pb, int modop) ret = SLAPI_PLUGIN_FAILURE; } - slapi_log_error(SLAPI_LOG_TRACE, MEP_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_TRACE, MEP_PLUGIN_SUBSYSTEM, "<-- mep_pre_op\n"); return ret; @@ -2297,7 +2297,7 @@ mep_mod_post_op(Slapi_PBlock *pb) LDAPMod **mods = NULL; int i, abort_mod = 1; - slapi_log_error(SLAPI_LOG_TRACE, MEP_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_TRACE, MEP_PLUGIN_SUBSYSTEM, "--> mep_mod_post_op\n"); if (mep_oktodo(pb) && (sdn = mep_get_sdn(pb))) { @@ -2315,7 +2315,7 @@ mep_mod_post_op(Slapi_PBlock *pb) * backend, so don't treat the message as fatal. */ slapi_pblock_get(pb, SLAPI_ENTRY_POST_OP, &e); if (e == NULL) { - slapi_log_error(SLAPI_LOG_ERR, MEP_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_ERR, MEP_PLUGIN_SUBSYSTEM, "mep_mod_post_op - Unable to fetch postop entry.\n"); result = SLAPI_PLUGIN_FAILURE; goto bail; @@ -2369,7 +2369,7 @@ mep_mod_post_op(Slapi_PBlock *pb) mep_pb = slapi_pblock_new(); /* Perform the modify operation. */ - slapi_log_error(SLAPI_LOG_PLUGIN, MEP_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_PLUGIN, MEP_PLUGIN_SUBSYSTEM, "mep_mod_post_op - Updating mapped attributes " "in entry \"%s\"\n.", managed_dn); slapi_modify_internal_set_pb(mep_pb, managed_dn, @@ -2379,7 +2379,7 @@ mep_mod_post_op(Slapi_PBlock *pb) slapi_pblock_get(mep_pb, SLAPI_PLUGIN_INTOP_RESULT, &result); if (result != LDAP_SUCCESS) { - slapi_log_error(SLAPI_LOG_ERR, MEP_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_ERR, MEP_PLUGIN_SUBSYSTEM, "mep_mod_post_op - Unable to update mapped " "attributes from origin entry \"%s\" in managed " "entry \"%s\" (%s).\n", slapi_sdn_get_dn(sdn), managed_dn, @@ -2403,7 +2403,7 @@ mep_mod_post_op(Slapi_PBlock *pb) slapi_sdn_free(&managed_sdn); } } else { - slapi_log_error(SLAPI_LOG_ERR, MEP_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_ERR, MEP_PLUGIN_SUBSYSTEM, "mep_mod_post_op - Unable to find config for origin " "entry \"%s\".\n", slapi_sdn_get_dn(sdn)); } @@ -2417,7 +2417,7 @@ bail: result = SLAPI_PLUGIN_FAILURE; } slapi_ch_free_string(&managed_dn); - slapi_log_error(SLAPI_LOG_TRACE, MEP_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_TRACE, MEP_PLUGIN_SUBSYSTEM, "<-- mep_mod_post_op\n"); return result; @@ -2431,7 +2431,7 @@ mep_add_post_op(Slapi_PBlock *pb) struct configEntry *config = NULL; int result = SLAPI_PLUGIN_SUCCESS; - slapi_log_error(SLAPI_LOG_TRACE, MEP_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_TRACE, MEP_PLUGIN_SUBSYSTEM, "--> mep_add_post_op\n"); /* Reload config if a config entry was added. */ @@ -2440,7 +2440,7 @@ mep_add_post_op(Slapi_PBlock *pb) mep_load_config(); } } else { - slapi_log_error(SLAPI_LOG_PLUGIN, MEP_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_PLUGIN, MEP_PLUGIN_SUBSYSTEM, "mep_add_post_op - Error retrieving dn\n"); } @@ -2484,12 +2484,12 @@ mep_add_post_op(Slapi_PBlock *pb) mep_config_unlock(); } else { - slapi_log_error(SLAPI_LOG_PLUGIN, MEP_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_PLUGIN, MEP_PLUGIN_SUBSYSTEM, "mep_add_post_op - Error " "retrieving post-op entry %s\n", slapi_sdn_get_dn(sdn)); } - slapi_log_error(SLAPI_LOG_TRACE, MEP_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_TRACE, MEP_PLUGIN_SUBSYSTEM, "<-- mep_add_post_op\n"); return result; @@ -2502,7 +2502,7 @@ mep_del_post_op(Slapi_PBlock *pb) Slapi_DN *sdn = NULL; int result = SLAPI_PLUGIN_SUCCESS; - slapi_log_error(SLAPI_LOG_TRACE, MEP_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_TRACE, MEP_PLUGIN_SUBSYSTEM, "--> mep_del_post_op\n"); /* Reload config if a config entry was deleted. */ @@ -2510,7 +2510,7 @@ mep_del_post_op(Slapi_PBlock *pb) if (mep_dn_is_config(sdn)) mep_load_config(); } else { - slapi_log_error(SLAPI_LOG_PLUGIN, MEP_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_PLUGIN, MEP_PLUGIN_SUBSYSTEM, "mep_del_post_op - Error retrieving dn\n"); } @@ -2536,7 +2536,7 @@ mep_del_post_op(Slapi_PBlock *pb) Slapi_PBlock *mep_pb = slapi_pblock_new(); /* Delete the managed entry. */ - slapi_log_error(SLAPI_LOG_PLUGIN, MEP_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_PLUGIN, MEP_PLUGIN_SUBSYSTEM, "mep_del_post_op - Deleting managed entry " "\"%s\" due to deletion of origin entry " "\"%s\".\n ", managed_dn, slapi_sdn_get_dn(sdn)); @@ -2545,7 +2545,7 @@ mep_del_post_op(Slapi_PBlock *pb) slapi_delete_internal_pb(mep_pb); slapi_pblock_get(mep_pb, SLAPI_PLUGIN_INTOP_RESULT, &result); if(result){ - slapi_log_error(SLAPI_LOG_ERR, MEP_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_ERR, MEP_PLUGIN_SUBSYSTEM, "mep_del_post_op - Failed to delete managed entry " "(%s) - error (%d)\n",managed_dn, result); } @@ -2553,7 +2553,7 @@ mep_del_post_op(Slapi_PBlock *pb) slapi_pblock_destroy(mep_pb); } } else { - slapi_log_error(SLAPI_LOG_PLUGIN, MEP_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_PLUGIN, MEP_PLUGIN_SUBSYSTEM, "mep_del_post_op - Error " "retrieving pre-op entry %s\n", slapi_sdn_get_dn(sdn)); } @@ -2563,7 +2563,7 @@ mep_del_post_op(Slapi_PBlock *pb) result = SLAPI_PLUGIN_FAILURE; } - slapi_log_error(SLAPI_LOG_TRACE, MEP_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_TRACE, MEP_PLUGIN_SUBSYSTEM, "<-- mep_del_post_op\n"); return result; @@ -2580,7 +2580,7 @@ mep_modrdn_post_op(Slapi_PBlock *pb) struct configEntry *config = NULL; int result = SLAPI_PLUGIN_SUCCESS; - slapi_log_error(SLAPI_LOG_TRACE, MEP_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_TRACE, MEP_PLUGIN_SUBSYSTEM, "--> mep_modrdn_post_op\n"); /* Just bail if we aren't ready to service requests yet. */ @@ -2595,7 +2595,7 @@ mep_modrdn_post_op(Slapi_PBlock *pb) new_sdn = slapi_entry_get_sdn(post_e); new_dn = slapi_sdn_get_dn(new_sdn); } else { - slapi_log_error(SLAPI_LOG_ERR, MEP_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_ERR, MEP_PLUGIN_SUBSYSTEM, "mep_modrdn_post_op -Error " "retrieving post-op entry\n"); return SLAPI_PLUGIN_FAILURE; @@ -2605,7 +2605,7 @@ mep_modrdn_post_op(Slapi_PBlock *pb) if (mep_dn_is_config(old_sdn) || mep_dn_is_config(new_sdn)) mep_load_config(); } else { - slapi_log_error(SLAPI_LOG_PLUGIN, MEP_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_PLUGIN, MEP_PLUGIN_SUBSYSTEM, "mep_modrdn_post_op - Error " "retrieving dn\n"); } @@ -2649,7 +2649,7 @@ mep_modrdn_post_op(Slapi_PBlock *pb) char *vals2[2]; /* Delete the associated managed entry. */ - slapi_log_error(SLAPI_LOG_PLUGIN, MEP_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_PLUGIN, MEP_PLUGIN_SUBSYSTEM, "mep_modrdn_post_op - Removing managed entry \"%s\" " "since origin entry \"%s\" was moved out of scope.\n", managed_dn, slapi_sdn_get_dn(old_sdn)); @@ -2658,7 +2658,7 @@ mep_modrdn_post_op(Slapi_PBlock *pb) slapi_delete_internal_pb(mep_pb); slapi_pblock_get(mep_pb, SLAPI_PLUGIN_INTOP_RESULT, &result); if(result){ - slapi_log_error(SLAPI_LOG_ERR, MEP_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_ERR, MEP_PLUGIN_SUBSYSTEM, "mep_modrdn_post_op - Failed to delete managed entry " "(%s) - error (%d)\n",managed_dn, result); goto bailmod; @@ -2684,7 +2684,7 @@ mep_modrdn_post_op(Slapi_PBlock *pb) mods[2] = 0; /* Perform the modify operation. */ - slapi_log_error(SLAPI_LOG_PLUGIN, MEP_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_PLUGIN, MEP_PLUGIN_SUBSYSTEM, "mep_modrdn_post_op - Removing %s pointer and %s " "objectclass from entry \"%s\".\n", MEP_MANAGED_ENTRY_TYPE, MEP_ORIGIN_OC, new_dn); @@ -2694,7 +2694,7 @@ mep_modrdn_post_op(Slapi_PBlock *pb) slapi_pblock_get(mep_pb, SLAPI_PLUGIN_INTOP_RESULT, &result); if (result != LDAP_SUCCESS) { - slapi_log_error(SLAPI_LOG_ERR, MEP_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_ERR, MEP_PLUGIN_SUBSYSTEM, "mep_modrdn_post_op - Unable to remove %s " "pointer and %s objectclass from entry " "\"%s\".\n", MEP_MANAGED_ENTRY_TYPE, @@ -2715,7 +2715,7 @@ mep_modrdn_post_op(Slapi_PBlock *pb) * we need to make to the existing managed entry. */ new_managed_entry = mep_create_managed_entry(config, post_e); if (new_managed_entry == NULL) { - slapi_log_error(SLAPI_LOG_ERR, MEP_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_ERR, MEP_PLUGIN_SUBSYSTEM, "mep_modrdn_post_op - Unable to create in-memory " "managed entry from origin entry \"%s\".\n", new_dn); result = SLAPI_PLUGIN_FAILURE; @@ -2738,7 +2738,7 @@ mep_modrdn_post_op(Slapi_PBlock *pb) } /* Perform the modify operation. */ - slapi_log_error(SLAPI_LOG_PLUGIN, MEP_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_PLUGIN, MEP_PLUGIN_SUBSYSTEM, "mep_modrdn_post_op - Updating %s pointer to \"%s\" " "in entry \"%s\".\n", MEP_MANAGED_BY_TYPE, new_dn, managed_dn); slapi_modify_internal_set_pb(mep_pb, managed_dn, mods, 0, 0, @@ -2747,7 +2747,7 @@ mep_modrdn_post_op(Slapi_PBlock *pb) slapi_pblock_get(mep_pb, SLAPI_PLUGIN_INTOP_RESULT, &result); if (result != LDAP_SUCCESS) { - slapi_log_error(SLAPI_LOG_ERR, MEP_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_ERR, MEP_PLUGIN_SUBSYSTEM, "mep_modrdn_post_op - Unable to update pointer to " "origin entry \"%s\" in managed entry \"%s\" " "(%s).\n", new_dn, managed_dn, ldap_err2string(result)); @@ -2756,7 +2756,7 @@ mep_modrdn_post_op(Slapi_PBlock *pb) /* See if we need to rename the managed entry. */ if (slapi_sdn_compare(slapi_entry_get_sdn(new_managed_entry), managed_sdn) != 0) { /* Rename the managed entry. */ - slapi_log_error(SLAPI_LOG_PLUGIN, MEP_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_PLUGIN, MEP_PLUGIN_SUBSYSTEM, "mep_modrdn_post_op - Renaming managed entry " "\"%s\" to \"%s\" due to rename of origin " "entry \"%s\".\n ", managed_dn, @@ -2778,7 +2778,7 @@ mep_modrdn_post_op(Slapi_PBlock *pb) slapi_pblock_init(mep_pb); /* Perform the modify operation. */ - slapi_log_error(SLAPI_LOG_PLUGIN, MEP_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_PLUGIN, MEP_PLUGIN_SUBSYSTEM, "mep_modrdn_post_op - Updating mapped attributes " "in entry \"%s\"\n.", managed_dn); slapi_modify_internal_set_pb_ext(mep_pb, @@ -2789,7 +2789,7 @@ mep_modrdn_post_op(Slapi_PBlock *pb) slapi_pblock_get(mep_pb, SLAPI_PLUGIN_INTOP_RESULT, &result); if (result != LDAP_SUCCESS) { - slapi_log_error(SLAPI_LOG_ERR, MEP_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_ERR, MEP_PLUGIN_SUBSYSTEM, "mep_modrdn_post_op - Unable to update mapped " "attributes from origin entry \"%s\" in managed " "entry \"%s\" (%s).\n", new_dn, @@ -2845,7 +2845,7 @@ bailmod: slapi_pblock_set(pb, SLAPI_RESULT_CODE, &result); result = SLAPI_PLUGIN_FAILURE; } - slapi_log_error(SLAPI_LOG_TRACE, MEP_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_TRACE, MEP_PLUGIN_SUBSYSTEM, "<-- mep_modrdn_post_op\n"); return result; diff --git a/ldap/servers/plugins/pam_passthru/pam_ptconfig.c b/ldap/servers/plugins/pam_passthru/pam_ptconfig.c index afc5c64..b15b424 100644 --- a/ldap/servers/plugins/pam_passthru/pam_ptconfig.c +++ b/ldap/servers/plugins/pam_passthru/pam_ptconfig.c @@ -52,7 +52,7 @@ pam_passthru_load_config(int skip_validate) Slapi_PBlock *search_pb; Slapi_Entry **entries = NULL; - slapi_log_error(SLAPI_LOG_TRACE, PAM_PASSTHRU_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_TRACE, PAM_PASSTHRU_PLUGIN_SUBSYSTEM, "=> pam_passthru_load_config\n"); pam_passthru_write_lock(); @@ -100,12 +100,12 @@ pam_passthru_load_config(int skip_validate) if (skip_validate || (PAM_PASSTHRU_SUCCESS == pam_passthru_validate_config(entries[i], NULL))) { if (PAM_PASSTHRU_FAILURE == pam_passthru_apply_config(entries[i])) { - slapi_log_error(SLAPI_LOG_ERR, PAM_PASSTHRU_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_ERR, PAM_PASSTHRU_PLUGIN_SUBSYSTEM, "pam_passthru_load_config - Unable to apply config " "for entry \"%s\"\n", slapi_entry_get_ndn(entries[i])); } } else { - slapi_log_error(SLAPI_LOG_ERR, PAM_PASSTHRU_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_ERR, PAM_PASSTHRU_PLUGIN_SUBSYSTEM, "pam_passthru_load_config - Skipping invalid config " "entry \"%s\"\n", slapi_entry_get_ndn(entries[i])); } @@ -115,7 +115,7 @@ pam_passthru_load_config(int skip_validate) slapi_free_search_results_internal(search_pb); slapi_pblock_destroy(search_pb); pam_passthru_unlock(); - slapi_log_error(SLAPI_LOG_TRACE, PAM_PASSTHRU_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_TRACE, PAM_PASSTHRU_PLUGIN_SUBSYSTEM, "<= pam_passthru_load_config\n"); return status; @@ -279,7 +279,7 @@ parse_map_method(char *map_method, int *one, int *two, int *three, char *returnt "The map method in the string [%s] is invalid: must be " "one of %s", map_method, get_map_method_values()); } else { - slapi_log_error(SLAPI_LOG_ERR, PAM_PASSTHRU_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_ERR, PAM_PASSTHRU_PLUGIN_SUBSYSTEM, "parse_map_method - The map method in the string [%s] is invalid: must be " "one of %s\n", map_method, get_map_method_values()); } @@ -293,7 +293,7 @@ parse_map_method(char *map_method, int *one, int *two, int *three, char *returnt "The map method in the string [%s] is invalid: must be " "one of %s", map_method, get_map_method_values()); } else { - slapi_log_error(SLAPI_LOG_ERR, PAM_PASSTHRU_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_ERR, PAM_PASSTHRU_PLUGIN_SUBSYSTEM, "parse_map_method - The map method in the string [%s] is invalid: must be " "one of %s\n", map_method, get_map_method_values()); } @@ -307,7 +307,7 @@ parse_map_method(char *map_method, int *one, int *two, int *three, char *returnt "The map method in the string [%s] is invalid: must be " "one of %s", map_method, get_map_method_values()); } else { - slapi_log_error(SLAPI_LOG_ERR, PAM_PASSTHRU_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_ERR, PAM_PASSTHRU_PLUGIN_SUBSYSTEM, "parse_map_method - The map method in the string [%s] is invalid: must be " "one of %s\n", map_method, get_map_method_values()); } @@ -320,7 +320,7 @@ parse_map_method(char *map_method, int *one, int *two, int *three, char *returnt "Invalid extra text [%s] after last map method", ((ptr && *ptr) ? *ptr : "(null)")); } else { - slapi_log_error(SLAPI_LOG_ERR, PAM_PASSTHRU_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_ERR, PAM_PASSTHRU_PLUGIN_SUBSYSTEM, "parse_map_method - Invalid extra text [%s] after last map method\n", ((ptr && *ptr) ? *ptr : "(null)")); } @@ -337,13 +337,13 @@ print_suffixes(void) { void *cookie = NULL; Slapi_DN *sdn = NULL; - slapi_log_error(SLAPI_LOG_INFO, PAM_PASSTHRU_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_INFO, PAM_PASSTHRU_PLUGIN_SUBSYSTEM, "print_suffixes - The following is the list of valid suffixes to use with " PAMPT_EXCLUDES_ATTR " and " PAMPT_INCLUDES_ATTR ":\n"); for (sdn = slapi_get_first_suffix(&cookie, 1); sdn && cookie; sdn = slapi_get_next_suffix(&cookie, 1)) { - slapi_log_error(SLAPI_LOG_INFO, PAM_PASSTHRU_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_INFO, PAM_PASSTHRU_PLUGIN_SUBSYSTEM, "print_suffixes -\t%s\n", slapi_sdn_get_dn(sdn)); } } @@ -376,7 +376,7 @@ pam_passthru_validate_config (Slapi_Entry* e, char *returntext) "Error: valid values for %s are %s", PAMPT_MISSING_SUFFIX_ATTR, get_missing_suffix_values()); } else { - slapi_log_error(SLAPI_LOG_ERR, PAM_PASSTHRU_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_ERR, PAM_PASSTHRU_PLUGIN_SUBSYSTEM, "pam_passthru_validate_config - Valid values for %s are %s\n", PAMPT_MISSING_SUFFIX_ATTR, get_missing_suffix_values()); } @@ -422,7 +422,7 @@ pam_passthru_validate_config (Slapi_Entry* e, char *returntext) } } } else { - slapi_log_error(SLAPI_LOG_ERR, PAM_PASSTHRU_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_ERR, PAM_PASSTHRU_PLUGIN_SUBSYSTEM, "pam_passthru_validate_config - The suffixes listed in %s or %s are not present in " "this server\n", PAMPT_EXCLUDES_ATTR, PAMPT_INCLUDES_ATTR); } @@ -432,7 +432,7 @@ pam_passthru_validate_config (Slapi_Entry* e, char *returntext) print_suffixes(); if (missing_suffix != PAMPT_MISSING_SUFFIX_ERROR) { if (returntext) { - slapi_log_error(SLAPI_LOG_ERR, PAM_PASSTHRU_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_ERR, PAM_PASSTHRU_PLUGIN_SUBSYSTEM, "pam_passthru_validate_config - Warning: %s\n", returntext); *returntext = 0; /* log error, don't report back to user */ } @@ -458,7 +458,7 @@ pam_passthru_validate_config (Slapi_Entry* e, char *returntext) " was specified, but no %s was given", PAMPT_MAP_METHOD_ENTRY_STRING, PAMPT_PAM_IDENT_ATTR); } else { - slapi_log_error(SLAPI_LOG_ERR, PAM_PASSTHRU_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_ERR, PAM_PASSTHRU_PLUGIN_SUBSYSTEM, "pam_passthru_validate_config - The %s method was specified, but no %s was given\n", PAMPT_MAP_METHOD_ENTRY_STRING, PAMPT_PAM_IDENT_ATTR); } @@ -472,7 +472,7 @@ pam_passthru_validate_config (Slapi_Entry* e, char *returntext) " specified for %s, should be one or more of %s", PAMPT_MAP_METHOD_ATTR, get_map_method_values()); } else { - slapi_log_error(SLAPI_LOG_ERR, PAM_PASSTHRU_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_ERR, PAM_PASSTHRU_PLUGIN_SUBSYSTEM, "pam_passthru_validate_config - No method(s) specified for %s, should be " "one or more of %s\n", PAMPT_MAP_METHOD_ATTR, get_map_method_values()); @@ -492,7 +492,7 @@ pam_passthru_validate_config (Slapi_Entry* e, char *returntext) "filter specified for %s (filter: \"%s\")", PAMPT_FILTER_ATTR, pam_filter_str); } else { - slapi_log_error(SLAPI_LOG_ERR, PAM_PASSTHRU_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_ERR, PAM_PASSTHRU_PLUGIN_SUBSYSTEM, "pam_passthru_validate_config - Invalid filter specified for %s " "(filter: \"%s\")\n", PAMPT_FILTER_ATTR, pam_filter_str); @@ -658,7 +658,7 @@ pam_passthru_apply_config (Slapi_Entry* e) if (pam_passthru_global_config == list) { /* add to tail */ PR_INSERT_BEFORE(&(entry->list), list); - slapi_log_error(SLAPI_LOG_CONFIG, PAM_PASSTHRU_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_CONFIG, PAM_PASSTHRU_PLUGIN_SUBSYSTEM, "pam_passthru_apply_config - store [%s] at tail\n", entry->dn); inserted = 1; break; @@ -667,7 +667,7 @@ pam_passthru_apply_config (Slapi_Entry* e) } else { /* first entry */ PR_INSERT_LINK(&(entry->list), pam_passthru_global_config); - slapi_log_error(SLAPI_LOG_CONFIG, PAM_PASSTHRU_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_CONFIG, PAM_PASSTHRU_PLUGIN_SUBSYSTEM, "pam_passthru_apply_config - store [%s] at head \n", entry->dn); inserted = 1; } diff --git a/ldap/servers/plugins/pam_passthru/pam_ptimpl.c b/ldap/servers/plugins/pam_passthru/pam_ptimpl.c index b4d30f2..5073ff7 100644 --- a/ldap/servers/plugins/pam_passthru/pam_ptimpl.c +++ b/ldap/servers/plugins/pam_passthru/pam_ptimpl.c @@ -87,17 +87,17 @@ derive_from_bind_entry(Slapi_PBlock *pb, const Slapi_DN *bindsdn, pam_passthruauth_get_plugin_identity()); if (rc != LDAP_SUCCESS) { - slapi_log_error(SLAPI_LOG_ERR, PAM_PASSTHRU_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_ERR, PAM_PASSTHRU_PLUGIN_SUBSYSTEM, "derive_from_bind_entry - Could not find BIND dn %s (error %d - %s)\n", slapi_sdn_get_ndn(bindsdn), rc, ldap_err2string(rc)); init_my_str_buf(pam_id, NULL); } else if (NULL == entry) { - slapi_log_error(SLAPI_LOG_ERR, PAM_PASSTHRU_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_ERR, PAM_PASSTHRU_PLUGIN_SUBSYSTEM, "derive_from_bind_entry - Could not find entry for BIND dn %s\n", slapi_sdn_get_ndn(bindsdn)); init_my_str_buf(pam_id, NULL); } else if (slapi_check_account_lock( pb, entry, 0, 0, 0 ) == 1) { - slapi_log_error(SLAPI_LOG_ERR, PAM_PASSTHRU_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_ERR, PAM_PASSTHRU_PLUGIN_SUBSYSTEM, "derive_from_bind_entry - Account %s inactivated.\n", slapi_sdn_get_ndn(bindsdn)); init_my_str_buf(pam_id, NULL); @@ -117,7 +117,7 @@ static void report_pam_error(char *str, int rc, pam_handle_t *pam_handle) { if (rc != PAM_SUCCESS) { - slapi_log_error(SLAPI_LOG_ERR, PAM_PASSTHRU_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_ERR, PAM_PASSTHRU_PLUGIN_SUBSYSTEM, "report_pam_error - %s (%d: %s)\n", str, rc, pam_strerror(pam_handle, rc)); } @@ -168,7 +168,7 @@ pam_conv_func(int num_msg, const struct pam_message **msg, struct pam_response * sizeof(struct pam_response)); slapi_pblock_get( my_data->pb, SLAPI_BIND_CREDENTIALS, &creds ); /* the password */ for (ii = 0; ii < num_msg; ++ii) { - slapi_log_error(SLAPI_LOG_PLUGIN, PAM_PASSTHRU_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_PLUGIN, PAM_PASSTHRU_PLUGIN_SUBSYSTEM, "pam_conv_func - pam msg [%d] = %d %s\n", ii, msg[ii]->msg_style, msg[ii]->msg); /* hard to tell what prompt is for . . . */ @@ -182,13 +182,13 @@ pam_conv_func(int num_msg, const struct pam_message **msg, struct pam_response * } else if (msg[ii]->msg_style == PAM_PROMPT_ECHO_ON) { /* assume username */ reply[ii].resp = slapi_ch_strdup(my_data->pam_identity); } else if (msg[ii]->msg_style == PAM_ERROR_MSG) { - slapi_log_error(SLAPI_LOG_ERR, PAM_PASSTHRU_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_ERR, PAM_PASSTHRU_PLUGIN_SUBSYSTEM, "pam_conv_func - pam msg [%d] error [%s]\n", ii, msg[ii]->msg); } else if (msg[ii]->msg_style == PAM_TEXT_INFO) { - slapi_log_error(SLAPI_LOG_PLUGIN, PAM_PASSTHRU_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_PLUGIN, PAM_PASSTHRU_PLUGIN_SUBSYSTEM, "pam_conv_func - pam msg [%d] text info [%s]\n", ii, msg[ii]->msg); } else { - slapi_log_error(SLAPI_LOG_ERR, PAM_PASSTHRU_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_ERR, PAM_PASSTHRU_PLUGIN_SUBSYSTEM, "pam_conv_func - Error: unknown pam message type (%d: %s)\n", msg[ii]->msg_style, msg[ii]->msg); ret = PAM_CONV_ERR; @@ -370,7 +370,7 @@ done: } if (retcode != LDAP_SUCCESS) { - slapi_log_error(SLAPI_LOG_ERR, PAM_PASSTHRU_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_ERR, PAM_PASSTHRU_PLUGIN_SUBSYSTEM, "do_one_pam_auth - %s\n", errmsg); if (final_method && !fallback) { slapi_send_ldap_result(pb, retcode, NULL, errmsg, 0, NULL); diff --git a/ldap/servers/plugins/pam_passthru/pam_ptpreop.c b/ldap/servers/plugins/pam_passthru/pam_ptpreop.c index 709d6ec..3b22955 100644 --- a/ldap/servers/plugins/pam_passthru/pam_ptpreop.c +++ b/ldap/servers/plugins/pam_passthru/pam_ptpreop.c @@ -92,7 +92,7 @@ pam_passthruauth_init( Slapi_PBlock *pb ) PAM_PASSTHRU_ASSERT( pb != NULL ); - slapi_log_error(SLAPI_LOG_TRACE, PAM_PASSTHRU_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_TRACE, PAM_PASSTHRU_PLUGIN_SUBSYSTEM, "=> pam_passthruauth_init\n" ); slapi_pblock_get (pb, SLAPI_PLUGIN_IDENTITY, &pam_passthruauth_plugin_identity); @@ -121,7 +121,7 @@ pam_passthruauth_init( Slapi_PBlock *pb ) slapi_pblock_set( pb, premod, (void *)pam_passthru_mod_preop ) || slapi_pblock_set( pb, predel, (void *)pam_passthru_del_preop ) || slapi_pblock_set( pb, premdn, (void *)pam_passthru_modrdn_preop )) { - slapi_log_error(SLAPI_LOG_ERR, PAM_PASSTHRU_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_ERR, PAM_PASSTHRU_PLUGIN_SUBSYSTEM, "pam_passthruauth_init - Failed\n"); status = -1; goto bail; @@ -136,7 +136,7 @@ pam_passthruauth_init( Slapi_PBlock *pb ) NULL, /* ? */ pam_passthruauth_plugin_identity /* access control */ )) { - slapi_log_error(SLAPI_LOG_ERR, PAM_PASSTHRU_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_ERR, PAM_PASSTHRU_PLUGIN_SUBSYSTEM, "pam_passthruauth_init - " "Failed to register preop plugin\n"); status = -1; @@ -156,7 +156,7 @@ pam_passthruauth_init( Slapi_PBlock *pb ) slapi_pblock_set( pb, premod, (void *)pam_passthru_mod_preop ) || slapi_pblock_set( pb, predel, (void *)pam_passthru_del_preop ) || slapi_pblock_set( pb, premdn, (void *)pam_passthru_modrdn_preop )) { - slapi_log_error(SLAPI_LOG_ERR, PAM_PASSTHRU_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_ERR, PAM_PASSTHRU_PLUGIN_SUBSYSTEM, "pam_passthruauth_init - Failed\n"); status = -1; goto bail; @@ -171,7 +171,7 @@ pam_passthruauth_init( Slapi_PBlock *pb ) NULL, /* ? */ pam_passthruauth_plugin_identity /* access control */ )) { - slapi_log_error(SLAPI_LOG_ERR, PAM_PASSTHRU_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_ERR, PAM_PASSTHRU_PLUGIN_SUBSYSTEM, "pam_passthruauth_init - " "Failed to register internal postop plugin\n"); status = -1; @@ -188,7 +188,7 @@ pam_passthruauth_init( Slapi_PBlock *pb ) NULL, /* ? */ pam_passthruauth_plugin_identity /* access control */ )) { - slapi_log_error(SLAPI_LOG_ERR, PAM_PASSTHRU_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_ERR, PAM_PASSTHRU_PLUGIN_SUBSYSTEM, "pam_passthruauth_init - " "Failed to register (%s) plugin\n", is_betxn ? "postoperation" : "betxnpostoperation"); @@ -196,7 +196,7 @@ pam_passthruauth_init( Slapi_PBlock *pb ) goto bail; } - slapi_log_error(SLAPI_LOG_TRACE, PAM_PASSTHRU_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_TRACE, PAM_PASSTHRU_PLUGIN_SUBSYSTEM, "<= pam_passthruauth_init\n" ); bail: @@ -214,7 +214,7 @@ pam_passthru_preop_init(Slapi_PBlock *pb) if ( slapi_pblock_set( pb, SLAPI_PLUGIN_PRE_BIND_FN, (void *)pam_passthru_bindpreop ) || slapi_pblock_set( pb, SLAPI_PLUGIN_CLOSE_FN, (void *)pam_passthru_bindpreop_close )) { - slapi_log_error(SLAPI_LOG_ERR, PAM_PASSTHRU_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_ERR, PAM_PASSTHRU_PLUGIN_SUBSYSTEM, "pam_passthru_preop_init - Failed\n"); status = -1; } @@ -238,7 +238,7 @@ pam_passthru_internal_postop_init(Slapi_PBlock *pb) (void *) pam_passthru_postop) != 0 || slapi_pblock_set(pb, SLAPI_PLUGIN_INTERNAL_POST_MODRDN_FN, (void *) pam_passthru_postop) != 0) { - slapi_log_error(SLAPI_LOG_ERR, PAM_PASSTHRU_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_ERR, PAM_PASSTHRU_PLUGIN_SUBSYSTEM, "pam_passthru_internal_postop_init: failed to register plugin\n"); status = -1; } @@ -277,7 +277,7 @@ pam_passthru_postop_init(Slapi_PBlock *pb) slapi_pblock_set(pb, postdel, (void *) pam_passthru_postop) || slapi_pblock_set(pb, postmod, (void *) pam_passthru_postop) || slapi_pblock_set(pb, postmdn, (void *) pam_passthru_postop) ) { - slapi_log_error(SLAPI_LOG_ERR, PAM_PASSTHRU_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_ERR, PAM_PASSTHRU_PLUGIN_SUBSYSTEM, "pam_passthru_postop_init - " "Failed to register (%s) plugin\n", is_betxn ? "betxn postop" : "postop"); @@ -300,13 +300,13 @@ pam_passthru_bindpreop_start( Slapi_PBlock *pb ) PAM_PASSTHRU_ASSERT( pb != NULL ); - slapi_log_error(SLAPI_LOG_TRACE, PAM_PASSTHRU_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_TRACE, PAM_PASSTHRU_PLUGIN_SUBSYSTEM, "=> pam_passthru_bindpreop_start\n" ); /* Get the plug-in configuration DN and store it for later use. */ slapi_pblock_get(pb, SLAPI_TARGET_SDN, &pluginsdn); if (NULL == pluginsdn || 0 == slapi_sdn_get_ndn_len(pluginsdn)) { - slapi_log_error(SLAPI_LOG_ERR, PAM_PASSTHRU_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_ERR, PAM_PASSTHRU_PLUGIN_SUBSYSTEM, "pam_passthru_bindpreop_start - Unable to determine plug-in config dn\n"); rc = PAM_PASSTHRU_FAILURE; goto done; @@ -323,7 +323,7 @@ pam_passthru_bindpreop_start( Slapi_PBlock *pb ) pam_passthru_set_config_area(slapi_sdn_dup(pluginsdn)); } - slapi_log_error(SLAPI_LOG_PLUGIN, PAM_PASSTHRU_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_PLUGIN, PAM_PASSTHRU_PLUGIN_SUBSYSTEM, "pam_passthru_bindpreop_start - Config at %s\n", slapi_sdn_get_ndn(pam_passthru_get_config_area())); @@ -331,7 +331,7 @@ pam_passthru_bindpreop_start( Slapi_PBlock *pb ) g_pam_config_lock = slapi_new_rwlock(); if (!g_pam_config_lock) { - slapi_log_error(SLAPI_LOG_ERR, PAM_PASSTHRU_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_ERR, PAM_PASSTHRU_PLUGIN_SUBSYSTEM, "pam_passthru_bindpreop_start - Lock creation failed\n"); rc = PAM_PASSTHRU_FAILURE; goto done; @@ -346,7 +346,7 @@ pam_passthru_bindpreop_start( Slapi_PBlock *pb ) pam_passthru_load_config(0 /* don't skip validation */); if (( rc = pam_passthru_pam_init()) != LDAP_SUCCESS ) { - slapi_log_error(SLAPI_LOG_ERR, PAM_PASSTHRU_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_ERR, PAM_PASSTHRU_PLUGIN_SUBSYSTEM, "pam_passthru_bindpreop_start - Could not initialize PAM subsystem (%d)\n", rc); rc = PAM_PASSTHRU_FAILURE; goto done; @@ -359,11 +359,11 @@ done: g_pam_config_lock = NULL; slapi_ch_free((void **)&pam_passthru_global_config); } else { - slapi_log_error(SLAPI_LOG_PLUGIN, PAM_PASSTHRU_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_PLUGIN, PAM_PASSTHRU_PLUGIN_SUBSYSTEM, "pam_passthru_bindpreop_start - Ready for service\n" ); } - slapi_log_error(SLAPI_LOG_TRACE, PAM_PASSTHRU_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_TRACE, PAM_PASSTHRU_PLUGIN_SUBSYSTEM, "<= pam_passthru_bindpreop_start\n" ); return( rc ); @@ -378,7 +378,7 @@ pam_passthru_bindpreop_close( Slapi_PBlock *pb ) { PAM_PASSTHRU_ASSERT( pb != NULL ); - slapi_log_error(SLAPI_LOG_TRACE, PAM_PASSTHRU_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_TRACE, PAM_PASSTHRU_PLUGIN_SUBSYSTEM, "=> pam_passthru_bindpreop_close\n" ); pam_passthru_delete_config(); @@ -391,7 +391,7 @@ pam_passthru_bindpreop_close( Slapi_PBlock *pb ) slapi_destroy_rwlock(g_pam_config_lock); g_pam_config_lock = NULL; - slapi_log_error(SLAPI_LOG_TRACE, PAM_PASSTHRU_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_TRACE, PAM_PASSTHRU_PLUGIN_SUBSYSTEM, "<= pam_passthru_bindpreop_close\n" ); return( 0 ); @@ -412,7 +412,7 @@ pam_passthru_bindpreop( Slapi_PBlock *pb ) PAM_PASSTHRU_ASSERT( pb != NULL ); - slapi_log_error(SLAPI_LOG_TRACE, PAM_PASSTHRU_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_TRACE, PAM_PASSTHRU_PLUGIN_SUBSYSTEM, "=> pam_passthru_bindpreop\n" ); /* @@ -421,7 +421,7 @@ pam_passthru_bindpreop( Slapi_PBlock *pb ) if ( slapi_pblock_get( pb, SLAPI_BIND_METHOD, &method ) != 0 || slapi_pblock_get( pb, SLAPI_BIND_TARGET_SDN, &bindsdn ) != 0 || slapi_pblock_get( pb, SLAPI_BIND_CREDENTIALS, &creds ) != 0 ) { - slapi_log_error(SLAPI_LOG_ERR, PAM_PASSTHRU_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_ERR, PAM_PASSTHRU_PLUGIN_SUBSYSTEM, "pam_passthru_bindpreop - not handled (unable to retrieve bind parameters)\n" ); return retcode; } @@ -433,7 +433,7 @@ pam_passthru_bindpreop( Slapi_PBlock *pb ) */ if ((method != LDAP_AUTH_SIMPLE) || (*normbinddn == '\0') || (creds->bv_len == 0)) { - slapi_log_error(SLAPI_LOG_PLUGIN, PAM_PASSTHRU_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_PLUGIN, PAM_PASSTHRU_PLUGIN_SUBSYSTEM, "pam_passthru_bindpreop - Not handled (not simple bind or NULL dn/credentials)\n" ); return retcode; } @@ -451,7 +451,7 @@ pam_passthru_bindpreop( Slapi_PBlock *pb ) cfg = pam_passthru_get_config(bindsdn); if (!cfg) { - slapi_log_error(SLAPI_LOG_PLUGIN, PAM_PASSTHRU_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_PLUGIN, PAM_PASSTHRU_PLUGIN_SUBSYSTEM, "pam_passthru_bindpreop - \"%s\" Not handled (doesn't meet configuration criteria)\n", normbinddn ); goto done; } @@ -460,7 +460,7 @@ pam_passthru_bindpreop( Slapi_PBlock *pb ) int is_ssl = 0; slapi_pblock_get(pb, SLAPI_CONN_IS_SSL_SESSION, &is_ssl); if (!is_ssl) { - slapi_log_error(SLAPI_LOG_PLUGIN, PAM_PASSTHRU_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_PLUGIN, PAM_PASSTHRU_PLUGIN_SUBSYSTEM, "pam_passthru_bindpreop - Connection not secure (secure connection required; check config)\n"); goto done; } @@ -484,7 +484,7 @@ pam_passthru_bindpreop( Slapi_PBlock *pb ) slapi_ch_free_string(&ndn); rc = LDAP_OPERATIONS_ERROR; errmsg = "unable to set connection DN or AUTHTYPE"; - slapi_log_error(SLAPI_LOG_ERR, PAM_PASSTHRU_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_ERR, PAM_PASSTHRU_PLUGIN_SUBSYSTEM, "pam_passthru_bindpreop - %s\n", errmsg); } else { LDAPControl **reqctrls = NULL; @@ -508,10 +508,10 @@ pam_passthru_bindpreop( Slapi_PBlock *pb ) done: pam_passthru_unlock(); - slapi_log_error(SLAPI_LOG_PLUGIN, PAM_PASSTHRU_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_PLUGIN, PAM_PASSTHRU_PLUGIN_SUBSYSTEM, "pam_passthru_bindpreop - handled (error %d - %s)\n", rc, ldap_err2string(rc)); - slapi_log_error(SLAPI_LOG_TRACE, PAM_PASSTHRU_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_TRACE, PAM_PASSTHRU_PLUGIN_SUBSYSTEM, "<= pam_passthru_bindpreop\n" ); return retcode; @@ -530,7 +530,7 @@ pam_passthru_preop(Slapi_PBlock *pb, int modtype) char returntext[SLAPI_DSE_RETURNTEXT_SIZE]; int ret = SLAPI_PLUGIN_SUCCESS; - slapi_log_error(SLAPI_LOG_TRACE, PAM_PASSTHRU_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_TRACE, PAM_PASSTHRU_PLUGIN_SUBSYSTEM, "=> pam_passthru_preop\n"); /* Get the target SDN. */ @@ -595,7 +595,7 @@ bail: slapi_send_ldap_result(pb, ret, NULL, returntext, 0, NULL); ret = SLAPI_PLUGIN_FAILURE; } - slapi_log_error(SLAPI_LOG_TRACE, PAM_PASSTHRU_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_TRACE, PAM_PASSTHRU_PLUGIN_SUBSYSTEM, "<= pam_passthru_preop\n"); return ret; @@ -638,7 +638,7 @@ pam_passthru_postop(Slapi_PBlock *pb) int optype = SLAPI_OPERATION_NONE; int oprc = -1; - slapi_log_error(SLAPI_LOG_TRACE, PAM_PASSTHRU_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_TRACE, PAM_PASSTHRU_PLUGIN_SUBSYSTEM, "=> pam_passthru_postop\n"); /* Make sure the operation succeeded and bail if it didn't. */ @@ -651,7 +651,7 @@ pam_passthru_postop(Slapi_PBlock *pb) /* Get the target SDN. */ slapi_pblock_get(pb, SLAPI_TARGET_SDN, &sdn); if (!sdn) { - slapi_log_error(SLAPI_LOG_ERR, PAM_PASSTHRU_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_ERR, PAM_PASSTHRU_PLUGIN_SUBSYSTEM, "pam_passthru_postop - Unable to fetch target SDN.\n"); ret = SLAPI_PLUGIN_FAILURE; goto bail; @@ -665,7 +665,7 @@ pam_passthru_postop(Slapi_PBlock *pb) if (e) { new_sdn = slapi_entry_get_sdn(e); } else { - slapi_log_error(SLAPI_LOG_ERR, PAM_PASSTHRU_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_ERR, PAM_PASSTHRU_PLUGIN_SUBSYSTEM, "pam_passthru_postop - Unable to fetch post-op " "entry for rename operation.\n"); ret = SLAPI_PLUGIN_FAILURE; @@ -680,7 +680,7 @@ pam_passthru_postop(Slapi_PBlock *pb) pam_passthru_load_config(1); /* skip validation, as it was done at preop */ } - slapi_log_error(SLAPI_LOG_TRACE, PAM_PASSTHRU_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_TRACE, PAM_PASSTHRU_PLUGIN_SUBSYSTEM, "<= pam_passthru_postop\n"); bail: diff --git a/ldap/servers/plugins/passthru/ptbind.c b/ldap/servers/plugins/passthru/ptbind.c index 1556bdb..3e913bd 100644 --- a/ldap/servers/plugins/passthru/ptbind.c +++ b/ldap/servers/plugins/passthru/ptbind.c @@ -56,7 +56,7 @@ passthru_simple_bind_s( Slapi_PBlock *pb, PassThruServer *srvr, int tries, * check to see if operation has been abandoned... */ if ( slapi_op_abandoned( pb )) { - slapi_log_error(SLAPI_LOG_PLUGIN, PASSTHRU_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_PLUGIN, PASSTHRU_PLUGIN_SUBSYSTEM, "operation abandoned\n" ); rc = LDAP_USER_CANCELLED; } else { diff --git a/ldap/servers/plugins/passthru/ptconfig.c b/ldap/servers/plugins/passthru/ptconfig.c index 279a955..bbe12e1 100644 --- a/ldap/servers/plugins/passthru/ptconfig.c +++ b/ldap/servers/plugins/passthru/ptconfig.c @@ -80,7 +80,7 @@ passthru_config( int argc, char **argv ) int ret = LDAP_SUCCESS; if ( inited ) { - slapi_log_error(SLAPI_LOG_ERR, PASSTHRU_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_ERR, PASSTHRU_PLUGIN_SUBSYSTEM, "passthru_config - Only one pass through plugin instance can be used\n" ); ret = LDAP_PARAM_ERROR; goto error; @@ -93,7 +93,7 @@ passthru_config( int argc, char **argv ) * providing at least one remote server. Return an error if attempted. */ if ( argc < 1 ) { - slapi_log_error(SLAPI_LOG_ERR, PASSTHRU_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_ERR, PASSTHRU_PLUGIN_SUBSYSTEM, "passthru_config - No pass through servers found in configuration " "(at least one must be listed)\n" ); ret = LDAP_PARAM_ERROR; @@ -153,7 +153,7 @@ passthru_config( int argc, char **argv ) &srvr->ptsrvr_maxconcurrency, &tosecs, &srvr->ptsrvr_ldapversion, &srvr->ptsrvr_connlifetime, &starttls); if ( rc < 4 ) { - slapi_log_error(SLAPI_LOG_ERR, PASSTHRU_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_ERR, PASSTHRU_PLUGIN_SUBSYSTEM, "passthru_config - Server parameters should be in the form " "\"maxconnections,maxconcurrency,timeout,ldapversion," "connlifetime\" (got \"%s\")\n", p ); @@ -172,7 +172,7 @@ passthru_config( int argc, char **argv ) } if ( srvr->ptsrvr_ldapversion != LDAP_VERSION2 && srvr->ptsrvr_ldapversion != LDAP_VERSION3 ) { - slapi_log_error(SLAPI_LOG_ERR, PASSTHRU_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_ERR, PASSTHRU_PLUGIN_SUBSYSTEM, "passthru_config - LDAP protocol version should be %d or %d (got %d)\n", LDAP_VERSION2, LDAP_VERSION3, srvr->ptsrvr_ldapversion ); ret = LDAP_PARAM_ERROR; @@ -180,7 +180,7 @@ passthru_config( int argc, char **argv ) } if ( srvr->ptsrvr_maxconnections <= 0 ) { - slapi_log_error(SLAPI_LOG_ERR, PASSTHRU_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_ERR, PASSTHRU_PLUGIN_SUBSYSTEM, "passthru_config - Maximum connections must be greater than " "zero (got %d)\n", srvr->ptsrvr_maxconnections ); ret = LDAP_PARAM_ERROR; @@ -188,7 +188,7 @@ passthru_config( int argc, char **argv ) } if ( srvr->ptsrvr_maxconcurrency <= 0 ) { - slapi_log_error(SLAPI_LOG_ERR, PASSTHRU_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_ERR, PASSTHRU_PLUGIN_SUBSYSTEM, "passthru_config - Maximum concurrency must be greater than " "zero (got %d)\n", srvr->ptsrvr_maxconcurrency ); ret = LDAP_PARAM_ERROR; @@ -207,7 +207,7 @@ passthru_config( int argc, char **argv ) * parse the LDAP URL */ if (( rc = slapi_ldap_url_parse( srvr->ptsrvr_url, &ludp, 1, &secure )) != 0 ) { - slapi_log_error(SLAPI_LOG_ERR, PASSTHRU_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_ERR, PASSTHRU_PLUGIN_SUBSYSTEM, "passthru_config - Unable to parse LDAP URL \"%s\" (%s)\n", srvr->ptsrvr_url, slapi_urlparse_err2string( rc )); ret = LDAP_PARAM_ERROR; @@ -215,7 +215,7 @@ passthru_config( int argc, char **argv ) } if ( ludp->lud_dn == NULL || *ludp->lud_dn == '\0' ) { - slapi_log_error(SLAPI_LOG_ERR, PASSTHRU_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_ERR, PASSTHRU_PLUGIN_SUBSYSTEM, "passthru_config - Missing suffix in LDAP URL \"%s\"\n", srvr->ptsrvr_url ); ret = LDAP_PARAM_ERROR; goto error; @@ -241,7 +241,7 @@ passthru_config( int argc, char **argv ) * split the DN into multiple suffixes (separated by ';') */ if (( suffixarray = slapi_str2charray( ludp->lud_dn, ";" )) == NULL ) { - slapi_log_error(SLAPI_LOG_ERR, PASSTHRU_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_ERR, PASSTHRU_PLUGIN_SUBSYSTEM, "passthru_config - Unable to parse suffix string \"%s\" within \"%s\"\n", ludp->lud_dn, srvr->ptsrvr_url ); ret = LDAP_PARAM_ERROR; @@ -304,7 +304,7 @@ passthru_config( int argc, char **argv ) /* * log configuration for debugging purposes */ - slapi_log_error(SLAPI_LOG_PLUGIN, PASSTHRU_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_PLUGIN, PASSTHRU_PLUGIN_SUBSYSTEM, "PTA server host: \"%s\", port: %d, secure: %d, " "maxconnections: %d, maxconcurrency: %d, timeout: %d, " "ldversion: %d, connlifetime: %d\n", @@ -317,7 +317,7 @@ passthru_config( int argc, char **argv ) for ( prevsuffix = srvr->ptsrvr_suffixes; prevsuffix != NULL; prevsuffix = prevsuffix->ptsuffix_next ) { - slapi_log_error(SLAPI_LOG_DEBUG, PASSTHRU_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_DEBUG, PASSTHRU_PLUGIN_SUBSYSTEM, " normalized suffix: \"%s\"\n", prevsuffix->ptsuffix_normsuffix ); } #endif diff --git a/ldap/servers/plugins/passthru/ptconn.c b/ldap/servers/plugins/passthru/ptconn.c index e6eb90e..d9a5b40 100644 --- a/ldap/servers/plugins/passthru/ptconn.c +++ b/ldap/servers/plugins/passthru/ptconn.c @@ -128,7 +128,7 @@ passthru_get_connection( PassThruServer *srvr, LDAP **ldp ) slapi_lock_mutex( srvr->ptsrvr_connlist_mutex ); rc = LDAP_SUCCESS; /* optimistic */ - slapi_log_error(SLAPI_LOG_PLUGIN, PASSTHRU_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_PLUGIN, PASSTHRU_PLUGIN_SUBSYSTEM, "=> passthru_get_connection server %s:%d conns: %d maxconns: %d\n", srvr->ptsrvr_hostname, srvr->ptsrvr_port, srvr->ptsrvr_connlist_count, srvr->ptsrvr_maxconnections ); @@ -143,7 +143,7 @@ passthru_get_connection( PassThruServer *srvr, LDAP **ldp ) if ( conn->ptconn_status == PASSTHRU_CONNSTATUS_OK && conn->ptconn_usecount < srvr->ptsrvr_maxconcurrency ) { #ifdef PASSTHRU_VERBOSE_LOGGING - slapi_log_error(SLAPI_LOG_PLUGIN, PASSTHRU_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_PLUGIN, PASSTHRU_PLUGIN_SUBSYSTEM, "<= passthru_get_connection server found " "conn 0x%x to use)\n", conn->ptconn_ld ); #endif @@ -160,7 +160,7 @@ passthru_get_connection( PassThruServer *srvr, LDAP **ldp ) if (( ld = slapi_ldap_init( srvr->ptsrvr_hostname, srvr->ptsrvr_port, srvr->ptsrvr_secure, 1 )) == NULL ) { #ifdef PASSTHRU_VERBOSE_LOGGING - slapi_log_error(SLAPI_LOG_PLUGIN, PASSTHRU_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_PLUGIN, PASSTHRU_PLUGIN_SUBSYSTEM, "<= passthru_get_connection slapi_ldap_init failed\n" ); #endif rc = LDAP_LOCAL_ERROR; @@ -195,7 +195,7 @@ passthru_get_connection( PassThruServer *srvr, LDAP **ldp ) ++srvr->ptsrvr_connlist_count; #ifdef PASSTHRU_VERBOSE_LOGGING - slapi_log_error(SLAPI_LOG_PLUGIN, PASSTHRU_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_PLUGIN, PASSTHRU_PLUGIN_SUBSYSTEM, "<= passthru_get_connection added new conn 0x%x, " "conn count now %d\n", ld, srvr->ptsrvr_connlist_count ); #endif @@ -203,13 +203,13 @@ passthru_get_connection( PassThruServer *srvr, LDAP **ldp ) } #ifdef PASSTHRU_VERBOSE_LOGGING - slapi_log_error(SLAPI_LOG_PLUGIN, PASSTHRU_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_PLUGIN, PASSTHRU_PLUGIN_SUBSYSTEM, "... passthru_get_connection waiting for conn to free up\n" ); #endif slapi_wait_condvar( srvr->ptsrvr_connlist_cv, NULL ); #ifdef PASSTHRU_VERBOSE_LOGGING - slapi_log_error(SLAPI_LOG_PLUGIN, PASSTHRU_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_PLUGIN, PASSTHRU_PLUGIN_SUBSYSTEM, "... passthru_get_connection awake again\n" ); #endif } @@ -218,11 +218,11 @@ unlock_and_return: if ( conn != NULL ) { ++conn->ptconn_usecount; *ldp = conn->ptconn_ld; - slapi_log_error(SLAPI_LOG_PLUGIN, PASSTHRU_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_PLUGIN, PASSTHRU_PLUGIN_SUBSYSTEM, "<= passthru_get_connection ld=0x%p (concurrency now %d)\n", *ldp, conn->ptconn_usecount ); } else { - slapi_log_error(SLAPI_LOG_PLUGIN, PASSTHRU_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_PLUGIN, PASSTHRU_PLUGIN_SUBSYSTEM, "<= passthru_get_connection error %d\n", rc ); } @@ -245,7 +245,7 @@ passthru_release_connection( PassThruServer *srvr, LDAP *ld, int dispose ) PASSTHRU_ASSERT( ld != NULL ); #ifdef PASSTHRU_VERBOSE_LOGGING - slapi_log_error(SLAPI_LOG_PLUGIN, PASSTHRU_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_PLUGIN, PASSTHRU_PLUGIN_SUBSYSTEM, "=> passthru_release_connection ld=0x%x%s\n", ld, dispose ? " (disposing)" : "" ); #endif @@ -265,7 +265,7 @@ passthru_release_connection( PassThruServer *srvr, LDAP *ld, int dispose ) } if ( conn == NULL ) { /* ld not found -- unexpected */ - slapi_log_error(SLAPI_LOG_PLUGIN, PASSTHRU_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_PLUGIN, PASSTHRU_PLUGIN_SUBSYSTEM, "=> passthru_release_connection ld=0x%p not found\n", ld ); } else { PASSTHRU_ASSERT( conn->ptconn_usecount > 0 ); @@ -371,7 +371,7 @@ check_for_stale_connections( PassThruServer *srvr ) PASSTHRU_ASSERT( srvr != NULL ); #ifdef PASSTHRU_VERBOSE_LOGGING - slapi_log_error(SLAPI_LOG_PLUGIN, PASSTHRU_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_PLUGIN, PASSTHRU_PLUGIN_SUBSYSTEM, "check_for_stale_connections: server %s (lifetime %d secs)\n", srvr->ptsrvr_url, srvr->ptsrvr_connlifetime ); #endif @@ -395,7 +395,7 @@ check_for_stale_connections( PassThruServer *srvr ) * connection is idle and stale -- remove from server's list */ #ifdef PASSTHRU_VERBOSE_LOGGING - slapi_log_error(SLAPI_LOG_PLUGIN, PASSTHRU_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_PLUGIN, PASSTHRU_PLUGIN_SUBSYSTEM, "check_for_stale_connections: discarding idle, " "stale connection 0x%x\n", conn->ptconn_ld ); #endif @@ -411,7 +411,7 @@ check_for_stale_connections( PassThruServer *srvr ) * connection is stale but in use -- mark to be disposed later */ #ifdef PASSTHRU_VERBOSE_LOGGING - slapi_log_error(SLAPI_LOG_PLUGIN, PASSTHRU_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_PLUGIN, PASSTHRU_PLUGIN_SUBSYSTEM, "check_for_stale_connections: marking connection 0x%x " "stale (use count %d)\n", conn->ptconn_ld, conn->ptconn_usecount ); diff --git a/ldap/servers/plugins/passthru/ptpreop.c b/ldap/servers/plugins/passthru/ptpreop.c index d96fc21..569fa40 100644 --- a/ldap/servers/plugins/passthru/ptpreop.c +++ b/ldap/servers/plugins/passthru/ptpreop.c @@ -38,7 +38,7 @@ passthruauth_init( Slapi_PBlock *pb ) { PASSTHRU_ASSERT( pb != NULL ); - slapi_log_error(SLAPI_LOG_PLUGIN, PASSTHRU_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_PLUGIN, PASSTHRU_PLUGIN_SUBSYSTEM, "=> passthruauth_init\n" ); if ( slapi_pblock_set( pb, SLAPI_PLUGIN_VERSION, @@ -51,12 +51,12 @@ passthruauth_init( Slapi_PBlock *pb ) (void *)passthru_bindpreop ) != 0 || slapi_pblock_set( pb, SLAPI_PLUGIN_CLOSE_FN, (void *)passthru_bindpreop_close ) != 0 ) { - slapi_log_error(SLAPI_LOG_ERR, PASSTHRU_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_ERR, PASSTHRU_PLUGIN_SUBSYSTEM, "passthruauth_init - Failed\n" ); return( -1 ); } - slapi_log_error(SLAPI_LOG_PLUGIN, PASSTHRU_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_PLUGIN, PASSTHRU_PLUGIN_SUBSYSTEM, "<= passthruauth_init succeeded\n" ); return( 0 ); @@ -75,18 +75,18 @@ passthru_bindpreop_start( Slapi_PBlock *pb ) PASSTHRU_ASSERT( pb != NULL ); - slapi_log_error(SLAPI_LOG_PLUGIN, PASSTHRU_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_PLUGIN, PASSTHRU_PLUGIN_SUBSYSTEM, "=> passthru_bindpreop_start\n" ); if ( slapi_pblock_get( pb, SLAPI_PLUGIN_ARGC, &argc ) != 0 || slapi_pblock_get( pb, SLAPI_PLUGIN_ARGV, &argv ) != 0 ) { - slapi_log_error(SLAPI_LOG_ERR, PASSTHRU_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_ERR, PASSTHRU_PLUGIN_SUBSYSTEM, "passthru_bindpreop_start - Unable to get arguments\n" ); return( -1 ); } if (( rc = passthru_config( argc, argv )) != LDAP_SUCCESS ) { - slapi_log_error(SLAPI_LOG_ERR, PASSTHRU_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_ERR, PASSTHRU_PLUGIN_SUBSYSTEM, "passthru_bindpreop_start - Configuration failed (%s)\n", ldap_err2string( rc )); return( -1 ); } @@ -103,7 +103,7 @@ passthru_bindpreop_close( Slapi_PBlock *pb ) { PASSTHRU_ASSERT( pb != NULL ); - slapi_log_error(SLAPI_LOG_PLUGIN, PASSTHRU_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_PLUGIN, PASSTHRU_PLUGIN_SUBSYSTEM, "=> passthru_bindpreop_close\n" ); /* @@ -133,7 +133,7 @@ passthru_bindpreop( Slapi_PBlock *pb ) PASSTHRU_ASSERT( pb != NULL ); - slapi_log_error(SLAPI_LOG_PLUGIN, PASSTHRU_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_PLUGIN, PASSTHRU_PLUGIN_SUBSYSTEM, "=> passthru_bindpreop\n" ); /* @@ -142,7 +142,7 @@ passthru_bindpreop( Slapi_PBlock *pb ) if ( slapi_pblock_get( pb, SLAPI_BIND_METHOD, &method ) != 0 || slapi_pblock_get( pb, SLAPI_BIND_TARGET_SDN, &sdn ) != 0 || slapi_pblock_get( pb, SLAPI_BIND_CREDENTIALS, &creds ) != 0 ) { - slapi_log_error(SLAPI_LOG_ERR, PASSTHRU_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_ERR, PASSTHRU_PLUGIN_SUBSYSTEM, "passthru_bindpreop - Not handled (unable to retrieve bind parameters)\n" ); return( PASSTHRU_OP_NOT_HANDLED ); } @@ -157,7 +157,7 @@ passthru_bindpreop( Slapi_PBlock *pb ) */ if ( method != LDAP_AUTH_SIMPLE || *normbinddn == '\0' || creds->bv_len == 0 ) { - slapi_log_error(SLAPI_LOG_PLUGIN, PASSTHRU_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_PLUGIN, PASSTHRU_PLUGIN_SUBSYSTEM, "passthru_bindpreop - Not handled (not simple bind or NULL dn/credentials)\n" ); return( PASSTHRU_OP_NOT_HANDLED ); } @@ -172,7 +172,7 @@ passthru_bindpreop( Slapi_PBlock *pb ) * another server. */ if ( passthru_dn2server( cfg, normbinddn, &srvr ) != LDAP_SUCCESS ) { - slapi_log_error(SLAPI_LOG_PLUGIN, PASSTHRU_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_PLUGIN, PASSTHRU_PLUGIN_SUBSYSTEM, "passthru_bindpreop - Not handled (not one of our suffixes)\n" ); return( PASSTHRU_OP_NOT_HANDLED ); } @@ -187,7 +187,7 @@ passthru_bindpreop( Slapi_PBlock *pb ) if ( slapi_pblock_get( pb, SLAPI_REQCONTROLS, &reqctrls ) != 0 ) { rc = LDAP_OPERATIONS_ERROR; errmsg = "unable to retrieve bind controls"; - slapi_log_error(SLAPI_LOG_ERR, PASSTHRU_PLUGIN_SUBSYSTEM, "%s\n", + slapi_log_err(SLAPI_LOG_ERR, PASSTHRU_PLUGIN_SUBSYSTEM, "%s\n", errmsg ); } else { int lderrno; @@ -224,7 +224,7 @@ passthru_bindpreop( Slapi_PBlock *pb ) slapi_ch_free((void **)&ndn); rc = LDAP_OPERATIONS_ERROR; errmsg = "unable to set connection DN or AUTHTYPE"; - slapi_log_error(SLAPI_LOG_ERR, PASSTHRU_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_ERR, PASSTHRU_PLUGIN_SUBSYSTEM, "passthru_bindpreop - %s\n", errmsg ); } } @@ -259,7 +259,7 @@ passthru_bindpreop( Slapi_PBlock *pb ) ldap_memfree( matcheddn ); } - slapi_log_error(SLAPI_LOG_PLUGIN, PASSTHRU_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_PLUGIN, PASSTHRU_PLUGIN_SUBSYSTEM, "passthru_bindpreop - handled (error %d - %s)\n", rc, ldap_err2string( rc )); return( PASSTHRU_OP_HANDLED ); diff --git a/ldap/servers/plugins/posix-winsync/posix-group-func.c b/ldap/servers/plugins/posix-winsync/posix-group-func.c index 61e4aa5..9827235 100644 --- a/ldap/servers/plugins/posix-winsync/posix-group-func.c +++ b/ldap/servers/plugins/posix-winsync/posix-group-func.c @@ -77,7 +77,7 @@ addDynamicGroupIfNecessary(Slapi_Entry *entry, Slapi_Mods *smods) { Slapi_Entry * getEntry(const char *udn, char **attrs) { - slapi_log_error(SLAPI_LOG_PLUGIN, POSIX_WINSYNC_PLUGIN_NAME, "getEntry: search %s\n", udn); + slapi_log_err(SLAPI_LOG_PLUGIN, POSIX_WINSYNC_PLUGIN_NAME, "getEntry: search %s\n", udn); Slapi_DN *udn_sdn = slapi_sdn_new_dn_byval(udn); Slapi_Entry *result = NULL; @@ -89,12 +89,12 @@ getEntry(const char *udn, char **attrs) return result; /* Must be freed */ } else { - slapi_log_error(SLAPI_LOG_PLUGIN, POSIX_WINSYNC_PLUGIN_NAME, + slapi_log_err(SLAPI_LOG_PLUGIN, POSIX_WINSYNC_PLUGIN_NAME, "getEntry: %s not found\n", udn); } } else { - slapi_log_error(SLAPI_LOG_ERR, POSIX_WINSYNC_PLUGIN_NAME, + slapi_log_err(SLAPI_LOG_ERR, POSIX_WINSYNC_PLUGIN_NAME, "getEntry: error searching for uid %s: %d\n", udn, rc); } @@ -118,10 +118,10 @@ searchUid(const char *udn) if (slapi_entry_attr_find(entry, "uid", &attr) == 0 && hasObjectClass(entry, "posixAccount")) { slapi_attr_first_value(attr, &v); uid = slapi_ch_strdup(slapi_value_get_string(v)); - slapi_log_error(SLAPI_LOG_PLUGIN, POSIX_WINSYNC_PLUGIN_NAME, + slapi_log_err(SLAPI_LOG_PLUGIN, POSIX_WINSYNC_PLUGIN_NAME, "searchUid: return uid %s\n", uid); } else { - slapi_log_error(SLAPI_LOG_PLUGIN, POSIX_WINSYNC_PLUGIN_NAME, + slapi_log_err(SLAPI_LOG_PLUGIN, POSIX_WINSYNC_PLUGIN_NAME, "searchUid: uid in %s not found\n", udn); } @@ -129,13 +129,13 @@ searchUid(const char *udn) uid = slapi_dn_ignore_case(uid); } - slapi_log_error(SLAPI_LOG_PLUGIN, POSIX_WINSYNC_PLUGIN_NAME, + slapi_log_err(SLAPI_LOG_PLUGIN, POSIX_WINSYNC_PLUGIN_NAME, "searchUid: About to free entry (%s)\n", udn); slapi_entry_free(entry); } - slapi_log_error(SLAPI_LOG_PLUGIN, POSIX_WINSYNC_PLUGIN_NAME, + slapi_log_err(SLAPI_LOG_PLUGIN, POSIX_WINSYNC_PLUGIN_NAME, "searchUid(%s): <==\n", udn); return uid; @@ -180,7 +180,7 @@ uid_in_set(const char* uid, char **uids) char *i_uid = NULL; char *t = NULL; - slapi_log_error(SLAPI_LOG_PLUGIN, POSIX_WINSYNC_PLUGIN_NAME, "uid_in_set: comp %s %s \n", + slapi_log_err(SLAPI_LOG_PLUGIN, POSIX_WINSYNC_PLUGIN_NAME, "uid_in_set: comp %s %s \n", uid, uids[i]); i_rdn = slapi_rdn_new_dn(uids[i]); if (slapi_rdn_get_first(i_rdn, &t, &i_uid) == 1) { @@ -210,7 +210,7 @@ uid_in_valueset(const char* uid, Slapi_ValueSet *uids) const char *uid_i = slapi_value_get_string(v); - slapi_log_error(SLAPI_LOG_PLUGIN, POSIX_WINSYNC_PLUGIN_NAME, "uid_in_valueset: comp %s %s \n", + slapi_log_err(SLAPI_LOG_PLUGIN, POSIX_WINSYNC_PLUGIN_NAME, "uid_in_valueset: comp %s %s \n", uid, uid_i); i_rdn = slapi_rdn_new_dn(uid_i); if (slapi_rdn_get_first(i_rdn, &t, &i_uid) == 1) { @@ -271,7 +271,7 @@ hasObjectClass(Slapi_Entry *entry, const char *objectClass) return 0; /* Doesn't have any objectclasses */ } - slapi_log_error(SLAPI_LOG_PLUGIN, POSIX_WINSYNC_PLUGIN_NAME, + slapi_log_err(SLAPI_LOG_PLUGIN, POSIX_WINSYNC_PLUGIN_NAME, "Scanning objectclasses\n"); for ( @@ -309,7 +309,7 @@ posix_winsync_foreach_parent(Slapi_Entry *entry, char **attrs, plugin_search_ent if (base_sdn == NULL) { continue; } - slapi_log_error(SLAPI_LOG_PLUGIN, POSIX_WINSYNC_PLUGIN_NAME, + slapi_log_err(SLAPI_LOG_PLUGIN, POSIX_WINSYNC_PLUGIN_NAME, "posix_winsync_foreach_parent: Searching subtree %s for %s\n", slapi_sdn_get_dn(base_sdn), filter); @@ -339,9 +339,9 @@ posix_winsync_foreach_parent(Slapi_Entry *entry, char **attrs, plugin_search_ent void getMembershipFromDownward(Slapi_Entry *entry, Slapi_ValueSet *muid_vs, Slapi_ValueSet *muid_nested_vs, Slapi_ValueSet *deletions, const Slapi_DN *base_sdn, int depth) { - slapi_log_error(SLAPI_LOG_PLUGIN, POSIX_WINSYNC_PLUGIN_NAME, + slapi_log_err(SLAPI_LOG_PLUGIN, POSIX_WINSYNC_PLUGIN_NAME, "getMembershipFromDownward: ==>\n"); - slapi_log_error(SLAPI_LOG_PLUGIN, POSIX_WINSYNC_PLUGIN_NAME, + slapi_log_err(SLAPI_LOG_PLUGIN, POSIX_WINSYNC_PLUGIN_NAME, "getMembershipFromDownward: entry name: %s\n", slapi_entry_get_dn_const(entry)); @@ -350,14 +350,14 @@ getMembershipFromDownward(Slapi_Entry *entry, Slapi_ValueSet *muid_vs, Slapi_Val Slapi_Value *uid_value = NULL; /* uniqueMember attribute values */ if (depth >= MAX_RECURSION_DEPTH) { - slapi_log_error(SLAPI_LOG_PLUGIN, POSIX_WINSYNC_PLUGIN_NAME, + slapi_log_err(SLAPI_LOG_PLUGIN, POSIX_WINSYNC_PLUGIN_NAME, "getMembershipFromDownward: recursion limit reached: %d\n", depth); return; } rc = slapi_entry_attr_find(entry, "uniquemember", &um_attr); if (rc != 0 || um_attr == NULL) { - slapi_log_error(SLAPI_LOG_PLUGIN, POSIX_WINSYNC_PLUGIN_NAME, + slapi_log_err(SLAPI_LOG_PLUGIN, POSIX_WINSYNC_PLUGIN_NAME, "getMembershipFromDownward end: attribute uniquemember not found\n"); return; } @@ -368,13 +368,13 @@ getMembershipFromDownward(Slapi_Entry *entry, Slapi_ValueSet *muid_vs, Slapi_Val char *attrs[] = { "uniqueMember", "memberUid", "uid", "objectClass", NULL }; const char *uid_dn = slapi_value_get_string(uid_value); - slapi_log_error(SLAPI_LOG_PLUGIN, POSIX_WINSYNC_PLUGIN_NAME, + slapi_log_err(SLAPI_LOG_PLUGIN, POSIX_WINSYNC_PLUGIN_NAME, "getMembershipFromDownward: iterating uniqueMember: %s\n", uid_dn); if (deletions && !slapi_sdn_compare(slapi_entry_get_sdn_const(entry), base_sdn)) { if (slapi_valueset_find(um_attr, deletions, uid_value)) { - slapi_log_error(SLAPI_LOG_PLUGIN, POSIX_WINSYNC_PLUGIN_NAME, + slapi_log_err(SLAPI_LOG_PLUGIN, POSIX_WINSYNC_PLUGIN_NAME, "getMembershipFromDownward: Skipping iteration because of deletion\n"); continue; @@ -384,7 +384,7 @@ getMembershipFromDownward(Slapi_Entry *entry, Slapi_ValueSet *muid_vs, Slapi_Val Slapi_Entry *child = getEntry(uid_dn, attrs); if (!child) { - slapi_log_error(SLAPI_LOG_PLUGIN, POSIX_WINSYNC_PLUGIN_NAME, + slapi_log_err(SLAPI_LOG_PLUGIN, POSIX_WINSYNC_PLUGIN_NAME, "getMembershipFromDownward end: child not found: %s\n", uid_dn); } else { @@ -403,7 +403,7 @@ getMembershipFromDownward(Slapi_Entry *entry, Slapi_ValueSet *muid_vs, Slapi_Val slapi_attr_first_value(uid_attr, &v); if (v && !slapi_valueset_find(uid_attr, muid_vs, v)) { - slapi_log_error(SLAPI_LOG_PLUGIN, POSIX_WINSYNC_PLUGIN_NAME, + slapi_log_err(SLAPI_LOG_PLUGIN, POSIX_WINSYNC_PLUGIN_NAME, "getMembershipFromDownward: adding member: %s\n", slapi_value_get_string(v)); slapi_valueset_add_value(muid_vs, v); @@ -417,7 +417,7 @@ getMembershipFromDownward(Slapi_Entry *entry, Slapi_ValueSet *muid_vs, Slapi_Val slapi_attr_first_value(uid_attr, &v); if (v && !slapi_valueset_find(uid_attr, muid_vs, v)) { - slapi_log_error(SLAPI_LOG_PLUGIN, POSIX_WINSYNC_PLUGIN_NAME, + slapi_log_err(SLAPI_LOG_PLUGIN, POSIX_WINSYNC_PLUGIN_NAME, "getMembershipFromDownward: adding member: %s\n", slapi_value_get_string(v)); slapi_valueset_add_value(muid_vs, v); @@ -429,7 +429,7 @@ getMembershipFromDownward(Slapi_Entry *entry, Slapi_ValueSet *muid_vs, Slapi_Val } } - slapi_log_error(SLAPI_LOG_PLUGIN, POSIX_WINSYNC_PLUGIN_NAME, + slapi_log_err(SLAPI_LOG_PLUGIN, POSIX_WINSYNC_PLUGIN_NAME, "getMembershipFromDownward: <==\n"); } @@ -453,14 +453,14 @@ void propogateMembershipUpward(Slapi_Entry *entry, Slapi_ValueSet *muid_vs, int depth) { if (depth >= MAX_RECURSION_DEPTH) { - slapi_log_error(SLAPI_LOG_PLUGIN, POSIX_WINSYNC_PLUGIN_NAME, + slapi_log_err(SLAPI_LOG_PLUGIN, POSIX_WINSYNC_PLUGIN_NAME, "propogateMembershipUpward: recursion limit reached: %d\n", depth); return; } - slapi_log_error(SLAPI_LOG_PLUGIN, POSIX_WINSYNC_PLUGIN_NAME, + slapi_log_err(SLAPI_LOG_PLUGIN, POSIX_WINSYNC_PLUGIN_NAME, "propogateMembershipUpward: ==>\n"); - slapi_log_error(SLAPI_LOG_PLUGIN, POSIX_WINSYNC_PLUGIN_NAME, + slapi_log_err(SLAPI_LOG_PLUGIN, POSIX_WINSYNC_PLUGIN_NAME, "propogateMembershipUpward: entry name: %s\n", slapi_entry_get_dn_const(entry)); @@ -476,7 +476,7 @@ propogateMembershipUpward(Slapi_Entry *entry, Slapi_ValueSet *muid_vs, int depth Slapi_ValueSet *muid_old_vs = NULL; int rc = slapi_entry_attr_find(entry, "memberUid", &muid_old_attr); if (rc != 0 || muid_old_attr == NULL) { /* Found no memberUid list, so create */ - slapi_log_error(SLAPI_LOG_PLUGIN, POSIX_WINSYNC_PLUGIN_NAME, + slapi_log_err(SLAPI_LOG_PLUGIN, POSIX_WINSYNC_PLUGIN_NAME, "propogateMembershipUpward: no attribute memberUid\n"); /* There's no values from this entry to add */ @@ -497,7 +497,7 @@ propogateMembershipUpward(Slapi_Entry *entry, Slapi_ValueSet *muid_vs, int depth i = slapi_valueset_next_value(muid_vs, i, &v)) { if (!slapi_valueset_find(muid_old_attr, muid_old_vs, v)) { - slapi_log_error(SLAPI_LOG_PLUGIN, POSIX_WINSYNC_PLUGIN_NAME, + slapi_log_err(SLAPI_LOG_PLUGIN, POSIX_WINSYNC_PLUGIN_NAME, "propogateMembershipUpward: adding %s to set\n", slapi_value_get_string(v)); @@ -535,7 +535,7 @@ propogateMembershipUpward(Slapi_Entry *entry, Slapi_ValueSet *muid_vs, int depth slapi_valueset_free(muid_upward_vs); muid_upward_vs = NULL; } - slapi_log_error(SLAPI_LOG_PLUGIN, POSIX_WINSYNC_PLUGIN_NAME, + slapi_log_err(SLAPI_LOG_PLUGIN, POSIX_WINSYNC_PLUGIN_NAME, "propogateMembershipUpward: <==\n"); } @@ -563,14 +563,14 @@ propogateDeletionsUpward(Slapi_Entry *entry, const Slapi_DN *base_sdn, Slapi_Val if (smod_deluids == NULL) return; if (depth >= MAX_RECURSION_DEPTH) { - slapi_log_error(SLAPI_LOG_PLUGIN, POSIX_WINSYNC_PLUGIN_NAME, + slapi_log_err(SLAPI_LOG_PLUGIN, POSIX_WINSYNC_PLUGIN_NAME, "propogateDeletionsUpward: recursion limit reached: %d\n", depth); return; } - slapi_log_error(SLAPI_LOG_PLUGIN, POSIX_WINSYNC_PLUGIN_NAME, + slapi_log_err(SLAPI_LOG_PLUGIN, POSIX_WINSYNC_PLUGIN_NAME, "propogateDeletionsUpward: ==>\n"); - slapi_log_error(SLAPI_LOG_PLUGIN, POSIX_WINSYNC_PLUGIN_NAME, + slapi_log_err(SLAPI_LOG_PLUGIN, POSIX_WINSYNC_PLUGIN_NAME, "propogateDeletionsUpward: entry name: %s\n", slapi_entry_get_dn_const(entry)); @@ -596,14 +596,14 @@ propogateDeletionsUpward(Slapi_Entry *entry, const Slapi_DN *base_sdn, Slapi_Val if (!slapi_valueset_find(muid_attr, muid_vs, v)) { const char *uid = slapi_value_get_string(v); if (depth == 0 && !uid_in_valueset(uid, smod_deluids)) { - slapi_log_error(SLAPI_LOG_PLUGIN, POSIX_WINSYNC_PLUGIN_NAME, + slapi_log_err(SLAPI_LOG_PLUGIN, POSIX_WINSYNC_PLUGIN_NAME, "propogateDeletionsUpward: Adding deletion to modlist: %s\n", slapi_value_get_string(v)); slapi_valueset_add_value(del_nested_vs, v); } else if (depth > 0) { slapi_valueset_add_value(muid_deletions_vs, v); - slapi_log_error(SLAPI_LOG_PLUGIN, POSIX_WINSYNC_PLUGIN_NAME, + slapi_log_err(SLAPI_LOG_PLUGIN, POSIX_WINSYNC_PLUGIN_NAME, "propogateDeletionsUpward: Adding deletion to deletion list: %s\n", slapi_value_get_string(v)); } @@ -611,7 +611,7 @@ propogateDeletionsUpward(Slapi_Entry *entry, const Slapi_DN *base_sdn, Slapi_Val } if (depth > 0) { - slapi_log_error(SLAPI_LOG_PLUGIN, POSIX_WINSYNC_PLUGIN_NAME, + slapi_log_err(SLAPI_LOG_PLUGIN, POSIX_WINSYNC_PLUGIN_NAME, "propogateDeletionsUpward: executing deletion list\n"); Slapi_Mods *smods = slapi_mods_new(); @@ -632,21 +632,21 @@ propogateDeletionsUpward(Slapi_Entry *entry, const Slapi_DN *base_sdn, Slapi_Val slapi_valueset_free(muid_deletions_vs); muid_deletions_vs = NULL; } - slapi_log_error(SLAPI_LOG_PLUGIN, POSIX_WINSYNC_PLUGIN_NAME, + slapi_log_err(SLAPI_LOG_PLUGIN, POSIX_WINSYNC_PLUGIN_NAME, "propogateDeletionsUpward: <==\n"); } int modGroupMembership(Slapi_Entry *entry, Slapi_Mods *smods, int *do_modify, int newposixgroup) { - slapi_log_error(SLAPI_LOG_PLUGIN, POSIX_WINSYNC_PLUGIN_NAME, "modGroupMembership: ==>\n"); - slapi_log_error(SLAPI_LOG_PLUGIN, POSIX_WINSYNC_PLUGIN_NAME, "modGroupMembership: Modding %s\n", + slapi_log_err(SLAPI_LOG_PLUGIN, POSIX_WINSYNC_PLUGIN_NAME, "modGroupMembership: ==>\n"); + slapi_log_err(SLAPI_LOG_PLUGIN, POSIX_WINSYNC_PLUGIN_NAME, "modGroupMembership: Modding %s\n", slapi_entry_get_dn_const(entry)); int posixGroup = hasObjectClass(entry, "posixGroup"); if (!(posixGroup || hasObjectClass(entry, "ntGroup")) && !newposixgroup) { - slapi_log_error(SLAPI_LOG_PLUGIN, POSIX_WINSYNC_PLUGIN_NAME, + slapi_log_err(SLAPI_LOG_PLUGIN, POSIX_WINSYNC_PLUGIN_NAME, "modGroupMembership end: Not a posixGroup or ntGroup\n"); return 0; } @@ -657,7 +657,7 @@ modGroupMembership(Slapi_Entry *entry, Slapi_Mods *smods, int *do_modify, int ne char **smod_adduids = NULL; Slapi_ValueSet *smod_deluids = NULL; - slapi_log_error(SLAPI_LOG_PLUGIN, POSIX_WINSYNC_PLUGIN_NAME, + slapi_log_err(SLAPI_LOG_PLUGIN, POSIX_WINSYNC_PLUGIN_NAME, "modGroupMembership: posixGroup -> look for uniquemember\n"); if (slapi_is_loglevel_set(SLAPI_LOG_PLUGIN)) slapi_mods_dump(smods, "memberUid - mods dump - initial"); @@ -680,13 +680,13 @@ modGroupMembership(Slapi_Entry *entry, Slapi_Mods *smods, int *do_modify, int ne if (!smod_deluids) smod_deluids = slapi_valueset_new(); slapi_valueset_add_value(smod_deluids, sv); - slapi_log_error(SLAPI_LOG_PLUGIN, POSIX_WINSYNC_PLUGIN_NAME, + slapi_log_err(SLAPI_LOG_PLUGIN, POSIX_WINSYNC_PLUGIN_NAME, "modGroupMembership: add to deluids %s\n", bv->bv_val); } else { slapi_ch_array_add(&smod_adduids, slapi_ch_strdup(slapi_value_get_string(sv))); - slapi_log_error(SLAPI_LOG_PLUGIN, POSIX_WINSYNC_PLUGIN_NAME, + slapi_log_err(SLAPI_LOG_PLUGIN, POSIX_WINSYNC_PLUGIN_NAME, "modGroupMembership: add to adduids %s\n", bv->bv_val); } @@ -719,7 +719,7 @@ modGroupMembership(Slapi_Entry *entry, Slapi_Mods *smods, int *do_modify, int ne int rc = slapi_entry_attr_find(entry, "uniquemember", &um_attr); if (rc != 0 || um_attr == NULL) { - slapi_log_error(SLAPI_LOG_PLUGIN, POSIX_WINSYNC_PLUGIN_NAME, + slapi_log_err(SLAPI_LOG_PLUGIN, POSIX_WINSYNC_PLUGIN_NAME, "modGroupMembership end: attribute uniquemember not found\n"); break; } @@ -727,7 +727,7 @@ modGroupMembership(Slapi_Entry *entry, Slapi_Mods *smods, int *do_modify, int ne slapi_attr_get_valueset(um_attr, &smod_deluids); } if (muid_rc != 0 || muid_attr == NULL) { - slapi_log_error(SLAPI_LOG_PLUGIN, POSIX_WINSYNC_PLUGIN_NAME, + slapi_log_err(SLAPI_LOG_PLUGIN, POSIX_WINSYNC_PLUGIN_NAME, "modGroupMembership end: attribute memberUid not found\n"); } else if (posix_winsync_config_get_mapMemberUid()) { @@ -736,14 +736,14 @@ modGroupMembership(Slapi_Entry *entry, Slapi_Mods *smods, int *do_modify, int ne j = slapi_attr_next_value(muid_attr, j, &uid_value)) { /* remove from uniquemember: remove from memberUid also */ const char *uid = NULL; - slapi_log_error(SLAPI_LOG_PLUGIN, POSIX_WINSYNC_PLUGIN_NAME, + slapi_log_err(SLAPI_LOG_PLUGIN, POSIX_WINSYNC_PLUGIN_NAME, "modGroupMembership: test dellist \n"); uid = slapi_value_get_string(uid_value); - slapi_log_error(SLAPI_LOG_PLUGIN, POSIX_WINSYNC_PLUGIN_NAME, + slapi_log_err(SLAPI_LOG_PLUGIN, POSIX_WINSYNC_PLUGIN_NAME, "modGroupMembership: test dellist %s\n", uid); if (uid_in_valueset(uid, smod_deluids)) { slapi_valueset_add_value(deluids, uid_value); - slapi_log_error(SLAPI_LOG_PLUGIN, POSIX_WINSYNC_PLUGIN_NAME, + slapi_log_err(SLAPI_LOG_PLUGIN, POSIX_WINSYNC_PLUGIN_NAME, "modGroupMembership: add to dellist %s\n", uid); } } @@ -763,7 +763,7 @@ modGroupMembership(Slapi_Entry *entry, Slapi_Mods *smods, int *do_modify, int ne if (smod_adduids != NULL) { /* not MOD_DELETE */ const char *uid_dn = NULL; - slapi_log_error(SLAPI_LOG_PLUGIN, POSIX_WINSYNC_PLUGIN_NAME, + slapi_log_err(SLAPI_LOG_PLUGIN, POSIX_WINSYNC_PLUGIN_NAME, "modGroupMembership: posixGroup -> look for uniquemember\n"); if (muid_rc == 0 && muid_attr == NULL) { @@ -781,13 +781,13 @@ modGroupMembership(Slapi_Entry *entry, Slapi_Mods *smods, int *do_modify, int ne static char *uid = NULL; uid_dn = smod_adduids[j]; - slapi_log_error(SLAPI_LOG_PLUGIN, POSIX_WINSYNC_PLUGIN_NAME, + slapi_log_err(SLAPI_LOG_PLUGIN, POSIX_WINSYNC_PLUGIN_NAME, "modGroupMembership: perform user %s\n", uid_dn); uid = searchUid(uid_dn); if (uid == NULL) { - slapi_log_error(SLAPI_LOG_PLUGIN, POSIX_WINSYNC_PLUGIN_NAME, + slapi_log_err(SLAPI_LOG_PLUGIN, POSIX_WINSYNC_PLUGIN_NAME, "modGroupMembership: uid not found for %s, cannot do anything\n", uid_dn); /* member on longer on server, do nothing */ } else { @@ -797,14 +797,14 @@ modGroupMembership(Slapi_Entry *entry, Slapi_Mods *smods, int *do_modify, int ne if (muid_rc == 0 && muid_attr != NULL && slapi_valueset_find(muid_attr, muid_vs, v) != NULL) { - slapi_log_error(SLAPI_LOG_PLUGIN, POSIX_WINSYNC_PLUGIN_NAME, + slapi_log_err(SLAPI_LOG_PLUGIN, POSIX_WINSYNC_PLUGIN_NAME, "modGroupMembership: uid found in memberuid list %s nothing to do\n", uid); } else { slapi_valueset_add_value(adduids, v); slapi_valueset_add_value(muid_vs, v); - slapi_log_error(SLAPI_LOG_PLUGIN, POSIX_WINSYNC_PLUGIN_NAME, + slapi_log_err(SLAPI_LOG_PLUGIN, POSIX_WINSYNC_PLUGIN_NAME, "modGroupMembership: add to modlist %s\n", uid); } @@ -821,7 +821,7 @@ modGroupMembership(Slapi_Entry *entry, Slapi_Mods *smods, int *do_modify, int ne if (child) { if (hasObjectClass(child, "ntGroup") || hasObjectClass(child, "posixGroup")) { - slapi_log_error(SLAPI_LOG_PLUGIN, POSIX_WINSYNC_PLUGIN_NAME, + slapi_log_err(SLAPI_LOG_PLUGIN, POSIX_WINSYNC_PLUGIN_NAME, "modGroupMembership: Found mod to add group, adding membership: %s\n", smod_adduids[j]); Slapi_ValueSet *muid_tempnested = slapi_valueset_new(); @@ -831,7 +831,7 @@ modGroupMembership(Slapi_Entry *entry, Slapi_Mods *smods, int *do_modify, int ne } } else { - slapi_log_error(SLAPI_LOG_PLUGIN, POSIX_WINSYNC_PLUGIN_NAME, + slapi_log_err(SLAPI_LOG_PLUGIN, POSIX_WINSYNC_PLUGIN_NAME, "modGroupMembership: entry not found for dn: %s\n", smod_adduids[j]); } @@ -910,7 +910,7 @@ modGroupMembership(Slapi_Entry *entry, Slapi_Mods *smods, int *do_modify, int ne slapi_valueset_free(muid_vs); muid_vs = NULL; } - slapi_log_error(SLAPI_LOG_PLUGIN, POSIX_WINSYNC_PLUGIN_NAME, "modGroupMembership: <==\n"); + slapi_log_err(SLAPI_LOG_PLUGIN, POSIX_WINSYNC_PLUGIN_NAME, "modGroupMembership: <==\n"); return 0; } @@ -941,12 +941,12 @@ addGroupMembership(Slapi_Entry *entry, Slapi_Entry *ad_entry) int rc = 0; int i; - slapi_log_error(SLAPI_LOG_PLUGIN, POSIX_WINSYNC_PLUGIN_NAME, "addGroupMembership: ==>\n"); + slapi_log_err(SLAPI_LOG_PLUGIN, POSIX_WINSYNC_PLUGIN_NAME, "addGroupMembership: ==>\n"); int posixGroup = hasObjectClass(entry, "posixGroup"); if(!(posixGroup || hasObjectClass(entry, "ntGroup"))) { - slapi_log_error(SLAPI_LOG_PLUGIN, POSIX_WINSYNC_PLUGIN_NAME, + slapi_log_err(SLAPI_LOG_PLUGIN, POSIX_WINSYNC_PLUGIN_NAME, "addGroupMembership: didn't find posixGroup or ntGroup objectclass\n"); return 0; } @@ -957,18 +957,18 @@ addGroupMembership(Slapi_Entry *entry, Slapi_Entry *ad_entry) Slapi_ValueSet *newvs = NULL; - slapi_log_error(SLAPI_LOG_PLUGIN, POSIX_WINSYNC_PLUGIN_NAME, + slapi_log_err(SLAPI_LOG_PLUGIN, POSIX_WINSYNC_PLUGIN_NAME, "addGroupMembership: posixGroup -> look for uniquemember\n"); rc = slapi_entry_attr_find(entry, "uniquemember", &um_attr); if (rc != 0 || um_attr == NULL) { - slapi_log_error(SLAPI_LOG_PLUGIN, POSIX_WINSYNC_PLUGIN_NAME, + slapi_log_err(SLAPI_LOG_PLUGIN, POSIX_WINSYNC_PLUGIN_NAME, "addGroupMembership end: attribute uniquemember not found\n"); return 0; } /* found attribute uniquemember */ rc = slapi_entry_attr_find(entry, "memberUid", &muid_attr); if (rc != 0 || muid_attr == NULL) { /* Found no memberUid list, so create */ - slapi_log_error(SLAPI_LOG_PLUGIN, POSIX_WINSYNC_PLUGIN_NAME, + slapi_log_err(SLAPI_LOG_PLUGIN, POSIX_WINSYNC_PLUGIN_NAME, "addGroupMembership: no attribute memberUid\n"); muid_attr = NULL; } @@ -982,11 +982,11 @@ addGroupMembership(Slapi_Entry *entry, Slapi_Entry *ad_entry) Slapi_Value *v = NULL; uid_dn = slapi_value_get_string(uid_value); - slapi_log_error(SLAPI_LOG_PLUGIN, POSIX_WINSYNC_PLUGIN_NAME, + slapi_log_err(SLAPI_LOG_PLUGIN, POSIX_WINSYNC_PLUGIN_NAME, "addGroupMembership: perform member %s\n", uid_dn); uid = searchUid(uid_dn); if (uid == NULL) { - slapi_log_error(SLAPI_LOG_PLUGIN, POSIX_WINSYNC_PLUGIN_NAME, + slapi_log_err(SLAPI_LOG_PLUGIN, POSIX_WINSYNC_PLUGIN_NAME, "addGroupMembership: uid not found for %s, cannot do anything\n", uid_dn); /* member on longer on server, do nothing */ } else { @@ -1021,7 +1021,7 @@ addGroupMembership(Slapi_Entry *entry, Slapi_Entry *ad_entry) slapi_valueset_free(newvs); newvs = NULL; posix_winsync_config_get_MOFTaskCreated(); - slapi_log_error(SLAPI_LOG_PLUGIN, POSIX_WINSYNC_PLUGIN_NAME, "addGroupMembership: <==\n"); + slapi_log_err(SLAPI_LOG_PLUGIN, POSIX_WINSYNC_PLUGIN_NAME, "addGroupMembership: <==\n"); return 0; } diff --git a/ldap/servers/plugins/posix-winsync/posix-group-task.c b/ldap/servers/plugins/posix-winsync/posix-group-task.c index e090a64..9d1aafe 100644 --- a/ldap/servers/plugins/posix-winsync/posix-group-task.c +++ b/ldap/servers/plugins/posix-winsync/posix-group-task.c @@ -75,7 +75,7 @@ posix_group_task_add(Slapi_PBlock *pb, Slapi_Entry *e, Slapi_Entry *eAfter, int *returncode = LDAP_SUCCESS; - slapi_log_error(SLAPI_LOG_PLUGIN, POSIX_WINSYNC_PLUGIN_NAME, + slapi_log_err(SLAPI_LOG_PLUGIN, POSIX_WINSYNC_PLUGIN_NAME, "posix_group_task_add: ==>\n"); /* get arg(s) */ @@ -86,7 +86,7 @@ posix_group_task_add(Slapi_PBlock *pb, Slapi_Entry *e, Slapi_Entry *eAfter, int goto out; } - slapi_log_error(SLAPI_LOG_PLUGIN, POSIX_WINSYNC_PLUGIN_NAME, + slapi_log_err(SLAPI_LOG_PLUGIN, POSIX_WINSYNC_PLUGIN_NAME, "posix_group_task_add: retrieved basedn: %s\n", dn); if ((filter = fetch_attr(e, "filter", "(&(objectclass=ntGroup)(|(uniquemember=*)(memberuid=*)))")) == NULL) { @@ -95,7 +95,7 @@ posix_group_task_add(Slapi_PBlock *pb, Slapi_Entry *e, Slapi_Entry *eAfter, int goto out; } - slapi_log_error(SLAPI_LOG_PLUGIN, POSIX_WINSYNC_PLUGIN_NAME, + slapi_log_err(SLAPI_LOG_PLUGIN, POSIX_WINSYNC_PLUGIN_NAME, "posix_group_task_add: retrieved filter: %s\n", filter); /* setup our task data */ @@ -108,31 +108,31 @@ posix_group_task_add(Slapi_PBlock *pb, Slapi_Entry *e, Slapi_Entry *eAfter, int mytaskdata->dn = slapi_ch_strdup(dn); mytaskdata->filter_str = slapi_ch_strdup(filter); - slapi_log_error(SLAPI_LOG_PLUGIN, POSIX_WINSYNC_PLUGIN_NAME, + slapi_log_err(SLAPI_LOG_PLUGIN, POSIX_WINSYNC_PLUGIN_NAME, "posix_group_task_add: task data allocated\n"); /* allocate new task now */ char * ndn = slapi_entry_get_ndn(e); - slapi_log_error(SLAPI_LOG_PLUGIN, POSIX_WINSYNC_PLUGIN_NAME, + slapi_log_err(SLAPI_LOG_PLUGIN, POSIX_WINSYNC_PLUGIN_NAME, "posix_group_task_add: creating task object: %s\n", ndn); task = slapi_new_task(ndn); - slapi_log_error(SLAPI_LOG_PLUGIN, POSIX_WINSYNC_PLUGIN_NAME, + slapi_log_err(SLAPI_LOG_PLUGIN, POSIX_WINSYNC_PLUGIN_NAME, "posix_group_task_add: task object created\n"); /* register our destructor for cleaning up our private data */ slapi_task_set_destructor_fn(task, posix_group_task_destructor); - slapi_log_error(SLAPI_LOG_PLUGIN, POSIX_WINSYNC_PLUGIN_NAME, + slapi_log_err(SLAPI_LOG_PLUGIN, POSIX_WINSYNC_PLUGIN_NAME, "posix_group_task_add: task destructor set\n"); /* Stash a pointer to our data in the task */ slapi_task_set_data(task, mytaskdata); - slapi_log_error(SLAPI_LOG_PLUGIN, POSIX_WINSYNC_PLUGIN_NAME, + slapi_log_err(SLAPI_LOG_PLUGIN, POSIX_WINSYNC_PLUGIN_NAME, "posix_group_task_add: task object initialized\n"); /* start the sample task as a separate thread */ @@ -140,11 +140,11 @@ posix_group_task_add(Slapi_PBlock *pb, Slapi_Entry *e, Slapi_Entry *eAfter, int PR_PRIORITY_NORMAL, PR_GLOBAL_THREAD, PR_UNJOINABLE_THREAD, SLAPD_DEFAULT_THREAD_STACKSIZE); - slapi_log_error(SLAPI_LOG_PLUGIN, POSIX_WINSYNC_PLUGIN_NAME, + slapi_log_err(SLAPI_LOG_PLUGIN, POSIX_WINSYNC_PLUGIN_NAME, "posix_group_task_add: thread created\n"); if (thread == NULL) { - slapi_log_error(SLAPI_LOG_ERR, POSIX_WINSYNC_PLUGIN_NAME, + slapi_log_err(SLAPI_LOG_ERR, POSIX_WINSYNC_PLUGIN_NAME, "posix_group_task_add: unable to create task thread!\n"); *returncode = LDAP_OPERATIONS_ERROR; rv = SLAPI_DSE_CALLBACK_ERROR; @@ -154,7 +154,7 @@ posix_group_task_add(Slapi_PBlock *pb, Slapi_Entry *e, Slapi_Entry *eAfter, int } out: - slapi_log_error(SLAPI_LOG_PLUGIN, POSIX_WINSYNC_PLUGIN_NAME, + slapi_log_err(SLAPI_LOG_PLUGIN, POSIX_WINSYNC_PLUGIN_NAME, "posix_group_task_add: <==\n"); return rv; @@ -176,7 +176,7 @@ posix_group_task_destructor(Slapi_Task *task) slapi_ch_free((void **) &mydata); } } - slapi_log_error(SLAPI_LOG_PLUGIN, POSIX_WINSYNC_PLUGIN_NAME, + slapi_log_err(SLAPI_LOG_PLUGIN, POSIX_WINSYNC_PLUGIN_NAME, "posix_group_task_destructor <--\n"); } @@ -247,7 +247,7 @@ static int posix_group_fix_memberuid_callback(Slapi_Entry *e, void *callback_data) { int i; - slapi_log_error(SLAPI_LOG_PLUGIN, POSIX_WINSYNC_PLUGIN_NAME, + slapi_log_err(SLAPI_LOG_PLUGIN, POSIX_WINSYNC_PLUGIN_NAME, "_fix_memberuid ==>\n"); cb_data *the_cb_data = (cb_data *) callback_data; @@ -291,14 +291,14 @@ posix_group_fix_memberuid_callback(Slapi_Entry *e, void *callback_data) slapi_attr_get_valueset(dsmuid_attr, &dsmuid_vs); } - slapi_log_error(SLAPI_LOG_PLUGIN, POSIX_WINSYNC_PLUGIN_NAME, + slapi_log_err(SLAPI_LOG_PLUGIN, POSIX_WINSYNC_PLUGIN_NAME, "_fix_memberuid scan for orphaned memberuids\n"); for (i = slapi_attr_first_value(muid_attr, &v); i != -1; i = slapi_attr_next_value(muid_attr, i, &v)) { char *muid = (char *)slapi_value_get_string(v); - slapi_log_error(SLAPI_LOG_PLUGIN, POSIX_WINSYNC_PLUGIN_NAME, + slapi_log_err(SLAPI_LOG_PLUGIN, POSIX_WINSYNC_PLUGIN_NAME, "_fix_memberuid iterating memberuid: %s\n", muid); @@ -316,7 +316,7 @@ posix_group_fix_memberuid_callback(Slapi_Entry *e, void *callback_data) attrs, 0, NULL, NULL, posix_winsync_get_plugin_identity(), 0); - slapi_log_error(SLAPI_LOG_PLUGIN, POSIX_WINSYNC_PLUGIN_NAME, + slapi_log_err(SLAPI_LOG_PLUGIN, POSIX_WINSYNC_PLUGIN_NAME, "_fix_memberuid searching %s with filter: %s\n", the_cb_data->dn, filter); @@ -325,14 +325,14 @@ posix_group_fix_memberuid_callback(Slapi_Entry *e, void *callback_data) slapi_pblock_get(search_pb, SLAPI_PLUGIN_INTOP_SEARCH_ENTRIES, &search_entries); if (!search_entries || !search_entries[0]) { - slapi_log_error(SLAPI_LOG_PLUGIN, POSIX_WINSYNC_PLUGIN_NAME, + slapi_log_err(SLAPI_LOG_PLUGIN, POSIX_WINSYNC_PLUGIN_NAME, "_fix_memberuid Adding bad memberuid %s\n", slapi_value_get_string(v)); slapi_mods_add_string(smods, LDAP_MOD_DELETE, "memberuid", slapi_value_get_string(v)); if (dsmuid_vs && slapi_valueset_find(dsmuid_attr, dsmuid_vs, v)) { - slapi_log_error(SLAPI_LOG_PLUGIN, POSIX_WINSYNC_PLUGIN_NAME, + slapi_log_err(SLAPI_LOG_PLUGIN, POSIX_WINSYNC_PLUGIN_NAME, "_fix_memberuid Adding bad dsonlymemberuid %s\n", slapi_value_get_string(v)); @@ -360,7 +360,7 @@ posix_group_fix_memberuid_callback(Slapi_Entry *e, void *callback_data) Slapi_ValueSet *bad_ums = NULL; Slapi_Value *uniqval = NULL; /* uniquemeber Attribute values */ Slapi_ValueSet *uids = NULL; - slapi_log_error(SLAPI_LOG_PLUGIN, POSIX_WINSYNC_PLUGIN_NAME, + slapi_log_err(SLAPI_LOG_PLUGIN, POSIX_WINSYNC_PLUGIN_NAME, "_fix_memberuid scan uniquemember, group %s\n", dn); for (i = slapi_attr_first_value(obj_attr, &uniqval); i != -1; i = slapi_attr_next_value(obj_attr, i, &uniqval)) { @@ -372,7 +372,7 @@ posix_group_fix_memberuid_callback(Slapi_Entry *e, void *callback_data) if (child) { slapi_entry_free(child); } else { - slapi_log_error(SLAPI_LOG_PLUGIN, POSIX_WINSYNC_PLUGIN_NAME, + slapi_log_err(SLAPI_LOG_PLUGIN, POSIX_WINSYNC_PLUGIN_NAME, "_fix_memberuid orphaned uniquemember found: %s\n", member); if ((strncasecmp(member, "cn=", 3) == 0) || @@ -388,7 +388,7 @@ posix_group_fix_memberuid_callback(Slapi_Entry *e, void *callback_data) if (is_posix_group) { char *uid = NULL; /* search uid for member (DN) */ - slapi_log_error(SLAPI_LOG_PLUGIN, POSIX_WINSYNC_PLUGIN_NAME, "search %s\n", member); + slapi_log_err(SLAPI_LOG_PLUGIN, POSIX_WINSYNC_PLUGIN_NAME, "search %s\n", member); if ((uid = searchUid(member)) != NULL) { Slapi_Value *value = slapi_value_new(); /* Search an entry having "member" as DN and get uid value from it. */ @@ -425,13 +425,13 @@ posix_group_fix_memberuid_callback(Slapi_Entry *e, void *callback_data) } slapi_valueset_free(uids); - slapi_log_error(SLAPI_LOG_PLUGIN, POSIX_WINSYNC_PLUGIN_NAME, + slapi_log_err(SLAPI_LOG_PLUGIN, POSIX_WINSYNC_PLUGIN_NAME, "_fix_memberuid Finishing...\n"); if (fixMembership && posix_winsync_config_get_mapNestedGrouping()) { Slapi_ValueSet *del_nested_vs = slapi_valueset_new(); - slapi_log_error(SLAPI_LOG_PLUGIN, POSIX_WINSYNC_PLUGIN_NAME, + slapi_log_err(SLAPI_LOG_PLUGIN, POSIX_WINSYNC_PLUGIN_NAME, "_fix_memberuid group deleted, recalculating nesting\n"); propogateDeletionsUpward(e, sdn, bad_ums, del_nested_vs, 0); @@ -459,7 +459,7 @@ posix_group_fix_memberuid_callback(Slapi_Entry *e, void *callback_data) } slapi_mods_free(&smods); bail: - slapi_log_error(SLAPI_LOG_PLUGIN, POSIX_WINSYNC_PLUGIN_NAME, + slapi_log_err(SLAPI_LOG_PLUGIN, POSIX_WINSYNC_PLUGIN_NAME, "_fix_memberuid <==\n"); /* * Since Ticket #481 "expand nested posix groups", @@ -473,7 +473,7 @@ bail: static void posix_group_fixup_task_thread(void *arg) { - slapi_log_error(SLAPI_LOG_PLUGIN, POSIX_WINSYNC_PLUGIN_NAME, + slapi_log_err(SLAPI_LOG_PLUGIN, POSIX_WINSYNC_PLUGIN_NAME, "_task_thread ==>\n"); Slapi_Task *task = (Slapi_Task *) arg; @@ -484,7 +484,7 @@ posix_group_fixup_task_thread(void *arg) return; /* no task */ } slapi_task_inc_refcount(task); - slapi_log_error(SLAPI_LOG_PLUGIN, POSIX_WINSYNC_PLUGIN_NAME, + slapi_log_err(SLAPI_LOG_PLUGIN, POSIX_WINSYNC_PLUGIN_NAME, "posix_group_fixup_task_thread --> refcount incremented.\n" ); /* Fetch our task data from the task */ td = (task_data *) slapi_task_get_data(task); @@ -506,15 +506,15 @@ posix_group_fixup_task_thread(void *arg) slapi_task_log_status(task, "posix_group task finished."); slapi_task_inc_progress(task); - slapi_log_error(SLAPI_LOG_PLUGIN, POSIX_WINSYNC_PLUGIN_NAME, + slapi_log_err(SLAPI_LOG_PLUGIN, POSIX_WINSYNC_PLUGIN_NAME, "_task_thread finishing\n"); /* this will queue the destruction of the task */ slapi_task_finish(task, rc); - slapi_log_error(SLAPI_LOG_PLUGIN, POSIX_WINSYNC_PLUGIN_NAME, + slapi_log_err(SLAPI_LOG_PLUGIN, POSIX_WINSYNC_PLUGIN_NAME, "_task_thread <==\n"); slapi_task_dec_refcount(task); - slapi_log_error(SLAPI_LOG_PLUGIN, POSIX_WINSYNC_PLUGIN_NAME, + slapi_log_err(SLAPI_LOG_PLUGIN, POSIX_WINSYNC_PLUGIN_NAME, "posix_group_fixup_task_thread <-- refcount decremented.\n"); } diff --git a/ldap/servers/plugins/posix-winsync/posix-winsync-config.c b/ldap/servers/plugins/posix-winsync/posix-winsync-config.c index 34df25d..cd6cb51 100644 --- a/ldap/servers/plugins/posix-winsync/posix-winsync-config.c +++ b/ldap/servers/plugins/posix-winsync/posix-winsync-config.c @@ -46,7 +46,7 @@ posix_winsync_agmt_init(const Slapi_DN *ds_subtree, const Slapi_DN *ad_subtree) return NULL; } - slapi_log_error(SLAPI_LOG_PLUGIN, POSIX_WINSYNC_PLUGIN_NAME, + slapi_log_err(SLAPI_LOG_PLUGIN, POSIX_WINSYNC_PLUGIN_NAME, "--> posix_winsync_agmt_init [%s] [%s] -- begin\n", slapi_sdn_get_dn(ds_subtree), slapi_sdn_get_dn(ad_subtree)); @@ -55,7 +55,7 @@ posix_winsync_agmt_init(const Slapi_DN *ds_subtree, const Slapi_DN *ad_subtree) /* if sdn is a parent of ds_subtree or sdn is the WinSync Subtree itself */ if (slapi_sdn_isparent(sdn, ds_subtree) || !slapi_sdn_compare(sdn, ds_subtree)) { theConfig.rep_suffix = sdn; - slapi_log_error(SLAPI_LOG_PLUGIN, POSIX_WINSYNC_PLUGIN_NAME, "posix_winsync_agmt_init - " + slapi_log_err(SLAPI_LOG_PLUGIN, POSIX_WINSYNC_PLUGIN_NAME, "posix_winsync_agmt_init - " "Found suffix's '%s'\n", slapi_sdn_get_dn(sdn)); break; } @@ -63,13 +63,13 @@ posix_winsync_agmt_init(const Slapi_DN *ds_subtree, const Slapi_DN *ad_subtree) } if (!sdn) { char *pardn = slapi_dn_parent(slapi_sdn_get_dn(ds_subtree)); - slapi_log_error(SLAPI_LOG_ERR, POSIX_WINSYNC_PLUGIN_NAME, "posix_winsync_agmt_init - " + slapi_log_err(SLAPI_LOG_ERR, POSIX_WINSYNC_PLUGIN_NAME, "posix_winsync_agmt_init - " "suffix not found for '%s'\n", pardn); slapi_ch_free_string(&pardn); } plugin_op_finished(); - slapi_log_error(SLAPI_LOG_PLUGIN, POSIX_WINSYNC_PLUGIN_NAME, + slapi_log_err(SLAPI_LOG_PLUGIN, POSIX_WINSYNC_PLUGIN_NAME, "<-- posix_winsync_agmt_init -- end\n"); return cbdata; @@ -151,10 +151,10 @@ posix_winsync_config(Slapi_Entry *config_e) theConfig.config_e = NULL; theConfig.lock = NULL; - slapi_log_error(SLAPI_LOG_PLUGIN, POSIX_WINSYNC_PLUGIN_NAME, "--> _config %s -- begin\n", + slapi_log_err(SLAPI_LOG_PLUGIN, POSIX_WINSYNC_PLUGIN_NAME, "--> _config %s -- begin\n", slapi_entry_get_dn_const(config_e)); if (inited) { - slapi_log_error(SLAPI_LOG_ERR, POSIX_WINSYNC_PLUGIN_NAME, + slapi_log_err(SLAPI_LOG_ERR, POSIX_WINSYNC_PLUGIN_NAME, "posix_winsync_config - POSIX WinSync plug-in already configured. " "Please remove the plugin config entry [%s]\n", slapi_entry_get_dn_const(config_e)); @@ -183,7 +183,7 @@ posix_winsync_config(Slapi_Entry *config_e) const char *config_dn = slapi_entry_get_dn_const(config_e); if (!memberUidLockInit()) { - slapi_log_error(SLAPI_LOG_PLUGIN, POSIX_WINSYNC_PLUGIN_NAME, + slapi_log_err(SLAPI_LOG_PLUGIN, POSIX_WINSYNC_PLUGIN_NAME, "posix_winsync_config - init Monitor failed\n"); } @@ -193,7 +193,7 @@ posix_winsync_config(Slapi_Entry *config_e) rc = slapi_task_register_handler("memberuid task", posix_group_task_add); if (rc) { - slapi_log_error(SLAPI_LOG_PLUGIN, POSIX_WINSYNC_PLUGIN_NAME, + slapi_log_err(SLAPI_LOG_PLUGIN, POSIX_WINSYNC_PLUGIN_NAME, "posix_winsync_config - register memberuid task failed\n"); } } @@ -201,7 +201,7 @@ posix_winsync_config(Slapi_Entry *config_e) inited = 1; if (returncode != LDAP_SUCCESS) { - slapi_log_error(SLAPI_LOG_ERR, POSIX_WINSYNC_PLUGIN_NAME, "posix_winsync_config - Error %d: %s\n", returncode, + slapi_log_err(SLAPI_LOG_ERR, POSIX_WINSYNC_PLUGIN_NAME, "posix_winsync_config - Error %d: %s\n", returncode, returntext); } @@ -237,7 +237,7 @@ posix_winsync_apply_config(Slapi_PBlock *pb, Slapi_Entry* entryBefore, Slapi_Ent /* get msfuSchema value */ if (!slapi_entry_attr_find(e, POSIX_WINSYNC_MSSFU_SCHEMA, &testattr) && (NULL != testattr)) { mssfuSchema = slapi_entry_attr_get_bool(e, POSIX_WINSYNC_MSSFU_SCHEMA); - slapi_log_error(SLAPI_LOG_PLUGIN, POSIX_WINSYNC_PLUGIN_NAME, + slapi_log_err(SLAPI_LOG_PLUGIN, POSIX_WINSYNC_PLUGIN_NAME, "posix_winsync_apply_config: Config parameter %s: %d\n", POSIX_WINSYNC_MSSFU_SCHEMA, mssfuSchema); } @@ -245,7 +245,7 @@ posix_winsync_apply_config(Slapi_PBlock *pb, Slapi_Entry* entryBefore, Slapi_Ent /* get memberUid value */ if (!slapi_entry_attr_find(e, POSIX_WINSYNC_MAP_MEMBERUID, &testattr) && (NULL != testattr)) { mapMemberUID = slapi_entry_attr_get_bool(e, POSIX_WINSYNC_MAP_MEMBERUID); - slapi_log_error(SLAPI_LOG_PLUGIN, POSIX_WINSYNC_PLUGIN_NAME, + slapi_log_err(SLAPI_LOG_PLUGIN, POSIX_WINSYNC_PLUGIN_NAME, "posix_winsync_apply_config: Config parameter %s: %d\n", POSIX_WINSYNC_MAP_MEMBERUID, mapMemberUID); } @@ -253,21 +253,21 @@ posix_winsync_apply_config(Slapi_PBlock *pb, Slapi_Entry* entryBefore, Slapi_Ent if (!slapi_entry_attr_find(e, POSIX_WINSYNC_CREATE_MEMBEROFTASK, &testattr) && (NULL != testattr)) { createMemberOfTask = slapi_entry_attr_get_bool(e, POSIX_WINSYNC_CREATE_MEMBEROFTASK); - slapi_log_error(SLAPI_LOG_PLUGIN, POSIX_WINSYNC_PLUGIN_NAME, + slapi_log_err(SLAPI_LOG_PLUGIN, POSIX_WINSYNC_PLUGIN_NAME, "posix_winsync_apply_config: Config parameter %s: %d\n", POSIX_WINSYNC_CREATE_MEMBEROFTASK, createMemberOfTask); } /* get lower case UID in memberUID */ if (!slapi_entry_attr_find(e, POSIX_WINSYNC_LOWER_CASE, &testattr) && (NULL != testattr)) { lowercase = slapi_entry_attr_get_bool(e, POSIX_WINSYNC_LOWER_CASE); - slapi_log_error(SLAPI_LOG_PLUGIN, POSIX_WINSYNC_PLUGIN_NAME, + slapi_log_err(SLAPI_LOG_PLUGIN, POSIX_WINSYNC_PLUGIN_NAME, "posix_winsync_apply_config: Config parameter %s: %d\n", POSIX_WINSYNC_LOWER_CASE, lowercase); } /* propogate memberuids in nested grouping */ if (!slapi_entry_attr_find(e, POSIX_WINSYNC_MAP_NESTED_GROUPING, &testattr) && (NULL != testattr)) { mapNestedGrouping = slapi_entry_attr_get_bool(e, POSIX_WINSYNC_MAP_NESTED_GROUPING); - slapi_log_error(SLAPI_LOG_PLUGIN, POSIX_WINSYNC_PLUGIN_NAME, + slapi_log_err(SLAPI_LOG_PLUGIN, POSIX_WINSYNC_PLUGIN_NAME, "posix_winsync_apply_config: Config parameter %s: %d\n", POSIX_WINSYNC_MAP_NESTED_GROUPING, mapNestedGrouping); } @@ -286,7 +286,7 @@ posix_winsync_apply_config(Slapi_PBlock *pb, Slapi_Entry* entryBefore, Slapi_Ent theConfig.mapNestedGrouping = mapNestedGrouping; /* success */ - slapi_log_error(SLAPI_LOG_PLUGIN, POSIX_WINSYNC_PLUGIN_NAME, + slapi_log_err(SLAPI_LOG_PLUGIN, POSIX_WINSYNC_PLUGIN_NAME, "<-- posix_winsync_apply_config: config evaluated\n"); *returncode = LDAP_SUCCESS; diff --git a/ldap/servers/plugins/posix-winsync/posix-winsync.c b/ldap/servers/plugins/posix-winsync/posix-winsync.c index 6372bed..a7e024d 100644 --- a/ldap/servers/plugins/posix-winsync/posix-winsync.c +++ b/ldap/servers/plugins/posix-winsync/posix-winsync.c @@ -165,7 +165,7 @@ _check_account_lock(Slapi_Entry *ds_entry, int *isvirt) rc = 0; /* account is disabled */ } slapi_ch_free_string(&strval); - slapi_log_error(SLAPI_LOG_PLUGIN, posix_winsync_plugin_name, + slapi_log_err(SLAPI_LOG_PLUGIN, posix_winsync_plugin_name, "<-- _check_account_lock - entry [%s] has real " "attribute nsAccountLock and entry %s locked\n", slapi_entry_get_dn_const(ds_entry), rc ? "is not" : "is"); @@ -194,13 +194,13 @@ _check_account_lock(Slapi_Entry *ds_entry, int *isvirt) if (values != NULL) { slapi_vattr_values_free(&values, &actual_type_name, attr_free_flags); } - slapi_log_error(SLAPI_LOG_PLUGIN, posix_winsync_plugin_name, + slapi_log_err(SLAPI_LOG_PLUGIN, posix_winsync_plugin_name, "<-- _check_account_lock - entry [%s] has virtual " "attribute nsAccountLock and entry %s locked\n", slapi_entry_get_dn_const(ds_entry), rc ? "is not" : "is"); } else { rc = 1; /* no attr == entry is enabled */ - slapi_log_error(SLAPI_LOG_PLUGIN, posix_winsync_plugin_name, + slapi_log_err(SLAPI_LOG_PLUGIN, posix_winsync_plugin_name, "<-- _check_account_lock - entry [%s] does not " "have attribute nsAccountLock - entry is not locked\n", slapi_entry_get_dn_const(ds_entry)); @@ -242,7 +242,7 @@ sync_acct_disable(void *cbdata, /* the usual domain config data */ ds_is_enabled = 0; } if (isvirt) - slapi_log_error(SLAPI_LOG_PLUGIN, posix_winsync_plugin_name, + slapi_log_err(SLAPI_LOG_PLUGIN, posix_winsync_plugin_name, "<-- sync_acct_disable - %s DS nsaccountlock is virtual!!!!\n", slapi_entry_get_dn_const(ds_entry)); /* get the account lock state of the ad entry */ @@ -269,7 +269,7 @@ sync_acct_disable(void *cbdata, /* the usual domain config data */ } if (update_entry) { slapi_entry_attr_set_ulong(update_entry, "userAccountControl", adval); - slapi_log_error(SLAPI_LOG_PLUGIN, posix_winsync_plugin_name, + slapi_log_err(SLAPI_LOG_PLUGIN, posix_winsync_plugin_name, "<-- sync_acct_disable - %s AD account [%s] - " "new value is [%ld]\n", (ds_is_enabled) ? "enabled" : "disabled", slapi_entry_get_dn_const(update_entry), adval); @@ -326,7 +326,7 @@ sync_acct_disable(void *cbdata, /* the usual domain config data */ mod_bval->bv_val = slapi_ch_strdup(acctvalstr); mod_bval->bv_len = strlen(acctvalstr); } - slapi_log_error(SLAPI_LOG_PLUGIN, posix_winsync_plugin_name, + slapi_log_err(SLAPI_LOG_PLUGIN, posix_winsync_plugin_name, "<-- sync_acct_disable - %s AD account [%s] - " "new value is [%ld]\n", (ds_is_enabled) ? "enabled" : "disabled", slapi_entry_get_dn_const(ad_entry), adval); @@ -353,7 +353,7 @@ sync_acct_disable(void *cbdata, /* the usual domain config data */ if (update_entry) { slapi_entry_attr_set_charptr(update_entry, attrtype, attrval); - slapi_log_error(SLAPI_LOG_PLUGIN, posix_winsync_plugin_name, + slapi_log_err(SLAPI_LOG_PLUGIN, posix_winsync_plugin_name, "<-- sync_acct_disable - %s DS account [%s]\n", (ad_is_enabled) ? "enable" : "disable", slapi_entry_get_dn_const(ds_entry)); } else { /* do mod */ @@ -373,7 +373,7 @@ sync_acct_disable(void *cbdata, /* the usual domain config data */ slapi_mods_add_ldapmod(smods, slapi_mod_get_ldapmod_passout(smod)); slapi_mod_free(&smod); - slapi_log_error(SLAPI_LOG_PLUGIN, posix_winsync_plugin_name, + slapi_log_err(SLAPI_LOG_PLUGIN, posix_winsync_plugin_name, "<-- sync_acct_disable - %s DS account [%s]\n", (ad_is_enabled) ? "enable" : "disable", slapi_entry_get_dn_const(ds_entry)); if (do_modify) { @@ -465,7 +465,7 @@ getNisDomainName(const Slapi_Entry *ds_entry) Slapi_Entry *entry = NULL; int rc = -1; - slapi_log_error(SLAPI_LOG_PLUGIN, posix_winsync_plugin_name, "getNisDomainName start DN:%s\n", + slapi_log_err(SLAPI_LOG_PLUGIN, posix_winsync_plugin_name, "getNisDomainName start DN:%s\n", slapi_sdn_get_dn(entry_sdn)); /* search NIS domain name */ slapi_sdn_get_parent(entry_sdn, subtree_sdn); @@ -484,7 +484,7 @@ getNisDomainName(const Slapi_Entry *ds_entry) if (rc == 0 && entry) { nisdomainname = slapi_entry_attr_get_charptr(entry, type_NisDomain); if (nisdomainname != NULL){ - slapi_log_error(SLAPI_LOG_PLUGIN, posix_winsync_plugin_name, + slapi_log_err(SLAPI_LOG_PLUGIN, posix_winsync_plugin_name, "getNisDomainName NisDomain %s found in DN:%s\n", nisdomainname, slapi_sdn_get_dn(childparent)); break; @@ -492,7 +492,7 @@ getNisDomainName(const Slapi_Entry *ds_entry) } } slapi_sdn_copy(childparent, subtree_sdn); - slapi_log_error(SLAPI_LOG_PLUGIN, posix_winsync_plugin_name, + slapi_log_err(SLAPI_LOG_PLUGIN, posix_winsync_plugin_name, "getNisDomainName iterate DN:%s\n", slapi_sdn_get_dn(subtree_sdn)); slapi_entry_free(entry); entry = NULL; @@ -500,7 +500,7 @@ getNisDomainName(const Slapi_Entry *ds_entry) slapi_pblock_destroy(pb); if (rc != 0 || nisdomainname == NULL ) { - slapi_log_error(SLAPI_LOG_REPL, posix_winsync_plugin_name, + slapi_log_err(SLAPI_LOG_REPL, posix_winsync_plugin_name, "getNisDomainName: no nisdomainname found in %s, LDAP Err%d\n", slapi_sdn_get_dn(subtree_sdn), rc); } @@ -518,7 +518,7 @@ addNisDomainName(Slapi_Mod *smod, const Slapi_Entry *ds_entry) char* nisdomainname = getNisDomainName(ds_entry); if ( nisdomainname == NULL ) { - slapi_log_error(SLAPI_LOG_PLUGIN, posix_winsync_plugin_name, + slapi_log_err(SLAPI_LOG_PLUGIN, posix_winsync_plugin_name, "addNisDomainName NisDomain not found\n"); rc = LDAP_NO_SUCH_ATTRIBUTE; } else { @@ -533,7 +533,7 @@ addNisDomainName(Slapi_Mod *smod, const Slapi_Entry *ds_entry) if (slapi_is_loglevel_set(SLAPI_LOG_PLUGIN)) slapi_mod_dump((LDAPMod*) slapi_mod_get_ldapmod_byref(smod), 0); - slapi_log_error(SLAPI_LOG_PLUGIN, posix_winsync_plugin_name, + slapi_log_err(SLAPI_LOG_PLUGIN, posix_winsync_plugin_name, "addNisDomainName NisDomain %s found\n", nisdomainname); slapi_ch_free_string(&nisdomainname); /* allocated by slapi_entry_attr_getchrptr */ } @@ -544,10 +544,10 @@ static void posix_winsync_dirsync_search_params_cb(void *cbdata, const char *agmt_dn, char **base, int *scope, char **filter, char ***attrs, LDAPControl ***serverctrls) { - slapi_log_error(SLAPI_LOG_PLUGIN, posix_winsync_plugin_name, + slapi_log_err(SLAPI_LOG_PLUGIN, posix_winsync_plugin_name, "--> posix_winsync_dirsync_search_params_cb -- begin\n"); - slapi_log_error(SLAPI_LOG_PLUGIN, posix_winsync_plugin_name, + slapi_log_err(SLAPI_LOG_PLUGIN, posix_winsync_plugin_name, "<-- posix_winsync_dirsync_search_params_cb -- end\n"); return; @@ -558,10 +558,10 @@ static void posix_winsync_pre_ad_search_cb(void *cbdata, const char *agmt_dn, char **base, int *scope, char **filter, char ***attrs, LDAPControl ***serverctrls) { - slapi_log_error(SLAPI_LOG_PLUGIN, posix_winsync_plugin_name, + slapi_log_err(SLAPI_LOG_PLUGIN, posix_winsync_plugin_name, "--> posix_winsync_pre_ad_search_cb -- begin\n"); - slapi_log_error(SLAPI_LOG_PLUGIN, posix_winsync_plugin_name, + slapi_log_err(SLAPI_LOG_PLUGIN, posix_winsync_plugin_name, "<-- posix_winsync_pre_ad_search_cb -- end\n"); return; @@ -578,7 +578,7 @@ posix_winsync_pre_ds_search_entry_cb(void *cbdata, const char *agmt_dn, char **b char *s = tmpbase; int i=0; */ - slapi_log_error(SLAPI_LOG_PLUGIN, posix_winsync_plugin_name, "--> _pre_ds_search_cb -- begin\n"); + slapi_log_err(SLAPI_LOG_PLUGIN, posix_winsync_plugin_name, "--> _pre_ds_search_cb -- begin\n"); /* skip the first subtree container ou=xyz, */ /* if (strlen(*base) > 3) { s++; @@ -595,11 +595,11 @@ posix_winsync_pre_ds_search_entry_cb(void *cbdata, const char *agmt_dn, char **b } } */ - slapi_log_error(SLAPI_LOG_PLUGIN, posix_winsync_plugin_name, + slapi_log_err(SLAPI_LOG_PLUGIN, posix_winsync_plugin_name, "-- _pre_ds_search_cb - base [%s] " "scope [%d] filter [%s]\n", *base, *scope, *filter); /* slapi_ch_free_string(&tmpbase); */ - slapi_log_error(SLAPI_LOG_PLUGIN, posix_winsync_plugin_name, "<-- _pre_ds_search_cb -- end\n"); + slapi_log_err(SLAPI_LOG_PLUGIN, posix_winsync_plugin_name, "<-- _pre_ds_search_cb -- end\n"); return; } @@ -608,14 +608,14 @@ static void posix_winsync_pre_ds_search_all_cb(void *cbdata, const char *agmt_dn, char **base, int *scope, char **filter, char ***attrs, LDAPControl ***serverctrls) { - slapi_log_error(SLAPI_LOG_PLUGIN, posix_winsync_plugin_name, + slapi_log_err(SLAPI_LOG_PLUGIN, posix_winsync_plugin_name, "--> posix_winsync_pre_ds_search_all_cb -- orig filter [%s] -- begin\n", ((filter && *filter) ? *filter : "NULL")); /* slapi_ch_free_string(filter); *filter = slapi_ch_strdup("(|(objectclass=posixaccount)(objectclass=posixgroup))"); */ - slapi_log_error(SLAPI_LOG_PLUGIN, posix_winsync_plugin_name, + slapi_log_err(SLAPI_LOG_PLUGIN, posix_winsync_plugin_name, "<-- posix_winsync_pre_ds_search_all_cb -- end\n"); return; @@ -636,7 +636,7 @@ posix_winsync_pre_ad_mod_user_cb(void *cbdata, const Slapi_Entry *rawentry, Slap return; } - slapi_log_error(SLAPI_LOG_PLUGIN, posix_winsync_plugin_name, + slapi_log_err(SLAPI_LOG_PLUGIN, posix_winsync_plugin_name, "--> posix_winsync_pre_ad_mod_user_cb -- begin DS account [%s]\n", slapi_entry_get_dn_const(ds_entry)); if (posix_winsync_config_get_msSFUSchema()) { @@ -651,7 +651,7 @@ posix_winsync_pre_ad_mod_user_cb(void *cbdata, const Slapi_Entry *rawentry, Slap size_t i = 0; slapi_attr_get_type(attr, &type); - slapi_log_error(SLAPI_LOG_PLUGIN, posix_winsync_plugin_name, + slapi_log_err(SLAPI_LOG_PLUGIN, posix_winsync_plugin_name, "_pre_ad_mod_user_cb -- check modify type %s\n", type); for (; attr_map[i].windows_attribute_name != NULL; i++) { if (0 == slapi_attr_type_cmp(type, attr_map[i].ldap_attribute_name, @@ -669,7 +669,7 @@ posix_winsync_pre_ad_mod_user_cb(void *cbdata, const Slapi_Entry *rawentry, Slap int values_equal = 0; values_equal = attr_compare_equal(attr, ad_attr); if (!values_equal) { - slapi_log_error(SLAPI_LOG_PLUGIN, + slapi_log_err(SLAPI_LOG_PLUGIN, posix_winsync_plugin_name, "_pre_ad_mod_user_cb -- update mods: %s, %s : values are different -> modify\n", slapi_sdn_get_dn(slapi_entry_get_sdn_const(ds_entry)), @@ -693,7 +693,7 @@ posix_winsync_pre_ad_mod_user_cb(void *cbdata, const Slapi_Entry *rawentry, Slap slapi_ch_free((void**) &ad_type); slapi_valueset_free(vs); - slapi_log_error(SLAPI_LOG_PLUGIN, posix_winsync_plugin_name, + slapi_log_err(SLAPI_LOG_PLUGIN, posix_winsync_plugin_name, "_pre_ad_mod_user_cb -- add modify %s DS account [%s]\n", attr_map[i].windows_attribute_name, slapi_entry_get_dn_const(ds_entry)); @@ -710,7 +710,7 @@ posix_winsync_pre_ad_mod_user_cb(void *cbdata, const Slapi_Entry *rawentry, Slap } } plugin_op_finished(); - slapi_log_error(SLAPI_LOG_PLUGIN, posix_winsync_plugin_name, + slapi_log_err(SLAPI_LOG_PLUGIN, posix_winsync_plugin_name, "<-- posix_winsync_pre_ad_mod_user_cb -- end\n"); return; @@ -734,7 +734,7 @@ posix_winsync_pre_ad_mod_group_cb(void *cbdata, const Slapi_Entry *rawentry, Sla if (posix_winsync_config_get_msSFUSchema()) attr_map = group_mssfu_attribute_map; - slapi_log_error(SLAPI_LOG_PLUGIN, posix_winsync_plugin_name, + slapi_log_err(SLAPI_LOG_PLUGIN, posix_winsync_plugin_name, "--> _pre_ad_mod_group_cb -- begin DS account [%s]\n", slapi_entry_get_dn_const(ds_entry)); @@ -745,7 +745,7 @@ posix_winsync_pre_ad_mod_group_cb(void *cbdata, const Slapi_Entry *rawentry, Sla size_t i = 0; slapi_attr_get_type(attr, &type); - slapi_log_error(SLAPI_LOG_PLUGIN, posix_winsync_plugin_name, + slapi_log_err(SLAPI_LOG_PLUGIN, posix_winsync_plugin_name, "_pre_ad_mod_group_cb -- check modify type %s\n", type); for (; attr_map[i].windows_attribute_name != NULL; i++) { if (0 == slapi_attr_type_cmp(type, attr_map[i].ldap_attribute_name, @@ -791,7 +791,7 @@ posix_winsync_pre_ad_mod_group_cb(void *cbdata, const Slapi_Entry *rawentry, Sla int values_equal = 0; values_equal = attr_compare_equal(attr, ad_attr); if (!values_equal) { - slapi_log_error(SLAPI_LOG_PLUGIN, + slapi_log_err(SLAPI_LOG_PLUGIN, posix_winsync_plugin_name, "_pre_ad_mod_group_cb -- update mods: %s, %s : values are different -> modify\n", slapi_sdn_get_dn(slapi_entry_get_sdn_const(ds_entry)), @@ -815,21 +815,21 @@ posix_winsync_pre_ad_mod_group_cb(void *cbdata, const Slapi_Entry *rawentry, Sla slapi_ch_free((void**) &ad_type); slapi_valueset_free(vs); - slapi_log_error(SLAPI_LOG_PLUGIN, posix_winsync_plugin_name, + slapi_log_err(SLAPI_LOG_PLUGIN, posix_winsync_plugin_name, "_pre_ad_mod_group_cb -- add modify %s DS account [%s]\n", attr_map[i].windows_attribute_name, slapi_entry_get_dn_const(ds_entry)); } } } - slapi_log_error(SLAPI_LOG_PLUGIN, posix_winsync_plugin_name, "_pre_ad_mod_group_cb -- step\n"); + slapi_log_err(SLAPI_LOG_PLUGIN, posix_winsync_plugin_name, "_pre_ad_mod_group_cb -- step\n"); if (slapi_is_loglevel_set(SLAPI_LOG_PLUGIN)) { for (mod = slapi_mods_get_first_mod(smods); mod; mod = slapi_mods_get_next_mod(smods)) { slapi_mod_dump(mod, 0); } } plugin_op_finished(); - slapi_log_error(SLAPI_LOG_PLUGIN, posix_winsync_plugin_name, + slapi_log_err(SLAPI_LOG_PLUGIN, posix_winsync_plugin_name, "<-- _pre_ad_mod_group_cb -- end\n"); return; @@ -854,11 +854,11 @@ posix_winsync_pre_ds_mod_user_cb(void *cbdata, const Slapi_Entry *rawentry, Slap return; } - slapi_log_error(SLAPI_LOG_PLUGIN, posix_winsync_plugin_name, + slapi_log_err(SLAPI_LOG_PLUGIN, posix_winsync_plugin_name, "--> _pre_ds_mod_user_cb -- begin\n"); if ((NULL == ad_entry) || (NULL == ds_entry)) { - slapi_log_error(SLAPI_LOG_PLUGIN, posix_winsync_plugin_name, + slapi_log_err(SLAPI_LOG_PLUGIN, posix_winsync_plugin_name, "<-- _pre_ds_mod_user_cb -- Empty %s entry.\n", (NULL==ad_entry)?"ad entry":"ds entry"); plugin_op_finished(); @@ -880,7 +880,7 @@ posix_winsync_pre_ds_mod_user_cb(void *cbdata, const Slapi_Entry *rawentry, Slap &pa_attr)) { /* required attribute does not exist */ posixval = PR_FALSE; - slapi_log_error(SLAPI_LOG_PLUGIN, posix_winsync_plugin_name, + slapi_log_err(SLAPI_LOG_PLUGIN, posix_winsync_plugin_name, "AD entry %s does not have required attribute %s for posixAccount objectclass.\n", slapi_entry_get_dn_const(ad_entry), attr_map[i].ldap_attribute_name); @@ -912,7 +912,7 @@ posix_winsync_pre_ds_mod_user_cb(void *cbdata, const Slapi_Entry *rawentry, Slap posixval = PR_TRUE; values_equal = attr_compare_equal(attr, local_attr); if (!values_equal) { - slapi_log_error(SLAPI_LOG_PLUGIN, posix_winsync_plugin_name, + slapi_log_err(SLAPI_LOG_PLUGIN, posix_winsync_plugin_name, "_pre_ds_mod_user_cb -- update mods: %s, %s : values are different -> modify\n", slapi_sdn_get_dn(slapi_entry_get_sdn_const(ds_entry)), local_type); @@ -933,7 +933,7 @@ posix_winsync_pre_ds_mod_user_cb(void *cbdata, const Slapi_Entry *rawentry, Slap } } } - slapi_log_error(SLAPI_LOG_PLUGIN, posix_winsync_plugin_name, + slapi_log_err(SLAPI_LOG_PLUGIN, posix_winsync_plugin_name, "<-- _pre_ds_mod_user_cb present %d modify %d isPosixaccount %s\n", is_present_local, do_modify_local, posixval?"yes":"no"); @@ -953,7 +953,7 @@ posix_winsync_pre_ds_mod_user_cb(void *cbdata, const Slapi_Entry *rawentry, Slap slapi_attr_get_valueset(oc_attr, &oc_vs); slapi_value_init_string(oc_nv, "posixAccount"); slapi_valueset_add_value(oc_vs, oc_nv); - slapi_log_error(SLAPI_LOG_PLUGIN, posix_winsync_plugin_name, + slapi_log_err(SLAPI_LOG_PLUGIN, posix_winsync_plugin_name, "<-- _pre_ds_mod_user_cb add oc:posixAccount\n"); slapi_value_init_string(voc, "shadowAccount"); @@ -962,7 +962,7 @@ posix_winsync_pre_ds_mod_user_cb(void *cbdata, const Slapi_Entry *rawentry, Slap slapi_value_init_string(oc_nv, "shadowAccount"); slapi_valueset_add_value(oc_vs, oc_nv); - slapi_log_error(SLAPI_LOG_PLUGIN, posix_winsync_plugin_name, + slapi_log_err(SLAPI_LOG_PLUGIN, posix_winsync_plugin_name, "<-- _pre_ds_mod_user_cb add oc:shadowAccount\n"); } slapi_mods_add_mod_values(smods, LDAP_MOD_REPLACE, "objectClass", @@ -980,7 +980,7 @@ posix_winsync_pre_ds_mod_user_cb(void *cbdata, const Slapi_Entry *rawentry, Slap slapi_value_free(&voc); } sync_acct_disable(cbdata, ad_entry, ds_entry, ACCT_DISABLE_TO_DS, NULL, smods, do_modify); - slapi_log_error(SLAPI_LOG_PLUGIN, posix_winsync_plugin_name, "<-- _pre_ds_mod_user_cb %s %s\n", + slapi_log_err(SLAPI_LOG_PLUGIN, posix_winsync_plugin_name, "<-- _pre_ds_mod_user_cb %s %s\n", slapi_sdn_get_dn(slapi_entry_get_sdn_const(ds_entry)), (do_modify) ? "modified" : "not modified"); @@ -990,7 +990,7 @@ posix_winsync_pre_ds_mod_user_cb(void *cbdata, const Slapi_Entry *rawentry, Slap } } plugin_op_finished(); - slapi_log_error(SLAPI_LOG_PLUGIN, posix_winsync_plugin_name, "<-- _pre_ds_mod_user_cb -- end\n"); + slapi_log_err(SLAPI_LOG_PLUGIN, posix_winsync_plugin_name, "<-- _pre_ds_mod_user_cb -- end\n"); return; } @@ -1015,7 +1015,7 @@ posix_winsync_pre_ds_mod_group_cb(void *cbdata, const Slapi_Entry *rawentry, Sla if (posix_winsync_config_get_msSFUSchema()) attr_map = group_mssfu_attribute_map; - slapi_log_error(SLAPI_LOG_PLUGIN, posix_winsync_plugin_name, + slapi_log_err(SLAPI_LOG_PLUGIN, posix_winsync_plugin_name, "--> _pre_ds_mod_group_cb -- begin\n"); /* in the ad to ds case we have no changelog, so we have to compare the entries */ for (rc = slapi_entry_first_attr(ad_entry, &attr); rc == 0; rc @@ -1031,7 +1031,7 @@ posix_winsync_pre_ds_mod_group_cb(void *cbdata, const Slapi_Entry *rawentry, Sla Slapi_Attr *local_attr = NULL; char *local_type = NULL; - slapi_log_error(SLAPI_LOG_PLUGIN, posix_winsync_plugin_name, + slapi_log_err(SLAPI_LOG_PLUGIN, posix_winsync_plugin_name, "_pre_ds_mod_group_cb -- found AD attr %s\n", type); slapi_attr_get_valueset(attr, &vs); local_type = slapi_ch_strdup(attr_map[i].ldap_attribute_name); @@ -1039,11 +1039,11 @@ posix_winsync_pre_ds_mod_group_cb(void *cbdata, const Slapi_Entry *rawentry, Sla is_present_local = (NULL == local_attr) ? 0 : 1; if (is_present_local) { int values_equal = 0; - slapi_log_error(SLAPI_LOG_PLUGIN, posix_winsync_plugin_name, + slapi_log_err(SLAPI_LOG_PLUGIN, posix_winsync_plugin_name, "_pre_ds_mod_group_cb -- compare with DS attr %s\n", local_type); values_equal = attr_compare_equal(attr, local_attr); if (!values_equal) { - slapi_log_error(SLAPI_LOG_PLUGIN, posix_winsync_plugin_name, + slapi_log_err(SLAPI_LOG_PLUGIN, posix_winsync_plugin_name, "_pre_ds_mod_group_cb -- update mods: %s, %s : values are different -> modify\n", slapi_sdn_get_dn(slapi_entry_get_sdn_const(ds_entry)), local_type); @@ -1053,14 +1053,14 @@ posix_winsync_pre_ds_mod_group_cb(void *cbdata, const Slapi_Entry *rawentry, Sla *do_modify = 1; } } else { - slapi_log_error(SLAPI_LOG_PLUGIN, posix_winsync_plugin_name, + slapi_log_err(SLAPI_LOG_PLUGIN, posix_winsync_plugin_name, "_pre_ds_mod_group_cb -- add attr\n"); slapi_mods_add_mod_values(smods, LDAP_MOD_ADD, local_type, valueset_get_valuearray(vs)); *do_modify = do_modify_local = 1; } - slapi_log_error(SLAPI_LOG_PLUGIN, posix_winsync_plugin_name, + slapi_log_err(SLAPI_LOG_PLUGIN, posix_winsync_plugin_name, "_pre_ds_mod_group_cb -- values compared\n"); slapi_ch_free((void**) &local_type); @@ -1069,11 +1069,11 @@ posix_winsync_pre_ds_mod_group_cb(void *cbdata, const Slapi_Entry *rawentry, Sla } } } - slapi_log_error(SLAPI_LOG_PLUGIN, posix_winsync_plugin_name, + slapi_log_err(SLAPI_LOG_PLUGIN, posix_winsync_plugin_name, "_pre_ds_mod_group_cb present %d modify %d before\n", is_present_local, do_modify_local); - slapi_log_error(SLAPI_LOG_PLUGIN, posix_winsync_plugin_name, + slapi_log_err(SLAPI_LOG_PLUGIN, posix_winsync_plugin_name, "_pre_ds_mod_group_cb present %d modify %d\n", is_present_local, do_modify_local); @@ -1090,7 +1090,7 @@ posix_winsync_pre_ds_mod_group_cb(void *cbdata, const Slapi_Entry *rawentry, Sla slapi_attr_get_valueset(oc_attr, &oc_vs); slapi_value_init_string(oc_nv, "posixGroup"); slapi_valueset_add_value(oc_vs, oc_nv); - slapi_log_error(SLAPI_LOG_PLUGIN, posix_winsync_plugin_name, + slapi_log_err(SLAPI_LOG_PLUGIN, posix_winsync_plugin_name, "_pre_ds_mod_group_cb add oc:posixGroup\n"); slapi_mods_add_mod_values(smods, LDAP_MOD_REPLACE, "objectClass", valueset_get_valuearray(oc_vs)); @@ -1105,14 +1105,14 @@ posix_winsync_pre_ds_mod_group_cb(void *cbdata, const Slapi_Entry *rawentry, Sla memberUidUnlock(); } - slapi_log_error(SLAPI_LOG_PLUGIN, posix_winsync_plugin_name, "_pre_ds_mod_group_cb step\n"); + slapi_log_err(SLAPI_LOG_PLUGIN, posix_winsync_plugin_name, "_pre_ds_mod_group_cb step\n"); if (slapi_is_loglevel_set(SLAPI_LOG_PLUGIN)) { for (mod = slapi_mods_get_first_mod(smods); mod; mod = slapi_mods_get_next_mod(smods)) { slapi_mod_dump(mod, 0); } } plugin_op_finished(); - slapi_log_error(SLAPI_LOG_PLUGIN, posix_winsync_plugin_name, + slapi_log_err(SLAPI_LOG_PLUGIN, posix_winsync_plugin_name, "<-- _pre_ds_mod_group_cb -- end\n"); return; @@ -1138,7 +1138,7 @@ posix_winsync_pre_ds_add_user_cb(void *cbdata, const Slapi_Entry *rawentry, Slap attr_map = user_mssfu_attribute_map; /* add objectclass: posixAccount, uidnumber, gidnumber, homeDirectory, loginShell */ - slapi_log_error(SLAPI_LOG_PLUGIN, posix_winsync_plugin_name, + slapi_log_err(SLAPI_LOG_PLUGIN, posix_winsync_plugin_name, "--> _pre_ds_add_user_cb -- begin\n"); /* check all of the required attributes are in the ad_entry: @@ -1153,7 +1153,7 @@ posix_winsync_pre_ds_add_user_cb(void *cbdata, const Slapi_Entry *rawentry, Slap &pa_attr)) { /* required attribute does not exist */ posixval = PR_FALSE; - slapi_log_error(SLAPI_LOG_PLUGIN, posix_winsync_plugin_name, + slapi_log_err(SLAPI_LOG_PLUGIN, posix_winsync_plugin_name, "AD entry %s does not have required attribute %s for posixAccount objectclass.\n", slapi_entry_get_dn_const(ad_entry), attr_map[i].ldap_attribute_name); @@ -1172,7 +1172,7 @@ posix_winsync_pre_ds_add_user_cb(void *cbdata, const Slapi_Entry *rawentry, Slap continue; } - slapi_log_error(SLAPI_LOG_PLUGIN, posix_winsync_plugin_name, + slapi_log_err(SLAPI_LOG_PLUGIN, posix_winsync_plugin_name, "--> _pre_ds_add_user_cb -- " "look for [%s] to new entry [%s]\n", type, slapi_entry_get_dn_const(ds_entry)); @@ -1185,7 +1185,7 @@ posix_winsync_pre_ds_add_user_cb(void *cbdata, const Slapi_Entry *rawentry, Slap attr_map[i].ldap_attribute_name, svs); slapi_valueset_free(svs); - slapi_log_error(SLAPI_LOG_PLUGIN, posix_winsync_plugin_name, + slapi_log_err(SLAPI_LOG_PLUGIN, posix_winsync_plugin_name, "--> _pre_ds_add_user_cb -- " "adding val for [%s] to new entry [%s]\n", type, slapi_entry_get_dn_const(ds_entry)); @@ -1196,7 +1196,7 @@ posix_winsync_pre_ds_add_user_cb(void *cbdata, const Slapi_Entry *rawentry, Slap rc |= slapi_entry_add_string(ds_entry, "objectClass", "shadowAccount"); rc |= slapi_entry_add_string(ds_entry, "objectClass", "inetUser"); if (rc != 0) { - slapi_log_error(SLAPI_LOG_PLUGIN, posix_winsync_plugin_name, + slapi_log_err(SLAPI_LOG_PLUGIN, posix_winsync_plugin_name, "<-- _pre_ds_add_user_cb -- adding objectclass for new entry failed %d\n", rc); } else { @@ -1209,7 +1209,7 @@ posix_winsync_pre_ds_add_user_cb(void *cbdata, const Slapi_Entry *rawentry, Slap } sync_acct_disable(cbdata, ad_entry, ds_entry, ACCT_DISABLE_TO_DS, ds_entry, NULL, NULL); plugin_op_finished(); - slapi_log_error(SLAPI_LOG_PLUGIN, posix_winsync_plugin_name, "<-- _pre_ds_add_user_cb -- end\n"); + slapi_log_err(SLAPI_LOG_PLUGIN, posix_winsync_plugin_name, "<-- _pre_ds_add_user_cb -- end\n"); return; } @@ -1232,7 +1232,7 @@ posix_winsync_pre_ds_add_group_cb(void *cbdata, const Slapi_Entry *rawentry, Sla if (posix_winsync_config_get_msSFUSchema()) attr_map = group_mssfu_attribute_map; - slapi_log_error(SLAPI_LOG_PLUGIN, posix_winsync_plugin_name, + slapi_log_err(SLAPI_LOG_PLUGIN, posix_winsync_plugin_name, "--> posix_winsync_pre_ds_add_group_cb -- begin\n"); for (slapi_entry_first_attr(ad_entry, &attr); attr; slapi_entry_next_attr(ad_entry, attr, &attr)) { @@ -1243,7 +1243,7 @@ posix_winsync_pre_ds_add_group_cb(void *cbdata, const Slapi_Entry *rawentry, Sla continue; } - slapi_log_error(SLAPI_LOG_PLUGIN, posix_winsync_plugin_name, "--> _pre_ds_add_group_cb -- " + slapi_log_err(SLAPI_LOG_PLUGIN, posix_winsync_plugin_name, "--> _pre_ds_add_group_cb -- " "look for [%s] to new entry [%s]\n", type, slapi_entry_get_dn_const(ds_entry)); for (i = 0; attr_map && attr_map[i].windows_attribute_name != NULL; i++) { if (slapi_attr_type_cmp(attr_map[i].windows_attribute_name, type, @@ -1253,7 +1253,7 @@ posix_winsync_pre_ds_add_group_cb(void *cbdata, const Slapi_Entry *rawentry, Sla slapi_entry_add_valueset(ds_entry, attr_map[i].ldap_attribute_name, svs); slapi_valueset_free(svs); - slapi_log_error(SLAPI_LOG_PLUGIN, posix_winsync_plugin_name, + slapi_log_err(SLAPI_LOG_PLUGIN, posix_winsync_plugin_name, "--> _pre_ds_add_group_cb -- " "adding val for [%s] to new entry [%s]\n", type, slapi_entry_get_dn_const(ds_entry)); @@ -1265,7 +1265,7 @@ posix_winsync_pre_ds_add_group_cb(void *cbdata, const Slapi_Entry *rawentry, Sla int rc; rc = slapi_entry_add_string(ds_entry, "objectClass", "posixGroup"); if (rc != 0) { - slapi_log_error(SLAPI_LOG_PLUGIN, posix_winsync_plugin_name, + slapi_log_err(SLAPI_LOG_PLUGIN, posix_winsync_plugin_name, "<-- _pre_ds_add_group_cb -- adding objectclass for new entry failed %d\n", rc); } @@ -1276,7 +1276,7 @@ posix_winsync_pre_ds_add_group_cb(void *cbdata, const Slapi_Entry *rawentry, Sla memberUidUnlock(); } plugin_op_finished(); - slapi_log_error(SLAPI_LOG_PLUGIN, posix_winsync_plugin_name, + slapi_log_err(SLAPI_LOG_PLUGIN, posix_winsync_plugin_name, "<-- posix_winsync_pre_ds_add_group_cb -- end\n"); return; @@ -1287,11 +1287,11 @@ posix_winsync_get_new_ds_user_dn_cb(void *cbdata, const Slapi_Entry *rawentry, Slapi_Entry *ad_entry, char **new_dn_string, const Slapi_DN *ds_suffix, const Slapi_DN *ad_suffix) { - slapi_log_error(SLAPI_LOG_PLUGIN, posix_winsync_plugin_name, + slapi_log_err(SLAPI_LOG_PLUGIN, posix_winsync_plugin_name, "--> posix_winsync_get_new_ds_user_dn_cb -- old dn [%s] -- begin\n", *new_dn_string); - slapi_log_error(SLAPI_LOG_PLUGIN, posix_winsync_plugin_name, + slapi_log_err(SLAPI_LOG_PLUGIN, posix_winsync_plugin_name, "<-- posix_winsync_get_new_ds_user_dn_cb -- new dn [%s] -- end\n", *new_dn_string); @@ -1303,10 +1303,10 @@ posix_winsync_get_new_ds_group_dn_cb(void *cbdata, const Slapi_Entry *rawentry, Slapi_Entry *ad_entry, char **new_dn_string, const Slapi_DN *ds_suffix, const Slapi_DN *ad_suffix) { - slapi_log_error(SLAPI_LOG_PLUGIN, posix_winsync_plugin_name, + slapi_log_err(SLAPI_LOG_PLUGIN, posix_winsync_plugin_name, "--> posix_winsync_get_new_ds_group_dn_cb -- begin\n"); - slapi_log_error(SLAPI_LOG_PLUGIN, posix_winsync_plugin_name, + slapi_log_err(SLAPI_LOG_PLUGIN, posix_winsync_plugin_name, "<-- posix_winsync_get_new_ds_group_dn_cb -- end\n"); return; @@ -1334,7 +1334,7 @@ posix_winsync_pre_ad_mod_user_mods_cb(void *cbdata, const Slapi_Entry *rawentry, attr_map = user_mssfu_attribute_map; /* mod if changed objectclass: posixAccount, uidnumber, gidnumber, homeDirectory, loginShell */ - slapi_log_error(SLAPI_LOG_PLUGIN, posix_winsync_plugin_name, + slapi_log_err(SLAPI_LOG_PLUGIN, posix_winsync_plugin_name, "--> _pre_ad_mod_user_mods_cb -- begin DS account [%s] \n", slapi_entry_get_dn_const(ds_entry)); @@ -1344,7 +1344,7 @@ posix_winsync_pre_ad_mod_user_mods_cb(void *cbdata, const Slapi_Entry *rawentry, for (mod = slapi_mods_get_first_mod(smods); mod; mod = slapi_mods_get_next_mod(smods)) { size_t i = 0; - slapi_log_error(SLAPI_LOG_PLUGIN, posix_winsync_plugin_name, + slapi_log_err(SLAPI_LOG_PLUGIN, posix_winsync_plugin_name, "_pre_ad_mod_user_mods_cb -- check modify type %s\n", mod->mod_type); for (; attr_map[i].windows_attribute_name != NULL; i++) { if (0 == slapi_attr_type_cmp(mod->mod_type, attr_map[i].ldap_attribute_name, @@ -1354,13 +1354,13 @@ posix_winsync_pre_ad_mod_user_mods_cb(void *cbdata, const Slapi_Entry *rawentry, slapi_mod_set_type(mysmod, attr_map[i].windows_attribute_name); slapi_mods_add_ldapmod(new_smods, slapi_mod_get_ldapmod_passout(mysmod)); slapi_mod_free(&mysmod); - slapi_log_error(SLAPI_LOG_PLUGIN, posix_winsync_plugin_name, + slapi_log_err(SLAPI_LOG_PLUGIN, posix_winsync_plugin_name, "_pre_ad_mod_user_mods_cb -- add modify %s DS account [%s]\n", attr_map[i].windows_attribute_name, slapi_entry_get_dn_const(ds_entry)); if (0 == slapi_attr_type_cmp(mod->mod_type, "uidNumber", SLAPI_TYPE_CMP_SUBTYPE)) { Slapi_Mod *ocsmod = slapi_mod_new(); - slapi_log_error(SLAPI_LOG_PLUGIN, posix_winsync_plugin_name, + slapi_log_err(SLAPI_LOG_PLUGIN, posix_winsync_plugin_name, "_pre_ad_mod_user_mods_cb -- add NisDomain\n"); addNisDomainName(ocsmod, ds_entry); slapi_mods_add_ldapmod(new_smods, slapi_mod_get_ldapmod_passout(ocsmod)); @@ -1385,7 +1385,7 @@ posix_winsync_pre_ad_mod_user_mods_cb(void *cbdata, const Slapi_Entry *rawentry, slapi_mods_free(&smods); slapi_mods_free(&new_smods); plugin_op_finished(); - slapi_log_error(SLAPI_LOG_PLUGIN, posix_winsync_plugin_name, + slapi_log_err(SLAPI_LOG_PLUGIN, posix_winsync_plugin_name, "<-- _pre_ad_mod_user_mods_cb -- end\n"); return; @@ -1413,7 +1413,7 @@ posix_winsync_pre_ad_mod_group_mods_cb(void *cbdata, const Slapi_Entry *rawentry if (posix_winsync_config_get_msSFUSchema()) attr_map = group_mssfu_attribute_map; - slapi_log_error(SLAPI_LOG_PLUGIN, posix_winsync_plugin_name, + slapi_log_err(SLAPI_LOG_PLUGIN, posix_winsync_plugin_name, "--> _pre_ad_mod_group_mods_cb -- begin\n"); /* wrap the modstosend in a Slapi_Mods for convenience */ slapi_mods_init_passin(new_smods, *modstosend); @@ -1421,7 +1421,7 @@ posix_winsync_pre_ad_mod_group_mods_cb(void *cbdata, const Slapi_Entry *rawentry for (mod = slapi_mods_get_first_mod(smods); mod; mod = slapi_mods_get_next_mod(smods)) { size_t i = 0; - slapi_log_error(SLAPI_LOG_PLUGIN, posix_winsync_plugin_name, + slapi_log_err(SLAPI_LOG_PLUGIN, posix_winsync_plugin_name, "_pre_ad_mod_group_mods_cb -- check modify type %s\n", mod->mod_type); for (; attr_map[i].windows_attribute_name != NULL; i++) { if (0 == slapi_attr_type_cmp(mod->mod_type, attr_map[i].ldap_attribute_name, @@ -1436,7 +1436,7 @@ posix_winsync_pre_ad_mod_group_mods_cb(void *cbdata, const Slapi_Entry *rawentry slapi_mod_set_type(mysmod, attr_map[i].windows_attribute_name); if (0 == slapi_attr_type_cmp(mod->mod_type, "gidNumber", SLAPI_TYPE_CMP_SUBTYPE)) { Slapi_Mod *ocsmod = slapi_mod_new(); - slapi_log_error(SLAPI_LOG_PLUGIN, posix_winsync_plugin_name, + slapi_log_err(SLAPI_LOG_PLUGIN, posix_winsync_plugin_name, "_pre_ad_mod_group_mods_cb -- add NisDomain\n"); addNisDomainName(ocsmod, ds_entry); slapi_mods_add_ldapmod(new_smods, slapi_mod_get_ldapmod_passout(ocsmod)); @@ -1445,7 +1445,7 @@ posix_winsync_pre_ad_mod_group_mods_cb(void *cbdata, const Slapi_Entry *rawentry } slapi_mods_add_ldapmod(new_smods, slapi_mod_get_ldapmod_passout(mysmod)); slapi_mod_free(&mysmod); - slapi_log_error(SLAPI_LOG_PLUGIN, posix_winsync_plugin_name, + slapi_log_err(SLAPI_LOG_PLUGIN, posix_winsync_plugin_name, "_pre_ad_mod_group_mods_cb -- add modify %s DS account [%s]\n", attr_map[i].windows_attribute_name, slapi_entry_get_dn_const(ds_entry)); @@ -1463,7 +1463,7 @@ posix_winsync_pre_ad_mod_group_mods_cb(void *cbdata, const Slapi_Entry *rawentry slapi_mods_free(&new_smods); plugin_op_finished(); - slapi_log_error(SLAPI_LOG_PLUGIN, posix_winsync_plugin_name, + slapi_log_err(SLAPI_LOG_PLUGIN, posix_winsync_plugin_name, "<-- _pre_ad_mod_group_mods_cb -- end\n"); return; @@ -1473,10 +1473,10 @@ static int posix_winsync_can_add_entry_to_ad_cb(void *cbdata, const Slapi_Entry *local_entry, const Slapi_DN *remote_dn) { - slapi_log_error(SLAPI_LOG_PLUGIN, posix_winsync_plugin_name, + slapi_log_err(SLAPI_LOG_PLUGIN, posix_winsync_plugin_name, "--> posix_winsync_can_add_entry_to_ad_cb -- begin\n"); - slapi_log_error(SLAPI_LOG_PLUGIN, posix_winsync_plugin_name, + slapi_log_err(SLAPI_LOG_PLUGIN, posix_winsync_plugin_name, "<-- posix_winsync_can_add_entry_to_ad_cb -- end\n"); return 1; /* false - do not allow entries to be added to ad */ @@ -1492,12 +1492,12 @@ posix_winsync_begin_update_cb(void *cbdata, const Slapi_DN *ds_subtree, const Sl return; } - slapi_log_error(SLAPI_LOG_PLUGIN, posix_winsync_plugin_name, + slapi_log_err(SLAPI_LOG_PLUGIN, posix_winsync_plugin_name, "--> posix_winsync_begin_update_cb -- begin\n"); posix_winsync_config_reset_MOFTaskCreated(); plugin_op_finished(); - slapi_log_error(SLAPI_LOG_PLUGIN, posix_winsync_plugin_name, + slapi_log_err(SLAPI_LOG_PLUGIN, posix_winsync_plugin_name, "<-- posix_winsync_begin_update_cb -- end\n"); return; @@ -1514,7 +1514,7 @@ posix_winsync_end_update_cb(void *cbdata, const Slapi_DN *ds_subtree, const Slap return; } - slapi_log_error(SLAPI_LOG_PLUGIN, posix_winsync_plugin_name, + slapi_log_err(SLAPI_LOG_PLUGIN, posix_winsync_plugin_name, "--> posix_winsync_end_update_cb -- begin %d %d\n", posix_winsync_config_get_MOFTaskCreated(), posix_winsync_config_get_createMOFTask()); @@ -1529,16 +1529,16 @@ posix_winsync_end_update_cb(void *cbdata, const Slapi_DN *ds_subtree, const Slap if (NULL == dn) { slapi_pblock_destroy(pb); slapi_entry_free(e_task); - slapi_log_error(SLAPI_LOG_ERR, posix_winsync_plugin_name, + slapi_log_err(SLAPI_LOG_ERR, posix_winsync_plugin_name, "posix_winsync_end_update_cb: " "failed to create task dn: cn=%s,%s,cn=tasks,cn=config\n", posix_winsync_plugin_name, MEMBEROFTASK); plugin_op_finished(); return; } - slapi_log_error(SLAPI_LOG_PLUGIN, posix_winsync_plugin_name, + slapi_log_err(SLAPI_LOG_PLUGIN, posix_winsync_plugin_name, "--> posix_winsync_end_update_cb, create task %s\n", dn); - slapi_log_error(SLAPI_LOG_PLUGIN, posix_winsync_plugin_name, + slapi_log_err(SLAPI_LOG_PLUGIN, posix_winsync_plugin_name, "--> posix_winsync_end_update_cb, init'ing task\n"); slapi_entry_init(e_task, dn, NULL); @@ -1549,24 +1549,24 @@ posix_winsync_end_update_cb(void *cbdata, const Slapi_DN *ds_subtree, const Slap slapi_add_entry_internal_set_pb(pb, e_task, NULL, posix_winsync_get_plugin_identity(), 0); - slapi_log_error(SLAPI_LOG_PLUGIN, posix_winsync_plugin_name, + slapi_log_err(SLAPI_LOG_PLUGIN, posix_winsync_plugin_name, "--> posix_winsync_end_update_cb, adding task\n"); slapi_add_internal_pb(pb); - slapi_log_error(SLAPI_LOG_PLUGIN, posix_winsync_plugin_name, + slapi_log_err(SLAPI_LOG_PLUGIN, posix_winsync_plugin_name, "--> posix_winsync_end_update_cb, retrieving return code\n"); slapi_pblock_get(pb, SLAPI_PLUGIN_INTOP_RESULT, &rc); if (LDAP_ALREADY_EXISTS == rc) { - slapi_log_error(SLAPI_LOG_PLUGIN, posix_winsync_plugin_name, + slapi_log_err(SLAPI_LOG_PLUGIN, posix_winsync_plugin_name, "posix_winsync_end_update_cb: " "task entry %s already exists\n", posix_winsync_plugin_name); } else if (rc != 0) { - slapi_log_error(SLAPI_LOG_ERR, posix_winsync_plugin_name, + slapi_log_err(SLAPI_LOG_ERR, posix_winsync_plugin_name, "posix_winsync_end_update_cb: " "failed to add task entry (%d)\n", rc); } else { - slapi_log_error(SLAPI_LOG_PLUGIN, posix_winsync_plugin_name, + slapi_log_err(SLAPI_LOG_PLUGIN, posix_winsync_plugin_name, "posix_winsync_end_update_cb: " "add task entry\n"); } @@ -1576,7 +1576,7 @@ posix_winsync_end_update_cb(void *cbdata, const Slapi_DN *ds_subtree, const Slap posix_winsync_config_reset_MOFTaskCreated(); } plugin_op_finished(); - slapi_log_error(SLAPI_LOG_PLUGIN, posix_winsync_plugin_name, + slapi_log_err(SLAPI_LOG_PLUGIN, posix_winsync_plugin_name, "<-- posix_winsync_end_update_cb -- end\n"); return; @@ -1585,10 +1585,10 @@ posix_winsync_end_update_cb(void *cbdata, const Slapi_DN *ds_subtree, const Slap static void posix_winsync_destroy_agmt_cb(void *cbdata, const Slapi_DN *ds_subtree, const Slapi_DN *ad_subtree) { - slapi_log_error(SLAPI_LOG_PLUGIN, posix_winsync_plugin_name, + slapi_log_err(SLAPI_LOG_PLUGIN, posix_winsync_plugin_name, "--> posix_winsync_destroy_agmt_cb -- begin\n"); - slapi_log_error(SLAPI_LOG_PLUGIN, posix_winsync_plugin_name, + slapi_log_err(SLAPI_LOG_PLUGIN, posix_winsync_plugin_name, "<-- posix_winsync_destroy_agmt_cb -- end\n"); return; @@ -1597,16 +1597,16 @@ posix_winsync_destroy_agmt_cb(void *cbdata, const Slapi_DN *ds_subtree, const Sl static void posix_winsync_post_ad_mod_user_cb(void *cookie, const Slapi_Entry *rawentry, Slapi_Entry *ad_entry, Slapi_Entry *ds_entry, Slapi_Mods *smods, int *result) { - slapi_log_error(SLAPI_LOG_PLUGIN, posix_winsync_plugin_name, + slapi_log_err(SLAPI_LOG_PLUGIN, posix_winsync_plugin_name, "--> posix_winsync_post_ad_mod_user_cb -- begin\n"); #ifdef THIS_IS_JUST_AN_EXAMPLE - slapi_log_error(SLAPI_LOG_PLUGIN, posix_winsync_plugin_name, + slapi_log_err(SLAPI_LOG_PLUGIN, posix_winsync_plugin_name, "Result of modifying AD entry [%s] was [%d:%s]\n", slapi_entry_get_dn(ad_entry), *result, ldap_err2string(*result)); #endif - slapi_log_error(SLAPI_LOG_PLUGIN, posix_winsync_plugin_name, + slapi_log_err(SLAPI_LOG_PLUGIN, posix_winsync_plugin_name, "<-- posix_winsync_post_ad_mod_user_cb -- end\n"); return; @@ -1615,16 +1615,16 @@ posix_winsync_post_ad_mod_user_cb(void *cookie, const Slapi_Entry *rawentry, Sla static void posix_winsync_post_ad_mod_group_cb(void *cookie, const Slapi_Entry *rawentry, Slapi_Entry *ad_entry, Slapi_Entry *ds_entry, Slapi_Mods *smods, int *result) { - slapi_log_error(SLAPI_LOG_PLUGIN, posix_winsync_plugin_name, + slapi_log_err(SLAPI_LOG_PLUGIN, posix_winsync_plugin_name, "--> posix_winsync_post_ad_mod_group_cb -- begin\n"); #ifdef THIS_IS_JUST_AN_EXAMPLE - slapi_log_error(SLAPI_LOG_PLUGIN, posix_winsync_plugin_name, + slapi_log_err(SLAPI_LOG_PLUGIN, posix_winsync_plugin_name, "Result of modifying AD entry [%s] was [%d:%s]\n", slapi_entry_get_dn(ad_entry), *result, ldap_err2string(*result)); #endif - slapi_log_error(SLAPI_LOG_PLUGIN, posix_winsync_plugin_name, + slapi_log_err(SLAPI_LOG_PLUGIN, posix_winsync_plugin_name, "<-- posix_winsync_post_ad_mod_group_cb -- end\n"); return; @@ -1633,16 +1633,16 @@ posix_winsync_post_ad_mod_group_cb(void *cookie, const Slapi_Entry *rawentry, Sl static void posix_winsync_post_ds_mod_user_cb(void *cookie, const Slapi_Entry *rawentry, Slapi_Entry *ad_entry, Slapi_Entry *ds_entry, Slapi_Mods *smods, int *result) { - slapi_log_error(SLAPI_LOG_PLUGIN, posix_winsync_plugin_name, + slapi_log_err(SLAPI_LOG_PLUGIN, posix_winsync_plugin_name, "--> posix_winsync_post_ds_mod_user_cb -- begin\n"); #ifdef THIS_IS_JUST_AN_EXAMPLE - slapi_log_error(SLAPI_LOG_PLUGIN, posix_winsync_plugin_name, + slapi_log_err(SLAPI_LOG_PLUGIN, posix_winsync_plugin_name, "Result of modifying DS entry [%s] was [%d:%s]\n", slapi_entry_get_dn(ds_entry), *result, ldap_err2string(*result)); #endif - slapi_log_error(SLAPI_LOG_PLUGIN, posix_winsync_plugin_name, + slapi_log_err(SLAPI_LOG_PLUGIN, posix_winsync_plugin_name, "<-- posix_winsync_post_ds_mod_user_cb -- end\n"); return; @@ -1651,16 +1651,16 @@ posix_winsync_post_ds_mod_user_cb(void *cookie, const Slapi_Entry *rawentry, Sla static void posix_winsync_post_ds_mod_group_cb(void *cookie, const Slapi_Entry *rawentry, Slapi_Entry *ad_entry, Slapi_Entry *ds_entry, Slapi_Mods *smods, int *result) { - slapi_log_error(SLAPI_LOG_PLUGIN, posix_winsync_plugin_name, + slapi_log_err(SLAPI_LOG_PLUGIN, posix_winsync_plugin_name, "--> posix_winsync_post_ds_mod_group_cb -- begin\n"); #ifdef THIS_IS_JUST_AN_EXAMPLE - slapi_log_error(SLAPI_LOG_PLUGIN, posix_winsync_plugin_name, + slapi_log_err(SLAPI_LOG_PLUGIN, posix_winsync_plugin_name, "Result of modifying DS entry [%s] was [%d:%s]\n", slapi_entry_get_dn(ds_entry), *result, ldap_err2string(*result)); #endif - slapi_log_error(SLAPI_LOG_PLUGIN, posix_winsync_plugin_name, + slapi_log_err(SLAPI_LOG_PLUGIN, posix_winsync_plugin_name, "<-- posix_winsync_post_ds_mod_group_cb -- end\n"); return; @@ -1669,16 +1669,16 @@ posix_winsync_post_ds_mod_group_cb(void *cookie, const Slapi_Entry *rawentry, Sl static void posix_winsync_post_ds_add_user_cb(void *cookie, const Slapi_Entry *rawentry, Slapi_Entry *ad_entry, Slapi_Entry *ds_entry, int *result) { - slapi_log_error(SLAPI_LOG_PLUGIN, posix_winsync_plugin_name, + slapi_log_err(SLAPI_LOG_PLUGIN, posix_winsync_plugin_name, "--> posix_winsync_post_ds_add_user_cb -- begin\n"); #ifdef THIS_IS_JUST_AN_EXAMPLE - slapi_log_error(SLAPI_LOG_PLUGIN, posix_winsync_plugin_name, + slapi_log_err(SLAPI_LOG_PLUGIN, posix_winsync_plugin_name, "Result of adding DS entry [%s] was [%d:%s]\n", slapi_entry_get_dn(ds_entry), *result, ldap_err2string(*result)); #endif - slapi_log_error(SLAPI_LOG_PLUGIN, posix_winsync_plugin_name, + slapi_log_err(SLAPI_LOG_PLUGIN, posix_winsync_plugin_name, "<-- posix_winsync_post_ds_add_user_cb -- end\n"); return; @@ -1687,16 +1687,16 @@ posix_winsync_post_ds_add_user_cb(void *cookie, const Slapi_Entry *rawentry, Sla static void posix_winsync_post_ds_add_group_cb(void *cookie, const Slapi_Entry *rawentry, Slapi_Entry *ad_entry, Slapi_Entry *ds_entry, int *result) { - slapi_log_error(SLAPI_LOG_PLUGIN, posix_winsync_plugin_name, + slapi_log_err(SLAPI_LOG_PLUGIN, posix_winsync_plugin_name, "--> posix_winsync_post_ds_add_group_cb -- begin\n"); #ifdef THIS_IS_JUST_AN_EXAMPLE - slapi_log_error(SLAPI_LOG_PLUGIN, posix_winsync_plugin_name, + slapi_log_err(SLAPI_LOG_PLUGIN, posix_winsync_plugin_name, "Result of adding DS entry [%s] was [%d:%s]\n", slapi_entry_get_dn(ds_entry), *result, ldap_err2string(*result)); #endif - slapi_log_error(SLAPI_LOG_PLUGIN, posix_winsync_plugin_name, + slapi_log_err(SLAPI_LOG_PLUGIN, posix_winsync_plugin_name, "<-- posix_winsync_post_ds_add_group_cb -- end\n"); return; @@ -1721,7 +1721,7 @@ posix_winsync_pre_ad_add_user_cb(void *cookie, Slapi_Entry *ad_entry, Slapi_Entr /* if ds_entry has oc posixAccount add uidnumber, gidnumber, homeDirectory, loginShell, gecos */ /* syncing/mapping of nsaccountlock -> userAccountControl will already done by the normal Win Sync-Service */ - slapi_log_error(SLAPI_LOG_PLUGIN, posix_winsync_plugin_name, + slapi_log_err(SLAPI_LOG_PLUGIN, posix_winsync_plugin_name, "--> _pre_ad_add_user_cb -- begin DS account [%s] \n", slapi_entry_get_dn_const(ds_entry)); rc = slapi_entry_attr_find(ds_entry, "objectclass", &obj_attr); @@ -1729,7 +1729,7 @@ posix_winsync_pre_ad_add_user_cb(void *cookie, Slapi_Entry *ad_entry, Slapi_Entr int i; Slapi_Value * value = NULL; /* Attribute values */ - slapi_log_error(SLAPI_LOG_PLUGIN, POSIX_WINSYNC_PLUGIN_NAME,"_pre_ad_add_user_cb -- test objectclass posixAccount\n"); + slapi_log_err(SLAPI_LOG_PLUGIN, POSIX_WINSYNC_PLUGIN_NAME,"_pre_ad_add_user_cb -- test objectclass posixAccount\n"); for ( i = slapi_attr_first_value(obj_attr, &value); i != -1; @@ -1738,7 +1738,7 @@ posix_winsync_pre_ad_add_user_cb(void *cookie, Slapi_Entry *ad_entry, Slapi_Entr const char * oc = NULL; oc = slapi_value_get_string(value); - slapi_log_error(SLAPI_LOG_PLUGIN, POSIX_WINSYNC_PLUGIN_NAME,"_pre_ad_add_user_cb -- oc: %s \n", oc); + slapi_log_err(SLAPI_LOG_PLUGIN, POSIX_WINSYNC_PLUGIN_NAME,"_pre_ad_add_user_cb -- oc: %s \n", oc); if (strncasecmp(oc,"posixAccount",13)==0){ /* entry has objectclass posixAccount */ Slapi_Attr *attr = NULL; char *nisdomainname = getNisDomainName(ds_entry); @@ -1750,7 +1750,7 @@ posix_winsync_pre_ad_add_user_cb(void *cookie, Slapi_Entry *ad_entry, Slapi_Entr size_t i = 0; slapi_attr_get_type( attr, &type ); - slapi_log_error(SLAPI_LOG_PLUGIN, posix_winsync_plugin_name, + slapi_log_err(SLAPI_LOG_PLUGIN, posix_winsync_plugin_name, "_pre_ad_add_user_cb -- check add attr: %s\n", type); for (; attr_map[i].windows_attribute_name != NULL; i++) { if (0 == slapi_attr_type_cmp(type,attr_map[i].ldap_attribute_name, SLAPI_TYPE_CMP_SUBTYPE)){ @@ -1760,7 +1760,7 @@ posix_winsync_pre_ad_add_user_cb(void *cookie, Slapi_Entry *ad_entry, Slapi_Entr slapi_entry_add_valueset(ad_entry, attr_map[i].windows_attribute_name, vs); slapi_valueset_free(vs); - slapi_log_error(SLAPI_LOG_PLUGIN, posix_winsync_plugin_name, + slapi_log_err(SLAPI_LOG_PLUGIN, posix_winsync_plugin_name, "--> _pre_ad_add_user_cb -- " "adding val for [%s] to new entry [%s]\n", type, slapi_entry_get_dn_const(ad_entry)); @@ -1770,7 +1770,7 @@ posix_winsync_pre_ad_add_user_cb(void *cookie, Slapi_Entry *ad_entry, Slapi_Entr if (nisdomainname) { slapi_entry_add_value(ad_entry, "msSFU30NisDomain", slapi_value_new_string(nisdomainname)); - slapi_log_error(SLAPI_LOG_PLUGIN, posix_winsync_plugin_name, + slapi_log_err(SLAPI_LOG_PLUGIN, posix_winsync_plugin_name, "--> _pre_ad_add_user_cb -- " "adding val for [%s] to new entry [%s]\n", "msSFU30NisDomain", nisdomainname); @@ -1780,7 +1780,7 @@ posix_winsync_pre_ad_add_user_cb(void *cookie, Slapi_Entry *ad_entry, Slapi_Entr } } plugin_op_finished(); - slapi_log_error(SLAPI_LOG_PLUGIN, posix_winsync_plugin_name, + slapi_log_err(SLAPI_LOG_PLUGIN, posix_winsync_plugin_name, "<-- _pre_ad_add_user_cb -- end\n"); return; @@ -1804,7 +1804,7 @@ posix_winsync_pre_ad_add_group_cb(void *cookie, Slapi_Entry *ad_entry, Slapi_Ent } /* if ds_entry has oc posixGroup add gidnumber, ... */ - slapi_log_error(SLAPI_LOG_PLUGIN, posix_winsync_plugin_name, + slapi_log_err(SLAPI_LOG_PLUGIN, posix_winsync_plugin_name, "--> _pre_ad_add_group_cb -- begin DS account [%s] \n", slapi_entry_get_dn_const(ds_entry)); rc = slapi_entry_attr_find(ds_entry, "objectclass", &obj_attr); @@ -1812,7 +1812,7 @@ posix_winsync_pre_ad_add_group_cb(void *cookie, Slapi_Entry *ad_entry, Slapi_Ent int i; Slapi_Value * value = NULL; /* Attribute values */ - slapi_log_error(SLAPI_LOG_PLUGIN, POSIX_WINSYNC_PLUGIN_NAME,"_pre_ad_add_group_cb -- test objectclass posixGroup\n"); + slapi_log_err(SLAPI_LOG_PLUGIN, POSIX_WINSYNC_PLUGIN_NAME,"_pre_ad_add_group_cb -- test objectclass posixGroup\n"); for (i = slapi_attr_first_value(obj_attr, &value); i != -1; i = slapi_attr_next_value(obj_attr, i, &value)) { @@ -1830,7 +1830,7 @@ posix_winsync_pre_ad_add_group_cb(void *cookie, Slapi_Entry *ad_entry, Slapi_Ent int j = 0; slapi_attr_get_type( attr, &type ); - slapi_log_error(SLAPI_LOG_PLUGIN, posix_winsync_plugin_name, + slapi_log_err(SLAPI_LOG_PLUGIN, posix_winsync_plugin_name, "_pre_ad_add_group_cb -- check add attr: %s\n", type); for (j = 0; attr_map && attr_map[j].windows_attribute_name != NULL; j++) { if (0 == slapi_attr_type_cmp(type,attr_map[j].ldap_attribute_name, SLAPI_TYPE_CMP_SUBTYPE)){ @@ -1840,7 +1840,7 @@ posix_winsync_pre_ad_add_group_cb(void *cookie, Slapi_Entry *ad_entry, Slapi_Ent slapi_entry_add_valueset(ad_entry, attr_map[j].windows_attribute_name, vs); slapi_valueset_free(vs); - slapi_log_error(SLAPI_LOG_PLUGIN, posix_winsync_plugin_name, + slapi_log_err(SLAPI_LOG_PLUGIN, posix_winsync_plugin_name, "--> _pre_ad_add_group_cb -- " "adding val for [%s] to new entry [%s]\n", type, slapi_entry_get_dn_const(ad_entry)); @@ -1849,7 +1849,7 @@ posix_winsync_pre_ad_add_group_cb(void *cookie, Slapi_Entry *ad_entry, Slapi_Ent } if (nisdomainname) { slapi_entry_add_value(ad_entry, "msSFU30NisDomain", slapi_value_new_string(nisdomainname)); - slapi_log_error(SLAPI_LOG_PLUGIN, posix_winsync_plugin_name, + slapi_log_err(SLAPI_LOG_PLUGIN, posix_winsync_plugin_name, "--> _pre_ad_add_group_cb -- " "adding val for [%s] to new entry [%s]\n", "msSFU30NisDomain", nisdomainname); @@ -1859,7 +1859,7 @@ posix_winsync_pre_ad_add_group_cb(void *cookie, Slapi_Entry *ad_entry, Slapi_Ent } } plugin_op_finished(); - slapi_log_error(SLAPI_LOG_PLUGIN, posix_winsync_plugin_name, + slapi_log_err(SLAPI_LOG_PLUGIN, posix_winsync_plugin_name, "<-- _pre_ad_add_group_cb -- end\n"); return; @@ -1868,16 +1868,16 @@ posix_winsync_pre_ad_add_group_cb(void *cookie, Slapi_Entry *ad_entry, Slapi_Ent static void posix_winsync_post_ad_add_user_cb(void *cookie, Slapi_Entry *ds_entry, Slapi_Entry *ad_entry, int *result) { - slapi_log_error(SLAPI_LOG_PLUGIN, posix_winsync_plugin_name, + slapi_log_err(SLAPI_LOG_PLUGIN, posix_winsync_plugin_name, "--> posix_winsync_post_ad_add_user_cb -- begin\n"); #ifdef THIS_IS_JUST_AN_EXAMPLE - slapi_log_error(SLAPI_LOG_PLUGIN, posix_winsync_plugin_name, + slapi_log_err(SLAPI_LOG_PLUGIN, posix_winsync_plugin_name, "Result of adding AD entry [%s] was [%d:%s]\n", slapi_entry_get_dn(ad_entry), *result, ldap_err2string(*result)); #endif - slapi_log_error(SLAPI_LOG_PLUGIN, posix_winsync_plugin_name, + slapi_log_err(SLAPI_LOG_PLUGIN, posix_winsync_plugin_name, "<-- posix_winsync_post_ad_add_user_cb -- end\n"); return; @@ -1886,16 +1886,16 @@ posix_winsync_post_ad_add_user_cb(void *cookie, Slapi_Entry *ds_entry, Slapi_Ent static void posix_winsync_post_ad_add_group_cb(void *cookie, Slapi_Entry *ds_entry, Slapi_Entry *ad_entry, int *result) { - slapi_log_error(SLAPI_LOG_PLUGIN, posix_winsync_plugin_name, + slapi_log_err(SLAPI_LOG_PLUGIN, posix_winsync_plugin_name, "--> posix_winsync_post_ad_add_group_cb -- begin\n"); #ifdef THIS_IS_JUST_AN_EXAMPLE - slapi_log_error(SLAPI_LOG_PLUGIN, posix_winsync_plugin_name, + slapi_log_err(SLAPI_LOG_PLUGIN, posix_winsync_plugin_name, "Result of adding AD entry [%s] was [%d:%s]\n", slapi_entry_get_dn(ad_entry), *result, ldap_err2string(*result)); #endif - slapi_log_error(SLAPI_LOG_PLUGIN, posix_winsync_plugin_name, + slapi_log_err(SLAPI_LOG_PLUGIN, posix_winsync_plugin_name, "<-- posix_winsync_post_ad_add_group_cb -- end\n"); return; @@ -1904,16 +1904,16 @@ posix_winsync_post_ad_add_group_cb(void *cookie, Slapi_Entry *ds_entry, Slapi_En static void posix_winsync_post_ad_mod_user_mods_cb(void *cookie, const Slapi_Entry *rawentry, const Slapi_DN *local_dn, const Slapi_Entry *ds_entry, LDAPMod * const *origmods, Slapi_DN *remote_dn, LDAPMod ***modstosend, int *result) { - slapi_log_error(SLAPI_LOG_PLUGIN, posix_winsync_plugin_name, + slapi_log_err(SLAPI_LOG_PLUGIN, posix_winsync_plugin_name, "--> posix_winsync_post_ad_mod_user_mods_cb -- begin\n"); #ifdef THIS_IS_JUST_AN_EXAMPLE - slapi_log_error(SLAPI_LOG_PLUGIN, posix_winsync_plugin_name, + slapi_log_err(SLAPI_LOG_PLUGIN, posix_winsync_plugin_name, "Result of modifying AD entry [%s] was [%d:%s]\n", slapi_sdn_get_dn(remote_dn), *result, ldap_err2string(*result)); #endif - slapi_log_error(SLAPI_LOG_PLUGIN, posix_winsync_plugin_name, + slapi_log_err(SLAPI_LOG_PLUGIN, posix_winsync_plugin_name, "<-- posix_winsync_post_ad_mod_user_mods_cb -- end\n"); return; @@ -1922,16 +1922,16 @@ posix_winsync_post_ad_mod_user_mods_cb(void *cookie, const Slapi_Entry *rawentry static void posix_winsync_post_ad_mod_group_mods_cb(void *cookie, const Slapi_Entry *rawentry, const Slapi_DN *local_dn, const Slapi_Entry *ds_entry, LDAPMod * const *origmods, Slapi_DN *remote_dn, LDAPMod ***modstosend, int *result) { - slapi_log_error(SLAPI_LOG_PLUGIN, posix_winsync_plugin_name, + slapi_log_err(SLAPI_LOG_PLUGIN, posix_winsync_plugin_name, "--> posix_winsync_post_ad_mod_group_mods_cb -- begin\n"); #ifdef THIS_IS_JUST_AN_EXAMPLE - slapi_log_error(SLAPI_LOG_PLUGIN, posix_winsync_plugin_name, + slapi_log_err(SLAPI_LOG_PLUGIN, posix_winsync_plugin_name, "Result of modifying AD entry [%s] was [%d:%s]\n", slapi_sdn_get_dn(remote_dn), *result, ldap_err2string(*result)); #endif - slapi_log_error(SLAPI_LOG_PLUGIN, posix_winsync_plugin_name, + slapi_log_err(SLAPI_LOG_PLUGIN, posix_winsync_plugin_name, "<-- posix_winsync_post_ad_mod_group_mods_cb -- end\n"); return; @@ -2004,29 +2004,29 @@ posix_winsync_plugin_start(Slapi_PBlock *pb) int rc; Slapi_Entry *config_e = NULL; /* entry containing plugin config */ - slapi_log_error(SLAPI_LOG_PLUGIN, posix_winsync_plugin_name, + slapi_log_err(SLAPI_LOG_PLUGIN, posix_winsync_plugin_name, "--> posix_winsync_plugin_start -- begin\n"); if (slapi_apib_register(WINSYNC_v3_0_GUID, posix_winsync_api)) { - slapi_log_error(SLAPI_LOG_ERR, posix_winsync_plugin_name, + slapi_log_err(SLAPI_LOG_ERR, posix_winsync_plugin_name, "<-- posix_winsync_plugin_start -- failed to register winsync api -- end\n"); return -1; } if (slapi_pblock_get(pb, SLAPI_ADD_ENTRY, &config_e) != 0) { - slapi_log_error(SLAPI_LOG_ERR, posix_winsync_plugin_name, "posix_winsync_plugin_start - " + slapi_log_err(SLAPI_LOG_ERR, posix_winsync_plugin_name, "posix_winsync_plugin_start - " "Missing config entry\n"); return (-1); } if ((rc = posix_winsync_config(config_e)) != LDAP_SUCCESS) { - slapi_log_error(SLAPI_LOG_ERR, posix_winsync_plugin_name, "posix_winsync_plugin_start - " + slapi_log_err(SLAPI_LOG_ERR, posix_winsync_plugin_name, "posix_winsync_plugin_start - " "configuration failed (%s)\n", ldap_err2string(rc)); return (-1); } g_plugin_started = 1; op_counter = slapi_counter_new(); - slapi_log_error(SLAPI_LOG_PLUGIN, posix_winsync_plugin_name, + slapi_log_err(SLAPI_LOG_PLUGIN, posix_winsync_plugin_name, "<-- posix_winsync_plugin_start -- registered; end\n"); return 0; } @@ -2034,7 +2034,7 @@ posix_winsync_plugin_start(Slapi_PBlock *pb) static int posix_winsync_plugin_close(Slapi_PBlock *pb) { - slapi_log_error(SLAPI_LOG_PLUGIN, posix_winsync_plugin_name, + slapi_log_err(SLAPI_LOG_PLUGIN, posix_winsync_plugin_name, "--> posix_winsync_plugin_close -- begin\n"); g_plugin_started = 0; @@ -2042,7 +2042,7 @@ posix_winsync_plugin_close(Slapi_PBlock *pb) slapi_apib_unregister(WINSYNC_v1_0_GUID); posix_winsync_config_free(); - slapi_log_error(SLAPI_LOG_PLUGIN, posix_winsync_plugin_name, + slapi_log_err(SLAPI_LOG_PLUGIN, posix_winsync_plugin_name, "<-- posix_winsync_plugin_close -- end\n"); return 0; } @@ -2056,7 +2056,7 @@ posix_winsync_plugin_init(Slapi_PBlock *pb) void *plugin_id = NULL; Slapi_Entry *confige = NULL; - slapi_log_error(SLAPI_LOG_PLUGIN, posix_winsync_plugin_name, + slapi_log_err(SLAPI_LOG_PLUGIN, posix_winsync_plugin_name, "--> posix_winsync_plugin_init -- begin\n"); if (slapi_pblock_get(pb, SLAPI_PLUGIN_CONFIG_ENTRY, &confige) && confige) { @@ -2070,7 +2070,7 @@ posix_winsync_plugin_init(Slapi_PBlock *pb) || slapi_pblock_set(pb, SLAPI_PLUGIN_START_FN, (void *) posix_winsync_plugin_start) != 0 || slapi_pblock_set(pb, SLAPI_PLUGIN_CLOSE_FN, (void *) posix_winsync_plugin_close) != 0 || slapi_pblock_set(pb, SLAPI_PLUGIN_DESCRIPTION, (void *) &posix_winsync_pdesc) != 0) { - slapi_log_error(SLAPI_LOG_ERR, posix_winsync_plugin_name, + slapi_log_err(SLAPI_LOG_ERR, posix_winsync_plugin_name, "posix_winsync_plugin_init - Failed to register plugin -- end\n"); return -1; } @@ -2078,14 +2078,14 @@ posix_winsync_plugin_init(Slapi_PBlock *pb) /* Retrieve and save the plugin identity to later pass to internal operations */ if (slapi_pblock_get(pb, SLAPI_PLUGIN_IDENTITY, &plugin_id) != 0) { - slapi_log_error(SLAPI_LOG_ERR, posix_winsync_plugin_name, + slapi_log_err(SLAPI_LOG_ERR, posix_winsync_plugin_name, "posix_winsync_plugin_init - Failed to retrieve plugin identity -- end\n"); return -1; } posix_winsync_set_plugin_identity(plugin_id); - slapi_log_error(SLAPI_LOG_PLUGIN, posix_winsync_plugin_name, + slapi_log_err(SLAPI_LOG_PLUGIN, posix_winsync_plugin_name, "<-- posix_winsync_plugin_init -- end\n"); return 0; } diff --git a/ldap/servers/plugins/presence/presence.c b/ldap/servers/plugins/presence/presence.c index 090ce22..07fa7cf 100644 --- a/ldap/servers/plugins/presence/presence.c +++ b/ldap/servers/plugins/presence/presence.c @@ -29,22 +29,6 @@ #include -/*** from ldaplog.h ***/ - -/* edited ldaplog.h for LDAPDebug()*/ -#ifndef _LDAPLOG_H -#define _LDAPLOG_H - -#ifdef __cplusplus -extern "C" { -#endif - -#ifdef __cplusplus -} -#endif - -#endif /* _LDAP_H */ - #define PRESENCE_PLUGIN_SUBSYSTEM "presence-plugin" #define PRESENCE_PLUGIN_VERSION 0x00050050 @@ -230,7 +214,7 @@ int presence_init( Slapi_PBlock *pb ) int status = PRESENCE_SUCCESS; char * plugin_identity=NULL; - slapi_log_error(SLAPI_LOG_PLUGIN, PRESENCE_PLUGIN_SUBSYSTEM,"presence_init - BEGIN\n"); + slapi_log_err(SLAPI_LOG_PLUGIN, PRESENCE_PLUGIN_SUBSYSTEM,"presence_init - BEGIN\n"); /** * Store the plugin identity for later use. @@ -250,12 +234,12 @@ int presence_init( Slapi_PBlock *pb ) slapi_pblock_set( pb, SLAPI_PLUGIN_DESCRIPTION, (void *)&pdesc ) != 0 ) { - slapi_log_error(SLAPI_LOG_ERR, PRESENCE_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_ERR, PRESENCE_PLUGIN_SUBSYSTEM, "presence_init - Failed to register plugin\n" ); status = PRESENCE_FAILURE; } - slapi_log_error(SLAPI_LOG_PLUGIN, PRESENCE_PLUGIN_SUBSYSTEM, "presence_init -- END\n"); + slapi_log_err(SLAPI_LOG_PLUGIN, PRESENCE_PLUGIN_SUBSYSTEM, "presence_init -- END\n"); return status; } @@ -270,7 +254,7 @@ int presence_start( Slapi_PBlock *pb ) { char * plugindn = NULL; - slapi_log_error(SLAPI_LOG_PLUGIN, PRESENCE_PLUGIN_SUBSYSTEM, "presence_start - BEGIN\n"); + slapi_log_err(SLAPI_LOG_PLUGIN, PRESENCE_PLUGIN_SUBSYSTEM, "presence_start - BEGIN\n"); if(slapi_apib_get_interface(HTTP_v1_0_GUID, &_HttpAPI)) { @@ -288,7 +272,7 @@ int presence_start( Slapi_PBlock *pb ) presence_vattr_compare, presence_vattr_types) != 0) { - slapi_log_error(SLAPI_LOG_ERR, PRESENCE_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_ERR, PRESENCE_PLUGIN_SUBSYSTEM, "presence_start - Cannot register as service provider\n" ); return PRESENCE_FAILURE; } @@ -321,13 +305,13 @@ int presence_start( Slapi_PBlock *pb ) */ if (loadPluginConfig() != PRESENCE_SUCCESS) { - slapi_log_error(SLAPI_LOG_ERR, PRESENCE_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_ERR, PRESENCE_PLUGIN_SUBSYSTEM, "presence_start - Unable to load plug-in configuration\n" ); return PRESENCE_FAILURE; } - slapi_log_error(SLAPI_LOG_PLUGIN, PRESENCE_PLUGIN_SUBSYSTEM, "presence_start - Ready for service\n"); - slapi_log_error(SLAPI_LOG_PLUGIN, PRESENCE_PLUGIN_SUBSYSTEM, "presence_start - END\n"); + slapi_log_err(SLAPI_LOG_PLUGIN, PRESENCE_PLUGIN_SUBSYSTEM, "presence_start - Ready for service\n"); + slapi_log_err(SLAPI_LOG_PLUGIN, PRESENCE_PLUGIN_SUBSYSTEM, "presence_start - END\n"); return PRESENCE_SUCCESS; } @@ -339,11 +323,11 @@ int presence_start( Slapi_PBlock *pb ) */ int presence_close( Slapi_PBlock *pb ) { - slapi_log_error(SLAPI_LOG_PLUGIN, PRESENCE_PLUGIN_SUBSYSTEM, "--> presence_close\n"); + slapi_log_err(SLAPI_LOG_PLUGIN, PRESENCE_PLUGIN_SUBSYSTEM, "--> presence_close\n"); deleteMapTables(); - slapi_log_error(SLAPI_LOG_PLUGIN, PRESENCE_PLUGIN_SUBSYSTEM, "<-- presence_close\n"); + slapi_log_err(SLAPI_LOG_PLUGIN, PRESENCE_PLUGIN_SUBSYSTEM, "<-- presence_close\n"); return PRESENCE_SUCCESS; } @@ -367,9 +351,9 @@ static int presence_vattr_get(vattr_sp_handle *handle, _Vmap *map = NULL; _ConfigEntry *info = NULL; - slapi_log_error(SLAPI_LOG_PLUGIN, PRESENCE_PLUGIN_SUBSYSTEM, "--> presence_vattr_get \n"); + slapi_log_err(SLAPI_LOG_PLUGIN, PRESENCE_PLUGIN_SUBSYSTEM, "--> presence_vattr_get \n"); - slapi_log_error(SLAPI_LOG_PLUGIN, PRESENCE_PLUGIN_SUBSYSTEM, "presence_vattr_get - Type=[%s] \n",type); + slapi_log_err(SLAPI_LOG_PLUGIN, PRESENCE_PLUGIN_SUBSYSTEM, "presence_vattr_get - Type=[%s] \n",type); if (imIDExists(e, type, &id, &map, &info) != PRESENCE_SUCCESS) { @@ -381,7 +365,7 @@ static int presence_vattr_get(vattr_sp_handle *handle, status = PRESENCE_FAILURE; goto cleanup; } - slapi_log_error(SLAPI_LOG_PLUGIN, PRESENCE_PLUGIN_SUBSYSTEM, "presence_vattr_get - ID=[%s] \n",id); + slapi_log_err(SLAPI_LOG_PLUGIN, PRESENCE_PLUGIN_SUBSYSTEM, "presence_vattr_get - ID=[%s] \n",id); /** * Now since we got a valid id we do a quick schema check @@ -398,8 +382,8 @@ static int presence_vattr_get(vattr_sp_handle *handle, status = makeHttpRequest(id, map, info, &returnedBUF, &size); - slapi_log_error(SLAPI_LOG_PLUGIN, PRESENCE_PLUGIN_SUBSYSTEM, "presence_vattr_get - size=[%d] \n",size); - slapi_log_error(SLAPI_LOG_PLUGIN, PRESENCE_PLUGIN_SUBSYSTEM, "presence_vattr_get - buffer=[%s]\n",(returnedBUF) ? returnedBUF : "NULL"); + slapi_log_err(SLAPI_LOG_PLUGIN, PRESENCE_PLUGIN_SUBSYSTEM, "presence_vattr_get - size=[%d] \n",size); + slapi_log_err(SLAPI_LOG_PLUGIN, PRESENCE_PLUGIN_SUBSYSTEM, "presence_vattr_get - buffer=[%s]\n",(returnedBUF) ? returnedBUF : "NULL"); if(status == PRESENCE_SUCCESS) @@ -432,14 +416,14 @@ static int presence_vattr_get(vattr_sp_handle *handle, } cleanup: -slapi_log_error(SLAPI_LOG_PLUGIN, PRESENCE_PLUGIN_SUBSYSTEM, "presence_vattr_get - Processed ID=[%s] \n",id); +slapi_log_err(SLAPI_LOG_PLUGIN, PRESENCE_PLUGIN_SUBSYSTEM, "presence_vattr_get - Processed ID=[%s] \n",id); if (id != NULL ) { slapi_ch_free((void **)&id); } if (returnedBUF != NULL ) { PR_Free(returnedBUF); } - slapi_log_error(SLAPI_LOG_PLUGIN, PRESENCE_PLUGIN_SUBSYSTEM, "<-- presence_vattr_get \n"); + slapi_log_err(SLAPI_LOG_PLUGIN, PRESENCE_PLUGIN_SUBSYSTEM, "<-- presence_vattr_get \n"); return status; } @@ -450,8 +434,8 @@ static int presence_vattr_compare(vattr_sp_handle *handle, vattr_context *c, Sla /** * not yet implemented ??? */ - slapi_log_error(SLAPI_LOG_PLUGIN, PRESENCE_PLUGIN_SUBSYSTEM, "--> presence_vattr_compare - does nothing \n"); - slapi_log_error(SLAPI_LOG_PLUGIN, PRESENCE_PLUGIN_SUBSYSTEM, "<-- presence_vattr_compare \n"); + slapi_log_err(SLAPI_LOG_PLUGIN, PRESENCE_PLUGIN_SUBSYSTEM, "--> presence_vattr_compare - does nothing \n"); + slapi_log_err(SLAPI_LOG_PLUGIN, PRESENCE_PLUGIN_SUBSYSTEM, "<-- presence_vattr_compare \n"); return status; } @@ -463,11 +447,11 @@ static int presence_vattr_types(vattr_sp_handle *handle,Slapi_Entry *e,vattr_typ args.entry = e; args.context = type_context; - slapi_log_error(SLAPI_LOG_PLUGIN, PRESENCE_PLUGIN_SUBSYSTEM, "--> presence_vattr_types\n"); + slapi_log_err(SLAPI_LOG_PLUGIN, PRESENCE_PLUGIN_SUBSYSTEM, "--> presence_vattr_types\n"); PL_HashTableEnumerateEntries(_IdVattrMapTable, setTypes, &args); - slapi_log_error(SLAPI_LOG_PLUGIN, PRESENCE_PLUGIN_SUBSYSTEM, "<-- presence_vattr_types\n"); + slapi_log_err(SLAPI_LOG_PLUGIN, PRESENCE_PLUGIN_SUBSYSTEM, "<-- presence_vattr_types\n"); return status; } @@ -479,7 +463,7 @@ static int loadPluginConfig(void) Slapi_PBlock *search_pb; Slapi_Entry **entries = NULL; - slapi_log_error(SLAPI_LOG_PLUGIN, PRESENCE_PLUGIN_SUBSYSTEM, "--> loadPluginConfig\n"); + slapi_log_err(SLAPI_LOG_PLUGIN, PRESENCE_PLUGIN_SUBSYSTEM, "--> loadPluginConfig\n"); search_pb = slapi_pblock_new(); @@ -490,7 +474,7 @@ static int loadPluginConfig(void) if (status != PRESENCE_SUCCESS) { - slapi_log_error(SLAPI_LOG_ERR, PRESENCE_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_ERR, PRESENCE_PLUGIN_SUBSYSTEM, "loadPluginConfig - Error getting level1 presence configurations<%s>\n", getPluginDN()); status = PRESENCE_FAILURE; goto cleanup; @@ -499,7 +483,7 @@ static int loadPluginConfig(void) slapi_pblock_get(search_pb, SLAPI_PLUGIN_INTOP_SEARCH_ENTRIES, &entries); if (NULL == entries || entries[0] == NULL) { - slapi_log_error(SLAPI_LOG_ERR, PRESENCE_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_ERR, PRESENCE_PLUGIN_SUBSYSTEM, "loadPluginConfig - No entries found for <%s>\n", getPluginDN()); status = PRESENCE_FAILURE; @@ -522,7 +506,7 @@ static int loadPluginConfig(void) NULL ); - slapi_log_error(SLAPI_LOG_PLUGIN, PRESENCE_PLUGIN_SUBSYSTEM, "--> parseConfigEntry \n"); + slapi_log_err(SLAPI_LOG_PLUGIN, PRESENCE_PLUGIN_SUBSYSTEM, "--> parseConfigEntry \n"); for (i = 0; (entries[i] != NULL); i++) { @@ -533,9 +517,9 @@ static int loadPluginConfig(void) goto cleanup; } } - slapi_log_error(SLAPI_LOG_PLUGIN, PRESENCE_PLUGIN_SUBSYSTEM, "<-- parseConfigEntry \n"); + slapi_log_err(SLAPI_LOG_PLUGIN, PRESENCE_PLUGIN_SUBSYSTEM, "<-- parseConfigEntry \n"); - slapi_log_error(SLAPI_LOG_PLUGIN, PRESENCE_PLUGIN_SUBSYSTEM, "<-- loadPluginConfig\n"); + slapi_log_err(SLAPI_LOG_PLUGIN, PRESENCE_PLUGIN_SUBSYSTEM, "<-- loadPluginConfig\n"); cleanup: slapi_free_search_results_internal(search_pb); @@ -560,7 +544,7 @@ static int parseConfigEntry(Slapi_Entry *e) */ return PRESENCE_FAILURE; } - slapi_log_error(SLAPI_LOG_PLUGIN, PRESENCE_PLUGIN_SUBSYSTEM, "parseConfigEntry - key [%s] \n",key); + slapi_log_err(SLAPI_LOG_PLUGIN, PRESENCE_PLUGIN_SUBSYSTEM, "parseConfigEntry - key [%s] \n",key); /** * Now create the config entry which will hold all the * attributes of a presence vendor @@ -583,7 +567,7 @@ static int parseConfigEntry(Slapi_Entry *e) toLowerCase(value); PL_HashTableAdd(_IdVattrMapTable, value, map); } - slapi_log_error(SLAPI_LOG_PLUGIN, PRESENCE_PLUGIN_SUBSYSTEM, "parseConfigEntry - nsIMStatusText [%s] \n",value); + slapi_log_err(SLAPI_LOG_PLUGIN, PRESENCE_PLUGIN_SUBSYSTEM, "parseConfigEntry - nsIMStatusText [%s] \n",value); value = slapi_entry_attr_get_charptr(e, NS_IM_STATUS_GRAPHIC); if (value) { @@ -595,35 +579,35 @@ static int parseConfigEntry(Slapi_Entry *e) PL_HashTableAdd(_IdVattrMapTable, value, map); } - slapi_log_error(SLAPI_LOG_PLUGIN, PRESENCE_PLUGIN_SUBSYSTEM, "parseConfigEntry - nsIMStatusGraphic [%s] \n",value); + slapi_log_err(SLAPI_LOG_PLUGIN, PRESENCE_PLUGIN_SUBSYSTEM, "parseConfigEntry - nsIMStatusGraphic [%s] \n",value); value = slapi_entry_attr_get_charptr(e, NS_IM_URL_TEXT); if (value) { entry->textURL = value; } - slapi_log_error(SLAPI_LOG_PLUGIN, PRESENCE_PLUGIN_SUBSYSTEM, "parseConfigEntry - nsIMURLText [%s] \n",value); + slapi_log_err(SLAPI_LOG_PLUGIN, PRESENCE_PLUGIN_SUBSYSTEM, "parseConfigEntry - nsIMURLText [%s] \n",value); value = slapi_entry_attr_get_charptr(e, NS_IM_URL_GRAPHIC); if (value) { entry->graphicURL = value; } - slapi_log_error(SLAPI_LOG_PLUGIN, PRESENCE_PLUGIN_SUBSYSTEM, "parseConfigEntry - nsIMStatusGraphic [%s] \n",value); + slapi_log_err(SLAPI_LOG_PLUGIN, PRESENCE_PLUGIN_SUBSYSTEM, "parseConfigEntry - nsIMStatusGraphic [%s] \n",value); value = slapi_entry_attr_get_charptr(e, NS_IM_ON_VALUE_MAP_TEXT); if (value) { entry->onTextMap = value; } - slapi_log_error(SLAPI_LOG_PLUGIN, PRESENCE_PLUGIN_SUBSYSTEM, "parseConfigEntry - nsIMOnValueMapText [%s] \n",value); + slapi_log_err(SLAPI_LOG_PLUGIN, PRESENCE_PLUGIN_SUBSYSTEM, "parseConfigEntry - nsIMOnValueMapText [%s] \n",value); value = slapi_entry_attr_get_charptr(e, NS_IM_OFF_VALUE_MAP_TEXT); if (value) { entry->offTextMap = value; } - slapi_log_error(SLAPI_LOG_PLUGIN, PRESENCE_PLUGIN_SUBSYSTEM, "parseConfigEntry - nsIMOffValueMapText [%s] \n",value); + slapi_log_err(SLAPI_LOG_PLUGIN, PRESENCE_PLUGIN_SUBSYSTEM, "parseConfigEntry - nsIMOffValueMapText [%s] \n",value); /** * Next 3 are binary syntax types so needs special handling @@ -651,20 +635,20 @@ static int parseConfigEntry(Slapi_Entry *e) entry->requestMethod = value; } - slapi_log_error(SLAPI_LOG_PLUGIN, PRESENCE_PLUGIN_SUBSYSTEM, "parseConfigEntry - nsIMRequestMethod [%s] \n",value); + slapi_log_err(SLAPI_LOG_PLUGIN, PRESENCE_PLUGIN_SUBSYSTEM, "parseConfigEntry - nsIMRequestMethod [%s] \n",value); value = slapi_entry_attr_get_charptr(e, NS_IM_URL_TEXT_RETURN_TYPE); if (value) { entry->textReturnType = value; } - slapi_log_error(SLAPI_LOG_PLUGIN, PRESENCE_PLUGIN_SUBSYSTEM, "parseConfigEntry - nsIMURLTextReturnType [%s] \n",value); + slapi_log_err(SLAPI_LOG_PLUGIN, PRESENCE_PLUGIN_SUBSYSTEM, "parseConfigEntry - nsIMURLTextReturnType [%s] \n",value); value = slapi_entry_attr_get_charptr(e, NS_IM_URL_GRAPHIC_RETURN_TYPE); if (value) { entry->graphicReturnType = value; } - slapi_log_error(SLAPI_LOG_PLUGIN, PRESENCE_PLUGIN_SUBSYSTEM, "parseConfigEntry - nsIMURLGraphicReturnType [%s] \n",value); + slapi_log_err(SLAPI_LOG_PLUGIN, PRESENCE_PLUGIN_SUBSYSTEM, "parseConfigEntry - nsIMURLGraphicReturnType [%s] \n",value); /** * Finally add the entry to the map table @@ -686,8 +670,8 @@ static int imIDExists(Slapi_Entry *e, char *type, char **value, _Vmap **map, _Co _ConfigEntry *tEntry = NULL; _Vmap *tMap = NULL; - slapi_log_error(SLAPI_LOG_PLUGIN, PRESENCE_PLUGIN_SUBSYSTEM, "--> imIDExists \n",0,0,0); - slapi_log_error(SLAPI_LOG_PLUGIN, PRESENCE_PLUGIN_SUBSYSTEM, "imIDExists - Type [%s] \n",type,0,0); + slapi_log_err(SLAPI_LOG_PLUGIN, PRESENCE_PLUGIN_SUBSYSTEM, "--> imIDExists \n",0,0,0); + slapi_log_err(SLAPI_LOG_PLUGIN, PRESENCE_PLUGIN_SUBSYSTEM, "imIDExists - Type [%s] \n",type,0,0); /** * The public function PL_HashTableLookup modifies the @@ -703,7 +687,7 @@ static int imIDExists(Slapi_Entry *e, char *type, char **value, _Vmap **map, _Co * this should not happen but no harm we just return */ status = PRESENCE_FAILURE; - slapi_log_error(SLAPI_LOG_ERR, PRESENCE_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_ERR, PRESENCE_PLUGIN_SUBSYSTEM, "imIDExists - No hashtable for vattr types\n"); goto bail; } @@ -720,14 +704,14 @@ static int imIDExists(Slapi_Entry *e, char *type, char **value, _Vmap **map, _Co status = PRESENCE_FAILURE; goto bail; } - slapi_log_error(SLAPI_LOG_PLUGIN, PRESENCE_PLUGIN_SUBSYSTEM, "-imIDExists - Value [%s] \n",tValue,0,0); + slapi_log_err(SLAPI_LOG_PLUGIN, PRESENCE_PLUGIN_SUBSYSTEM, "-imIDExists - Value [%s] \n",tValue,0,0); tEntry = PL_HashTableLookupConst(_IdConfigMapTable, tMap->imID); *value = tValue; *entry = tEntry; *map = tMap; - slapi_log_error(SLAPI_LOG_PLUGIN, PRESENCE_PLUGIN_SUBSYSTEM, "<-- imIDExists \n"); + slapi_log_err(SLAPI_LOG_PLUGIN, PRESENCE_PLUGIN_SUBSYSTEM, "<-- imIDExists \n"); bail: return status; @@ -741,7 +725,7 @@ static int makeHttpRequest(char *id, _Vmap *map, _ConfigEntry *info, char **BUF, char *urltosend = NULL; int bytesRead; - slapi_log_error(SLAPI_LOG_PLUGIN, PRESENCE_PLUGIN_SUBSYSTEM, "--> makeHttpRequest\n"); + slapi_log_err(SLAPI_LOG_PLUGIN, PRESENCE_PLUGIN_SUBSYSTEM, "--> makeHttpRequest\n"); if (map->syntax == PRESENCE_STRING) { url = info->textURL; @@ -754,14 +738,14 @@ static int makeHttpRequest(char *id, _Vmap *map, _ConfigEntry *info, char **BUF, } urltosend = replaceIdWithValue(url, map->imID, id); - slapi_log_error(SLAPI_LOG_PLUGIN, PRESENCE_PLUGIN_SUBSYSTEM, "makeHttpRequest - URL [%s] \n",urltosend); + slapi_log_err(SLAPI_LOG_PLUGIN, PRESENCE_PLUGIN_SUBSYSTEM, "makeHttpRequest - URL [%s] \n",urltosend); /** * make an actual HTTP call now */ - slapi_log_error(SLAPI_LOG_PLUGIN, PRESENCE_PLUGIN_SUBSYSTEM, "makeHttpRequest - RequestMethod [%s] \n", info->requestMethod); - slapi_log_error(SLAPI_LOG_PLUGIN, PRESENCE_PLUGIN_SUBSYSTEM, "makeHttpRequest - Syntax [%d] \n", map->syntax); - slapi_log_error(SLAPI_LOG_PLUGIN, PRESENCE_PLUGIN_SUBSYSTEM, "makeHttpRequest - TextReturnType [%s] \n", info->textReturnType); - slapi_log_error(SLAPI_LOG_PLUGIN, PRESENCE_PLUGIN_SUBSYSTEM, "makeHttpRequest - GraphicReturnType [%s] \n", info->graphicReturnType); + slapi_log_err(SLAPI_LOG_PLUGIN, PRESENCE_PLUGIN_SUBSYSTEM, "makeHttpRequest - RequestMethod [%s] \n", info->requestMethod); + slapi_log_err(SLAPI_LOG_PLUGIN, PRESENCE_PLUGIN_SUBSYSTEM, "makeHttpRequest - Syntax [%d] \n", map->syntax); + slapi_log_err(SLAPI_LOG_PLUGIN, PRESENCE_PLUGIN_SUBSYSTEM, "makeHttpRequest - TextReturnType [%s] \n", info->textReturnType); + slapi_log_err(SLAPI_LOG_PLUGIN, PRESENCE_PLUGIN_SUBSYSTEM, "makeHttpRequest - GraphicReturnType [%s] \n", info->graphicReturnType); if (!strcasecmp(info->requestMethod, PRESENCE_REQUEST_METHOD_GET)) { if (map->syntax == PRESENCE_STRING) { if (!strcasecmp(info->textReturnType, PRESENCE_TEXT_RETURN_TYPE)) { @@ -786,7 +770,7 @@ static int makeHttpRequest(char *id, _Vmap *map, _ConfigEntry *info, char **BUF, * properly checked and throw warning/errors in case * of any invalid entry */ - slapi_log_error(SLAPI_LOG_ERR, PRESENCE_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_ERR, PRESENCE_PLUGIN_SUBSYSTEM, "makeHttpRequest - Unknown request type <%s>\n", info->requestMethod); status = PRESENCE_FAILURE; goto bail; @@ -798,7 +782,7 @@ static int makeHttpRequest(char *id, _Vmap *map, _ConfigEntry *info, char **BUF, } bail: - slapi_log_error(SLAPI_LOG_PLUGIN, PRESENCE_PLUGIN_SUBSYSTEM, "<-- makeHttpRequest:: <%d>\n",status,0,0); + slapi_log_err(SLAPI_LOG_PLUGIN, PRESENCE_PLUGIN_SUBSYSTEM, "<-- makeHttpRequest:: <%d>\n",status,0,0); slapi_ch_free((void**)&urltosend); return status; @@ -870,7 +854,7 @@ static int setIMStatus(char *id, _Vmap *map, _ConfigEntry *info, Slapi_Attr *attr = NULL; const struct berval *tmp = NULL; - slapi_log_error(SLAPI_LOG_PLUGIN, PRESENCE_PLUGIN_SUBSYSTEM, "--> setIMStatus \n"); + slapi_log_err(SLAPI_LOG_PLUGIN, PRESENCE_PLUGIN_SUBSYSTEM, "--> setIMStatus \n"); /** * we got some data back so lets try to map it to * the existing set of on/off data @@ -913,15 +897,15 @@ static int setIMStatus(char *id, _Vmap *map, _ConfigEntry *info, bval.bv_val = returnedBUF; value1 = slapi_value_new_berval(&bval); - slapi_log_error(SLAPI_LOG_PLUGIN, PRESENCE_PLUGIN_SUBSYSTEM, "setIMStatus - returned size [%d] \n", bval.bv_len); - slapi_log_error(SLAPI_LOG_PLUGIN, PRESENCE_PLUGIN_SUBSYSTEM, "setIMStatus - returned value [%s] \n", bval.bv_val); + slapi_log_err(SLAPI_LOG_PLUGIN, PRESENCE_PLUGIN_SUBSYSTEM, "setIMStatus - returned size [%d] \n", bval.bv_len); + slapi_log_err(SLAPI_LOG_PLUGIN, PRESENCE_PLUGIN_SUBSYSTEM, "setIMStatus - returned value [%s] \n", bval.bv_val); attr = info->onGraphicMap; if (attr) { slapi_attr_first_value(attr, &value2); tmp = slapi_value_get_berval(value2); - slapi_log_error(SLAPI_LOG_PLUGIN, PRESENCE_PLUGIN_SUBSYSTEM, "setIMStatus - Stored size [%d] \n", tmp->bv_len); - slapi_log_error(SLAPI_LOG_PLUGIN, PRESENCE_PLUGIN_SUBSYSTEM, "setIMStatus - Stored value [%s] \n", tmp->bv_val); + slapi_log_err(SLAPI_LOG_PLUGIN, PRESENCE_PLUGIN_SUBSYSTEM, "setIMStatus - Stored size [%d] \n", tmp->bv_len); + slapi_log_err(SLAPI_LOG_PLUGIN, PRESENCE_PLUGIN_SUBSYSTEM, "setIMStatus - Stored value [%s] \n", tmp->bv_val); if (!slapi_value_compare(attr, value1, value2)) { value = slapi_value_new_string(PRESENCE_RETURNED_ON_TEXT); } @@ -954,7 +938,7 @@ static int setIMStatus(char *id, _Vmap *map, _ConfigEntry *info, */ value = slapi_value_new_string(PRESENCE_RETURNED_ERROR_TEXT); } - slapi_log_error(SLAPI_LOG_PLUGIN, PRESENCE_PLUGIN_SUBSYSTEM, "setIMStatus - value [%s] \n", returnedBUF); + slapi_log_err(SLAPI_LOG_PLUGIN, PRESENCE_PLUGIN_SUBSYSTEM, "setIMStatus - value [%s] \n", returnedBUF); } else { /** * we had send a request for image @@ -962,7 +946,7 @@ static int setIMStatus(char *id, _Vmap *map, _ConfigEntry *info, * return instead of analyzing it */ if (!strcasecmp(info->graphicReturnType, PRESENCE_TEXT_RETURN_TYPE)) { - slapi_log_error(SLAPI_LOG_PLUGIN, PRESENCE_PLUGIN_SUBSYSTEM, "setIMStatus - value [%s] \n", returnedBUF); + slapi_log_err(SLAPI_LOG_PLUGIN, PRESENCE_PLUGIN_SUBSYSTEM, "setIMStatus - value [%s] \n", returnedBUF); if (!strcasecmp(info->requestMethod, PRESENCE_REQUEST_METHOD_REDIRECT)) { /** * a redirect case in which we should probably have a @@ -997,7 +981,7 @@ static int setIMStatus(char *id, _Vmap *map, _ConfigEntry *info, */ } } else { - slapi_log_error(SLAPI_LOG_PLUGIN, PRESENCE_PLUGIN_SUBSYSTEM, "setIMStatus - value [%s] \n", returnedBUF); + slapi_log_err(SLAPI_LOG_PLUGIN, PRESENCE_PLUGIN_SUBSYSTEM, "setIMStatus - value [%s] \n", returnedBUF); bval.bv_len = size; bval.bv_val = returnedBUF; value = slapi_value_new_berval(&bval); @@ -1018,7 +1002,7 @@ static int setIMStatus(char *id, _Vmap *map, _ConfigEntry *info, if (value && map->syntax == PRESENCE_STRING) { slapi_value_free(&value); } - slapi_log_error(SLAPI_LOG_PLUGIN, PRESENCE_PLUGIN_SUBSYSTEM, "<-- setIMStatus \n"); + slapi_log_err(SLAPI_LOG_PLUGIN, PRESENCE_PLUGIN_SUBSYSTEM, "<-- setIMStatus \n"); return status; } @@ -1037,7 +1021,7 @@ static int setTypes(PLHashEntry *he, PRIntn i, void *arg) _Vmap *map = (_Vmap *)he->value; char *id = map->imID; - slapi_log_error(SLAPI_LOG_PLUGIN, PRESENCE_PLUGIN_SUBSYSTEM, "--> setTypes \n"); + slapi_log_err(SLAPI_LOG_PLUGIN, PRESENCE_PLUGIN_SUBSYSTEM, "--> setTypes \n"); status = slapi_vattr_values_get_sp(NULL, args->entry, id, &results, &type_name_disposition, &actual_type_name, 0, &free_flags); if(status == PRESENCE_SUCCESS) @@ -1052,9 +1036,9 @@ static int setTypes(PLHashEntry *he, PRIntn i, void *arg) slapi_vattr_values_free(&results, &actual_type_name, free_flags); - slapi_log_error(SLAPI_LOG_PLUGIN, PRESENCE_PLUGIN_SUBSYSTEM, "setTypes - ID [%s] Type[%s]\n", actual_type_name,type); + slapi_log_err(SLAPI_LOG_PLUGIN, PRESENCE_PLUGIN_SUBSYSTEM, "setTypes - ID [%s] Type[%s]\n", actual_type_name,type); } - slapi_log_error(SLAPI_LOG_PLUGIN, PRESENCE_PLUGIN_SUBSYSTEM, "<-- setTypes \n"); + slapi_log_err(SLAPI_LOG_PLUGIN, PRESENCE_PLUGIN_SUBSYSTEM, "<-- setTypes \n"); return HT_ENUMERATE_NEXT; } @@ -1066,20 +1050,20 @@ logGraphicAttributeValue( Slapi_Attr *attr, const char *attrname ) Slapi_Value *val = NULL; const struct berval *v = NULL; - if ( LDAPDebugLevelIsSet( LDAP_DEBUG_PLUGIN )) { + if ( loglevel_is_set( LDAP_DEBUG_PLUGIN )) { slapi_attr_first_value(attr, &val); v = slapi_value_get_berval(val); if (v) { char *ldifvalue; - slapi_log_error(SLAPI_LOG_PLUGIN, PRESENCE_PLUGIN_SUBSYSTEM, "logGraphicAttributeValue - %s size [%d] \n", + slapi_log_err(SLAPI_LOG_PLUGIN, PRESENCE_PLUGIN_SUBSYSTEM, "logGraphicAttributeValue - %s size [%d] \n", attrname,v->bv_len); ldifvalue = ldif_type_and_value_with_options( (char *)attrname, /* XXX: had to cast away const */ v->bv_val, v->bv_len, 0 ); if ( NULL != ldifvalue ) { - slapi_log_error(SLAPI_LOG_PLUGIN, PRESENCE_PLUGIN_SUBSYSTEM, "logGraphicAttributeValue - %s value [\n%s]\n", + slapi_log_err(SLAPI_LOG_PLUGIN, PRESENCE_PLUGIN_SUBSYSTEM, "logGraphicAttributeValue - %s value [\n%s]\n", attrname,ldifvalue); slapi_ch_free_string( &ldifvalue ); } diff --git a/ldap/servers/plugins/pwdstorage/md5_pwd.c b/ldap/servers/plugins/pwdstorage/md5_pwd.c index 0bc8f3c..a2b374b 100644 --- a/ldap/servers/plugins/pwdstorage/md5_pwd.c +++ b/ldap/servers/plugins/pwdstorage/md5_pwd.c @@ -40,7 +40,7 @@ md5_pw_cmp( const char *userpwd, const char *dbpwd ) ctx = PK11_CreateDigestContext(SEC_OID_MD5); if (ctx == NULL) { - slapi_log_error(SLAPI_LOG_PLUGIN, MD5_SUBSYSTEM_NAME, + slapi_log_err(SLAPI_LOG_PLUGIN, MD5_SUBSYSTEM_NAME, "Could not create context for digest operation for password compare"); goto loser; } @@ -59,7 +59,7 @@ md5_pw_cmp( const char *userpwd, const char *dbpwd ) if (bver) { rc = strcmp(bver,dbpwd); } else { - slapi_log_error(SLAPI_LOG_PLUGIN, MD5_SUBSYSTEM_NAME, + slapi_log_err(SLAPI_LOG_PLUGIN, MD5_SUBSYSTEM_NAME, "Could not base64 encode hashed value for password compare"); } loser: @@ -78,7 +78,7 @@ md5_pw_enc( const char *pwd ) ctx = PK11_CreateDigestContext(SEC_OID_MD5); if (ctx == NULL) { - slapi_log_error(SLAPI_LOG_PLUGIN, MD5_SUBSYSTEM_NAME, + slapi_log_err(SLAPI_LOG_PLUGIN, MD5_SUBSYSTEM_NAME, "Could not create context for digest operation for password encoding"); return NULL; } @@ -97,7 +97,7 @@ md5_pw_enc( const char *pwd ) enc = slapi_ch_smprintf("%c%s%c%s", PWD_HASH_PREFIX_START, MD5_SCHEME_NAME, PWD_HASH_PREFIX_END, bver ); } else { - slapi_log_error(SLAPI_LOG_PLUGIN, MD5_SUBSYSTEM_NAME, + slapi_log_err(SLAPI_LOG_PLUGIN, MD5_SUBSYSTEM_NAME, "Could not base64 encode hashed value for password encoding"); } diff --git a/ldap/servers/plugins/pwdstorage/pwd_init.c b/ldap/servers/plugins/pwdstorage/pwd_init.c index 14ac643..5efd9ca 100644 --- a/ldap/servers/plugins/pwdstorage/pwd_init.c +++ b/ldap/servers/plugins/pwdstorage/pwd_init.c @@ -51,7 +51,7 @@ sha_pwd_storage_scheme_init( Slapi_PBlock *pb ) { int rc; - slapi_log_error(SLAPI_LOG_PLUGIN, plugin_name, "=> sha_pwd_storage_scheme_init\n" ); + slapi_log_err(SLAPI_LOG_PLUGIN, plugin_name, "=> sha_pwd_storage_scheme_init\n" ); rc = slapi_pblock_set( pb, SLAPI_PLUGIN_VERSION, (void *) SLAPI_PLUGIN_VERSION_01 ); @@ -64,7 +64,7 @@ sha_pwd_storage_scheme_init( Slapi_PBlock *pb ) rc |= slapi_pblock_set( pb, SLAPI_PLUGIN_PWD_STORAGE_SCHEME_NAME, "SHA" ); - slapi_log_error(SLAPI_LOG_PLUGIN, plugin_name, "<= sha_pwd_storage_scheme_init %d\n\n", rc ); + slapi_log_err(SLAPI_LOG_PLUGIN, plugin_name, "<= sha_pwd_storage_scheme_init %d\n\n", rc ); return( rc ); } @@ -74,7 +74,7 @@ ssha_pwd_storage_scheme_init( Slapi_PBlock *pb ) { int rc; - slapi_log_error(SLAPI_LOG_PLUGIN, plugin_name, "=> ssha_pwd_storage_scheme_init\n" ); + slapi_log_err(SLAPI_LOG_PLUGIN, plugin_name, "=> ssha_pwd_storage_scheme_init\n" ); rc = slapi_pblock_set( pb, SLAPI_PLUGIN_VERSION, (void *) SLAPI_PLUGIN_VERSION_01 ); @@ -87,7 +87,7 @@ ssha_pwd_storage_scheme_init( Slapi_PBlock *pb ) rc |= slapi_pblock_set( pb, SLAPI_PLUGIN_PWD_STORAGE_SCHEME_NAME, "SSHA" ); - slapi_log_error(SLAPI_LOG_PLUGIN, plugin_name, "<= ssha_pwd_storage_scheme_init %d\n\n", rc ); + slapi_log_err(SLAPI_LOG_PLUGIN, plugin_name, "<= ssha_pwd_storage_scheme_init %d\n\n", rc ); return( rc ); } @@ -96,7 +96,7 @@ sha256_pwd_storage_scheme_init( Slapi_PBlock *pb ) { int rc; - slapi_log_error(SLAPI_LOG_PLUGIN, plugin_name, "=> sha256_pwd_storage_scheme_init\n" ); + slapi_log_err(SLAPI_LOG_PLUGIN, plugin_name, "=> sha256_pwd_storage_scheme_init\n" ); rc = slapi_pblock_set( pb, SLAPI_PLUGIN_VERSION, (void *) SLAPI_PLUGIN_VERSION_01 ); @@ -109,7 +109,7 @@ sha256_pwd_storage_scheme_init( Slapi_PBlock *pb ) rc |= slapi_pblock_set( pb, SLAPI_PLUGIN_PWD_STORAGE_SCHEME_NAME, "SHA256" ); - slapi_log_error(SLAPI_LOG_PLUGIN, plugin_name, "<= sha256_pwd_storage_scheme_init %d\n\n", rc ); + slapi_log_err(SLAPI_LOG_PLUGIN, plugin_name, "<= sha256_pwd_storage_scheme_init %d\n\n", rc ); return( rc ); } @@ -119,7 +119,7 @@ ssha256_pwd_storage_scheme_init( Slapi_PBlock *pb ) { int rc; - slapi_log_error(SLAPI_LOG_PLUGIN, plugin_name, "=> ssha256_pwd_storage_scheme_init\n" ); + slapi_log_err(SLAPI_LOG_PLUGIN, plugin_name, "=> ssha256_pwd_storage_scheme_init\n" ); rc = slapi_pblock_set( pb, SLAPI_PLUGIN_VERSION, (void *) SLAPI_PLUGIN_VERSION_01 ); @@ -132,7 +132,7 @@ ssha256_pwd_storage_scheme_init( Slapi_PBlock *pb ) rc |= slapi_pblock_set( pb, SLAPI_PLUGIN_PWD_STORAGE_SCHEME_NAME, "SSHA256" ); - slapi_log_error(SLAPI_LOG_PLUGIN, plugin_name, "<= ssha256_pwd_storage_scheme_init %d\n\n", rc ); + slapi_log_err(SLAPI_LOG_PLUGIN, plugin_name, "<= ssha256_pwd_storage_scheme_init %d\n\n", rc ); return( rc ); } @@ -141,7 +141,7 @@ sha384_pwd_storage_scheme_init( Slapi_PBlock *pb ) { int rc; - slapi_log_error(SLAPI_LOG_PLUGIN, plugin_name, "=> sha384_pwd_storage_scheme_init\n" ); + slapi_log_err(SLAPI_LOG_PLUGIN, plugin_name, "=> sha384_pwd_storage_scheme_init\n" ); rc = slapi_pblock_set( pb, SLAPI_PLUGIN_VERSION, (void *) SLAPI_PLUGIN_VERSION_01 ); @@ -154,7 +154,7 @@ sha384_pwd_storage_scheme_init( Slapi_PBlock *pb ) rc |= slapi_pblock_set( pb, SLAPI_PLUGIN_PWD_STORAGE_SCHEME_NAME, "SHA384" ); - slapi_log_error(SLAPI_LOG_PLUGIN, plugin_name, "<= sha384_pwd_storage_scheme_init %d\n\n", rc ); + slapi_log_err(SLAPI_LOG_PLUGIN, plugin_name, "<= sha384_pwd_storage_scheme_init %d\n\n", rc ); return( rc ); } @@ -164,7 +164,7 @@ ssha384_pwd_storage_scheme_init( Slapi_PBlock *pb ) { int rc; - slapi_log_error(SLAPI_LOG_PLUGIN, plugin_name, "=> ssha384_pwd_storage_scheme_init\n" ); + slapi_log_err(SLAPI_LOG_PLUGIN, plugin_name, "=> ssha384_pwd_storage_scheme_init\n" ); rc = slapi_pblock_set( pb, SLAPI_PLUGIN_VERSION, (void *) SLAPI_PLUGIN_VERSION_01 ); @@ -177,7 +177,7 @@ ssha384_pwd_storage_scheme_init( Slapi_PBlock *pb ) rc |= slapi_pblock_set( pb, SLAPI_PLUGIN_PWD_STORAGE_SCHEME_NAME, "SSHA384" ); - slapi_log_error(SLAPI_LOG_PLUGIN, plugin_name, "<= ssha384_pwd_storage_scheme_init %d\n\n", rc ); + slapi_log_err(SLAPI_LOG_PLUGIN, plugin_name, "<= ssha384_pwd_storage_scheme_init %d\n\n", rc ); return( rc ); } @@ -186,7 +186,7 @@ sha512_pwd_storage_scheme_init( Slapi_PBlock *pb ) { int rc; - slapi_log_error(SLAPI_LOG_PLUGIN, plugin_name, "=> sha512_pwd_storage_scheme_init\n" ); + slapi_log_err(SLAPI_LOG_PLUGIN, plugin_name, "=> sha512_pwd_storage_scheme_init\n" ); rc = slapi_pblock_set( pb, SLAPI_PLUGIN_VERSION, (void *) SLAPI_PLUGIN_VERSION_01 ); @@ -199,7 +199,7 @@ sha512_pwd_storage_scheme_init( Slapi_PBlock *pb ) rc |= slapi_pblock_set( pb, SLAPI_PLUGIN_PWD_STORAGE_SCHEME_NAME, "SHA512" ); - slapi_log_error(SLAPI_LOG_PLUGIN, plugin_name, "<= sha512_pwd_storage_scheme_init %d\n\n", rc ); + slapi_log_err(SLAPI_LOG_PLUGIN, plugin_name, "<= sha512_pwd_storage_scheme_init %d\n\n", rc ); return( rc ); } @@ -209,7 +209,7 @@ ssha512_pwd_storage_scheme_init( Slapi_PBlock *pb ) { int rc; - slapi_log_error(SLAPI_LOG_PLUGIN, plugin_name, "=> ssha512_pwd_storage_scheme_init\n" ); + slapi_log_err(SLAPI_LOG_PLUGIN, plugin_name, "=> ssha512_pwd_storage_scheme_init\n" ); rc = slapi_pblock_set( pb, SLAPI_PLUGIN_VERSION, (void *) SLAPI_PLUGIN_VERSION_01 ); @@ -222,7 +222,7 @@ ssha512_pwd_storage_scheme_init( Slapi_PBlock *pb ) rc |= slapi_pblock_set( pb, SLAPI_PLUGIN_PWD_STORAGE_SCHEME_NAME, "SSHA512" ); - slapi_log_error(SLAPI_LOG_PLUGIN, plugin_name, "<= ssha512_pwd_storage_scheme_init %d\n\n", rc ); + slapi_log_err(SLAPI_LOG_PLUGIN, plugin_name, "<= ssha512_pwd_storage_scheme_init %d\n\n", rc ); return( rc ); } @@ -231,7 +231,7 @@ crypt_pwd_storage_scheme_init( Slapi_PBlock *pb ) { int rc; - slapi_log_error(SLAPI_LOG_PLUGIN, plugin_name, "=> crypt_pwd_storage_scheme_init\n" ); + slapi_log_err(SLAPI_LOG_PLUGIN, plugin_name, "=> crypt_pwd_storage_scheme_init\n" ); crypt_init(); rc = slapi_pblock_set( pb, SLAPI_PLUGIN_VERSION, @@ -245,7 +245,7 @@ crypt_pwd_storage_scheme_init( Slapi_PBlock *pb ) rc |= slapi_pblock_set( pb, SLAPI_PLUGIN_PWD_STORAGE_SCHEME_NAME, "CRYPT" ); - slapi_log_error(SLAPI_LOG_PLUGIN, plugin_name, "<= crypt_pwd_storage_scheme_init %d\n\n", rc ); + slapi_log_err(SLAPI_LOG_PLUGIN, plugin_name, "<= crypt_pwd_storage_scheme_init %d\n\n", rc ); return( rc ); } @@ -254,7 +254,7 @@ clear_pwd_storage_scheme_init( Slapi_PBlock *pb ) { int rc; - slapi_log_error(SLAPI_LOG_PLUGIN, plugin_name, "=> clear_pwd_storage_scheme_init\n" ); + slapi_log_err(SLAPI_LOG_PLUGIN, plugin_name, "=> clear_pwd_storage_scheme_init\n" ); rc = slapi_pblock_set( pb, SLAPI_PLUGIN_VERSION, (void *) SLAPI_PLUGIN_VERSION_01 ); @@ -267,7 +267,7 @@ clear_pwd_storage_scheme_init( Slapi_PBlock *pb ) rc |= slapi_pblock_set( pb, SLAPI_PLUGIN_PWD_STORAGE_SCHEME_NAME, "CLEAR" ); - slapi_log_error(SLAPI_LOG_PLUGIN, plugin_name, "<= clear_pwd_storage_scheme_init %d\n\n", rc ); + slapi_log_err(SLAPI_LOG_PLUGIN, plugin_name, "<= clear_pwd_storage_scheme_init %d\n\n", rc ); return( rc ); } @@ -276,7 +276,7 @@ ns_mta_md5_pwd_storage_scheme_init( Slapi_PBlock *pb ) { int rc; - slapi_log_error(SLAPI_LOG_PLUGIN, plugin_name, "=> ns_mta_md5_pwd_storage_scheme_init\n" ); + slapi_log_err(SLAPI_LOG_PLUGIN, plugin_name, "=> ns_mta_md5_pwd_storage_scheme_init\n" ); rc = slapi_pblock_set( pb, SLAPI_PLUGIN_VERSION, (void *) SLAPI_PLUGIN_VERSION_01 ); @@ -289,7 +289,7 @@ ns_mta_md5_pwd_storage_scheme_init( Slapi_PBlock *pb ) rc |= slapi_pblock_set( pb, SLAPI_PLUGIN_PWD_STORAGE_SCHEME_NAME, "NS-MTA-MD5" ); - slapi_log_error(SLAPI_LOG_PLUGIN, plugin_name, "<= ns_mta_md5_pwd_storage_scheme_init %d\n\n", rc ); + slapi_log_err(SLAPI_LOG_PLUGIN, plugin_name, "<= ns_mta_md5_pwd_storage_scheme_init %d\n\n", rc ); return( rc ); } @@ -298,7 +298,7 @@ md5_pwd_storage_scheme_init( Slapi_PBlock *pb ) { int rc; - slapi_log_error(SLAPI_LOG_PLUGIN, plugin_name, "=> md5_pwd_storage_scheme_init\n" ); + slapi_log_err(SLAPI_LOG_PLUGIN, plugin_name, "=> md5_pwd_storage_scheme_init\n" ); rc = slapi_pblock_set( pb, SLAPI_PLUGIN_VERSION, (void *) SLAPI_PLUGIN_VERSION_01 ); @@ -311,7 +311,7 @@ md5_pwd_storage_scheme_init( Slapi_PBlock *pb ) rc |= slapi_pblock_set( pb, SLAPI_PLUGIN_PWD_STORAGE_SCHEME_NAME, "MD5" ); - slapi_log_error(SLAPI_LOG_PLUGIN, plugin_name, "<= md5_pwd_storage_scheme_init %d\n\n", rc ); + slapi_log_err(SLAPI_LOG_PLUGIN, plugin_name, "<= md5_pwd_storage_scheme_init %d\n\n", rc ); return( rc ); } @@ -320,7 +320,7 @@ smd5_pwd_storage_scheme_init( Slapi_PBlock *pb ) { int rc; - slapi_log_error(SLAPI_LOG_PLUGIN, plugin_name, "=> smd5_pwd_storage_scheme_init\n" ); + slapi_log_err(SLAPI_LOG_PLUGIN, plugin_name, "=> smd5_pwd_storage_scheme_init\n" ); rc = slapi_pblock_set( pb, SLAPI_PLUGIN_VERSION, (void *) SLAPI_PLUGIN_VERSION_01 ); @@ -333,6 +333,6 @@ smd5_pwd_storage_scheme_init( Slapi_PBlock *pb ) rc |= slapi_pblock_set( pb, SLAPI_PLUGIN_PWD_STORAGE_SCHEME_NAME, "SMD5" ); - slapi_log_error(SLAPI_LOG_PLUGIN, plugin_name, "<= smd5_pwd_storage_scheme_init %d\n\n", rc ); + slapi_log_err(SLAPI_LOG_PLUGIN, plugin_name, "<= smd5_pwd_storage_scheme_init %d\n\n", rc ); return( rc ); } diff --git a/ldap/servers/plugins/pwdstorage/sha_pwd.c b/ldap/servers/plugins/pwdstorage/sha_pwd.c index 3f624f8..30fe725 100644 --- a/ldap/servers/plugins/pwdstorage/sha_pwd.c +++ b/ldap/servers/plugins/pwdstorage/sha_pwd.c @@ -99,7 +99,7 @@ sha_pw_cmp (const char *userpwd, const char *dbpwd, unsigned int shaLen ) } hashresult = PL_Base64Decode( dbpwd, dbpwd_len, dbhash ); if (NULL == hashresult) { - slapi_log_error(SLAPI_LOG_PLUGIN, plugin_name, hasherrmsg, schemeName, dbpwd ); + slapi_log_err(SLAPI_LOG_PLUGIN, plugin_name, hasherrmsg, schemeName, dbpwd ); goto loser; } else if ( hash_len >= shaLen ) { /* must be salted */ salt.bv_val = (void*)(dbhash + shaLen); /* salt starts after hash value */ @@ -108,14 +108,14 @@ sha_pw_cmp (const char *userpwd, const char *dbpwd, unsigned int shaLen ) salt.bv_val = (void*)dbhash; salt.bv_len = OLD_SALT_LENGTH; } else { /* unsupported, invalid BASE64 (hash_len < 0), or similar */ - slapi_log_error(SLAPI_LOG_PLUGIN, plugin_name, hasherrmsg, schemeName, dbpwd ); + slapi_log_err(SLAPI_LOG_PLUGIN, plugin_name, hasherrmsg, schemeName, dbpwd ); goto loser; } /* hash the user's key */ memset( userhash, 0, sizeof(userhash) ); if ( sha_salted_hash( userhash, userpwd, &salt, secOID ) != SECSuccess ) { - slapi_log_error(SLAPI_LOG_PLUGIN, plugin_name, "sha_pw_cmp: sha_salted_hash() failed\n"); + slapi_log_err(SLAPI_LOG_PLUGIN, plugin_name, "sha_pw_cmp: sha_salted_hash() failed\n"); goto loser; } diff --git a/ldap/servers/plugins/pwdstorage/smd5_pwd.c b/ldap/servers/plugins/pwdstorage/smd5_pwd.c index 128c2c3..1309d28 100644 --- a/ldap/servers/plugins/pwdstorage/smd5_pwd.c +++ b/ldap/servers/plugins/pwdstorage/smd5_pwd.c @@ -44,7 +44,7 @@ smd5_pw_cmp( const char *userpwd, const char *dbpwd ) ctx = PK11_CreateDigestContext(SEC_OID_MD5); if (ctx == NULL) { - slapi_log_error(SLAPI_LOG_PLUGIN, SALTED_MD5_SUBSYSTEM_NAME, + slapi_log_err(SLAPI_LOG_PLUGIN, SALTED_MD5_SUBSYSTEM_NAME, "Could not create context for digest operation for password compare"); goto loser; } @@ -62,7 +62,7 @@ smd5_pw_cmp( const char *userpwd, const char *dbpwd ) hashresult = PL_Base64Decode( dbpwd, 0, dbhash ); if (NULL == hashresult) { - slapi_log_error(SLAPI_LOG_PLUGIN, SALTED_MD5_SUBSYSTEM_NAME, + slapi_log_err(SLAPI_LOG_PLUGIN, SALTED_MD5_SUBSYSTEM_NAME, "smd5_pw_cmp: userPassword \"%s\" is the wrong length " "or is not properly encoded BASE64\n", dbpwd ); goto loser; @@ -101,7 +101,7 @@ smd5_pw_enc( const char *pwd ) ctx = PK11_CreateDigestContext(SEC_OID_MD5); if (ctx == NULL) { - slapi_log_error(SLAPI_LOG_PLUGIN, SALTED_MD5_SUBSYSTEM_NAME, + slapi_log_err(SLAPI_LOG_PLUGIN, SALTED_MD5_SUBSYSTEM_NAME, "Could not create context for digest operation for password encoding"); return NULL; } @@ -129,7 +129,7 @@ smd5_pw_enc( const char *pwd ) enc = slapi_ch_smprintf("%c%s%c%s", PWD_HASH_PREFIX_START, SALTED_MD5_SCHEME_NAME, PWD_HASH_PREFIX_END, bver ); } else { - slapi_log_error(SLAPI_LOG_PLUGIN, SALTED_MD5_SUBSYSTEM_NAME, + slapi_log_err(SLAPI_LOG_PLUGIN, SALTED_MD5_SUBSYSTEM_NAME, "Could not base64 encode hashed value for password encoding"); } diff --git a/ldap/servers/plugins/referint/referint.c b/ldap/servers/plugins/referint/referint.c index 4bd7432..e6af414 100644 --- a/ldap/servers/plugins/referint/referint.c +++ b/ldap/servers/plugins/referint/referint.c @@ -166,7 +166,7 @@ referint_postop_init( Slapi_PBlock *pb ) PR_ASSERT (referint_plugin_identity); if((config = (referint_config *)slapi_ch_calloc (1, sizeof (referint_config))) == NULL){ - slapi_log_error(SLAPI_LOG_ERR, REFERINT_PLUGIN_SUBSYSTEM, "referint_postop_init - Failed to " + slapi_log_err(SLAPI_LOG_ERR, REFERINT_PLUGIN_SUBSYSTEM, "referint_postop_init - Failed to " "allocate configuration\n" ); return ( -1 ); } @@ -203,7 +203,7 @@ referint_postop_init( Slapi_PBlock *pb ) plugin_EntryScope = (Slapi_DN **)slapi_ch_calloc(sizeof(Slapi_DN *),i+1); for (i=0; plugin_attr_values[i];i++) { if (slapi_dn_syntax_check(NULL, plugin_attr_values[i], 1) == 1) { - slapi_log_error(SLAPI_LOG_WARNING, REFERINT_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_WARNING, REFERINT_PLUGIN_SUBSYSTEM, "referint_postop_init - Ignoring invalid DN used as plugin entry scope: [%s]\n", plugin_attr_values[i]); slapi_ch_free_string(&plugin_attr_values[i]); @@ -216,7 +216,7 @@ referint_postop_init( Slapi_PBlock *pb ) plugin_attr_value = slapi_entry_attr_get_charptr(plugin_entry, "nsslapd-pluginExcludeEntryScope"); if(plugin_attr_value) { if (slapi_dn_syntax_check(NULL, plugin_attr_value, 1) == 1) { - slapi_log_error(SLAPI_LOG_WARNING, REFERINT_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_WARNING, REFERINT_PLUGIN_SUBSYSTEM, "referint_postop_init - Ignoring invalid DN used as plugin exclude entry scope: [%s]\n", plugin_attr_value); slapi_ch_free_string(&plugin_attr_value); @@ -228,7 +228,7 @@ referint_postop_init( Slapi_PBlock *pb ) plugin_attr_value = slapi_entry_attr_get_charptr(plugin_entry, "nsslapd-pluginContainerScope"); if(plugin_attr_value) { if (slapi_dn_syntax_check(NULL, plugin_attr_value, 1) == 1) { - slapi_log_error(SLAPI_LOG_ERR, REFERINT_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_ERR, REFERINT_PLUGIN_SUBSYSTEM, "referint_postop_init - Ignoring invalid DN used as plugin container scope: [%s]\n", plugin_attr_value); slapi_ch_free_string(&plugin_attr_value); @@ -248,7 +248,7 @@ referint_postop_init( Slapi_PBlock *pb ) slapi_pblock_set( pb, SLAPI_PLUGIN_START_FN, (void *) referint_postop_start ) != 0 || slapi_pblock_set( pb, SLAPI_PLUGIN_CLOSE_FN, (void *) referint_postop_close ) != 0) { - slapi_log_error(SLAPI_LOG_ERR, REFERINT_PLUGIN_SUBSYSTEM, "referint_postop_init - Failed\n" ); + slapi_log_err(SLAPI_LOG_ERR, REFERINT_PLUGIN_SUBSYSTEM, "referint_postop_init - Failed\n" ); return( -1 ); } @@ -263,7 +263,7 @@ referint_postop_init( Slapi_PBlock *pb ) NULL, /* ? */ referint_plugin_identity /* access control */)) { - slapi_log_error(SLAPI_LOG_ERR, REFERINT_PLUGIN_SUBSYSTEM, "referint_postop_init - Preop registration failed\n" ); + slapi_log_err(SLAPI_LOG_ERR, REFERINT_PLUGIN_SUBSYSTEM, "referint_postop_init - Preop registration failed\n" ); return ( -1 ); } @@ -300,13 +300,13 @@ load_config(Slapi_PBlock *pb, Slapi_Entry *config_entry, int apply) slapi_rwlock_wrlock(config_rwlock); if(config == NULL){ - slapi_log_error(SLAPI_LOG_ERR, REFERINT_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_ERR, REFERINT_PLUGIN_SUBSYSTEM, "load_config: config is NULL\n" ); rc = SLAPI_PLUGIN_FAILURE; goto done; } if((tmp_config = (referint_config *)slapi_ch_calloc (1, sizeof (referint_config))) == NULL){ - slapi_log_error(SLAPI_LOG_ERR, REFERINT_PLUGIN_SUBSYSTEM, "load_config - Failed to " + slapi_log_err(SLAPI_LOG_ERR, REFERINT_PLUGIN_SUBSYSTEM, "load_config - Failed to " "allocate configuration\n" ); rc = SLAPI_PLUGIN_FAILURE; goto done; @@ -338,19 +338,19 @@ load_config(Slapi_PBlock *pb, Slapi_Entry *config_entry, int apply) if(new_config_present){ /* Verify we have everything we need */ if(tmp_config->delay == -1){ - slapi_log_error(SLAPI_LOG_ERR, REFERINT_PLUGIN_SUBSYSTEM, "load_config - Plugin configuration is missing %s\n", + slapi_log_err(SLAPI_LOG_ERR, REFERINT_PLUGIN_SUBSYSTEM, "load_config - Plugin configuration is missing %s\n", REFERINT_ATTR_DELAY); rc = SLAPI_PLUGIN_FAILURE; } else if (!tmp_config->logfile){ - slapi_log_error(SLAPI_LOG_ERR, REFERINT_PLUGIN_SUBSYSTEM, "load_config - Plugin configuration is missing %s\n", + slapi_log_err(SLAPI_LOG_ERR, REFERINT_PLUGIN_SUBSYSTEM, "load_config - Plugin configuration is missing %s\n", REFERINT_ATTR_LOGFILE); rc = SLAPI_PLUGIN_FAILURE; } else if (tmp_config->logchanges == -1){ - slapi_log_error(SLAPI_LOG_ERR, REFERINT_PLUGIN_SUBSYSTEM, "load_config - Plugin configuration is missing %s\n", + slapi_log_err(SLAPI_LOG_ERR, REFERINT_PLUGIN_SUBSYSTEM, "load_config - Plugin configuration is missing %s\n", REFERINT_ATTR_LOGCHANGES); rc = SLAPI_PLUGIN_FAILURE; } else if (!tmp_config->attrs){ - slapi_log_error(SLAPI_LOG_ERR, REFERINT_PLUGIN_SUBSYSTEM, "load_config - Plugin configuration is missing %s\n", + slapi_log_err(SLAPI_LOG_ERR, REFERINT_PLUGIN_SUBSYSTEM, "load_config - Plugin configuration is missing %s\n", REFERINT_ATTR_MEMBERSHIP); rc = SLAPI_PLUGIN_FAILURE; } @@ -359,19 +359,19 @@ load_config(Slapi_PBlock *pb, Slapi_Entry *config_entry, int apply) * We are using the old plugin arg configuration, get the args */ if ( slapi_pblock_get( pb, SLAPI_PLUGIN_ARGC, &argc ) != 0) { - slapi_log_error(SLAPI_LOG_ERR, REFERINT_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_ERR, REFERINT_PLUGIN_SUBSYSTEM, "load_config - Failed to get argc\n" ); rc = SLAPI_PLUGIN_FAILURE; goto done; } if ( slapi_pblock_get( pb, SLAPI_PLUGIN_ARGV, &argv ) != 0) { - slapi_log_error(SLAPI_LOG_ERR, REFERINT_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_ERR, REFERINT_PLUGIN_SUBSYSTEM, "load_config - Failed to get argv\n" ); rc = SLAPI_PLUGIN_FAILURE; goto done; } if(argv == NULL){ - slapi_log_error(SLAPI_LOG_ERR, REFERINT_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_ERR, REFERINT_PLUGIN_SUBSYSTEM, "load_config - args are NULL\n" ); rc = SLAPI_PLUGIN_FAILURE; goto done; @@ -389,7 +389,7 @@ load_config(Slapi_PBlock *pb, Slapi_Entry *config_entry, int apply) slapi_ch_array_add(&tmp_config->attrs, slapi_ch_strdup(argv[i])); } } else { - slapi_log_error(SLAPI_LOG_ERR, REFERINT_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_ERR, REFERINT_PLUGIN_SUBSYSTEM, "load_config - Insufficient arguments supplied\n" ); rc = SLAPI_PLUGIN_FAILURE; goto done; @@ -431,7 +431,7 @@ referint_postop_modify(Slapi_PBlock *pb) if (referint_sdn_config_cmp(sdn) == 0 && slapi_sdn_compare(sdn, referint_get_plugin_area())) { if( SLAPI_PLUGIN_FAILURE == load_config(pb, entry, 1)){ - slapi_log_error(SLAPI_LOG_ERR, REFERINT_PLUGIN_SUBSYSTEM, "referint_postop_modify - " + slapi_log_err(SLAPI_LOG_ERR, REFERINT_PLUGIN_SUBSYSTEM, "referint_postop_modify - " "Failed to update configuration.\n"); return SLAPI_PLUGIN_FAILURE; } @@ -443,7 +443,7 @@ referint_postop_modify(Slapi_PBlock *pb) if((config_area = slapi_entry_attr_get_charptr(entry, SLAPI_PLUGIN_SHARED_CONFIG_AREA))){ rc = slapi_dn_syntax_check(pb, config_area, 1); if (rc) { /* syntax check failed */ - slapi_log_error(SLAPI_LOG_ERR, REFERINT_PLUGIN_SUBSYSTEM, "referint_postop_modify - " + slapi_log_err(SLAPI_LOG_ERR, REFERINT_PLUGIN_SUBSYSTEM, "referint_postop_modify - " "%s does not contain a valid DN (%s)\n", SLAPI_PLUGIN_SHARED_CONFIG_AREA, config_area); rc = LDAP_INVALID_DN_SYNTAX; @@ -454,7 +454,7 @@ referint_postop_modify(Slapi_PBlock *pb) if (LDAP_SUCCESS != result) { if (result == LDAP_NO_SUCH_OBJECT) { /* log an error and use the plugin entry for the config */ - slapi_log_error(SLAPI_LOG_PLUGIN, REFERINT_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_PLUGIN, REFERINT_PLUGIN_SUBSYSTEM, "referint_postop_modify - Config entry \"%s\" does " "not exist.\n", config_area); rc = LDAP_OPERATIONS_ERROR; @@ -464,7 +464,7 @@ referint_postop_modify(Slapi_PBlock *pb) if(e){ config_e = e; } else { - slapi_log_error(SLAPI_LOG_PLUGIN, REFERINT_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_PLUGIN, REFERINT_PLUGIN_SUBSYSTEM, "referint_postop_modify - Config entry \"%s\" was not located.\n", config_area); rc = LDAP_OPERATIONS_ERROR; goto bail; @@ -618,7 +618,7 @@ referint_postop_del( Slapi_PBlock *pb ) slapi_pblock_get( pb, SLAPI_DELETE_TARGET_SDN, &sdn ) != 0 || slapi_pblock_get(pb, SLAPI_PLUGIN_OPRETURN, &oprc) != 0) { - slapi_log_error(SLAPI_LOG_ERR, REFERINT_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_ERR, REFERINT_PLUGIN_SUBSYSTEM, "referint_postop_del - Could not get parameters\n" ); return SLAPI_PLUGIN_FAILURE; } @@ -671,7 +671,7 @@ referint_postop_modrdn( Slapi_PBlock *pb ) slapi_pblock_get( pb, SLAPI_MODRDN_NEWSUPERIOR_SDN, &newsuperior ) != 0 || slapi_pblock_get( pb, SLAPI_PLUGIN_OPRETURN, &oprc) != 0 ) { - slapi_log_error(SLAPI_LOG_ERR, REFERINT_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_ERR, REFERINT_PLUGIN_SUBSYSTEM, "referint_postop_modrdn - Could not get parameters\n" ); return SLAPI_PLUGIN_FAILURE; } @@ -792,7 +792,7 @@ _update_one_per_mod(Slapi_DN *entrySDN, /* DN of the searched entry */ list_of_mods[1] = NULL; rc = _do_modify(mod_pb, entrySDN, list_of_mods); if (rc) { - slapi_log_error(SLAPI_LOG_ERR, REFERINT_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_ERR, REFERINT_PLUGIN_SUBSYSTEM, "_update_one_per_mod - Entry %s: deleting \"%s: %s\" failed (%d)" "\n", slapi_sdn_get_dn(entrySDN), attrName, slapi_sdn_get_dn(origDN), rc); } @@ -803,14 +803,14 @@ _update_one_per_mod(Slapi_DN *entrySDN, /* DN of the searched entry */ Slapi_Value *v = NULL; if (NULL == origDN) { - slapi_log_error(SLAPI_LOG_ERR, REFERINT_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_ERR, REFERINT_PLUGIN_SUBSYSTEM, "_update_one_per_mod - NULL dn was passed\n"); goto bail; } /* need to put together rdn into a dn */ dnParts = slapi_ldap_explode_dn( slapi_sdn_get_dn(origDN), 0 ); if (NULL == dnParts) { - slapi_log_error(SLAPI_LOG_ERR, REFERINT_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_ERR, REFERINT_PLUGIN_SUBSYSTEM, "_update_one_per_mod - Failed to explode dn %s\n", slapi_sdn_get_dn(origDN)); goto bail; @@ -882,7 +882,7 @@ _update_one_per_mod(Slapi_DN *entrySDN, /* DN of the searched entry */ list_of_mods[2] = NULL; rc = _do_modify(mod_pb, entrySDN, list_of_mods); if (rc) { - slapi_log_error(SLAPI_LOG_ERR, REFERINT_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_ERR, REFERINT_PLUGIN_SUBSYSTEM, "_update_one_per_mod - Entry %s: replacing \"%s: %s\" " "with \"%s: %s\" failed (%d)\n", slapi_sdn_get_dn(entrySDN), attrName, @@ -912,7 +912,7 @@ _update_one_per_mod(Slapi_DN *entrySDN, /* DN of the searched entry */ list_of_mods[2] = NULL; rc = _do_modify(mod_pb, entrySDN, list_of_mods); if (rc) { - slapi_log_error(SLAPI_LOG_ERR, REFERINT_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_ERR, REFERINT_PLUGIN_SUBSYSTEM, "_update_one_per_mod - Entry %s: replacing \"%s: %s\" " "with \"%s: %s\" failed (%d)\n", slapi_sdn_get_dn(entrySDN), attrName, sval, attrName, newvalue, rc); @@ -975,7 +975,7 @@ _update_all_per_mod(Slapi_DN *entrySDN, /* DN of the searched entry */ mods[1] = NULL; rc = _do_modify(mod_pb, entrySDN, mods); if (rc) { - slapi_log_error(SLAPI_LOG_ERR, REFERINT_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_ERR, REFERINT_PLUGIN_SUBSYSTEM, "_update_all_per_mod - Entry %s: deleting \"%s: %s\" failed (%d)" "\n", slapi_sdn_get_dn(entrySDN), attrName, slapi_sdn_get_dn(origDN), rc); } @@ -986,14 +986,14 @@ _update_all_per_mod(Slapi_DN *entrySDN, /* DN of the searched entry */ Slapi_Value *v = NULL; if (NULL == origDN) { - slapi_log_error(SLAPI_LOG_ERR, REFERINT_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_ERR, REFERINT_PLUGIN_SUBSYSTEM, "_update_all_per_mod - NULL dn was passed\n"); goto bail; } /* need to put together rdn into a dn */ dnParts = slapi_ldap_explode_dn( slapi_sdn_get_dn(origDN), 0 ); if (NULL == dnParts) { - slapi_log_error(SLAPI_LOG_ERR, REFERINT_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_ERR, REFERINT_PLUGIN_SUBSYSTEM, "_update_all_per_mod - Failed to explode dn %s\n", slapi_sdn_get_dn(origDN)); goto bail; @@ -1070,7 +1070,7 @@ _update_all_per_mod(Slapi_DN *entrySDN, /* DN of the searched entry */ } rc = _do_modify(mod_pb, entrySDN, slapi_mods_get_ldapmods_byref(smods)); if (rc) { - slapi_log_error(SLAPI_LOG_ERR, REFERINT_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_ERR, REFERINT_PLUGIN_SUBSYSTEM, "_update_all_per_mod - Entry %s failed (%d)\n", slapi_sdn_get_dn(entrySDN), rc); } @@ -1220,7 +1220,7 @@ update_integrity(Slapi_DN *origSDN, } } else { if (isFatalSearchError(search_result)){ - slapi_log_error(SLAPI_LOG_ERR, REFERINT_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_ERR, REFERINT_PLUGIN_SUBSYSTEM, "update_integrity - Search (base=%s filter=%s) returned " "error %d\n", search_base, filter, search_result); rc = SLAPI_PLUGIN_FAILURE; @@ -1268,7 +1268,7 @@ int referint_postop_start( Slapi_PBlock *pb) int rc = 0; if((config_rwlock = slapi_new_rwlock()) == NULL){ - slapi_log_error(SLAPI_LOG_ERR, REFERINT_PLUGIN_SUBSYSTEM, "referint_postop_start - Failed to " + slapi_log_err(SLAPI_LOG_ERR, REFERINT_PLUGIN_SUBSYSTEM, "referint_postop_start - Failed to " "create rwlock.\n" ); return ( -1 ); } @@ -1281,7 +1281,7 @@ int referint_postop_start( Slapi_PBlock *pb) { rc = slapi_dn_syntax_check(pb, config_area, 1); if (rc) { /* syntax check failed */ - slapi_log_error(SLAPI_LOG_ERR, REFERINT_PLUGIN_SUBSYSTEM, "referint_postop_start - " + slapi_log_err(SLAPI_LOG_ERR, REFERINT_PLUGIN_SUBSYSTEM, "referint_postop_start - " "%s does not contain a valid DN (%s)\n", SLAPI_PLUGIN_SHARED_CONFIG_AREA, config_area); rc = LDAP_INVALID_DN_SYNTAX; @@ -1292,7 +1292,7 @@ int referint_postop_start( Slapi_PBlock *pb) if (LDAP_SUCCESS != result) { if (result == LDAP_NO_SUCH_OBJECT) { /* log an error and use the plugin entry for the config */ - slapi_log_error(SLAPI_LOG_PLUGIN, REFERINT_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_PLUGIN, REFERINT_PLUGIN_SUBSYSTEM, "referint_postop_start -Config entry \"%s\" does " "not exist.\n", config_area); rc = -1; @@ -1302,7 +1302,7 @@ int referint_postop_start( Slapi_PBlock *pb) if(e){ config_e = e; } else { - slapi_log_error(SLAPI_LOG_PLUGIN, REFERINT_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_PLUGIN, REFERINT_PLUGIN_SUBSYSTEM, "referint_postop_start - Config entry \"%s\" was not located.\n", config_area); rc = -1; goto bail; @@ -1339,7 +1339,7 @@ int referint_postop_start( Slapi_PBlock *pb) PR_UNJOINABLE_THREAD, SLAPD_DEFAULT_THREAD_STACKSIZE); if ( referint_tid == NULL ) { - slapi_log_error(SLAPI_LOG_ERR, REFERINT_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_ERR, REFERINT_PLUGIN_SUBSYSTEM, "referint_postop_start - PR_CreateThread failed\n" ); exit( 1 ); } @@ -1456,7 +1456,7 @@ referint_thread_func(void *arg) if (strcasecmp(ptoken, "NULL") != 0) { /* Set the bind DN in the thread data */ if(slapi_td_set_dn(slapi_ch_strdup(ptoken))){ - slapi_log_error(SLAPI_LOG_ERR, REFERINT_PLUGIN_SUBSYSTEM,"referint_thread_func - " + slapi_log_err(SLAPI_LOG_ERR, REFERINT_PLUGIN_SUBSYSTEM,"referint_thread_func - " "Failed to set thread data\n"); } } @@ -1472,7 +1472,7 @@ referint_thread_func(void *arg) /* remove the original file */ if( PR_SUCCESS != PR_Delete(logfilename) ){ - slapi_log_error(SLAPI_LOG_ERR, REFERINT_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_ERR, REFERINT_PLUGIN_SUBSYSTEM, "referint_thread_func - Could not delete \"%s\"\n", logfilename ); } @@ -1592,7 +1592,7 @@ writeintegritylog(Slapi_PBlock *pb, char *logfilename, Slapi_DN *sdn, if (( prfd = PR_Open( logfilename, PR_WRONLY | PR_CREATE_FILE | PR_APPEND, REFERINT_DEFAULT_FILE_MODE )) == NULL ) { - slapi_log_error(SLAPI_LOG_ERR, REFERINT_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_ERR, REFERINT_PLUGIN_SUBSYSTEM, "writeintegritylog - Could not write integrity log \"%s\" " SLAPI_COMPONENT_NAME_NSPR " %d (%s)\n", logfilename, PR_GetError(), slapd_pr_strerror(PR_GetError()) ); @@ -1638,7 +1638,7 @@ writeintegritylog(Slapi_PBlock *pb, char *logfilename, Slapi_DN *sdn, } if(len_to_write > MAX_LINE ){ - slapi_log_error(SLAPI_LOG_ERR, REFERINT_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_ERR, REFERINT_PLUGIN_SUBSYSTEM, "writeintegritylog - Could not write integrity log:" " line length exceeded. It will not be able" " to update references to this entry.\n"); @@ -1648,7 +1648,7 @@ writeintegritylog(Slapi_PBlock *pb, char *logfilename, Slapi_DN *sdn, (newsuperiordn != NULL) ? newsuperiordn : "NULL", requestordn ? requestordn : "NULL"); if (PR_Write(prfd,buffer,strlen(buffer)) < 0){ - slapi_log_error(SLAPI_LOG_ERR,REFERINT_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_ERR,REFERINT_PLUGIN_SUBSYSTEM, " writeintegritylog - PR_Write failed : The disk" " may be full or the file is unwritable :: NSPR error - %d\n", PR_GetError()); @@ -1658,7 +1658,7 @@ writeintegritylog(Slapi_PBlock *pb, char *logfilename, Slapi_DN *sdn, /* If file descriptor is closed successfully, PR_SUCCESS */ rc = PR_Close(prfd); if (rc != PR_SUCCESS){ - slapi_log_error(SLAPI_LOG_ERR,REFERINT_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_ERR,REFERINT_PLUGIN_SUBSYSTEM, " writeintegritylog - Failed to close the file descriptor prfd; NSPR error - %d\n", PR_GetError()); } @@ -1674,7 +1674,7 @@ referint_preop_init(Slapi_PBlock *pb) slapi_pblock_set(pb, SLAPI_PLUGIN_DESCRIPTION, (void *) &pdesc) != 0 || slapi_pblock_set(pb, premodfn, (void *)referint_validate_config) != 0) { - slapi_log_error(SLAPI_LOG_ERR, REFERINT_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_ERR, REFERINT_PLUGIN_SUBSYSTEM, "referint_preop_init - Failed to register plugin\n"); status = -1; } @@ -1702,7 +1702,7 @@ referint_validate_config(Slapi_PBlock *pb) slapi_pblock_get(pb, SLAPI_TARGET_SDN, &sdn); slapi_pblock_get(pb, SLAPI_ENTRY_PRE_OP, &pre_entry); if (!pre_entry) { - slapi_log_error(SLAPI_LOG_ERR, REFERINT_PLUGIN_SUBSYSTEM, "referint_validate_config - Null pre op entry.\n"); + slapi_log_err(SLAPI_LOG_ERR, REFERINT_PLUGIN_SUBSYSTEM, "referint_validate_config - Null pre op entry.\n"); rc = LDAP_OPERATIONS_ERROR; goto bail; } @@ -1726,7 +1726,7 @@ referint_validate_config(Slapi_PBlock *pb) } if ( SLAPI_PLUGIN_FAILURE == load_config(pb, resulting_entry, 0)) { - slapi_log_error(SLAPI_LOG_ERR, REFERINT_PLUGIN_SUBSYSTEM, "referint_validate_config - " + slapi_log_err(SLAPI_LOG_ERR, REFERINT_PLUGIN_SUBSYSTEM, "referint_validate_config - " "configuration validation failed.\n"); rc = LDAP_UNWILLING_TO_PERFORM; goto bail; @@ -1750,7 +1750,7 @@ referint_validate_config(Slapi_PBlock *pb) if((config_area = slapi_entry_attr_get_charptr(resulting_entry, SLAPI_PLUGIN_SHARED_CONFIG_AREA))){ rc = slapi_dn_syntax_check(pb, config_area, 1); if (rc) { /* syntax check failed */ - slapi_log_error(SLAPI_LOG_ERR, REFERINT_PLUGIN_SUBSYSTEM, "referint_validate_config - " + slapi_log_err(SLAPI_LOG_ERR, REFERINT_PLUGIN_SUBSYSTEM, "referint_validate_config - " "%s does not contain a valid DN (%s)\n", SLAPI_PLUGIN_SHARED_CONFIG_AREA, config_area); rc = LDAP_INVALID_DN_SYNTAX; @@ -1760,7 +1760,7 @@ referint_validate_config(Slapi_PBlock *pb) rc = slapi_search_internal_get_entry(config_sdn, NULL, &e, referint_plugin_identity); if (LDAP_SUCCESS != rc) { /* log an error and use the plugin entry for the config */ - slapi_log_error(SLAPI_LOG_PLUGIN, REFERINT_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_PLUGIN, REFERINT_PLUGIN_SUBSYSTEM, "referint_validate_config - Config entry \"%s\" couild not be found, error %d\n", config_area, rc); rc = LDAP_OPERATIONS_ERROR; @@ -1769,7 +1769,7 @@ referint_validate_config(Slapi_PBlock *pb) if(e){ config_e = e; } else { - slapi_log_error(SLAPI_LOG_PLUGIN, REFERINT_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_PLUGIN, REFERINT_PLUGIN_SUBSYSTEM, "referint_validate_config - Config entry \"%s\" was not located.\n", config_area); rc = LDAP_OPERATIONS_ERROR; goto bail; diff --git a/ldap/servers/plugins/replication/cl4_api.c b/ldap/servers/plugins/replication/cl4_api.c index 788c8c7..0d830cb 100644 --- a/ldap/servers/plugins/replication/cl4_api.c +++ b/ldap/servers/plugins/replication/cl4_api.c @@ -61,7 +61,7 @@ int cl4Init () s_cl4Desc.csnPL = csnplNew (); if (s_cl4Desc.csnPL == NULL) { - slapi_log_error(SLAPI_LOG_ERR, repl_plugin_name, "cl4Init: failed to create CSN pending list\n"); + slapi_log_err(SLAPI_LOG_ERR, repl_plugin_name, "cl4Init: failed to create CSN pending list\n"); return CL4_CSNPL_ERROR; } @@ -90,14 +90,14 @@ int cl4WriteOperation (const slapi_operation_parameters *op) if (op == NULL || !IsValidOperation (op)) { - slapi_log_error(SLAPI_LOG_ERR, repl_plugin_name, "cl4WriteEntry: invalid entry\n"); + slapi_log_err(SLAPI_LOG_ERR, repl_plugin_name, "cl4WriteEntry: invalid entry\n"); return CL4_BAD_DATA; } rc = _cl4WriteOperation (op); if (rc != CL4_SUCCESS) { - slapi_log_error(SLAPI_LOG_ERR, repl_plugin_name, "cl4WriteEntry: failed to write changelog entry\n"); + slapi_log_err(SLAPI_LOG_ERR, repl_plugin_name, "cl4WriteEntry: failed to write changelog entry\n"); return rc; } @@ -109,7 +109,7 @@ int cl4WriteOperation (const slapi_operation_parameters *op) if (rc != 0) { - slapi_log_error(SLAPI_LOG_ERR, repl_plugin_name, + slapi_log_err(SLAPI_LOG_ERR, repl_plugin_name, "cl4WriteEntry: failed to remove CSN from the pending list\n"); rc = CL4_CSNPL_ERROR; } @@ -127,7 +127,7 @@ int cl4ChangeTargetDN (const CSN *csn, const char *newDN) if (csn == NULL || newDN == NULL) { - slapi_log_error(SLAPI_LOG_ERR, repl_plugin_name, "cl4ChangeTargetDN: invalid argument\n"); + slapi_log_err(SLAPI_LOG_ERR, repl_plugin_name, "cl4ChangeTargetDN: invalid argument\n"); return CL4_BAD_DATA; } @@ -135,7 +135,7 @@ int cl4ChangeTargetDN (const CSN *csn, const char *newDN) changeEntryDN = _cl4MakeCSNDN (csn); if (changeEntryDN == NULL) { - slapi_log_error(SLAPI_LOG_ERR, repl_plugin_name, + slapi_log_err(SLAPI_LOG_ERR, repl_plugin_name, "cl4ChangeTargetDN: failed to construct change entry dn\n"); return CL4_MEMORY_ERROR; } @@ -158,7 +158,7 @@ int cl4ChangeTargetDN (const CSN *csn, const char *newDN) if (res != LDAP_SUCCESS) { char s[CSN_STRSIZE]; - slapi_log_error(SLAPI_LOG_ERR, repl_plugin_name, + slapi_log_err(SLAPI_LOG_ERR, repl_plugin_name, "cl4ChangeTargetDN: an error occured while modifying change entry with csn %s: %s. " "Logging of changes is disabled.\n", csn_as_string(csn,PR_FALSE,s), ldap_err2string(res)); /* GGOODREPL g_set_repl_backend( NULL ); */ @@ -191,7 +191,7 @@ void cl4AssignChangeNumbers (time_t when, void *arg) slapi_entry_free (entry); if (rc != CL4_SUCCESS) { - slapi_log_error(SLAPI_LOG_ERR, repl_plugin_name, "cl4AssignChangeNumbers: failed to resolve target dn\n"); + slapi_log_err(SLAPI_LOG_ERR, repl_plugin_name, "cl4AssignChangeNumbers: failed to resolve target dn\n"); break; } @@ -213,7 +213,7 @@ void cl4AssignChangeNumbers (time_t when, void *arg) if (rc != CL4_SUCCESS) { - slapi_log_error(SLAPI_LOG_ERR, repl_plugin_name, + slapi_log_err(SLAPI_LOG_ERR, repl_plugin_name, "cl4AssignChangeNumbers: failed to update changelog entry\n"); break; } @@ -239,7 +239,7 @@ static int _cl4WriteOperation (const slapi_operation_parameters *op) Slapi_Value *values[3]; char s[CSN_STRSIZE]; - slapi_log_error(SLAPI_LOG_PLUGIN, repl_plugin_name, + slapi_log_err(SLAPI_LOG_PLUGIN, repl_plugin_name, "_cl4WriteEntry: writing change record with csn %s for dn: \"%s\"\n", csn_as_string(op->csn,PR_FALSE,s), op->target_address.dn); @@ -247,7 +247,7 @@ static int _cl4WriteOperation (const slapi_operation_parameters *op) changeEntryDN = _cl4MakeCSNDN (op->csn); if (changeEntryDN == NULL) { - slapi_log_error(SLAPI_LOG_ERR, repl_plugin_name, + slapi_log_err(SLAPI_LOG_ERR, repl_plugin_name, "_cl4WriteEntry: failed to create entry dn\n"); return CL4_MEMORY_ERROR; } @@ -259,7 +259,7 @@ static int _cl4WriteOperation (const slapi_operation_parameters *op) e = slapi_entry_alloc(); if (e == NULL) { - slapi_log_error(SLAPI_LOG_ERR, repl_plugin_name, + slapi_log_err(SLAPI_LOG_ERR, repl_plugin_name, "_cl4WriteEntry: failed to allocate change entry\n"); return CL4_MEMORY_ERROR; } @@ -343,7 +343,7 @@ static int _cl4WriteOperation (const slapi_operation_parameters *op) if (res != LDAP_SUCCESS) { char s[CSN_STRSIZE]; - slapi_log_error(SLAPI_LOG_ERR, repl_plugin_name, + slapi_log_err(SLAPI_LOG_ERR, repl_plugin_name, "_cl4WriteEntry: an error occured while adding change entry with csn %s, dn = %s: %s. " "Logging of changes is disabled.\n", csn_as_string(op->csn,PR_FALSE,s), op->target_address.dn, ldap_err2string(res)); @@ -365,7 +365,7 @@ static void _cl4AssignCSNCallback (const CSN *csn, void *data) if (csn == NULL) { - slapi_log_error(SLAPI_LOG_ERR, repl_plugin_name, "_cl4AssignCSNCallback: null csn\n"); + slapi_log_err(SLAPI_LOG_ERR, repl_plugin_name, "_cl4AssignCSNCallback: null csn\n"); return; } @@ -374,7 +374,7 @@ static void _cl4AssignCSNCallback (const CSN *csn, void *data) if (rc == -1) { char s[CSN_STRSIZE]; - slapi_log_error(SLAPI_LOG_ERR, repl_plugin_name, + slapi_log_err(SLAPI_LOG_ERR, repl_plugin_name, "_cl4AssignCSNCallback: failed to insert csn %s to the pending list\n", csn_as_string(csn,PR_FALSE,s)); } @@ -386,7 +386,7 @@ static void _cl4AbortCSNCallback (const CSN *csn, void *data) if (csn == NULL) { - slapi_log_error(SLAPI_LOG_ERR, repl_plugin_name, "_cl4AbortCSNCallback: null csn\n"); + slapi_log_err(SLAPI_LOG_ERR, repl_plugin_name, "_cl4AbortCSNCallback: null csn\n"); return; } @@ -394,7 +394,7 @@ static void _cl4AbortCSNCallback (const CSN *csn, void *data) if (rc == -1) { char s[CSN_STRSIZE]; - slapi_log_error(SLAPI_LOG_ERR, repl_plugin_name, + slapi_log_err(SLAPI_LOG_ERR, repl_plugin_name, "_cl4AbortCSNCallback: failed to remove csn %s from the pending list\n", csn_as_string(csn,PR_FALSE,s)); } @@ -443,7 +443,7 @@ static int _cl4GetEntry (const CSN *csn, Slapi_Entry **entry) if (rc != 0 || ret.err != 0) { - slapi_log_error(SLAPI_LOG_ERR, repl_plugin_name, "_cl4GetEntry: failed to get next changelog entry\n"); + slapi_log_err(SLAPI_LOG_ERR, repl_plugin_name, "_cl4GetEntry: failed to get next changelog entry\n"); return CL4_INTERNAL_ERROR; } @@ -510,14 +510,14 @@ static int _cl4ResolveTargetDN (Slapi_Entry *entry, Slapi_DN **newTargetDN) rc = _cl4GetTargetEntry (targetSDN, uniqueid, &targetEntry); if (rc != CL4_SUCCESS) { - slapi_log_error(SLAPI_LOG_ERR, repl_plugin_name, "_cl4ResolveTargetDN: failed to get target entry\n"); + slapi_log_err(SLAPI_LOG_ERR, repl_plugin_name, "_cl4ResolveTargetDN: failed to get target entry\n"); goto done; } teDNCSN = entry_get_dncsn(targetEntry); if (teDNCSN == NULL) { - slapi_log_error(SLAPI_LOG_ERR, repl_plugin_name, "_cl4ResolveTargetDN: failed to get target entry dn\n"); + slapi_log_err(SLAPI_LOG_ERR, repl_plugin_name, "_cl4ResolveTargetDN: failed to get target entry dn\n"); rc = CL4_BAD_FORMAT; goto done; } @@ -583,7 +583,7 @@ static int _cl4GetTargetEntry (Slapi_DN *sdn, const char *uniqueid, Slapi_Entry slapi_pblock_get(pb, SLAPI_PLUGIN_INTOP_RESULT, &res); if (res == LDAP_NO_SUCH_OBJECT) /* entry not found */ { - slapi_log_error(SLAPI_LOG_ERR, repl_plugin_name, "_cl4GetTargetEntry: entry (%s) not found\n", + slapi_log_err(SLAPI_LOG_ERR, repl_plugin_name, "_cl4GetTargetEntry: entry (%s) not found\n", slapi_sdn_get_ndn(sdn)); rc = CL4_NOT_FOUND; goto done; @@ -591,7 +591,7 @@ static int _cl4GetTargetEntry (Slapi_DN *sdn, const char *uniqueid, Slapi_Entry if (res != LDAP_SUCCESS) { - slapi_log_error(SLAPI_LOG_ERR, repl_plugin_name, + slapi_log_err(SLAPI_LOG_ERR, repl_plugin_name, "_cl4ResolveTargetDN: an error occured while searching for directory entry with uniqueid %s: %s. " "Logging of changes is disabled.\n", uniqueid, ldap_err2string(res)); /* GGOODREPL g_set_repl_backend( NULL ); */ @@ -602,7 +602,7 @@ static int _cl4GetTargetEntry (Slapi_DN *sdn, const char *uniqueid, Slapi_Entry slapi_pblock_get(pb, SLAPI_PLUGIN_INTOP_SEARCH_ENTRIES, &entries); if (entries == NULL || entries [0] == NULL) { - slapi_log_error(SLAPI_LOG_ERR, repl_plugin_name, "_cl4GetTargetEntry: entry (%s) not found\n", + slapi_log_err(SLAPI_LOG_ERR, repl_plugin_name, "_cl4GetTargetEntry: entry (%s) not found\n", slapi_sdn_get_ndn(sdn)); rc = CL4_NOT_FOUND; goto done; @@ -655,7 +655,7 @@ static int _cl4FindTargetDN (const CSN *csn, const char *uniqueid, slapi_pblock_get(pb, SLAPI_PLUGIN_INTOP_RESULT, &res); if (res == LDAP_NO_SUCH_OBJECT) /* entry not found */ { - slapi_log_error(SLAPI_LOG_ERR, repl_plugin_name, "_cl4FindTargetDN: no entries much filter (%s)\n", + slapi_log_err(SLAPI_LOG_ERR, repl_plugin_name, "_cl4FindTargetDN: no entries much filter (%s)\n", filter); rc = CL4_NOT_FOUND; goto done; @@ -663,7 +663,7 @@ static int _cl4FindTargetDN (const CSN *csn, const char *uniqueid, if (res != LDAP_SUCCESS) { - slapi_log_error(SLAPI_LOG_ERR, repl_plugin_name, + slapi_log_err(SLAPI_LOG_ERR, repl_plugin_name, "_cl4ResolveTargetDN: an error occured while searching change entries matching filter %s: %s. " "Logging of changes is disabled.\n", filter, ldap_err2string(res)); /* GGOODREPL g_set_repl_backend( NULL ); */ @@ -674,7 +674,7 @@ static int _cl4FindTargetDN (const CSN *csn, const char *uniqueid, slapi_pblock_get(pb, SLAPI_PLUGIN_INTOP_SEARCH_ENTRIES, &entries); if (entries == NULL) { - slapi_log_error(SLAPI_LOG_ERR, repl_plugin_name, "_cl4FindTargetDN: no entries much filter (%s)\n", + slapi_log_err(SLAPI_LOG_ERR, repl_plugin_name, "_cl4FindTargetDN: no entries much filter (%s)\n", filter); rc = CL4_NOT_FOUND; goto done; @@ -744,14 +744,14 @@ static int _cl4UpdateEntry (const CSN *csn, const char *changeType, if (csn == NULL || changeType == NULL) { - slapi_log_error(SLAPI_LOG_ERR, repl_plugin_name, "_cl4UpdateEntry: invalid argument\n"); + slapi_log_err(SLAPI_LOG_ERR, repl_plugin_name, "_cl4UpdateEntry: invalid argument\n"); return CL4_BAD_DATA; } dn = _cl4MakeCSNDN (csn); if (dn == NULL) { - slapi_log_error(SLAPI_LOG_ERR, repl_plugin_name, "_cl4UpdateEntry: failed to create entry dn\n"); + slapi_log_err(SLAPI_LOG_ERR, repl_plugin_name, "_cl4UpdateEntry: failed to create entry dn\n"); return CL4_MEMORY_ERROR; } @@ -787,7 +787,7 @@ static int _cl4UpdateEntry (const CSN *csn, const char *changeType, if (res != LDAP_SUCCESS) { char s[CSN_STRSIZE]; - slapi_log_error(SLAPI_LOG_ERR, repl_plugin_name, + slapi_log_err(SLAPI_LOG_ERR, repl_plugin_name, "cl4ChangeTargetDN: an error occured while modifying change entry with csn %s: %s. " "Logging of changes is disabled.\n", csn_as_string(csn,PR_FALSE,s), ldap_err2string(res)); /* GGOODREPL g_set_repl_backend( NULL ); */ diff --git a/ldap/servers/plugins/replication/cl4_init.c b/ldap/servers/plugins/replication/cl4_init.c index c020364..7ff1d66 100644 --- a/ldap/servers/plugins/replication/cl4_init.c +++ b/ldap/servers/plugins/replication/cl4_init.c @@ -84,7 +84,7 @@ int changelog4_init () if(rc != 0) { - slapi_log_error(SLAPI_LOG_PLUGIN, repl_plugin_name, + slapi_log_err(SLAPI_LOG_PLUGIN, repl_plugin_name, "An error occurred configuring the changelog database\n" ); } @@ -107,7 +107,7 @@ changelog4_close() rc = slapi_be_getentrypoint (rbe, SLAPI_PLUGIN_CLOSE_FN, (void**)&closefn, pb); if (rc != 0) { - slapi_log_error(SLAPI_LOG_ERR, repl_plugin_name, + slapi_log_err(SLAPI_LOG_ERR, repl_plugin_name, "Error: backend close entry point is missing. " "Replication subsystem disabled.\n"); slapi_pblock_destroy (pb); @@ -120,7 +120,7 @@ changelog4_close() if (rc != 0) { - slapi_log_error(SLAPI_LOG_ERR, repl_plugin_name, "Error: the changelog database could " + slapi_log_err(SLAPI_LOG_ERR, repl_plugin_name, "Error: the changelog database could " "not be closed. Replication subsystem disabled.\n"); set_repl_backend( NULL ); rc = -1; @@ -142,7 +142,7 @@ changelog4_remove() rc = slapi_be_getentrypoint (rbe, SLAPI_PLUGIN_DB_RMDB_FN, (void**)&rmdbfn, pb); if (rc != 0) { - slapi_log_error(SLAPI_LOG_ERR, repl_plugin_name, + slapi_log_err(SLAPI_LOG_ERR, repl_plugin_name, "Error: backend rmdb entry point is missing. " "Replication subsystem disabled.\n"); slapi_pblock_destroy (pb); @@ -155,13 +155,13 @@ changelog4_remove() if (rc != 0) { - slapi_log_error(SLAPI_LOG_ERR, repl_plugin_name, "Error: the changelog database could " + slapi_log_err(SLAPI_LOG_ERR, repl_plugin_name, "Error: the changelog database could " "not be removed. Replication subsystem disabled.\n"); rc = -1; } else { - slapi_log_error(SLAPI_LOG_REPL, repl_plugin_name, "New database generation computed. " + slapi_log_err(SLAPI_LOG_REPL, repl_plugin_name, "New database generation computed. " "Changelog database removed.\n"); } @@ -222,7 +222,7 @@ changelog4_create_be() char *cl_suffix; if ( cl_dir == NULL ) { - slapi_log_error(SLAPI_LOG_ERR, repl_plugin_name, + slapi_log_err(SLAPI_LOG_ERR, repl_plugin_name, "Error: no directory specified for changelog database.\n"); return -1; } @@ -231,7 +231,7 @@ changelog4_create_be() if ( cl_suffix == NULL ) { slapi_ch_free ((void **)&cl_dir); - slapi_log_error(SLAPI_LOG_ERR, repl_plugin_name, + slapi_log_err(SLAPI_LOG_ERR, repl_plugin_name, "Error: no suffix specified for changelog database.\n"); return -1; } @@ -298,7 +298,7 @@ changelog4_create_be() if (rbe == NULL) { - slapi_log_error(SLAPI_LOG_ERR, repl_plugin_name, + slapi_log_err(SLAPI_LOG_ERR, repl_plugin_name, "Error: failed to create changelog backend. " "Replication disabled.\n"); return -1; @@ -331,7 +331,7 @@ changelog4_start_be () rc = slapi_be_getentrypoint(rbe, SLAPI_PLUGIN_START_FN, (void**)&startfn, pb); if (rc != 0) { - slapi_log_error(SLAPI_LOG_ERR, repl_plugin_name, + slapi_log_err(SLAPI_LOG_ERR, repl_plugin_name, "Error: backend start entry point is missing. " "Replication subsystem disabled.\n"); slapi_pblock_destroy (pb); @@ -344,7 +344,7 @@ changelog4_start_be () if (rc != 0) { - slapi_log_error(SLAPI_LOG_ERR, repl_plugin_name, + slapi_log_err(SLAPI_LOG_ERR, repl_plugin_name, "Error: Failed to start changelog backend. " "Replication subsystem disabled.\n"); set_repl_backend( NULL ); diff --git a/ldap/servers/plugins/replication/cl5_api.c b/ldap/servers/plugins/replication/cl5_api.c index f1cc54c..e31cff2 100644 --- a/ldap/servers/plugins/replication/cl5_api.c +++ b/ldap/servers/plugins/replication/cl5_api.c @@ -366,14 +366,14 @@ int cl5Init(void) s_cl5Desc.stLock = slapi_new_rwlock(); if (s_cl5Desc.stLock == NULL) { - slapi_log_error(SLAPI_LOG_ERR, repl_plugin_name_cl, + slapi_log_err(SLAPI_LOG_ERR, repl_plugin_name_cl, "cl5Init - Failed to create state lock; NSPR error - %d\n", PR_GetError ()); return CL5_SYSTEM_ERROR; } if ((s_cl5Desc.clLock = PR_NewLock()) == NULL) { - slapi_log_error(SLAPI_LOG_ERR, repl_plugin_name_cl, + slapi_log_err(SLAPI_LOG_ERR, repl_plugin_name_cl, "cl5Init - Failed to create on close lock; NSPR error - %d\n", PR_GetError ()); return CL5_SYSTEM_ERROR; @@ -381,7 +381,7 @@ int cl5Init(void) } if ((s_cl5Desc.clCvar = PR_NewCondVar(s_cl5Desc.clLock)) == NULL) { - slapi_log_error(SLAPI_LOG_ERR, repl_plugin_name_cl, + slapi_log_err(SLAPI_LOG_ERR, repl_plugin_name_cl, "cl5Init - Failed to create on close cvar; NSPR error - %d\n", PR_GetError ()); return CL5_SYSTEM_ERROR; @@ -451,13 +451,13 @@ int cl5Open (const char *dir, const CL5DBConfig *config) if (dir == NULL) { - slapi_log_error(SLAPI_LOG_ERR, repl_plugin_name_cl, "cl5Open: null directory\n"); + slapi_log_err(SLAPI_LOG_ERR, repl_plugin_name_cl, "cl5Open: null directory\n"); return CL5_BAD_DATA; } if (s_cl5Desc.dbState == CL5_STATE_NONE) { - slapi_log_error(SLAPI_LOG_ERR, repl_plugin_name_cl, + slapi_log_err(SLAPI_LOG_ERR, repl_plugin_name_cl, "cl5Open - Changelog is not initialized\n"); return CL5_BAD_STATE; } @@ -468,14 +468,14 @@ int cl5Open (const char *dir, const CL5DBConfig *config) /* already open - ignore */ if (s_cl5Desc.dbState == CL5_STATE_OPEN) { - slapi_log_error(SLAPI_LOG_REPL, repl_plugin_name_cl, + slapi_log_err(SLAPI_LOG_REPL, repl_plugin_name_cl, "cl5Open - changelog already opened; request ignored\n"); rc = CL5_SUCCESS; goto done; } else if (s_cl5Desc.dbState != CL5_STATE_CLOSED) { - slapi_log_error(SLAPI_LOG_ERR, repl_plugin_name_cl, + slapi_log_err(SLAPI_LOG_ERR, repl_plugin_name_cl, "cl5Open - Invalid state - %d\n", s_cl5Desc.dbState); rc = CL5_BAD_STATE; goto done; @@ -484,7 +484,7 @@ int cl5Open (const char *dir, const CL5DBConfig *config) rc = _cl5Open (dir, config, CL5_OPEN_NORMAL); if (rc != CL5_SUCCESS) { - slapi_log_error(SLAPI_LOG_ERR, repl_plugin_name_cl, + slapi_log_err(SLAPI_LOG_ERR, repl_plugin_name_cl, "cl5Open - Failed to open changelog\n"); goto done; } @@ -493,7 +493,7 @@ int cl5Open (const char *dir, const CL5DBConfig *config) rc = _cl5DispatchDBThreads (); if (rc != CL5_SUCCESS) { - slapi_log_error(SLAPI_LOG_ERR, repl_plugin_name_cl, + slapi_log_err(SLAPI_LOG_ERR, repl_plugin_name_cl, "cl5Open - Failed to start database monitoring threads\n"); _cl5Close (); @@ -528,7 +528,7 @@ int cl5Close () if (s_cl5Desc.dbState == CL5_STATE_NONE) { - slapi_log_error(SLAPI_LOG_REPL, repl_plugin_name_cl, + slapi_log_err(SLAPI_LOG_REPL, repl_plugin_name_cl, "cl5Close - Changelog is not initialized\n"); return CL5_BAD_STATE; } @@ -538,14 +538,14 @@ int cl5Close () /* already closed - ignore */ if (s_cl5Desc.dbState == CL5_STATE_CLOSED) { - slapi_log_error(SLAPI_LOG_PLUGIN, repl_plugin_name_cl, + slapi_log_err(SLAPI_LOG_PLUGIN, repl_plugin_name_cl, "cl5Close - Changelog closed; request ignored\n"); slapi_rwlock_unlock (s_cl5Desc.stLock); return CL5_SUCCESS; } else if (s_cl5Desc.dbState != CL5_STATE_OPEN) { - slapi_log_error(SLAPI_LOG_REPL, repl_plugin_name_cl, + slapi_log_err(SLAPI_LOG_REPL, repl_plugin_name_cl, "cl5Close - Invalid state - %d\n", s_cl5Desc.dbState); slapi_rwlock_unlock (s_cl5Desc.stLock); return CL5_BAD_STATE; @@ -581,13 +581,13 @@ int cl5Delete (const char *dir) if (dir == NULL) { - slapi_log_error(SLAPI_LOG_PLUGIN, repl_plugin_name_cl, "cl5Delete - NULL directory\n"); + slapi_log_err(SLAPI_LOG_PLUGIN, repl_plugin_name_cl, "cl5Delete - NULL directory\n"); return CL5_BAD_DATA; } if (s_cl5Desc.dbState == CL5_STATE_NONE) { - slapi_log_error(SLAPI_LOG_REPL, repl_plugin_name_cl, + slapi_log_err(SLAPI_LOG_REPL, repl_plugin_name_cl, "cl5Delete - Changelog is not initialized\n"); return CL5_BAD_STATE; } @@ -596,7 +596,7 @@ int cl5Delete (const char *dir) if (s_cl5Desc.dbState != CL5_STATE_CLOSED) { - slapi_log_error(SLAPI_LOG_REPL, repl_plugin_name_cl, + slapi_log_err(SLAPI_LOG_REPL, repl_plugin_name_cl, "cl5Delete - Invalid state - %d\n", s_cl5Desc.dbState); slapi_rwlock_unlock (s_cl5Desc.stLock); return CL5_BAD_STATE; @@ -605,7 +605,7 @@ int cl5Delete (const char *dir) rc = _cl5Delete (dir, PR_TRUE /* remove changelog dir */); if (rc != CL5_SUCCESS) { - slapi_log_error(SLAPI_LOG_REPL, repl_plugin_name_cl, + slapi_log_err(SLAPI_LOG_REPL, repl_plugin_name_cl, "cl5Delete - Failed to remove changelog\n"); } @@ -625,7 +625,7 @@ int cl5DeleteDBSync (Object *replica) if (replica == NULL) { - slapi_log_error(SLAPI_LOG_REPL, repl_plugin_name_cl, + slapi_log_err(SLAPI_LOG_REPL, repl_plugin_name_cl, "cl5DeleteDBSync - invalid database id\n"); return CL5_BAD_DATA; } @@ -633,7 +633,7 @@ int cl5DeleteDBSync (Object *replica) /* changelog is not initialized */ if (s_cl5Desc.dbState == CL5_STATE_NONE) { - slapi_log_error(SLAPI_LOG_REPL, repl_plugin_name_cl, "cl5DeleteDBSync - " + slapi_log_err(SLAPI_LOG_REPL, repl_plugin_name_cl, "cl5DeleteDBSync - " "Changelog is not initialized\n"); return CL5_BAD_STATE; } @@ -665,7 +665,7 @@ int cl5DeleteDBSync (Object *replica) { Replica *r = (Replica*)object_get_data (replica); PR_ASSERT (r); - slapi_log_error(SLAPI_LOG_REPL, repl_plugin_name_cl, "cl5DeleteDBSync - " + slapi_log_err(SLAPI_LOG_REPL, repl_plugin_name_cl, "cl5DeleteDBSync - " "File for replica at (%s) not found\n", slapi_sdn_get_dn (replica_get_root (r))); } @@ -693,7 +693,7 @@ int cl5GetUpperBoundRUV (Replica *r, RUV **ruv) if (r == NULL || ruv == NULL) { - slapi_log_error(SLAPI_LOG_REPL, repl_plugin_name_cl, + slapi_log_err(SLAPI_LOG_REPL, repl_plugin_name_cl, "cl5GetUpperBoundRUV - Invalid parameters\n"); return CL5_BAD_DATA; } @@ -701,7 +701,7 @@ int cl5GetUpperBoundRUV (Replica *r, RUV **ruv) /* changelog is not initialized */ if (s_cl5Desc.dbState == CL5_STATE_NONE) { - slapi_log_error(SLAPI_LOG_REPL, repl_plugin_name_cl, "cl5GetUpperBoundRUV - " + slapi_log_err(SLAPI_LOG_REPL, repl_plugin_name_cl, "cl5GetUpperBoundRUV - " "Changelog is not initialized\n"); return CL5_BAD_STATE; } @@ -726,7 +726,7 @@ int cl5GetUpperBoundRUV (Replica *r, RUV **ruv) } else { - slapi_log_error(SLAPI_LOG_REPL, repl_plugin_name_cl, "cl5GetUpperBoundRUV - " + slapi_log_err(SLAPI_LOG_REPL, repl_plugin_name_cl, "cl5GetUpperBoundRUV - " "Could not find DB object for replica\n"); } @@ -759,14 +759,14 @@ int cl5ExportLDIF (const char *ldifFile, Object **replicas) if (ldifFile == NULL) { - slapi_log_error(SLAPI_LOG_ERR, repl_plugin_name_cl, + slapi_log_err(SLAPI_LOG_ERR, repl_plugin_name_cl, "cl5ExportLDIF - null ldif file name\n"); return CL5_BAD_DATA; } if (s_cl5Desc.dbState == CL5_STATE_NONE) { - slapi_log_error(SLAPI_LOG_ERR, repl_plugin_name_cl, + slapi_log_err(SLAPI_LOG_ERR, repl_plugin_name_cl, "cl5ExportLDIF - Changelog is not initialized\n"); return CL5_BAD_STATE; } @@ -779,14 +779,14 @@ int cl5ExportLDIF (const char *ldifFile, Object **replicas) prFile = PR_Open (ldifFile, PR_WRONLY | PR_CREATE_FILE | PR_TRUNCATE, 0600); if (prFile == NULL) { - slapi_log_error(SLAPI_LOG_ERR, repl_plugin_name_cl, + slapi_log_err(SLAPI_LOG_ERR, repl_plugin_name_cl, "cl5ExportLDIF - Failed to open (%s) file; NSPR error - %d\n", ldifFile, PR_GetError ()); rc = CL5_SYSTEM_ERROR; goto done; } - slapi_log_error(SLAPI_LOG_PLUGIN, repl_plugin_name_cl, + slapi_log_err(SLAPI_LOG_PLUGIN, repl_plugin_name_cl, "cl5ExportLDIF: starting changelog export to (%s) ...\n", ldifFile); if (replicas) /* export only selected files */ @@ -805,7 +805,7 @@ int cl5ExportLDIF (const char *ldifFile, Object **replicas) PR_ASSERT (r); - slapi_log_error(SLAPI_LOG_ERR, repl_plugin_name_cl, "cl5ExportLDIF - " + slapi_log_err(SLAPI_LOG_ERR, repl_plugin_name_cl, "cl5ExportLDIF - " "Failed to locate changelog file for replica at (%s)\n", slapi_sdn_get_dn (replica_get_root (r))); } @@ -826,7 +826,7 @@ done:; _cl5RemoveThread (); if (rc == CL5_SUCCESS) - slapi_log_error(SLAPI_LOG_PLUGIN, repl_plugin_name_cl, + slapi_log_err(SLAPI_LOG_PLUGIN, repl_plugin_name_cl, "cl5ExportLDIF - Changelog export is finished.\n"); if (prFile) @@ -878,21 +878,21 @@ cl5ImportLDIF (const char *clDir, const char *ldifFile, Object **replicas) /* validate params */ if (ldifFile == NULL) { - slapi_log_error(SLAPI_LOG_ERR, repl_plugin_name_cl, + slapi_log_err(SLAPI_LOG_ERR, repl_plugin_name_cl, "cl5ImportLDIF - null ldif file name\n"); return CL5_BAD_DATA; } if (s_cl5Desc.dbState == CL5_STATE_NONE) { - slapi_log_error(SLAPI_LOG_ERR, repl_plugin_name_cl, + slapi_log_err(SLAPI_LOG_ERR, repl_plugin_name_cl, "cl5ImportLDIF - Changelog is not initialized\n"); return CL5_BAD_STATE; } if (replicas == NULL) { - slapi_log_error(SLAPI_LOG_ERR, repl_plugin_name_cl, + slapi_log_err(SLAPI_LOG_ERR, repl_plugin_name_cl, "cl5ImportLDIF - null list of replicas\n"); return CL5_BAD_DATA; } @@ -901,7 +901,7 @@ cl5ImportLDIF (const char *clDir, const char *ldifFile, Object **replicas) if (NULL == prim_replica_obj) { /* Never happens for now. (see replica_execute_ldif2cl_task) */ - slapi_log_error(SLAPI_LOG_ERR, repl_plugin_name_cl, + slapi_log_err(SLAPI_LOG_ERR, repl_plugin_name_cl, "cl5ImportLDIF - empty replica list\n"); return CL5_BAD_DATA; } @@ -913,7 +913,7 @@ cl5ImportLDIF (const char *clDir, const char *ldifFile, Object **replicas) /* make sure changelog is closed */ if (s_cl5Desc.dbState != CL5_STATE_CLOSED) { - slapi_log_error(SLAPI_LOG_ERR, repl_plugin_name_cl, + slapi_log_err(SLAPI_LOG_ERR, repl_plugin_name_cl, "cl5ImportLDIF - Invalid state - %d \n", s_cl5Desc.dbState); slapi_rwlock_unlock (s_cl5Desc.stLock); @@ -928,7 +928,7 @@ cl5ImportLDIF (const char *clDir, const char *ldifFile, Object **replicas) #endif if (file == NULL) { - slapi_log_error(SLAPI_LOG_ERR, repl_plugin_name_cl, + slapi_log_err(SLAPI_LOG_ERR, repl_plugin_name_cl, "cl5ImportLDIF - Failed to open (%s) ldif file; system error - %d\n", ldifFile, errno); rc = CL5_SYSTEM_ERROR; @@ -939,7 +939,7 @@ cl5ImportLDIF (const char *clDir, const char *ldifFile, Object **replicas) rc = _cl5Delete (clDir, PR_FALSE); if (rc != CL5_SUCCESS) { - slapi_log_error(SLAPI_LOG_ERR, repl_plugin_name_cl, + slapi_log_err(SLAPI_LOG_ERR, repl_plugin_name_cl, "cl5ImportLDIF - Failed to remove changelog\n"); goto done; } @@ -948,7 +948,7 @@ cl5ImportLDIF (const char *clDir, const char *ldifFile, Object **replicas) rc = _cl5Open (clDir, NULL, CL5_OPEN_LDIF2CL); if (rc != CL5_SUCCESS) { - slapi_log_error(SLAPI_LOG_ERR, repl_plugin_name_cl, + slapi_log_err(SLAPI_LOG_ERR, repl_plugin_name_cl, "cl5ImportLDIF - Failed to open changelog\n"); goto done; } @@ -1040,7 +1040,7 @@ cl5ImportLDIF (const char *clDir, const char *ldifFile, Object **replicas) replGen, &op, 1); if (rc != CL5_SUCCESS) { - slapi_log_error(SLAPI_LOG_ERR, repl_plugin_name_cl, + slapi_log_err(SLAPI_LOG_ERR, repl_plugin_name_cl, "cl5ImportLDIF - " "Failed to write operation to the changelog: " "type: %lu, dn: %s\n", @@ -1060,7 +1060,7 @@ cl5ImportLDIF (const char *clDir, const char *ldifFile, Object **replicas) replGen, &op, 1); if (rc != CL5_SUCCESS) { - slapi_log_error(SLAPI_LOG_ERR, repl_plugin_name_cl, + slapi_log_err(SLAPI_LOG_ERR, repl_plugin_name_cl, "cl5ImportLDIF - " "Failed to write operation to the changelog: " "type: %lu, dn: %s\n", @@ -1157,7 +1157,7 @@ cl5ConfigTrimming (int maxEntries, const char *maxAge, int compactInterval, int { if (s_cl5Desc.dbState == CL5_STATE_NONE) { - slapi_log_error(SLAPI_LOG_ERR, repl_plugin_name_cl, + slapi_log_err(SLAPI_LOG_ERR, repl_plugin_name_cl, "cl5ConfigTrimming - Changelog is not initialized\n"); return CL5_BAD_STATE; } @@ -1165,7 +1165,7 @@ cl5ConfigTrimming (int maxEntries, const char *maxAge, int compactInterval, int /* make sure changelog is not closed while trimming configuration is updated.*/ if (CL5_SUCCESS != _cl5AddThread ()) { - slapi_log_error(SLAPI_LOG_ERR, repl_plugin_name_cl, + slapi_log_err(SLAPI_LOG_ERR, repl_plugin_name_cl, "cl5ConfigTrimming - Could not start changelog trimming thread\n"); return CL5_BAD_STATE; } @@ -1233,25 +1233,25 @@ int cl5GetOperation (Object *replica, slapi_operation_parameters *op) if (replica == NULL) { - slapi_log_error(SLAPI_LOG_REPL, repl_plugin_name_cl, "cl5GetOperation - NULL replica\n"); + slapi_log_err(SLAPI_LOG_REPL, repl_plugin_name_cl, "cl5GetOperation - NULL replica\n"); return CL5_BAD_DATA; } if (op == NULL) { - slapi_log_error(SLAPI_LOG_REPL, repl_plugin_name_cl, "cl5GetOperation - NULL operation\n"); + slapi_log_err(SLAPI_LOG_REPL, repl_plugin_name_cl, "cl5GetOperation - NULL operation\n"); return CL5_BAD_DATA; } if (op->csn == NULL) { - slapi_log_error(SLAPI_LOG_REPL, repl_plugin_name_cl, "%s: cl5GetOperation - operation contains no CSN\n", agmt_name); + slapi_log_err(SLAPI_LOG_REPL, repl_plugin_name_cl, "%s: cl5GetOperation - operation contains no CSN\n", agmt_name); return CL5_BAD_DATA; } if (s_cl5Desc.dbState == CL5_STATE_NONE) { - slapi_log_error(SLAPI_LOG_REPL, repl_plugin_name_cl, + slapi_log_err(SLAPI_LOG_REPL, repl_plugin_name_cl, "cl5GetOperation - %s - Changelog is not initialized\n", agmt_name); return CL5_BAD_STATE; } @@ -1287,7 +1287,7 @@ int cl5GetFirstOperation (Object *replica, slapi_operation_parameters *op, void if (replica == NULL || op == NULL || iterator == NULL) { - slapi_log_error(SLAPI_LOG_REPL, repl_plugin_name_cl, + slapi_log_err(SLAPI_LOG_REPL, repl_plugin_name_cl, "cl5GetFirstOperation - Invalid argument\n"); return CL5_BAD_DATA; } @@ -1297,7 +1297,7 @@ int cl5GetFirstOperation (Object *replica, slapi_operation_parameters *op, void if (s_cl5Desc.dbState == CL5_STATE_NONE) { agmt_name = get_thread_private_agmtname(); - slapi_log_error(SLAPI_LOG_REPL, repl_plugin_name_cl, + slapi_log_err(SLAPI_LOG_REPL, repl_plugin_name_cl, "cl5GetFirstOperation - %s - Changelog is not initialized\n", agmt_name); return CL5_BAD_STATE; } @@ -1341,14 +1341,14 @@ int cl5GetNextOperation (slapi_operation_parameters *op, void *iterator) if (op == NULL || iterator == NULL || !_cl5IsValidIterator (iterator)) { - slapi_log_error(SLAPI_LOG_REPL, repl_plugin_name_cl, + slapi_log_err(SLAPI_LOG_REPL, repl_plugin_name_cl, "cl5GetNextOperation - Invalid argument\n"); return CL5_BAD_DATA; } if (s_cl5Desc.dbState != CL5_STATE_OPEN) { - slapi_log_error(SLAPI_LOG_REPL, repl_plugin_name_cl, + slapi_log_err(SLAPI_LOG_REPL, repl_plugin_name_cl, "cl5GetNextOperation - Changelog is not open\n"); return CL5_BAD_STATE; } @@ -1405,7 +1405,7 @@ int cl5WriteOperationTxn(const char *replName, const char *replGen, if (op == NULL) { - slapi_log_error(SLAPI_LOG_REPL, repl_plugin_name_cl, + slapi_log_err(SLAPI_LOG_REPL, repl_plugin_name_cl, "cl5WriteOperationTxn - NULL operation passed\n"); return CL5_BAD_DATA; } @@ -1418,7 +1418,7 @@ int cl5WriteOperationTxn(const char *replName, const char *replGen, if (s_cl5Desc.dbState == CL5_STATE_NONE) { - slapi_log_error(SLAPI_LOG_REPL, repl_plugin_name_cl, + slapi_log_err(SLAPI_LOG_REPL, repl_plugin_name_cl, "cl5WriteOperationTxn - Changelog is not initialized\n"); return CL5_BAD_STATE; } @@ -1511,7 +1511,7 @@ int cl5CreateReplayIteratorEx (Private_Repl_Protocol *prp, const RUV *consumerRu replica = prp->replica_object; if (replica == NULL || consumerRuv == NULL || iterator == NULL) { - slapi_log_error(SLAPI_LOG_REPL, repl_plugin_name_cl, + slapi_log_err(SLAPI_LOG_REPL, repl_plugin_name_cl, "cl5CreateReplayIteratorEx - Invalid parameter\n"); return CL5_BAD_DATA; } @@ -1520,7 +1520,7 @@ int cl5CreateReplayIteratorEx (Private_Repl_Protocol *prp, const RUV *consumerRu if (s_cl5Desc.dbState == CL5_STATE_NONE) { - slapi_log_error(SLAPI_LOG_REPL, repl_plugin_name_cl, + slapi_log_err(SLAPI_LOG_REPL, repl_plugin_name_cl, "cl5CreateReplayIteratorEx - Changelog is not initialized\n"); return CL5_BAD_STATE; } @@ -1540,7 +1540,7 @@ int cl5CreateReplayIteratorEx (Private_Repl_Protocol *prp, const RUV *consumerRu } else { - slapi_log_error(SLAPI_LOG_REPL, repl_plugin_name_cl, + slapi_log_err(SLAPI_LOG_REPL, repl_plugin_name_cl, "cl5CreateReplayIteratorEx - Could not find DB object for replica\n"); } @@ -1572,7 +1572,7 @@ int cl5CreateReplayIterator (Private_Repl_Protocol *prp, const RUV *consumerRuv, replica = prp->replica_object; if (replica == NULL || consumerRuv == NULL || iterator == NULL) { - slapi_log_error(SLAPI_LOG_REPL, repl_plugin_name_cl, + slapi_log_err(SLAPI_LOG_REPL, repl_plugin_name_cl, "cl5CreateReplayIterator - Invalid parameter\n"); return CL5_BAD_DATA; } @@ -1581,7 +1581,7 @@ int cl5CreateReplayIterator (Private_Repl_Protocol *prp, const RUV *consumerRuv, if (s_cl5Desc.dbState == CL5_STATE_NONE) { - slapi_log_error(SLAPI_LOG_REPL, repl_plugin_name_cl, + slapi_log_err(SLAPI_LOG_REPL, repl_plugin_name_cl, "cl5CreateReplayIterator - Changelog is not initialized\n"); return CL5_BAD_STATE; } @@ -1601,7 +1601,7 @@ int cl5CreateReplayIterator (Private_Repl_Protocol *prp, const RUV *consumerRuv, } else { - slapi_log_error(SLAPI_LOG_REPL, repl_plugin_name_cl, + slapi_log_err(SLAPI_LOG_REPL, repl_plugin_name_cl, "cl5CreateReplayIterator - Could not find DB object for replica\n"); } @@ -1654,7 +1654,7 @@ cl5GetNextOperationToReplay (CL5ReplayIterator *iterator, CL5Entry *entry) if (entry == NULL) { - slapi_log_error(SLAPI_LOG_REPL, repl_plugin_name_cl, + slapi_log_err(SLAPI_LOG_REPL, repl_plugin_name_cl, "cl5GetNextOperationToReplay - %s - Invalid parameter passed\n", agmt_name); return CL5_BAD_DATA; } @@ -1672,7 +1672,7 @@ cl5GetNextOperationToReplay (CL5ReplayIterator *iterator, CL5Entry *entry) if (rc != 0) { - slapi_log_error(SLAPI_LOG_ERR, repl_plugin_name_cl, "cl5GetNextOperationToReplay - %s - " + slapi_log_err(SLAPI_LOG_ERR, repl_plugin_name_cl, "cl5GetNextOperationToReplay - %s - " "Failed to read next entry; DB error %d\n", agmt_name, rc); return CL5_DB_ERROR; } @@ -1691,7 +1691,7 @@ cl5GetNextOperationToReplay (CL5ReplayIterator *iterator, CL5Entry *entry) /* Callers of this function should cl5_operation_parameters_done(op) */ if ( 0 != cl5DBData2Entry ( data, datalen, entry ) ) { - slapi_log_error(SLAPI_LOG_ERR, repl_plugin_name_cl, + slapi_log_err(SLAPI_LOG_ERR, repl_plugin_name_cl, "cl5GetNextOperationToReplay - %s - Failed to format entry rc=%d\n", agmt_name, rc); return rc; } @@ -1708,7 +1708,7 @@ void cl5DestroyReplayIterator (CL5ReplayIterator **iterator) { if (iterator == NULL) { - slapi_log_error(SLAPI_LOG_REPL, repl_plugin_name_cl, + slapi_log_err(SLAPI_LOG_REPL, repl_plugin_name_cl, "cl5DestroyReplayIterator - Invalid iterator passed\n"); return; } @@ -1793,7 +1793,7 @@ int cl5GetOperationCount (Object *replica) if (s_cl5Desc.dbState == CL5_STATE_NONE) { - slapi_log_error(SLAPI_LOG_REPL, repl_plugin_name_cl, + slapi_log_err(SLAPI_LOG_REPL, repl_plugin_name_cl, "cl5GetOperationCount - Changelog is not initialized\n"); return -1; } @@ -1824,13 +1824,13 @@ int cl5GetOperationCount (Object *replica) PR_ASSERT (file); count = file->entryCount; - slapi_log_error(SLAPI_LOG_REPL, repl_plugin_name_cl, + slapi_log_err(SLAPI_LOG_REPL, repl_plugin_name_cl, "cl5GetOperationCount - Found DB object %p\n", obj); object_release (obj); } else { - slapi_log_error(SLAPI_LOG_REPL, repl_plugin_name_cl, + slapi_log_err(SLAPI_LOG_REPL, repl_plugin_name_cl, "cl5GetOperationCount - Could not get DB object for replica\n"); count = 0; } @@ -1863,7 +1863,7 @@ static int _cl5Open (const char *dir, const CL5DBConfig *config, CL5OpenMode ope rc = _cl5TrimInit (); if (rc != CL5_SUCCESS) { - slapi_log_error(SLAPI_LOG_REPL, repl_plugin_name_cl, + slapi_log_err(SLAPI_LOG_REPL, repl_plugin_name_cl, "_cl5Open - Failed to initialize trimming\n"); goto done; } @@ -1872,7 +1872,7 @@ static int _cl5Open (const char *dir, const CL5DBConfig *config, CL5OpenMode ope rc = cl5CreateDirIfNeeded (dir); if (rc != CL5_SUCCESS) { - slapi_log_error(SLAPI_LOG_REPL, repl_plugin_name_cl, + slapi_log_err(SLAPI_LOG_REPL, repl_plugin_name_cl, "_cl5Open - Failed to create changelog directory (%s)\n", dir); goto done; } @@ -1886,7 +1886,7 @@ static int _cl5Open (const char *dir, const CL5DBConfig *config, CL5OpenMode ope rc = _cl5CheckDBVersion (); if (rc != CL5_SUCCESS) { - slapi_log_error(SLAPI_LOG_REPL, repl_plugin_name_cl, "_cl5Open - Invalid db version\n"); + slapi_log_err(SLAPI_LOG_REPL, repl_plugin_name_cl, "_cl5Open - Invalid db version\n"); goto done; } @@ -1896,7 +1896,7 @@ static int _cl5Open (const char *dir, const CL5DBConfig *config, CL5OpenMode ope rc = _cl5AppInit (); if (rc != CL5_SUCCESS) { - slapi_log_error(SLAPI_LOG_REPL, repl_plugin_name_cl, + slapi_log_err(SLAPI_LOG_REPL, repl_plugin_name_cl, "_cl5Open - Failed to initialize db environment\n"); goto done; } @@ -1911,7 +1911,7 @@ static int _cl5Open (const char *dir, const CL5DBConfig *config, CL5OpenMode ope rc = _cl5DBOpen (); if (rc != CL5_SUCCESS) { - slapi_log_error(SLAPI_LOG_REPL, repl_plugin_name_cl, + slapi_log_err(SLAPI_LOG_REPL, repl_plugin_name_cl, "_cl5Open - Failed to open changelog database\n"); goto done; @@ -1959,7 +1959,7 @@ int cl5CreateDirIfNeeded (const char *dirName) rc = PR_MkDir (buff, DIR_CREATE_MODE); if (rc != PR_SUCCESS) { - slapi_log_error(SLAPI_LOG_REPL, repl_plugin_name_cl, + slapi_log_err(SLAPI_LOG_REPL, repl_plugin_name_cl, "cl5CreateDirIfNeeded - Failed to create dir (%s); NSPR error - %d\n", dirName, PR_GetError ()); return CL5_SYSTEM_ERROR; @@ -1975,7 +1975,7 @@ int cl5CreateDirIfNeeded (const char *dirName) rc = PR_MkDir (buff, DIR_CREATE_MODE); if (rc != PR_SUCCESS) { - slapi_log_error(SLAPI_LOG_REPL, repl_plugin_name_cl, + slapi_log_err(SLAPI_LOG_REPL, repl_plugin_name_cl, "cl5CreateDirIfNeeded - Failed to create dir; NSPR error - %d\n", PR_GetError ()); return CL5_SYSTEM_ERROR; @@ -2011,7 +2011,7 @@ static int _cl5AppInit (void) if (rc == 0 && dbEnv && pagesize) { - slapi_log_error(SLAPI_LOG_REPL, repl_plugin_name_cl, + slapi_log_err(SLAPI_LOG_REPL, repl_plugin_name_cl, "_cl5AppInit - Fetched backend dbEnv (%p)\n", dbEnv); s_cl5Desc.dbEnv = dbEnv; s_cl5Desc.dbEnvOpenFlags = openflags; @@ -2020,7 +2020,7 @@ static int _cl5AppInit (void) } else { - slapi_log_error(SLAPI_LOG_ERR, repl_plugin_name_cl, + slapi_log_err(SLAPI_LOG_ERR, repl_plugin_name_cl, "_cl5AppInit - Failed to fetch backend dbenv (%p) and/or " "index page size (%lu)\n", dbEnv, (long unsigned int)pagesize); return CL5_DB_ERROR; @@ -2043,7 +2043,7 @@ static int _cl5DBOpen () dir = PR_OpenDir(s_cl5Desc.dbDir); if (dir == NULL) { - slapi_log_error(SLAPI_LOG_REPL, repl_plugin_name_cl, + slapi_log_err(SLAPI_LOG_REPL, repl_plugin_name_cl, "_cl5DBOpen - Failed to open changelog dir; NSPR error - %d\n", PR_GetError ()); return CL5_SYSTEM_ERROR; @@ -2069,7 +2069,7 @@ static int _cl5DBOpen () PR_FALSE /* check for duplicates */); if (rc != CL5_SUCCESS) { - slapi_log_error(SLAPI_LOG_REPL, repl_plugin_name_cl, "_cl5DBOpen - " + slapi_log_err(SLAPI_LOG_REPL, repl_plugin_name_cl, "_cl5DBOpen - " "Error opening file %s\n", entry->name); return rc; @@ -2081,7 +2081,7 @@ static int _cl5DBOpen () else /* there is no matching replica for the file - remove */ { char fullpathname[MAXPATHLEN]; - slapi_log_error(SLAPI_LOG_REPL, repl_plugin_name_cl, "_cl5DBOpen - " + slapi_log_err(SLAPI_LOG_REPL, repl_plugin_name_cl, "_cl5DBOpen - " "File %s has no matching replica; removing\n", entry->name); PR_snprintf(fullpathname, MAXPATHLEN, "%s/%s", s_cl5Desc.dbDir, entry->name); @@ -2090,13 +2090,13 @@ static int _cl5DBOpen () DEFAULT_DB_ENV_OP_FLAGS); if (rc != 0) { - slapi_log_error(SLAPI_LOG_REPL, repl_plugin_name_cl, + slapi_log_err(SLAPI_LOG_REPL, repl_plugin_name_cl, "_cl5DBOpen - Failed to remove (%s) file; " "libdb error - %d (%s)\n", fullpathname, rc, db_strerror(rc)); if (PR_Delete(fullpathname) != PR_SUCCESS) { PRErrorCode prerr = PR_GetError(); - slapi_log_error(SLAPI_LOG_ERR, repl_plugin_name_cl, + slapi_log_err(SLAPI_LOG_ERR, repl_plugin_name_cl, "_cl5DBOpen - Failed to remove (%s) file; " "nspr error - %d (%s)\n", fullpathname, prerr, slapd_pr_strerror(prerr)); @@ -2106,7 +2106,7 @@ static int _cl5DBOpen () } } - slapi_log_error(SLAPI_LOG_REPL, repl_plugin_name_cl, "_cl5DBOpen - " + slapi_log_err(SLAPI_LOG_REPL, repl_plugin_name_cl, "_cl5DBOpen - " "Opened %d existing databases in %s\n", count, s_cl5Desc.dbDir); PR_CloseDir(dir); @@ -2201,7 +2201,7 @@ static int _cl5Entry2DBData (const CL5Entry *entry, char **data, PRUint32 *len) (*data) = slapi_ch_malloc (size); if ((*data) == NULL) { - slapi_log_error(SLAPI_LOG_ERR, repl_plugin_name_cl, + slapi_log_err(SLAPI_LOG_ERR, repl_plugin_name_cl, "_cl5Entry2DBData - Failed to allocate data buffer\n"); return CL5_MEMORY_ERROR; } @@ -2254,7 +2254,7 @@ static int _cl5Entry2DBData (const CL5Entry *entry, char **data, PRUint32 *len) (*len) = pos - *data; if (*len > size) { - slapi_log_error(SLAPI_LOG_ERR, repl_plugin_name_cl, + slapi_log_err(SLAPI_LOG_ERR, repl_plugin_name_cl, "_cl5Entry2DBData - real len %d > estimated size %d\n", *len, size); return CL5_MEMORY_ERROR; @@ -2298,7 +2298,7 @@ cl5DBData2Entry (const char *data, PRUint32 len, CL5Entry *entry) version = (PRUint8)(*pos); if (version != V_5) { - slapi_log_error(SLAPI_LOG_ERR, repl_plugin_name_cl, + slapi_log_err(SLAPI_LOG_ERR, repl_plugin_name_cl, "cl5DBData2Entry - Invalid data version\n"); return CL5_BAD_FORMAT; } @@ -2368,7 +2368,7 @@ cl5DBData2Entry (const char *data, PRUint32 len, CL5Entry *entry) default: rc = CL5_BAD_FORMAT; - slapi_log_error(SLAPI_LOG_ERR, repl_plugin_name_cl, + slapi_log_err(SLAPI_LOG_ERR, repl_plugin_name_cl, "cl5DBData2Entry - Failed to format entry\n"); break; } @@ -2386,7 +2386,7 @@ static int _cl5DispatchDBThreads(void) PR_UNJOINABLE_THREAD, DEFAULT_THREAD_STACKSIZE); if (NULL == pth) { - slapi_log_error(SLAPI_LOG_REPL, repl_plugin_name_cl, + slapi_log_err(SLAPI_LOG_REPL, repl_plugin_name_cl, "_cl5DispatchDBThreads - Failed to create trimming thread" "; NSPR error - %d\n", PR_GetError ()); return CL5_SYSTEM_ERROR; @@ -2405,7 +2405,7 @@ static int _cl5AddThread(void) /* open changelog if it is not already open */ if (s_cl5Desc.dbState != CL5_STATE_OPEN) { - slapi_log_error(SLAPI_LOG_ERR, repl_plugin_name_cl, + slapi_log_err(SLAPI_LOG_ERR, repl_plugin_name_cl, "_cl5AddThread - Invalid changelog state - %d\n", s_cl5Desc.dbState); slapi_rwlock_unlock (s_cl5Desc.stLock); return CL5_BAD_STATE; @@ -2558,7 +2558,7 @@ _cl5WriteMod (LDAPMod *mod, char **buff) /* successfully encrypted. use the encrypted bv */ bv_to_use = encbv; } else { /* failed */ - slapi_log_error(SLAPI_LOG_ERR, repl_plugin_name_cl, + slapi_log_err(SLAPI_LOG_ERR, repl_plugin_name_cl, "_cl5WriteMod - Encrypting \"%s: %s\" failed\n", slapi_mod_get_type(&smod), bv->bv_val); bv_to_use = NULL; @@ -2684,7 +2684,7 @@ static int _cl5ReadMod (Slapi_Mod *smod, char **buff) ptr += 3; } *ptr = '\0'; - slapi_log_error(SLAPI_LOG_ERR, repl_plugin_name_cl, + slapi_log_err(SLAPI_LOG_ERR, repl_plugin_name_cl, "_cl5ReadMod - Decrypting \"%s: %s\" failed\n", slapi_mod_get_type(smod), encstr); bv_to_use = NULL; @@ -2889,7 +2889,7 @@ static int _cl5UpgradeMajor(char *fromVersion, char *toVersion) rc = _cl5AppInit (); if (rc != CL5_SUCCESS) { - slapi_log_error(SLAPI_LOG_ERR, repl_plugin_name_cl, + slapi_log_err(SLAPI_LOG_ERR, repl_plugin_name_cl, "_cl5UpgradeMajor - Failed to open the db env\n"); return rc; } @@ -2898,7 +2898,7 @@ static int _cl5UpgradeMajor(char *fromVersion, char *toVersion) dir = PR_OpenDir(s_cl5Desc.dbDir); if (dir == NULL) { - slapi_log_error(SLAPI_LOG_ERR, repl_plugin_name_cl, + slapi_log_err(SLAPI_LOG_ERR, repl_plugin_name_cl, "_cl5UpgradeMajor - Failed to open changelog dir %s; NSPR error - %d\n", s_cl5Desc.dbDir, PR_GetError ()); goto out; @@ -2931,7 +2931,7 @@ static int _cl5UpgradeMajor(char *fromVersion, char *toVersion) /* db->rename closes DB; need to create every time */ rc = db_create(&thisdb, s_cl5Desc.dbEnv, 0); if (0 != rc) { - slapi_log_error(SLAPI_LOG_ERR, repl_plugin_name_cl, + slapi_log_err(SLAPI_LOG_ERR, repl_plugin_name_cl, "_cl5UpgradeMajor - Failed to get db handle\n"); goto out; } @@ -2942,13 +2942,13 @@ static int _cl5UpgradeMajor(char *fromVersion, char *toVersion) PR_snprintf(nName, MAXPATHLEN+1, "%s", oName); PR_snprintf(nName + baselen, MAXPATHLEN+1-baselen, "%s", DB_EXTENSION); *p = c; - slapi_log_error(SLAPI_LOG_REPL, repl_plugin_name_cl, + slapi_log_err(SLAPI_LOG_REPL, repl_plugin_name_cl, "_cl5UpgradeMajor - Renaming %s to %s\n", oName, nName); rc = thisdb->rename(thisdb, (const char *)oName, NULL /* subdb */, (const char *)nName, 0); if (rc != PR_SUCCESS) { - slapi_log_error(SLAPI_LOG_REPL, repl_plugin_name_cl, + slapi_log_err(SLAPI_LOG_REPL, repl_plugin_name_cl, "_cl5UpgradeMajor - Failed to rename file (%s -> %s); " "db error - %d %s\n", oName, nName, rc, db_strerror(rc)); break; @@ -2957,7 +2957,7 @@ static int _cl5UpgradeMajor(char *fromVersion, char *toVersion) } /* update the version file */ _cl5WriteDBVersion (); - slapi_log_error(SLAPI_LOG_INFO, repl_plugin_name_cl, + slapi_log_err(SLAPI_LOG_INFO, repl_plugin_name_cl, "_cl5UpgradeMajor - Upgrading from %s to %s is successfully done (%s)\n", fromVersion, toVersion, s_cl5Desc.dbDir); out: @@ -2984,7 +2984,7 @@ static int _cl5UpgradeMinor(char *fromVersion, char *toVersion) rc = _cl5AppInit (); if (rc != CL5_SUCCESS) { - slapi_log_error(SLAPI_LOG_ERR, repl_plugin_name_cl, + slapi_log_err(SLAPI_LOG_ERR, repl_plugin_name_cl, "_cl5UpgradeMinor - Failed to open the db env\n"); return rc; } @@ -2992,7 +2992,7 @@ static int _cl5UpgradeMinor(char *fromVersion, char *toVersion) /* update the version file */ _cl5WriteDBVersion (); - slapi_log_error(SLAPI_LOG_INFO, repl_plugin_name_cl, + slapi_log_err(SLAPI_LOG_INFO, repl_plugin_name_cl, "_cl5UpgradeMinor - Upgrading from %s to %s is successfully done (%s)\n", fromVersion, toVersion, s_cl5Desc.dbDir); @@ -3025,7 +3025,7 @@ static int _cl5CheckDBVersion(void) if (rc != CL5_SUCCESS) { - slapi_log_error(SLAPI_LOG_ERR, repl_plugin_name_cl, + slapi_log_err(SLAPI_LOG_ERR, repl_plugin_name_cl, "_cl5CheckDBVersion - Invalid dbversion\n"); rc = CL5_BAD_DBVERSION; goto bailout; @@ -3044,7 +3044,7 @@ static int _cl5CheckDBVersion(void) } if (NULL == versionp || versionp == versionendp) { - slapi_log_error(SLAPI_LOG_ERR, repl_plugin_name_cl, + slapi_log_err(SLAPI_LOG_ERR, repl_plugin_name_cl, "_cl5CheckDBVersion - Invalid dbversion: %s\n", dbVersion); rc = CL5_BAD_DBVERSION; goto bailout; @@ -3068,7 +3068,7 @@ static int _cl5CheckDBVersion(void) rc = _cl5UpgradeMajor(dbVersion, clVersion); if (rc != CL5_SUCCESS) { - slapi_log_error(SLAPI_LOG_ERR, repl_plugin_name_cl, + slapi_log_err(SLAPI_LOG_ERR, repl_plugin_name_cl, "_cl5CheckDBVersion - Upgrade %s -> %s failed\n", dbVersion, clVersion); rc = CL5_BAD_DBVERSION; @@ -3080,7 +3080,7 @@ static int _cl5CheckDBVersion(void) rc = _cl5UpgradeMinor(dbVersion, clVersion); if (rc != CL5_SUCCESS) { - slapi_log_error(SLAPI_LOG_ERR, repl_plugin_name_cl, + slapi_log_err(SLAPI_LOG_ERR, repl_plugin_name_cl, "_cl5CheckDBVersion - Upgrade %s -> %s failed\n", dbVersion, clVersion); rc = CL5_BAD_DBVERSION; @@ -3111,7 +3111,7 @@ static int _cl5ReadDBVersion (const char *dir, char *clVersion, int buflen) file = PR_Open (fName, PR_RDONLY, 777); if (file == NULL) { - slapi_log_error(SLAPI_LOG_REPL, repl_plugin_name_cl, + slapi_log_err(SLAPI_LOG_REPL, repl_plugin_name_cl, "_cl5ReadDBVersion - Failed to open DBVERSION; NSPR error - %d\n", PR_GetError ()); return CL5_SYSTEM_ERROR; @@ -3120,7 +3120,7 @@ static int _cl5ReadDBVersion (const char *dir, char *clVersion, int buflen) size = slapi_read_buffer (file, buff, BUFSIZ); if (size < 0) { - slapi_log_error(SLAPI_LOG_REPL, repl_plugin_name_cl, + slapi_log_err(SLAPI_LOG_REPL, repl_plugin_name_cl, "_cl5ReadDBVersion - Failed to read DBVERSION; NSPR error - %d\n", PR_GetError ()); PR_Close (file); @@ -3141,7 +3141,7 @@ static int _cl5ReadDBVersion (const char *dir, char *clVersion, int buflen) rc = PR_Close (file); if (rc != PR_SUCCESS) { - slapi_log_error(SLAPI_LOG_REPL, repl_plugin_name_cl, + slapi_log_err(SLAPI_LOG_REPL, repl_plugin_name_cl, "_cl5ReadDBVersion - Failed to close DBVERSION; NSPR error - %d\n", PR_GetError ()); return CL5_SYSTEM_ERROR; @@ -3164,7 +3164,7 @@ static int _cl5WriteDBVersion(void) s_cl5Desc.dbConfig.fileMode); if (file == NULL) { - slapi_log_error(SLAPI_LOG_REPL, repl_plugin_name_cl, + slapi_log_err(SLAPI_LOG_REPL, repl_plugin_name_cl, "_cl5WriteDBVersion - Failed to open DBVERSION; NSPR error - %d\n", PR_GetError ()); return CL5_SYSTEM_ERROR; @@ -3178,7 +3178,7 @@ static int _cl5WriteDBVersion(void) size = slapi_write_buffer (file, clVersion, len); if (size != len) { - slapi_log_error(SLAPI_LOG_REPL, repl_plugin_name_cl, + slapi_log_err(SLAPI_LOG_REPL, repl_plugin_name_cl, "_cl5WriteDBVersion - Failed to write DBVERSION; NSPR error - %d\n", PR_GetError ()); PR_Close (file); @@ -3188,7 +3188,7 @@ static int _cl5WriteDBVersion(void) rc = PR_Close (file); if (rc != PR_SUCCESS) { - slapi_log_error(SLAPI_LOG_REPL, repl_plugin_name_cl, + slapi_log_err(SLAPI_LOG_REPL, repl_plugin_name_cl, "_cl5WriteDBVersion - Failed to close DBVERSION; NSPR error - %d\n", PR_GetError ()); return CL5_SYSTEM_ERROR; @@ -3212,7 +3212,7 @@ static void _cl5Close(void) interval = PR_MillisecondsToInterval(100); while (s_cl5Desc.threadCount > 0) { - slapi_log_error(SLAPI_LOG_REPL, repl_plugin_name_cl, + slapi_log_err(SLAPI_LOG_REPL, repl_plugin_name_cl, "_cl5Close -Waiting for threads to exit: %d thread(s) still active\n", s_cl5Desc.threadCount); DS_Sleep(interval); @@ -3231,7 +3231,7 @@ static void _cl5Close(void) if (_cl5Delete (s_cl5Desc.dbDir, 1) != CL5_SUCCESS) { - slapi_log_error(SLAPI_LOG_REPL, repl_plugin_name_cl, + slapi_log_err(SLAPI_LOG_REPL, repl_plugin_name_cl, "cl5Close - Failed to remove changelog\n"); } s_cl5Desc.dbRmOnClose = PR_FALSE; @@ -3252,10 +3252,10 @@ static void _cl5DBClose(void) Object *obj; for (obj = objset_first_obj(s_cl5Desc.dbFiles); obj; obj = objset_next_obj(s_cl5Desc.dbFiles, obj)) { - slapi_log_error(SLAPI_LOG_REPL, repl_plugin_name_cl, + slapi_log_err(SLAPI_LOG_REPL, repl_plugin_name_cl, "_cl5DBClose - Deleting DB object %p\n", obj); } - slapi_log_error(SLAPI_LOG_REPL, repl_plugin_name_cl, + slapi_log_err(SLAPI_LOG_REPL, repl_plugin_name_cl, "_cl5DBClose - Closing databases in %s\n", s_cl5Desc.dbDir); objset_delete (&s_cl5Desc.dbFiles); } @@ -3298,7 +3298,7 @@ static int _cl5Delete (const char *clDir, int rmDir) dir = PR_OpenDir(clDir); if (dir == NULL) { - slapi_log_error(SLAPI_LOG_REPL, repl_plugin_name_cl, + slapi_log_err(SLAPI_LOG_REPL, repl_plugin_name_cl, "_cl5Delete - Failed to open changelog dir; NSPR error - %d\n", PR_GetError ()); return CL5_SYSTEM_ERROR; @@ -3312,7 +3312,7 @@ static int _cl5Delete (const char *clDir, int rmDir) break; } if (!_cl5IsDbFile(entry->name)) { - slapi_log_error(SLAPI_LOG_REPL, repl_plugin_name_cl, + slapi_log_err(SLAPI_LOG_REPL, repl_plugin_name_cl, "_cl5Delete - Skipping file [%s/%s] because it is not a changelogdb file.\n", clDir, entry->name); dirisempty = 0; /* skipped at least one file - dir not empty */ @@ -3325,7 +3325,7 @@ static int _cl5Delete (const char *clDir, int rmDir) /* DBVERSION */ rc = PR_Delete(filename) != PR_SUCCESS; if (PR_SUCCESS != rc) { - slapi_log_error(SLAPI_LOG_ERR, repl_plugin_name_cl, + slapi_log_err(SLAPI_LOG_ERR, repl_plugin_name_cl, "_cl5Delete - Failed to remove \"%s\"; NSPR error - %d\n", filename, PR_GetError ()); } @@ -3334,7 +3334,7 @@ static int _cl5Delete (const char *clDir, int rmDir) rc = s_cl5Desc.dbEnv->dbremove(s_cl5Desc.dbEnv, 0, filename, 0, DEFAULT_DB_ENV_OP_FLAGS); if (rc) { - slapi_log_error(SLAPI_LOG_ERR, repl_plugin_name_cl, + slapi_log_err(SLAPI_LOG_ERR, repl_plugin_name_cl, "_cl5Delete - Failed to remove \"%s\"; " "libdb error - %d (%s)\n", filename, rc, db_strerror(rc)); @@ -3345,7 +3345,7 @@ static int _cl5Delete (const char *clDir, int rmDir) rc = PR_CloseDir(dir); if (rc != PR_SUCCESS) { - slapi_log_error(SLAPI_LOG_REPL, repl_plugin_name_cl, + slapi_log_err(SLAPI_LOG_REPL, repl_plugin_name_cl, "_cl5Delete - Failed to close changelog dir (%s); NSPR error - %d\n", clDir, PR_GetError ()); return CL5_SYSTEM_ERROR; @@ -3356,13 +3356,13 @@ static int _cl5Delete (const char *clDir, int rmDir) rc = PR_RmDir (clDir); if (rc != 0) { - slapi_log_error(SLAPI_LOG_REPL, repl_plugin_name_cl, + slapi_log_err(SLAPI_LOG_REPL, repl_plugin_name_cl, "_cl5Delete - Failed to remove changelog dir (%s); errno = %d\n", clDir, errno); return CL5_SYSTEM_ERROR; } } else if (rmDir && !dirisempty) { - slapi_log_error(SLAPI_LOG_REPL, repl_plugin_name_cl, + slapi_log_err(SLAPI_LOG_REPL, repl_plugin_name_cl, "_cl5Delete - Changelog dir (%s) is not empty - cannot remove\n", clDir); } @@ -3395,7 +3395,7 @@ static int _cl5TrimInit(void) if (s_cl5Desc.dbTrim.lock == NULL) { - slapi_log_error(SLAPI_LOG_REPL, repl_plugin_name_cl, + slapi_log_err(SLAPI_LOG_REPL, repl_plugin_name_cl, "_cl5InitTrimming - Failed to create lock; NSPR error - %d\n", PR_GetError ()); return CL5_SYSTEM_ERROR; @@ -3450,7 +3450,7 @@ static int _cl5TrimMain (void *param) } PR_AtomicDecrement (&s_cl5Desc.threadCount); - slapi_log_error(SLAPI_LOG_REPL, repl_plugin_name_cl, "_cl5TrimMain - Exiting\n"); + slapi_log_err(SLAPI_LOG_REPL, repl_plugin_name_cl, "_cl5TrimMain - Exiting\n"); return 0; } @@ -3518,11 +3518,11 @@ static void _cl5DoPurging (Replica *replica) /* We found our changelog, now purge it */ _cl5PurgeRID (obj, rid); object_release (obj); - slapi_log_error(SLAPI_LOG_REPL, repl_plugin_name_cl, + slapi_log_err(SLAPI_LOG_REPL, repl_plugin_name_cl, "_cl5DoPurging - Purged rid (%d) from suffix (%s)\n", rid, slapi_sdn_get_dn(sdn)); } else { - slapi_log_error(SLAPI_LOG_ERR, repl_plugin_name_cl, + slapi_log_err(SLAPI_LOG_ERR, repl_plugin_name_cl, "_cl5DoPurging - Purge rid (%d) failed to find changelog file (%s) for suffix (%s)\n", rid, fileName, slapi_sdn_get_dn(sdn)); } @@ -3549,7 +3549,7 @@ _cl5CompactDBs(void) PR_Lock (s_cl5Desc.dbTrim.lock); rc = TXN_BEGIN(s_cl5Desc.dbEnv, NULL, &txnid, 0); if (rc) { - slapi_log_error(SLAPI_LOG_ERR, repl_plugin_name_cl, + slapi_log_err(SLAPI_LOG_ERR, repl_plugin_name_cl, "_cl5CompactDBs - Failed to begin transaction; db error - %d %s\n", rc, db_strerror(rc)); goto bail; @@ -3565,12 +3565,12 @@ _cl5CompactDBs(void) rc = db->compact(db, txnid, NULL/*start*/, NULL/*stop*/, &c_data, DB_FREE_SPACE, NULL/*end*/); if (rc) { - slapi_log_error(SLAPI_LOG_ERR, repl_plugin_name_cl, + slapi_log_err(SLAPI_LOG_ERR, repl_plugin_name_cl, "_cl5CompactDBs - Failed to compact %s; db error - %d %s\n", dbFile->replName, rc, db_strerror(rc)); goto bail; } - slapi_log_error(SLAPI_LOG_REPL, repl_plugin_name_cl, + slapi_log_err(SLAPI_LOG_REPL, repl_plugin_name_cl, "_cl5CompactDBs - %s - %d pages freed\n", dbFile->replName, c_data.compact_pages_free); } @@ -3581,14 +3581,14 @@ bail: if (rc) { rc = TXN_ABORT (txnid); if (rc) { - slapi_log_error(SLAPI_LOG_ERR, repl_plugin_name_cl, + slapi_log_err(SLAPI_LOG_ERR, repl_plugin_name_cl, "_cl5CompactDBs - Failed to abort transaction; db error - %d %s\n", rc, db_strerror(rc)); } } else { rc = TXN_COMMIT (txnid, 0); if (rc) { - slapi_log_error(SLAPI_LOG_ERR, repl_plugin_name_cl, + slapi_log_err(SLAPI_LOG_ERR, repl_plugin_name_cl, "_cl5CompactDBs - Failed to commit transaction; db error - %d %s\n", rc, db_strerror(rc)); } @@ -3619,7 +3619,7 @@ _cl5PurgeGetFirstEntry(Object *obj, CL5Entry *entry, void **iterator, DB_TXN *tx rc = file->db->cursor(file->db, txnid, &cursor, 0); if (rc != 0) { - slapi_log_error(SLAPI_LOG_ERR, repl_plugin_name_cl, + slapi_log_err(SLAPI_LOG_ERR, repl_plugin_name_cl, "_cl5PurgeGetFirstEntry - Failed to create cursor; db error - %d %s\n", rc, db_strerror(rc)); rc = CL5_DB_ERROR; goto done; @@ -3642,7 +3642,7 @@ _cl5PurgeGetFirstEntry(Object *obj, CL5Entry *entry, void **iterator, DB_TXN *tx slapi_ch_free(&(data.data)); if (rc != 0) { - slapi_log_error(SLAPI_LOG_REPL, repl_plugin_name_cl, + slapi_log_err(SLAPI_LOG_REPL, repl_plugin_name_cl, "_cl5PurgeGetFirstEntry - Failed to format entry: %d\n", rc); goto done; } @@ -3667,7 +3667,7 @@ _cl5PurgeGetFirstEntry(Object *obj, CL5Entry *entry, void **iterator, DB_TXN *tx } /* db error occured while iterating */ - slapi_log_error(SLAPI_LOG_ERR, repl_plugin_name_cl, + slapi_log_err(SLAPI_LOG_ERR, repl_plugin_name_cl, "_cl5PurgeGetFirstEntry - Failed to get entry; db error - %d %s\n", rc, db_strerror(rc)); rc = CL5_DB_ERROR; @@ -3716,7 +3716,7 @@ _cl5PurgeGetNextEntry (CL5Entry *entry, void *iterator, DBT *key) /* Not a lock error, free the key */ slapi_ch_free(&key->data); } - slapi_log_error(rc == CL5_DB_LOCK_ERROR?SLAPI_LOG_REPL:SLAPI_LOG_ERR, + slapi_log_err(rc == CL5_DB_LOCK_ERROR?SLAPI_LOG_REPL:SLAPI_LOG_ERR, repl_plugin_name_cl, "_cl5PurgeGetNextEntry - Failed to format entry: %d\n", rc); @@ -3738,7 +3738,7 @@ _cl5PurgeGetNextEntry (CL5Entry *entry, void *iterator, DBT *key) } /* cursor operation failed */ - slapi_log_error(rc == CL5_DB_LOCK_ERROR?SLAPI_LOG_REPL:SLAPI_LOG_ERR, + slapi_log_err(rc == CL5_DB_LOCK_ERROR?SLAPI_LOG_REPL:SLAPI_LOG_ERR, repl_plugin_name_cl, "_cl5PurgeGetNextEntry - Failed to get entry; db error - %d %s\n", rc, db_strerror(rc)); @@ -3792,7 +3792,7 @@ _cl5PurgeRID(Object *obj, ReplicaId cleaned_rid) rc = TXN_BEGIN(s_cl5Desc.dbEnv, NULL, &txnid, 0); if (rc != 0){ - slapi_log_error(SLAPI_LOG_ERR, repl_plugin_name_cl, + slapi_log_err(SLAPI_LOG_ERR, repl_plugin_name_cl, "_cl5PurgeRID - Failed to begin transaction; db error - %d %s. " "Changelog was not purged of rid(%d)\n", rc, db_strerror(rc), cleaned_rid); @@ -3834,7 +3834,7 @@ _cl5PurgeRID(Object *obj, ReplicaId cleaned_rid) * Reduce the the batch count and reset the key to * the starting point */ - slapi_log_error(SLAPI_LOG_REPL, repl_plugin_name_cl, + slapi_log_err(SLAPI_LOG_REPL, repl_plugin_name_cl, "_cl5PurgeRID - Ran out of db locks deleting entry. " "Reduce the batch value and restart.\n"); batch_count = trimmed - 10; @@ -3849,7 +3849,7 @@ _cl5PurgeRID(Object *obj, ReplicaId cleaned_rid) break; } else { /* fatal error */ - slapi_log_error(SLAPI_LOG_ERR, repl_plugin_name_cl, + slapi_log_err(SLAPI_LOG_ERR, repl_plugin_name_cl, "_cl5PurgeRID - Fatal error (%d)\n", rc); slapi_ch_free(&(key.data)); finished = 1; @@ -3869,7 +3869,7 @@ _cl5PurgeRID(Object *obj, ReplicaId cleaned_rid) * Reduce the the batch count and reset the key to the starting * point. */ - slapi_log_error(SLAPI_LOG_ERR, repl_plugin_name_cl, + slapi_log_err(SLAPI_LOG_ERR, repl_plugin_name_cl, "_cl5PurgeRID - Ran out of db locks getting the next entry. " "Reduce the batch value and restart.\n"); batch_count = trimmed - 10; @@ -3900,7 +3900,7 @@ _cl5PurgeRID(Object *obj, ReplicaId cleaned_rid) if (rc == CL5_SUCCESS || rc == CL5_NOTFOUND){ rc = TXN_COMMIT (txnid, 0); if (rc != 0){ - slapi_log_error(SLAPI_LOG_ERR, repl_plugin_name_cl, + slapi_log_err(SLAPI_LOG_ERR, repl_plugin_name_cl, "_cl5PurgeRID - Failed to commit transaction; db error - %d %s. " "Changelog was not completely purged of rid (%d)\n", rc, db_strerror(rc), cleaned_rid); @@ -3917,14 +3917,14 @@ _cl5PurgeRID(Object *obj, ReplicaId cleaned_rid) } else { rc = TXN_ABORT (txnid); if (rc != 0){ - slapi_log_error(SLAPI_LOG_ERR, repl_plugin_name_cl, + slapi_log_err(SLAPI_LOG_ERR, repl_plugin_name_cl, "_cl5PurgeRID - Failed to abort transaction; db error - %d %s. " "Changelog was not completely purged of rid (%d)\n", rc, db_strerror(rc), cleaned_rid); } if (batch_count == 0){ /* This was not a retry. Fatal error, break out */ - slapi_log_error(SLAPI_LOG_ERR, repl_plugin_name_cl, + slapi_log_err(SLAPI_LOG_ERR, repl_plugin_name_cl, "_cl5PurgeRID - Changelog was not purged of rid (%d)\n", cleaned_rid); break; @@ -3933,7 +3933,7 @@ _cl5PurgeRID(Object *obj, ReplicaId cleaned_rid) } slapi_ch_free_string(&starting_key); - slapi_log_error(SLAPI_LOG_REPL, repl_plugin_name_cl, + slapi_log_err(SLAPI_LOG_REPL, repl_plugin_name_cl, "_cl5PurgeRID - Removed (%ld entries) that originated from rid (%d)\n", totalTrimmed, cleaned_rid); } @@ -3978,7 +3978,7 @@ static void _cl5TrimFile (Object *obj, long *numToTrim) rc = TXN_BEGIN(s_cl5Desc.dbEnv, NULL, &txnid, 0); if (rc != 0) { - slapi_log_error(SLAPI_LOG_ERR, repl_plugin_name_cl, + slapi_log_err(SLAPI_LOG_ERR, repl_plugin_name_cl, "_cl5TrimFile - Failed to begin transaction; db error - %d %s\n", rc, db_strerror(rc)); finished = PR_TRUE; @@ -3993,7 +3993,7 @@ static void _cl5TrimFile (Object *obj, long *numToTrim) * parameters and has been seen by all consumers. */ if(op.csn == NULL){ - slapi_log_error(SLAPI_LOG_ERR, repl_plugin_name_cl, "_cl5TrimFile - " + slapi_log_err(SLAPI_LOG_ERR, repl_plugin_name_cl, "_cl5TrimFile - " "Operation missing csn, moving on to next entry.\n"); cl5_operation_parameters_done (&op); finished =_cl5GetNextEntry (&entry, it); @@ -4040,7 +4040,7 @@ static void _cl5TrimFile (Object *obj, long *numToTrim) else { if (slapi_is_loglevel_set(SLAPI_LOG_REPL)) { - slapi_log_error(SLAPI_LOG_REPL, repl_plugin_name_cl, + slapi_log_err(SLAPI_LOG_REPL, repl_plugin_name_cl, "_cl5TrimFile - Changelog purge skipped anchor csn %s\n", csn_as_string (maxcsn, PR_FALSE, strCSN)); } @@ -4075,7 +4075,7 @@ static void _cl5TrimFile (Object *obj, long *numToTrim) rc = TXN_ABORT (txnid); if (rc != 0) { - slapi_log_error(SLAPI_LOG_ERR, repl_plugin_name_cl, + slapi_log_err(SLAPI_LOG_ERR, repl_plugin_name_cl, "_cl5TrimFile - Failed to abort transaction; db error - %d %s\n", rc, db_strerror(rc)); } @@ -4086,7 +4086,7 @@ static void _cl5TrimFile (Object *obj, long *numToTrim) if (rc != 0) { finished = 1; - slapi_log_error(SLAPI_LOG_ERR, repl_plugin_name_cl, + slapi_log_err(SLAPI_LOG_ERR, repl_plugin_name_cl, "_cl5TrimFile - Failed to commit transaction; db error - %d %s\n", rc, db_strerror(rc)); } @@ -4103,7 +4103,7 @@ static void _cl5TrimFile (Object *obj, long *numToTrim) if (totalTrimmed) { - slapi_log_error(SLAPI_LOG_REPL, repl_plugin_name_cl, "_cl5TrimFile - Trimmed %d changes from the changelog\n", + slapi_log_err(SLAPI_LOG_REPL, repl_plugin_name_cl, "_cl5TrimFile - Trimmed %d changes from the changelog\n", totalTrimmed); } } @@ -4174,7 +4174,7 @@ static int _cl5ReadRUV (const char *replGen, Object *obj, PRBool purge) } if (rc != RUV_SUCCESS) { - slapi_log_error(SLAPI_LOG_REPL, repl_plugin_name_cl, + slapi_log_err(SLAPI_LOG_REPL, repl_plugin_name_cl, "_cl5ReadRUV - %s - Failed to initialize %s ruv; " "RUV error %d\n", agmt_name, purge? "purge" : "upper bound", rc); @@ -4193,7 +4193,7 @@ static int _cl5ReadRUV (const char *replGen, Object *obj, PRBool purge) rc = _cl5ConstructRUV (replGen, obj, purge); goto done; - default: slapi_log_error(SLAPI_LOG_ERR, repl_plugin_name_cl, + default: slapi_log_err(SLAPI_LOG_ERR, repl_plugin_name_cl, "_cl5ReadRUV - %s - Failed to get purge RUV; " "db error - %d %s\n", agmt_name, rc, db_strerror(rc)); rc = CL5_DB_ERROR; @@ -4249,7 +4249,7 @@ static int _cl5WriteRUV (CL5DBFile *file, PRBool purge) rc = txn_begin(s_cl5Desc.dbEnv, NULL, &txnid, 0); if (rc != 0) { - slapi_log_error(SLAPI_LOG_ERR, repl_plugin_name_cl, + slapi_log_err(SLAPI_LOG_ERR, repl_plugin_name_cl, "_cl5WriteRUV - Failed to begin transaction; db error - %d %s\n", rc, db_strerror(rc)); return CL5_DB_ERROR; @@ -4264,7 +4264,7 @@ static int _cl5WriteRUV (CL5DBFile *file, PRBool purge) rc = txn_commit (txnid, 0); if (rc != 0) { - slapi_log_error(SLAPI_LOG_ERR, repl_plugin_name_cl, + slapi_log_err(SLAPI_LOG_ERR, repl_plugin_name_cl, "_cl5WriteRUV - Failed to commit transaction; db error - %d %s\n", rc, db_strerror(rc)); return CL5_DB_ERROR; @@ -4274,7 +4274,7 @@ static int _cl5WriteRUV (CL5DBFile *file, PRBool purge) } else { - slapi_log_error(SLAPI_LOG_ERR, repl_plugin_name_cl, + slapi_log_err(SLAPI_LOG_ERR, repl_plugin_name_cl, "_cl5WriteRUV - Failed to write %s RUV for file %s; db error - %d (%s)\n", purge? "purge" : "upper bound", file->name, rc, db_strerror(rc)); @@ -4287,7 +4287,7 @@ static int _cl5WriteRUV (CL5DBFile *file, PRBool purge) rc = txn_abort (txnid); if (rc != 0) { - slapi_log_error(SLAPI_LOG_ERR, repl_plugin_name_cl, + slapi_log_err(SLAPI_LOG_ERR, repl_plugin_name_cl, "_cl5WriteRUV - Failed to abort transaction; db error - %d %s\n", rc, db_strerror(rc)); } @@ -4319,7 +4319,7 @@ static int _cl5ConstructRUV (const char *replGen, Object *obj, PRBool purge) rc = ruv_init_new (replGen, 0, NULL, &file->maxRUV); if (rc != RUV_SUCCESS) { - slapi_log_error(SLAPI_LOG_REPL, repl_plugin_name_cl, "_cl5ConstructRUV - " + slapi_log_err(SLAPI_LOG_REPL, repl_plugin_name_cl, "_cl5ConstructRUV - " "Failed to initialize %s RUV for file %s; ruv error - %d\n", purge? "purge" : "upper bound", file->name, rc); return CL5_RUV_ERROR; @@ -4332,7 +4332,7 @@ static int _cl5ConstructRUV (const char *replGen, Object *obj, PRBool purge) if(op.csn){ rid = csn_get_replicaid (op.csn); } else { - slapi_log_error(SLAPI_LOG_WARNING, repl_plugin_name_cl, "_cl5ConstructRUV - " + slapi_log_err(SLAPI_LOG_WARNING, repl_plugin_name_cl, "_cl5ConstructRUV - " "Operation missing csn, moving on to next entry.\n"); cl5_operation_parameters_done (&op); rc = _cl5GetNextEntry (&entry, iterator); @@ -4340,7 +4340,7 @@ static int _cl5ConstructRUV (const char *replGen, Object *obj, PRBool purge) } if(is_cleaned_rid(rid)){ /* skip this entry as the rid is invalid */ - slapi_log_error(SLAPI_LOG_REPL, repl_plugin_name_cl, "_cl5ConstructRUV - " + slapi_log_err(SLAPI_LOG_REPL, repl_plugin_name_cl, "_cl5ConstructRUV - " "Skipping entry because its csn contains a cleaned rid(%d)\n", rid); cl5_operation_parameters_done (&op); rc = _cl5GetNextEntry (&entry, iterator); @@ -4354,7 +4354,7 @@ static int _cl5ConstructRUV (const char *replGen, Object *obj, PRBool purge) cl5_operation_parameters_done (&op); if (rc != RUV_SUCCESS) { - slapi_log_error(SLAPI_LOG_REPL, repl_plugin_name_cl, "_cl5ConstructRUV - " + slapi_log_err(SLAPI_LOG_REPL, repl_plugin_name_cl, "_cl5ConstructRUV - " "Failed to updated %s RUV for file %s; ruv error - %d\n", purge ? "purge" : "upper bound", file->name, rc); rc = CL5_RUV_ERROR; @@ -4422,7 +4422,7 @@ static int _cl5UpdateRUV (Object *obj, CSN *csn, PRBool newReplica, PRBool purge if (rc != RUV_SUCCESS) { - slapi_log_error(SLAPI_LOG_REPL, repl_plugin_name_cl, "_cl5UpdatePurgeRUV - " + slapi_log_err(SLAPI_LOG_REPL, repl_plugin_name_cl, "_cl5UpdatePurgeRUV - " "Failed to update %s RUV for file %s; ruv error - %d\n", purge ? "purge" : "upper bound", file->name, rc); return CL5_RUV_ERROR; @@ -4515,7 +4515,7 @@ static int _cl5GetRUV2Purge2 (Object *fileObj, RUV **ruv) rc = ruv_enumerate_elements (consRUV, _cl5EnumConsumerRUV, *ruv); if (rc != RUV_SUCCESS) { - slapi_log_error(SLAPI_LOG_REPL, repl_plugin_name_cl, "_cl5GetRUV2Purge2 - " + slapi_log_err(SLAPI_LOG_REPL, repl_plugin_name_cl, "_cl5GetRUV2Purge2 - " "Failed to construct ruv; ruv error - %d\n", rc); rc = CL5_RUV_ERROR; object_release (consRUVObj); @@ -4573,7 +4573,7 @@ static int _cl5GetEntryCount (CL5DBFile *file) /* delete the entry. the entry is re-added when file is successfully closed */ file->db->del (file->db, NULL, &key, DEFAULT_DB_OP_FLAGS(NULL)); - slapi_log_error(SLAPI_LOG_REPL, repl_plugin_name_cl, + slapi_log_err(SLAPI_LOG_REPL, repl_plugin_name_cl, "_cl5GetEntryCount - %d changes for replica %s\n", file->entryCount, file->replName); return CL5_SUCCESS; @@ -4589,7 +4589,7 @@ static int _cl5GetEntryCount (CL5DBFile *file) #endif if (rc != 0) { - slapi_log_error(SLAPI_LOG_ERR, repl_plugin_name_cl, + slapi_log_err(SLAPI_LOG_ERR, repl_plugin_name_cl, "_cl5GetEntryCount - Failed to get changelog statistics; " "db error - %d %s\n", rc, db_strerror(rc)); return CL5_DB_ERROR; @@ -4600,14 +4600,14 @@ static int _cl5GetEntryCount (CL5DBFile *file) #else /* DB31 */ file->entryCount = stats->bt_ndata; #endif - slapi_log_error(SLAPI_LOG_REPL, repl_plugin_name_cl, + slapi_log_err(SLAPI_LOG_REPL, repl_plugin_name_cl, "_cl5GetEntryCount - %d changes for replica %s\n", file->entryCount, file->replName); slapi_ch_free ((void **)&stats); return CL5_SUCCESS; - default: slapi_log_error(SLAPI_LOG_ERR, repl_plugin_name_cl, + default: slapi_log_err(SLAPI_LOG_ERR, repl_plugin_name_cl, "_cl5GetEntryCount - Failed to get count entry; " "db error - %d %s\n", rc, db_strerror(rc)); return CL5_DB_ERROR; @@ -4630,7 +4630,7 @@ static int _cl5WriteEntryCount (CL5DBFile *file) rc = txn_begin(s_cl5Desc.dbEnv, NULL, &txnid, 0); if (rc != 0) { - slapi_log_error(SLAPI_LOG_ERR, repl_plugin_name_cl, + slapi_log_err(SLAPI_LOG_ERR, repl_plugin_name_cl, "_cl5WriteEntryCount - Failed to begin transaction; db error - %d %s\n", rc, db_strerror(rc)); return CL5_DB_ERROR; @@ -4643,7 +4643,7 @@ static int _cl5WriteEntryCount (CL5DBFile *file) rc = txn_commit (txnid, 0); if (rc != 0) { - slapi_log_error(SLAPI_LOG_ERR, repl_plugin_name_cl, + slapi_log_err(SLAPI_LOG_ERR, repl_plugin_name_cl, "_cl5WriteEntryCount - Failed to commit transaction; db error - %d %s\n", rc, db_strerror(rc)); return CL5_DB_ERROR; @@ -4653,7 +4653,7 @@ static int _cl5WriteEntryCount (CL5DBFile *file) } else { - slapi_log_error(SLAPI_LOG_ERR, repl_plugin_name_cl, + slapi_log_err(SLAPI_LOG_ERR, repl_plugin_name_cl, "_cl5WriteEntryCount - " "Failed to write count entry for file %s; db error - %d %s\n", file->name, rc, db_strerror(rc)); @@ -4666,7 +4666,7 @@ static int _cl5WriteEntryCount (CL5DBFile *file) rc = txn_abort (txnid); if (rc != 0) { - slapi_log_error(SLAPI_LOG_ERR, repl_plugin_name_cl, + slapi_log_err(SLAPI_LOG_ERR, repl_plugin_name_cl, "_cl5WriteEntryCount - Failed to abort transaction; db error - %d %s\n", rc, db_strerror(rc)); } @@ -4731,7 +4731,7 @@ static int _cl5Operation2LDIF (const slapi_operation_parameters *op, const char { case SLAPI_OPERATION_ADD: if (NULL == op->p.p_add.target_entry) { - slapi_log_error(SLAPI_LOG_ERR, repl_plugin_name_cl, + slapi_log_err(SLAPI_LOG_ERR, repl_plugin_name_cl, "_cl5Operation2LDIF - ADD - entry is NULL\n"); return CL5_BAD_FORMAT; } @@ -4746,7 +4746,7 @@ static int _cl5Operation2LDIF (const slapi_operation_parameters *op, const char case SLAPI_OPERATION_MODIFY: if (NULL == op->p.p_modify.modify_mods) { - slapi_log_error(SLAPI_LOG_ERR, repl_plugin_name_cl, + slapi_log_err(SLAPI_LOG_ERR, repl_plugin_name_cl, "_cl5Operation2LDIF - MODIFY - mods are NULL\n"); return CL5_BAD_FORMAT; } @@ -4757,7 +4757,7 @@ static int _cl5Operation2LDIF (const slapi_operation_parameters *op, const char case SLAPI_OPERATION_MODRDN: if (NULL == op->p.p_modrdn.modrdn_mods) { - slapi_log_error(SLAPI_LOG_ERR, repl_plugin_name_cl, + slapi_log_err(SLAPI_LOG_ERR, repl_plugin_name_cl, "_cl5Operation2LDIF - MODRDN - mods are NULL\n"); return CL5_BAD_FORMAT; } @@ -4778,7 +4778,7 @@ static int _cl5Operation2LDIF (const slapi_operation_parameters *op, const char case SLAPI_OPERATION_DELETE: if (NULL == REPL_GET_DN(&op->target_address)) { - slapi_log_error(SLAPI_LOG_ERR, repl_plugin_name_cl, + slapi_log_err(SLAPI_LOG_ERR, repl_plugin_name_cl, "_cl5Operation2LDIF - DELETE - target dn is NULL\n"); return CL5_BAD_FORMAT; } @@ -4786,7 +4786,7 @@ static int _cl5Operation2LDIF (const slapi_operation_parameters *op, const char break; default: - slapi_log_error(SLAPI_LOG_ERR, repl_plugin_name_cl, + slapi_log_err(SLAPI_LOG_ERR, repl_plugin_name_cl, "_cl5Operation2LDIF - Invalid operation type - %lu\n", op->operation_type); return CL5_BAD_FORMAT; } @@ -4796,7 +4796,7 @@ static int _cl5Operation2LDIF (const slapi_operation_parameters *op, const char start = buff; if (buff == NULL) { - slapi_log_error(SLAPI_LOG_ERR, repl_plugin_name_cl, + slapi_log_err(SLAPI_LOG_ERR, repl_plugin_name_cl, "_cl5Operation2LDIF: memory allocation failed\n"); return CL5_MEMORY_ERROR; } @@ -4893,7 +4893,7 @@ _cl5LDIF2Operation (char *ldifEntry, slapi_operation_parameters *op, char **repl rc = slapi_ldif_parse_line(line, &type, &value, &freeval); if (rc != 0) { - slapi_log_error(SLAPI_LOG_REPL, repl_plugin_name_cl, + slapi_log_err(SLAPI_LOG_REPL, repl_plugin_name_cl, "_cl5LDIF2Operation - Failed to parse ldif line, moving on...\n"); continue; } @@ -4963,7 +4963,7 @@ _cl5LDIF2Operation (char *ldifEntry, slapi_operation_parameters *op, char **repl * not NULL. */ if (NULL == rawDN) { - slapi_log_error(SLAPI_LOG_ERR, repl_plugin_name_cl, + slapi_log_err(SLAPI_LOG_ERR, repl_plugin_name_cl, "_cl5LDIF2Operation - corrupted format " "for operation type - %lu\n", op->operation_type); @@ -4993,7 +4993,7 @@ _cl5LDIF2Operation (char *ldifEntry, slapi_operation_parameters *op, char **repl break; default: - slapi_log_error(SLAPI_LOG_ERR, repl_plugin_name_cl, + slapi_log_err(SLAPI_LOG_ERR, repl_plugin_name_cl, "_cl5LDIF2Operation - Invalid operation type - %lu\n", op->operation_type); if (freeval) { @@ -5017,7 +5017,7 @@ _cl5LDIF2Operation (char *ldifEntry, slapi_operation_parameters *op, char **repl } else { - slapi_log_error(SLAPI_LOG_ERR, repl_plugin_name_cl, + slapi_log_err(SLAPI_LOG_ERR, repl_plugin_name_cl, "_cl5LDIF2Operation - Invalid data format\n"); } } @@ -5047,14 +5047,14 @@ static int _cl5WriteOperationTxn(const char *replName, const char *replGen, PR_TRUE /* check for duplicates */); if (rc != CL5_SUCCESS) { - slapi_log_error(SLAPI_LOG_REPL, repl_plugin_name_cl, + slapi_log_err(SLAPI_LOG_REPL, repl_plugin_name_cl, "_cl5WriteOperationTxn - Failed to find or open DB object for replica %s\n", replName); return rc; } } else if (rc != CL5_SUCCESS) { - slapi_log_error(SLAPI_LOG_REPL, repl_plugin_name_cl, + slapi_log_err(SLAPI_LOG_REPL, repl_plugin_name_cl, "_cl5WriteOperationTxn - Failed to get db file for target dn (%s)", REPL_GET_DN(&op->target_address)); return CL5_OBJSET_ERROR; @@ -5074,7 +5074,7 @@ static int _cl5WriteOperationTxn(const char *replName, const char *replGen, if (rc != CL5_SUCCESS) { char s[CSN_STRSIZE]; - slapi_log_error(SLAPI_LOG_REPL, repl_plugin_name_cl, + slapi_log_err(SLAPI_LOG_REPL, repl_plugin_name_cl, "_cl5WriteOperationTxn - Failed to convert entry with csn (%s) " "to db format\n", csn_as_string(op->csn,PR_FALSE,s)); goto done; @@ -5089,7 +5089,7 @@ static int _cl5WriteOperationTxn(const char *replName, const char *replGen, rc = file->db->put(file->db, NULL, &key, data, 0); if (rc != 0) { - slapi_log_error(SLAPI_LOG_ERR, repl_plugin_name_cl, + slapi_log_err(SLAPI_LOG_ERR, repl_plugin_name_cl, "_cl5WriteOperationTxn - Failed to write entry; db error - %d %s\n", rc, db_strerror(rc)); if (CL5_OS_ERR_IS_DISKFULL(rc)) @@ -5114,7 +5114,7 @@ static int _cl5WriteOperationTxn(const char *replName, const char *replGen, rc = TXN_ABORT (txnid); if (rc != 0) { - slapi_log_error(SLAPI_LOG_ERR, repl_plugin_name_cl, + slapi_log_err(SLAPI_LOG_ERR, repl_plugin_name_cl, "_cl5WriteOperationTxn - Failed to abort transaction; db error - %d %s\n", rc, db_strerror(rc)); rc = CL5_DB_ERROR; @@ -5130,7 +5130,7 @@ static int _cl5WriteOperationTxn(const char *replName, const char *replGen, rc = TXN_BEGIN(s_cl5Desc.dbEnv, parent_txnid, &txnid, 0); if (rc != 0) { - slapi_log_error(SLAPI_LOG_ERR, repl_plugin_name_cl, + slapi_log_err(SLAPI_LOG_ERR, repl_plugin_name_cl, "_cl5WriteOperationTxn - Failed to start transaction; db error - %d %s\n", rc, db_strerror(rc)); rc = CL5_DB_ERROR; @@ -5149,7 +5149,7 @@ static int _cl5WriteOperationTxn(const char *replName, const char *replGen, } if (CL5_OS_ERR_IS_DISKFULL(rc)) { - slapi_log_error(SLAPI_LOG_CRIT, repl_plugin_name_cl, + slapi_log_err(SLAPI_LOG_CRIT, repl_plugin_name_cl, "_cl5WriteOperationTxn - Changelog (%s) DISK FULL; db error - %d %s\n", s_cl5Desc.dbDir, rc, db_strerror(rc)); cl5_set_diskfull(); @@ -5160,12 +5160,12 @@ static int _cl5WriteOperationTxn(const char *replName, const char *replGen, { if (rc == 0) { - slapi_log_error(SLAPI_LOG_ERR, repl_plugin_name_cl, "_cl5WriteOperationTxn - " + slapi_log_err(SLAPI_LOG_ERR, repl_plugin_name_cl, "_cl5WriteOperationTxn - " "retry (%d) the transaction (csn=%s) succeeded\n", cnt, (char*)key.data); } else if ((cnt + 1) >= MAX_TRIALS) { - slapi_log_error(SLAPI_LOG_ERR, repl_plugin_name_cl, "_cl5WriteOperationTxn - " + slapi_log_err(SLAPI_LOG_ERR, repl_plugin_name_cl, "_cl5WriteOperationTxn - " "retry (%d) the transaction (csn=%s) failed (rc=%d (%s))\n", cnt, (char*)key.data, rc, db_strerror(rc)); } @@ -5182,7 +5182,7 @@ static int _cl5WriteOperationTxn(const char *replName, const char *replGen, else { char s[CSN_STRSIZE]; - slapi_log_error(SLAPI_LOG_ERR, repl_plugin_name_cl, + slapi_log_err(SLAPI_LOG_ERR, repl_plugin_name_cl, "_cl5WriteOperationTxn - Failed to write entry with csn (%s); " "db error - %d %s\n", csn_as_string(op->csn,PR_FALSE,s), rc, db_strerror(rc)); @@ -5190,7 +5190,7 @@ static int _cl5WriteOperationTxn(const char *replName, const char *replGen, rc = TXN_ABORT (txnid); if (rc != 0) { - slapi_log_error(SLAPI_LOG_ERR, repl_plugin_name_cl, + slapi_log_err(SLAPI_LOG_ERR, repl_plugin_name_cl, "_cl5WriteOperationTxn - Failed to abort transaction; db error - %d %s\n", rc, db_strerror(rc)); } @@ -5205,7 +5205,7 @@ static int _cl5WriteOperationTxn(const char *replName, const char *replGen, /* update purge vector if we have not seen any changes from this replica before */ _cl5UpdateRUV (file_obj, op->csn, PR_TRUE, PR_TRUE); - slapi_log_error(SLAPI_LOG_REPL, repl_plugin_name_cl, + slapi_log_err(SLAPI_LOG_REPL, repl_plugin_name_cl, "cl5WriteOperationTxn - Successfully written entry with csn (%s)\n", csnStr); rc = CL5_SUCCESS; done: @@ -5241,7 +5241,7 @@ static int _cl5GetFirstEntry (Object *obj, CL5Entry *entry, void **iterator, DB_ rc = file->db->cursor(file->db, txnid, &cursor, 0); if (rc != 0) { - slapi_log_error(SLAPI_LOG_ERR, repl_plugin_name_cl, + slapi_log_err(SLAPI_LOG_ERR, repl_plugin_name_cl, "_cl5GetFirstEntry - Failed to create cursor; db error - %d %s\n", rc, db_strerror(rc)); rc = CL5_DB_ERROR; goto done; @@ -5265,7 +5265,7 @@ static int _cl5GetFirstEntry (Object *obj, CL5Entry *entry, void **iterator, DB_ slapi_ch_free (&(data.data)); if (rc != 0) { - slapi_log_error(SLAPI_LOG_REPL, repl_plugin_name_cl, + slapi_log_err(SLAPI_LOG_REPL, repl_plugin_name_cl, "_cl5GetFirstOperation - Failed to format entry: %d\n", rc); goto done; } @@ -5303,7 +5303,7 @@ static int _cl5GetFirstEntry (Object *obj, CL5Entry *entry, void **iterator, DB_ /* db error occured while iterating */ /* On this path, the condition "rc != 0" cannot be false */ - slapi_log_error(SLAPI_LOG_ERR, repl_plugin_name_cl, + slapi_log_err(SLAPI_LOG_ERR, repl_plugin_name_cl, "_cl5GetFirstEntry - Failed to get entry; db error - %d %s\n", rc, db_strerror(rc)); rc = CL5_DB_ERROR; @@ -5345,7 +5345,7 @@ static int _cl5GetNextEntry (CL5Entry *entry, void *iterator) slapi_ch_free (&(data.data)); if (rc != 0) { - slapi_log_error(SLAPI_LOG_ERR, repl_plugin_name_cl, + slapi_log_err(SLAPI_LOG_ERR, repl_plugin_name_cl, "_cl5GetNextEntry - Failed to format entry: %d\n", rc); } @@ -5374,7 +5374,7 @@ static int _cl5GetNextEntry (CL5Entry *entry, void *iterator) } /* cursor operation failed */ - slapi_log_error(rc == CL5_DB_LOCK_ERROR?SLAPI_LOG_REPL:SLAPI_LOG_ERR, + slapi_log_err(rc == CL5_DB_LOCK_ERROR?SLAPI_LOG_REPL:SLAPI_LOG_ERR, repl_plugin_name_cl, "_cl5GetNextEntry - Failed to get entry; db error - %d %s\n", rc, db_strerror(rc)); @@ -5400,7 +5400,7 @@ static int _cl5CurrentDeleteEntry (void *iterator) PR_AtomicDecrement (&file->entryCount); return CL5_SUCCESS; } else { - slapi_log_error(SLAPI_LOG_ERR, repl_plugin_name_cl, + slapi_log_err(SLAPI_LOG_ERR, repl_plugin_name_cl, "_cl5CurrentDeleteEntry - Failed, err=%d %s\n", rc, db_strerror(rc)); /* @@ -5450,27 +5450,27 @@ static int _cl5GetOperation (Object *replica, slapi_operation_parameters *op) rc = cl5DBData2Entry (data.data, data.size, &entry); if (rc == CL5_SUCCESS) { - slapi_log_error(SLAPI_LOG_REPL, repl_plugin_name_cl, + slapi_log_err(SLAPI_LOG_REPL, repl_plugin_name_cl, "_cl5GetOperation - Successfully retrieved operation with csn (%s)\n", csnStr); } else { - slapi_log_error(SLAPI_LOG_REPL, repl_plugin_name_cl, + slapi_log_err(SLAPI_LOG_REPL, repl_plugin_name_cl, "_cl5GetOperation - Failed to convert db data to operation;" " csn - %s\n", csnStr); } goto done; case DB_NOTFOUND: - slapi_log_error(SLAPI_LOG_REPL, repl_plugin_name_cl, + slapi_log_err(SLAPI_LOG_REPL, repl_plugin_name_cl, "_cl5GetOperation - Operation for csn (%s) is not found in db that should contain dn (%s)\n", csnStr, REPL_GET_DN(&op->target_address)); rc = CL5_NOTFOUND; goto done; default: - slapi_log_error(SLAPI_LOG_REPL, repl_plugin_name_cl, + slapi_log_err(SLAPI_LOG_REPL, repl_plugin_name_cl, "_cl5GetOperation - Failed to get entry for csn (%s); " "db error - %d %s\n", csnStr, rc, db_strerror(rc)); rc = CL5_DB_ERROR; @@ -5502,7 +5502,7 @@ PRBool cl5HelperEntry (const char *csnstr, CSN *csnp) } if (csn == NULL) { - slapi_log_error(SLAPI_LOG_REPL, repl_plugin_name_cl, + slapi_log_err(SLAPI_LOG_REPL, repl_plugin_name_cl, "cl5HelperEntry - Failed to get csn time; csn error\n"); return PR_FALSE; } @@ -5573,9 +5573,9 @@ static int _cl5PositionCursorForReplay (ReplicaId consumerRID, const RUV *consum agmt_name = get_thread_private_agmtname(); if (slapi_is_loglevel_set(SLAPI_LOG_REPL)) { - slapi_log_error(SLAPI_LOG_REPL, repl_plugin_name_cl, "_cl5PositionCursorForReplay - (%s): Consumer RUV:\n", agmt_name); + slapi_log_err(SLAPI_LOG_REPL, repl_plugin_name_cl, "_cl5PositionCursorForReplay - (%s): Consumer RUV:\n", agmt_name); ruv_dump (consumerRuv, agmt_name, NULL); - slapi_log_error(SLAPI_LOG_REPL, repl_plugin_name_cl, "_cl5PositionCursorForReplay - (%s): Supplier RUV:\n", agmt_name); + slapi_log_err(SLAPI_LOG_REPL, repl_plugin_name_cl, "_cl5PositionCursorForReplay - (%s): Supplier RUV:\n", agmt_name); ruv_dump (supplierRuv, agmt_name, NULL); } @@ -5592,7 +5592,7 @@ static int _cl5PositionCursorForReplay (ReplicaId consumerRID, const RUV *consum rc = CL5_SUCCESS; if (slapi_is_loglevel_set(SLAPI_LOG_REPL)) { csn_as_string(startCSN, PR_FALSE, csnStr); - slapi_log_error(SLAPI_LOG_REPL, repl_plugin_name_cl, + slapi_log_err(SLAPI_LOG_REPL, repl_plugin_name_cl, "%s: CSN %s found, position set for replay\n", agmt_name, csnStr); } } @@ -5611,14 +5611,14 @@ static int _cl5PositionCursorForReplay (ReplicaId consumerRID, const RUV *consum { if (slapi_is_loglevel_set(SLAPI_LOG_REPL)) { csn_as_string(startCSN, PR_FALSE, csnStr); - slapi_log_error(SLAPI_LOG_REPL, repl_plugin_name_cl, + slapi_log_err(SLAPI_LOG_REPL, repl_plugin_name_cl, "repl_plugin_name_cl - %s: CSN %s not found, seems to be missing\n", agmt_name, csnStr); } } else /* we are not as up to date or we purged */ { csn_as_string(startCSN, PR_FALSE, csnStr); - slapi_log_error(SLAPI_LOG_ERR, repl_plugin_name_cl, + slapi_log_err(SLAPI_LOG_ERR, repl_plugin_name_cl, "repl_plugin_name_cl - %s: CSN %s not found, we aren't as up to date, or we purged\n", agmt_name, csnStr); } @@ -5627,7 +5627,7 @@ static int _cl5PositionCursorForReplay (ReplicaId consumerRID, const RUV *consum { csn_as_string(startCSN, PR_FALSE, csnStr); /* db error */ - slapi_log_error(SLAPI_LOG_ERR, repl_plugin_name_cl, + slapi_log_err(SLAPI_LOG_ERR, repl_plugin_name_cl, "repl_plugin_name_cl - %s: Failed to retrieve change with CSN %s; db error - %d %s\n", agmt_name, csnStr, rc, db_strerror(rc)); @@ -5642,7 +5642,7 @@ static int _cl5PositionCursorForReplay (ReplicaId consumerRID, const RUV *consum if (*iterator == NULL) { - slapi_log_error(SLAPI_LOG_ERR, repl_plugin_name_cl, + slapi_log_err(SLAPI_LOG_ERR, repl_plugin_name_cl, "_cl5PositionCursorForReplay - %s - Failed to allocate iterator\n", agmt_name); rc = CL5_MEMORY_ERROR; goto done; @@ -5848,7 +5848,7 @@ static int _cl5CheckMissingCSN (const CSN *csn, const RUV *supplierRuv, CL5DBFil /* we have not seen any changes from this replica so it is ok not to have this csn */ if (slapi_is_loglevel_set(SLAPI_LOG_REPL)) { - slapi_log_error(SLAPI_LOG_REPL, repl_plugin_name_cl, "_cl5CheckMissingCSN - " + slapi_log_err(SLAPI_LOG_REPL, repl_plugin_name_cl, "_cl5CheckMissingCSN - " "can't locate %s csn: we have not seen any changes for replica %d\n", csn_as_string (csn, PR_FALSE, csnStr), rid); } @@ -5862,7 +5862,7 @@ static int _cl5CheckMissingCSN (const CSN *csn, const RUV *supplierRuv, CL5DBFil if (csn_compare (csn, supplierCsn) <= 0) { if (slapi_is_loglevel_set(SLAPI_LOG_REPL)) { - slapi_log_error(SLAPI_LOG_REPL, repl_plugin_name_cl, "_cl5CheckMissingCSN - " + slapi_log_err(SLAPI_LOG_REPL, repl_plugin_name_cl, "_cl5CheckMissingCSN - " "the change with %s csn was never logged because it was imported " "during replica initialization\n", csn_as_string (csn, PR_FALSE, csnStr)); } @@ -5871,7 +5871,7 @@ static int _cl5CheckMissingCSN (const CSN *csn, const RUV *supplierRuv, CL5DBFil else { if (slapi_is_loglevel_set(SLAPI_LOG_REPL)) { - slapi_log_error(SLAPI_LOG_REPL, repl_plugin_name_cl, "_cl5CheckMissingCSN - " + slapi_log_err(SLAPI_LOG_REPL, repl_plugin_name_cl, "_cl5CheckMissingCSN - " "change with %s csn has not yet been seen by this server; " " last csn seen from that replica is %s\n", csn_as_string (csn, PR_FALSE, csnStr), @@ -5891,7 +5891,7 @@ static int _cl5CheckMissingCSN (const CSN *csn, const RUV *supplierRuv, CL5DBFil if (csn_compare (csn, supplierCsn) <= 0) /* we should have the data but we don't */ { if (slapi_is_loglevel_set(SLAPI_LOG_REPL)) { - slapi_log_error(SLAPI_LOG_REPL, repl_plugin_name_cl, "_cl5CheckMissingCSN - " + slapi_log_err(SLAPI_LOG_REPL, repl_plugin_name_cl, "_cl5CheckMissingCSN - " "change with %s csn has been purged by this server; " "the current purge point for that replica is %s\n", csn_as_string (csn, PR_FALSE, csnStr), @@ -5902,7 +5902,7 @@ static int _cl5CheckMissingCSN (const CSN *csn, const RUV *supplierRuv, CL5DBFil else { if (slapi_is_loglevel_set(SLAPI_LOG_REPL)) { - slapi_log_error(SLAPI_LOG_REPL, repl_plugin_name_cl, "_cl5CheckMissingCSN - " + slapi_log_err(SLAPI_LOG_REPL, repl_plugin_name_cl, "_cl5CheckMissingCSN - " "change with %s csn has not yet been seen by this server; " " last csn seen from that replica is %s\n", csn_as_string (csn, PR_FALSE, csnStr), @@ -5951,7 +5951,7 @@ _cl5FileName2Replica (const char *file_name, Object **replica) len = strlen (file_gen); if (len <= extlen + 1) { - slapi_log_error(SLAPI_LOG_REPL, repl_plugin_name_cl, + slapi_log_err(SLAPI_LOG_REPL, repl_plugin_name_cl, "_cl5FileName2Replica - " "Invalid file name (%s)\n", file_name); } @@ -5968,7 +5968,7 @@ _cl5FileName2Replica (const char *file_name, Object **replica) PR_ASSERT (repl_gen); if (strcmp (file_gen, repl_gen) != 0) { - slapi_log_error(SLAPI_LOG_REPL, repl_plugin_name_cl, + slapi_log_err(SLAPI_LOG_REPL, repl_plugin_name_cl, "_cl5FileName2Replica - " "Replica generation mismatch for replica at (%s), " "file generation %s, new replica generation %s\n", @@ -5984,7 +5984,7 @@ _cl5FileName2Replica (const char *file_name, Object **replica) } else { - slapi_log_error(SLAPI_LOG_REPL, repl_plugin_name_cl, "_cl5FileName2Replica - " + slapi_log_err(SLAPI_LOG_REPL, repl_plugin_name_cl, "_cl5FileName2Replica - " "Malformed file name - %s\n", file_name); } @@ -6066,7 +6066,7 @@ static int _cl5DBOpenFileByReplicaName (const char *replName, const char *replGe slapi_ch_free((void **)&file_name); if (tmpObj) /* this file already exist */ { - slapi_log_error(SLAPI_LOG_REPL, repl_plugin_name_cl, + slapi_log_err(SLAPI_LOG_REPL, repl_plugin_name_cl, "_cl5DBOpenFileByReplicaName - Found DB object %p for replica %s\n", tmpObj, replName); /* if we were asked for file handle - keep the handle */ if (obj) @@ -6097,7 +6097,7 @@ static int _cl5DBOpenFileByReplicaName (const char *replName, const char *replGe rc = _cl5ReadRUV (replGen, tmpObj, PR_TRUE); if (rc != CL5_SUCCESS) { - slapi_log_error(SLAPI_LOG_REPL, repl_plugin_name_cl, + slapi_log_err(SLAPI_LOG_REPL, repl_plugin_name_cl, "_cl5DBOpenFileByReplicaName - Failed to get purge RUV\n"); goto done; } @@ -6106,7 +6106,7 @@ static int _cl5DBOpenFileByReplicaName (const char *replName, const char *replGe rc = _cl5ReadRUV (replGen, tmpObj, PR_FALSE); if (rc != CL5_SUCCESS) { - slapi_log_error(SLAPI_LOG_REPL, repl_plugin_name_cl, + slapi_log_err(SLAPI_LOG_REPL, repl_plugin_name_cl, "_cl5DBOpenFileByReplicaName - Failed to get upper bound RUV\n"); goto done; } @@ -6114,7 +6114,7 @@ static int _cl5DBOpenFileByReplicaName (const char *replName, const char *replGe /* Mark the DB File initialize */ _cl5DBFileInitialized(tmpObj); - slapi_log_error(SLAPI_LOG_REPL, repl_plugin_name_cl, + slapi_log_err(SLAPI_LOG_REPL, repl_plugin_name_cl, "_cl5DBOpenFileByReplicaName - Created new DB object %p\n", tmpObj); if (obj) { @@ -6154,7 +6154,7 @@ static int _cl5AddDBFile (CL5DBFile *file, Object **obj) rc = objset_add_obj(s_cl5Desc.dbFiles, tmpObj); if (rc != OBJSET_SUCCESS) { - slapi_log_error(SLAPI_LOG_REPL, repl_plugin_name_cl, + slapi_log_err(SLAPI_LOG_REPL, repl_plugin_name_cl, "_cl5AddDBFile - Failed to add db file to the list; " "repl_objset error - %d\n", rc); object_release (tmpObj); @@ -6162,7 +6162,7 @@ static int _cl5AddDBFile (CL5DBFile *file, Object **obj) } else { - slapi_log_error(SLAPI_LOG_REPL, repl_plugin_name_cl, + slapi_log_err(SLAPI_LOG_REPL, repl_plugin_name_cl, "_cl5AddDBFile - Added new DB object %p\n", tmpObj); } @@ -6189,7 +6189,7 @@ static int _cl5NewDBFile (const char *replName, const char *replGen, CL5DBFile** PR_ASSERT (replName && replGen && dbFile); if (!dbFile) { - slapi_log_error(SLAPI_LOG_ERR, repl_plugin_name_cl, + slapi_log_err(SLAPI_LOG_ERR, repl_plugin_name_cl, "_cl5NewDBFile - NULL dbFile\n"); return CL5_UNKNOWN_ERROR; } @@ -6197,7 +6197,7 @@ static int _cl5NewDBFile (const char *replName, const char *replGen, CL5DBFile** (*dbFile) = (CL5DBFile *)slapi_ch_calloc (1, sizeof (CL5DBFile)); if (*dbFile == NULL) { - slapi_log_error(SLAPI_LOG_ERR, repl_plugin_name_cl, + slapi_log_err(SLAPI_LOG_ERR, repl_plugin_name_cl, "_cl5NewDBFile - memory allocation failed\n"); return CL5_MEMORY_ERROR; } @@ -6240,7 +6240,7 @@ static int _cl5NewDBFile (const char *replName, const char *replGen, CL5DBFile** out: if (rc != 0) { - slapi_log_error(SLAPI_LOG_ERR, repl_plugin_name_cl, + slapi_log_err(SLAPI_LOG_ERR, repl_plugin_name_cl, "_cl5NewDBFile - db_open failed; db error - %d %s\n", rc, db_strerror(rc)); rc = CL5_DB_ERROR; @@ -6288,12 +6288,12 @@ out: if ( semadir != NULL ) { (*dbFile)->semaName = slapi_ch_smprintf("%s/%s.sema", semadir, replName); - slapi_log_error(SLAPI_LOG_REPL, repl_plugin_name_cl, + slapi_log_err(SLAPI_LOG_REPL, repl_plugin_name_cl, "_cl5NewDBFile - semaphore %s\n", (*dbFile)->semaName); (*dbFile)->sema = PR_OpenSemaphore((*dbFile)->semaName, PR_SEM_CREATE | PR_SEM_EXCL, 0666, s_cl5Desc.dbConfig.maxConcurrentWrites ); - slapi_log_error(SLAPI_LOG_REPL, repl_plugin_name_cl, "_cl5NewDBFile - maxConcurrentWrites=%d\n", s_cl5Desc.dbConfig.maxConcurrentWrites ); + slapi_log_err(SLAPI_LOG_REPL, repl_plugin_name_cl, "_cl5NewDBFile - maxConcurrentWrites=%d\n", s_cl5Desc.dbConfig.maxConcurrentWrites ); } if ((*dbFile)->sema == NULL ) @@ -6307,7 +6307,7 @@ out: PR_DeleteSemaphore((*dbFile)->semaName); prerr = PR_GetError(); if (PR_SUCCESS != prerr) { - slapi_log_error(SLAPI_LOG_ERR, repl_plugin_name_cl, + slapi_log_err(SLAPI_LOG_ERR, repl_plugin_name_cl, "_cl5NewDBFile - PR_DeleteSemaphore: %s; NSPR error - %d\n", (*dbFile)->semaName ? (*dbFile)->semaName : "(nil)", prerr); } @@ -6322,14 +6322,14 @@ out: { PRErrorCode prerr = PR_GetError(); if (PR_FILE_EXISTS_ERROR == prerr) { - slapi_log_error(SLAPI_LOG_ERR, repl_plugin_name_cl, + slapi_log_err(SLAPI_LOG_ERR, repl_plugin_name_cl, "_cl5NewDBFile - PR_OpenSemaphore: %s; sema: 0x%p, NSPR error - %d\n", (*dbFile)->semaName ? (*dbFile)->semaName : "(nil)", (*dbFile)->sema, prerr); - slapi_log_error(SLAPI_LOG_ERR, repl_plugin_name_cl, + slapi_log_err(SLAPI_LOG_ERR, repl_plugin_name_cl, "_cl5NewDBFile - Leftover semaphores may exist. " "Run \"ipcs -s\", and remove them with \"ipcrm -s \" if any\n"); } else { - slapi_log_error(SLAPI_LOG_ERR, repl_plugin_name_cl, + slapi_log_err(SLAPI_LOG_ERR, repl_plugin_name_cl, "_cl5NewDBFile - Failed to create semaphore %s; NSPR error - %d\n", (*dbFile)->semaName ? (*dbFile)->semaName : "(nil)", prerr); } @@ -6348,7 +6348,7 @@ out: rc = _cl5GetEntryCount (*dbFile); if (rc != CL5_SUCCESS) { - slapi_log_error(SLAPI_LOG_REPL, repl_plugin_name_cl, + slapi_log_err(SLAPI_LOG_REPL, repl_plugin_name_cl, "_cl5NewDBFile - Failed to get entry count\n"); goto done; } @@ -6378,7 +6378,7 @@ static void _cl5DBCloseFile (void **data) PR_ASSERT (file); - slapi_log_error(SLAPI_LOG_REPL, repl_plugin_name_cl, "_cl5DBCloseFile - " + slapi_log_err(SLAPI_LOG_REPL, repl_plugin_name_cl, "_cl5DBCloseFile - " "Closing database %s\n", file->name); /* close the file */ @@ -6394,7 +6394,7 @@ static void _cl5DBCloseFile (void **data) /* close the db */ if (file->db) { rc = file->db->close(file->db, 0); - slapi_log_error(SLAPI_LOG_REPL, repl_plugin_name_cl, + slapi_log_err(SLAPI_LOG_REPL, repl_plugin_name_cl, "_cl5DBCloseFile - " "Closed the changelog database handle for %s " "(rc: %d)\n", file->name, rc); @@ -6405,18 +6405,18 @@ static void _cl5DBCloseFile (void **data) { /* We need to use the libdb API to delete the files, otherwise we'll * run into problems when we try to checkpoint transactions later. */ - slapi_log_error(SLAPI_LOG_REPL, repl_plugin_name_cl, "_cl5DBCloseFile - " + slapi_log_err(SLAPI_LOG_REPL, repl_plugin_name_cl, "_cl5DBCloseFile - " "removing the changelog %s (flag %d)\n", file->name, DEFAULT_DB_ENV_OP_FLAGS); rc = s_cl5Desc.dbEnv->dbremove(s_cl5Desc.dbEnv, 0, file->name, 0, DEFAULT_DB_ENV_OP_FLAGS); if (rc != 0) { - slapi_log_error(SLAPI_LOG_REPL, repl_plugin_name_cl, "_cl5DBCloseFile - " + slapi_log_err(SLAPI_LOG_REPL, repl_plugin_name_cl, "_cl5DBCloseFile - " "failed to remove (%s) file; libdb error - %d (%s)\n", file->name, rc, db_strerror(rc)); } else { - slapi_log_error(SLAPI_LOG_REPL, repl_plugin_name_cl, "_cl5DBCloseFile - " + slapi_log_err(SLAPI_LOG_REPL, repl_plugin_name_cl, "_cl5DBCloseFile - " "Deleted the changelog database file %s\n", file->name); } @@ -6450,14 +6450,14 @@ static int _cl5GetDBFile (Object *replica, Object **obj) *obj = objset_find(s_cl5Desc.dbFiles, _cl5CompareDBFile, fileName); if (*obj) { - slapi_log_error(SLAPI_LOG_REPL, repl_plugin_name_cl, "_cl5GetDBFile - " + slapi_log_err(SLAPI_LOG_REPL, repl_plugin_name_cl, "_cl5GetDBFile - " "found DB object %p for database %s\n", *obj, fileName); slapi_ch_free_string(&fileName); return CL5_SUCCESS; } else { - slapi_log_error(SLAPI_LOG_REPL, repl_plugin_name_cl, "_cl5GetDBFile - " + slapi_log_err(SLAPI_LOG_REPL, repl_plugin_name_cl, "_cl5GetDBFile - " "no DB object found for database %s\n", fileName); slapi_ch_free_string(&fileName); return CL5_NOTFOUND; @@ -6476,14 +6476,14 @@ static int _cl5GetDBFileByReplicaName (const char *replName, const char *replGen *obj = objset_find(s_cl5Desc.dbFiles, _cl5CompareDBFile, fileName); if (*obj) { - slapi_log_error(SLAPI_LOG_REPL, repl_plugin_name_cl, "_cl5GetDBFileByReplicaName - " + slapi_log_err(SLAPI_LOG_REPL, repl_plugin_name_cl, "_cl5GetDBFileByReplicaName - " "found DB object %p for database %s\n", *obj, fileName); slapi_ch_free_string(&fileName); return CL5_SUCCESS; } else { - slapi_log_error(SLAPI_LOG_REPL, repl_plugin_name_cl, "_cl5GetDBFileByReplicaName - " + slapi_log_err(SLAPI_LOG_REPL, repl_plugin_name_cl, "_cl5GetDBFileByReplicaName - " "no DB object found for database %s\n", fileName); slapi_ch_free_string(&fileName); return CL5_NOTFOUND; @@ -6502,10 +6502,10 @@ static void _cl5DBDeleteFile (Object *obj) file->flags |= DB_FILE_DELETED; rc = objset_remove_obj(s_cl5Desc.dbFiles, obj); if (rc != OBJSET_SUCCESS) { - slapi_log_error(SLAPI_LOG_REPL, repl_plugin_name_cl, "_cl5DBDeleteFile - " + slapi_log_err(SLAPI_LOG_REPL, repl_plugin_name_cl, "_cl5DBDeleteFile - " "could not find DB object %p\n", obj); } else { - slapi_log_error(SLAPI_LOG_REPL, repl_plugin_name_cl, "_cl5DBDeleteFile - " + slapi_log_err(SLAPI_LOG_REPL, repl_plugin_name_cl, "_cl5DBDeleteFile - " "removed DB object %p\n", obj); } object_release (obj); @@ -6587,7 +6587,7 @@ static int _cl5ExportFile (PRFileDesc *prFile, Object *obj) rc = _cl5Operation2LDIF (&op, file->replGen, &buff, &len); if (rc != CL5_SUCCESS) { - slapi_log_error(SLAPI_LOG_ERR, repl_plugin_name_cl, + slapi_log_err(SLAPI_LOG_ERR, repl_plugin_name_cl, "_cl5ExportFile - Failed to convert operation to ldif\n"); operation_parameters_done (&op); break; @@ -6597,7 +6597,7 @@ static int _cl5ExportFile (PRFileDesc *prFile, Object *obj) slapi_ch_free((void **)&buff); if (wlen < len) { - slapi_log_error(SLAPI_LOG_ERR, repl_plugin_name_cl, + slapi_log_err(SLAPI_LOG_ERR, repl_plugin_name_cl, "_cl5ExportFile - Failed to write to ldif file\n"); rc = CL5_SYSTEM_ERROR; operation_parameters_done (&op); @@ -6616,7 +6616,7 @@ static int _cl5ExportFile (PRFileDesc *prFile, Object *obj) if (rc != CL5_NOTFOUND) { - slapi_log_error(SLAPI_LOG_ERR, repl_plugin_name_cl, + slapi_log_err(SLAPI_LOG_ERR, repl_plugin_name_cl, "_cl5ExportFile - Failed to retrieve changelog entry\n"); } else @@ -6723,7 +6723,7 @@ cl5_diskspace_is_available() struct statvfs fsbuf; if (statvfs(s_cl5Desc.dbDir, &fsbuf) < 0) { - slapi_log_error(SLAPI_LOG_ERR, repl_plugin_name_cl, + slapi_log_err(SLAPI_LOG_ERR, repl_plugin_name_cl, "cl5_diskspace_is_available - Cannot get file system info\n"); rval = 0; } @@ -6732,7 +6732,7 @@ cl5_diskspace_is_available() unsigned long fsiz = fsbuf.f_bavail * fsbuf.f_frsize; if (fsiz < NO_DISK_SPACE) { - slapi_log_error(SLAPI_LOG_ERR, repl_plugin_name_cl, + slapi_log_err(SLAPI_LOG_ERR, repl_plugin_name_cl, "cl5_diskspace_is_available - No enough diskspace for changelog: (%u bytes free)\n", fsiz); rval = 0; } @@ -6747,7 +6747,7 @@ cl5_diskspace_is_available() struct statfs fsbuf; if (statfs(s_cl5Desc.dbDir, &fsbuf) < 0) { - slapi_log_error(SLAPI_LOG_ERR, repl_plugin_name_cl, + slapi_log_err(SLAPI_LOG_ERR, repl_plugin_name_cl, "cl5_diskspace_is_available - Cannot get file system info\n"); rval = 0; } @@ -6756,7 +6756,7 @@ cl5_diskspace_is_available() unsigned long fsiz = fsbuf.f_bavail * fsbuf.f_bsize; if (fsiz < NO_DISK_SPACE) { - slapi_log_error(SLAPI_LOG_ERR, repl_plugin_name_cl, + slapi_log_err(SLAPI_LOG_ERR, repl_plugin_name_cl, "cl5_diskspace_is_available - No enough diskspace for changelog: (%lu bytes free)\n", fsiz); rval = 0; } @@ -6843,7 +6843,7 @@ cl5WriteRUV() * And the server IS running. * RUVs are not in the changelog and no easy way to retrieve them. * bail out - return failure */ - slapi_log_error(SLAPI_LOG_ERR, repl_plugin_name_cl, + slapi_log_err(SLAPI_LOG_ERR, repl_plugin_name_cl, "cl5WriteRUV - server (pid %d) is already running; bail.\n", slapd_pid); rc = 1; @@ -6855,7 +6855,7 @@ cl5WriteRUV() if (CL5_STATE_OPEN != s_cl5Desc.dbState) { rc = _cl5Open(config.dir, &config.dbconfig, CL5_OPEN_NORMAL); if (rc != CL5_SUCCESS) { - slapi_log_error(SLAPI_LOG_ERR, repl_plugin_name_cl, + slapi_log_err(SLAPI_LOG_ERR, repl_plugin_name_cl, "cl5WriteRUV - Failed to open changelog\n"); goto bail; } @@ -6923,7 +6923,7 @@ cl5DeleteRUV() * And the server IS running. * RUVs are not in the changelog. * bail out - return success */ - slapi_log_error(SLAPI_LOG_ERR, repl_plugin_name_cl, + slapi_log_err(SLAPI_LOG_ERR, repl_plugin_name_cl, "cl5DeleteRUV - server (pid %d) is already running; bail.\n", slapd_pid); goto bail; @@ -6934,7 +6934,7 @@ cl5DeleteRUV() if (CL5_STATE_OPEN != s_cl5Desc.dbState) { rc = _cl5Open(config.dir, &config.dbconfig, CL5_OPEN_NORMAL); if (rc != CL5_SUCCESS) { - slapi_log_error(SLAPI_LOG_ERR, repl_plugin_name_cl, + slapi_log_err(SLAPI_LOG_ERR, repl_plugin_name_cl, "cl5DeleteRUV - Failed to open changelog\n"); goto bail; } @@ -6950,20 +6950,20 @@ cl5DeleteRUV() rc = _cl5GetEntryCount(dbfile); if (rc != CL5_SUCCESS) { - slapi_log_error(SLAPI_LOG_REPL, repl_plugin_name_cl, + slapi_log_err(SLAPI_LOG_REPL, repl_plugin_name_cl, "cl5DeleteRUV - Failed to get/delete entry count\n"); goto bail; } /* _cl5ReadRUV deletes RUV after reading it */ rc = _cl5ReadRUV (dbfile->replGen, file_obj, PR_TRUE); if (rc != CL5_SUCCESS) { - slapi_log_error(SLAPI_LOG_ERR, repl_plugin_name_cl, + slapi_log_err(SLAPI_LOG_ERR, repl_plugin_name_cl, "cl5DeleteRUV - Failed to read/delete purge RUV\n"); goto bail; } rc = _cl5ReadRUV (dbfile->replGen, file_obj, PR_FALSE); if (rc != CL5_SUCCESS) { - slapi_log_error(SLAPI_LOG_ERR, repl_plugin_name_cl, + slapi_log_err(SLAPI_LOG_ERR, repl_plugin_name_cl, "cl5DeleteRUV - Failed to read/delete upper bound RUV\n"); goto bail; } @@ -7012,7 +7012,7 @@ void trigger_cl_purging(Replica *replica){ (void *)replica, PR_PRIORITY_NORMAL, PR_GLOBAL_THREAD, PR_UNJOINABLE_THREAD, DEFAULT_THREAD_STACKSIZE); if (NULL == trim_tid){ - slapi_log_error(SLAPI_LOG_ERR, repl_plugin_name_cl, + slapi_log_err(SLAPI_LOG_ERR, repl_plugin_name_cl, "trigger_cl_purging - Failed to create trimming " "thread; NSPR error - %d\n", PR_GetError ()); } else { @@ -7037,7 +7037,7 @@ trigger_cl_purging_thread(void *arg){ /* Bump the changelog thread count */ if (CL5_SUCCESS != _cl5AddThread()) { - slapi_log_error(SLAPI_LOG_ERR, repl_plugin_name_cl, + slapi_log_err(SLAPI_LOG_ERR, repl_plugin_name_cl, "trigger_cl_purging_thread - Abort, failed to increment thread count " "NSPR error - %d\n", PR_GetError ()); return; @@ -7046,7 +7046,7 @@ trigger_cl_purging_thread(void *arg){ /* Purge the changelog */ _cl5DoPurging(replica); _cl5RemoveThread(); - slapi_log_error(SLAPI_LOG_REPL, repl_plugin_name_cl, + slapi_log_err(SLAPI_LOG_REPL, repl_plugin_name_cl, "trigger_cl_purging_thread - purged changelog for (%s) rid (%d)\n", slapi_sdn_get_dn(replica_get_root(replica)), replica_get_rid(replica)); } diff --git a/ldap/servers/plugins/replication/cl5_clcache.c b/ldap/servers/plugins/replication/cl5_clcache.c index eeb04a4..13bbc21 100644 --- a/ldap/servers/plugins/replication/cl5_clcache.c +++ b/ldap/servers/plugins/replication/cl5_clcache.c @@ -221,9 +221,9 @@ clcache_get_buffer ( CLC_Buffer **buf, DB *db, ReplicaId consumer_rid, const RUV need_new = (!_pool || !_pool->pl_busy_lists || !_pool->pl_busy_lists->bl_buffers); if ( (!need_new) && (NULL != ( *buf = (CLC_Buffer*) get_thread_private_cache())) ) { - slapi_log_error(SLAPI_LOG_REPL, get_thread_private_agmtname(), + slapi_log_err(SLAPI_LOG_REPL, get_thread_private_agmtname(), "clcache_get_buffer - found thread private buffer cache %p\n", *buf); - slapi_log_error(SLAPI_LOG_REPL, get_thread_private_agmtname(), + slapi_log_err(SLAPI_LOG_REPL, get_thread_private_agmtname(), "clcache_get_buffer - _pool is %p _pool->pl_busy_lists is %p _pool->pl_busy_lists->bl_buffers is %p\n", _pool, _pool ? _pool->pl_busy_lists : NULL, (_pool && _pool->pl_busy_lists) ? _pool->pl_busy_lists->bl_buffers : NULL); @@ -274,7 +274,7 @@ clcache_get_buffer ( CLC_Buffer **buf, DB *db, ReplicaId consumer_rid, const RUV csn_free(&l_csn); } else { - slapi_log_error(SLAPI_LOG_ERR, get_thread_private_agmtname(), + slapi_log_err(SLAPI_LOG_ERR, get_thread_private_agmtname(), "clcache_get_buffer - Can't allocate new buffer\n" ); rc = CL5_MEMORY_ERROR; } @@ -290,7 +290,7 @@ clcache_return_buffer ( CLC_Buffer **buf ) { int i; - slapi_log_error(SLAPI_LOG_REPL, (*buf)->buf_agmt_name, + slapi_log_err(SLAPI_LOG_REPL, (*buf)->buf_agmt_name, "clcache_return_buffer - session end: state=%d load=%d sent=%d skipped=%d skipped_new_rid=%d " "skipped_csn_gt_cons_maxcsn=%d skipped_up_to_date=%d " "skipped_csn_gt_ruv=%d skipped_csn_covered=%d\n", @@ -353,7 +353,7 @@ clcache_load_buffer ( CLC_Buffer *buf, CSN **anchorCSN ) } } else { - slapi_log_error(SLAPI_LOG_ERR, buf->buf_agmt_name, + slapi_log_err(SLAPI_LOG_ERR, buf->buf_agmt_name, "clcache_load_buffer - Can't locate CSN %s in the changelog (DB rc=%d). " "If replication stops, the consumer may need to be reinitialized.\n", (char*)buf->buf_key.data, rc ); @@ -363,7 +363,7 @@ clcache_load_buffer ( CLC_Buffer *buf, CSN **anchorCSN ) } if ( rc != 0 ) { - slapi_log_error(SLAPI_LOG_REPL, buf->buf_agmt_name, + slapi_log_err(SLAPI_LOG_REPL, buf->buf_agmt_name, "clcache_load_buffer - rc=%d\n", rc ); } @@ -386,12 +386,12 @@ clcache_load_buffer_bulk ( CLC_Buffer *buf, int flag ) #endif if (NULL == buf) { - slapi_log_error(SLAPI_LOG_ERR, buf->buf_agmt_name, + slapi_log_err(SLAPI_LOG_ERR, buf->buf_agmt_name, "clcache_load_buffer_bulk - NULL buf\n" ); return rc; } if (NULL == buf->buf_busy_list) { - slapi_log_error(SLAPI_LOG_ERR, buf->buf_agmt_name, "clcache_load_buffer_bulk - " + slapi_log_err(SLAPI_LOG_ERR, buf->buf_agmt_name, "clcache_load_buffer_bulk - " "%s%sno buf_busy_list\n", buf->buf_agmt_name?buf->buf_agmt_name:"", buf->buf_agmt_name?": ":"" ); @@ -414,7 +414,7 @@ retry: * 2. try to find another starting position as close * as possible */ - slapi_log_error(SLAPI_LOG_ERR, buf->buf_agmt_name, "clcache_load_buffer_bulk - " + slapi_log_err(SLAPI_LOG_ERR, buf->buf_agmt_name, "clcache_load_buffer_bulk - " "changelog record with csn (%s) not found for DB_NEXT\n", (char *)buf->buf_key.data ); rc = cursor->c_get ( cursor, & buf->buf_key, & buf->buf_data, @@ -434,7 +434,7 @@ retry: if ( 0 == rc || DB_BUFFER_SMALL == rc ) { rc = clcache_cursor_get ( cursor, buf, use_flag ); if ( rc == DB_NOTFOUND && use_flag == DB_SET) { - slapi_log_error(SLAPI_LOG_ERR, buf->buf_agmt_name, "clcache_load_buffer_bulk - " + slapi_log_err(SLAPI_LOG_ERR, buf->buf_agmt_name, "clcache_load_buffer_bulk - " "changelog record with csn (%s) not found for DB_SET\n", (char *)buf->buf_key.data ); rc = clcache_cursor_get ( cursor, buf, DB_SET_RANGE ); @@ -455,7 +455,7 @@ retry: PRIntervalTime interval; tries++; - slapi_log_error(SLAPI_LOG_TRACE, buf->buf_agmt_name, "clcache_load_buffer_bulk - " + slapi_log_err(SLAPI_LOG_TRACE, buf->buf_agmt_name, "clcache_load_buffer_bulk - " "deadlock number [%d] - retrying\n", tries ); /* back off */ interval = PR_MillisecondsToInterval(slapi_rand() % 100); @@ -464,7 +464,7 @@ retry: goto retry; } if ((rc == DB_LOCK_DEADLOCK) && (tries >= MAX_TRIALS)) { - slapi_log_error(SLAPI_LOG_REPL, buf->buf_agmt_name, "clcache_load_buffer_bulk - " + slapi_log_err(SLAPI_LOG_REPL, buf->buf_agmt_name, "clcache_load_buffer_bulk - " "could not load buffer from changelog after %d tries\n", tries ); } @@ -536,7 +536,7 @@ clcache_get_next_change ( CLC_Buffer *buf, void **key, size_t *keylen, void **da } else { *csn = buf->buf_current_csn; - slapi_log_error(SLAPI_LOG_REPL, buf->buf_agmt_name, + slapi_log_err(SLAPI_LOG_REPL, buf->buf_agmt_name, "clcache_get_next_change - load=%d rec=%d csn=%s\n", buf->buf_load_cnt, buf->buf_record_cnt, (char*)*key ); } @@ -650,7 +650,7 @@ clcache_initial_anchorcsn ( CLC_Buffer *buf, int *flag ) csn_as_string(cscb->local_maxcsn, 0, local); csn_as_string(buf->buf_current_csn, 0, curr); csn_as_string(cscb->consumer_maxcsn, 0, conmaxcsn); - slapi_log_error(SLAPI_LOG_REPL, buf->buf_agmt_name, + slapi_log_err(SLAPI_LOG_REPL, buf->buf_agmt_name, "clcache_initial_anchorcsn - " "%s - (cscb %d - state %d) - csnPrevMax (%s) " "csnMax (%s) csnBuf (%s) csnConsumerMax (%s)\n", @@ -680,7 +680,7 @@ clcache_initial_anchorcsn ( CLC_Buffer *buf, int *flag ) } else { csn_init_by_csn(buf->buf_current_csn, anchorcsn); csn_as_string(buf->buf_current_csn, 0, (char *)buf->buf_key.data); - slapi_log_error(SLAPI_LOG_REPL, "clcache_initial_anchorcsn", + slapi_log_err(SLAPI_LOG_REPL, "clcache_initial_anchorcsn", "anchor is now: %s\n", (char *)buf->buf_key.data); } @@ -710,7 +710,7 @@ clcache_adjust_anchorcsn ( CLC_Buffer *buf, int *flag ) csn_as_string(cscb->local_maxcsn, 0, local); csn_as_string(buf->buf_current_csn, 0, curr); csn_as_string(cscb->consumer_maxcsn, 0, conmaxcsn); - slapi_log_error(SLAPI_LOG_REPL, buf->buf_agmt_name, "clcache_adjust_anchorcsn - " + slapi_log_err(SLAPI_LOG_REPL, buf->buf_agmt_name, "clcache_adjust_anchorcsn - " "%s - (cscb %d - state %d) - csnPrevMax (%s) " "csnMax (%s) csnBuf (%s) csnConsumerMax (%s)\n", buf->buf_agmt_name, i, cscb->state, prevmax, local, @@ -750,7 +750,7 @@ clcache_adjust_anchorcsn ( CLC_Buffer *buf, int *flag ) } else { csn_init_by_csn(buf->buf_current_csn, anchorcsn); csn_as_string(buf->buf_current_csn, 0, (char *)buf->buf_key.data); - slapi_log_error(SLAPI_LOG_REPL, buf->buf_agmt_name, "clcache_adjust_anchorcsn - " + slapi_log_err(SLAPI_LOG_REPL, buf->buf_agmt_name, "clcache_adjust_anchorcsn - " "anchor is now: %s\n", (char *)buf->buf_key.data); } @@ -780,7 +780,7 @@ clcache_skip_change ( CLC_Buffer *buf ) if (rid == buf->buf_consumer_rid && buf->buf_ignoreConsumerRID){ if (slapi_is_loglevel_set(SLAPI_LOG_REPL)) { csn_as_string(buf->buf_current_csn, 0, buf_cur_csn_str); - slapi_log_error(SLAPI_LOG_REPL, buf->buf_agmt_name, + slapi_log_err(SLAPI_LOG_REPL, buf->buf_agmt_name, "clcache_skip_change - Skipping update because the consumer with Rid: [%d] is ignored\n", rid); buf->buf_skipped_csn_gt_cons_maxcsn++; } @@ -789,7 +789,7 @@ clcache_skip_change ( CLC_Buffer *buf ) /* Skip helper entry (ENTRY_COUNT, PURGE_RUV and so on) */ if ( cl5HelperEntry ( NULL, buf->buf_current_csn ) == PR_TRUE ) { - slapi_log_error(SLAPI_LOG_REPL, buf->buf_agmt_name, + slapi_log_err(SLAPI_LOG_REPL, buf->buf_agmt_name, "clcache_skip_change - Skip helper entry type=%ld\n", csn_get_time( buf->buf_current_csn )); break; } @@ -801,7 +801,7 @@ clcache_skip_change ( CLC_Buffer *buf ) if ( i >= buf->buf_num_cscbs ) { if (slapi_is_loglevel_set(SLAPI_LOG_REPL)) { csn_as_string(buf->buf_current_csn, 0, buf_cur_csn_str); - slapi_log_error(SLAPI_LOG_REPL, buf->buf_agmt_name, + slapi_log_err(SLAPI_LOG_REPL, buf->buf_agmt_name, "clcache_skip_change - Skipping update because the changelog buffer current csn [%s] rid " "[%d] is not in the list of changelog csn buffers (length %d)\n", buf_cur_csn_str, rid, buf->buf_num_cscbs); @@ -872,7 +872,7 @@ clcache_skip_change ( CLC_Buffer *buf ) if ( cscb->local_maxcsn ) csn_as_string ( cscb->local_maxcsn, PR_FALSE, local ); csn_as_string ( buf->buf_current_csn, PR_FALSE, current ); - slapi_log_error(SLAPI_LOG_REPL, buf->buf_agmt_name, + slapi_log_err(SLAPI_LOG_REPL, buf->buf_agmt_name, "clcache_skip_change - Skip %s consumer=%s local=%s\n", current, consumer, local ); } #endif @@ -887,7 +887,7 @@ clcache_new_cscb(void) cscb = (struct csn_seq_ctrl_block *) slapi_ch_calloc ( 1, sizeof (struct csn_seq_ctrl_block) ); if (cscb == NULL) { - slapi_log_error(SLAPI_LOG_ERR, NULL, "clcache: malloc failure\n" ); + slapi_log_err(SLAPI_LOG_ERR, NULL, "clcache: malloc failure\n" ); } return cscb; } @@ -1068,7 +1068,7 @@ clcache_open_cursor ( DB_TXN *txn, CLC_Buffer *buf, DBC **cursor ) rc = buf->buf_busy_list->bl_db->cursor ( buf->buf_busy_list->bl_db, txn, cursor, 0 ); if ( rc != 0 ) { - slapi_log_error(SLAPI_LOG_ERR, get_thread_private_agmtname(), + slapi_log_err(SLAPI_LOG_ERR, get_thread_private_agmtname(), "clcache: failed to open cursor; db error - %d %s\n", rc, db_strerror(rc)); } @@ -1108,19 +1108,19 @@ clcache_cursor_get ( DBC *cursor, CLC_Buffer *buf, int flag ) &( buf->buf_key ), &( buf->buf_data ), buf->buf_load_flag | flag ); - slapi_log_error(SLAPI_LOG_REPL, buf->buf_agmt_name, + slapi_log_err(SLAPI_LOG_REPL, buf->buf_agmt_name, "clcache_cursor_get - clcache: (%d | %d) buf key len %d reallocated and retry returns %d\n", buf->buf_load_flag, flag, buf->buf_key.size, rc ); } } switch ( rc ) { case EINVAL: - slapi_log_error(SLAPI_LOG_ERR, buf->buf_agmt_name, + slapi_log_err(SLAPI_LOG_ERR, buf->buf_agmt_name, "clcache_cursor_get - invalid parameter\n" ); break; case DB_BUFFER_SMALL: - slapi_log_error(SLAPI_LOG_ERR, buf->buf_agmt_name, + slapi_log_err(SLAPI_LOG_ERR, buf->buf_agmt_name, "clcache_cursor_get - can't allocate %u bytes\n", buf->buf_data.ulen ); break; diff --git a/ldap/servers/plugins/replication/cl5_config.c b/ldap/servers/plugins/replication/cl5_config.c index 1a37997..ba3c016 100644 --- a/ldap/servers/plugins/replication/cl5_config.c +++ b/ldap/servers/plugins/replication/cl5_config.c @@ -55,7 +55,7 @@ int changelog5_config_init() } if (s_configLock == NULL) { - slapi_log_error(SLAPI_LOG_ERR, repl_plugin_name_cl, + slapi_log_err(SLAPI_LOG_ERR, repl_plugin_name_cl, "changelog5_config_init - Failed to create configuration lock; " "NSPR error - %d\n",PR_GetError ()); return 1; @@ -165,7 +165,7 @@ changelog5_config_add (Slapi_PBlock *pb, Slapi_Entry* e, Slapi_Entry* entryAfter strcpy (returntext, "attempt to add changelog when it already exists"); } - slapi_log_error(SLAPI_LOG_NOTICE, repl_plugin_name_cl, + slapi_log_err(SLAPI_LOG_NOTICE, repl_plugin_name_cl, "changelog5_config_add - Changelog already exist; " "request ignored\n"); goto done; @@ -180,7 +180,7 @@ changelog5_config_add (Slapi_PBlock *pb, Slapi_Entry* e, Slapi_Entry* entryAfter PR_snprintf (returntext, SLAPI_DSE_RETURNTEXT_SIZE, "NULL changelog directory"); } - slapi_log_error(SLAPI_LOG_ERR, repl_plugin_name_cl, + slapi_log_err(SLAPI_LOG_ERR, repl_plugin_name_cl, "changelog5_config_add - NULL changelog directory\n"); goto done; } @@ -209,7 +209,7 @@ changelog5_config_add (Slapi_PBlock *pb, Slapi_Entry* e, Slapi_Entry* entryAfter PR_snprintf (returntext, SLAPI_DSE_RETURNTEXT_SIZE, "Failed to start changelog; error - %d", rc); } - slapi_log_error(SLAPI_LOG_ERR, repl_plugin_name_cl, + slapi_log_err(SLAPI_LOG_ERR, repl_plugin_name_cl, "changelog5_config_add - Failed to start changelog\n"); goto done; } @@ -223,7 +223,7 @@ changelog5_config_add (Slapi_PBlock *pb, Slapi_Entry* e, Slapi_Entry* entryAfter { PR_snprintf (returntext, SLAPI_DSE_RETURNTEXT_SIZE, "failed to configure changelog trimming; error - %d", rc); } - slapi_log_error(SLAPI_LOG_ERR, repl_plugin_name_cl, + slapi_log_err(SLAPI_LOG_ERR, repl_plugin_name_cl, "changelog5_config_add - Failed to configure changelog trimming\n"); goto done; } @@ -273,7 +273,7 @@ changelog5_config_modify (Slapi_PBlock *pb, Slapi_Entry* entryBefore, Slapi_Entr strcpy (returntext, "changelog is not configured"); } - slapi_log_error(SLAPI_LOG_ERR, repl_plugin_name_cl, + slapi_log_err(SLAPI_LOG_ERR, repl_plugin_name_cl, "changelog5_config_modify - Changelog is not configured\n"); return SLAPI_DSE_CALLBACK_ERROR; } @@ -289,7 +289,7 @@ changelog5_config_modify (Slapi_PBlock *pb, Slapi_Entry* entryBefore, Slapi_Entr strcpy (returntext, "changelog is not configured"); } - slapi_log_error(SLAPI_LOG_ERR, repl_plugin_name_cl, + slapi_log_err(SLAPI_LOG_ERR, repl_plugin_name_cl, "changelog5_config_modify - Changelog is not configured\n"); goto done; } @@ -492,7 +492,7 @@ changelog5_config_modify (Slapi_PBlock *pb, Slapi_Entry* entryBefore, Slapi_Entr /* changelog directory changed - need to remove the previous changelog and create new one */ - slapi_log_error(SLAPI_LOG_PLUGIN, repl_plugin_name_cl, + slapi_log_err(SLAPI_LOG_PLUGIN, repl_plugin_name_cl, "changelog5_config_modify - Changelog directory changed; " "old dir - %s, new dir - %s; recreating changelog.\n", currentDir, config.dir); @@ -506,11 +506,11 @@ changelog5_config_modify (Slapi_PBlock *pb, Slapi_Entry* entryBefore, Slapi_Entr PR_snprintf (returntext, SLAPI_DSE_RETURNTEXT_SIZE, "Failed to close changelog; error - %d", rc); } - slapi_log_error(SLAPI_LOG_ERR, repl_plugin_name_cl, + slapi_log_err(SLAPI_LOG_ERR, repl_plugin_name_cl, "changelog5_config_modify - Failed to close changelog\n"); goto done; } else { - slapi_log_error(SLAPI_LOG_REPL, repl_plugin_name_cl, + slapi_log_err(SLAPI_LOG_REPL, repl_plugin_name_cl, "changelog5_config_modif - Closed the changelog\n"); } @@ -523,11 +523,11 @@ changelog5_config_modify (Slapi_PBlock *pb, Slapi_Entry* entryBefore, Slapi_Entr PR_snprintf (returntext, SLAPI_DSE_RETURNTEXT_SIZE, "failed to remove changelog; error - %d", rc); } - slapi_log_error(SLAPI_LOG_ERR, repl_plugin_name_cl, + slapi_log_err(SLAPI_LOG_ERR, repl_plugin_name_cl, "changelog5_config_modify - Failed to remove changelog\n"); goto done; } else { - slapi_log_error(SLAPI_LOG_REPL, repl_plugin_name_cl, + slapi_log_err(SLAPI_LOG_REPL, repl_plugin_name_cl, "changelog5_config_modify - Deleted the changelog at %s\n", currentDir); } @@ -540,17 +540,17 @@ changelog5_config_modify (Slapi_PBlock *pb, Slapi_Entry* entryBefore, Slapi_Entr PR_snprintf (returntext, SLAPI_DSE_RETURNTEXT_SIZE, "Failed to restart changelog; error - %d", rc); } - slapi_log_error(SLAPI_LOG_ERR, repl_plugin_name_cl, + slapi_log_err(SLAPI_LOG_ERR, repl_plugin_name_cl, "changelog5_config_modify - Failed to restart changelog\n"); /* before finishing, let's try to do some error recovery */ if (CL5_SUCCESS != cl5Open(currentDir, &config.dbconfig)) { - slapi_log_error(SLAPI_LOG_ERR, repl_plugin_name_cl, + slapi_log_err(SLAPI_LOG_ERR, repl_plugin_name_cl, "changelog5_config_modify - Failed to restore previous changelog\n"); } goto done; } else { - slapi_log_error(SLAPI_LOG_REPL, repl_plugin_name_cl, + slapi_log_err(SLAPI_LOG_REPL, repl_plugin_name_cl, "changelog5_config_modify - Opened the changelog at %s\n", config.dir); } } @@ -570,7 +570,7 @@ changelog5_config_modify (Slapi_PBlock *pb, Slapi_Entry* entryBefore, Slapi_Entr PR_snprintf (returntext, SLAPI_DSE_RETURNTEXT_SIZE, "failed to configure changelog trimming; error - %d", rc); } - slapi_log_error(SLAPI_LOG_ERR, repl_plugin_name_cl, + slapi_log_err(SLAPI_LOG_ERR, repl_plugin_name_cl, "changelog5_config_modify - Failed to configure changelog trimming\n"); goto done; } @@ -616,7 +616,7 @@ changelog5_config_delete (Slapi_PBlock *pb, Slapi_Entry* e, Slapi_Entry* entryAf PL_strncpyz(returntext, "changelog is not configured", SLAPI_DSE_RETURNTEXT_SIZE); } - slapi_log_error(SLAPI_LOG_ERR, repl_plugin_name_cl, + slapi_log_err(SLAPI_LOG_ERR, repl_plugin_name_cl, "changelog5_config_delete - Chagelog is not configured\n"); return SLAPI_DSE_CALLBACK_ERROR; } @@ -632,7 +632,7 @@ changelog5_config_delete (Slapi_PBlock *pb, Slapi_Entry* e, Slapi_Entry* entryAf PL_strncpyz(returntext, "changelog is not configured", SLAPI_DSE_RETURNTEXT_SIZE); } - slapi_log_error(SLAPI_LOG_ERR, repl_plugin_name_cl, + slapi_log_err(SLAPI_LOG_ERR, repl_plugin_name_cl, "changelog5_config_delete - Changelog is not configured\n"); goto done; } @@ -648,7 +648,7 @@ changelog5_config_delete (Slapi_PBlock *pb, Slapi_Entry* e, Slapi_Entry* entryAf PL_strncpyz (returntext, "internal failure", SLAPI_DSE_RETURNTEXT_SIZE); } - slapi_log_error(SLAPI_LOG_ERR, repl_plugin_name_cl, + slapi_log_err(SLAPI_LOG_ERR, repl_plugin_name_cl, "changelog5_config_delete - NULL directory\n"); goto done; } @@ -664,7 +664,7 @@ changelog5_config_delete (Slapi_PBlock *pb, Slapi_Entry* e, Slapi_Entry* entryAf PR_snprintf (returntext, SLAPI_DSE_RETURNTEXT_SIZE, "failed to close changelog; error - %d", rc); } - slapi_log_error(SLAPI_LOG_ERR, repl_plugin_name_cl, + slapi_log_err(SLAPI_LOG_ERR, repl_plugin_name_cl, "changelog5_config_delete - Failed to close changelog\n"); goto done; } @@ -678,7 +678,7 @@ changelog5_config_delete (Slapi_PBlock *pb, Slapi_Entry* e, Slapi_Entry* entryAf PR_snprintf (returntext, SLAPI_DSE_RETURNTEXT_SIZE, "failed to remove changelog; error - %d", rc); } - slapi_log_error(SLAPI_LOG_ERR, repl_plugin_name_cl, + slapi_log_err(SLAPI_LOG_ERR, repl_plugin_name_cl, "changelog5_config_delete - Failed to remove changelog\n"); goto done; } @@ -753,7 +753,7 @@ static void changelog5_extract_config(Slapi_Entry* entry, changelog5Config *conf if (slapi_is_duration_valid(arg)) { config->compactInterval = (long)slapi_parse_duration(arg); } else { - slapi_log_error(SLAPI_LOG_NOTICE, repl_plugin_name_cl, + slapi_log_err(SLAPI_LOG_NOTICE, repl_plugin_name_cl, "changelog5_extract_config - %s: invalid value \"%s\", ignoring the change.\n", CONFIG_CHANGELOG_COMPACTDB_ATTRIBUTE, arg); } @@ -770,7 +770,7 @@ static void changelog5_extract_config(Slapi_Entry* entry, changelog5Config *conf if (slapi_is_duration_valid(arg)) { config->trimInterval = (long)slapi_parse_duration(arg); } else { - slapi_log_error(SLAPI_LOG_NOTICE, repl_plugin_name_cl, + slapi_log_err(SLAPI_LOG_NOTICE, repl_plugin_name_cl, "changelog5_extract_config - %s: invalid value \"%s\", ignoring the change.\n", CONFIG_CHANGELOG_TRIM_ATTRIBUTE, arg); config->trimInterval = CHANGELOGDB_TRIM_INTERVAL; @@ -787,7 +787,7 @@ static void changelog5_extract_config(Slapi_Entry* entry, changelog5Config *conf if (slapi_is_duration_valid(arg)) { config->maxAge = arg; } else { - slapi_log_error(SLAPI_LOG_NOTICE, repl_plugin_name_cl, + slapi_log_err(SLAPI_LOG_NOTICE, repl_plugin_name_cl, "changelog5_extract_config - %s: invalid value \"%s\", ignoring the change.\n", CONFIG_CHANGELOG_MAXAGE_ATTRIBUTE, arg); slapi_ch_free_string(&arg); diff --git a/ldap/servers/plugins/replication/cl5_init.c b/ldap/servers/plugins/replication/cl5_init.c index 5296819..c013482 100644 --- a/ldap/servers/plugins/replication/cl5_init.c +++ b/ldap/servers/plugins/replication/cl5_init.c @@ -29,7 +29,7 @@ int changelog5_init() rc = cl5Init (); if (rc != CL5_SUCCESS) { - slapi_log_error(SLAPI_LOG_ERR, repl_plugin_name_cl, + slapi_log_err(SLAPI_LOG_ERR, repl_plugin_name_cl, "changelog5_init: failed to initialize changelog\n"); return 1; } @@ -51,7 +51,7 @@ int changelog5_init() rc = cl5Open (config.dir, &config.dbconfig); if (rc != CL5_SUCCESS) { - slapi_log_error(SLAPI_LOG_ERR, repl_plugin_name_cl, + slapi_log_err(SLAPI_LOG_ERR, repl_plugin_name_cl, "changelog5_init: failed to start changelog at %s\n", config.dir); rc = 1; @@ -62,7 +62,7 @@ int changelog5_init() rc = cl5ConfigTrimming (config.maxEntries, config.maxAge, config.compactInterval, config.trimInterval); if (rc != CL5_SUCCESS) { - slapi_log_error(SLAPI_LOG_ERR, repl_plugin_name_cl, + slapi_log_err(SLAPI_LOG_ERR, repl_plugin_name_cl, "changelog5_init: failed to configure changelog trimming\n"); rc = 1; goto done; diff --git a/ldap/servers/plugins/replication/cl5_test.c b/ldap/servers/plugins/replication/cl5_test.c index f90131d..5d3d3c2 100644 --- a/ldap/servers/plugins/replication/cl5_test.c +++ b/ldap/servers/plugins/replication/cl5_test.c @@ -74,7 +74,7 @@ static void testBasic () { int rc = 0; - slapi_log_error(SLAPI_LOG_ERR, repl_plugin_name_cl, "Starting basic test ...\n"); + slapi_log_err(SLAPI_LOG_ERR, repl_plugin_name_cl, "Starting basic test ...\n"); /* ONREPL - we can't run the tests from the startup code because operations can't be issued until all plugins are started. So, @@ -90,10 +90,10 @@ static void testBasic () } if (rc == 0) - slapi_log_error(SLAPI_LOG_ERR, repl_plugin_name_cl, + slapi_log_err(SLAPI_LOG_ERR, repl_plugin_name_cl, "Basic test completed successfully\n"); else - slapi_log_error(SLAPI_LOG_ERR, repl_plugin_name_cl, + slapi_log_err(SLAPI_LOG_ERR, repl_plugin_name_cl, "Basic test failed\n"); } @@ -104,7 +104,7 @@ static void testBackupRestore () char *baseDir; char bkDir [MAXPATHLEN]; - slapi_log_error(SLAPI_LOG_ERR, repl_plugin_name_cl, "Starting backup and recovery test ...\n"); + slapi_log_err(SLAPI_LOG_ERR, repl_plugin_name_cl, "Starting backup and recovery test ...\n"); dir = cl5GetDir (); @@ -127,10 +127,10 @@ static void testBackupRestore () } if (rc == CL5_SUCCESS) - slapi_log_error(SLAPI_LOG_ERR, repl_plugin_name_cl, + slapi_log_err(SLAPI_LOG_ERR, repl_plugin_name_cl, "Backup and Restore test completed successfully\n"); else - slapi_log_error(SLAPI_LOG_ERR, repl_plugin_name_cl, + slapi_log_err(SLAPI_LOG_ERR, repl_plugin_name_cl, "Backup and Restore test failed\n"); } @@ -146,7 +146,7 @@ static void testIteration () int rc; int i; - slapi_log_error(SLAPI_LOG_ERR, repl_plugin_name_cl, "Starting iteration test ...\n"); + slapi_log_err(SLAPI_LOG_ERR, repl_plugin_name_cl, "Starting iteration test ...\n"); /* get replica object */ r_root = slapi_sdn_new_dn_byval(REPLICA_ROOT); @@ -154,12 +154,12 @@ static void testIteration () slapi_sdn_free (&r_root); if (r_obj == NULL) { - slapi_log_error(SLAPI_LOG_ERR, repl_plugin_name_cl, "replica is not configured for (%s)\n", + slapi_log_err(SLAPI_LOG_ERR, repl_plugin_name_cl, "replica is not configured for (%s)\n", REPLICA_ROOT); return; } - slapi_log_error(SLAPI_LOG_ERR, repl_plugin_name_cl, "Starting first iteration pass ...\n"); + slapi_log_err(SLAPI_LOG_ERR, repl_plugin_name_cl, "Starting first iteration pass ...\n"); /* configure empty consumer ruv */ r = (Replica*)object_get_data (r_obj); @@ -186,16 +186,16 @@ static void testIteration () if (rc == CL5_NOTFOUND) { if (i == 0) /* success */ - slapi_log_error(SLAPI_LOG_ERR, repl_plugin_name_cl, "First iteration pass completed " + slapi_log_err(SLAPI_LOG_ERR, repl_plugin_name_cl, "First iteration pass completed " "successfully: no changes to replay\n"); else /* incorrect number of entries traversed */ - slapi_log_error(SLAPI_LOG_ERR, repl_plugin_name_cl, "First iteration pass failed: " + slapi_log_err(SLAPI_LOG_ERR, repl_plugin_name_cl, "First iteration pass failed: " "traversed %d entries; expected none\n", i); } else /* general error */ - slapi_log_error(SLAPI_LOG_ERR, repl_plugin_name_cl, "First iteration pass failed\n"); + slapi_log_err(SLAPI_LOG_ERR, repl_plugin_name_cl, "First iteration pass failed\n"); - slapi_log_error(SLAPI_LOG_ERR, repl_plugin_name_cl, "Starting second iteration pass ...\n"); + slapi_log_err(SLAPI_LOG_ERR, repl_plugin_name_cl, "Starting second iteration pass ...\n"); /* add some entries */ populateChangelogOp (); @@ -219,16 +219,16 @@ static void testIteration () if (rc == CL5_NOTFOUND) { if (i == OP_COUNT) /* success */ - slapi_log_error(SLAPI_LOG_ERR, repl_plugin_name_cl, "Second iteration pass completed " + slapi_log_err(SLAPI_LOG_ERR, repl_plugin_name_cl, "Second iteration pass completed " "successfully: %d entries traversed\n", i); else /* incorrect number of entries traversed */ - slapi_log_error(SLAPI_LOG_ERR, repl_plugin_name_cl, "Second iteration pass failed: " + slapi_log_err(SLAPI_LOG_ERR, repl_plugin_name_cl, "Second iteration pass failed: " "traversed %d entries; expected %d\n", i, OP_COUNT); } else /* general error */ - slapi_log_error(SLAPI_LOG_ERR, repl_plugin_name_cl, "Second iteration pass failed\n"); + slapi_log_err(SLAPI_LOG_ERR, repl_plugin_name_cl, "Second iteration pass failed\n"); - slapi_log_error(SLAPI_LOG_ERR, repl_plugin_name_cl, "Starting third iteration pass ...\n"); + slapi_log_err(SLAPI_LOG_ERR, repl_plugin_name_cl, "Starting third iteration pass ...\n"); /* add more entries */ populateChangelogOp (); @@ -251,16 +251,16 @@ static void testIteration () if (rc == CL5_NOTFOUND) { if (i == OP_COUNT) /* success */ - slapi_log_error(SLAPI_LOG_ERR, repl_plugin_name_cl, "Third iteration pass completed " + slapi_log_err(SLAPI_LOG_ERR, repl_plugin_name_cl, "Third iteration pass completed " "successfully: %d entries traversed\n", i); else /* incorrect number of entries traversed */ - slapi_log_error(SLAPI_LOG_ERR, repl_plugin_name_cl, "Third iteration pass failed: " + slapi_log_err(SLAPI_LOG_ERR, repl_plugin_name_cl, "Third iteration pass failed: " "traversed %d entries; expected %d\n", i, OP_COUNT); } else /* general error */ - slapi_log_error(SLAPI_LOG_ERR, repl_plugin_name_cl, "Second iteration pass failed\n"); + slapi_log_err(SLAPI_LOG_ERR, repl_plugin_name_cl, "Second iteration pass failed\n"); - slapi_log_error(SLAPI_LOG_ERR, repl_plugin_name_cl, "Iteration test is complete\n"); + slapi_log_err(SLAPI_LOG_ERR, repl_plugin_name_cl, "Iteration test is complete\n"); ruv_destroy (&ruv); object_release (r_obj); @@ -273,7 +273,7 @@ static void testTrimming () int count; int rc; - slapi_log_error(SLAPI_LOG_ERR, repl_plugin_name_cl, "Starting trimming test ...\n"); + slapi_log_err(SLAPI_LOG_ERR, repl_plugin_name_cl, "Starting trimming test ...\n"); rc = populateChangelog (200, NULL); @@ -288,7 +288,7 @@ static void testTrimming () rc = cl5ConfigTrimming (300, "1d", CHANGELOGDB_COMPACT_INTERVAL, CHANGELOGDB_TRIM_INTERVAL); interval = PR_SecondsToInterval(300); /* 5 min is default trimming interval */ - slapi_log_error(SLAPI_LOG_ERR, repl_plugin_name_cl, + slapi_log_err(SLAPI_LOG_ERR, repl_plugin_name_cl, "Trimming test: sleeping for 5 minutes until trimming kicks in\n"); DS_Sleep (interval); @@ -297,17 +297,17 @@ static void testTrimming () if (rc == 0 && count == 300) { - slapi_log_error(SLAPI_LOG_ERR, repl_plugin_name_cl, + slapi_log_err(SLAPI_LOG_ERR, repl_plugin_name_cl, "Trimming test completed successfully: changelog contains 300 entries\n"); } else if (rc == 0) { - slapi_log_error(SLAPI_LOG_ERR, repl_plugin_name_cl, + slapi_log_err(SLAPI_LOG_ERR, repl_plugin_name_cl, "Trimming test failed: changelog contains %d entries; expected - 300\n", count); } else /* general failure */ - slapi_log_error(SLAPI_LOG_ERR, repl_plugin_name_cl, "Trimming test failed\n"); + slapi_log_err(SLAPI_LOG_ERR, repl_plugin_name_cl, "Trimming test failed\n"); } static void testPerformance () @@ -324,7 +324,7 @@ static void testPerformance () endtime = PR_Now(); totaltime = (endtime - starttime) / 1000; /* ms */ - slapi_log_error(SLAPI_LOG_ERR, repl_plugin_name_cl, "Write performance:\n" + slapi_log_err(SLAPI_LOG_ERR, repl_plugin_name_cl, "Write performance:\n" "entry count - %d, total time - %ldms\n" "latency = %d msec\nthroughput = %d entry/sec\n", entryCount, totaltime, @@ -338,7 +338,7 @@ static void testPerformance () endtime = PR_Now(); totaltime = (endtime - starttime) / 1000; /* ms */ - slapi_log_error(SLAPI_LOG_ERR, repl_plugin_name_cl, "Read performance:\n" + slapi_log_err(SLAPI_LOG_ERR, repl_plugin_name_cl, "Read performance:\n" "entry count - %d, total time - %ld\n" "latency = %d msec\nthroughput = %d entry/sec\n", entryCount, totaltime, @@ -375,7 +375,7 @@ static void testPerformanceMT () endtime = PR_Now(); totaltime = (endtime - starttime) / 1000; /* ms */ - slapi_log_error(SLAPI_LOG_ERR, repl_plugin_name_cl, "Write performance:\n" + slapi_log_err(SLAPI_LOG_ERR, repl_plugin_name_cl, "Write performance:\n" "entry count - %d, total time - %ld\n" "latency = %d msec per entry\nthroughput = %d entry/sec\n", entryCount, totaltime, @@ -390,7 +390,7 @@ static void testPerformanceMT () endtime = PR_Now(); totaltime = (endtime - starttime) / 1000; /* ms */ - slapi_log_error(SLAPI_LOG_ERR, repl_plugin_name_cl, "Read performance:\n" + slapi_log_err(SLAPI_LOG_ERR, repl_plugin_name_cl, "Read performance:\n" "entry count - %d, total time - %ld\n" "latency = %d msec per entry\nthroughput = %d entry/sec\n", entryCount, totaltime, @@ -404,7 +404,7 @@ static void testLDIF () char *baseDir; char ldifFile [MAXPATHLEN]; - slapi_log_error(SLAPI_LOG_ERR, repl_plugin_name_cl, "Starting LDIF test ...\n"); + slapi_log_err(SLAPI_LOG_ERR, repl_plugin_name_cl, "Starting LDIF test ...\n"); baseDir = getBaseDir (clDir); PR_snprintf (ldifFile, sizeof(ldifFile), "%s/cl5.ldif", baseDir); @@ -426,10 +426,10 @@ static void testLDIF () PR_Delete (ldifFile); if (rc == CL5_SUCCESS) - slapi_log_error(SLAPI_LOG_ERR, repl_plugin_name_cl, + slapi_log_err(SLAPI_LOG_ERR, repl_plugin_name_cl, "LDIF test completed successfully\n"); else - slapi_log_error(SLAPI_LOG_ERR, repl_plugin_name_cl, "LDIF test failed\n"); + slapi_log_err(SLAPI_LOG_ERR, repl_plugin_name_cl, "LDIF test failed\n"); } static void testAll () @@ -448,11 +448,11 @@ static void testAll () /* xxxPINAKI */ /* these tests are not working correctly...the call to db->put() */ /* just hangs forever */ - slapi_log_error(SLAPI_LOG_ERR, repl_plugin_name_cl, + slapi_log_err(SLAPI_LOG_ERR, repl_plugin_name_cl, "Starting single threaded performance measurement ...\n"); testPerformance (); - slapi_log_error(SLAPI_LOG_ERR, repl_plugin_name_cl, + slapi_log_err(SLAPI_LOG_ERR, repl_plugin_name_cl, "Starting multi threaded performance measurement ...\n"); testPerformanceMT (); #endif @@ -523,7 +523,7 @@ static int populateChangelog (int entryCount, CSN ***csnList) return -1; } - slapi_log_error(SLAPI_LOG_ERR, repl_plugin_name_cl, + slapi_log_err(SLAPI_LOG_ERR, repl_plugin_name_cl, "Successfully populated changelog with %d entries\n", entryCount); return 0; } @@ -547,7 +547,7 @@ static int processEntries (int entryCount, CSN **csnList) operation_parameters_done (&op); } - slapi_log_error(SLAPI_LOG_ERR, repl_plugin_name_cl, + slapi_log_err(SLAPI_LOG_ERR, repl_plugin_name_cl, "Successfully read %d entries from the changelog\n", entryCount); return 0; } @@ -660,7 +660,7 @@ static int configureChangelog () slapi_pblock_get(pb, SLAPI_PLUGIN_INTOP_RESULT, &rc); if (rc != LDAP_SUCCESS) { - slapi_log_error(SLAPI_LOG_ERR, repl_plugin_name_cl, "failed to get server instance " + slapi_log_err(SLAPI_LOG_ERR, repl_plugin_name_cl, "failed to get server instance " "directory; LDAP error - %d\n", rc); rc = -1; goto done; @@ -684,7 +684,7 @@ static int configureChangelog () slapi_pblock_get(pb, SLAPI_PLUGIN_INTOP_RESULT, &rc); if (rc != LDAP_SUCCESS) { - slapi_log_error(SLAPI_LOG_ERR, repl_plugin_name_cl, "failed to add changelog " + slapi_log_err(SLAPI_LOG_ERR, repl_plugin_name_cl, "failed to add changelog " "configuration entry; LDAP error - %d\n", rc); rc = -1; } @@ -738,7 +738,7 @@ static int configureReplica () slapi_pblock_get(pb, SLAPI_PLUGIN_INTOP_RESULT, &rc); if (rc != LDAP_SUCCESS) { - slapi_log_error(SLAPI_LOG_ERR, repl_plugin_name_cl, "failed to add replica for (%s) " + slapi_log_err(SLAPI_LOG_ERR, repl_plugin_name_cl, "failed to add replica for (%s) " "configuration entry; LDAP error - %d\n", REPLICA_ROOT, rc); rc = -1; } @@ -777,7 +777,7 @@ static int populateChangelogOp () slapi_pblock_destroy (pb); if (rc != LDAP_SUCCESS) { - slapi_log_error(SLAPI_LOG_ERR, repl_plugin_name_cl, "failed to add entry (%s); " + slapi_log_err(SLAPI_LOG_ERR, repl_plugin_name_cl, "failed to add entry (%s); " "LDAP error - %d\n", dn, rc); return -1; } @@ -800,7 +800,7 @@ static int populateChangelogOp () slapi_pblock_destroy (pb); if (rc != LDAP_SUCCESS) { - slapi_log_error(SLAPI_LOG_ERR, repl_plugin_name_cl, "failed to modify entry (%s); " + slapi_log_err(SLAPI_LOG_ERR, repl_plugin_name_cl, "failed to modify entry (%s); " "LDAP error - %d\n", dn, rc); return -1; } @@ -816,7 +816,7 @@ static int populateChangelogOp () slapi_pblock_destroy (pb); if (rc != LDAP_SUCCESS) { - slapi_log_error(SLAPI_LOG_ERR, repl_plugin_name_cl, "failed to rename entry (%s); " + slapi_log_err(SLAPI_LOG_ERR, repl_plugin_name_cl, "failed to rename entry (%s); " "LDAP error - %d\n", dn, rc); return -1; } @@ -831,7 +831,7 @@ static int populateChangelogOp () slapi_pblock_destroy (pb); if (rc != LDAP_SUCCESS) { - slapi_log_error(SLAPI_LOG_ERR, repl_plugin_name_cl, "failed to delete entry (%s); " + slapi_log_err(SLAPI_LOG_ERR, repl_plugin_name_cl, "failed to delete entry (%s); " "LDAP error - %d\n", dn, rc); return -1; } diff --git a/ldap/servers/plugins/replication/cl_crypt.c b/ldap/servers/plugins/replication/cl_crypt.c index 68f836e..36f45c2 100644 --- a/ldap/servers/plugins/replication/cl_crypt.c +++ b/ldap/servers/plugins/replication/cl_crypt.c @@ -37,7 +37,7 @@ clcrypt_init(const CL5DBConfig *config, void **clcrypt_handle) Slapi_Backend *be = NULL; back_info_crypt_init crypt_init = {0}; - slapi_log_error(SLAPI_LOG_TRACE, repl_plugin_name, "-> clcrypt_init\n"); + slapi_log_err(SLAPI_LOG_TRACE, repl_plugin_name, "-> clcrypt_init\n"); /* Encryption is not specified */ if (!config->encryptionAlgorithm || !clcrypt_handle) { goto bail; @@ -64,7 +64,7 @@ clcrypt_init(const CL5DBConfig *config, void **clcrypt_handle) rc = 1; } bail: - slapi_log_error(SLAPI_LOG_TRACE, repl_plugin_name, + slapi_log_err(SLAPI_LOG_TRACE, repl_plugin_name, "<- clcrypt_init : %d\n", rc); return rc; } @@ -86,7 +86,7 @@ clcrypt_encrypt_value(void *clcrypt_handle, Slapi_Backend *be = NULL; back_info_crypt_value crypt_value = {0}; - slapi_log_error(SLAPI_LOG_TRACE, repl_plugin_name, + slapi_log_err(SLAPI_LOG_TRACE, repl_plugin_name, "-> clcrypt_encrypt_value\n"); if (NULL == out) { goto bail; @@ -116,7 +116,7 @@ clcrypt_encrypt_value(void *clcrypt_handle, rc = -1; } bail: - slapi_log_error(SLAPI_LOG_TRACE, repl_plugin_name, + slapi_log_err(SLAPI_LOG_TRACE, repl_plugin_name, "<- clcrypt_encrypt_entry (returning %d)\n", rc); return rc; } @@ -138,7 +138,7 @@ clcrypt_decrypt_value(void *clcrypt_handle, Slapi_Backend *be = NULL; back_info_crypt_value crypt_value = {0}; - slapi_log_error(SLAPI_LOG_TRACE, repl_plugin_name, + slapi_log_err(SLAPI_LOG_TRACE, repl_plugin_name, "-> clcrypt_decrypt_value\n"); if (NULL == out) { goto bail; @@ -168,7 +168,7 @@ clcrypt_decrypt_value(void *clcrypt_handle, rc = -1; } bail: - slapi_log_error(SLAPI_LOG_TRACE, repl_plugin_name, + slapi_log_err(SLAPI_LOG_TRACE, repl_plugin_name, "<- clcrypt_decrypt_entry (returning %d)\n", rc); return rc; } diff --git a/ldap/servers/plugins/replication/csnpl.c b/ldap/servers/plugins/replication/csnpl.c index d962df1..7861b6d 100644 --- a/ldap/servers/plugins/replication/csnpl.c +++ b/ldap/servers/plugins/replication/csnpl.c @@ -40,7 +40,7 @@ CSNPL* csnplNew () csnpl = (CSNPL *)slapi_ch_malloc (sizeof (CSNPL)); if (csnpl == NULL) { - slapi_log_error(SLAPI_LOG_ERR, repl_plugin_name, + slapi_log_err(SLAPI_LOG_ERR, repl_plugin_name, "csnplNew - Failed to allocate pending list\n"); return NULL; } @@ -48,7 +48,7 @@ CSNPL* csnplNew () csnpl->csnList = llistNew (); if (csnpl->csnList == NULL) { - slapi_log_error(SLAPI_LOG_ERR, repl_plugin_name, + slapi_log_err(SLAPI_LOG_ERR, repl_plugin_name, "csnplNew - Failed to allocate pending list\n"); slapi_ch_free ((void**)&csnpl); return NULL; @@ -59,7 +59,7 @@ CSNPL* csnplNew () if (csnpl->csnLock == NULL) { - slapi_log_error(SLAPI_LOG_ERR, repl_plugin_name, + slapi_log_err(SLAPI_LOG_ERR, repl_plugin_name, "csnplNew - Failed to create lock; NSPR error - %d\n", PR_GetError ()); slapi_ch_free ((void**)&(csnpl->csnList)); @@ -111,7 +111,7 @@ int csnplInsert (CSNPL *csnpl, const CSN *csn) if (csnpl == NULL || csn == NULL) { - slapi_log_error(SLAPI_LOG_ERR, repl_plugin_name, + slapi_log_err(SLAPI_LOG_ERR, repl_plugin_name, "csnplInsert - Invalid argument\n"); return -1; } @@ -143,7 +143,7 @@ int csnplInsert (CSNPL *csnpl, const CSN *csn) { char s[CSN_STRSIZE]; if (slapi_is_loglevel_set(SLAPI_LOG_REPL)) { - slapi_log_error(SLAPI_LOG_REPL, repl_plugin_name, + slapi_log_err(SLAPI_LOG_REPL, repl_plugin_name, "csnplInsert - Failed to insert csn (%s) into pending list\n", csn_as_string(csn,PR_FALSE,s)); } return -1; @@ -159,7 +159,7 @@ int csnplRemove (CSNPL *csnpl, const CSN *csn) if (csnpl == NULL || csn == NULL) { - slapi_log_error(SLAPI_LOG_ERR, repl_plugin_name, + slapi_log_err(SLAPI_LOG_ERR, repl_plugin_name, "csnplRemove: invalid argument\n"); return -1; } @@ -193,7 +193,7 @@ int csnplCommit (CSNPL *csnpl, const CSN *csn) if (csnpl == NULL || csn == NULL) { - slapi_log_error(SLAPI_LOG_ERR, repl_plugin_name, + slapi_log_err(SLAPI_LOG_ERR, repl_plugin_name, "csnplCommit: invalid argument\n"); return -1; } @@ -218,7 +218,7 @@ int csnplCommit (CSNPL *csnpl, const CSN *csn) ReplicaId rid = csn_get_replicaid (csn); if (rid < MAX_REPLICA_ID) { - slapi_log_error(SLAPI_LOG_ERR, repl_plugin_name, + slapi_log_err(SLAPI_LOG_ERR, repl_plugin_name, "csnplCommit: can't find csn %s\n", csn_str); } slapi_rwlock_unlock (csnpl->csnLock); @@ -329,12 +329,12 @@ static void _csnplDumpContentNoLock(CSNPL *csnpl, const char *caller) data = (csnpldata *)llistGetFirst(csnpl->csnList, &iterator); if (data) { - slapi_log_error(SLAPI_LOG_REPL, repl_plugin_name, "%s: CSN Pending list content:\n", + slapi_log_err(SLAPI_LOG_REPL, repl_plugin_name, "%s: CSN Pending list content:\n", caller ? caller : ""); } while (data) { - slapi_log_error(SLAPI_LOG_REPL, repl_plugin_name, "%s, %s\n", + slapi_log_err(SLAPI_LOG_REPL, repl_plugin_name, "%s, %s\n", csn_as_string(data->csn, PR_FALSE, csn_str), data->committed ? "committed" : "not committed"); data = (csnpldata *)llistGetNext (csnpl->csnList, &iterator); diff --git a/ldap/servers/plugins/replication/legacy_consumer.c b/ldap/servers/plugins/replication/legacy_consumer.c index fa1ed49..de07add 100644 --- a/ldap/servers/plugins/replication/legacy_consumer.c +++ b/ldap/servers/plugins/replication/legacy_consumer.c @@ -230,7 +230,7 @@ legacy_consumer_config_init() int rc; if ((legacy_consumer_config_lock = slapi_new_rwlock()) == NULL) { - slapi_log_error(SLAPI_LOG_ERR, repl_plugin_name, + slapi_log_err(SLAPI_LOG_ERR, repl_plugin_name, "Failed to create legacy_consumer config read-write lock\n"); exit(1); } @@ -238,7 +238,7 @@ legacy_consumer_config_init() rc = legacy_consumer_read_config (); if (rc != LDAP_SUCCESS) { - slapi_log_error(SLAPI_LOG_ERR, repl_plugin_name, + slapi_log_err(SLAPI_LOG_ERR, repl_plugin_name, "Failed to initialize legacy replication configuration\n"); return 1; } @@ -260,13 +260,13 @@ legacy_consumer_config_add (Slapi_PBlock *pb, Slapi_Entry* e, Slapi_Entry* entry if (rc != LDAP_SUCCESS) { *returncode = rc; - slapi_log_error(SLAPI_LOG_ERR, repl_plugin_name, "Failed to configure legacy replication\n"); + slapi_log_err(SLAPI_LOG_ERR, repl_plugin_name, "Failed to configure legacy replication\n"); return SLAPI_DSE_CALLBACK_ERROR; } /* make sure that the password is encoded */ legacy_consumer_encode_pw(e); - slapi_log_error(SLAPI_LOG_REPL, repl_plugin_name, "legacy_consumer_config_add: " + slapi_log_err(SLAPI_LOG_REPL, repl_plugin_name, "legacy_consumer_config_add: " "successfully configured legacy consumer credentials\n"); return SLAPI_DSE_CALLBACK_OK; @@ -328,7 +328,7 @@ legacy_consumer_config_modify (Slapi_PBlock *pb, Slapi_Entry* entryBefore, Slapi if (legacy_consumer_replicationdn != NULL) { not_allowed = 1; - slapi_log_error(SLAPI_LOG_ERR, repl_plugin_name, + slapi_log_err(SLAPI_LOG_ERR, repl_plugin_name, "Multiple replicationdns not permitted." ); } else @@ -354,7 +354,7 @@ legacy_consumer_config_modify (Slapi_PBlock *pb, Slapi_Entry* entryBefore, Slapi if (legacy_consumer_replicationpw != NULL) { not_allowed = 1; - slapi_log_error(SLAPI_LOG_ERR, repl_plugin_name, + slapi_log_err(SLAPI_LOG_ERR, repl_plugin_name, "Multiple replicationpws not permitted." ); } else @@ -373,7 +373,7 @@ legacy_consumer_config_modify (Slapi_PBlock *pb, Slapi_Entry* entryBefore, Slapi if (not_allowed) { - slapi_log_error(SLAPI_LOG_ERR, repl_plugin_name, + slapi_log_err(SLAPI_LOG_ERR, repl_plugin_name, "Failed to modify legacy replication configuration\n" ); *returncode= LDAP_CONSTRAINT_VIOLATION; return SLAPI_DSE_CALLBACK_ERROR; @@ -586,7 +586,7 @@ get_legacy_referral (Slapi_Entry *e, char **referral, char **state) if (rc != 0) { const char *target_dn = slapi_entry_get_dn_const(e); - slapi_log_error(SLAPI_LOG_ERR, repl_plugin_name, "Warning: a copiedFrom " + slapi_log_err(SLAPI_LOG_ERR, repl_plugin_name, "Warning: a copiedFrom " "or copyingFrom attribute was added to or removed from an " "entry that is not the root of a replicated area. It is possible " "that a legacy replication supplier is incorrectly configured " @@ -653,7 +653,7 @@ legacy_consumer_init_referrals (Replica *r) if (rc == LDAP_REFERRAL) { /* We are in referral mode, probably because ORC failed */ - slapi_log_error(SLAPI_LOG_ERR, repl_plugin_name, "legacy_consumer_init_referrals " + slapi_log_err(SLAPI_LOG_ERR, repl_plugin_name, "legacy_consumer_init_referrals " "data for replica %s is in referral mode due to failed " "initialization. Replica need to be reinitialized\n", root_dn); @@ -661,7 +661,7 @@ legacy_consumer_init_referrals (Replica *r) } else { - slapi_log_error(SLAPI_LOG_ERR, repl_plugin_name, "legacy_consumer_init_referrals " + slapi_log_err(SLAPI_LOG_ERR, repl_plugin_name, "legacy_consumer_init_referrals " "failed to obtain root entry for replica %s; LDAP error - %d\n", root_dn, rc); rc = -1; diff --git a/ldap/servers/plugins/replication/llist.c b/ldap/servers/plugins/replication/llist.c index c171bed..6a88ebe 100644 --- a/ldap/servers/plugins/replication/llist.c +++ b/ldap/servers/plugins/replication/llist.c @@ -201,14 +201,14 @@ int llistInsertHead (LList *list, const char *key, void *data) LNode *node; if (list == NULL || list->head == NULL || data == NULL) { - slapi_log_error(SLAPI_LOG_PLUGIN, repl_plugin_name, "llistInsertHead: invalid argument\n"); + slapi_log_err(SLAPI_LOG_PLUGIN, repl_plugin_name, "llistInsertHead: invalid argument\n"); return -1; } node = _llistNewNode (key, data); if (node == NULL) { - slapi_log_error(SLAPI_LOG_PLUGIN, repl_plugin_name, "llistInsertHead: failed to allocate list node\n"); + slapi_log_err(SLAPI_LOG_PLUGIN, repl_plugin_name, "llistInsertHead: failed to allocate list node\n"); return -1; } @@ -231,14 +231,14 @@ int llistInsertTail (LList *list, const char *key, void *data) LNode *node; if (list == NULL || list->head == NULL || data == NULL) { - slapi_log_error(SLAPI_LOG_PLUGIN, repl_plugin_name, "llistInsertHead: invalid argument\n"); + slapi_log_err(SLAPI_LOG_PLUGIN, repl_plugin_name, "llistInsertHead: invalid argument\n"); return -1; } node = _llistNewNode (key, data); if (node == NULL) { - slapi_log_error(SLAPI_LOG_PLUGIN, repl_plugin_name, "llistInsertHead: failed to allocate list node\n"); + slapi_log_err(SLAPI_LOG_PLUGIN, repl_plugin_name, "llistInsertHead: failed to allocate list node\n"); return -1; } diff --git a/ldap/servers/plugins/replication/profile.c b/ldap/servers/plugins/replication/profile.c index af82192..059711a 100644 --- a/ldap/servers/plugins/replication/profile.c +++ b/ldap/servers/plugins/replication/profile.c @@ -25,7 +25,7 @@ static FILE *profile_fd=NULL; void profile_log(char *file,int line) { if (profile_fd==NULL) - slapi_log_error(SLAPI_LOG_ERR, repl_plugin_name, "profile_log: profile file not open."); + slapi_log_err(SLAPI_LOG_ERR, repl_plugin_name, "profile_log: profile file not open."); else { /* JCMREPL - Probably need a lock around here */ @@ -43,7 +43,7 @@ void profile_open() void profile_close() { if (profile_fd==NULL) - slapi_log_error(SLAPI_LOG_ERR, repl_plugin_name ,"profile_close: profile file not open."); + slapi_log_err(SLAPI_LOG_ERR, repl_plugin_name ,"profile_close: profile file not open."); else textfile_close(profile_fd); } diff --git a/ldap/servers/plugins/replication/repl.h b/ldap/servers/plugins/replication/repl.h index 2d476f9..89ad481 100644 --- a/ldap/servers/plugins/replication/repl.h +++ b/ldap/servers/plugins/replication/repl.h @@ -38,7 +38,6 @@ #include #include "portable.h" /* GGOODREPL - is this cheating? */ -#include "ldaplog.h" #include "repl_shared.h" #include "cl4.h" diff --git a/ldap/servers/plugins/replication/repl5.h b/ldap/servers/plugins/replication/repl5.h index a473d29..c163dcf 100644 --- a/ldap/servers/plugins/replication/repl5.h +++ b/ldap/servers/plugins/replication/repl5.h @@ -727,7 +727,7 @@ void replica_updatedn_list_enumerate(ReplicaUpdateDNList list, FNEnumDN fn, void /* enabling developper traces for MMR to understand the total/inc protocol state machines */ #ifdef DEV_DEBUG #define SLAPI_LOG_DEV_DEBUG SLAPI_LOG_DEBUG -#define dev_debug(a) slapi_log_error(SLAPI_LOG_DEV_DEBUG, "DEV_DEBUG", "%s\n", a) +#define dev_debug(a) slapi_log_err(SLAPI_LOG_DEV_DEBUG, "DEV_DEBUG", "%s\n", a) #else #define dev_debug(a) #endif diff --git a/ldap/servers/plugins/replication/repl5_agmt.c b/ldap/servers/plugins/replication/repl5_agmt.c index 6838c6e..4ce1dbc 100644 --- a/ldap/servers/plugins/replication/repl5_agmt.c +++ b/ldap/servers/plugins/replication/repl5_agmt.c @@ -172,36 +172,36 @@ agmt_is_valid(Repl_Agmt *ra) if (NULL == ra->hostname) { - slapi_log_error(SLAPI_LOG_ERR, repl_plugin_name, "agmt_is_valid - Replication agreement \"%s\" " + slapi_log_err(SLAPI_LOG_ERR, repl_plugin_name, "agmt_is_valid - Replication agreement \"%s\" " "is malformed: missing host name.\n", slapi_sdn_get_dn(ra->dn)); return_value = 0; } if (ra->port <= 0) { - slapi_log_error(SLAPI_LOG_ERR, repl_plugin_name, "agmt_is_valid - Replication agreement \"%s\" " + slapi_log_err(SLAPI_LOG_ERR, repl_plugin_name, "agmt_is_valid - Replication agreement \"%s\" " "is malformed: invalid port number %d.\n", slapi_sdn_get_dn(ra->dn), ra->port); return_value = 0; } if (ra->timeout < 0) { - slapi_log_error(SLAPI_LOG_ERR, repl_plugin_name, "agmt_is_valid - Replication agreement \"%s\" " + slapi_log_err(SLAPI_LOG_ERR, repl_plugin_name, "agmt_is_valid - Replication agreement \"%s\" " "is malformed: invalid timeout %ld.\n", slapi_sdn_get_dn(ra->dn), ra->timeout); return_value = 0; } if (ra->busywaittime < 0) { - slapi_log_error(SLAPI_LOG_ERR, repl_plugin_name, "agmt_is_valid - Replication agreement \"%s\" " + slapi_log_err(SLAPI_LOG_ERR, repl_plugin_name, "agmt_is_valid - Replication agreement \"%s\" " "is malformed: invalid busy wait time %ld.\n", slapi_sdn_get_dn(ra->dn), ra->busywaittime); return_value = 0; } if (ra->pausetime < 0) { - slapi_log_error(SLAPI_LOG_ERR, repl_plugin_name, "agmt_is_valid - Replication agreement \"%s\" " + slapi_log_err(SLAPI_LOG_ERR, repl_plugin_name, "agmt_is_valid - Replication agreement \"%s\" " "is malformed: invalid pausetime %ld.\n", slapi_sdn_get_dn(ra->dn), ra->pausetime); return_value = 0; } if ((0 == ra->transport_flags) && (BINDMETHOD_SSL_CLIENTAUTH == ra->bindmethod)) { - slapi_log_error(SLAPI_LOG_ERR, repl_plugin_name, "agmt_is_valid - Replication agreement \"%s\" " + slapi_log_err(SLAPI_LOG_ERR, repl_plugin_name, "agmt_is_valid - Replication agreement \"%s\" " " is malformed: cannot use SSLCLIENTAUTH if using plain LDAP - please " "change %s to SSL or TLS before changing %s to use SSLCLIENTAUTH\n", slapi_sdn_get_dn(ra->dn), type_nsds5TransportInfo, type_nsds5ReplicaBindMethod); @@ -221,7 +221,7 @@ agmt_is_valid(Repl_Agmt *ra) } else { auth_mech = "Unknown"; } - slapi_log_error(SLAPI_LOG_ERR, repl_plugin_name, "agmt_is_valid - Replication agreement \"%s\" " + slapi_log_err(SLAPI_LOG_ERR, repl_plugin_name, "agmt_is_valid - Replication agreement \"%s\" " "is malformed: a bind DN and password must be supplied for authentication " "method \"%s\"\n", slapi_sdn_get_dn(ra->dn), auth_mech); return_value = 0; @@ -244,14 +244,14 @@ agmt_new_from_entry(Slapi_Entry *e) ra = (Repl_Agmt *)slapi_ch_calloc(1, sizeof(repl5agmt)); if ((ra->lock = PR_NewLock()) == NULL) { - slapi_log_error(SLAPI_LOG_ERR, repl_plugin_name, "agmt_new_from_entry - Unable to create new lock " + slapi_log_err(SLAPI_LOG_ERR, repl_plugin_name, "agmt_new_from_entry - Unable to create new lock " "for replication agreement \"%s\" - agreement ignored.\n", slapi_entry_get_dn_const(e)); goto loser; } if ((ra->attr_lock = slapi_new_rwlock()) == NULL) { - slapi_log_error(SLAPI_LOG_ERR, repl_plugin_name, "agmt_new_from_entry - Unable to create new attr lock " + slapi_log_err(SLAPI_LOG_ERR, repl_plugin_name, "agmt_new_from_entry - Unable to create new attr lock " "for replication agreement \"%s\" - agreement ignored.\n", slapi_entry_get_dn_const(e)); goto loser; @@ -382,7 +382,7 @@ agmt_new_from_entry(Slapi_Entry *e) } else if(strcasecmp(tmpstr, "on") == 0){ ra->is_enabled = PR_TRUE; } else { - slapi_log_error(SLAPI_LOG_ERR, repl_plugin_name, "agmt_new_from_entry - " + slapi_log_err(SLAPI_LOG_ERR, repl_plugin_name, "agmt_new_from_entry - " "Warning invalid value for nsds5ReplicaEnabled (%s), value must be \"on\" or \"off\". " "Ignoring this repl agreement.\n",tmpstr); slapi_ch_free_string(&tmpstr); @@ -474,7 +474,7 @@ agmt_new_from_entry(Slapi_Entry *e) * could be a default excluded attr list in cn=plugin default config */ if (agmt_set_replicated_attributes_from_attr(ra, sattr) != 0) { - slapi_log_error(SLAPI_LOG_REPL, repl_plugin_name, + slapi_log_err(SLAPI_LOG_REPL, repl_plugin_name, "agmt_new_from_entry: failed to set " "replicated attributes for agreement %s\n", agmt_get_long_name(ra)); @@ -484,7 +484,7 @@ agmt_new_from_entry(Slapi_Entry *e) if (denied_attrs) { /* Report the error to the client */ - slapi_log_error(SLAPI_LOG_ERR, repl_plugin_name, + slapi_log_err(SLAPI_LOG_ERR, repl_plugin_name, "agmt_new_from_entry: Attempt to exclude illegal attributes " "from a fractional agreement\n"); /* Free the list */ @@ -496,7 +496,7 @@ agmt_new_from_entry(Slapi_Entry *e) slapi_entry_attr_find(e, type_nsds5ReplicatedAttributeListTotal, &sattr); if (sattr && agmt_set_replicated_attributes_total_from_attr(ra, sattr) != 0) { - slapi_log_error(SLAPI_LOG_REPL, repl_plugin_name, + slapi_log_err(SLAPI_LOG_REPL, repl_plugin_name, "agmt_new_from_entry: failed to parse total " "update replicated attributes for agreement %s\n", agmt_get_long_name(ra)); @@ -506,7 +506,7 @@ agmt_new_from_entry(Slapi_Entry *e) if (denied_attrs) { /* Report the error to the client */ - slapi_log_error(SLAPI_LOG_ERR, repl_plugin_name, + slapi_log_err(SLAPI_LOG_ERR, repl_plugin_name, "agmt_new_from_entry: Attempt to exclude illegal attributes " "from a fractional agreement for total update protocol\n"); /* Free the list */ @@ -531,7 +531,7 @@ agmt_new_from_entry(Slapi_Entry *e) /* Now that the agreement is done, just check if changelog is configured */ if (cl5GetState() != CL5_STATE_OPEN) { - slapi_log_error(SLAPI_LOG_WARNING, repl_plugin_name, "agmt_new_from_entry: " + slapi_log_err(SLAPI_LOG_WARNING, repl_plugin_name, "agmt_new_from_entry: " "Replication agreement added but there is no changelog configured. " "No change will be replicated until a changelog is configured.\n"); } @@ -697,7 +697,7 @@ agmt_start(Repl_Agmt *ra) */ repl_sdn = agmt_get_replarea(ra); if (!repl_sdn) { - slapi_log_error(SLAPI_LOG_REPL, repl_plugin_name, + slapi_log_err(SLAPI_LOG_REPL, repl_plugin_name, "agmt_start: failed to get repl area. Please check agreement.\n"); prot_free(&prot); return -1; @@ -723,7 +723,7 @@ agmt_start(Repl_Agmt *ra) if (rc == LDAP_SUCCESS){ slapi_pblock_get(pb, SLAPI_PLUGIN_INTOP_SEARCH_ENTRIES, &entries); if (NULL == entries || NULL == entries[0]){ - slapi_log_error(SLAPI_LOG_ERR, repl_plugin_name, + slapi_log_err(SLAPI_LOG_ERR, repl_plugin_name, "agmt_start: replica ruv tombstone entry for " "replica %s not found\n", slapi_sdn_get_dn(ra->replarea)); @@ -739,7 +739,7 @@ agmt_start(Repl_Agmt *ra) /* Check that replication is not already started */ if (ra->protocol != NULL) { - slapi_log_error(SLAPI_LOG_REPL, repl_plugin_name, "replication already started for agreement \"%s\"\n", agmt_get_long_name(ra)); + slapi_log_err(SLAPI_LOG_REPL, repl_plugin_name, "replication already started for agreement \"%s\"\n", agmt_get_long_name(ra)); prot_free(&prot); goto done; } @@ -831,7 +831,7 @@ windows_agmt_start(Repl_Agmt *ra) /* Check that replication is not already started */ if (ra->protocol != NULL) { - slapi_log_error(SLAPI_LOG_REPL, repl_plugin_name, "replication already started for agreement \"%s\"\n", agmt_get_long_name(ra)); + slapi_log_err(SLAPI_LOG_REPL, repl_plugin_name, "replication already started for agreement \"%s\"\n", agmt_get_long_name(ra)); PR_Unlock(ra->lock); prot_free(&prot); return 0; @@ -1515,7 +1515,7 @@ _agmt_set_default_fractional_attrs(Repl_Agmt *ra) rc = agmt_parse_excluded_attrs_config_attr(val, &(ra->frac_attrs)); if (0 != rc) { - slapi_log_error(SLAPI_LOG_ERR, repl_plugin_name, + slapi_log_err(SLAPI_LOG_ERR, repl_plugin_name, "_agmt_set_default_fractional_attrs: failed to " "parse default config (%s) attribute %s value: %s\n", SLAPI_PLUGIN_DEFAULT_CONFIG, @@ -2264,7 +2264,7 @@ agmt_replica_init_done (const Repl_Agmt *agmt) slapi_pblock_get(pb, SLAPI_PLUGIN_INTOP_RESULT, &rc); if (rc != LDAP_SUCCESS && rc != LDAP_NO_SUCH_ATTRIBUTE) { - slapi_log_error(SLAPI_LOG_ERR, repl_plugin_name, "agmt_replica_init_done: " + slapi_log_err(SLAPI_LOG_ERR, repl_plugin_name, "agmt_replica_init_done: " "failed to remove (%s) attribute from (%s) entry; LDAP error - %d\n", type_nsds5ReplicaInitialize, slapi_sdn_get_ndn (agmt->dn), rc); } @@ -2300,7 +2300,7 @@ agmt_set_consumer_ruv (Repl_Agmt *ra, RUV *ruv) { if (ra == NULL || ruv == NULL) { - slapi_log_error(SLAPI_LOG_REPL, repl_plugin_name, "agmt_set_consumer_ruv: invalid argument" + slapi_log_err(SLAPI_LOG_REPL, repl_plugin_name, "agmt_set_consumer_ruv: invalid argument" " agmt - %p, ruv - %p\n", ra, ruv); return -1; } @@ -2357,7 +2357,7 @@ agmt_update_consumer_ruv (Repl_Agmt *ra) slapi_pblock_get(pb, SLAPI_PLUGIN_INTOP_RESULT, &rc); if (rc != LDAP_SUCCESS && rc != LDAP_NO_SUCH_ATTRIBUTE) { - slapi_log_error(SLAPI_LOG_ERR, repl_plugin_name, "agmt_update_consumer_ruv - " + slapi_log_err(SLAPI_LOG_ERR, repl_plugin_name, "agmt_update_consumer_ruv - " "%s: agmt_update_consumer_ruv: " "failed to update consumer's RUV; LDAP error - %d\n", ra->long_name, rc); @@ -2484,10 +2484,10 @@ agmt_set_last_update_status (Repl_Agmt *ra, int ldaprc, int replrc, const char * "(If the suffix is disabled you must enable it then restart the server for replication to take place).", replrc, ra->long_name ? ra->long_name : "a replica"); /* Log into the errors log, as "ra->long_name" is not accessible from the caller */ - slapi_log_error(SLAPI_LOG_ERR, repl_plugin_name, + slapi_log_err(SLAPI_LOG_ERR, repl_plugin_name, "Incremental update aborted: Replication agreement for \"%s\" " "can not be updated while the replica is disabled\n", ra->long_name ? ra->long_name : "a replica"); - slapi_log_error(SLAPI_LOG_ERR, repl_plugin_name, + slapi_log_err(SLAPI_LOG_ERR, repl_plugin_name, "(If the suffix is disabled you must enable it then restart the server for replication to take place).\n"); } else @@ -2552,7 +2552,7 @@ agmt_set_last_init_status (Repl_Agmt *ra, int ldaprc, int replrc, int connrc, co else if (replrc == NSDS50_REPL_DISABLED) { if(agmt_is_enabled(ra)){ - slapi_log_error(SLAPI_LOG_ERR, repl_plugin_name, "Total update aborted: " + slapi_log_err(SLAPI_LOG_ERR, repl_plugin_name, "Total update aborted: " "Replication agreement for \"%s\" can not be updated while the suffix is disabled.\n" "You must enable it then restart the server for replication to take place).\n", ra->long_name ? ra->long_name : "a replica"); @@ -2562,7 +2562,7 @@ agmt_set_last_init_status (Repl_Agmt *ra, int ldaprc, int replrc, int connrc, co replrc, ra->long_name ? ra->long_name : "a replica"); } else { /* You do not need to restart the server after enabling the agreement */ - slapi_log_error(SLAPI_LOG_ERR, repl_plugin_name, "Total update aborted: " + slapi_log_err(SLAPI_LOG_ERR, repl_plugin_name, "Total update aborted: " "Replication agreement for \"%s\" can not be updated while the agreement is disabled\n", ra->long_name ? ra->long_name : "a replica"); PR_snprintf(ra->last_init_status, STATUS_LEN, "%d Total update aborted: " @@ -2793,7 +2793,7 @@ agmt_get_consumer_rid ( Repl_Agmt *agmt, void *conn ) slapi_create_dn_string("cn=replica,cn=\"%s\",cn=mapping tree,cn=config", slapi_sdn_get_dn (agmt->replarea) ); if (NULL == mapping_tree_node) { - slapi_log_error(SLAPI_LOG_ERR, repl_plugin_name, + slapi_log_err(SLAPI_LOG_ERR, repl_plugin_name, "agmt_get_consumer_rid: failed to normalize " "replica dn for %s\n", slapi_sdn_get_dn (agmt->replarea)); @@ -2896,7 +2896,7 @@ agmt_set_enabled_from_entry(Repl_Agmt *ra, Slapi_Entry *e, char *returntext){ } else if(strcasecmp(attr_val,"on") == 0){ is_enabled = PR_TRUE; } else { - slapi_log_error(SLAPI_LOG_ERR, repl_plugin_name, "agmt_set_enabled_from_entry: invalid " + slapi_log_err(SLAPI_LOG_ERR, repl_plugin_name, "agmt_set_enabled_from_entry: invalid " "value for nsds5ReplicaEnabled (%s), the value must be \"on\" or \"off\".\n", attr_val); PR_snprintf(returntext, SLAPI_DSE_RETURNTEXT_SIZE, "Invalid value for nsds5ReplicaEnabled, " "the value must be \"on\" or \"off\".\n"); @@ -2908,7 +2908,7 @@ agmt_set_enabled_from_entry(Repl_Agmt *ra, Slapi_Entry *e, char *returntext){ if(is_enabled){ if(!ra->is_enabled){ ra->is_enabled = PR_TRUE; - slapi_log_error(SLAPI_LOG_REPL, repl_plugin_name, "agmt_set_enabled_from_entry: " + slapi_log_err(SLAPI_LOG_REPL, repl_plugin_name, "agmt_set_enabled_from_entry: " "agreement is now enabled (%s)\n",ra->long_name); PR_Unlock(ra->lock); agmt_start(ra); @@ -2917,7 +2917,7 @@ agmt_set_enabled_from_entry(Repl_Agmt *ra, Slapi_Entry *e, char *returntext){ } else { if(ra->is_enabled){ ra->is_enabled = PR_FALSE; - slapi_log_error(SLAPI_LOG_REPL, repl_plugin_name, "agmt_set_enabled_from_entry: " + slapi_log_err(SLAPI_LOG_REPL, repl_plugin_name, "agmt_set_enabled_from_entry: " "agreement is now disabled (%s)\n",ra->long_name); PR_Unlock(ra->lock); agmt_stop(ra); @@ -3196,7 +3196,7 @@ agmt_remove_maxcsn(Repl_Agmt *ra) pb = slapi_pblock_new(); if (!pb) { - slapi_log_error(SLAPI_LOG_ERR, repl_plugin_name, "agmt_remove_maxcsn: Out of memory\n"); + slapi_log_err(SLAPI_LOG_ERR, repl_plugin_name, "agmt_remove_maxcsn: Out of memory\n"); goto done; } @@ -3205,7 +3205,7 @@ agmt_remove_maxcsn(Repl_Agmt *ra) r = (Replica *)object_get_data(repl_obj); tombstone_sdn = replica_get_root(r); } else { - slapi_log_error(SLAPI_LOG_ERR, repl_plugin_name, "agmt_remove_maxcsn: Failed to get repl object.\n"); + slapi_log_err(SLAPI_LOG_ERR, repl_plugin_name, "agmt_remove_maxcsn: Failed to get repl object.\n"); goto done; } slapi_ch_free_string(&ra->maxcsn); @@ -3238,7 +3238,7 @@ agmt_remove_maxcsn(Repl_Agmt *ra) slapi_pblock_get(pb, SLAPI_PLUGIN_INTOP_SEARCH_ENTRIES, &entries); if (NULL == entries || NULL == entries[0]){ - slapi_log_error(SLAPI_LOG_ERR, repl_plugin_name, + slapi_log_err(SLAPI_LOG_ERR, repl_plugin_name, "agmt_remove_maxcsn: replica ruv tombstone entry for " "replica %s not found\n", slapi_sdn_get_dn(ra->replarea)); goto done; @@ -3291,7 +3291,7 @@ agmt_remove_maxcsn(Repl_Agmt *ra) slapi_modify_internal_pb(modpb); slapi_pblock_get(modpb, SLAPI_PLUGIN_INTOP_RESULT, &rc); if (rc != LDAP_SUCCESS){ - slapi_log_error(SLAPI_LOG_REPL, repl_plugin_name, + slapi_log_err(SLAPI_LOG_REPL, repl_plugin_name, "agmt_remove_maxcsn: failed to remove agmt maxcsn (%s), error(%d)\n",maxcsns[i], rc); } slapi_mod_done(&smod); diff --git a/ldap/servers/plugins/replication/repl5_agmtlist.c b/ldap/servers/plugins/replication/repl5_agmtlist.c index 0daa1d8..b7963b5 100644 --- a/ldap/servers/plugins/replication/repl5_agmtlist.c +++ b/ldap/servers/plugins/replication/repl5_agmtlist.c @@ -225,13 +225,13 @@ agmtlist_add_callback(Slapi_PBlock *pb, Slapi_Entry *e, Slapi_Entry *entryAfter, int *returncode, char *returntext, void *arg) { int rc; - slapi_log_error(SLAPI_LOG_REPL, repl_plugin_name, "agmt_add: begin\n"); + slapi_log_err(SLAPI_LOG_REPL, repl_plugin_name, "agmt_add: begin\n"); rc = add_new_agreement(e); if (0 != rc) { Slapi_DN *sdn = NULL; slapi_pblock_get(pb, SLAPI_TARGET_SDN, &sdn); - slapi_log_error(SLAPI_LOG_ERR, repl_plugin_name, "agmtlist_add_callback - " + slapi_log_err(SLAPI_LOG_ERR, repl_plugin_name, "agmtlist_add_callback - " "Can't start agreement \"%s\"\n", slapi_sdn_get_dn(sdn)); *returncode = LDAP_UNWILLING_TO_PERFORM; return SLAPI_DSE_CALLBACK_ERROR; @@ -271,14 +271,14 @@ agmtlist_modify_callback(Slapi_PBlock *pb, Slapi_Entry *entryBefore, Slapi_Entry slapi_pblock_get(pb, SLAPI_TARGET_SDN, &sdn); if (NULL == sdn) { - slapi_log_error(SLAPI_LOG_ERR, repl_plugin_name, + slapi_log_err(SLAPI_LOG_ERR, repl_plugin_name, "agmtlist_modify_callback - NULL target dn\n"); goto done; } agmt = agmtlist_get_by_agmt_name(sdn); if (NULL == agmt) { - slapi_log_error(SLAPI_LOG_WARNING, repl_plugin_name, "agmtlist_modify_callback - " + slapi_log_err(SLAPI_LOG_WARNING, repl_plugin_name, "agmtlist_modify_callback - " "Received a modification for unknown replication agreement \"%s\"\n", slapi_sdn_get_dn(sdn)); goto done; @@ -297,7 +297,7 @@ agmtlist_modify_callback(Slapi_PBlock *pb, Slapi_Entry *entryBefore, Slapi_Entry the replication plugin - handled above */ if (mods[i]->mod_op & LDAP_MOD_DELETE) { - slapi_log_error(SLAPI_LOG_ERR, repl_plugin_name, "agmtlist_modify_callback - " + slapi_log_err(SLAPI_LOG_ERR, repl_plugin_name, "agmtlist_modify_callback - " "Deletion of %s attribute is not allowed\n", type_nsds5ReplicaInitialize); *returncode = LDAP_UNWILLING_TO_PERFORM; rc = SLAPI_DSE_CALLBACK_ERROR; @@ -306,7 +306,7 @@ agmtlist_modify_callback(Slapi_PBlock *pb, Slapi_Entry *entryBefore, Slapi_Entry else { if(val == NULL){ - slapi_log_error(SLAPI_LOG_ERR, repl_plugin_name, "agmtlist_modify_callback - " + slapi_log_err(SLAPI_LOG_ERR, repl_plugin_name, "agmtlist_modify_callback - " "No value provided for %s attribute\n", type_nsds5ReplicaInitialize); *returncode = LDAP_UNWILLING_TO_PERFORM; rc = SLAPI_DSE_CALLBACK_ERROR; @@ -331,7 +331,7 @@ agmtlist_modify_callback(Slapi_PBlock *pb, Slapi_Entry *entryBefore, Slapi_Entry PR_snprintf (errortext, SLAPI_DSE_RETURNTEXT_SIZE, "Invalid value (%s) value supplied for attr (%s); Ignoring ...", val, mods[i]->mod_type); - slapi_log_error(SLAPI_LOG_ERR, repl_plugin_name, "agmtlist_modify_callback - %s\n", errortext); + slapi_log_err(SLAPI_LOG_ERR, repl_plugin_name, "agmtlist_modify_callback - %s\n", errortext); *returncode = LDAP_UNWILLING_TO_PERFORM; rc = SLAPI_DSE_CALLBACK_ERROR; } @@ -352,7 +352,7 @@ agmtlist_modify_callback(Slapi_PBlock *pb, Slapi_Entry *entryBefore, Slapi_Entry /* New replica credentials */ if (agmt_set_credentials_from_entry(agmt, e) != 0) { - slapi_log_error(SLAPI_LOG_ERR, repl_plugin_name, "agmtlist_modify_callback - " + slapi_log_err(SLAPI_LOG_ERR, repl_plugin_name, "agmtlist_modify_callback - " "Failed to update credentials for agreement %s\n", agmt_get_long_name(agmt)); *returncode = LDAP_OPERATIONS_ERROR; @@ -365,7 +365,7 @@ agmtlist_modify_callback(Slapi_PBlock *pb, Slapi_Entry *entryBefore, Slapi_Entry /* New replica timeout */ if (agmt_set_timeout_from_entry(agmt, e) != 0) { - slapi_log_error(SLAPI_LOG_ERR, repl_plugin_name, "agmtlist_modify_callback - " + slapi_log_err(SLAPI_LOG_ERR, repl_plugin_name, "agmtlist_modify_callback - " "Failed to update timeout for agreement %s\n", agmt_get_long_name(agmt)); *returncode = LDAP_OPERATIONS_ERROR; @@ -378,7 +378,7 @@ agmtlist_modify_callback(Slapi_PBlock *pb, Slapi_Entry *entryBefore, Slapi_Entry /* New replica timeout */ if (agmt_set_flowcontrolwindow_from_entry(agmt, e) != 0) { - slapi_log_error(SLAPI_LOG_ERR, repl_plugin_name, "agmtlist_modify_callback - " + slapi_log_err(SLAPI_LOG_ERR, repl_plugin_name, "agmtlist_modify_callback - " "Failed to update the flow control window for agreement %s\n", agmt_get_long_name(agmt)); *returncode = LDAP_OPERATIONS_ERROR; @@ -391,7 +391,7 @@ agmtlist_modify_callback(Slapi_PBlock *pb, Slapi_Entry *entryBefore, Slapi_Entry /* New replica timeout */ if (agmt_set_flowcontrolpause_from_entry(agmt, e) != 0) { - slapi_log_error(SLAPI_LOG_ERR, repl_plugin_name, "agmtlist_modify_callback - " + slapi_log_err(SLAPI_LOG_ERR, repl_plugin_name, "agmtlist_modify_callback - " "Failed to update the flow control pause for agreement %s\n", agmt_get_long_name(agmt)); *returncode = LDAP_OPERATIONS_ERROR; @@ -404,7 +404,7 @@ agmtlist_modify_callback(Slapi_PBlock *pb, Slapi_Entry *entryBefore, Slapi_Entry /* New replica busywaittime */ if (agmt_set_busywaittime_from_entry(agmt, e) != 0) { - slapi_log_error(SLAPI_LOG_ERR, repl_plugin_name, "agmtlist_modify_callback -" + slapi_log_err(SLAPI_LOG_ERR, repl_plugin_name, "agmtlist_modify_callback -" "Failed to update busy wait time for agreement %s\n", agmt_get_long_name(agmt)); *returncode = LDAP_OPERATIONS_ERROR; @@ -417,7 +417,7 @@ agmtlist_modify_callback(Slapi_PBlock *pb, Slapi_Entry *entryBefore, Slapi_Entry /* New replica pausetime */ if (agmt_set_pausetime_from_entry(agmt, e) != 0) { - slapi_log_error(SLAPI_LOG_ERR, repl_plugin_name, "agmtlist_modify_callback - " + slapi_log_err(SLAPI_LOG_ERR, repl_plugin_name, "agmtlist_modify_callback - " "Failed to update session pause time for agreement %s\n", agmt_get_long_name(agmt)); *returncode = LDAP_OPERATIONS_ERROR; @@ -430,7 +430,7 @@ agmtlist_modify_callback(Slapi_PBlock *pb, Slapi_Entry *entryBefore, Slapi_Entry /* New replica Bind DN */ if (agmt_set_binddn_from_entry(agmt, e) != 0) { - slapi_log_error(SLAPI_LOG_ERR, repl_plugin_name, "agmtlist_modify_callback- " + slapi_log_err(SLAPI_LOG_ERR, repl_plugin_name, "agmtlist_modify_callback- " "Failed to update bind DN for agreement %s\n", agmt_get_long_name(agmt)); *returncode = LDAP_OPERATIONS_ERROR; @@ -442,7 +442,7 @@ agmtlist_modify_callback(Slapi_PBlock *pb, Slapi_Entry *entryBefore, Slapi_Entry /* New replica host */ if (agmt_set_host_from_entry(agmt, e) != 0) { - slapi_log_error(SLAPI_LOG_ERR, repl_plugin_name, + slapi_log_err(SLAPI_LOG_ERR, repl_plugin_name, "agmtlist_modify_callback - " "Failed to update host for agreement %s\n", agmt_get_long_name(agmt)); @@ -462,7 +462,7 @@ agmtlist_modify_callback(Slapi_PBlock *pb, Slapi_Entry *entryBefore, Slapi_Entry /* New replica port */ if (agmt_set_port_from_entry(agmt, e) != 0) { - slapi_log_error(SLAPI_LOG_ERR, repl_plugin_name, + slapi_log_err(SLAPI_LOG_ERR, repl_plugin_name, "agmtlist_modify_callback - " "Failed to update port for agreement %s\n", agmt_get_long_name(agmt)); @@ -482,7 +482,7 @@ agmtlist_modify_callback(Slapi_PBlock *pb, Slapi_Entry *entryBefore, Slapi_Entry /* New Transport info */ if (agmt_set_transportinfo_from_entry(agmt, e) != 0) { - slapi_log_error(SLAPI_LOG_ERR, repl_plugin_name, "agmtlist_modify_callback - " + slapi_log_err(SLAPI_LOG_ERR, repl_plugin_name, "agmtlist_modify_callback - " "Failed to update transport info for agreement %s\n", agmt_get_long_name(agmt)); *returncode = LDAP_OPERATIONS_ERROR; @@ -494,7 +494,7 @@ agmtlist_modify_callback(Slapi_PBlock *pb, Slapi_Entry *entryBefore, Slapi_Entry { if (agmt_set_bind_method_from_entry(agmt, e) != 0) { - slapi_log_error(SLAPI_LOG_ERR, repl_plugin_name, "agmtlist_modify_callback - " + slapi_log_err(SLAPI_LOG_ERR, repl_plugin_name, "agmtlist_modify_callback - " "Failed to update bind method for agreement %s\n", agmt_get_long_name(agmt)); *returncode = LDAP_OPERATIONS_ERROR; @@ -508,7 +508,7 @@ agmtlist_modify_callback(Slapi_PBlock *pb, Slapi_Entry *entryBefore, Slapi_Entry /* New set of excluded attributes */ if (agmt_set_replicated_attributes_from_entry(agmt, e) != 0) { - slapi_log_error(SLAPI_LOG_ERR, repl_plugin_name, "agmtlist_modify_callback - " + slapi_log_err(SLAPI_LOG_ERR, repl_plugin_name, "agmtlist_modify_callback - " "Failed to update replicated attributes for agreement %s\n", agmt_get_long_name(agmt)); *returncode = LDAP_OPERATIONS_ERROR; @@ -520,7 +520,7 @@ agmtlist_modify_callback(Slapi_PBlock *pb, Slapi_Entry *entryBefore, Slapi_Entry { /* Report the error to the client */ PR_snprintf (errortext, SLAPI_DSE_RETURNTEXT_SIZE, "attempt to exclude an illegal attribute in a fractional agreement"); - slapi_log_error(SLAPI_LOG_ERR, repl_plugin_name, "agmtlist_modify_callback - " + slapi_log_err(SLAPI_LOG_ERR, repl_plugin_name, "agmtlist_modify_callback - " "Attempt to exclude an illegal attribute in a fractional agreement\n"); *returncode = LDAP_UNWILLING_TO_PERFORM; @@ -537,7 +537,7 @@ agmtlist_modify_callback(Slapi_PBlock *pb, Slapi_Entry *entryBefore, Slapi_Entry /* New set of excluded attributes */ if (agmt_set_replicated_attributes_total_from_entry(agmt, e) != 0) { - slapi_log_error(SLAPI_LOG_ERR, repl_plugin_name, "agmtlist_modify_callback - " + slapi_log_err(SLAPI_LOG_ERR, repl_plugin_name, "agmtlist_modify_callback - " "Failed to update total update replicated attributes for agreement %s\n", agmt_get_long_name(agmt)); *returncode = LDAP_OPERATIONS_ERROR; @@ -550,7 +550,7 @@ agmtlist_modify_callback(Slapi_PBlock *pb, Slapi_Entry *entryBefore, Slapi_Entry /* Report the error to the client */ PR_snprintf (errortext, SLAPI_DSE_RETURNTEXT_SIZE, "attempt to exclude an illegal total update " "attribute in a fractional agreement"); - slapi_log_error(SLAPI_LOG_ERR, repl_plugin_name, "agmtlist_modify_callback - " + slapi_log_err(SLAPI_LOG_ERR, repl_plugin_name, "agmtlist_modify_callback - " "Attempt to exclude an illegal total update attribute in a fractional agreement\n"); *returncode = LDAP_UNWILLING_TO_PERFORM; @@ -576,7 +576,7 @@ agmtlist_modify_callback(Slapi_PBlock *pb, Slapi_Entry *entryBefore, Slapi_Entry else if (slapi_attr_types_equivalent(mods[i]->mod_type, type_nsds5ReplicaEnabled)) { if(agmt_set_enabled_from_entry(agmt, e, returntext) != 0){ - slapi_log_error(SLAPI_LOG_ERR, repl_plugin_name, "agmtlist_modify_callback - " + slapi_log_err(SLAPI_LOG_ERR, repl_plugin_name, "agmtlist_modify_callback - " "Failed to set replica agmt state \"enabled/disabled\" for %s\n",agmt_get_long_name(agmt)); *returncode = LDAP_OPERATIONS_ERROR; rc = SLAPI_DSE_CALLBACK_ERROR; @@ -585,7 +585,7 @@ agmtlist_modify_callback(Slapi_PBlock *pb, Slapi_Entry *entryBefore, Slapi_Entry else if (slapi_attr_types_equivalent(mods[i]->mod_type, type_nsds5ReplicaStripAttrs)) { if(agmt_set_attrs_to_strip(agmt, e) != 0){ - slapi_log_error(SLAPI_LOG_ERR, repl_plugin_name, "agmtlist_modify_callback - " + slapi_log_err(SLAPI_LOG_ERR, repl_plugin_name, "agmtlist_modify_callback - " "Failed to set replica agmt attributes to strip for %s\n",agmt_get_long_name(agmt)); *returncode = LDAP_OPERATIONS_ERROR; rc = SLAPI_DSE_CALLBACK_ERROR; @@ -609,7 +609,7 @@ agmtlist_modify_callback(Slapi_PBlock *pb, Slapi_Entry *entryBefore, Slapi_Entry PR_snprintf (returntext, SLAPI_DSE_RETURNTEXT_SIZE, "attribute %s value (%s) is invalid, must be a number greater than zero.\n", type_replicaProtocolTimeout, val ? val : ""); - slapi_log_error(SLAPI_LOG_ERR, repl_plugin_name, "agmtlist_modify_callback - " + slapi_log_err(SLAPI_LOG_ERR, repl_plugin_name, "agmtlist_modify_callback - " "Attribute %s value (%s) is invalid, must be a number greater than zero.\n", type_replicaProtocolTimeout, val ? val : ""); rc = SLAPI_DSE_CALLBACK_ERROR; @@ -629,7 +629,7 @@ agmtlist_modify_callback(Slapi_PBlock *pb, Slapi_Entry *entryBefore, Slapi_Entry else if ((0 == windows_handle_modify_agreement(agmt, mods[i]->mod_type, e)) && (0 == id_extended_agreement(agmt, mods, e))) { - slapi_log_error(SLAPI_LOG_ERR, repl_plugin_name, "agmtlist_modify_callback - " + slapi_log_err(SLAPI_LOG_ERR, repl_plugin_name, "agmtlist_modify_callback - " "Modification of %s attribute is not allowed\n", mods[i]->mod_type); *returncode = LDAP_UNWILLING_TO_PERFORM; rc = SLAPI_DSE_CALLBACK_ERROR; @@ -664,7 +664,7 @@ agmtlist_modify_callback(Slapi_PBlock *pb, Slapi_Entry *entryBefore, Slapi_Entry { if (agmt_set_schedule_from_entry(agmt, e) != 0) { - slapi_log_error(SLAPI_LOG_ERR, repl_plugin_name, "agmtlist_modify_callback - " + slapi_log_err(SLAPI_LOG_ERR, repl_plugin_name, "agmtlist_modify_callback - " "Failed to update replication schedule for agreement %s\n", agmt_get_long_name(agmt)); *returncode = LDAP_OPERATIONS_ERROR; @@ -689,12 +689,12 @@ agmtlist_delete_callback(Slapi_PBlock *pb, Slapi_Entry *e, Slapi_Entry *entryAft Repl_Agmt *ra; Object *ro; - slapi_log_error(SLAPI_LOG_REPL, repl_plugin_name, "agmtlist_delete_callback - Begin\n"); + slapi_log_err(SLAPI_LOG_REPL, repl_plugin_name, "agmtlist_delete_callback - Begin\n"); ro = objset_find(agmt_set, agmt_dn_cmp, (const void *)slapi_entry_get_sdn_const(e)); ra = (NULL == ro) ? NULL : (Repl_Agmt *)object_get_data(ro); if (NULL == ra) { - slapi_log_error(SLAPI_LOG_ERR, repl_plugin_name, "agmtlist_delete_callback - " + slapi_log_err(SLAPI_LOG_ERR, repl_plugin_name, "agmtlist_delete_callback - " "Tried to delete replication agreement \"%s\", but no such " "agreement was configured.\n", slapi_sdn_get_dn(slapi_entry_get_sdn_const(e))); } @@ -713,7 +713,7 @@ static int agmtlist_rename_callback(Slapi_PBlock *pb, Slapi_Entry *entryBefore, Slapi_Entry *e, int *returncode, char *returntext, void *arg) { - slapi_log_error(SLAPI_LOG_REPL, repl_plugin_name, "agmtlist_rename_callback - Begin\n"); + slapi_log_err(SLAPI_LOG_REPL, repl_plugin_name, "agmtlist_rename_callback - Begin\n"); *returncode = LDAP_SUCCESS; return SLAPI_DSE_CALLBACK_OK; @@ -726,7 +726,7 @@ handle_agmt_search(Slapi_Entry *e, void *callback_data) int *agmtcount = (int *)callback_data; int rc; - slapi_log_error(SLAPI_LOG_REPL, repl_plugin_name, + slapi_log_err(SLAPI_LOG_REPL, repl_plugin_name, "handle_agmt_search - Found replication agreement named \"%s\".\n", slapi_sdn_get_dn(slapi_entry_get_sdn(e))); rc = add_new_agreement(e); @@ -736,7 +736,7 @@ handle_agmt_search(Slapi_Entry *e, void *callback_data) } else { - slapi_log_error(SLAPI_LOG_REPL, repl_plugin_name, "handle_agmt_search - " + slapi_log_err(SLAPI_LOG_REPL, repl_plugin_name, "handle_agmt_search - " "The replication agreement named \"%s\" could not be correctly parsed. No " "replication will occur with this replica.\n", slapi_sdn_get_dn(slapi_entry_get_sdn(e))); @@ -784,7 +784,7 @@ agmtlist_config_init() NULL /* referral callback */); slapi_pblock_destroy(pb); - slapi_log_error(SLAPI_LOG_REPL, repl_plugin_name, "agmtlist_config_init - " + slapi_log_err(SLAPI_LOG_REPL, repl_plugin_name, "agmtlist_config_init - " "Found %d replication agreements in DIT\n", agmtcount); return 0; diff --git a/ldap/servers/plugins/replication/repl5_connection.c b/ldap/servers/plugins/replication/repl5_connection.c index 3646bfd..b3c86bc 100644 --- a/ldap/servers/plugins/replication/repl5_connection.c +++ b/ldap/servers/plugins/replication/repl5_connection.c @@ -435,7 +435,7 @@ conn_read_result_ex(Repl_Connection *conn, char **retoidp, struct berval **retda /* must not access conn->ld if disconnected in another thread */ /* the other thread that actually did the conn_disconnect() */ /* will set the status and error info */ - slapi_log_error(SLAPI_LOG_REPL, repl_plugin_name, + slapi_log_err(SLAPI_LOG_REPL, repl_plugin_name, "conn_read_result_ex - %s: Connection disconnected by another thread\n", agmt_get_long_name(conn->agmt)); } @@ -557,7 +557,7 @@ see_if_write_available(Repl_Connection *conn, PRIntervalTime timeout) /* get the sockbuf */ if ((ldap_get_option(conn->ld, LDAP_OPT_DESC, &fd) != LDAP_OPT_SUCCESS) || (fd <= 0)) { - slapi_log_error(SLAPI_LOG_ERR, repl_plugin_name, + slapi_log_err(SLAPI_LOG_ERR, repl_plugin_name, "see_if_write_available - %s - *Invalid connection\n", agmt_get_long_name(conn->agmt)); conn->last_ldap_error = LDAP_PARAM_ERROR; @@ -578,13 +578,13 @@ see_if_write_available(Repl_Connection *conn, PRIntervalTime timeout) /* check */ if (rc == 0) { /* timeout */ - slapi_log_error(SLAPI_LOG_REPL, repl_plugin_name, + slapi_log_err(SLAPI_LOG_REPL, repl_plugin_name, "see_if_write_available - %s - poll timed out - poll interval [%d]\n", agmt_get_long_name(conn->agmt), timeout); return CONN_TIMEOUT; } else if ((rc < 0) || (!(polldesc.out_flags&PR_POLL_WRITE))) { /* error */ - slapi_log_error(SLAPI_LOG_REPL, repl_plugin_name, + slapi_log_err(SLAPI_LOG_REPL, repl_plugin_name, "see_if_write_available - %s - error during poll attempt [%d:%s]\n", agmt_get_long_name(conn->agmt), PR_GetError(), slapd_pr_strerror(PR_GetError())); @@ -615,7 +615,7 @@ see_if_write_available(Repl_Connection *conn, PRIntervalTime timeout) iofns.lextiof_size = LDAP_X_EXTIO_FNS_SIZE; if (ldap_get_option(conn->ld, LDAP_X_OPT_EXTIO_FN_PTRS, &iofns) < 0) { rc = slapi_ldap_get_lderrno(conn->ld, NULL, NULL); - slapi_log_error(SLAPI_LOG_ERR, repl_plugin_name, + slapi_log_err(SLAPI_LOG_ERR, repl_plugin_name, "see_if_write_available - %s: Failed call to ldap_get_option to get extiofns: LDAP error %d (%s)\n", agmt_get_long_name(conn->agmt), rc, ldap_err2string(rc)); @@ -627,7 +627,7 @@ see_if_write_available(Repl_Connection *conn, PRIntervalTime timeout) /* set up the poll structure */ if (ldap_get_option(conn->ld, LDAP_OPT_DESC, &pollstr.lpoll_fd) < 0) { rc = slapi_ldap_get_lderrno(conn->ld, NULL, NULL); - slapi_log_error(SLAPI_LOG_ERR, repl_plugin_name, + slapi_log_err(SLAPI_LOG_ERR, repl_plugin_name, "see_if_write_available - %s: Failed call to ldap_get_option for poll_fd: LDAP error %d (%s)\n", agmt_get_long_name(conn->agmt), rc, ldap_err2string(rc)); @@ -638,7 +638,7 @@ see_if_write_available(Repl_Connection *conn, PRIntervalTime timeout) if (ldap_get_option(conn->ld, LDAP_X_OPT_SOCKETARG, &pollstr.lpoll_socketarg) < 0) { rc = slapi_ldap_get_lderrno(conn->ld, NULL, NULL); - slapi_log_error(SLAPI_LOG_ERR, repl_plugin_name, + slapi_log_err(SLAPI_LOG_ERR, repl_plugin_name, "see_if_write_available - %s: Failed call to ldap_get_option for socketarg: LDAP error %d (%s)\n", agmt_get_long_name(conn->agmt), rc, ldap_err2string(rc)); @@ -651,7 +651,7 @@ see_if_write_available(Repl_Connection *conn, PRIntervalTime timeout) private = iofns.lextiof_session_arg; if (0 == (*ldap_poll)(&pollstr, nfds, timeout, private)) { - slapi_log_error(SLAPI_LOG_REPL, repl_plugin_name, + slapi_log_err(SLAPI_LOG_REPL, repl_plugin_name, "%s: poll timed out - poll interval [%d]\n", agmt_get_long_name(conn->agmt), timeout); @@ -684,12 +684,12 @@ check_flow_control_tot_init(Repl_Connection *conn, int optype, const char *extop */ rcv_msgid = repl5_tot_last_rcv_msgid(conn); if (rcv_msgid == -1) { - slapi_log_error(SLAPI_LOG_ERR, repl_plugin_name, + slapi_log_err(SLAPI_LOG_ERR, repl_plugin_name, "check_flow_control_tot_init - %s - Check_flow_control_tot_init no callback data [ msgid sent: %d]\n", agmt_get_long_name(conn->agmt), sent_msgid); } else if (sent_msgid < rcv_msgid) { - slapi_log_error(SLAPI_LOG_REPL, repl_plugin_name, + slapi_log_err(SLAPI_LOG_REPL, repl_plugin_name, "check_flow_control_tot_init - %s - Invalid message ids [ msgid sent: %d, rcv: %d]\n", agmt_get_long_name(conn->agmt), sent_msgid, @@ -710,7 +710,7 @@ check_flow_control_tot_init(Repl_Connection *conn, int optype, const char *extop * Log it at least once to inform administrator there is * a potential configuration issue here */ - slapi_log_error(SLAPI_LOG_ERR, repl_plugin_name, + slapi_log_err(SLAPI_LOG_ERR, repl_plugin_name, "check_flow_control_tot_init - %s - Total update flow control gives time (%d msec) to the consumer before sending more entries [ msgid sent: %d, rcv: %d])\n" "If total update fails you can try to increase %s and/or decrease %s in the replica agreement configuration\n", agmt_get_long_name(conn->agmt), @@ -772,7 +772,7 @@ conn_is_available(Repl_Connection *conn) } else { /* Else give connection to others threads */ PR_Unlock(conn->lock); - slapi_log_error(SLAPI_LOG_REPL, repl_plugin_name, + slapi_log_err(SLAPI_LOG_REPL, repl_plugin_name, "conn_is_available - %s: transient timeout. retry)\n", agmt_get_long_name(conn->agmt)); DS_Sleep(PR_MillisecondsToInterval(yield_delay_msec)); @@ -833,7 +833,7 @@ perform_operation(Repl_Connection *conn, int optype, const char *dn, return_value = conn_is_available(conn); if (return_value != CONN_OPERATION_SUCCESS) { PR_Unlock(conn->lock); - slapi_log_error(SLAPI_LOG_ERR, repl_plugin_name, + slapi_log_err(SLAPI_LOG_ERR, repl_plugin_name, "perform_operation - %s - Connection is not available (%d)\n", agmt_get_long_name(conn->agmt), return_value); @@ -883,7 +883,7 @@ perform_operation(Repl_Connection *conn, int optype, const char *dn, } else { - slapi_log_error(SLAPI_LOG_ERR, repl_plugin_name, + slapi_log_err(SLAPI_LOG_ERR, repl_plugin_name, "perform_operation - %s: Failed to send %s operation: LDAP error %d (%s)\n", agmt_get_long_name(conn->agmt), op_string ? op_string : "NULL", rc, ldap_err2string(rc)); @@ -1070,7 +1070,7 @@ conn_cancel_linger(Repl_Connection *conn) PR_Lock(conn->lock); if (conn->linger_active) { - slapi_log_error(SLAPI_LOG_REPL, repl_plugin_name, + slapi_log_err(SLAPI_LOG_REPL, repl_plugin_name, "conn_cancel_linger - %s - Canceling linger on the connection\n", agmt_get_long_name(conn->agmt)); conn->linger_active = PR_FALSE; @@ -1083,7 +1083,7 @@ conn_cancel_linger(Repl_Connection *conn) } else { - slapi_log_error(SLAPI_LOG_REPL, repl_plugin_name, + slapi_log_err(SLAPI_LOG_REPL, repl_plugin_name, "conn_cancel_linger - %s - No linger to cancel on the connection\n", agmt_get_long_name(conn->agmt)); } @@ -1103,7 +1103,7 @@ linger_timeout(time_t event_time, void *arg) Repl_Connection *conn = (Repl_Connection *)arg; PR_ASSERT(NULL != conn); - slapi_log_error(SLAPI_LOG_REPL, repl_plugin_name, + slapi_log_err(SLAPI_LOG_REPL, repl_plugin_name, "linger_timeout - %s - Linger timeout has expired on the connection\n", agmt_get_long_name(conn->agmt)); PR_Lock(conn->lock); @@ -1131,12 +1131,12 @@ conn_start_linger(Repl_Connection *conn) time_t now; PR_ASSERT(NULL != conn); - slapi_log_error(SLAPI_LOG_REPL, repl_plugin_name, + slapi_log_err(SLAPI_LOG_REPL, repl_plugin_name, "conn_start_linger -%s - Beginning linger on the connection\n", agmt_get_long_name(conn->agmt)); if (!conn_connected(conn)) { - slapi_log_error(SLAPI_LOG_REPL, repl_plugin_name, + slapi_log_err(SLAPI_LOG_REPL, repl_plugin_name, "conn_start_linger - %s - No linger on the closed conn\n", agmt_get_long_name(conn->agmt)); return; @@ -1145,7 +1145,7 @@ conn_start_linger(Repl_Connection *conn) PR_Lock(conn->lock); if (conn->linger_active) { - slapi_log_error(SLAPI_LOG_REPL, repl_plugin_name, + slapi_log_err(SLAPI_LOG_REPL, repl_plugin_name, "conn_start_linger - %s - Linger already active on the connection\n", agmt_get_long_name(conn->agmt)); } @@ -1212,7 +1212,7 @@ conn_connect(Repl_Connection *conn) /* Pb occured in decryption: stop now, binding will fail */ if ( pw_ret == -1 ) { - slapi_log_error(SLAPI_LOG_ERR, repl_plugin_name, + slapi_log_err(SLAPI_LOG_ERR, repl_plugin_name, "conn_connect - %s - Decoding of the credentials failed.\n", agmt_get_long_name(conn->agmt)); @@ -1238,7 +1238,7 @@ conn_connect(Repl_Connection *conn) if (secure > 0) { if (!NSS_IsInitialized()) { - slapi_log_error(SLAPI_LOG_ERR, repl_plugin_name, + slapi_log_err(SLAPI_LOG_ERR, repl_plugin_name, "conn_connect - %s - SSL Not Initialized, Replication over SSL FAILED\n", agmt_get_long_name(conn->agmt)); conn->last_ldap_error = LDAP_INAPPROPRIATE_AUTH; @@ -1254,7 +1254,7 @@ conn_connect(Repl_Connection *conn) #endif /* Now we initialize the LDAP Structure and set options */ - slapi_log_error(SLAPI_LOG_REPL, repl_plugin_name, + slapi_log_err(SLAPI_LOG_REPL, repl_plugin_name, "conn_connect - %s - Trying %s%s slapi_ldap_init_ext\n", agmt_get_long_name(conn->agmt), secure ? "secure" : "non-secure", @@ -1272,7 +1272,7 @@ conn_connect(Repl_Connection *conn) conn->state = STATE_DISCONNECTED; conn->last_operation = CONN_INIT; conn->last_ldap_error = LDAP_LOCAL_ERROR; - slapi_log_error(SLAPI_LOG_ERR, repl_plugin_name, + slapi_log_err(SLAPI_LOG_ERR, repl_plugin_name, "conn_connect - %s - Failed to establish %s%sconnection to the consumer\n", agmt_get_long_name(conn->agmt), secure ? "secure " : "", @@ -1283,7 +1283,7 @@ conn_connect(Repl_Connection *conn) /* slapi_ch_strdup is OK with NULL strings */ binddn = slapi_ch_strdup(conn->binddn); - slapi_log_error(SLAPI_LOG_REPL, repl_plugin_name, + slapi_log_err(SLAPI_LOG_REPL, repl_plugin_name, "conn_connect - %s - binddn = %s, passwd = %s\n", agmt_get_long_name(conn->agmt), binddn?binddn:"NULL", creds->bv_val?creds->bv_val:"NULL"); @@ -1361,7 +1361,7 @@ close_connection_internal(Repl_Connection *conn) slapi_ldap_unbind(conn->ld); } conn->ld = NULL; - slapi_log_error(SLAPI_LOG_REPL, repl_plugin_name, + slapi_log_err(SLAPI_LOG_REPL, repl_plugin_name, "close_connection_internal - %s - Disconnected from the consumer\n", agmt_get_long_name(conn->agmt)); } @@ -1695,12 +1695,12 @@ supplier_read_consumer_definitions(Repl_Connection *conn, struct berval ***remot if (return_value == CONN_OPERATION_SUCCESS) { *remote_attributetypes = remote_schema_attributetypes_bervals; } else { - slapi_log_error(SLAPI_LOG_ERR, repl_plugin_name, + slapi_log_err(SLAPI_LOG_ERR, repl_plugin_name, "%s: Fail to retrieve the remote schema attributetypes\n", agmt_get_long_name(conn->agmt)); } } else { - slapi_log_error(SLAPI_LOG_ERR, repl_plugin_name, + slapi_log_err(SLAPI_LOG_ERR, repl_plugin_name, "%s: Fail to retrieve the remote schema objectclasses\n", agmt_get_long_name(conn->agmt)); } @@ -1735,7 +1735,7 @@ update_consumer_schema(Repl_Connection *conn) /* The consumer contains definitions that needs to be learned */ supplier_learn_new_definitions(remote_schema_objectclasses_bervals, remote_schema_attributetypes_bervals); - slapi_log_error(SLAPI_LOG_ERR, repl_plugin_name, + slapi_log_err(SLAPI_LOG_ERR, repl_plugin_name, "update_consumer_schema - [S] Schema %s must not be overwritten (set replication log for additional info)\n", agmt_get_long_name(conn->agmt)); ok_to_send_schema = PR_FALSE; @@ -1778,12 +1778,12 @@ conn_push_schema(Repl_Connection *conn, CSN **remotecsn) if (!remotecsn) { return_value = CONN_OPERATION_FAILED; - slapi_log_error(SLAPI_LOG_ERR, repl_plugin_name, "conn_push_schema - NULL remote CSN\n"); + slapi_log_err(SLAPI_LOG_ERR, repl_plugin_name, "conn_push_schema - NULL remote CSN\n"); } else if (!conn_connected_locked(conn, 0 /* not locked */)) { return_value = CONN_NOT_CONNECTED; - slapi_log_error(SLAPI_LOG_REPL, repl_plugin_name, + slapi_log_err(SLAPI_LOG_REPL, repl_plugin_name, "conn_push_schema - %s: Schema replication update failed: not connected to consumer\n", agmt_get_long_name(conn->agmt)); } @@ -1805,11 +1805,11 @@ conn_push_schema(Repl_Connection *conn, CSN **remotecsn) if (*remotecsn) { csn_as_string (*remotecsn, PR_FALSE, remotecnsstr); csn_as_string (localcsn, PR_FALSE, localcsnstr); - slapi_log_error(SLAPI_LOG_REPL, repl_plugin_name, + slapi_log_err(SLAPI_LOG_REPL, repl_plugin_name, "conn_push_schema - [S] Checking consumer schema localcsn:%s / remotecsn:%s\n", localcsnstr, remotecnsstr); } else { csn_as_string (localcsn, PR_FALSE, localcsnstr); - slapi_log_error(SLAPI_LOG_REPL, repl_plugin_name, + slapi_log_err(SLAPI_LOG_REPL, repl_plugin_name, "conn_push_schema - [S] Checking consumer schema localcsn:%s / remotecsn:NULL\n", localcsnstr); } if (!update_consumer_schema(conn)) { @@ -1820,10 +1820,10 @@ conn_push_schema(Repl_Connection *conn, CSN **remotecsn) * So it could be possible that a second attempt (right now) of update_consumer_schema * would be successful */ - slapi_log_error(SLAPI_LOG_REPL, repl_plugin_name, + slapi_log_err(SLAPI_LOG_REPL, repl_plugin_name, "conn_push_schema - [S] schema definitions may have been learned\n"); if (!update_consumer_schema(conn)) { - slapi_log_error(SLAPI_LOG_REPL, "schema", + slapi_log_err(SLAPI_LOG_REPL, "schema", "conn_push_schema - [S] learned definitions are not suffisant to try to push the schema \n"); return_value = CONN_OPERATION_FAILED; } @@ -1840,7 +1840,7 @@ conn_push_schema(Repl_Connection *conn, CSN **remotecsn) memcpy(remotecsnstr, remote_schema_csn_bervals[0]->bv_val, remote_schema_csn_bervals[0]->bv_len); remotecsnstr[remote_schema_csn_bervals[0]->bv_len] = '\0'; - slapi_log_error(SLAPI_LOG_REPL, repl_plugin_name, + slapi_log_err(SLAPI_LOG_REPL, repl_plugin_name, "conn_push_schema - [S] Reread remotecsn:%s\n", remotecsnstr); *remotecsn = csn_new_by_string(remotecsnstr); if (*remotecsn && (csn_compare(localcsn, *remotecsn) <= 0)) { @@ -1850,7 +1850,7 @@ conn_push_schema(Repl_Connection *conn, CSN **remotecsn) ber_bvecfree(remote_schema_csn_bervals); } if (return_value == CONN_OPERATION_SUCCESS) { - slapi_log_error(SLAPI_LOG_REPL, repl_plugin_name, + slapi_log_err(SLAPI_LOG_REPL, repl_plugin_name, "conn_push_schema - Schema checking successful: ok to push the schema (%s)\n", agmt_get_long_name(conn->agmt)); } } @@ -1894,7 +1894,7 @@ conn_push_schema(Repl_Connection *conn, CSN **remotecsn) if (NULL == entries || NULL == entries[0]) { /* Whoops - couldn't read our own schema! */ - slapi_log_error(SLAPI_LOG_ERR, repl_plugin_name, + slapi_log_err(SLAPI_LOG_ERR, repl_plugin_name, "conn_push_schema - %s - Error: unable to read local schema definitions.\n", agmt_get_long_name(conn->agmt)); return_value = CONN_OPERATION_FAILED; @@ -1938,7 +1938,7 @@ conn_push_schema(Repl_Connection *conn, CSN **remotecsn) { int ldaperr = -1, optype = -1; conn_get_error(conn, &optype, &ldaperr); - slapi_log_error(SLAPI_LOG_ERR, repl_plugin_name, + slapi_log_err(SLAPI_LOG_ERR, repl_plugin_name, "%s: Schema replication update failed: %s\n", agmt_get_long_name(conn->agmt), ldaperr == -1 ? "Unknown Error" : ldap_err2string(ldaperr)); @@ -1958,7 +1958,7 @@ conn_push_schema(Repl_Connection *conn, CSN **remotecsn) } else { - slapi_log_error(SLAPI_LOG_ERR, repl_plugin_name, + slapi_log_err(SLAPI_LOG_ERR, repl_plugin_name, "conn_push_schema - %s - Schema replication update failed: " "unable to prepare schema entry for transmission.\n", agmt_get_long_name(conn->agmt)); @@ -2077,7 +2077,7 @@ bind_and_check_pwp(Repl_Connection *conn, char * binddn, char *password) log_level = SLAPI_LOG_REPL; } conn->last_ldap_error = rc; - slapi_log_error(log_level, + slapi_log_err(log_level, repl_plugin_name, "bind_and_check_pwp - %s: Replication bind with %s auth resumed\n", agmt_get_long_name(conn->agmt), @@ -2092,7 +2092,7 @@ bind_and_check_pwp(Repl_Connection *conn, char * binddn, char *password) if ( !(strcmp( ctrls[ i ]->ldctl_oid, LDAP_CONTROL_PWEXPIRED)) ) { /* Bind is successfull but password has expired */ - slapi_log_error(SLAPI_LOG_ERR, repl_plugin_name, + slapi_log_err(SLAPI_LOG_ERR, repl_plugin_name, "bind_and_check_pwp - %s - Successfully bound %s to consumer, " "but password has expired on consumer.\n", agmt_get_long_name(conn->agmt), binddn); @@ -2104,7 +2104,7 @@ bind_and_check_pwp(Repl_Connection *conn, char * binddn, char *password) (ctrls[ i ]->ldctl_value.bv_len > 0) ) { int password_expiring = atoi( ctrls[ i ]->ldctl_value.bv_val ); - slapi_log_error(SLAPI_LOG_ERR, repl_plugin_name, + slapi_log_err(SLAPI_LOG_ERR, repl_plugin_name, "bind_and_check_pwp - %s - Successfully bound %s to consumer, " "but password is expiring on consumer in %d seconds.\n", agmt_get_long_name(conn->agmt), binddn, password_expiring); @@ -2127,7 +2127,7 @@ bind_and_check_pwp(Repl_Connection *conn, char * binddn, char *password) conn->last_ldap_error = rc; /* errmsg is a pointer directly into the ld structure - do not free */ rc = slapi_ldap_get_lderrno( ld, NULL, &errmsg ); - slapi_log_error(rc == LDAP_LOCAL_ERROR ? SLAPI_LOG_REPL : SLAPI_LOG_ERR, + slapi_log_err(rc == LDAP_LOCAL_ERROR ? SLAPI_LOG_REPL : SLAPI_LOG_ERR, repl_plugin_name, "bind_and_check_pwp - %s - Replication bind with %s auth failed: LDAP error %d (%s) (%s)\n", agmt_get_long_name(conn->agmt), @@ -2137,7 +2137,7 @@ bind_and_check_pwp(Repl_Connection *conn, char * binddn, char *password) char *errmsg = NULL; /* errmsg is a pointer directly into the ld structure - do not free */ rc = slapi_ldap_get_lderrno( ld, NULL, &errmsg ); - slapi_log_error(SLAPI_LOG_REPL, repl_plugin_name, + slapi_log_err(SLAPI_LOG_REPL, repl_plugin_name, "bind_and_check_pwp - %s - Replication bind with %s auth failed: LDAP error %d (%s) (%s)\n", agmt_get_long_name(conn->agmt), mech ? mech : "SIMPLE", rc, @@ -2219,7 +2219,7 @@ repl5_debug_timeout_callback(time_t when, void *arg) sprintf(buf, "%d", s_debug_level); config_set_errorlog_level("nsslapd-errorlog-level", buf, NULL, 1); - slapi_log_error(SLAPI_LOG_ERR, repl_plugin_name, + slapi_log_err(SLAPI_LOG_ERR, repl_plugin_name, "repl5_debug_timeout_callback: set debug level to %d at %ld\n", s_debug_level, when); } diff --git a/ldap/servers/plugins/replication/repl5_inc_protocol.c b/ldap/servers/plugins/replication/repl5_inc_protocol.c index e0a201c..eb4b965 100644 --- a/ldap/servers/plugins/replication/repl5_inc_protocol.c +++ b/ldap/servers/plugins/replication/repl5_inc_protocol.c @@ -230,7 +230,7 @@ repl5_inc_log_operation_failure(int operation_code, int ldap_error, char* ldap_e { char *op_string = slapi_op_type_to_string(operation_code); - slapi_log_error(SLAPI_LOG_DEBUG, repl_plugin_name, + slapi_log_err(SLAPI_LOG_DEBUG, repl_plugin_name, "repl5_inc_log_operation_failure - %s: Received error %d: %s for %s operation\n", agreement_name, ldap_error, ldap_error_string ? ldap_error_string : "NULL", @@ -249,7 +249,7 @@ repl5_inc_result_threadmain(void *param) int message_id = 0; int yield_session = 0; - slapi_log_error(SLAPI_LOG_REPL, repl_plugin_name, "repl5_inc_result_threadmain - Starting\n"); + slapi_log_err(SLAPI_LOG_REPL, repl_plugin_name, "repl5_inc_result_threadmain - Starting\n"); while (!finished) { LDAPControl **returned_controls = NULL; @@ -274,7 +274,7 @@ repl5_inc_result_threadmain(void *param) while (!finished) { conres = conn_read_result_ex(conn, NULL, NULL, &returned_controls, LDAP_RES_ANY, &message_id, 0); - slapi_log_error(SLAPI_LOG_REPL, repl_plugin_name, "repl5_inc_result_threadmain - " + slapi_log_err(SLAPI_LOG_REPL, repl_plugin_name, "repl5_inc_result_threadmain - " "Read result for message_id %d\n", message_id); /* Timeout here means that we didn't block, not a real timeout */ if (CONN_TIMEOUT == conres) @@ -338,7 +338,7 @@ repl5_inc_result_threadmain(void *param) } conn_get_error_ex(conn, &operation_code, &connection_error, &ldap_error_string); - slapi_log_error(SLAPI_LOG_REPL, repl_plugin_name, + slapi_log_err(SLAPI_LOG_REPL, repl_plugin_name, "repl5_inc_result_threadmain - Result %d, %d, %d, %d, %s\n", operation_code,connection_error,conres,message_id,ldap_error_string); return_value = repl5_inc_update_from_op_result(rd->prp, conres, connection_error, @@ -346,7 +346,7 @@ repl5_inc_result_threadmain(void *param) &(rd->num_changes_sent)); if (return_value || should_finish) { - slapi_log_error(SLAPI_LOG_REPL, repl_plugin_name, + slapi_log_err(SLAPI_LOG_REPL, repl_plugin_name, "repl5_inc_result_threadmain - Got op result %d should finish %d\n", return_value, should_finish); /* If so then we need to take steps to abort the update process */ @@ -375,7 +375,7 @@ repl5_inc_result_threadmain(void *param) if (!finished && yield_session && rd->abort != SESSION_ABORTED && rd->abort_time == 0) { rd->abort_time = time( NULL ); rd->abort = SESSION_ABORTED; /* only set the abort time once */ - slapi_log_error(SLAPI_LOG_REPL, repl_plugin_name, "repl5_inc_result_threadmain - " + slapi_log_err(SLAPI_LOG_REPL, repl_plugin_name, "repl5_inc_result_threadmain - " "Abort control detected, setting abort time...(%s)\n", agmt_get_long_name(rd->prp->agmt)); } @@ -389,7 +389,7 @@ repl5_inc_result_threadmain(void *param) repl5_inc_op_free(op); } } - slapi_log_error(SLAPI_LOG_REPL, repl_plugin_name, "repl5_inc_result_threadmain exiting\n"); + slapi_log_err(SLAPI_LOG_REPL, repl_plugin_name, "repl5_inc_result_threadmain exiting\n"); } static result_data * @@ -443,7 +443,7 @@ repl5_inc_create_async_result_thread(result_data *rd) SLAPD_DEFAULT_THREAD_STACKSIZE); if (NULL == tid) { - slapi_log_error(SLAPI_LOG_ERR, repl_plugin_name, + slapi_log_err(SLAPI_LOG_ERR, repl_plugin_name, "repl5_inc_create_async_result_thread - Failed. " SLAPI_COMPONENT_NAME_NSPR " error %d (%s)\n", PR_GetError(), slapd_pr_strerror( PR_GetError() )); @@ -500,7 +500,7 @@ repl5_inc_waitfor_async_results(result_data *rd) /* Lock the structure to force memory barrier */ PR_Lock(rd->lock); /* Are we caught up ? */ - slapi_log_error(SLAPI_LOG_REPL, repl_plugin_name, + slapi_log_err(SLAPI_LOG_REPL, repl_plugin_name, "repl5_inc_waitfor_async_results - %d %d\n", rd->last_message_id_received, rd->last_message_id_sent); if (rd->last_message_id_received >= rd->last_message_id_sent) { @@ -525,7 +525,7 @@ repl5_inc_waitfor_async_results(result_data *rd) if (!done && (loops > 300)) { /* Log a warning */ - slapi_log_error(SLAPI_LOG_ERR, repl_plugin_name, + slapi_log_err(SLAPI_LOG_ERR, repl_plugin_name, "repl5_inc_waitfor_async_results - Timed out waiting for responses: %d %d\n", rd->last_message_id_received, rd->last_message_id_sent); done = 1; @@ -747,7 +747,7 @@ repl5_inc_run(Private_Repl_Protocol *prp) } else if ((e1 = event_occurred(prp, EVENT_WINDOW_CLOSED)) || event_occurred(prp, EVENT_BACKOFF_EXPIRED)){ /* this events - should not occur - log a warning and go to sleep */ - slapi_log_error(SLAPI_LOG_ERR, repl_plugin_name, + slapi_log_err(SLAPI_LOG_ERR, repl_plugin_name, "repl5_inc_run - %s: " "Event %s should not occur in state %s; going to sleep\n", agmt_get_long_name(prp->agmt), e1 ? event2name(EVENT_WINDOW_CLOSED) : @@ -755,7 +755,7 @@ repl5_inc_run(Private_Repl_Protocol *prp) protocol_sleep(prp, PR_INTERVAL_NO_TIMEOUT); } else { /* wait until window opens or an event occurs */ - slapi_log_error(SLAPI_LOG_REPL, repl_plugin_name, + slapi_log_err(SLAPI_LOG_REPL, repl_plugin_name, "repl5_inc_run - %s: Waiting for update window to open\n", agmt_get_long_name(prp->agmt)); protocol_sleep(prp, PR_INTERVAL_NO_TIMEOUT); @@ -792,7 +792,7 @@ repl5_inc_run(Private_Repl_Protocol *prp) wait_change_timer_set = 0; } else if ((e1 = event_occurred(prp, EVENT_WINDOW_OPENED)) || event_occurred(prp, EVENT_BACKOFF_EXPIRED)){ /* this events - should not occur - log a warning and clear the event */ - slapi_log_error(SLAPI_LOG_ERR, repl_plugin_name, "repl5_inc_run - %s: " + slapi_log_err(SLAPI_LOG_ERR, repl_plugin_name, "repl5_inc_run - %s: " "Event %s should not occur in state %s\n",agmt_get_long_name(prp->agmt), e1 ? event2name(EVENT_WINDOW_OPENED) : event2name(EVENT_BACKOFF_EXPIRED), state2name(current_state)); @@ -860,7 +860,7 @@ repl5_inc_run(Private_Repl_Protocol *prp) event_occurred (prp, EVENT_BACKOFF_EXPIRED)){ /* This should never happen */ /* this events - should not occur - log a warning and go to sleep */ - slapi_log_error(SLAPI_LOG_ERR, repl_plugin_name, + slapi_log_err(SLAPI_LOG_ERR, repl_plugin_name, "repl5_inc_run - %s: Event %s should not occur in state %s\n", agmt_get_long_name(prp->agmt), e1 ? event2name(EVENT_WINDOW_OPENED) : event2name(EVENT_BACKOFF_EXPIRED), @@ -935,7 +935,7 @@ repl5_inc_run(Private_Repl_Protocol *prp) time(&now); next_fire_time = backoff_step(prp_priv->backoff); /* And go back to sleep */ - slapi_log_error(SLAPI_LOG_REPL, repl_plugin_name, + slapi_log_err(SLAPI_LOG_REPL, repl_plugin_name, "repl5_inc_run - %s: Replication session backing off for %ld seconds\n", agmt_get_long_name(prp->agmt),next_fire_time - now); protocol_sleep(prp, PR_INTERVAL_NO_TIMEOUT); @@ -960,7 +960,7 @@ repl5_inc_run(Private_Repl_Protocol *prp) } } else if (event_occurred(prp, EVENT_WINDOW_OPENED)){ /* this should never happen - log an error and go to sleep */ - slapi_log_error(SLAPI_LOG_ERR, repl_plugin_name, "repl5_inc_run - %s: " + slapi_log_err(SLAPI_LOG_ERR, repl_plugin_name, "repl5_inc_run - %s: " "Event %s should not occur in state %s; going to sleep\n", agmt_get_long_name(prp->agmt), event2name(EVENT_WINDOW_OPENED), state2name(current_state)); @@ -1007,7 +1007,7 @@ repl5_inc_run(Private_Repl_Protocol *prp) agmt_set_consumer_schema_csn ( prp->agmt, cons_schema_csn ); } if (CONN_SCHEMA_UPDATED != rc && CONN_SCHEMA_NO_UPDATE_NEEDED != rc){ - slapi_log_error(SLAPI_LOG_ERR, repl_plugin_name, + slapi_log_err(SLAPI_LOG_ERR, repl_plugin_name, "%s: Warning: unable to replicate schema: rc=%d\n", agmt_get_long_name(prp->agmt), rc); /* But keep going */ } @@ -1022,7 +1022,7 @@ repl5_inc_run(Private_Repl_Protocol *prp) next_state = STATE_STOP_FATAL_ERROR; break; case EXAMINE_RUV_PRISTINE_REPLICA: - slapi_log_error(SLAPI_LOG_WARNING, repl_plugin_name, + slapi_log_err(SLAPI_LOG_WARNING, repl_plugin_name, "repl5_inc_run - %s: Replica has no update vector. It has never been initialized.\n", agmt_get_long_name(prp->agmt)); agmt_set_last_update_status(prp->agmt, 0, NSDS50_REPL_RUV_ERROR, @@ -1030,7 +1030,7 @@ repl5_inc_run(Private_Repl_Protocol *prp) next_state = STATE_BACKOFF_START; break; case EXAMINE_RUV_GENERATION_MISMATCH: - slapi_log_error(SLAPI_LOG_WARNING, repl_plugin_name, + slapi_log_err(SLAPI_LOG_WARNING, repl_plugin_name, "repl5_inc_run - %s: The remote replica has a different database generation ID than " "the local database. You may have to reinitialize the remote replica, " "or the local replica.\n", agmt_get_long_name(prp->agmt)); @@ -1040,7 +1040,7 @@ repl5_inc_run(Private_Repl_Protocol *prp) next_state = STATE_BACKOFF_START; break; case EXAMINE_RUV_REPLICA_TOO_OLD: - slapi_log_error(SLAPI_LOG_WARNING, repl_plugin_name, + slapi_log_err(SLAPI_LOG_WARNING, repl_plugin_name, "repl5_inc_run - %s: Replica update vector is too out of date to bring " "into sync using the incremental protocol. The replica " "must be reinitialized.\n", agmt_get_long_name(prp->agmt)); @@ -1057,14 +1057,14 @@ repl5_inc_run(Private_Repl_Protocol *prp) object_release (prp->replica_object); replica = NULL; if (rc == CSN_LIMIT_EXCEEDED) /* too much skew */ { - slapi_log_error(SLAPI_LOG_ERR, repl_plugin_name, + slapi_log_err(SLAPI_LOG_ERR, repl_plugin_name, "repl5_inc_run - %s: Fatal error - too much time skew between replicas!\n", agmt_get_long_name(prp->agmt)); agmt_set_last_update_status(prp->agmt, 0, NSDS50_REPL_EXCESSIVE_CLOCK_SKEW, "fatal error - too much time skew between replicas"); next_state = STATE_STOP_FATAL_ERROR; } else if (rc != 0) /* internal error */ { - slapi_log_error(SLAPI_LOG_ERR, repl_plugin_name, + slapi_log_err(SLAPI_LOG_ERR, repl_plugin_name, "repl5_inc_run - %s: Fatal internal error updating the CSN generator!\n", agmt_get_long_name(prp->agmt)); agmt_set_last_update_status(prp->agmt, 0, NSDS50_REPL_INTERNAL_ERROR, @@ -1153,7 +1153,7 @@ repl5_inc_run(Private_Repl_Protocol *prp) loops = pausetime; /* the while loop is so that we don't just sleep and sleep if an * event comes in that we should handle immediately (like shutdown) */ - slapi_log_error(SLAPI_LOG_REPL, repl_plugin_name, + slapi_log_err(SLAPI_LOG_REPL, repl_plugin_name, "repl5_inc_run - %s: Pausing updates for %ld seconds to allow other suppliers to update consumer\n", agmt_get_long_name(prp->agmt), pausetime); while (loops-- && !(PROTOCOL_IS_SHUTDOWN(prp))){ @@ -1172,7 +1172,7 @@ repl5_inc_run(Private_Repl_Protocol *prp) * We encountered some sort of a fatal error. Suspend. */ dev_debug("repl5_inc_run(STATE_STOP_FATAL_ERROR)"); - slapi_log_error(SLAPI_LOG_ERR, repl_plugin_name, + slapi_log_err(SLAPI_LOG_ERR, repl_plugin_name, "repl5_inc_run - %s: Incremental update failed and requires administrator action\n", agmt_get_long_name(prp->agmt)); next_state = STATE_STOP_FATAL_ERROR_PART2; @@ -1221,7 +1221,7 @@ repl5_inc_run(Private_Repl_Protocol *prp) break; } - slapi_log_error(SLAPI_LOG_REPL, repl_plugin_name,"repl5_inc_run - %s: State: %s -> %s\n", + slapi_log_err(SLAPI_LOG_REPL, repl_plugin_name,"repl5_inc_run - %s: State: %s -> %s\n", agmt_get_long_name(prp->agmt),state2name(current_state), state2name(next_state)); current_state = next_state; @@ -1249,7 +1249,7 @@ protocol_sleep(Private_Repl_Protocol *prp, PRIntervalTime duration) PR_WaitCondVar(prp->cvar, duration); else { - slapi_log_error(SLAPI_LOG_REPL, repl_plugin_name, + slapi_log_err(SLAPI_LOG_REPL, repl_plugin_name, "protocol_sleep - %s: Can't go to sleep: event bits - %x\n", agmt_get_long_name(prp->agmt), prp->eventbits); } @@ -1339,7 +1339,7 @@ replay_update(Private_Repl_Protocol *prp, slapi_operation_parameters *op, int *m if (create_NSDS50ReplUpdateInfoControl(op->target_address.uniqueid, parentuniqueid, op->csn, modrdn_mods, &update_control) != LDAP_SUCCESS) { - slapi_log_error(SLAPI_LOG_WARNING, repl_plugin_name, + slapi_log_err(SLAPI_LOG_WARNING, repl_plugin_name, "replay_update - %s: Unable to create NSDS50ReplUpdateInfoControl " "for operation with csn %s. Skipping update.\n", agmt_get_long_name(prp->agmt), csn_as_string(op->csn, PR_FALSE, csn_str)); @@ -1347,7 +1347,7 @@ replay_update(Private_Repl_Protocol *prp, slapi_operation_parameters *op, int *m else { if (slapi_is_loglevel_set(SLAPI_LOG_REPL)) { - slapi_log_error(SLAPI_LOG_REPL, repl_plugin_name, + slapi_log_err(SLAPI_LOG_REPL, repl_plugin_name, "replay_update - %s: Sending %s operation (dn=\"%s\" csn=%s)\n", agmt_get_long_name(prp->agmt), op2string(op->operation_type), REPL_GET_DN(&op->target_address), @@ -1365,7 +1365,7 @@ replay_update(Private_Repl_Protocol *prp, slapi_operation_parameters *op, int *m &entryattrs); if (NULL == entryattrs) { - slapi_log_error(SLAPI_LOG_ERR, repl_plugin_name, + slapi_log_err(SLAPI_LOG_ERR, repl_plugin_name, "replay_update - %s: Cannot convert entry to LDAPMods.\n", agmt_get_long_name(prp->agmt)); return_value = CONN_LOCAL_ERROR; @@ -1379,7 +1379,7 @@ replay_update(Private_Repl_Protocol *prp, slapi_operation_parameters *op, int *m } if (MODS_ARE_EMPTY(entryattrs)) { if (slapi_is_loglevel_set(SLAPI_LOG_REPL)) { - slapi_log_error(SLAPI_LOG_REPL, repl_plugin_name, + slapi_log_err(SLAPI_LOG_REPL, repl_plugin_name, "replay_update - %s: %s operation (dn=\"%s\" csn=%s) " "not sent - empty\n", agmt_get_long_name(prp->agmt), @@ -1404,7 +1404,7 @@ replay_update(Private_Repl_Protocol *prp, slapi_operation_parameters *op, int *m } if (MODS_ARE_EMPTY(op->p.p_modify.modify_mods)) { if (slapi_is_loglevel_set(SLAPI_LOG_REPL)) { - slapi_log_error(SLAPI_LOG_REPL, repl_plugin_name, + slapi_log_err(SLAPI_LOG_REPL, repl_plugin_name, "replay_update - %s: %s operation (dn=\"%s\" csn=%s) " "not sent - empty\n", agmt_get_long_name(prp->agmt), @@ -1431,7 +1431,7 @@ replay_update(Private_Repl_Protocol *prp, slapi_operation_parameters *op, int *m update_control, message_id); break; default: - slapi_log_error(SLAPI_LOG_WARNING, repl_plugin_name, "replay_update - %s: Unknown " + slapi_log_err(SLAPI_LOG_WARNING, repl_plugin_name, "replay_update - %s: Unknown " "operation type %lu found in changelog - skipping change.\n", agmt_get_long_name(prp->agmt), op->operation_type); } @@ -1442,7 +1442,7 @@ replay_update(Private_Repl_Protocol *prp, slapi_operation_parameters *op, int *m if (CONN_OPERATION_SUCCESS == return_value) { if (slapi_is_loglevel_set(SLAPI_LOG_REPL)) { - slapi_log_error(SLAPI_LOG_REPL, repl_plugin_name, + slapi_log_err(SLAPI_LOG_REPL, repl_plugin_name, "replay_update - %s: Consumer successfully sent operation with csn %s\n", agmt_get_long_name(prp->agmt), csn_as_string(op->csn, PR_FALSE, csn_str)); } @@ -1450,7 +1450,7 @@ replay_update(Private_Repl_Protocol *prp, slapi_operation_parameters *op, int *m else { if (slapi_is_loglevel_set(SLAPI_LOG_REPL)) { - slapi_log_error(SLAPI_LOG_REPL, repl_plugin_name, + slapi_log_err(SLAPI_LOG_REPL, repl_plugin_name, "replay_update - %s: Consumer could not replay operation with csn %s\n", agmt_get_long_name(prp->agmt), csn_as_string(op->csn, PR_FALSE, csn_str)); } @@ -1525,7 +1525,7 @@ repl5_inc_update_from_op_result(Private_Repl_Protocol *prp, ConnResult replay_cr { agmt_inc_last_update_changecount (prp->agmt, replica_id, 1 /*skipped*/); } - slapi_log_error(*finished ? SLAPI_LOG_WARNING : slapi_log_urp, + slapi_log_err(*finished ? SLAPI_LOG_WARNING : slapi_log_urp, repl_plugin_name, "repl5_inc_update_from_op_result - %s: Consumer failed to replay change (uniqueid %s, CSN %s): %s (%d). %s.\n", agmt_get_long_name(prp->agmt), @@ -1539,7 +1539,7 @@ repl5_inc_update_from_op_result(Private_Repl_Protocol *prp, ConnResult replay_cr return_value = UPDATE_CONNECTION_LOST; *finished = 1; - slapi_log_error(SLAPI_LOG_WARNING, repl_plugin_name, + slapi_log_err(SLAPI_LOG_WARNING, repl_plugin_name, "repl5_inc_update_from_op_result - %s: Consumer failed to replay change (uniqueid %s, CSN %s): " "%s(%d). Will retry later.\n", agmt_get_long_name(prp->agmt), @@ -1551,7 +1551,7 @@ repl5_inc_update_from_op_result(Private_Repl_Protocol *prp, ConnResult replay_cr { return_value = UPDATE_TIMEOUT; *finished = 1; - slapi_log_error(SLAPI_LOG_WARNING, repl_plugin_name, + slapi_log_err(SLAPI_LOG_WARNING, repl_plugin_name, "repl5_inc_update_from_op_result - %s: Consumer timed out to replay change (uniqueid %s, CSN %s): " "%s.\n", agmt_get_long_name(prp->agmt), @@ -1566,7 +1566,7 @@ repl5_inc_update_from_op_result(Private_Repl_Protocol *prp, ConnResult replay_cr */ return_value = UPDATE_TRANSIENT_ERROR; *finished = 1; - slapi_log_error(SLAPI_LOG_WARNING, repl_plugin_name, + slapi_log_err(SLAPI_LOG_WARNING, repl_plugin_name, "repl5_inc_update_from_op_result - %s: Failed to replay change (uniqueid %s, CSN %s): " "Local error. Will retry later.\n", agmt_get_long_name(prp->agmt), @@ -1624,7 +1624,7 @@ send_updates(Private_Repl_Protocol *prp, RUV *remote_update_vector, PRUint32 *nu switch (rc) { case CL5_BAD_DATA: /* invalid parameter passed to the function */ - slapi_log_error(SLAPI_LOG_ERR, repl_plugin_name, + slapi_log_err(SLAPI_LOG_ERR, repl_plugin_name, "send_updates - %s: Invalid parameter passed to cl5CreateReplayIterator\n", agmt_get_long_name(prp->agmt)); agmt_set_last_update_status(prp->agmt, 0, NSDS50_REPL_CL_ERROR, @@ -1632,7 +1632,7 @@ send_updates(Private_Repl_Protocol *prp, RUV *remote_update_vector, PRUint32 *nu return_value = UPDATE_FATAL_ERROR; break; case CL5_BAD_FORMAT: /* db data has unexpected format */ - slapi_log_error(SLAPI_LOG_ERR, repl_plugin_name, + slapi_log_err(SLAPI_LOG_ERR, repl_plugin_name, "send_updates - %s: Unexpected format encountered in changelog database\n", agmt_get_long_name(prp->agmt)); agmt_set_last_update_status(prp->agmt, 0, NSDS50_REPL_CL_ERROR, @@ -1640,7 +1640,7 @@ send_updates(Private_Repl_Protocol *prp, RUV *remote_update_vector, PRUint32 *nu return_value = UPDATE_FATAL_ERROR; break; case CL5_BAD_STATE: /* changelog is in an incorrect state for attempted operation */ - slapi_log_error(SLAPI_LOG_ERR, repl_plugin_name, + slapi_log_err(SLAPI_LOG_ERR, repl_plugin_name, "send_updates - %s: Changelog database was in an incorrect state\n", agmt_get_long_name(prp->agmt)); agmt_set_last_update_status(prp->agmt, 0, NSDS50_REPL_CL_ERROR, @@ -1648,7 +1648,7 @@ send_updates(Private_Repl_Protocol *prp, RUV *remote_update_vector, PRUint32 *nu return_value = UPDATE_FATAL_ERROR; break; case CL5_BAD_DBVERSION: /* changelog has invalid dbversion */ - slapi_log_error(SLAPI_LOG_ERR, repl_plugin_name, + slapi_log_err(SLAPI_LOG_ERR, repl_plugin_name, "send_updates - %s: Incorrect dbversion found in changelog database\n", agmt_get_long_name(prp->agmt)); agmt_set_last_update_status(prp->agmt, 0, NSDS50_REPL_CL_ERROR, @@ -1656,7 +1656,7 @@ send_updates(Private_Repl_Protocol *prp, RUV *remote_update_vector, PRUint32 *nu return_value = UPDATE_FATAL_ERROR; break; case CL5_DB_ERROR: /* database error */ - slapi_log_error(SLAPI_LOG_ERR, repl_plugin_name, + slapi_log_err(SLAPI_LOG_ERR, repl_plugin_name, "send_updates - %s: A changelog database error was encountered\n", agmt_get_long_name(prp->agmt)); agmt_set_last_update_status(prp->agmt, 0, NSDS50_REPL_CL_ERROR, @@ -1664,13 +1664,13 @@ send_updates(Private_Repl_Protocol *prp, RUV *remote_update_vector, PRUint32 *nu return_value = UPDATE_FATAL_ERROR; break; case CL5_NOTFOUND: /* we have no changes to send */ - slapi_log_error(SLAPI_LOG_REPL, repl_plugin_name, + slapi_log_err(SLAPI_LOG_REPL, repl_plugin_name, "send_updates - %s: No changes to send\n", agmt_get_long_name(prp->agmt)); return_value = UPDATE_NO_MORE_UPDATES; break; case CL5_MEMORY_ERROR: /* memory allocation failed */ - slapi_log_error(SLAPI_LOG_ERR, repl_plugin_name, + slapi_log_err(SLAPI_LOG_ERR, repl_plugin_name, "send_updates - %s: Memory allocation error occurred\n", agmt_get_long_name(prp->agmt)); agmt_set_last_update_status(prp->agmt, 0, NSDS50_REPL_CL_ERROR, @@ -1678,31 +1678,31 @@ send_updates(Private_Repl_Protocol *prp, RUV *remote_update_vector, PRUint32 *nu return_value = UPDATE_FATAL_ERROR; break; case CL5_SYSTEM_ERROR: /* NSPR error occurred: use PR_GetError for further info */ - slapi_log_error(SLAPI_LOG_ERR, repl_plugin_name, + slapi_log_err(SLAPI_LOG_ERR, repl_plugin_name, "send_updates - %s: An NSPR error (%d) occurred\n", agmt_get_long_name(prp->agmt), PR_GetError()); return_value = UPDATE_TRANSIENT_ERROR; break; case CL5_CSN_ERROR: /* CSN API failed */ - slapi_log_error(SLAPI_LOG_ERR, repl_plugin_name, + slapi_log_err(SLAPI_LOG_ERR, repl_plugin_name, "send_updates - %s: A CSN API failure was encountered\n", agmt_get_long_name(prp->agmt)); return_value = UPDATE_TRANSIENT_ERROR; break; case CL5_RUV_ERROR: /* RUV API failed */ - slapi_log_error(SLAPI_LOG_ERR, repl_plugin_name, + slapi_log_err(SLAPI_LOG_ERR, repl_plugin_name, "send_updates - %s: An RUV API failure occurred\n", agmt_get_long_name(prp->agmt)); return_value = UPDATE_TRANSIENT_ERROR; break; case CL5_OBJSET_ERROR: /* namedobjset api failed */ - slapi_log_error(SLAPI_LOG_ERR, repl_plugin_name, + slapi_log_err(SLAPI_LOG_ERR, repl_plugin_name, "send_updates - %s: A namedobject API failure occurred\n", agmt_get_long_name(prp->agmt)); return_value = UPDATE_TRANSIENT_ERROR; break; case CL5_PURGED_DATA: /* requested data has been purged */ - slapi_log_error(SLAPI_LOG_ERR, repl_plugin_name, + slapi_log_err(SLAPI_LOG_ERR, repl_plugin_name, "send_updates - %s: Data required to update replica has been purged from the changelog. " "The replica must be reinitialized.\n", agmt_get_long_name(prp->agmt)); @@ -1712,7 +1712,7 @@ send_updates(Private_Repl_Protocol *prp, RUV *remote_update_vector, PRUint32 *nu return_value = UPDATE_FATAL_ERROR; break; case CL5_MISSING_DATA: /* data should be in the changelog, but is missing */ - slapi_log_error(SLAPI_LOG_ERR, repl_plugin_name, + slapi_log_err(SLAPI_LOG_ERR, repl_plugin_name, "send_updates - %s: Missing data encountered\n", agmt_get_long_name(prp->agmt)); agmt_set_last_update_status(prp->agmt, 0, NSDS50_REPL_CL_ERROR, @@ -1720,13 +1720,13 @@ send_updates(Private_Repl_Protocol *prp, RUV *remote_update_vector, PRUint32 *nu return_value = UPDATE_FATAL_ERROR; break; case CL5_UNKNOWN_ERROR: /* unclassified error */ - slapi_log_error(SLAPI_LOG_ERR, repl_plugin_name, + slapi_log_err(SLAPI_LOG_ERR, repl_plugin_name, "send_updates - %s: An unknown error was encountered\n", agmt_get_long_name(prp->agmt)); return_value = UPDATE_TRANSIENT_ERROR; break; default: - slapi_log_error(SLAPI_LOG_ERR, repl_plugin_name, + slapi_log_err(SLAPI_LOG_ERR, repl_plugin_name, "send_updates - %s: An unknown error (%d) occurred " "(cl5CreateReplayIterator)\n", agmt_get_long_name(prp->agmt), rc); @@ -1751,7 +1751,7 @@ send_updates(Private_Repl_Protocol *prp, RUV *remote_update_vector, PRUint32 *nu { rc = repl5_inc_create_async_result_thread(rd); if (rc) { - slapi_log_error(SLAPI_LOG_ERR, repl_plugin_name, "send_updates - %s: " + slapi_log_err(SLAPI_LOG_ERR, repl_plugin_name, "send_updates - %s: " "repl5_inc_create_async_result_thread failed; error - %d\n", agmt_get_long_name(prp->agmt), rc); agmt_set_last_update_status(prp->agmt, 0, rc, "Failed to create result thread"); @@ -1772,7 +1772,7 @@ send_updates(Private_Repl_Protocol *prp, RUV *remote_update_vector, PRUint32 *nu /* check that we don't return dummy entries */ if (is_dummy_operation (entry.op)) { - slapi_log_error(SLAPI_LOG_REPL, repl_plugin_name, + slapi_log_err(SLAPI_LOG_REPL, repl_plugin_name, "send_updates - %s: changelog iteration code returned a dummy entry with csn %s, " "skipping ...\n", agmt_get_long_name(prp->agmt), csn_as_string(entry.op->csn, PR_FALSE, csn_str)); @@ -1802,7 +1802,7 @@ send_updates(Private_Repl_Protocol *prp, RUV *remote_update_vector, PRUint32 *nu { agmt_inc_last_update_changecount (prp->agmt, csn_get_replicaid(entry.op->csn), 1 /*skipped*/); } - slapi_log_error(finished ? SLAPI_LOG_WARNING : slapi_log_urp, + slapi_log_err(finished ? SLAPI_LOG_WARNING : slapi_log_urp, "send_updates - %s: Failed to send update operation to consumer (uniqueid %s, CSN %s): %s. %s.\n", (char *)agmt_get_long_name(prp->agmt), entry.op->target_address.uniqueid, csn_str, @@ -1815,7 +1815,7 @@ send_updates(Private_Repl_Protocol *prp, RUV *remote_update_vector, PRUint32 *nu return_value = UPDATE_CONNECTION_LOST; finished = 1; - slapi_log_error(SLAPI_LOG_WARNING, repl_plugin_name, + slapi_log_err(SLAPI_LOG_WARNING, repl_plugin_name, "send_updates - %s: Failed to send update operation to consumer (uniqueid %s, CSN %s): " "%s. Will retry later.\n", agmt_get_long_name(prp->agmt), @@ -1826,7 +1826,7 @@ send_updates(Private_Repl_Protocol *prp, RUV *remote_update_vector, PRUint32 *nu { return_value = UPDATE_TIMEOUT; finished = 1; - slapi_log_error(SLAPI_LOG_WARNING, repl_plugin_name, + slapi_log_err(SLAPI_LOG_WARNING, repl_plugin_name, "send_updates - %s: Timed out sending update operation to consumer (uniqueid %s, CSN %s): " "%s.\n", agmt_get_long_name(prp->agmt), @@ -1841,7 +1841,7 @@ send_updates(Private_Repl_Protocol *prp, RUV *remote_update_vector, PRUint32 *nu */ return_value = UPDATE_TRANSIENT_ERROR; finished = 1; - slapi_log_error(SLAPI_LOG_WARNING, repl_plugin_name, + slapi_log_err(SLAPI_LOG_WARNING, repl_plugin_name, "send_updates - %s: Failed to send update operation to consumer (uniqueid %s, CSN %s): " "Local error. Will retry later.\n", agmt_get_long_name(prp->agmt), @@ -1891,7 +1891,7 @@ send_updates(Private_Repl_Protocol *prp, RUV *remote_update_vector, PRUint32 *nu repl5_int_push_operation(rd,sop); repl5_inc_flow_control_results(prp->agmt, rd); } else { - slapi_log_error(SLAPI_LOG_REPL, repl_plugin_name, + slapi_log_err(SLAPI_LOG_REPL, repl_plugin_name, "send_updates - %s: Skipping update operation with no message_id (uniqueid %s, CSN %s):\n", agmt_get_long_name(prp->agmt), entry.op->target_address.uniqueid, csn_str); @@ -1900,7 +1900,7 @@ send_updates(Private_Repl_Protocol *prp, RUV *remote_update_vector, PRUint32 *nu { skipped_updates++; if (skipped_updates > FRACTIONAL_SKIPPED_THRESHOLD) { - slapi_log_error(SLAPI_LOG_REPL, repl_plugin_name, + slapi_log_err(SLAPI_LOG_REPL, repl_plugin_name, "send_updates - %s: skipped updates is too high (%d) if no other update is sent we will update the subentry\n", agmt_get_long_name(prp->agmt), skipped_updates); subentry_update_needed = PR_TRUE; @@ -1910,7 +1910,7 @@ send_updates(Private_Repl_Protocol *prp, RUV *remote_update_vector, PRUint32 *nu } break; case CL5_BAD_DATA: - slapi_log_error(SLAPI_LOG_ERR, repl_plugin_name, + slapi_log_err(SLAPI_LOG_ERR, repl_plugin_name, "send_updates - %s: Invalid parameter passed to cl5GetNextOperationToReplay\n", agmt_get_long_name(prp->agmt)); agmt_set_last_update_status(prp->agmt, 0, NSDS50_REPL_CL_ERROR, @@ -1919,14 +1919,14 @@ send_updates(Private_Repl_Protocol *prp, RUV *remote_update_vector, PRUint32 *nu finished = 1; break; case CL5_NOTFOUND: - slapi_log_error(SLAPI_LOG_REPL, repl_plugin_name, + slapi_log_err(SLAPI_LOG_REPL, repl_plugin_name, "send_updates - %s: No more updates to send (cl5GetNextOperationToReplay)\n", agmt_get_long_name(prp->agmt)); return_value = UPDATE_NO_MORE_UPDATES; finished = 1; break; case CL5_DB_ERROR: - slapi_log_error(SLAPI_LOG_ERR, repl_plugin_name, + slapi_log_err(SLAPI_LOG_ERR, repl_plugin_name, "send_updates - %s: A database error occurred (cl5GetNextOperationToReplay)\n", agmt_get_long_name(prp->agmt)); agmt_set_last_update_status(prp->agmt, 0, NSDS50_REPL_CL_ERROR, @@ -1935,12 +1935,12 @@ send_updates(Private_Repl_Protocol *prp, RUV *remote_update_vector, PRUint32 *nu finished = 1; break; case CL5_BAD_FORMAT: - slapi_log_error(SLAPI_LOG_WARNING, repl_plugin_name, + slapi_log_err(SLAPI_LOG_WARNING, repl_plugin_name, "send_updates - %s: A malformed changelog entry was encountered (cl5GetNextOperationToReplay)\n", agmt_get_long_name(prp->agmt)); break; case CL5_MEMORY_ERROR: - slapi_log_error(SLAPI_LOG_ERR, repl_plugin_name, + slapi_log_err(SLAPI_LOG_ERR, repl_plugin_name, "send_updates - %s: A memory allocation error occurred (cl5GetNextOperationToReplay)\n", agmt_get_long_name(prp->agmt)); agmt_set_last_update_status(prp->agmt, 0, NSDS50_REPL_CL_ERROR, @@ -1950,7 +1950,7 @@ send_updates(Private_Repl_Protocol *prp, RUV *remote_update_vector, PRUint32 *nu case CL5_IGNORE_OP: break; default: - slapi_log_error(SLAPI_LOG_ERR, repl_plugin_name, + slapi_log_err(SLAPI_LOG_ERR, repl_plugin_name, "send_updates - %s: Unknown error code (%d) returned from cl5GetNextOperationToReplay\n", agmt_get_long_name(prp->agmt), rc); return_value = UPDATE_TRANSIENT_ERROR; @@ -1976,7 +1976,7 @@ send_updates(Private_Repl_Protocol *prp, RUV *remote_update_vector, PRUint32 *nu rd->result = UPDATE_YIELD; return_value = UPDATE_YIELD; finished = 1; - slapi_log_error(SLAPI_LOG_REPL, repl_plugin_name, + slapi_log_err(SLAPI_LOG_REPL, repl_plugin_name, "send_updates - Aborting send_updates...(%s)\n", agmt_get_long_name(rd->prp->agmt)); } @@ -1999,12 +1999,12 @@ send_updates(Private_Repl_Protocol *prp, RUV *remote_update_vector, PRUint32 *nu { rid = replica_get_rid(replica); } - slapi_log_error(SLAPI_LOG_REPL, repl_plugin_name, + slapi_log_err(SLAPI_LOG_REPL, repl_plugin_name, "send_updates - %s: skipped updates was definitely too high (%d) update the subentry now\n", agmt_get_long_name(prp->agmt), skipped_updates); replarea_sdn = agmt_get_replarea(prp->agmt); if (!replarea_sdn) { - slapi_log_error(SLAPI_LOG_ERR, repl_plugin_name, + slapi_log_err(SLAPI_LOG_ERR, repl_plugin_name, "send_updates - Unknown replication area due to agreement not found."); agmt_set_last_update_status(prp->agmt, 0, -1, "Agreement is corrupted: missing suffix"); return_value = UPDATE_FATAL_ERROR; @@ -2038,7 +2038,7 @@ send_updates(Private_Repl_Protocol *prp, RUV *remote_update_vector, PRUint32 *nu rc = repl5_inc_destroy_async_result_thread(rd); if (rc) { - slapi_log_error(SLAPI_LOG_ERR, repl_plugin_name, "%s: repl5_inc_run: " + slapi_log_err(SLAPI_LOG_ERR, repl_plugin_name, "%s: repl5_inc_run: " "send_updates - repl5_inc_destroy_async_result_thread failed; error - %d\n", agmt_get_long_name(prp->agmt), rc); } @@ -2046,7 +2046,7 @@ send_updates(Private_Repl_Protocol *prp, RUV *remote_update_vector, PRUint32 *nu } PR_Lock(rd->lock); if (rd->flowcontrol_detection) { - slapi_log_error(SLAPI_LOG_REPL, repl_plugin_name, + slapi_log_err(SLAPI_LOG_REPL, repl_plugin_name, "send_updates - %s: Incremental update flow control triggered %d times\n" "You may increase %s and/or decrease %s in the replica agreement configuration\n", agmt_get_long_name(prp->agmt), @@ -2101,21 +2101,21 @@ repl5_inc_stop(Private_Repl_Protocol *prp) { /* Isn't listening. Do something drastic. */ return_value = -1; - slapi_log_error(SLAPI_LOG_REPL, repl_plugin_name, + slapi_log_err(SLAPI_LOG_REPL, repl_plugin_name, "repl5_inc_stop - %s: Protocol does not stop after %" NSPRIu64 " seconds\n", agmt_get_long_name(prp->agmt), timeout); } else { return_value = 0; - slapi_log_error(SLAPI_LOG_REPL, repl_plugin_name, + slapi_log_err(SLAPI_LOG_REPL, repl_plugin_name, "repl5_inc_stop - %s: Protocol stopped after %d seconds\n", agmt_get_long_name(prp->agmt), PR_IntervalToSeconds(now-start)); } if (slapi_is_loglevel_set(SLAPI_LOG_REPL)) { if (NULL == prp->replica_object) { - slapi_log_error(SLAPI_LOG_REPL, repl_plugin_name, + slapi_log_err(SLAPI_LOG_REPL, repl_plugin_name, "repl5_inc_stop - %s: Protocol replica_object is NULL\n", agmt_get_long_name(prp->agmt)); } else { @@ -2123,13 +2123,13 @@ repl5_inc_stop(Private_Repl_Protocol *prp) object_acquire(prp->replica_object); replica = object_get_data(prp->replica_object); if (NULL == replica) { - slapi_log_error(SLAPI_LOG_REPL, repl_plugin_name, + slapi_log_err(SLAPI_LOG_REPL, repl_plugin_name, "repl5_inc_stop - %s:replica is NULL\n", agmt_get_long_name(prp->agmt)); } else { Object *ruv_obj = replica_get_ruv(replica); if (NULL == ruv_obj) { - slapi_log_error(SLAPI_LOG_REPL, repl_plugin_name, + slapi_log_err(SLAPI_LOG_REPL, repl_plugin_name, "repl5_inc_stop - %s: rruv_obj is NULL\n", agmt_get_long_name(prp->agmt)); } else { @@ -2137,7 +2137,7 @@ repl5_inc_stop(Private_Repl_Protocol *prp) object_acquire(ruv_obj); ruv = (RUV*)object_get_data (ruv_obj); if (NULL == ruv) { - slapi_log_error(SLAPI_LOG_REPL, repl_plugin_name, + slapi_log_err(SLAPI_LOG_REPL, repl_plugin_name, "repl5_inc_stop - %s: ruv is NULL\n", agmt_get_long_name(prp->agmt)); diff --git a/ldap/servers/plugins/replication/repl5_init.c b/ldap/servers/plugins/replication/repl5_init.c index ed80bf1..a9aa519 100644 --- a/ldap/servers/plugins/replication/repl5_init.c +++ b/ldap/servers/plugins/replication/repl5_init.c @@ -224,7 +224,7 @@ multimaster_preop_init( Slapi_PBlock *pb ) slapi_pblock_set( pb, SLAPI_PLUGIN_PRE_COMPARE_FN, (void *) multimaster_preop_compare ) != 0 || slapi_pblock_set( pb, SLAPI_PLUGIN_PRE_ENTRY_FN, (void *) multimaster_ruv_search ) != 0) { - slapi_log_error(SLAPI_LOG_PLUGIN, repl_plugin_name, "multimaster_preop_init - Failed\n" ); + slapi_log_err(SLAPI_LOG_PLUGIN, repl_plugin_name, "multimaster_preop_init - Failed\n" ); rc= -1; } return rc; @@ -245,7 +245,7 @@ multimaster_postop_init( Slapi_PBlock *pb ) slapi_pblock_set( pb, SLAPI_PLUGIN_POST_MODIFY_FN, (void *) multimaster_postop_modify ) != 0 || slapi_pblock_set( pb, SLAPI_PLUGIN_POST_MODRDN_FN, (void *) multimaster_postop_modrdn ) != 0 ) { - slapi_log_error(SLAPI_LOG_PLUGIN, repl_plugin_name, "multimaster_postop_init - Failed\n" ); + slapi_log_err(SLAPI_LOG_PLUGIN, repl_plugin_name, "multimaster_postop_init - Failed\n" ); rc= -1; } @@ -264,7 +264,7 @@ multimaster_internalpreop_init( Slapi_PBlock *pb ) slapi_pblock_set( pb, SLAPI_PLUGIN_INTERNAL_PRE_MODIFY_FN, (void *) multimaster_preop_modify ) != 0 || slapi_pblock_set( pb, SLAPI_PLUGIN_INTERNAL_PRE_MODRDN_FN, (void *) multimaster_preop_modrdn ) != 0 ) { - slapi_log_error(SLAPI_LOG_PLUGIN, repl_plugin_name, "multimaster_internalpreop_init - Failed\n" ); + slapi_log_err(SLAPI_LOG_PLUGIN, repl_plugin_name, "multimaster_internalpreop_init - Failed\n" ); rc= -1; } return rc; @@ -282,7 +282,7 @@ multimaster_internalpostop_init( Slapi_PBlock *pb ) slapi_pblock_set( pb, SLAPI_PLUGIN_INTERNAL_POST_MODIFY_FN, (void *) multimaster_postop_modify ) != 0 || slapi_pblock_set( pb, SLAPI_PLUGIN_INTERNAL_POST_MODRDN_FN, (void *) multimaster_postop_modrdn ) != 0 ) { - slapi_log_error(SLAPI_LOG_PLUGIN, repl_plugin_name, "multimaster_internalpostop_init - Failed\n" ); + slapi_log_err(SLAPI_LOG_PLUGIN, repl_plugin_name, "multimaster_internalpostop_init - Failed\n" ); rc= -1; } @@ -307,7 +307,7 @@ multimaster_bepreop_init( Slapi_PBlock *pb ) slapi_pblock_set( pb, SLAPI_PLUGIN_BE_PRE_CLOSE_FN, (void *) cl5Close ) != 0 || slapi_pblock_set( pb, SLAPI_PLUGIN_BE_PRE_BACKUP_FN, (void *) cl5WriteRUV ) != 0 ) { - slapi_log_error(SLAPI_LOG_PLUGIN, repl_plugin_name, "multimaster_bepreop_init - Failed\n" ); + slapi_log_err(SLAPI_LOG_PLUGIN, repl_plugin_name, "multimaster_bepreop_init - Failed\n" ); rc= -1; } @@ -342,7 +342,7 @@ multimaster_bepostop_init( Slapi_PBlock *pb ) slapi_pblock_set( pb, SLAPI_PLUGIN_BE_POST_OPEN_FN, (void *) changelog5_init ) != 0 || slapi_pblock_set( pb, SLAPI_PLUGIN_BE_POST_BACKUP_FN, (void *) cl5DeleteRUV ) != 0 ) { - slapi_log_error(SLAPI_LOG_PLUGIN, repl_plugin_name, "multimaster_bepostop_init - Failed\n" ); + slapi_log_err(SLAPI_LOG_PLUGIN, repl_plugin_name, "multimaster_bepostop_init - Failed\n" ); rc= -1; } @@ -364,7 +364,7 @@ multimaster_betxn_bepostop_init( Slapi_PBlock *pb ) slapi_pblock_set( pb, SLAPI_PLUGIN_BE_POST_OPEN_FN, (void *) changelog5_init ) || slapi_pblock_set( pb, SLAPI_PLUGIN_BE_POST_BACKUP_FN, (void *) cl5DeleteRUV ) ) { - slapi_log_error(SLAPI_LOG_PLUGIN, repl_plugin_name, "multimaster_betxn_bepostop_init - Failed\n" ); + slapi_log_err(SLAPI_LOG_PLUGIN, repl_plugin_name, "multimaster_betxn_bepostop_init - Failed\n" ); rc= -1; } @@ -399,7 +399,7 @@ multimaster_betxnpostop_init( Slapi_PBlock *pb ) slapi_pblock_set(pb, SLAPI_PLUGIN_BE_TXN_POST_DELETE_FN, del_fn) || slapi_pblock_set(pb, SLAPI_PLUGIN_BE_TXN_POST_MODRDN_FN, mdn_fn) || slapi_pblock_set(pb, SLAPI_PLUGIN_BE_TXN_POST_MODIFY_FN, mod_fn)) { - slapi_log_error(SLAPI_LOG_PLUGIN, repl_plugin_name, + slapi_log_err(SLAPI_LOG_PLUGIN, repl_plugin_name, "multimaster_betxnpostop_init - Failed\n"); rc = -1; } @@ -418,7 +418,7 @@ multimaster_start_extop_init( Slapi_PBlock *pb ) slapi_pblock_set( pb, SLAPI_PLUGIN_EXT_OP_NAMELIST, (void *)start_name_list ) != 0 || slapi_pblock_set( pb, SLAPI_PLUGIN_EXT_OP_FN, (void *)multimaster_extop_StartNSDS50ReplicationRequest )) { - slapi_log_error(SLAPI_LOG_PLUGIN, repl_plugin_name, "multimaster_start_extop_init - (StartNSDS50ReplicationRequest) failed\n" ); + slapi_log_err(SLAPI_LOG_PLUGIN, repl_plugin_name, "multimaster_start_extop_init - (StartNSDS50ReplicationRequest) failed\n" ); rc= -1; } @@ -439,7 +439,7 @@ multimaster_end_extop_init( Slapi_PBlock *pb ) slapi_pblock_set( pb, SLAPI_PLUGIN_EXT_OP_NAMELIST, (void *)end_name_list ) != 0 || slapi_pblock_set( pb, SLAPI_PLUGIN_EXT_OP_FN, (void *)multimaster_extop_EndNSDS50ReplicationRequest )) { - slapi_log_error(SLAPI_LOG_PLUGIN, repl_plugin_name, "multimaster_end_extop_init - (EndNSDS50ReplicationRequest) failed\n" ); + slapi_log_err(SLAPI_LOG_PLUGIN, repl_plugin_name, "multimaster_end_extop_init - (EndNSDS50ReplicationRequest) failed\n" ); rc= -1; } @@ -462,7 +462,7 @@ multimaster_cleanruv_maxcsn_extop_init( Slapi_PBlock *pb ) slapi_pblock_set( pb, SLAPI_PLUGIN_EXT_OP_NAMELIST, (void *)cleanruv_maxcsn_name_list ) != 0 || slapi_pblock_set( pb, SLAPI_PLUGIN_EXT_OP_FN, (void *)multimaster_extop_cleanruv_get_maxcsn )) { - slapi_log_error(SLAPI_LOG_PLUGIN, repl_plugin_name, "multimaster_cleanruv_maxcsn_extop_init - Failed\n" ); + slapi_log_err(SLAPI_LOG_PLUGIN, repl_plugin_name, "multimaster_cleanruv_maxcsn_extop_init - Failed\n" ); rc= -1; } @@ -485,7 +485,7 @@ multimaster_cleanruv_status_extop_init( Slapi_PBlock *pb ) slapi_pblock_set( pb, SLAPI_PLUGIN_EXT_OP_NAMELIST, (void *)cleanruv_status_name_list ) != 0 || slapi_pblock_set( pb, SLAPI_PLUGIN_EXT_OP_FN, (void *)multimaster_extop_cleanruv_check_status )) { - slapi_log_error(SLAPI_LOG_PLUGIN, repl_plugin_name, "multimaster_cleanruv_status_extop_init - Failed\n" ); + slapi_log_err(SLAPI_LOG_PLUGIN, repl_plugin_name, "multimaster_cleanruv_status_extop_init - Failed\n" ); rc= -1; } @@ -509,7 +509,7 @@ multimaster_total_extop_init( Slapi_PBlock *pb ) slapi_pblock_set( pb, SLAPI_PLUGIN_EXT_OP_NAMELIST, (void *)total_name_list ) != 0 || slapi_pblock_set( pb, SLAPI_PLUGIN_EXT_OP_FN, (void *)multimaster_extop_NSDS50ReplicationEntry )) { - slapi_log_error(SLAPI_LOG_PLUGIN, repl_plugin_name, "multimaster_total_extop_init - (NSDS50ReplicationEntry failed\n" ); + slapi_log_err(SLAPI_LOG_PLUGIN, repl_plugin_name, "multimaster_total_extop_init - (NSDS50ReplicationEntry failed\n" ); rc= -1; } @@ -532,7 +532,7 @@ multimaster_response_extop_init( Slapi_PBlock *pb ) slapi_pblock_set( pb, SLAPI_PLUGIN_EXT_OP_NAMELIST, (void *)response_name_list ) != 0 || slapi_pblock_set( pb, SLAPI_PLUGIN_EXT_OP_FN, (void *)extop_noop )) { - slapi_log_error(SLAPI_LOG_PLUGIN, repl_plugin_name, "multimaster_response_extop_init - (NSDS50ReplicationResponse failed\n" ); + slapi_log_err(SLAPI_LOG_PLUGIN, repl_plugin_name, "multimaster_response_extop_init - (NSDS50ReplicationResponse failed\n" ); rc= -1; } @@ -555,7 +555,7 @@ multimaster_cleanruv_extop_init( Slapi_PBlock *pb ) slapi_pblock_set( pb, SLAPI_PLUGIN_EXT_OP_NAMELIST, (void *)cleanruv_name_list ) != 0 || slapi_pblock_set( pb, SLAPI_PLUGIN_EXT_OP_FN, (void *)multimaster_extop_cleanruv )) { - slapi_log_error(SLAPI_LOG_PLUGIN, repl_plugin_name, "multimaster_cleanruv_extop_init - Failed\n" ); + slapi_log_err(SLAPI_LOG_PLUGIN, repl_plugin_name, "multimaster_cleanruv_extop_init - Failed\n" ); rc= -1; } @@ -578,7 +578,7 @@ multimaster_cleanruv_abort_extop_init( Slapi_PBlock *pb ) slapi_pblock_set( pb, SLAPI_PLUGIN_EXT_OP_NAMELIST, (void *)cleanruv_abort_name_list ) != 0 || slapi_pblock_set( pb, SLAPI_PLUGIN_EXT_OP_FN, (void *)multimaster_extop_abort_cleanruv )) { - slapi_log_error(SLAPI_LOG_PLUGIN, repl_plugin_name, "multimaster_cleanruv_abort_extop_init - Failed\n" ); + slapi_log_err(SLAPI_LOG_PLUGIN, repl_plugin_name, "multimaster_cleanruv_abort_extop_init - Failed\n" ); rc= -1; } @@ -633,7 +633,7 @@ create_repl_schema_policy(void) slapi_add_internal_pb(pb); slapi_pblock_get(pb, SLAPI_PLUGIN_INTOP_RESULT, &return_value); if (return_value != LDAP_SUCCESS && return_value != LDAP_ALREADY_EXISTS) { - slapi_log_error(SLAPI_LOG_ERR, repl_plugin_name, "create_repl_schema_policy - " + slapi_log_err(SLAPI_LOG_ERR, repl_plugin_name, "create_repl_schema_policy - " "Unable to create configuration entry %s: %s\n", repl_schema_top, ldap_err2string(return_value)); rc = -1; @@ -653,7 +653,7 @@ create_repl_schema_policy(void) slapi_add_internal_pb(pb); slapi_pblock_get(pb, SLAPI_PLUGIN_INTOP_RESULT, &return_value); if (return_value != LDAP_SUCCESS && return_value != LDAP_ALREADY_EXISTS) { - slapi_log_error(SLAPI_LOG_ERR, repl_plugin_name, "create_repl_schema_policy - Unable to " + slapi_log_err(SLAPI_LOG_ERR, repl_plugin_name, "create_repl_schema_policy - Unable to " "create configuration entry %s: %s\n", repl_schema_supplier, ldap_err2string(return_value)); rc = -1; @@ -673,7 +673,7 @@ create_repl_schema_policy(void) slapi_add_internal_pb(pb); slapi_pblock_get(pb, SLAPI_PLUGIN_INTOP_RESULT, &return_value); if (return_value != LDAP_SUCCESS && return_value != LDAP_ALREADY_EXISTS) { - slapi_log_error(SLAPI_LOG_ERR, repl_plugin_name, "create_repl_schema_policy - " + slapi_log_err(SLAPI_LOG_ERR, repl_plugin_name, "create_repl_schema_policy - " "Unable to create configuration entry %s: %s\n", repl_schema_consumer, ldap_err2string(return_value)); rc = -1; @@ -685,7 +685,7 @@ create_repl_schema_policy(void) /* Load the policies of the schema replication */ if (slapi_schema_load_repl_policies()) { - slapi_log_error(SLAPI_LOG_ERR, repl_plugin_name, "create_repl_schema_policy - " + slapi_log_err(SLAPI_LOG_ERR, repl_plugin_name, "create_repl_schema_policy - " "Unable to load the schema replication policies\n"); rc = -1; goto done; diff --git a/ldap/servers/plugins/replication/repl5_mtnode_ext.c b/ldap/servers/plugins/replication/repl5_mtnode_ext.c index c5f8aaf..8d0c514 100644 --- a/ldap/servers/plugins/replication/repl5_mtnode_ext.c +++ b/ldap/servers/plugins/replication/repl5_mtnode_ext.c @@ -62,7 +62,7 @@ multimaster_mtnode_construct_replicas () mtnode = slapi_get_mapping_tree_node_by_dn(root); if (mtnode == NULL) { - slapi_log_error(SLAPI_LOG_REPL, repl_plugin_name, + slapi_log_err(SLAPI_LOG_REPL, repl_plugin_name, "multimaster_mtnode_construct_replicas: " "failed to locate mapping tree node for %s\n", slapi_sdn_get_dn (root)); @@ -72,7 +72,7 @@ multimaster_mtnode_construct_replicas () ext = (multimaster_mtnode_extension *)repl_con_get_ext (REPL_CON_EXT_MTNODE, mtnode); if (ext == NULL) { - slapi_log_error(SLAPI_LOG_REPL, repl_plugin_name, "multimaster_mtnode_construct_replicas: " + slapi_log_err(SLAPI_LOG_REPL, repl_plugin_name, "multimaster_mtnode_construct_replicas: " "failed to locate replication extension of mapping tree node for %s\n", slapi_sdn_get_dn (root)); continue; @@ -147,7 +147,7 @@ replica_get_replica_from_dn (const Slapi_DN *dn) mtnode = slapi_get_mapping_tree_node_by_dn(dn); if (mtnode == NULL) { - slapi_log_error(SLAPI_LOG_REPL, repl_plugin_name, "replica_get_replica_from_dn: " + slapi_log_err(SLAPI_LOG_REPL, repl_plugin_name, "replica_get_replica_from_dn: " "failed to locate mapping tree node for %s\n", slapi_sdn_get_dn (dn)); return NULL; @@ -156,7 +156,7 @@ replica_get_replica_from_dn (const Slapi_DN *dn) ext = (multimaster_mtnode_extension *)repl_con_get_ext (REPL_CON_EXT_MTNODE, mtnode); if (ext == NULL) { - slapi_log_error(SLAPI_LOG_REPL, repl_plugin_name, "replica_get_replica_from_dn: " + slapi_log_err(SLAPI_LOG_REPL, repl_plugin_name, "replica_get_replica_from_dn: " "failed to locate replication extension of mapping tree node for %s\n", slapi_sdn_get_dn (dn)); return NULL; diff --git a/ldap/servers/plugins/replication/repl5_plugins.c b/ldap/servers/plugins/replication/repl5_plugins.c index f6cade1..70e003b 100644 --- a/ldap/servers/plugins/replication/repl5_plugins.c +++ b/ldap/servers/plugins/replication/repl5_plugins.c @@ -79,7 +79,7 @@ multimaster_set_local_purl() slapi_pblock_get(pb, SLAPI_PLUGIN_INTOP_RESULT, &rc); if (rc != 0) { - slapi_log_error(SLAPI_LOG_ERR, repl_plugin_name, "multimaster_set_local_purl - " + slapi_log_err(SLAPI_LOG_ERR, repl_plugin_name, "multimaster_set_local_purl - " "unable to read server configuration: error %d\n", rc); } else @@ -87,7 +87,7 @@ multimaster_set_local_purl() slapi_pblock_get(pb, SLAPI_PLUGIN_INTOP_SEARCH_ENTRIES, &entries); if (NULL == entries || NULL == entries[0]) { - slapi_log_error(SLAPI_LOG_ERR, repl_plugin_name, "multimaster_set_local_purl - " + slapi_log_err(SLAPI_LOG_ERR, repl_plugin_name, "multimaster_set_local_purl - " "Server configuration missing\n"); rc = -1; } @@ -98,7 +98,7 @@ multimaster_set_local_purl() char *sslport = slapi_entry_attr_get_charptr(entries[0], "nsslapd-secureport"); if (host == NULL || ((port == NULL && sslport == NULL))) { - slapi_log_error(SLAPI_LOG_WARNING, repl_plugin_name, + slapi_log_err(SLAPI_LOG_WARNING, repl_plugin_name, "multimaster_set_local_purl - Invalid server " "configuration\n"); } @@ -189,7 +189,7 @@ multimaster_preop_add (Slapi_PBlock *pb) int drc = decode_NSDS50ReplUpdateInfoControl(ctrlp, &target_uuid, &superior_uuid, &csn, NULL /* modrdn_mods */); if (-1 == drc) { - slapi_log_error(SLAPI_LOG_ERR, REPLICATION_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_ERR, REPLICATION_SUBSYSTEM, "multimaster_preop_add - %s An error occurred while decoding the replication update " "control - Add\n", sessionid); } @@ -240,7 +240,7 @@ multimaster_preop_add (Slapi_PBlock *pb) { if(strcasecmp(entry_uuid,target_uuid)!=0) { - slapi_log_error(SLAPI_LOG_WARNING, REPLICATION_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_WARNING, REPLICATION_SUBSYSTEM, "multimaster_preop_add - %s Replicated Add received with Control_UUID=%s and Entry_UUID=%s.\n", sessionid, target_uuid,entry_uuid); } @@ -318,7 +318,7 @@ multimaster_preop_delete (Slapi_PBlock *pb) int drc = decode_NSDS50ReplUpdateInfoControl(ctrlp, &target_uuid, NULL, &csn, NULL /* modrdn_mods */); if (-1 == drc) { - slapi_log_error(SLAPI_LOG_ERR, REPLICATION_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_ERR, REPLICATION_SUBSYSTEM, "multimaster_preop_delete - %s An error occurred while decoding the replication update " "control - Delete\n", sessionid); } @@ -331,7 +331,7 @@ multimaster_preop_delete (Slapi_PBlock *pb) slapi_send_ldap_result(pb, LDAP_SUCCESS, 0, "replication operation not processed, replica unavailable " "or csn ignored", 0, 0); - slapi_log_error(SLAPI_LOG_REPL, REPLICATION_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_REPL, REPLICATION_SUBSYSTEM, "multimaster_preop_delete - %s replication operation not processed, replica unavailable " "or csn ignored\n", sessionid); csn_free (&csn); @@ -417,7 +417,7 @@ multimaster_preop_modify (Slapi_PBlock *pb) int drc = decode_NSDS50ReplUpdateInfoControl(ctrlp, &target_uuid, NULL, &csn, NULL /* modrdn_mods */); if (-1 == drc) { - slapi_log_error(SLAPI_LOG_ERR, REPLICATION_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_ERR, REPLICATION_SUBSYSTEM, "multimaster_preop_modify - %s An error occurred while decoding the replication update " "control- Modify\n", sessionid); } @@ -430,7 +430,7 @@ multimaster_preop_modify (Slapi_PBlock *pb) slapi_send_ldap_result(pb, LDAP_SUCCESS, 0, "replication operation not processed, replica unavailable " "or csn ignored", 0, 0); - slapi_log_error(SLAPI_LOG_REPL, REPLICATION_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_REPL, REPLICATION_SUBSYSTEM, "multimaster_preop_modify - %s replication operation not processed, replica unavailable " "or csn ignored\n", sessionid); csn_free (&csn); @@ -522,7 +522,7 @@ multimaster_preop_modrdn (Slapi_PBlock *pb) &csn, &modrdn_mods); if (-1 == drc) { - slapi_log_error(SLAPI_LOG_ERR, REPLICATION_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_ERR, REPLICATION_SUBSYSTEM, "multimaster_preop_modrdn - %s An error occurred while decoding the replication update " "control - ModRDN\n", sessionid); } @@ -692,7 +692,7 @@ purge_entry_state_information (Slapi_PBlock *pb) /* conntion is always null */ if (slapi_is_loglevel_set(SLAPI_LOG_REPL)) { char csn_str[CSN_STRSIZE]; - slapi_log_error(SLAPI_LOG_REPL, repl_plugin_name, + slapi_log_err(SLAPI_LOG_REPL, repl_plugin_name, "purge_entry_state_information - From entry %s up to " "CSN %s\n", slapi_entry_get_dn(e), csn_as_string(purge_csn, PR_FALSE, csn_str)); @@ -959,13 +959,13 @@ copy_operation_parameters(Slapi_PBlock *pb) since client operations don't go through urp engine and pblock data can be logged */ slapi_pblock_get( pb, SLAPI_OPERATION, &op ); if (NULL == op) { - slapi_log_error(SLAPI_LOG_REPL, REPLICATION_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_REPL, REPLICATION_SUBSYSTEM, "copy_operation_parameters - operation is null.\n"); return; } replica = (Replica*)object_get_data (repl_obj); if (NULL == replica) { - slapi_log_error(SLAPI_LOG_REPL, REPLICATION_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_REPL, REPLICATION_SUBSYSTEM, "copy_operation_parameters - replica is null.\n"); return; } @@ -1150,7 +1150,7 @@ write_changelog_and_ruv (Slapi_PBlock *pb) void *txn = NULL; if (cl5_is_diskfull() && !cl5_diskspace_is_available()) { - slapi_log_error(SLAPI_LOG_CRIT, repl_plugin_name, + slapi_log_err(SLAPI_LOG_CRIT, repl_plugin_name, "write_changelog_and_ruv - Skipped due to DISKFULL\n"); return return_value; } @@ -1161,7 +1161,7 @@ write_changelog_and_ruv (Slapi_PBlock *pb) { char csn_str[CSN_STRSIZE]; /* ONREPL - log error */ - slapi_log_error(SLAPI_LOG_ERR, repl_plugin_name, + slapi_log_err(SLAPI_LOG_ERR, repl_plugin_name, "write_changelog_and_ruv - Can't add a change for " "%s (uniqid: %s, optype: %lu) to changelog csn %s\n", REPL_GET_DN(&op_params->target_address), @@ -1206,13 +1206,13 @@ write_changelog_and_ruv (Slapi_PBlock *pb) } rc = update_ruv_component(r, opcsn, pb); if (RUV_COVERS_CSN == rc) { - slapi_log_error(SLAPI_LOG_REPL, repl_plugin_name, + slapi_log_err(SLAPI_LOG_REPL, repl_plugin_name, "write_changelog_and_ruv - RUV already covers csn for " "%s (uniqid: %s, optype: %lu) csn %s\n", dn, uniqueid, optype, csn_as_string(oppcsn, PR_FALSE, csn_str)); } else if ((rc != RUV_SUCCESS) && (rc != RUV_NOTFOUND)) { - slapi_log_error(SLAPI_LOG_ERR, repl_plugin_name, + slapi_log_err(SLAPI_LOG_ERR, repl_plugin_name, "write_changelog_and_ruv - Failed to update RUV for " "%s (uniqid: %s, optype: %lu) to changelog csn %s - rc %d\n", dn, uniqueid, optype, @@ -1274,7 +1274,7 @@ process_postop (Slapi_PBlock *pb) rc = cancel_opcsn (pb); /* Don't try to get session id since conn is always null */ - slapi_log_error(SLAPI_LOG_REPL, repl_plugin_name, + slapi_log_err(SLAPI_LOG_REPL, repl_plugin_name, "process postop - %s canceling operation csn\n", sessionid); } else { rc = SLAPI_PLUGIN_FAILURE; @@ -1325,7 +1325,7 @@ process_postop (Slapi_PBlock *pb) slapi_pblock_get(pb, SLAPI_CONN_ID, &connid); if (conn) { - slapi_log_error(SLAPI_LOG_ERR, repl_plugin_name, + slapi_log_err(SLAPI_LOG_ERR, repl_plugin_name, "process_postop - Failed to apply update (%s) error (%d). " "Aborting replication session(conn=%" NSPRIu64 " op=%d)\n", csn_as_string(opcsn, PR_FALSE, csn_str), retval, @@ -1463,7 +1463,7 @@ process_operation (Slapi_PBlock *pb, const CSN *csn) { char sessionid[REPL_SESSION_ID_SIZE]; get_repl_session_id (pb, sessionid, NULL); - slapi_log_error(SLAPI_LOG_ERR, repl_plugin_name, "process_operation - " + slapi_log_err(SLAPI_LOG_ERR, repl_plugin_name, "process_operation - " "%s - Can't locate replica for the replicated operation\n", sessionid ); return PR_FALSE; @@ -1535,7 +1535,7 @@ static const char *replica_get_purl_for_op (const Replica *r, Slapi_PBlock *pb, { char sessionid[REPL_SESSION_ID_SIZE]; get_repl_session_id (pb, sessionid, NULL); - slapi_log_error(SLAPI_LOG_ERR, repl_plugin_name, "replica_get_purl_for_op - " + slapi_log_err(SLAPI_LOG_ERR, repl_plugin_name, "replica_get_purl_for_op - " "%s - Cannot obtain consumer connection extension or supplier_ruv.\n", sessionid); } @@ -1614,7 +1614,7 @@ multimaster_be_state_change (void *handle, char *be_name, int old_be_state, int if (new_be_state == SLAPI_BE_STATE_ON) { /* backend came back online - restart replication */ - slapi_log_error(SLAPI_LOG_NOTICE, repl_plugin_name, "multimaster_be_state_change - " + slapi_log_err(SLAPI_LOG_NOTICE, repl_plugin_name, "multimaster_be_state_change - " "Replica %s is coming online; enabling replication\n", slapi_sdn_get_ndn (replica_get_root (r))); replica_enable_replication (r); @@ -1622,7 +1622,7 @@ multimaster_be_state_change (void *handle, char *be_name, int old_be_state, int else if (new_be_state == SLAPI_BE_STATE_OFFLINE) { /* backend is about to be taken down - disable replication */ - slapi_log_error(SLAPI_LOG_NOTICE, repl_plugin_name, "multimaster_be_state_change - " + slapi_log_err(SLAPI_LOG_NOTICE, repl_plugin_name, "multimaster_be_state_change - " "Replica %s is going offline; disabling replication\n", slapi_sdn_get_ndn (replica_get_root (r))); replica_disable_replication (r, r_obj); @@ -1632,7 +1632,7 @@ multimaster_be_state_change (void *handle, char *be_name, int old_be_state, int /* backend is about to be removed - disable replication */ if (old_be_state == SLAPI_BE_STATE_ON) { - slapi_log_error(SLAPI_LOG_NOTICE, repl_plugin_name, "multimaster_be_state_change - " + slapi_log_err(SLAPI_LOG_NOTICE, repl_plugin_name, "multimaster_be_state_change - " "Replica %s is about to be deleted; disabling replication\n", slapi_sdn_get_ndn (replica_get_root (r))); replica_disable_replication (r, r_obj); diff --git a/ldap/servers/plugins/replication/repl5_protocol.c b/ldap/servers/plugins/replication/repl5_protocol.c index 54bdce1..c4185ee 100644 --- a/ldap/servers/plugins/replication/repl5_protocol.c +++ b/ldap/servers/plugins/replication/repl5_protocol.c @@ -85,7 +85,7 @@ prot_new(Repl_Agmt *agmt, int protocol_state) if (NULL == rp->replica_object) { /* Whoa, no local replica!?!? */ - slapi_log_error(SLAPI_LOG_ERR, repl_plugin_name, + slapi_log_err(SLAPI_LOG_ERR, repl_plugin_name, "prot_new - %s: Unable to locate replica object for local replica %s\n", agmt_get_long_name(agmt), slapi_sdn_get_dn(replarea_sdn)); @@ -246,7 +246,7 @@ prot_thread_main(void *arg) agmt = rp->agmt; if (!agmt) { - slapi_log_error(SLAPI_LOG_ERR, repl_plugin_name, "prot_thread_main - Missing replication agreement\n"); + slapi_log_err(SLAPI_LOG_ERR, repl_plugin_name, "prot_thread_main - Missing replication agreement\n"); return; } @@ -281,7 +281,7 @@ prot_thread_main(void *arg) if (replica_is_state_flag_set(replica, REPLICA_TOTAL_EXCL_RECV)) { object_release(replica_obj); - slapi_log_error(SLAPI_LOG_ERR, repl_plugin_name, + slapi_log_err(SLAPI_LOG_ERR, repl_plugin_name, "prot_thread_main - %s: total update on the replica is in progress. " "Cannot initiate the total update.\n", agmt_get_long_name(rp->agmt)); break; @@ -349,7 +349,7 @@ prot_start(Repl_Protocol *rp) { PRErrorCode prerr = PR_GetError(); - slapi_log_error(SLAPI_LOG_ERR, repl_plugin_name, + slapi_log_err(SLAPI_LOG_ERR, repl_plugin_name, "prot_start - %s: Unable to create protocol thread; NSPR error - %d, %s\n", agmt_get_long_name(rp->agmt), prerr, slapd_pr_strerror(prerr)); @@ -357,7 +357,7 @@ prot_start(Repl_Protocol *rp) } else { - slapi_log_error(SLAPI_LOG_ERR, repl_plugin_name, "prot_start - Unable to start " + slapi_log_err(SLAPI_LOG_ERR, repl_plugin_name, "prot_start - Unable to start " "protocol object - NULL protocol object passed to prot_start.\n"); } } @@ -377,7 +377,7 @@ prot_stop(Repl_Protocol *rp) { if (rp->prp_incremental->stop(rp->prp_incremental) != 0) { - slapi_log_error(SLAPI_LOG_WARNING, repl_plugin_name, + slapi_log_err(SLAPI_LOG_WARNING, repl_plugin_name, "prot_stop - Incremental protocol for replica \"%s\" " "did not shut down properly.\n", agmt_get_long_name(rp->agmt)); @@ -387,7 +387,7 @@ prot_stop(Repl_Protocol *rp) { if (rp->prp_total->stop(rp->prp_total) != 0) { - slapi_log_error(SLAPI_LOG_WARNING, repl_plugin_name, + slapi_log_err(SLAPI_LOG_WARNING, repl_plugin_name, "prot_stop - Total protocol for replica \"%s\" " "did not shut down properly.\n", agmt_get_long_name(rp->agmt)); @@ -402,7 +402,7 @@ prot_stop(Repl_Protocol *rp) } else { - slapi_log_error(SLAPI_LOG_ERR, repl_plugin_name, "prot_stop - " + slapi_log_err(SLAPI_LOG_ERR, repl_plugin_name, "prot_stop - " "NULL protocol instance.\n"); } } @@ -434,7 +434,7 @@ prot_notify_agmt_changed(Repl_Protocol *rp, char * agmt_name) { /* MAB: rp might be NULL for disabled suffixes. Don't ASSERT on it */ if (NULL == rp) { - slapi_log_error(SLAPI_LOG_ERR, repl_plugin_name, + slapi_log_err(SLAPI_LOG_ERR, repl_plugin_name, "prot_notify_agmt_changed - Replication agreement for %s could not be updated. " "For replication to take place, please enable the suffix " "and restart the server\n", agmt_name); diff --git a/ldap/servers/plugins/replication/repl5_protocol_util.c b/ldap/servers/plugins/replication/repl5_protocol_util.c index 25caa44..6db4e4f 100644 --- a/ldap/servers/plugins/replication/repl5_protocol_util.c +++ b/ldap/servers/plugins/replication/repl5_protocol_util.c @@ -98,7 +98,7 @@ acquire_replica(Private_Repl_Protocol *prp, char *prot_oid, RUV **ruv) if (prp->replica_acquired) /* we already acquire replica */ { - slapi_log_error(SLAPI_LOG_WARNING, repl_plugin_name, + slapi_log_err(SLAPI_LOG_WARNING, repl_plugin_name, "acquire_replica - %s: Remote replica already acquired\n", agmt_get_long_name(prp->agmt)); return_value = ACQUIRE_FATAL_ERROR; @@ -266,7 +266,7 @@ acquire_replica(Private_Repl_Protocol *prp, char *prot_oid, RUV **ruv) /* Couldn't send the extended operation */ return_value = ACQUIRE_TRANSIENT_ERROR; /* XXX right return value? */ - slapi_log_error(SLAPI_LOG_WARNING, repl_plugin_name, "acquire_replica - " + slapi_log_err(SLAPI_LOG_WARNING, repl_plugin_name, "acquire_replica - " "%s: Unable to send a startReplication " "extended operation to consumer (%s). Will retry later.\n", agmt_get_long_name(prp->agmt), @@ -298,7 +298,7 @@ acquire_replica(Private_Repl_Protocol *prp, char *prot_oid, RUV **ruv) { /* XXXggood handle other error codes here */ case NSDS50_REPL_INTERNAL_ERROR: - slapi_log_error(SLAPI_LOG_ERR, repl_plugin_name, + slapi_log_err(SLAPI_LOG_ERR, repl_plugin_name, "acquire_replica - " "%s: Unable to acquire replica: " "an internal error occurred on the remote replica. " @@ -313,7 +313,7 @@ acquire_replica(Private_Repl_Protocol *prp, char *prot_oid, RUV **ruv) /* Not allowed to send updates */ { char *repl_binddn = agmt_get_binddn(prp->agmt); - slapi_log_error(SLAPI_LOG_ERR, repl_plugin_name, + slapi_log_err(SLAPI_LOG_ERR, repl_plugin_name, "acquire_replica - " "%s: Unable to acquire replica: permission denied. " "The bind dn \"%s\" does not have permission to " @@ -333,7 +333,7 @@ acquire_replica(Private_Repl_Protocol *prp, char *prot_oid, RUV **ruv) /* There is no such replica on the consumer */ { Slapi_DN *repl_root = agmt_get_replarea(prp->agmt); - slapi_log_error(SLAPI_LOG_ERR, repl_plugin_name, + slapi_log_err(SLAPI_LOG_ERR, repl_plugin_name, "acquire_replica - " "%s: Unable to acquire replica: there is no " "replicated area \"%s\" on the consumer server. " @@ -350,7 +350,7 @@ acquire_replica(Private_Repl_Protocol *prp, char *prot_oid, RUV **ruv) } case NSDS50_REPL_EXCESSIVE_CLOCK_SKEW: /* Large clock skew between the consumer and the supplier */ - slapi_log_error(SLAPI_LOG_ERR, repl_plugin_name, + slapi_log_err(SLAPI_LOG_ERR, repl_plugin_name, "acquire_replica - " "%s: Unable to acquire replica: " "Excessive clock skew between the supplier and " @@ -360,7 +360,7 @@ acquire_replica(Private_Repl_Protocol *prp, char *prot_oid, RUV **ruv) break; case NSDS50_REPL_DECODING_ERROR: /* We sent something the replica couldn't understand. */ - slapi_log_error(SLAPI_LOG_ERR, repl_plugin_name, + slapi_log_err(SLAPI_LOG_ERR, repl_plugin_name, "acquire_replica - " "%s: Unable to acquire replica: " "the consumer was unable to decode the " @@ -381,7 +381,7 @@ acquire_replica(Private_Repl_Protocol *prp, char *prot_oid, RUV **ruv) if (strcmp(REPL_NSDS50_TOTAL_PROTOCOL_OID, prot_oid) == 0) { - slapi_log_error(SLAPI_LOG_NOTICE, repl_plugin_name, + slapi_log_err(SLAPI_LOG_NOTICE, repl_plugin_name, "acquire_replica - " "%s: Unable to acquire replica: " "the replica is currently being updated" @@ -390,7 +390,7 @@ acquire_replica(Private_Repl_Protocol *prp, char *prot_oid, RUV **ruv) } else /* REPL_NSDS50_INCREMENTAL_PROTOCOL_OID */ { - slapi_log_error(SLAPI_LOG_REPL, repl_plugin_name, + slapi_log_err(SLAPI_LOG_REPL, repl_plugin_name, "acquire_replica - " "%s: Unable to acquire replica: " "the replica is currently being updated" @@ -405,7 +405,7 @@ acquire_replica(Private_Repl_Protocol *prp, char *prot_oid, RUV **ruv) break; case NSDS50_REPL_LEGACY_CONSUMER: /* remote replica is a legacy consumer */ - slapi_log_error(SLAPI_LOG_ERR, repl_plugin_name, + slapi_log_err(SLAPI_LOG_ERR, repl_plugin_name, "acquire_replica - " "%s: Unable to acquire replica: the replica " "is supplied by a legacy supplier. " @@ -417,7 +417,7 @@ acquire_replica(Private_Repl_Protocol *prp, char *prot_oid, RUV **ruv) break; case NSDS50_REPL_REPLICAID_ERROR: /* remote replica detected a duplicate ReplicaID */ - slapi_log_error(SLAPI_LOG_ERR, repl_plugin_name, + slapi_log_err(SLAPI_LOG_ERR, repl_plugin_name, "acquire_replica - " "%s: Unable to aquire replica: the replica " "has the same Replica ID as this one. " @@ -431,7 +431,7 @@ acquire_replica(Private_Repl_Protocol *prp, char *prot_oid, RUV **ruv) case NSDS50_REPL_BACKOFF: /* A replication sesssion hook on the replica * wants us to go into backoff mode. */ - slapi_log_error(SLAPI_LOG_ERR, repl_plugin_name, + slapi_log_err(SLAPI_LOG_ERR, repl_plugin_name, "acquire_replica - " "%s: Unable to acquire replica: " "the replica instructed us to go into " @@ -472,7 +472,7 @@ acquire_replica(Private_Repl_Protocol *prp, char *prot_oid, RUV **ruv) } /* We've acquired the replica. */ - slapi_log_error(SLAPI_LOG_REPL, repl_plugin_name, + slapi_log_err(SLAPI_LOG_REPL, repl_plugin_name, "acquire_replica - " "%s: Replica was successfully acquired.\n", agmt_get_long_name(prp->agmt)); @@ -483,7 +483,7 @@ acquire_replica(Private_Repl_Protocol *prp, char *prot_oid, RUV **ruv) { /* Couldn't parse the update vector */ *ruv = NULL; - slapi_log_error(SLAPI_LOG_ERR, repl_plugin_name, + slapi_log_err(SLAPI_LOG_ERR, repl_plugin_name, "acquire_replica - " "%s: acquired replica, but could not parse update vector. " "The replica must be reinitialized.\n", @@ -507,7 +507,7 @@ acquire_replica(Private_Repl_Protocol *prp, char *prot_oid, RUV **ruv) else { /* Couldn't parse the response */ - slapi_log_error(SLAPI_LOG_ERR, repl_plugin_name, + slapi_log_err(SLAPI_LOG_ERR, repl_plugin_name, "acquire_replica - " "%s: Unable to parse the response to the " "startReplication extended operation. " @@ -528,7 +528,7 @@ acquire_replica(Private_Repl_Protocol *prp, char *prot_oid, RUV **ruv) /* Couldn't send the extended operation */ return_value = ACQUIRE_TRANSIENT_ERROR; /* XXX right return value? */ - slapi_log_error(SLAPI_LOG_WARNING, repl_plugin_name, + slapi_log_err(SLAPI_LOG_WARNING, repl_plugin_name, "acquire_replica - " "%s: Unable to receive the response for a startReplication " "extended operation to consumer (%s). Will retry later.\n", @@ -542,7 +542,7 @@ acquire_replica(Private_Repl_Protocol *prp, char *prot_oid, RUV **ruv) else { /* Couldn't get a current CSN */ - slapi_log_error(SLAPI_LOG_ERR, repl_plugin_name, + slapi_log_err(SLAPI_LOG_ERR, repl_plugin_name, "acquire_replica - " "%s: Unable to obtain current CSN. " "Replication is aborting.\n", @@ -613,7 +613,7 @@ release_replica(Private_Repl_Protocol *prp) { int operation, error; conn_get_error(prp->conn, &operation, &error); - slapi_log_error(SLAPI_LOG_ERR, repl_plugin_name, + slapi_log_err(SLAPI_LOG_ERR, repl_plugin_name, "release_replica - %s: Unable to send endReplication extended operation (%s)\n", agmt_get_long_name(prp->agmt), error ? ldap_err2string(error) : "unknown error"); @@ -625,7 +625,7 @@ release_replica(Private_Repl_Protocol *prp) { int operation, error; conn_get_error(prp->conn, &operation, &error); - slapi_log_error(SLAPI_LOG_ERR, repl_plugin_name, + slapi_log_err(SLAPI_LOG_ERR, repl_plugin_name, "release_replica - %s: Attempting to release replica, but unable to receive endReplication extended " "operation response from the replica. Error %d (%s)\n", agmt_get_long_name(prp->agmt), error, error ? ldap_err2string(error) : "unknown error"); @@ -643,7 +643,7 @@ release_replica(Private_Repl_Protocol *prp) { int operation, error; conn_get_error(prp->conn, &operation, &error); - slapi_log_error(SLAPI_LOG_ERR, repl_plugin_name, + slapi_log_err(SLAPI_LOG_ERR, repl_plugin_name, "release_replica - %s: Response message id does not match the request (%s)\n", agmt_get_long_name(prp->agmt), error ? ldap_err2string(error) : "unknown error"); @@ -663,12 +663,12 @@ release_replica(Private_Repl_Protocol *prp) { if (NSDS50_REPL_REPLICA_RELEASE_SUCCEEDED == extop_result) { - slapi_log_error(SLAPI_LOG_REPL, repl_plugin_name, + slapi_log_err(SLAPI_LOG_REPL, repl_plugin_name, "release_replica - %s: Successfully released consumer\n", agmt_get_long_name(prp->agmt)); } else { - slapi_log_error(SLAPI_LOG_ERR, repl_plugin_name, + slapi_log_err(SLAPI_LOG_ERR, repl_plugin_name, "release_replica - %s: Unable to release consumer: response code %d\n", agmt_get_long_name(prp->agmt), extop_result); /* disconnect from the consumer so that it does not stay locked */ @@ -678,7 +678,7 @@ release_replica(Private_Repl_Protocol *prp) else { /* Couldn't parse the response */ - slapi_log_error(SLAPI_LOG_ERR, repl_plugin_name, + slapi_log_err(SLAPI_LOG_ERR, repl_plugin_name, "release_replica - %s: Unable to parse the response " " to the endReplication extended operation.\n", agmt_get_long_name(prp->agmt)); diff --git a/ldap/servers/plugins/replication/repl5_replica.c b/ldap/servers/plugins/replication/repl5_replica.c index 1e5f960..b66eb8b 100644 --- a/ldap/servers/plugins/replication/repl5_replica.c +++ b/ldap/servers/plugins/replication/repl5_replica.c @@ -141,7 +141,7 @@ replica_new(const Slapi_DN *root) if (NULL == r) { - slapi_log_error(SLAPI_LOG_ERR, repl_plugin_name, "replica_new - " + slapi_log_err(SLAPI_LOG_ERR, repl_plugin_name, "replica_new - " "Unable to configure replica %s: %s\n", slapi_sdn_get_dn(root), errorbuf); } slapi_entry_free (e); @@ -264,7 +264,7 @@ replica_new_from_entry (Slapi_Entry *e, char *errortext, PRBool is_add_operation if (r->legacy_consumer) { legacy_consumer_init_referrals (r); - slapi_log_error(SLAPI_LOG_REPL, repl_plugin_name, "replica_new_from_entry: " + slapi_log_err(SLAPI_LOG_REPL, repl_plugin_name, "replica_new_from_entry: " "replica for %s was configured as legacy consumer\n", slapi_sdn_get_dn(r->repl_root)); } @@ -322,7 +322,7 @@ replica_destroy(void **arg) PR_ASSERT(r); - slapi_log_error(SLAPI_LOG_REPL, repl_plugin_name, "replica_destroy\n"); + slapi_log_err(SLAPI_LOG_REPL, repl_plugin_name, "replica_destroy\n"); /* * The function will not be called unless the refcnt of its @@ -435,13 +435,13 @@ replica_subentry_create(Slapi_DN *repl_root, ReplicaId rid) entry_string = slapi_ch_smprintf("dn: cn=%s %d,%s\nobjectclass: top\nobjectclass: ldapsubentry\nobjectclass: extensibleObject\ncn: %s %d", KEEP_ALIVE_ENTRY, rid, slapi_sdn_get_dn(repl_root), KEEP_ALIVE_ENTRY, rid); if (entry_string == NULL) { - slapi_log_error(SLAPI_LOG_ERR, repl_plugin_name, + slapi_log_err(SLAPI_LOG_ERR, repl_plugin_name, "replica_subentry_create - Failed in slapi_ch_smprintf\n"); rc = -1; goto done; } - slapi_log_error(SLAPI_LOG_INFO, repl_plugin_name, + slapi_log_err(SLAPI_LOG_INFO, repl_plugin_name, "replica_subentry_create - add %s\n", entry_string); e = slapi_str2entry(entry_string, 0); @@ -457,7 +457,7 @@ replica_subentry_create(Slapi_DN *repl_root, ReplicaId rid) return_value != LDAP_ALREADY_EXISTS && return_value != LDAP_REFERRAL /* CONSUMER */) { - slapi_log_error(SLAPI_LOG_ERR, repl_plugin_name, "replica_subentry_create - Unable to " + slapi_log_err(SLAPI_LOG_ERR, repl_plugin_name, "replica_subentry_create - Unable to " "create replication keep alive entry %s: error %d - %s\n", slapi_entry_get_dn_const(e), return_value, ldap_err2string(return_value)); rc = -1; @@ -493,16 +493,16 @@ replica_subentry_check(Slapi_DN *repl_root, ReplicaId rid) slapi_pblock_get(pb, SLAPI_PLUGIN_INTOP_SEARCH_ENTRIES, &entries); if (entries && (entries[0] == NULL)) { - slapi_log_error(SLAPI_LOG_NOTICE, repl_plugin_name, + slapi_log_err(SLAPI_LOG_NOTICE, repl_plugin_name, "replica_subentry_check - Need to create replication keep alive entry \n", KEEP_ALIVE_ENTRY, rid, slapi_sdn_get_dn(repl_root)); rc = replica_subentry_create(repl_root, rid); } else { - slapi_log_error(SLAPI_LOG_REPL, repl_plugin_name, + slapi_log_err(SLAPI_LOG_REPL, repl_plugin_name, "replica_subentry_check - replication keep alive entry already exists\n", KEEP_ALIVE_ENTRY, rid, slapi_sdn_get_dn(repl_root)); rc = 0; } } else { - slapi_log_error(SLAPI_LOG_ERR, repl_plugin_name, + slapi_log_err(SLAPI_LOG_ERR, repl_plugin_name, "replica_subentry_check - Error accessing replication keep alive entry res=%d\n", KEEP_ALIVE_ENTRY, rid, slapi_sdn_get_dn(repl_root), res); /* The status of the entry is not clear, do not attempt to create it */ @@ -535,7 +535,7 @@ replica_subentry_update(Slapi_DN *repl_root, ReplicaId rid) gmtime_r(&curtime, <m); strftime(buf, sizeof (buf), "%Y%m%d%H%M%SZ", <m); - slapi_log_error(SLAPI_LOG_REPL, repl_plugin_name, "subentry_update called at %s\n", buf); + slapi_log_err(SLAPI_LOG_REPL, repl_plugin_name, "subentry_update called at %s\n", buf); val.bv_val = buf; @@ -562,11 +562,11 @@ replica_subentry_update(Slapi_DN *repl_root, ReplicaId rid) if (ldrc != LDAP_SUCCESS) { - slapi_log_error(SLAPI_LOG_REPL, repl_plugin_name, + slapi_log_err(SLAPI_LOG_REPL, repl_plugin_name, "Failure (%d) to update replication keep alive entry \"%s: %s\"\n", ldrc, KEEP_ALIVE_ATTR, buf); rc = ldrc; } else { - slapi_log_error(SLAPI_LOG_PLUGIN, repl_plugin_name, + slapi_log_err(SLAPI_LOG_PLUGIN, repl_plugin_name, "Successful update of replication keep alive entry \"%s: %s\"\n", KEEP_ALIVE_ATTR, buf); } @@ -602,7 +602,7 @@ replica_get_exclusive_access(Replica *r, PRBool *isInc, PRUint64 connid, int opi if (isInc) *isInc = (r->repl_state_flags & REPLICA_INCREMENTAL_IN_PROGRESS); - slapi_log_error(SLAPI_LOG_REPL, repl_plugin_name, + slapi_log_err(SLAPI_LOG_REPL, repl_plugin_name, "replica_get_exclusive_access - " "conn=%" NSPRIu64 " op=%d repl=\"%s\": " "Replica in use locking_purl=%s\n", @@ -626,7 +626,7 @@ replica_get_exclusive_access(Replica *r, PRBool *isInc, PRUint64 connid, int opi } else { - slapi_log_error(SLAPI_LOG_REPL, repl_plugin_name, + slapi_log_err(SLAPI_LOG_REPL, repl_plugin_name, "replica_get_exclusive_access - " "conn=%" NSPRIu64 " op=%d repl=\"%s\": Acquired replica\n", connid, opid, @@ -670,13 +670,13 @@ replica_relinquish_exclusive_access(Replica *r, PRUint64 connid, int opid) /* check to see if the replica is in use and log a warning if not */ if (!(r->repl_state_flags & REPLICA_IN_USE)) { - slapi_log_error(SLAPI_LOG_REPL, repl_plugin_name, + slapi_log_err(SLAPI_LOG_REPL, repl_plugin_name, "replica_relinquish_exclusive_access - " "conn=%" NSPRIu64 " op=%d repl=\"%s\": " "Replica not in use\n", connid, opid, slapi_sdn_get_dn(r->repl_root)); } else { - slapi_log_error(SLAPI_LOG_REPL, repl_plugin_name, + slapi_log_err(SLAPI_LOG_REPL, repl_plugin_name, "replica_relinquish_exclusive_access - " "conn=%" NSPRIu64 " op=%d repl=\"%s\": " "Released replica held by locking_purl=%s\n", @@ -856,19 +856,19 @@ replica_update_ruv(Replica *r, const CSN *updated_csn, const char *replica_purl) PR_ASSERT(NULL != r); PR_ASSERT(NULL != updated_csn); #ifdef DEBUG - slapi_log_error(SLAPI_LOG_REPL, repl_plugin_name, + slapi_log_err(SLAPI_LOG_REPL, repl_plugin_name, "replica_update_ruv: csn %s\n", csn_as_string(updated_csn, PR_FALSE, csn_str)); /* XXXggood remove debugging */ #endif if (NULL == r) { - slapi_log_error(SLAPI_LOG_ERR, repl_plugin_name, "replica_update_ruv - Replica " + slapi_log_err(SLAPI_LOG_ERR, repl_plugin_name, "replica_update_ruv - Replica " "is NULL\n"); rc = RUV_BAD_DATA; } else if (NULL == updated_csn) { - slapi_log_error(SLAPI_LOG_ERR, repl_plugin_name, "replica_update_ruv - csn " + slapi_log_err(SLAPI_LOG_ERR, repl_plugin_name, "replica_update_ruv - csn " "is NULL when updating replica %s\n", slapi_sdn_get_dn(r->repl_root)); rc = RUV_BAD_DATA; } @@ -906,7 +906,7 @@ replica_update_ruv(Replica *r, const CSN *updated_csn, const char *replica_purl) rc = ruv_update_ruv (ruv, updated_csn, replica_purl, rid == r->repl_rid); if (RUV_COVERS_CSN == rc) { - slapi_log_error(SLAPI_LOG_REPL, + slapi_log_err(SLAPI_LOG_REPL, repl_plugin_name, "replica_update_ruv - RUV " "for replica %s already covers max_csn = %s\n", slapi_sdn_get_dn(r->repl_root), @@ -915,7 +915,7 @@ replica_update_ruv(Replica *r, const CSN *updated_csn, const char *replica_purl) } else if (RUV_SUCCESS != rc) { - slapi_log_error(SLAPI_LOG_ERR, + slapi_log_err(SLAPI_LOG_ERR, repl_plugin_name, "replica_update_ruv - Unable " "to update RUV for replica %s, csn = %s\n", slapi_sdn_get_dn(r->repl_root), @@ -929,7 +929,7 @@ replica_update_ruv(Replica *r, const CSN *updated_csn, const char *replica_purl) } else { - slapi_log_error(SLAPI_LOG_ERR, repl_plugin_name, + slapi_log_err(SLAPI_LOG_ERR, repl_plugin_name, "replica_update_ruv - Unable to get RUV object for replica " "%s\n", slapi_sdn_get_dn(r->repl_root)); rc = RUV_NOTFOUND; @@ -937,7 +937,7 @@ replica_update_ruv(Replica *r, const CSN *updated_csn, const char *replica_purl) } else { - slapi_log_error(SLAPI_LOG_ERR, repl_plugin_name, "replica_update_ruv - " + slapi_log_err(SLAPI_LOG_ERR, repl_plugin_name, "replica_update_ruv - " "Unable to initialize RUV for replica %s\n", slapi_sdn_get_dn(r->repl_root)); rc = RUV_NOTFOUND; @@ -1199,7 +1199,7 @@ replica_is_updatedn (Replica *r, const Slapi_DN *sdn) Slapi_ValueSet *updatedn_groups_copy = NULL; ReplicaUpdateDNList groupdn_list = replica_updatedn_list_new(NULL); - slapi_log_error(SLAPI_LOG_REPL, repl_plugin_name, "Authorized replication managers is resync (%ld)\n", now); + slapi_log_err(SLAPI_LOG_REPL, repl_plugin_name, "Authorized replication managers is resync (%ld)\n", now); updatedn_groups_copy = slapi_valueset_new(); slapi_valueset_set_valueset(updatedn_groups_copy, r->updatedn_groups); r->updatedn_group_last_check = now; /* Just to be sure no one will try to reload */ @@ -1222,7 +1222,7 @@ replica_is_updatedn (Replica *r, const Slapi_DN *sdn) /* the unpdatedn_groups has been updated while we released the replica * groupdn_list in the replica is up to date. Do not replace it */ - slapi_log_error(SLAPI_LOG_REPL, repl_plugin_name, "Authorized replication managers (%s) was updated during a refresh\n", attr_replicaBindDnGroup); + slapi_log_err(SLAPI_LOG_REPL, repl_plugin_name, "Authorized replication managers (%s) was updated during a refresh\n", attr_replicaBindDnGroup); replica_updatedn_list_delete(groupdn_list, NULL); replica_updatedn_list_free(groupdn_list); } @@ -1493,22 +1493,22 @@ replica_dump(Replica *r) replica_lock(r->repl_lock); - slapi_log_error(SLAPI_LOG_REPL, repl_plugin_name, "Replica state:\n"); - slapi_log_error(SLAPI_LOG_REPL, repl_plugin_name, "\treplica root: %s\n", + slapi_log_err(SLAPI_LOG_REPL, repl_plugin_name, "Replica state:\n"); + slapi_log_err(SLAPI_LOG_REPL, repl_plugin_name, "\treplica root: %s\n", slapi_sdn_get_ndn (r->repl_root)); - slapi_log_error(SLAPI_LOG_REPL, repl_plugin_name, "\treplica type: %s\n", + slapi_log_err(SLAPI_LOG_REPL, repl_plugin_name, "\treplica type: %s\n", _replica_type_as_string (r)); - slapi_log_error(SLAPI_LOG_REPL, repl_plugin_name, "\treplica id: %d\n", r->repl_rid); - slapi_log_error(SLAPI_LOG_REPL, repl_plugin_name, "\tflags: %d\n", r->repl_flags); - slapi_log_error(SLAPI_LOG_REPL, repl_plugin_name, "\tstate flags: %lu\n", r->repl_state_flags); + slapi_log_err(SLAPI_LOG_REPL, repl_plugin_name, "\treplica id: %d\n", r->repl_rid); + slapi_log_err(SLAPI_LOG_REPL, repl_plugin_name, "\tflags: %d\n", r->repl_flags); + slapi_log_err(SLAPI_LOG_REPL, repl_plugin_name, "\tstate flags: %lu\n", r->repl_state_flags); if (r->updatedn_list) updatedn_list = replica_updatedn_list_to_string(r->updatedn_list, "\n\t\t"); - slapi_log_error(SLAPI_LOG_REPL, repl_plugin_name, "\tupdate dn: %s\n", + slapi_log_err(SLAPI_LOG_REPL, repl_plugin_name, "\tupdate dn: %s\n", updatedn_list? updatedn_list : "not configured"); slapi_ch_free_string(&updatedn_list); - slapi_log_error(SLAPI_LOG_REPL, repl_plugin_name, "\truv: %s configured and is %sdirty\n", + slapi_log_err(SLAPI_LOG_REPL, repl_plugin_name, "\truv: %s configured and is %sdirty\n", r->repl_ruv ? "" : "not", r->repl_ruv_dirty ? "" : "not "); - slapi_log_error(SLAPI_LOG_REPL, repl_plugin_name, "\tCSN generator: %s configured\n", + slapi_log_err(SLAPI_LOG_REPL, repl_plugin_name, "\tCSN generator: %s configured\n", r->repl_csngen ? "" : "not"); /* JCMREPL - Dump Referrals */ @@ -1731,7 +1731,7 @@ replica_reload_ruv (Replica *r) r_obj = object_new (r, NULL); /* We can't use existing changelog - remove existing file */ - slapi_log_error(SLAPI_LOG_WARNING, repl_plugin_name, "replica_reload_ruv - " + slapi_log_err(SLAPI_LOG_WARNING, repl_plugin_name, "replica_reload_ruv - " "New data for replica %s does not match the data in the changelog.\n" " Recreating the changelog file. This could affect replication with replica's " " consumers in which case the consumers should be reinitialized.\n", @@ -1850,7 +1850,7 @@ int replica_check_for_data_reload (Replica *r, void *arg) */ if (slapi_disordely_shutdown(PR_FALSE)) { - slapi_log_error(SLAPI_LOG_WARNING, repl_plugin_name, "replica_check_for_data_reload - " + slapi_log_err(SLAPI_LOG_WARNING, repl_plugin_name, "replica_check_for_data_reload - " "Disorderly shutdown for replica %s. Check if DB RUV needs to be updated\n", slapi_sdn_get_dn(r->repl_root)); @@ -1873,7 +1873,7 @@ int replica_check_for_data_reload (Replica *r, void *arg) r_obj = object_new(r, NULL); /* We can't use existing changelog - remove existing file */ - slapi_log_error(SLAPI_LOG_WARNING, repl_plugin_name, "replica_check_for_data_reload - " + slapi_log_err(SLAPI_LOG_WARNING, repl_plugin_name, "replica_check_for_data_reload - " "Data for replica %s does not match the data in the changelog. " "Recreating the changelog file. " "This could affect replication with replica's consumers in which case the " @@ -1889,7 +1889,7 @@ int replica_check_for_data_reload (Replica *r, void *arg) rc = replica_log_ruv_elements(r); } } else if (rc) { - slapi_log_error(SLAPI_LOG_WARNING, repl_plugin_name, "replica_check_for_data_reload - " + slapi_log_err(SLAPI_LOG_WARNING, repl_plugin_name, "replica_check_for_data_reload - " "For replica %s there were some differences between the changelog max RUV and the " "database RUV. If there are obsolete elements in the database RUV, you " "should remove them using the CLEANALLRUV task. If they are not obsolete, " @@ -1936,7 +1936,7 @@ _replica_get_config_entry (const Slapi_DN *root, const char **attrs) dn = _replica_get_config_dn (root); if (NULL == dn) { - slapi_log_error(SLAPI_LOG_ERR, repl_plugin_name, + slapi_log_err(SLAPI_LOG_ERR, repl_plugin_name, "_replica_get_config_entry - Failed to get the config dn for %s\n", slapi_sdn_get_dn (root)); return NULL; @@ -2042,7 +2042,7 @@ _replica_init_from_config (Replica *r, Slapi_Entry *e, char *errortext) PR_snprintf (errormsg, SLAPI_DSE_RETURNTEXT_SIZE, "Failed to retrieve %s attribute from (%s)\n", attr_replicaRoot, (char*)slapi_entry_get_dn ((Slapi_Entry*)e)); - slapi_log_error(SLAPI_LOG_ERR, repl_plugin_name, "_replica_init_from_config - %s\n", + slapi_log_err(SLAPI_LOG_ERR, repl_plugin_name, "_replica_init_from_config - %s\n", errormsg); return -1; } @@ -2077,7 +2077,7 @@ _replica_init_from_config (Replica *r, Slapi_Entry *e, char *errortext) if(slapi_entry_attr_exists(e, type_replicaBackoffMin)){ backoff_min = slapi_entry_attr_get_int(e, type_replicaBackoffMin); if(backoff_min <= 0){ - slapi_log_error(SLAPI_LOG_WARNING, repl_plugin_name, "_replica_init_from_config - " + slapi_log_err(SLAPI_LOG_WARNING, repl_plugin_name, "_replica_init_from_config - " "Invalid value for %s: %d Using default value (%d)\n", type_replicaBackoffMin, backoff_min, PROTOCOL_BACKOFF_MINIMUM ); backoff_min = PROTOCOL_BACKOFF_MINIMUM; @@ -2089,7 +2089,7 @@ _replica_init_from_config (Replica *r, Slapi_Entry *e, char *errortext) if(slapi_entry_attr_exists(e, type_replicaBackoffMax)){ backoff_max = slapi_entry_attr_get_int(e, type_replicaBackoffMax); if(backoff_max <= 0){ - slapi_log_error(SLAPI_LOG_WARNING, repl_plugin_name, "_replica_init_from_config - " + slapi_log_err(SLAPI_LOG_WARNING, repl_plugin_name, "_replica_init_from_config - " "Invalid value for %s: %d Using default value (%d)\n", type_replicaBackoffMax, backoff_max, PROTOCOL_BACKOFF_MAXIMUM ); backoff_max = PROTOCOL_BACKOFF_MAXIMUM; @@ -2100,7 +2100,7 @@ _replica_init_from_config (Replica *r, Slapi_Entry *e, char *errortext) if(backoff_min > backoff_max){ /* Ok these values are invalid, reset back the defaults */ - slapi_log_error(SLAPI_LOG_WARNING, repl_plugin_name, "_replica_init_from_config - " + slapi_log_err(SLAPI_LOG_WARNING, repl_plugin_name, "_replica_init_from_config - " "Backoff minimum (%d) can not be greater than " "the backoff maximum (%d). Using default values: min (%d) max (%d)\n", backoff_min, backoff_max, PROTOCOL_BACKOFF_MINIMUM, PROTOCOL_BACKOFF_MAXIMUM); @@ -2136,7 +2136,7 @@ _replica_init_from_config (Replica *r, Slapi_Entry *e, char *errortext) slapi_counter_set_value(r->precise_purging, 0); } else{ /* Invalid value */ - slapi_log_error(SLAPI_LOG_WARNING, repl_plugin_name, "_replica_init_from_config - " + slapi_log_err(SLAPI_LOG_WARNING, repl_plugin_name, "_replica_init_from_config - " "Invalid value for %s: %s Using default value (off)\n", type_replicaPrecisePurge, precise_purging); slapi_counter_set_value(r->precise_purging, 0); @@ -2171,7 +2171,7 @@ _replica_init_from_config (Replica *r, Slapi_Entry *e, char *errortext) "and less than %d: entry %s", attr_replicaId, READ_ONLY_REPLICA_ID, (char*)slapi_entry_get_dn ((Slapi_Entry*)e)); - slapi_log_error(SLAPI_LOG_ERR, repl_plugin_name, + slapi_log_err(SLAPI_LOG_ERR, repl_plugin_name, "_replica_init_from_config - %s\n", errormsg); return -1; } else { @@ -2181,7 +2181,7 @@ _replica_init_from_config (Replica *r, Slapi_Entry *e, char *errortext) PR_snprintf (errormsg, SLAPI_DSE_RETURNTEXT_SIZE, "Failed to retrieve required %s attribute from %s", attr_replicaId,(char*)slapi_entry_get_dn ((Slapi_Entry*)e)); - slapi_log_error(SLAPI_LOG_ERR, repl_plugin_name, + slapi_log_err(SLAPI_LOG_ERR, repl_plugin_name, "_replica_init_from_config - %s\n", errormsg); return -1; } @@ -2194,7 +2194,7 @@ _replica_init_from_config (Replica *r, Slapi_Entry *e, char *errortext) PR_snprintf (errormsg, SLAPI_DSE_RETURNTEXT_SIZE, "Failed to create csn generator for replica (%s)", (char*)slapi_entry_get_dn ((Slapi_Entry*)e)); - slapi_log_error(SLAPI_LOG_ERR, repl_plugin_name, + slapi_log_err(SLAPI_LOG_ERR, repl_plugin_name, "_replica_init_from_config - %s\n", errormsg); return -1; } @@ -2229,7 +2229,7 @@ _replica_init_from_config (Replica *r, Slapi_Entry *e, char *errortext) PR_snprintf (errormsg, SLAPI_DSE_RETURNTEXT_SIZE, "Failed to assign replica name for replica (%s); uuid generator error - %d ", (char*)slapi_entry_get_dn ((Slapi_Entry*)e), rc); - slapi_log_error(SLAPI_LOG_ERR, repl_plugin_name, "_replica_init_from_config - %s\n", + slapi_log_err(SLAPI_LOG_ERR, repl_plugin_name, "_replica_init_from_config - %s\n", errormsg); return -1; } else @@ -2305,12 +2305,12 @@ replica_check_for_tasks(Replica *r, Slapi_Entry *e) if(token){ rid = atoi(token); if(rid <= 0 || rid >= READ_ONLY_REPLICA_ID){ - slapi_log_error(SLAPI_LOG_ERR, repl_plugin_name, "CleanAllRUV Task - Invalid replica id(%d) " + slapi_log_err(SLAPI_LOG_ERR, repl_plugin_name, "CleanAllRUV Task - Invalid replica id(%d) " "aborting task.\n", rid); goto done; } } else { - slapi_log_error(SLAPI_LOG_ERR, repl_plugin_name, "CleanAllRUV Task - Unable to parse cleanallruv " + slapi_log_err(SLAPI_LOG_ERR, repl_plugin_name, "CleanAllRUV Task - Unable to parse cleanallruv " "data (%s), aborting task.\n",clean_vals[i]); goto done; } @@ -2323,7 +2323,7 @@ replica_check_for_tasks(Replica *r, Slapi_Entry *e) forcing = "no"; } - slapi_log_error(SLAPI_LOG_NOTICE, repl_plugin_name, "CleanAllRUV Task - cleanAllRUV task found, " + slapi_log_err(SLAPI_LOG_NOTICE, repl_plugin_name, "CleanAllRUV Task - cleanAllRUV task found, " "resuming the cleaning of rid(%d)...\n", rid); /* * Create payload @@ -2333,7 +2333,7 @@ replica_check_for_tasks(Replica *r, Slapi_Entry *e) slapi_ch_free_string(&ridstr); if(payload == NULL){ - slapi_log_error(SLAPI_LOG_ERR, repl_plugin_name, "CleanAllRUV Task - Startup: Failed to " + slapi_log_err(SLAPI_LOG_ERR, repl_plugin_name, "CleanAllRUV Task - Startup: Failed to " "create extended op payload, aborting task"); csn_free(&maxcsn); goto done; @@ -2343,7 +2343,7 @@ replica_check_for_tasks(Replica *r, Slapi_Entry *e) */ data = (cleanruv_data*)slapi_ch_calloc(1, sizeof(cleanruv_data)); if (data == NULL) { - slapi_log_error(SLAPI_LOG_ERR, repl_plugin_name, "CleanAllRUV Task - Failed to allocate cleanruv_data.\n"); + slapi_log_err(SLAPI_LOG_ERR, repl_plugin_name, "CleanAllRUV Task - Failed to allocate cleanruv_data.\n"); csn_free(&maxcsn); } else { /* setup our data */ @@ -2362,7 +2362,7 @@ replica_check_for_tasks(Replica *r, Slapi_Entry *e) PR_UNJOINABLE_THREAD, SLAPD_DEFAULT_THREAD_STACKSIZE); if (thread == NULL) { /* log an error and free everything */ - slapi_log_error(SLAPI_LOG_ERR, repl_plugin_name, "CleanAllRUV Task - Unable to create cleanAllRUV " + slapi_log_err(SLAPI_LOG_ERR, repl_plugin_name, "CleanAllRUV Task - Unable to create cleanAllRUV " "thread for rid(%d)\n", (int)data->rid); csn_free(&maxcsn); slapi_sdn_free(&data->sdn); @@ -2396,12 +2396,12 @@ done: if(token){ rid = atoi(token); if(rid <= 0 || rid >= READ_ONLY_REPLICA_ID){ - slapi_log_error(SLAPI_LOG_ERR, repl_plugin_name, "Abort CleanAllRUV Task - Invalid replica id(%d) " + slapi_log_err(SLAPI_LOG_ERR, repl_plugin_name, "Abort CleanAllRUV Task - Invalid replica id(%d) " "aborting abort task.\n", rid); goto done2; } } else { - slapi_log_error(SLAPI_LOG_ERR, repl_plugin_name, "Abort CleanAllRUV Task - Unable to parse cleanallruv " + slapi_log_err(SLAPI_LOG_ERR, repl_plugin_name, "Abort CleanAllRUV Task - Unable to parse cleanallruv " "data (%s), aborting abort task.\n",clean_vals[i]); goto done2; } @@ -2410,7 +2410,7 @@ done: certify = ldap_utf8strtok_r(iter, ":", &iter); if(!is_cleaned_rid(rid)){ - slapi_log_error(SLAPI_LOG_NOTICE, repl_plugin_name, "Abort CleanAllRUV Task - Replica id(%d) is not " + slapi_log_err(SLAPI_LOG_NOTICE, repl_plugin_name, "Abort CleanAllRUV Task - Replica id(%d) is not " "being cleaned, nothing to abort. Aborting abort task.\n", rid); delete_aborted_rid(r, rid, repl_root, 0); goto done2; @@ -2419,21 +2419,21 @@ done: add_aborted_rid(rid, r, repl_root); stop_ruv_cleaning(); - slapi_log_error(SLAPI_LOG_NOTICE, repl_plugin_name, "Abort CleanAllRUV Task - Abort task found, " + slapi_log_err(SLAPI_LOG_NOTICE, repl_plugin_name, "Abort CleanAllRUV Task - Abort task found, " "resuming abort of rid(%d).\n", rid); /* * Setup the data struct, and fire off the abort thread. */ data = (cleanruv_data*)slapi_ch_calloc(1, sizeof(cleanruv_data)); if (data == NULL) { - slapi_log_error(SLAPI_LOG_ERR, repl_plugin_name, "Abort CleanAllRUV Task - Failed to allocate cleanruv_data.\n"); + slapi_log_err(SLAPI_LOG_ERR, repl_plugin_name, "Abort CleanAllRUV Task - Failed to allocate cleanruv_data.\n"); } else { ridstr = slapi_ch_smprintf("%d:%s:%s", rid, repl_root, certify); payload = create_cleanruv_payload(ridstr); slapi_ch_free_string(&ridstr); if(payload == NULL){ - slapi_log_error(SLAPI_LOG_ERR, repl_plugin_name, "Abort CleanAllRUV Task - Failed to create extended " + slapi_log_err(SLAPI_LOG_ERR, repl_plugin_name, "Abort CleanAllRUV Task - Failed to create extended " "op payload\n"); slapi_ch_free((void **)&data); } else { @@ -2451,7 +2451,7 @@ done: (void *)data, PR_PRIORITY_NORMAL, PR_GLOBAL_THREAD, PR_UNJOINABLE_THREAD, SLAPD_DEFAULT_THREAD_STACKSIZE); if (thread == NULL) { - slapi_log_error(SLAPI_LOG_ERR, repl_plugin_name, "Abort CleanAllRUV Task - Unable to create abort cleanAllRUV " + slapi_log_err(SLAPI_LOG_ERR, repl_plugin_name, "Abort CleanAllRUV Task - Unable to create abort cleanAllRUV " "thread for rid(%d)\n", (int)data->rid); slapi_sdn_free(&data->sdn); ber_bvfree(data->payload); @@ -2485,7 +2485,7 @@ _replica_update_entry (Replica *r, Slapi_Entry *e, char *errortext) if (rc != CSN_SUCCESS) { PR_snprintf(errortext, SLAPI_DSE_RETURNTEXT_SIZE, "Failed to get csn generator's state; csn error - %d", rc); - slapi_log_error(SLAPI_LOG_ERR, repl_plugin_name, + slapi_log_err(SLAPI_LOG_ERR, repl_plugin_name, "_replica_update_entry - %s\n", errortext); return -1; } @@ -2500,7 +2500,7 @@ _replica_update_entry (Replica *r, Slapi_Entry *e, char *errortext) if (rc != 0) { PR_snprintf(errortext, SLAPI_DSE_RETURNTEXT_SIZE, "Failed to update replica entry"); - slapi_log_error(SLAPI_LOG_ERR, repl_plugin_name, + slapi_log_err(SLAPI_LOG_ERR, repl_plugin_name, "_replica_update_entry - %s\n", errortext); return -1; } @@ -2510,7 +2510,7 @@ _replica_update_entry (Replica *r, Slapi_Entry *e, char *errortext) if (rc != 0) { PR_snprintf(errortext, SLAPI_DSE_RETURNTEXT_SIZE, "Failed to update replica entry"); - slapi_log_error(SLAPI_LOG_ERR, repl_plugin_name, + slapi_log_err(SLAPI_LOG_ERR, repl_plugin_name, "_replica_update_entry - %s\n", errortext); return -1; } @@ -2560,7 +2560,7 @@ _replica_configure_ruv (Replica *r, PRBool isLocked) /* read ruv state from the ruv tombstone entry */ pb = slapi_pblock_new(); if (!pb) { - slapi_log_error(SLAPI_LOG_ERR, repl_plugin_name, + slapi_log_err(SLAPI_LOG_ERR, repl_plugin_name, "_replica_configure_ruv - Out of memory\n"); goto done; } @@ -2587,7 +2587,7 @@ _replica_configure_ruv (Replica *r, PRBool isLocked) slapi_pblock_get(pb, SLAPI_PLUGIN_INTOP_SEARCH_ENTRIES, &entries); if (NULL == entries || NULL == entries[0]) { - slapi_log_error(SLAPI_LOG_ERR, repl_plugin_name, + slapi_log_err(SLAPI_LOG_ERR, repl_plugin_name, "_replica_configure_ruv - Replica ruv tombstone entry for " "replica %s not found\n", slapi_sdn_get_dn(r->repl_root)); @@ -2597,7 +2597,7 @@ _replica_configure_ruv (Replica *r, PRBool isLocked) rc = slapi_entry_attr_find(entries[0], type_ruvElement, &attr); if (rc != 0) /* ruv attribute is missing - this not allowed */ { - slapi_log_error(SLAPI_LOG_ERR, repl_plugin_name, + slapi_log_err(SLAPI_LOG_ERR, repl_plugin_name, "_replica_configure_ruv - Replica ruv tombstone entry for " "replica %s does not contain %s\n", slapi_sdn_get_dn(r->repl_root), type_ruvElement); @@ -2676,7 +2676,7 @@ _replica_configure_ruv (Replica *r, PRBool isLocked) OP_FLAG_REPL_RUV); rc = replica_create_ruv_tombstone(r); if (rc) { - slapi_log_error(SLAPI_LOG_ERR, repl_plugin_name, + slapi_log_err(SLAPI_LOG_ERR, repl_plugin_name, "_replica_configure_ruv - " "Failed to recreate replica ruv tombstone entry" " (%s); LDAP error - %d\n", @@ -2694,7 +2694,7 @@ _replica_configure_ruv (Replica *r, PRBool isLocked) } else { - slapi_log_error(SLAPI_LOG_ERR, repl_plugin_name, "_replica_configure_ruv - " + slapi_log_err(SLAPI_LOG_ERR, repl_plugin_name, "_replica_configure_ruv - " "RUV for replica %s is missing replica generation\n", slapi_sdn_get_dn(r->repl_root)); goto done; @@ -2702,7 +2702,7 @@ _replica_configure_ruv (Replica *r, PRBool isLocked) } else { - slapi_log_error(SLAPI_LOG_ERR, repl_plugin_name, "_replica_configure_ruv - " + slapi_log_err(SLAPI_LOG_ERR, repl_plugin_name, "_replica_configure_ruv - " "Unable to convert %s attribute in entry %s to a replica update vector.\n", type_ruvElement, slapi_sdn_get_dn(r->repl_root)); goto done; @@ -2728,7 +2728,7 @@ _replica_configure_ruv (Replica *r, PRBool isLocked) * XXXrichm - you can also get this error when the backend is in * read only mode c.f. bug 539782 */ - slapi_log_error(SLAPI_LOG_ERR, repl_plugin_name, + slapi_log_err(SLAPI_LOG_ERR, repl_plugin_name, "_replica_configure_ruv - Failed to create replica ruv tombstone " "entry (%s); LDAP error - %d\n", slapi_sdn_get_dn(r->repl_root), rc); @@ -2736,7 +2736,7 @@ _replica_configure_ruv (Replica *r, PRBool isLocked) } else { - slapi_log_error(SLAPI_LOG_REPL, repl_plugin_name, + slapi_log_err(SLAPI_LOG_REPL, repl_plugin_name, "_replica_configure_ruv - No ruv tombstone found for replica %s. " "Created a new one\n", slapi_sdn_get_dn(r->repl_root)); @@ -2749,7 +2749,7 @@ _replica_configure_ruv (Replica *r, PRBool isLocked) char *state = slapi_mtn_get_state(r->repl_root); if (state && !strcasecmp(state, "disabled")) { - slapi_log_error(SLAPI_LOG_ERR, repl_plugin_name, + slapi_log_err(SLAPI_LOG_ERR, repl_plugin_name, "_replica_configure_ruv - Replication disabled for " "entry (%s); LDAP error - %d\n", slapi_sdn_get_dn(r->repl_root), rc); @@ -2758,7 +2758,7 @@ _replica_configure_ruv (Replica *r, PRBool isLocked) } else if (!r->repl_ruv) /* other error */ { - slapi_log_error(SLAPI_LOG_ERR, repl_plugin_name, + slapi_log_err(SLAPI_LOG_ERR, repl_plugin_name, "_replica_configure_ruv - Replication broken for " "entry (%s); LDAP error - %d\n", slapi_sdn_get_dn(r->repl_root), rc); @@ -2767,7 +2767,7 @@ _replica_configure_ruv (Replica *r, PRBool isLocked) } else /* some error but continue anyway? */ { - slapi_log_error(SLAPI_LOG_REPL, repl_plugin_name, + slapi_log_err(SLAPI_LOG_REPL, repl_plugin_name, "_replica_configure_ruv - Error %d reading tombstone for replica %s.\n", rc, slapi_sdn_get_dn(r->repl_root)); return_value = 0; @@ -2869,7 +2869,7 @@ replica_update_state (time_t when, void *arg) /* EY: the consumer needs to flush ruv to disk. */ replica_unlock(r->repl_lock); if (replica_write_ruv(r)) { - slapi_log_error(SLAPI_LOG_REPL, repl_plugin_name, + slapi_log_err(SLAPI_LOG_REPL, repl_plugin_name, "replica_update_state - Failed write RUV for %s\n", slapi_sdn_get_dn (r->repl_root)); } @@ -2891,7 +2891,7 @@ replica_update_state (time_t when, void *arg) dn = _replica_get_config_dn (r->repl_root); if (NULL == dn) { - slapi_log_error(SLAPI_LOG_ERR, repl_plugin_name, + slapi_log_err(SLAPI_LOG_ERR, repl_plugin_name, "replica_update_state - Failed to get the config dn for %s\n", slapi_sdn_get_dn (r->repl_root)); replica_unlock(r->repl_lock); @@ -2933,7 +2933,7 @@ replica_update_state (time_t when, void *arg) slapi_pblock_get(pb, SLAPI_PLUGIN_INTOP_RESULT, &rc); if (rc != LDAP_SUCCESS) { - slapi_log_error(SLAPI_LOG_ERR, repl_plugin_name, "replica_update_state - " + slapi_log_err(SLAPI_LOG_ERR, repl_plugin_name, "replica_update_state - " "Failed to update state of csn generator for replica %s: LDAP " "error - %d\n", slapi_sdn_get_dn(r->repl_root), rc); } @@ -2944,7 +2944,7 @@ replica_update_state (time_t when, void *arg) /* update RUV - performs its own locking */ if (replica_write_ruv(r)) { - slapi_log_error(SLAPI_LOG_REPL, repl_plugin_name, + slapi_log_err(SLAPI_LOG_REPL, repl_plugin_name, "replica_update_state - Failed write RUV for %s\n", slapi_sdn_get_dn (r->repl_root)); } @@ -3030,7 +3030,7 @@ replica_write_ruv (Replica *r) } else /* error */ { - slapi_log_error(SLAPI_LOG_REPL, repl_plugin_name, + slapi_log_err(SLAPI_LOG_REPL, repl_plugin_name, "replica_write_ruv - Failed to update RUV tombstone for %s; " "LDAP error - %d\n", slapi_sdn_get_dn(r->repl_root), rc); @@ -3070,7 +3070,7 @@ replica_ruv_smods_for_op( Slapi_PBlock *pb, char **uniqueid, Slapi_Mods **smods if (target_entry && is_ruv_tombstone_entry(target_entry)) { /* disallow direct modification of the RUV tombstone entry must use the CLEANRUV task instead */ - slapi_log_error(SLAPI_LOG_ERR, repl_plugin_name, + slapi_log_err(SLAPI_LOG_ERR, repl_plugin_name, "replica_ruv_smods_for_op - Attempted to directly modify the tombstone RUV " "entry [%s] - use the CLEANALLRUV task instead\n", slapi_entry_get_dn_const(target_entry)); @@ -3165,7 +3165,7 @@ _delete_tombstone(const char *tombstone_dn, const char *uniqueid, int ext_op_fla PR_ASSERT(NULL != tombstone_dn && NULL != uniqueid); if (NULL == tombstone_dn || NULL == uniqueid) { - slapi_log_error(SLAPI_LOG_ERR, repl_plugin_name, "_delete_tombstone - " + slapi_log_err(SLAPI_LOG_ERR, repl_plugin_name, "_delete_tombstone - " "NULL tombstone_dn or uniqueid provided.\n"); } else @@ -3179,7 +3179,7 @@ _delete_tombstone(const char *tombstone_dn, const char *uniqueid, int ext_op_fla slapi_pblock_get(pb, SLAPI_PLUGIN_INTOP_RESULT, &ldaprc); if (LDAP_SUCCESS != ldaprc) { - slapi_log_error(SLAPI_LOG_ERR, repl_plugin_name, + slapi_log_err(SLAPI_LOG_ERR, repl_plugin_name, "_delete_tombstone - Unable to delete tombstone %s, " "uniqueid %s: %s.\n", tombstone_dn, uniqueid, ldap_err2string(ldaprc)); @@ -3212,7 +3212,7 @@ process_reap_entry (Slapi_Entry *entry, void *cb_data) /* abort reaping if we've been told to stop or we're shutting down */ if (*tombstone_reap_stop || slapi_is_shutting_down()) { - slapi_log_error(SLAPI_LOG_REPL, repl_plugin_name, + slapi_log_err(SLAPI_LOG_REPL, repl_plugin_name, "process_reap_entry - The tombstone reap process " " has been stopped\n"); return rc; @@ -3227,7 +3227,7 @@ process_reap_entry (Slapi_Entry *entry, void *cb_data) if ((NULL == deletion_csn || csn_compare(deletion_csn, purge_csn) < 0) && (!is_ruv_tombstone_entry(entry))) { if (slapi_is_loglevel_set(SLAPI_LOG_REPL)) { - slapi_log_error(SLAPI_LOG_REPL, repl_plugin_name, + slapi_log_err(SLAPI_LOG_REPL, repl_plugin_name, "process_reap_entry - Removing tombstone %s " "because its deletion csn (%s) is less than the " "purge csn (%s).\n", @@ -3243,7 +3243,7 @@ process_reap_entry (Slapi_Entry *entry, void *cb_data) } else { if (slapi_is_loglevel_set(SLAPI_LOG_REPL)) { - slapi_log_error(SLAPI_LOG_REPL, repl_plugin_name, + slapi_log_err(SLAPI_LOG_REPL, repl_plugin_name, "process_reap_entry - NOT removing tombstone " "%s\n", slapi_entry_get_dn(entry)); } @@ -3271,13 +3271,13 @@ _replica_reap_tombstones(void *arg) Replica *replica = NULL; CSN *purge_csn = NULL; - slapi_log_error(SLAPI_LOG_REPL, repl_plugin_name, + slapi_log_err(SLAPI_LOG_REPL, repl_plugin_name, "_replica_reap_tombstones - Beginning tombstone reap for replica %s.\n", replica_name ? replica_name : "(null)"); if (NULL == replica_name) { - slapi_log_error(SLAPI_LOG_REPL, repl_plugin_name, + slapi_log_err(SLAPI_LOG_REPL, repl_plugin_name, "_replica_reap_tombstones - Replica name is null in tombstone reap\n"); goto done; } @@ -3290,7 +3290,7 @@ _replica_reap_tombstones(void *arg) replica_object = replica_get_by_name(replica_name); if (NULL == replica_object) { - slapi_log_error(SLAPI_LOG_REPL, repl_plugin_name, + slapi_log_err(SLAPI_LOG_REPL, repl_plugin_name, "_replica_reap_tombstones - Replica object %s is null in tombstone reap\n", replica_name); goto done; } @@ -3299,14 +3299,14 @@ _replica_reap_tombstones(void *arg) replica = (Replica *)object_get_data(replica_object); if (NULL == replica) { - slapi_log_error(SLAPI_LOG_REPL, repl_plugin_name, + slapi_log_err(SLAPI_LOG_REPL, repl_plugin_name, "_replica_reap_tombstones - Replica %s is null in tombstone reap\n", replica_name); goto done; } if (replica->tombstone_reap_stop) { - slapi_log_error(SLAPI_LOG_REPL, repl_plugin_name, + slapi_log_err(SLAPI_LOG_REPL, repl_plugin_name, "_replica_reap_tombstones - Replica %s reap stop flag is set for tombstone reap\n", replica_name); goto done; } @@ -3377,7 +3377,7 @@ _replica_reap_tombstones(void *arg) if (LDAP_SUCCESS != oprc) { - slapi_log_error(SLAPI_LOG_ERR, repl_plugin_name, + slapi_log_err(SLAPI_LOG_ERR, repl_plugin_name, "_replica_reap_tombstones - Failed when searching for " "tombstones in replica %s: %s. Will try again in %ld " "seconds.\n", slapi_sdn_get_dn(replica->repl_root), @@ -3385,7 +3385,7 @@ _replica_reap_tombstones(void *arg) } else { - slapi_log_error(SLAPI_LOG_REPL, repl_plugin_name, + slapi_log_err(SLAPI_LOG_REPL, repl_plugin_name, "_replica_reap_tombstones - Purged %ld of %ld tombstones " "in replica %s. Will try again in %ld " "seconds.\n", cb_data.num_purged_entries, cb_data.num_entries, @@ -3395,7 +3395,7 @@ _replica_reap_tombstones(void *arg) } else { - slapi_log_error(SLAPI_LOG_REPL, repl_plugin_name, + slapi_log_err(SLAPI_LOG_REPL, repl_plugin_name, "_replica_reap_tombstones - No purge CSN for tombstone reap for replica %s.\n", replica_name); } @@ -3424,7 +3424,7 @@ done: replica = NULL; } - slapi_log_error(SLAPI_LOG_REPL, repl_plugin_name, + slapi_log_err(SLAPI_LOG_REPL, repl_plugin_name, "_replica_reap_tombstones - Finished tombstone reap for replica %s.\n", replica_name ? replica_name : "(null)"); @@ -3473,7 +3473,7 @@ eq_cb_reap_tombstones(time_t when, void *arg) SLAPD_DEFAULT_THREAD_STACKSIZE) == NULL) { replica->tombstone_reap_active = PR_FALSE; - slapi_log_error(SLAPI_LOG_ERR, repl_plugin_name, + slapi_log_err(SLAPI_LOG_ERR, repl_plugin_name, "eq_cb_reap_tombstones - Unable to create the tombstone reap thread for replica %s. " "Possible system resources problem\n", replica_name); @@ -3555,14 +3555,14 @@ replica_create_ruv_tombstone(Replica *r) r->repl_ruv_dirty = PR_TRUE; return_value = LDAP_SUCCESS; } else { - slapi_log_error(SLAPI_LOG_ERR, repl_plugin_name, "replica_create_ruv_tombstone - " + slapi_log_err(SLAPI_LOG_ERR, repl_plugin_name, "replica_create_ruv_tombstone - " "Cannot create new replica update vector for %s\n", slapi_sdn_get_dn(r->repl_root)); ruv_destroy(&ruv); goto done; } } else { - slapi_log_error(SLAPI_LOG_ERR, repl_plugin_name, "replica_create_ruv_tombstone - " + slapi_log_err(SLAPI_LOG_ERR, repl_plugin_name, "replica_create_ruv_tombstone - " "Cannot obtain CSN for new replica update vector for %s\n", slapi_sdn_get_dn(r->repl_root)); csn_free(&csn); @@ -3636,7 +3636,7 @@ assign_csn_callback(const CSN *csn, void *data) char csn_str[CSN_STRSIZE]; /* For logging only */ /* Ack, we can't keep track of min csn. Punt. */ if (slapi_is_loglevel_set(SLAPI_LOG_REPL)) { - slapi_log_error(SLAPI_LOG_REPL, repl_plugin_name, "assign_csn_callback - " + slapi_log_err(SLAPI_LOG_REPL, repl_plugin_name, "assign_csn_callback - " "Failed to insert csn %s for replica %s\n", csn_as_string(csn, PR_FALSE, csn_str), slapi_sdn_get_dn(r->repl_root)); @@ -3674,7 +3674,7 @@ abort_csn_callback(const CSN *csn, void *data) { int rc = csnplRemove(r->min_csn_pl, csn); if (rc) { - slapi_log_error(SLAPI_LOG_ERR, repl_plugin_name, "abort_csn_callback - csnplRemove failed"); + slapi_log_err(SLAPI_LOG_ERR, repl_plugin_name, "abort_csn_callback - csnplRemove failed"); return; } } @@ -3791,7 +3791,7 @@ replica_remove_legacy_attr (const Slapi_DN *repl_root_sdn, const char *attr) if (rc != LDAP_SUCCESS) { /* this is not a fatal error because the attribute may not be there */ - slapi_log_error(SLAPI_LOG_REPL, repl_plugin_name, "replica_remove_legacy_attr - " + slapi_log_err(SLAPI_LOG_REPL, repl_plugin_name, "replica_remove_legacy_attr - " "Failed to remove legacy attribute %s for replica %s; LDAP error - %d\n", attr, slapi_sdn_get_dn(repl_root_sdn), rc); } @@ -3883,7 +3883,7 @@ replica_set_tombstone_reap_interval (Replica *r, long interval) repl_name = slapi_eq_get_arg (r->repl_eqcxt_tr); slapi_ch_free ((void**)&repl_name); found = slapi_eq_cancel (r->repl_eqcxt_tr); - slapi_log_error(SLAPI_LOG_REPL, repl_plugin_name, + slapi_log_err(SLAPI_LOG_REPL, repl_plugin_name, "replica_set_tombstone_reap_interval - tombstone_reap event (interval=%ld) was %s\n", r->tombstone_reap_interval, (found ? "cancelled" : "not found")); r->repl_eqcxt_tr = NULL; @@ -3895,7 +3895,7 @@ replica_set_tombstone_reap_interval (Replica *r, long interval) r->repl_eqcxt_tr = slapi_eq_repeat (eq_cb_reap_tombstones, repl_name, current_time() + r->tombstone_reap_interval, 1000 * r->tombstone_reap_interval); - slapi_log_error(SLAPI_LOG_REPL, repl_plugin_name, + slapi_log_err(SLAPI_LOG_REPL, repl_plugin_name, "replica_set_tombstone_reap_interval - tombstone_reap event (interval=%ld) was %s\n", r->tombstone_reap_interval, (r->repl_eqcxt_tr ? "scheduled" : "not scheduled successfully")); } @@ -3918,7 +3918,7 @@ replica_strip_cleaned_rids(Replica *r) ruv_delete_replica(ruv, rid[i]); replica_set_ruv_dirty(r); if (replica_write_ruv(r)) { - slapi_log_error(SLAPI_LOG_REPL, repl_plugin_name, + slapi_log_err(SLAPI_LOG_REPL, repl_plugin_name, "replica_strip_cleaned_rids - Failed to write RUV\n"); } i++; @@ -3949,7 +3949,7 @@ replica_replace_ruv_tombstone(Replica *r) dn = _replica_get_config_dn (r->repl_root); if (NULL == dn) { - slapi_log_error(SLAPI_LOG_ERR, repl_plugin_name, + slapi_log_err(SLAPI_LOG_ERR, repl_plugin_name, "replica_replace_ruv_tombstone - " "Failed to get the config dn for %s\n", slapi_sdn_get_dn (r->repl_root)); @@ -3981,7 +3981,7 @@ replica_replace_ruv_tombstone(Replica *r) { if ((rc != LDAP_NO_SUCH_OBJECT && rc != LDAP_TYPE_OR_VALUE_EXISTS) || !replica_is_state_flag_set(r, REPLICA_IN_USE)) { - slapi_log_error(SLAPI_LOG_ERR, repl_plugin_name, "replica_replace_ruv_tombstone - " + slapi_log_err(SLAPI_LOG_ERR, repl_plugin_name, "replica_replace_ruv_tombstone - " "Failed to update replication update vector for replica %s: LDAP " "error - %d\n", (char*)slapi_sdn_get_dn (r->repl_root), rc); } @@ -4107,7 +4107,7 @@ replica_enable_replication (Replica *r) /* retrieve new ruv */ rc = replica_reload_ruv (r); if (rc) { - slapi_log_error(SLAPI_LOG_WARNING, repl_plugin_name, "replica_enable_replication - " + slapi_log_err(SLAPI_LOG_WARNING, repl_plugin_name, "replica_enable_replication - " "Reloading ruv failed\n"); /* What to do ? */ } @@ -4130,7 +4130,7 @@ replica_enable_replication (Replica *r) replica_set_state_flag(r, REPLICA_AGREEMENTS_DISABLED, PR_TRUE /* clear */); PR_Unlock(r->agmt_lock); - slapi_log_error(SLAPI_LOG_REPL, repl_plugin_name, "replica_enable_replication - " + slapi_log_err(SLAPI_LOG_REPL, repl_plugin_name, "replica_enable_replication - " "Replica %s is relinquished\n", slapi_sdn_get_ndn (replica_get_root (r))); } @@ -4175,7 +4175,7 @@ replica_disable_replication (Replica *r, Object *r_obj) if (!isInc) /* already locked, but not by inc update - break */ break; isInc = PR_FALSE; - slapi_log_error(SLAPI_LOG_REPL, repl_plugin_name, + slapi_log_err(SLAPI_LOG_REPL, repl_plugin_name, "replica_disable_replication - " "replica %s is already locked by (%s) for incoming " "incremental update; sleeping 100ms\n", @@ -4190,7 +4190,7 @@ replica_disable_replication (Replica *r, Object *r_obj) replica_set_state_flag(r, REPLICA_AGREEMENTS_DISABLED, PR_FALSE); PR_Unlock(r->agmt_lock); - slapi_log_error(SLAPI_LOG_REPL, repl_plugin_name, "replica_disable_replication - " + slapi_log_err(SLAPI_LOG_REPL, repl_plugin_name, "replica_disable_replication - " "replica %s is acquired\n", slapi_sdn_get_ndn (replica_get_root (r))); } @@ -4290,7 +4290,7 @@ replica_generate_next_csn ( Slapi_PBlock *pb, const CSN *basecsn ) csngen_adjust_time (gen, basecsn); csngen_new_csn (gen, &opcsn, PR_FALSE /* don't notify */); csn_as_string (opcsn, PR_FALSE, opcsn2str); - slapi_log_error(SLAPI_LOG_WARNING, repl_plugin_name, + slapi_log_err(SLAPI_LOG_WARNING, repl_plugin_name, "replica_generate_next_csn - " "opcsn=%s <= basecsn=%s, adjusted opcsn=%s\n", opcsnstr, basecsnstr, opcsn2str); @@ -4435,7 +4435,7 @@ replica_add_session_abort_control(Slapi_PBlock *pb) /* Build the BER payload */ if ( (ber = der_alloc()) == NULL ) { - slapi_log_error(SLAPI_LOG_REPL, repl_plugin_name, + slapi_log_err(SLAPI_LOG_REPL, repl_plugin_name, "add_session_abort_control - Failed to create ber\n"); return; } @@ -4445,7 +4445,7 @@ replica_add_session_abort_control(Slapi_PBlock *pb) } ber_free( ber, 1 ); if ( rc == -1 ) { - slapi_log_error(SLAPI_LOG_REPL, repl_plugin_name, + slapi_log_err(SLAPI_LOG_REPL, repl_plugin_name, "add_session_abort_control - Failed to flatten ber\n"); return; } @@ -4456,7 +4456,7 @@ replica_add_session_abort_control(Slapi_PBlock *pb) ber_bvfree( bvp ); slapi_pblock_set(pb, SLAPI_ADD_RESCONTROL, &ctrl); - slapi_log_error(SLAPI_LOG_REPL, repl_plugin_name, + slapi_log_err(SLAPI_LOG_REPL, repl_plugin_name, "add_session_abort_control - abort control successfully added to result\n"); } diff --git a/ldap/servers/plugins/replication/repl5_replica_config.c b/ldap/servers/plugins/replication/repl5_replica_config.c index 20a9433..c4cbfde 100644 --- a/ldap/servers/plugins/replication/repl5_replica_config.c +++ b/ldap/servers/plugins/replication/repl5_replica_config.c @@ -106,7 +106,7 @@ replica_config_init() if (s_configLock == NULL) { - slapi_log_error(SLAPI_LOG_ERR, repl_plugin_name, "replica_config_init - " + slapi_log_err(SLAPI_LOG_ERR, repl_plugin_name, "replica_config_init - " "Failed to create configuration lock; NSPR error - %d\n", PR_GetError ()); return -1; @@ -114,24 +114,24 @@ replica_config_init() rid_lock = slapi_new_rwlock(); if(rid_lock == NULL) { - slapi_log_error(SLAPI_LOG_ERR, repl_plugin_name, "replica_config_init - " + slapi_log_err(SLAPI_LOG_ERR, repl_plugin_name, "replica_config_init - " "Failed to create rid_lock; NSPR error - %d\n", PR_GetError ()); return -1; } abort_rid_lock = slapi_new_rwlock(); if(abort_rid_lock == NULL) { - slapi_log_error(SLAPI_LOG_ERR, repl_plugin_name, "replica_config_init - " + slapi_log_err(SLAPI_LOG_ERR, repl_plugin_name, "replica_config_init - " "Failed to create abort_rid_lock; NSPR error - %d\n", PR_GetError ()); return -1; } if ( ( notify_lock = PR_NewLock()) == NULL ) { - slapi_log_error(SLAPI_LOG_ERR, repl_plugin_name, "replica_config_init - " + slapi_log_err(SLAPI_LOG_ERR, repl_plugin_name, "replica_config_init - " "Failed to create notify lock; NSPR error - %d\n", PR_GetError ()); return -1; } if ( ( notify_cvar = PR_NewCondVar( notify_lock )) == NULL ) { - slapi_log_error(SLAPI_LOG_ERR, repl_plugin_name, "replica_config_init - " + slapi_log_err(SLAPI_LOG_ERR, repl_plugin_name, "replica_config_init - " "Failed to create notify cond var; NSPR error - %d\n", PR_GetError ()); return -1; } @@ -212,7 +212,7 @@ replica_config_add (Slapi_PBlock *pb, Slapi_Entry* e, Slapi_Entry* entryAfter, if (mtnode_ext->replica) { PR_snprintf (errortext, SLAPI_DSE_RETURNTEXT_SIZE, "replica already configured for %s", replica_root); - slapi_log_error(SLAPI_LOG_ERR, repl_plugin_name, "replica_config_add - %s\n", errortext); + slapi_log_err(SLAPI_LOG_ERR, repl_plugin_name, "replica_config_add - %s\n", errortext); *returncode = LDAP_UNWILLING_TO_PERFORM; goto done; } @@ -302,7 +302,7 @@ replica_config_modify (Slapi_PBlock *pb, Slapi_Entry* entryBefore, Slapi_Entry* if (mtnode_ext->replica == NULL) { PR_snprintf (errortext, SLAPI_DSE_RETURNTEXT_SIZE, "Replica does not exist for %s", replica_root); - slapi_log_error(SLAPI_LOG_ERR, repl_plugin_name, "replica_config_modify - %s\n", + slapi_log_err(SLAPI_LOG_ERR, repl_plugin_name, "replica_config_modify - %s\n", errortext); *returncode = LDAP_OPERATIONS_ERROR; goto done; @@ -343,7 +343,7 @@ replica_config_modify (Slapi_PBlock *pb, Slapi_Entry* entryBefore, Slapi_Entry* *returncode = LDAP_UNWILLING_TO_PERFORM; PR_snprintf (errortext, SLAPI_DSE_RETURNTEXT_SIZE, "Modification of %s attribute is not allowed", config_attr); - slapi_log_error(SLAPI_LOG_ERR, repl_plugin_name, "replica_config_modify - %s\n", + slapi_log_err(SLAPI_LOG_ERR, repl_plugin_name, "replica_config_modify - %s\n", errortext); } /* this is a request to delete an attribute */ @@ -417,7 +417,7 @@ replica_config_modify (Slapi_PBlock *pb, Slapi_Entry* entryBefore, Slapi_Entry* { *returncode = LDAP_UNWILLING_TO_PERFORM; PR_snprintf (errortext, SLAPI_DSE_RETURNTEXT_SIZE, "Deletion of %s attribute is not allowed", config_attr); - slapi_log_error(SLAPI_LOG_ERR, repl_plugin_name, "replica_config_modify - %s\n", errortext); + slapi_log_err(SLAPI_LOG_ERR, repl_plugin_name, "replica_config_modify - %s\n", errortext); } } else /* modify an attribute */ @@ -427,7 +427,7 @@ replica_config_modify (Slapi_PBlock *pb, Slapi_Entry* entryBefore, Slapi_Entry* *returncode = LDAP_UNWILLING_TO_PERFORM; PR_snprintf (errortext, SLAPI_DSE_RETURNTEXT_SIZE, "Attribute %s value is NULL.\n", config_attr); - slapi_log_error(SLAPI_LOG_ERR, repl_plugin_name, "replica_config_modify - %s\n", + slapi_log_err(SLAPI_LOG_ERR, repl_plugin_name, "replica_config_modify - %s\n", errortext); break; } @@ -530,7 +530,7 @@ replica_config_modify (Slapi_PBlock *pb, Slapi_Entry* entryBefore, Slapi_Entry* PR_snprintf (errortext, SLAPI_DSE_RETURNTEXT_SIZE, "Attribute %s value (%s) is invalid, must be a number greater than zero.\n", config_attr, config_attr_value); - slapi_log_error(SLAPI_LOG_ERR, repl_plugin_name, "replica_config_modify - %s\n", errortext); + slapi_log_err(SLAPI_LOG_ERR, repl_plugin_name, "replica_config_modify - %s\n", errortext); break; } replica_set_protocol_timeout(r, ptimeout); @@ -547,7 +547,7 @@ replica_config_modify (Slapi_PBlock *pb, Slapi_Entry* entryBefore, Slapi_Entry* PR_snprintf (errortext, SLAPI_DSE_RETURNTEXT_SIZE, "Attribute %s value (%s) is invalid, must be a number greater than zero.\n", config_attr, config_attr_value); - slapi_log_error(SLAPI_LOG_ERR, repl_plugin_name, "replica_config_modify - %s\n", errortext); + slapi_log_err(SLAPI_LOG_ERR, repl_plugin_name, "replica_config_modify - %s\n", errortext); break; } replica_set_backoff_min(r, val); @@ -564,7 +564,7 @@ replica_config_modify (Slapi_PBlock *pb, Slapi_Entry* entryBefore, Slapi_Entry* PR_snprintf (errortext, SLAPI_DSE_RETURNTEXT_SIZE, "Attribute %s value (%s) is invalid, must be a number greater than zero.\n", config_attr, config_attr_value); - slapi_log_error(SLAPI_LOG_ERR, repl_plugin_name, "replica_config_modify - %s\n", + slapi_log_err(SLAPI_LOG_ERR, repl_plugin_name, "replica_config_modify - %s\n", errortext); break; } @@ -588,7 +588,7 @@ replica_config_modify (Slapi_PBlock *pb, Slapi_Entry* entryBefore, Slapi_Entry* PR_snprintf (errortext, SLAPI_DSE_RETURNTEXT_SIZE, "Invalid value for %s: %s Value should be \"on\" or \"off\"\n", type_replicaPrecisePurge, config_attr_value); - slapi_log_error(SLAPI_LOG_ERR, repl_plugin_name, + slapi_log_err(SLAPI_LOG_ERR, repl_plugin_name, "replica_config_modify - %s:\n", errortext); break; } @@ -609,7 +609,7 @@ replica_config_modify (Slapi_PBlock *pb, Slapi_Entry* entryBefore, Slapi_Entry* PR_snprintf(errortext, SLAPI_DSE_RETURNTEXT_SIZE, "Attribute %s value (%s) is invalid, must be a number zero or greater.\n", config_attr, config_attr_value); - slapi_log_error(SLAPI_LOG_ERR, repl_plugin_name, + slapi_log_err(SLAPI_LOG_ERR, repl_plugin_name, "replica_config_modify - %s\n", errortext); break; } else { @@ -623,7 +623,7 @@ replica_config_modify (Slapi_PBlock *pb, Slapi_Entry* entryBefore, Slapi_Entry* *returncode = LDAP_UNWILLING_TO_PERFORM; PR_snprintf (errortext, SLAPI_DSE_RETURNTEXT_SIZE, "Modification of attribute %s is not allowed in replica entry", config_attr); - slapi_log_error(SLAPI_LOG_ERR, repl_plugin_name, "replica_config_modify - %s\n", errortext); + slapi_log_err(SLAPI_LOG_ERR, repl_plugin_name, "replica_config_modify - %s\n", errortext); } } } @@ -711,7 +711,7 @@ replica_config_post_modify(Slapi_PBlock *pb, { PR_snprintf (errortext, SLAPI_DSE_RETURNTEXT_SIZE, "Replica does not exist for %s", replica_root); - slapi_log_error(SLAPI_LOG_ERR, repl_plugin_name, + slapi_log_err(SLAPI_LOG_ERR, repl_plugin_name, "replica_config_post_modify - %s\n", errortext); *returncode = LDAP_OPERATIONS_ERROR; @@ -750,7 +750,7 @@ replica_config_post_modify(Slapi_PBlock *pb, PR_snprintf (errortext, SLAPI_DSE_RETURNTEXT_SIZE, "Modification of %s attribute is not allowed", config_attr); - slapi_log_error(SLAPI_LOG_ERR, repl_plugin_name, + slapi_log_err(SLAPI_LOG_ERR, repl_plugin_name, "replica_config_post_modify - %s\n", errortext); } @@ -818,7 +818,7 @@ replica_config_delete (Slapi_PBlock *pb, Slapi_Entry* e, Slapi_Entry* entryAfter r = (Replica*)object_get_data (mtnode_ext->replica); PR_ASSERT (r); /* The changelog for this replica is no longer valid, so we should remove it. */ - slapi_log_error(SLAPI_LOG_WARNING, repl_plugin_name, "replica_config_delete - " + slapi_log_err(SLAPI_LOG_WARNING, repl_plugin_name, "replica_config_delete - " "The changelog for replica %s is no longer valid since " "the replica config is being deleted. Removing the changelog.\n", slapi_sdn_get_dn(replica_get_root(r))); @@ -1136,7 +1136,7 @@ static int replica_execute_task (Object *r, const char *task_name, char *returnt int temprid = atoi(&(task_name[CLEANRUVLEN])); if (temprid <= 0 || temprid >= READ_ONLY_REPLICA_ID){ PR_snprintf(returntext, SLAPI_DSE_RETURNTEXT_SIZE, "Invalid replica id (%d) for task - %s", temprid, task_name); - slapi_log_error(SLAPI_LOG_ERR, repl_plugin_name, "replica_execute_task - %s\n", returntext); + slapi_log_err(SLAPI_LOG_ERR, repl_plugin_name, "replica_execute_task - %s\n", returntext); return LDAP_OPERATIONS_ERROR; } if (apply_mods) @@ -1151,7 +1151,7 @@ static int replica_execute_task (Object *r, const char *task_name, char *returnt int temprid = atoi(&(task_name[CLEANALLRUVLEN])); if (temprid <= 0 || temprid >= READ_ONLY_REPLICA_ID){ PR_snprintf(returntext, SLAPI_DSE_RETURNTEXT_SIZE, "Invalid replica id (%d) for task - (%s)", temprid, task_name); - slapi_log_error(SLAPI_LOG_ERR, repl_plugin_name, "replica_execute_task - %s\n", returntext); + slapi_log_err(SLAPI_LOG_ERR, repl_plugin_name, "replica_execute_task - %s\n", returntext); return LDAP_OPERATIONS_ERROR; } if (apply_mods) @@ -1165,7 +1165,7 @@ static int replica_execute_task (Object *r, const char *task_name, char *returnt else { PR_snprintf(returntext, SLAPI_DSE_RETURNTEXT_SIZE, "Unsupported replica task - %s", task_name); - slapi_log_error(SLAPI_LOG_ERR, repl_plugin_name, + slapi_log_err(SLAPI_LOG_ERR, repl_plugin_name, "replica_execute_task - %s\n", returntext); return LDAP_OPERATIONS_ERROR; } @@ -1224,7 +1224,7 @@ replica_task_done(Replica *replica) slapi_pblock_get(pb, SLAPI_PLUGIN_INTOP_RESULT, &rc); if ((rc != LDAP_SUCCESS) && (rc != LDAP_NO_SUCH_ATTRIBUTE)) { - slapi_log_error(SLAPI_LOG_ERR, repl_plugin_name, + slapi_log_err(SLAPI_LOG_ERR, repl_plugin_name, "replica_task_done - " "Failed to remove (%s) attribute from (%s) entry; " "LDAP error - %d\n", @@ -1248,7 +1248,7 @@ static int replica_execute_cl2ldif_task (Object *r, char *returntext) if (cl5GetState () != CL5_STATE_OPEN) { PR_snprintf (returntext, SLAPI_DSE_RETURNTEXT_SIZE, "Changelog is not open"); - slapi_log_error(SLAPI_LOG_ERR, repl_plugin_name, + slapi_log_err(SLAPI_LOG_ERR, repl_plugin_name, "replica_execute_cl2ldif_task - %s\n", returntext); rc = LDAP_OPERATIONS_ERROR; goto bail; @@ -1272,12 +1272,12 @@ static int replica_execute_cl2ldif_task (Object *r, char *returntext) } PR_snprintf (fName, MAXPATHLEN, "%s/%s.ldif", clDir, replica_get_name (replica)); - slapi_log_error(SLAPI_LOG_INFO, repl_plugin_name, + slapi_log_err(SLAPI_LOG_INFO, repl_plugin_name, "replica_execute_cl2ldif_task - Beginning changelog export of replica \"%s\"\n", replica_get_name(replica)); rc = cl5ExportLDIF (fName, rlist); if (rc == CL5_SUCCESS) { - slapi_log_error(SLAPI_LOG_INFO, repl_plugin_name, + slapi_log_err(SLAPI_LOG_INFO, repl_plugin_name, "replica_execute_cl2ldif_task - Finished changelog export of replica \"%s\"\n", replica_get_name(replica)); rc = LDAP_SUCCESS; @@ -1285,7 +1285,7 @@ static int replica_execute_cl2ldif_task (Object *r, char *returntext) PR_snprintf (returntext, SLAPI_DSE_RETURNTEXT_SIZE, "Failed changelog export replica %s; " "changelog error - %d", replica_get_name(replica), rc); - slapi_log_error(SLAPI_LOG_ERR, repl_plugin_name, + slapi_log_err(SLAPI_LOG_ERR, repl_plugin_name, "replica_execute_cl2ldif_task - %s\n", returntext); rc = LDAP_OPERATIONS_ERROR; } @@ -1307,7 +1307,7 @@ static int replica_execute_ldif2cl_task (Object *r, char *returntext) if (cl5GetState () != CL5_STATE_OPEN) { PR_snprintf (returntext, SLAPI_DSE_RETURNTEXT_SIZE, "changelog is not open"); - slapi_log_error(SLAPI_LOG_ERR, repl_plugin_name, + slapi_log_err(SLAPI_LOG_ERR, repl_plugin_name, "replica_execute_ldif2cl_task - %s\n", returntext); rc = LDAP_OPERATIONS_ERROR; goto bail; @@ -1338,18 +1338,18 @@ static int replica_execute_ldif2cl_task (Object *r, char *returntext) PR_snprintf (returntext, SLAPI_DSE_RETURNTEXT_SIZE, "Failed to close changelog to import changelog data; " "changelog error - %d", rc); - slapi_log_error(SLAPI_LOG_ERR, repl_plugin_name, + slapi_log_err(SLAPI_LOG_ERR, repl_plugin_name, "replica_execute_ldif2cl_task - %s\n", returntext); rc = LDAP_OPERATIONS_ERROR; goto bail; } - slapi_log_error(SLAPI_LOG_INFO, repl_plugin_name, + slapi_log_err(SLAPI_LOG_INFO, repl_plugin_name, "replica_execute_ldif2cl_task - Beginning changelog import of replica \"%s\"\n", replica_get_name(replica)); imprc = cl5ImportLDIF (clDir, fName, rlist); if (CL5_SUCCESS == imprc) { - slapi_log_error(SLAPI_LOG_INFO, repl_plugin_name, + slapi_log_err(SLAPI_LOG_INFO, repl_plugin_name, "replica_execute_ldif2cl_task - Finished changelog import of replica \"%s\"\n", replica_get_name(replica)); } @@ -1358,7 +1358,7 @@ static int replica_execute_ldif2cl_task (Object *r, char *returntext) PR_snprintf (returntext, SLAPI_DSE_RETURNTEXT_SIZE, "Failed changelog import replica %s; " "changelog error - %d", replica_get_name(replica), rc); - slapi_log_error(SLAPI_LOG_ERR, repl_plugin_name, + slapi_log_err(SLAPI_LOG_ERR, repl_plugin_name, "replica_execute_ldif2cl_task - %s\n", returntext); imprc = LDAP_OPERATIONS_ERROR; } @@ -1371,7 +1371,7 @@ static int replica_execute_ldif2cl_task (Object *r, char *returntext) } else { - slapi_log_error(SLAPI_LOG_ERR, repl_plugin_name, + slapi_log_err(SLAPI_LOG_ERR, repl_plugin_name, "replica_execute_ldif2cl_task - Failed to start changelog at %s\n", config.dir?config.dir:"null config dir"); rc = LDAP_OPERATIONS_ERROR; @@ -1397,7 +1397,7 @@ _replica_config_get_mtnode_ext (const Slapi_Entry *e) replica_root = slapi_entry_attr_get_charptr (e, attr_replicaRoot); if (replica_root == NULL) { - slapi_log_error(SLAPI_LOG_ERR, repl_plugin_name, "_replica_config_get_mtnode_ext - " + slapi_log_err(SLAPI_LOG_ERR, repl_plugin_name, "_replica_config_get_mtnode_ext - " "Configuration entry %s missing %s attribute\n", slapi_entry_get_dn((Slapi_Entry *)e), attr_replicaRoot); @@ -1410,7 +1410,7 @@ _replica_config_get_mtnode_ext (const Slapi_Entry *e) mtnode = slapi_get_mapping_tree_node_by_dn (sdn); if (mtnode == NULL) { - slapi_log_error(SLAPI_LOG_ERR, repl_plugin_name, "_replica_config_get_mtnode_ext - " + slapi_log_err(SLAPI_LOG_ERR, repl_plugin_name, "_replica_config_get_mtnode_ext - " "Failed to locate mapping tree node for dn %s\n", slapi_sdn_get_dn(sdn)); } @@ -1440,7 +1440,7 @@ replica_execute_cleanruv_task (Object *r, ReplicaId rid, char *returntext /* not int rc = 0; PR_ASSERT (replica); - slapi_log_error(SLAPI_LOG_REPL, repl_plugin_name, "cleanAllRUV_task - Cleaning rid (%d)...\n",(int)rid); + slapi_log_err(SLAPI_LOG_REPL, repl_plugin_name, "cleanAllRUV_task - Cleaning rid (%d)...\n",(int)rid); RUVObj = replica_get_ruv(replica); PR_ASSERT(RUVObj); local_ruv = (RUV*)object_get_data (RUVObj); @@ -1455,7 +1455,7 @@ replica_execute_cleanruv_task (Object *r, ReplicaId rid, char *returntext /* not rc = ruv_delete_replica(local_ruv, rid); replica_set_ruv_dirty(replica); if (replica_write_ruv(replica)) { - slapi_log_error(SLAPI_LOG_REPL, repl_plugin_name, "cleanAllRUV_task - Could not write RUV\n"); + slapi_log_err(SLAPI_LOG_REPL, repl_plugin_name, "cleanAllRUV_task - Could not write RUV\n"); } object_release(RUVObj); @@ -1473,10 +1473,10 @@ replica_execute_cleanruv_task (Object *r, ReplicaId rid, char *returntext /* not trigger_cl_purging(replica); if (rc != RUV_SUCCESS){ - slapi_log_error(SLAPI_LOG_ERR, repl_plugin_name, "cleanAllRUV_task - Task failed(%d)\n",rc); + slapi_log_err(SLAPI_LOG_ERR, repl_plugin_name, "cleanAllRUV_task - Task failed(%d)\n",rc); return LDAP_OPERATIONS_ERROR; } - slapi_log_error(SLAPI_LOG_REPL, repl_plugin_name, "cleanAllRUV_task - Finished successfully\n"); + slapi_log_err(SLAPI_LOG_REPL, repl_plugin_name, "cleanAllRUV_task - Finished successfully\n"); return LDAP_SUCCESS; } @@ -1511,7 +1511,7 @@ replica_cleanall_ruv_task(Slapi_PBlock *pb, Slapi_Entry *e, Slapi_Entry *eAfter, task = slapi_new_task(slapi_entry_get_ndn(e)); task_dn = slapi_entry_get_sdn(e); if(task == NULL){ - slapi_log_error(SLAPI_LOG_ERR, repl_plugin_name, "cleanAllRUV_task - Failed to create new task\n"); + slapi_log_err(SLAPI_LOG_ERR, repl_plugin_name, "cleanAllRUV_task - Failed to create new task\n"); rc = SLAPI_DSE_CALLBACK_ERROR; goto out; } @@ -1766,7 +1766,7 @@ replica_cleanallruv_thread(void *arg) } if (data->task) { slapi_task_inc_refcount(data->task); - slapi_log_error(SLAPI_LOG_PLUGIN, repl_plugin_name, + slapi_log_err(SLAPI_LOG_PLUGIN, repl_plugin_name, "replica_cleanallruv_thread --> refcount incremented (%d).\n", data->task->task_refcount); } @@ -2014,7 +2014,7 @@ done: if(data->task){ slapi_task_finish(data->task, rc); slapi_task_dec_refcount(data->task); - slapi_log_error(SLAPI_LOG_PLUGIN, repl_plugin_name, + slapi_log_err(SLAPI_LOG_PLUGIN, repl_plugin_name, "replica_cleanallruv_thread <-- refcount decremented.\n"); } if(data->payload){ @@ -2098,7 +2098,7 @@ remove_keep_alive_entry(Slapi_Task *task, ReplicaId rid, const char *repl_root) static void replica_cleanall_ruv_destructor(Slapi_Task *task) { - slapi_log_error(SLAPI_LOG_PLUGIN, repl_plugin_name, + slapi_log_err(SLAPI_LOG_PLUGIN, repl_plugin_name, "replica_cleanall_ruv_destructor -->\n" ); stop_ruv_cleaning(); if (task) { @@ -2107,14 +2107,14 @@ replica_cleanall_ruv_destructor(Slapi_Task *task) DS_Sleep (PR_MillisecondsToInterval(100)); } } - slapi_log_error(SLAPI_LOG_PLUGIN, repl_plugin_name, + slapi_log_err(SLAPI_LOG_PLUGIN, repl_plugin_name, "replica_cleanall_ruv_destructor <--\n" ); } static void replica_cleanall_ruv_abort_destructor(Slapi_Task *task) { - slapi_log_error(SLAPI_LOG_PLUGIN, repl_plugin_name, + slapi_log_err(SLAPI_LOG_PLUGIN, repl_plugin_name, "replica_cleanall_ruv_abort_destructor -->\n" ); stop_ruv_cleaning(); if (task) { @@ -2123,7 +2123,7 @@ replica_cleanall_ruv_abort_destructor(Slapi_Task *task) DS_Sleep (PR_MillisecondsToInterval(100)); } } - slapi_log_error(SLAPI_LOG_PLUGIN, repl_plugin_name, + slapi_log_err(SLAPI_LOG_PLUGIN, repl_plugin_name, "replica_cleanall_ruv_abort_destructor <--\n" ); } @@ -2652,7 +2652,7 @@ add_cleaned_rid(ReplicaId rid, Replica *r, char *maxcsn, char *forcing) slapi_modify_internal_pb (pb); slapi_pblock_get(pb, SLAPI_PLUGIN_INTOP_RESULT, &rc); if (rc != LDAP_SUCCESS && rc != LDAP_TYPE_OR_VALUE_EXISTS && rc != LDAP_NO_SUCH_OBJECT){ - slapi_log_error(SLAPI_LOG_ERR, repl_plugin_name, "CleanAllRUV Task - add_cleaned_rid: " + slapi_log_err(SLAPI_LOG_ERR, repl_plugin_name, "CleanAllRUV Task - add_cleaned_rid: " "Failed to update replica config (%d), rid (%d)\n", rc, rid); } slapi_ch_free_string(&dn); @@ -2705,7 +2705,7 @@ add_aborted_rid(ReplicaId rid, Replica *r, char *repl_root) slapi_modify_internal_pb (pb); slapi_pblock_get(pb, SLAPI_PLUGIN_INTOP_RESULT, &rc); if (rc != LDAP_SUCCESS && rc != LDAP_TYPE_OR_VALUE_EXISTS && rc != LDAP_NO_SUCH_OBJECT){ - slapi_log_error(SLAPI_LOG_ERR, repl_plugin_name, "Abort CleanAllRUV Task - add_aborted_rid: " + slapi_log_err(SLAPI_LOG_ERR, repl_plugin_name, "Abort CleanAllRUV Task - add_aborted_rid: " "Failed to update replica config (%d), rid (%d)\n", rc, rid); } @@ -2758,7 +2758,7 @@ delete_aborted_rid(Replica *r, ReplicaId rid, char *repl_root, int skip){ slapi_modify_internal_pb (pb); slapi_pblock_get(pb, SLAPI_PLUGIN_INTOP_RESULT, &rc); if (rc != LDAP_SUCCESS && rc != LDAP_NO_SUCH_OBJECT){ - slapi_log_error(SLAPI_LOG_ERR, repl_plugin_name, "Abort CleanAllRUV Task - delete_aborted_rid: " + slapi_log_err(SLAPI_LOG_ERR, repl_plugin_name, "Abort CleanAllRUV Task - delete_aborted_rid: " "Failed to remove replica config (%d), rid (%d)\n", rc, rid); } slapi_pblock_destroy (pb); @@ -3106,7 +3106,7 @@ replica_abort_task_thread(void *arg) } if (data->task) { slapi_task_inc_refcount(data->task); - slapi_log_error(SLAPI_LOG_PLUGIN, repl_plugin_name, "replica_abort_task_thread --> refcount incremented.\n"); + slapi_log_err(SLAPI_LOG_PLUGIN, repl_plugin_name, "replica_abort_task_thread --> refcount incremented.\n"); } cleanruv_log(data->task, data->rid, ABORT_CLEANALLRUV_ID, SLAPI_LOG_INFO, "Aborting task for rid(%d)...",data->rid); @@ -3219,7 +3219,7 @@ done: if(data->task){ slapi_task_finish(data->task, agmt_not_notified); slapi_task_dec_refcount(data->task); - slapi_log_error(SLAPI_LOG_PLUGIN, repl_plugin_name, "replica_abort_task_thread <-- refcount incremented.\n"); + slapi_log_err(SLAPI_LOG_PLUGIN, repl_plugin_name, "replica_abort_task_thread <-- refcount incremented.\n"); } if(data->repl_obj && release_it) object_release(data->repl_obj); @@ -3501,7 +3501,7 @@ replica_cleanallruv_replica_alive(Repl_Agmt *agmt) if(conn_connect(conn) == CONN_OPERATION_SUCCESS){ ld = conn_get_ldap(conn); if(ld == NULL){ - slapi_log_error(SLAPI_LOG_REPL, repl_plugin_name, "CleanAllRUV_task - failed to get LDAP " + slapi_log_err(SLAPI_LOG_REPL, repl_plugin_name, "CleanAllRUV_task - failed to get LDAP " "handle from the replication agmt (%s). Moving on to the next agmt.\n",agmt_get_long_name(agmt)); conn_delete_internal_ext(conn); return -1; diff --git a/ldap/servers/plugins/replication/repl5_replica_dnhash.c b/ldap/servers/plugins/replication/repl5_replica_dnhash.c index 485adcb..1518437 100644 --- a/ldap/servers/plugins/replication/repl5_replica_dnhash.c +++ b/ldap/servers/plugins/replication/repl5_replica_dnhash.c @@ -30,7 +30,7 @@ int replica_init_dn_hash () PL_CompareValues, NULL, NULL); if (s_hash == NULL) { - slapi_log_error(SLAPI_LOG_ERR, repl_plugin_name, "replica_init_dn_hash: " + slapi_log_err(SLAPI_LOG_ERR, repl_plugin_name, "replica_init_dn_hash: " "failed to allocate hash table; NSPR error - %d\n", PR_GetError ()); return -1; @@ -40,7 +40,7 @@ int replica_init_dn_hash () s_lock = slapi_new_rwlock(); if (s_lock == NULL) { - slapi_log_error(SLAPI_LOG_ERR, repl_plugin_name, "replica_init_dn_hash: " + slapi_log_err(SLAPI_LOG_ERR, repl_plugin_name, "replica_init_dn_hash: " "failed to create lock; NSPR error - %d\n", PR_GetError ()); replica_destroy_dn_hash (); @@ -68,13 +68,13 @@ int replica_add_by_dn (const char *dn) if (dn == NULL) { - slapi_log_error(SLAPI_LOG_ERR, repl_plugin_name, "replica_add_by_dn: NULL argument\n"); + slapi_log_err(SLAPI_LOG_ERR, repl_plugin_name, "replica_add_by_dn: NULL argument\n"); return -1; } if (s_hash == NULL || s_lock == NULL) { - slapi_log_error(SLAPI_LOG_ERR, repl_plugin_name, "replica_add_by_dn: " + slapi_log_err(SLAPI_LOG_ERR, repl_plugin_name, "replica_add_by_dn: " "replica hash is not initialized\n"); return -1; } @@ -84,7 +84,7 @@ int replica_add_by_dn (const char *dn) /* make sure that the dn is unique */ if (PL_HashTableLookup(s_hash, dn) != NULL) { - slapi_log_error(SLAPI_LOG_ERR, repl_plugin_name, "replica_add_by_dn: " + slapi_log_err(SLAPI_LOG_ERR, repl_plugin_name, "replica_add_by_dn: " "replica with dn (%s) already in the hash\n", dn); slapi_rwlock_unlock (s_lock); return -1 ; @@ -94,7 +94,7 @@ int replica_add_by_dn (const char *dn) dn_copy = slapi_ch_strdup(dn); if (PL_HashTableAdd(s_hash, dn_copy, dn_copy) == NULL) { - slapi_log_error(SLAPI_LOG_ERR, repl_plugin_name, "replica_add_by_dn: " + slapi_log_err(SLAPI_LOG_ERR, repl_plugin_name, "replica_add_by_dn: " "failed to add dn (%s); NSPR error - %d\n", dn_copy, PR_GetError ()); slapi_ch_free((void **)&dn_copy); @@ -102,7 +102,7 @@ int replica_add_by_dn (const char *dn) return -1; } - slapi_log_error(SLAPI_LOG_REPL, repl_plugin_name, "replica_add_by_dn: " + slapi_log_err(SLAPI_LOG_REPL, repl_plugin_name, "replica_add_by_dn: " "added dn (%s)\n", dn_copy); slapi_rwlock_unlock (s_lock); @@ -115,14 +115,14 @@ int replica_delete_by_dn (const char *dn) if (dn == NULL) { - slapi_log_error(SLAPI_LOG_ERR, repl_plugin_name, "replica_delete_by_dn: " + slapi_log_err(SLAPI_LOG_ERR, repl_plugin_name, "replica_delete_by_dn: " "NULL argument\n"); return -1; } if (s_hash == NULL || s_lock == NULL) { - slapi_log_error(SLAPI_LOG_ERR, repl_plugin_name, "replica_delete_by_dn: " + slapi_log_err(SLAPI_LOG_ERR, repl_plugin_name, "replica_delete_by_dn: " "replica hash is not initialized\n"); return -1; } @@ -132,7 +132,7 @@ int replica_delete_by_dn (const char *dn) /* locate object */ if (NULL == (dn_copy = (char *)PL_HashTableLookup(s_hash, dn))) { - slapi_log_error(SLAPI_LOG_ERR, repl_plugin_name, "replica_delete_by_dn: " + slapi_log_err(SLAPI_LOG_ERR, repl_plugin_name, "replica_delete_by_dn: " "dn (%s) is not in the hash.\n", dn); slapi_rwlock_unlock (s_lock); return -1; @@ -142,7 +142,7 @@ int replica_delete_by_dn (const char *dn) PL_HashTableRemove(s_hash, dn); slapi_ch_free((void **)&dn_copy); - slapi_log_error(SLAPI_LOG_REPL, repl_plugin_name, "replica_delete_by_dn: " + slapi_log_err(SLAPI_LOG_REPL, repl_plugin_name, "replica_delete_by_dn: " "removed dn (%s)\n", dn); slapi_rwlock_unlock (s_lock); @@ -154,14 +154,14 @@ int replica_is_being_configured (const char *dn) { if (dn == NULL) { - slapi_log_error(SLAPI_LOG_ERR, repl_plugin_name, "replica_is_being_configured: " + slapi_log_err(SLAPI_LOG_ERR, repl_plugin_name, "replica_is_being_configured: " "NULL argument\n"); return 0; } if (s_hash == NULL || s_lock == NULL) { - slapi_log_error(SLAPI_LOG_ERR, repl_plugin_name, "replica_is_being_configured: " + slapi_log_err(SLAPI_LOG_ERR, repl_plugin_name, "replica_is_being_configured: " "dn hash is not initialized\n"); return 0; } diff --git a/ldap/servers/plugins/replication/repl5_replica_hash.c b/ldap/servers/plugins/replication/repl5_replica_hash.c index 9f61657..55a1267 100644 --- a/ldap/servers/plugins/replication/repl5_replica_hash.c +++ b/ldap/servers/plugins/replication/repl5_replica_hash.c @@ -39,7 +39,7 @@ int replica_init_name_hash () PL_CompareValues, NULL, NULL); if (s_hash == NULL) { - slapi_log_error(SLAPI_LOG_ERR, repl_plugin_name, "replica_init_name_hash: " + slapi_log_err(SLAPI_LOG_ERR, repl_plugin_name, "replica_init_name_hash: " "failed to allocate hash table; NSPR error - %d\n", PR_GetError ()); return -1; @@ -49,7 +49,7 @@ int replica_init_name_hash () s_lock = slapi_new_rwlock(); if (s_lock == NULL) { - slapi_log_error(SLAPI_LOG_ERR, repl_plugin_name, "replica_init_name_hash: " + slapi_log_err(SLAPI_LOG_ERR, repl_plugin_name, "replica_init_name_hash: " "failed to create lock; NSPR error - %d\n", PR_GetError ()); replica_destroy_name_hash (); @@ -75,13 +75,13 @@ int replica_add_by_name (const char *name, Object *replica) { if (name == NULL || replica == NULL) { - slapi_log_error(SLAPI_LOG_ERR, repl_plugin_name, "replica_add_by_name: NULL argument\n"); + slapi_log_err(SLAPI_LOG_ERR, repl_plugin_name, "replica_add_by_name: NULL argument\n"); return -1; } if (s_hash == NULL || s_lock == NULL) { - slapi_log_error(SLAPI_LOG_ERR, repl_plugin_name, "replica_add_by_name: " + slapi_log_err(SLAPI_LOG_ERR, repl_plugin_name, "replica_add_by_name: " "replica hash is not initialized\n"); return -1; } @@ -91,7 +91,7 @@ int replica_add_by_name (const char *name, Object *replica) /* make sure that the name is unique */ if (PL_HashTableLookup(s_hash, name) != NULL) { - slapi_log_error(SLAPI_LOG_ERR, repl_plugin_name, "replica_add_by_name: " + slapi_log_err(SLAPI_LOG_ERR, repl_plugin_name, "replica_add_by_name: " "replica with name (%s) already in the hash\n", name); slapi_rwlock_unlock (s_lock); return -1 ; @@ -103,7 +103,7 @@ int replica_add_by_name (const char *name, Object *replica) /* add replica */ if (PL_HashTableAdd(s_hash, name, replica) == NULL) { - slapi_log_error(SLAPI_LOG_ERR, repl_plugin_name, "replica_add_by_name: " + slapi_log_err(SLAPI_LOG_ERR, repl_plugin_name, "replica_add_by_name: " "failed to add replica with name (%s); NSPR error - %d\n", name, PR_GetError ()); object_release (replica); @@ -121,14 +121,14 @@ int replica_delete_by_name (const char *name) if (name == NULL) { - slapi_log_error(SLAPI_LOG_ERR, repl_plugin_name, "replica_delete_by_name: " + slapi_log_err(SLAPI_LOG_ERR, repl_plugin_name, "replica_delete_by_name: " "NULL argument\n"); return -1; } if (s_hash == NULL || s_lock == NULL) { - slapi_log_error(SLAPI_LOG_ERR, repl_plugin_name, "replica_delete_by_name: " + slapi_log_err(SLAPI_LOG_ERR, repl_plugin_name, "replica_delete_by_name: " "replica hash is not initialized\n"); return -1; } @@ -139,7 +139,7 @@ int replica_delete_by_name (const char *name) replica = (Object*)PL_HashTableLookup(s_hash, name); if (replica == NULL) { - slapi_log_error(SLAPI_LOG_ERR, repl_plugin_name, "replica_delete_by_name: " + slapi_log_err(SLAPI_LOG_ERR, repl_plugin_name, "replica_delete_by_name: " "replica with name (%s) is not in the hash.\n", name); slapi_rwlock_unlock (s_lock); return -1; @@ -162,14 +162,14 @@ Object* replica_get_by_name (const char *name) if (name == NULL) { - slapi_log_error(SLAPI_LOG_ERR, repl_plugin_name, "replica_get_by_name: " + slapi_log_err(SLAPI_LOG_ERR, repl_plugin_name, "replica_get_by_name: " "NULL argument\n"); return NULL; } if (s_hash == NULL || s_lock == NULL) { - slapi_log_error(SLAPI_LOG_ERR, repl_plugin_name, "replica_get_by_name: " + slapi_log_err(SLAPI_LOG_ERR, repl_plugin_name, "replica_get_by_name: " "replica hash is not initialized\n"); return NULL; } diff --git a/ldap/servers/plugins/replication/repl5_ruv.c b/ldap/servers/plugins/replication/repl5_ruv.c index b688075..c2a9d19 100644 --- a/ldap/servers/plugins/replication/repl5_ruv.c +++ b/ldap/servers/plugins/replication/repl5_ruv.c @@ -92,7 +92,7 @@ ruv_init_new(const char *replGen, ReplicaId rid, const char *purl, RUV **ruv) if (ruv == NULL || replGen == NULL) { - slapi_log_error(SLAPI_LOG_REPL, repl_plugin_name, "ruv_init_new: NULL argument\n"); + slapi_log_err(SLAPI_LOG_REPL, repl_plugin_name, "ruv_init_new: NULL argument\n"); return RUV_BAD_DATA; } @@ -160,7 +160,7 @@ ruv_init_from_slapi_attr_and_check_purl(Slapi_Attr *attr, RUV **ruv, ReplicaId * if (NULL == ruv || NULL == attr) { - slapi_log_error(SLAPI_LOG_REPL, repl_plugin_name, + slapi_log_err(SLAPI_LOG_REPL, repl_plugin_name, "ruv_init_from_slapi_attr: NULL argument\n"); return_value = RUV_BAD_DATA; } @@ -200,7 +200,7 @@ ruv_init_from_slapi_attr_and_check_purl(Slapi_Attr *attr, RUV **ruv, ReplicaId * (*ruv)->replGen = get_replgen_from_berval(bval); } else { /* Twice replicageneration is wrong, just log and ignore */ - slapi_log_error(SLAPI_LOG_REPL, repl_plugin_name, + slapi_log_err(SLAPI_LOG_REPL, repl_plugin_name, "ruv_init_from_slapi_attr: %s is present more than once\n", prefix_replicageneration); } @@ -255,7 +255,7 @@ ruv_init_from_bervals(struct berval **vals, RUV **ruv) if (NULL == ruv || NULL == vals) { - slapi_log_error(SLAPI_LOG_REPL, repl_plugin_name, + slapi_log_err(SLAPI_LOG_REPL, repl_plugin_name, "ruv_init_from_slapi_value: NULL argument\n"); return_value = RUV_BAD_DATA; } @@ -284,7 +284,7 @@ ruv_init_from_bervals(struct berval **vals, RUV **ruv) (*ruv)->replGen = get_replgen_from_berval(vals[i]); } else { /* Twice replicageneration is wrong, just log and ignore */ - slapi_log_error(SLAPI_LOG_REPL, repl_plugin_name, + slapi_log_err(SLAPI_LOG_REPL, repl_plugin_name, "ruv_init_from_slapi_value: %s is present more than once\n", prefix_replicageneration); } @@ -427,7 +427,7 @@ ruv_delete_replica (RUV *ruv, ReplicaId rid) int return_value; if (ruv == NULL) { - slapi_log_error(SLAPI_LOG_REPL, repl_plugin_name, "ruv_delete_replica: NULL argument\n"); + slapi_log_err(SLAPI_LOG_REPL, repl_plugin_name, "ruv_delete_replica: NULL argument\n"); return_value = RUV_BAD_DATA; } else @@ -552,7 +552,7 @@ get_csn_internal(const RUV *ruv, ReplicaId rid, CSN **csn, int whichone) if (ruv == NULL || csn == NULL) { - slapi_log_error(SLAPI_LOG_REPL, repl_plugin_name, "ruv_get_largest_csn_for_replica: NULL argument\n"); + slapi_log_err(SLAPI_LOG_REPL, repl_plugin_name, "ruv_get_largest_csn_for_replica: NULL argument\n"); return_value = RUV_BAD_DATA; } else @@ -669,7 +669,7 @@ set_max_csn_nolock_ext(RUV *ruv, const CSN *max_csn, const char *replica_purl, P } else { char csn1[CSN_STRSIZE+1]; char csn2[CSN_STRSIZE+1]; - slapi_log_error(SLAPI_LOG_REPL, repl_plugin_name, + slapi_log_err(SLAPI_LOG_REPL, repl_plugin_name, "set_max_csn_nolock_ext: new CSN [%s] for replica ID [%d] " "is less than the existing max CSN [%s] - ignoring\n", csn_as_string(max_csn, PR_FALSE, csn1), rid, @@ -716,7 +716,7 @@ ruv_set_csns(RUV *ruv, const CSN *csn, const char *replica_purl) if (ruv == NULL || csn == NULL) { - slapi_log_error(SLAPI_LOG_REPL, repl_plugin_name, "ruv_set_csns: NULL argument\n"); + slapi_log_err(SLAPI_LOG_REPL, repl_plugin_name, "ruv_set_csns: NULL argument\n"); return_value = RUV_BAD_DATA; } else @@ -783,7 +783,7 @@ ruv_set_csns_keep_smallest(RUV *ruv, const CSN *csn) if (ruv == NULL || csn == NULL) { - slapi_log_error(SLAPI_LOG_REPL, repl_plugin_name, + slapi_log_err(SLAPI_LOG_REPL, repl_plugin_name, "ruv_set_csns_keep_smallest: NULL argument\n"); return_value = RUV_BAD_DATA; } @@ -869,7 +869,7 @@ ruv_covers_csn_internal(const RUV *ruv, const CSN *csn, PRBool strict) if (ruv == NULL || csn == NULL) { - slapi_log_error(SLAPI_LOG_REPL, repl_plugin_name, "ruv_covers_csn_internal - NULL argument\n"); + slapi_log_err(SLAPI_LOG_REPL, repl_plugin_name, "ruv_covers_csn_internal - NULL argument\n"); return_value = PR_FALSE; } else @@ -887,10 +887,10 @@ ruv_covers_csn_internal(const RUV *ruv, const CSN *csn, PRBool strict) * if strict is set. */ if(strict){ - slapi_log_error(SLAPI_LOG_REPL, repl_plugin_name, "ruv_covers_csn_internal - Replica for id %d not found.\n", rid); + slapi_log_err(SLAPI_LOG_REPL, repl_plugin_name, "ruv_covers_csn_internal - Replica for id %d not found.\n", rid); return_value = PR_TRUE; } else { - slapi_log_error(SLAPI_LOG_ERR, repl_plugin_name, "ruv_covers_csn_internal - Replica for id %d not found.\n", rid); + slapi_log_err(SLAPI_LOG_ERR, repl_plugin_name, "ruv_covers_csn_internal - Replica for id %d not found.\n", rid); return_value = PR_FALSE; } } @@ -947,7 +947,7 @@ ruv_covers_csn_cleanallruv(const RUV *ruv, const CSN *csn) PRBool return_value; if (ruv == NULL || csn == NULL){ - slapi_log_error(SLAPI_LOG_REPL, repl_plugin_name, "ruv_covers_csn_cleanallruv - NULL argument\n"); + slapi_log_err(SLAPI_LOG_REPL, repl_plugin_name, "ruv_covers_csn_cleanallruv - NULL argument\n"); return_value = PR_FALSE; } else { rid = csn_get_replicaid(csn); @@ -974,7 +974,7 @@ ruv_get_min_or_max_csn(const RUV *ruv, CSN **csn, int get_the_max, ReplicaId rid if (ruv == NULL || csn == NULL) { - slapi_log_error(SLAPI_LOG_REPL, repl_plugin_name, "ruv_get_min_or_max_csn - NULL argument\n"); + slapi_log_err(SLAPI_LOG_REPL, repl_plugin_name, "ruv_get_min_or_max_csn - NULL argument\n"); return_value = RUV_BAD_DATA; } else @@ -1140,7 +1140,7 @@ ruv_to_bervals(const RUV *ruv, struct berval ***bvals) int return_value; if (ruv == NULL || bvals == NULL) { - slapi_log_error(SLAPI_LOG_REPL, repl_plugin_name, "ruv_to_bervals - NULL argument\n"); + slapi_log_err(SLAPI_LOG_REPL, repl_plugin_name, "ruv_to_bervals - NULL argument\n"); return_value = RUV_BAD_DATA; } else @@ -1269,7 +1269,7 @@ ruv_to_smod(const RUV *ruv, Slapi_Mod *smod) if (ruv == NULL || smod == NULL) { - slapi_log_error(SLAPI_LOG_REPL, repl_plugin_name, "ruv_to_smod - NULL argument\n"); + slapi_log_err(SLAPI_LOG_REPL, repl_plugin_name, "ruv_to_smod - NULL argument\n"); return_value = RUV_BAD_DATA; } else @@ -1309,7 +1309,7 @@ ruv_last_modified_to_smod(const RUV *ruv, Slapi_Mod *smod) if (ruv == NULL || smod == NULL) { - slapi_log_error(SLAPI_LOG_REPL, repl_plugin_name, "ruv_last_modified_to_smod - NULL argument\n"); + slapi_log_err(SLAPI_LOG_REPL, repl_plugin_name, "ruv_last_modified_to_smod - NULL argument\n"); return_value = RUV_BAD_DATA; } else @@ -1400,7 +1400,7 @@ ruv_compare_ruv(const RUV *ruv1, const char *ruv1name, const RUV *ruv2, const ch /* compare replica generations first */ if (ruv1->replGen == NULL || ruv2->replGen == NULL) { - slapi_log_error(loglevel, + slapi_log_err(loglevel, repl_plugin_name, "ruv_compare_ruv - RUV [%s] is missing the replica generation\n", ruv1->replGen ? ruv2name : ruv1name); @@ -1408,7 +1408,7 @@ ruv_compare_ruv(const RUV *ruv1, const char *ruv1name, const RUV *ruv2, const ch } if (strcasecmp (ruv1->replGen, ruv2->replGen)) { - slapi_log_error(loglevel, + slapi_log_err(loglevel, repl_plugin_name, "ruv_compare_ruv - RUV [%s] replica generation [%s] does not match RUV [%s] [%s]\n", ruv1name, ruv1->replGen, ruv2name, ruv2->replGen); @@ -1438,33 +1438,33 @@ ruv_compare_ruv(const RUV *ruv1, const char *ruv1name, const RUV *ruv2, const ch csn_as_string(replicab->csn, PR_FALSE, csnstrb); if (replicaa == NULL) { (*missing)++; - slapi_log_error(loglevel, repl_plugin_name, + slapi_log_err(loglevel, repl_plugin_name, "ruv_compare_ruv - RUV [%s] does not contain element [%s] " "which is present in RUV [%s]\n", ruvaname, ruvelem, ruvbname); } else if (strict && (csn_compare (replicab->csn, replicaa->csn) >= 0)) { csn_as_string(replicaa->csn, PR_FALSE, csnstra); - slapi_log_error(loglevel, repl_plugin_name, + slapi_log_err(loglevel, repl_plugin_name, "ruv_compare_ruv - The max CSN [%s] from RUV [%s] is larger " "than or equal to the max CSN [%s] from RUV [%s] for element [%s]\n", csnstrb, ruvbname, csnstra, ruvaname, ruvelem); rc = RUV_COMP_CSN_DIFFERS; } else if (csn_compare (replicab->csn, replicaa->csn) > 0) { csn_as_string(replicaa->csn, PR_FALSE, csnstra); - slapi_log_error(loglevel, repl_plugin_name, + slapi_log_err(loglevel, repl_plugin_name, "ruv_compare_ruv - The max CSN [%s] from RUV [%s] is larger " "than the max CSN [%s] from RUV [%s] for element [%s]\n", csnstrb, ruvbname, csnstra, ruvaname, ruvelem); rc = RUV_COMP_CSN_DIFFERS; } else { csn_as_string(replicaa->csn, PR_FALSE, csnstra); - slapi_log_error(SLAPI_LOG_REPL, repl_plugin_name, + slapi_log_err(SLAPI_LOG_REPL, repl_plugin_name, "ruv_compare_ruv - The max CSN [%s] from RUV [%s] is less than " "or equal to the max CSN [%s] from RUV [%s] for element [%s]\n", csnstrb, ruvbname, csnstra, ruvaname, ruvelem); } } else { - slapi_log_error(SLAPI_LOG_REPL, repl_plugin_name, + slapi_log_err(SLAPI_LOG_REPL, repl_plugin_name, "ruv_compare_ruv - RUV [%s] has an empty CSN\n", ruvbname); } @@ -1564,7 +1564,7 @@ ruv_dump(const RUV *ruv, char *ruv_name, PRFileDesc *prFile) } else { - slapi_log_error(SLAPI_LOG_REPL, repl_plugin_name, "%s", buff); + slapi_log_err(SLAPI_LOG_REPL, repl_plugin_name, "%s", buff); } for (replica = dl_get_first (ruv->elements, &cookie); replica; replica = dl_get_next (ruv->elements, &cookie)) @@ -1589,7 +1589,7 @@ ruv_dump(const RUV *ruv, char *ruv_name, PRFileDesc *prFile) } else { - slapi_log_error(SLAPI_LOG_REPL, repl_plugin_name, "%s", buff); + slapi_log_err(SLAPI_LOG_REPL, repl_plugin_name, "%s", buff); } } @@ -1622,7 +1622,7 @@ int ruv_add_csn_inprogress (RUV *ruv, const CSN *csn) if (replica == NULL) { if (slapi_is_loglevel_set(SLAPI_LOG_REPL)) { - slapi_log_error(SLAPI_LOG_REPL, repl_plugin_name, "ruv_add_csn_inprogress - Failed to add replica" + slapi_log_err(SLAPI_LOG_REPL, repl_plugin_name, "ruv_add_csn_inprogress - Failed to add replica" " that created csn %s\n", csn_as_string (csn, PR_FALSE, csn_str)); } rc = RUV_MEMORY_ERROR; @@ -1634,7 +1634,7 @@ int ruv_add_csn_inprogress (RUV *ruv, const CSN *csn) if (ruv_covers_csn_internal(ruv, csn, PR_FALSE)) { if (slapi_is_loglevel_set(SLAPI_LOG_REPL)) { - slapi_log_error(SLAPI_LOG_REPL, repl_plugin_name, "ruv_add_csn_inprogress - " + slapi_log_err(SLAPI_LOG_REPL, repl_plugin_name, "ruv_add_csn_inprogress - " "The csn %s has already be seen - ignoring\n", csn_as_string (csn, PR_FALSE, csn_str)); } @@ -1646,7 +1646,7 @@ int ruv_add_csn_inprogress (RUV *ruv, const CSN *csn) if (rc == 1) /* we already seen this csn */ { if (slapi_is_loglevel_set(SLAPI_LOG_REPL)) { - slapi_log_error(SLAPI_LOG_REPL, repl_plugin_name, "ruv_add_csn_inprogress - " + slapi_log_err(SLAPI_LOG_REPL, repl_plugin_name, "ruv_add_csn_inprogress - " "The csn %s has already be seen - ignoring\n", csn_as_string (csn, PR_FALSE, csn_str)); } @@ -1655,7 +1655,7 @@ int ruv_add_csn_inprogress (RUV *ruv, const CSN *csn) else if(rc != 0) { if (slapi_is_loglevel_set(SLAPI_LOG_REPL)) { - slapi_log_error(SLAPI_LOG_REPL, repl_plugin_name, "ruv_add_csn_inprogress - Failed to insert csn %s" + slapi_log_err(SLAPI_LOG_REPL, repl_plugin_name, "ruv_add_csn_inprogress - Failed to insert csn %s" " into pending list\n", csn_as_string (csn, PR_FALSE, csn_str)); } rc = RUV_UNKNOWN_ERROR; @@ -1663,7 +1663,7 @@ int ruv_add_csn_inprogress (RUV *ruv, const CSN *csn) else { if (slapi_is_loglevel_set(SLAPI_LOG_REPL)) { - slapi_log_error(SLAPI_LOG_REPL, repl_plugin_name, "ruv_add_csn_inprogress - Successfully inserted csn %s" + slapi_log_err(SLAPI_LOG_REPL, repl_plugin_name, "ruv_add_csn_inprogress - Successfully inserted csn %s" " into pending list\n", csn_as_string (csn, PR_FALSE, csn_str)); } rc = RUV_SUCCESS; @@ -1719,14 +1719,14 @@ int ruv_update_ruv (RUV *ruv, const CSN *csn, const char *replica_purl, PRBool i { /* we should have a ruv element at this point because it would have been added by ruv_add_inprogress function */ - slapi_log_error(SLAPI_LOG_REPL, repl_plugin_name, "ruv_update_ruv - " + slapi_log_err(SLAPI_LOG_REPL, repl_plugin_name, "ruv_update_ruv - " "Can't locate RUV element for replica %d\n", csn_get_replicaid (csn)); goto done; } if (csnplCommit(replica->csnpl, csn) != 0) { - slapi_log_error(SLAPI_LOG_ERR, repl_plugin_name, "ruv_update_ruv - Cannot commit csn %s\n", + slapi_log_err(SLAPI_LOG_ERR, repl_plugin_name, "ruv_update_ruv - Cannot commit csn %s\n", csn_as_string(csn, PR_FALSE, csn_str)); rc = RUV_CSNPL_ERROR; goto done; @@ -1734,7 +1734,7 @@ int ruv_update_ruv (RUV *ruv, const CSN *csn, const char *replica_purl, PRBool i else { if (slapi_is_loglevel_set(SLAPI_LOG_REPL)) { - slapi_log_error(SLAPI_LOG_REPL, repl_plugin_name, "ruv_update_ruv - " + slapi_log_err(SLAPI_LOG_REPL, repl_plugin_name, "ruv_update_ruv - " "Successfully committed csn %s\n", csn_as_string(csn, PR_FALSE, csn_str)); } } @@ -1742,7 +1742,7 @@ int ruv_update_ruv (RUV *ruv, const CSN *csn, const char *replica_purl, PRBool i if ((max_csn = csnplRollUp(replica->csnpl, &first_csn)) != NULL) { #ifdef DEBUG - slapi_log_error(SLAPI_LOG_REPL, repl_plugin_name, "ruv_update_ruv - Rolled up to csn %s\n", + slapi_log_err(SLAPI_LOG_REPL, repl_plugin_name, "ruv_update_ruv - Rolled up to csn %s\n", csn_as_string(max_csn, PR_FALSE, csn_str)); /* XXXggood remove debugging */ #endif /* replica object sets min csn for local replica */ @@ -1793,7 +1793,7 @@ ruvInit (RUV **ruv, int initCount) (*ruv)->lock = slapi_new_rwlock(); if ((*ruv)->lock == NULL) { - slapi_log_error(SLAPI_LOG_REPL, repl_plugin_name, + slapi_log_err(SLAPI_LOG_REPL, repl_plugin_name, "ruvInit - Failed to create lock\n"); dl_free(&(*ruv)->elements); slapi_ch_free((void**)ruv); @@ -1840,7 +1840,7 @@ ruvAddReplica (RUV *ruv, const CSN *csn, const char *replica_purl) replica = (RUVElement *)slapi_ch_calloc (1, sizeof (RUVElement)); if (replica == NULL) { - slapi_log_error(SLAPI_LOG_REPL, repl_plugin_name, + slapi_log_err(SLAPI_LOG_REPL, repl_plugin_name, "ruvAddReplica: memory allocation failed\n"); return NULL; } @@ -1871,7 +1871,7 @@ ruvAddReplicaNoCSN (RUV *ruv, ReplicaId rid, const char *replica_purl) replica = (RUVElement *)slapi_ch_calloc (1, sizeof (RUVElement)); if (replica == NULL) { - slapi_log_error(SLAPI_LOG_REPL, repl_plugin_name, + slapi_log_err(SLAPI_LOG_REPL, repl_plugin_name, "ruvAddReplicaNoCSN - Memory allocation failed\n"); return NULL; } @@ -1896,7 +1896,7 @@ ruvAddIndexReplicaNoCSN (RUV *ruv, ReplicaId rid, const char *replica_purl, int replica = (RUVElement *)slapi_ch_calloc (1, sizeof (RUVElement)); if (replica == NULL) { - slapi_log_error(SLAPI_LOG_REPL, repl_plugin_name, + slapi_log_err(SLAPI_LOG_REPL, repl_plugin_name, "ruvAddIndexReplicaNoCSN - Memory allocation failed\n"); return NULL; } @@ -1990,7 +1990,7 @@ get_ruvelement_from_berval(const struct berval *bval) bval->bv_len <= strlen(prefix_ruvcsn) || strncasecmp(bval->bv_val, prefix_ruvcsn, strlen(prefix_ruvcsn)) != 0) { - slapi_log_error(SLAPI_LOG_REPL, repl_plugin_name, + slapi_log_err(SLAPI_LOG_REPL, repl_plugin_name, "get_ruvelement_from_berval - Invalid berval\n"); goto loser; } @@ -2082,7 +2082,7 @@ get_ruvelement_from_berval(const struct berval *bval) ret_ruve->csnpl = csnplNew (); if (ret_ruve->csnpl == NULL) { - slapi_log_error(SLAPI_LOG_REPL, repl_plugin_name, + slapi_log_err(SLAPI_LOG_REPL, repl_plugin_name, "get_ruvelement_from_berval - Failed to create csn pending list\n"); goto loser; } @@ -2242,7 +2242,7 @@ ruv_is_newer (Object *sruvobj, Object *cruvobj) if ( cruv->elements == NULL ) { - slapi_log_error(SLAPI_LOG_ERR, repl_plugin_name, + slapi_log_err(SLAPI_LOG_ERR, repl_plugin_name, "ruv_is_newer, consumer RUV has no elements\n"); is_newer=PR_FALSE; break; @@ -2290,7 +2290,7 @@ ruv_force_csn_update_from_ruv(RUV *src_ruv, RUV *tgt_ruv, char *msg, int logLeve ruv_force_csn_update(tgt_ruv, replica->csn); csn_as_string(replica->csn, PR_FALSE, csnStr); - slapi_log_error(logLevel, repl_plugin_name, "%s %s\n", msg, csnStr); + slapi_log_err(logLevel, repl_plugin_name, "%s %s\n", msg, csnStr); } } diff --git a/ldap/servers/plugins/replication/repl5_schedule.c b/ldap/servers/plugins/replication/repl5_schedule.c index a87327b..60ee6f2 100644 --- a/ldap/servers/plugins/replication/repl5_schedule.c +++ b/ldap/servers/plugins/replication/repl5_schedule.c @@ -593,7 +593,7 @@ schedule_window_state_change_event (Schedule *sch) sch->pending_event = slapi_eq_once(window_state_changed, sch, wakeup_time); timestr = get_timestring(&wakeup_time); - slapi_log_error(SLAPI_LOG_REPL, repl_plugin_name, "%s: Update window will %s at %s\n", + slapi_log_err(SLAPI_LOG_REPL, repl_plugin_name, "%s: Update window will %s at %s\n", sch->session_id, window_opened ? "close" : "open", timestr); free_timestring(timestr); @@ -615,7 +615,7 @@ window_state_changed (time_t when, void *arg) open = schedule_in_window_now_nolock(sch); - slapi_log_error(SLAPI_LOG_REPL, repl_plugin_name, "%s: Update window is now %s\n", + slapi_log_err(SLAPI_LOG_REPL, repl_plugin_name, "%s: Update window is now %s\n", sch->session_id, open ? "open" : "closed"); diff --git a/ldap/servers/plugins/replication/repl5_tot_protocol.c b/ldap/servers/plugins/replication/repl5_tot_protocol.c index a96ca8f..57d9de2 100644 --- a/ldap/servers/plugins/replication/repl5_tot_protocol.c +++ b/ldap/servers/plugins/replication/repl5_tot_protocol.c @@ -92,7 +92,7 @@ static void repl5_tot_delete(Private_Repl_Protocol **prp); static void repl5_tot_log_operation_failure(int ldap_error, char* ldap_error_string, const char *agreement_name) { - slapi_log_error(SLAPI_LOG_ERR, repl_plugin_name, + slapi_log_err(SLAPI_LOG_ERR, repl_plugin_name, "repl5_tot_log_operation_failure - " "%s: Received error %d (%s): %s for total update operation\n", agreement_name, ldap_error, ldap_err2string(ldap_error), @@ -204,7 +204,7 @@ static int repl5_tot_create_async_result_thread(callback_data *cb_data) SLAPD_DEFAULT_THREAD_STACKSIZE); if (NULL == tid) { - slapi_log_error(SLAPI_LOG_ERR, repl_plugin_name, + slapi_log_err(SLAPI_LOG_ERR, repl_plugin_name, "repl5_tot_create_async_result_thread - Failed. " SLAPI_COMPONENT_NAME_NSPR " error %d (%s)\n", PR_GetError(), slapd_pr_strerror( PR_GetError() )); @@ -263,7 +263,7 @@ repl5_tot_waitfor_async_results(callback_data *cb_data) /* Lock the structure to force memory barrier */ PR_Lock(cb_data->lock); /* Are we caught up ? */ - slapi_log_error(SLAPI_LOG_REPL, repl_plugin_name, + slapi_log_err(SLAPI_LOG_REPL, repl_plugin_name, "repl5_tot_waitfor_async_results - %d %d\n", cb_data->last_message_id_received, cb_data->last_message_id_sent); if (cb_data->last_message_id_received >= cb_data->last_message_id_sent) @@ -291,7 +291,7 @@ repl5_tot_waitfor_async_results(callback_data *cb_data) if (!done && (loops > 30)) { /* Log a warning */ - slapi_log_error(SLAPI_LOG_WARNING, repl_plugin_name, + slapi_log_err(SLAPI_LOG_WARNING, repl_plugin_name, "repl5_tot_waitfor_async_results - Timed out waiting for responses: %d %d\n", cb_data->last_message_id_received, cb_data->last_message_id_sent); done = 1; @@ -339,7 +339,7 @@ repl5_tot_run(Private_Repl_Protocol *prp) area_sdn = agmt_get_replarea(prp->agmt); if (!area_sdn) { - slapi_log_error(SLAPI_LOG_ERR, repl_plugin_name, "repl5_tot_run - Unable to " + slapi_log_err(SLAPI_LOG_ERR, repl_plugin_name, "repl5_tot_run - Unable to " "get repl area. Please check agreement.\n"); goto done; } @@ -363,7 +363,7 @@ retry: conn_get_error(prp->conn, &optype, &ldaprc); if (rc == ACQUIRE_TRANSIENT_ERROR && INIT_RETRY_MAX > init_retry++) { wait_retry = init_retry * INIT_RETRY_INT; - slapi_log_error(SLAPI_LOG_WARNING, repl_plugin_name, "repl5_tot_run - " + slapi_log_err(SLAPI_LOG_WARNING, repl_plugin_name, "repl5_tot_run - " "Unable to acquire replica for total update, error: %d, retrying in %d seconds.\n", ldaprc, wait_retry); DS_Sleep(PR_SecondsToInterval(wait_retry)); @@ -393,7 +393,7 @@ retry: if (CONN_SCHEMA_UPDATED != rc && CONN_SCHEMA_NO_UPDATE_NEEDED != rc) { - slapi_log_error(SLAPI_LOG_WARNING, repl_plugin_name, "repl5_tot_run - " + slapi_log_err(SLAPI_LOG_WARNING, repl_plugin_name, "repl5_tot_run - " "Unable to replicate schema to host %s, port %d. " "Continuing with total update session.\n", hostname, portnum); @@ -413,7 +413,7 @@ retry: agmt_set_last_init_status(prp->agmt, 0, 0, 0, "Total update in progress"); - slapi_log_error(SLAPI_LOG_INFO, repl_plugin_name, "repl5_tot_run - Beginning total update of replica " + slapi_log_err(SLAPI_LOG_INFO, repl_plugin_name, "repl5_tot_run - Beginning total update of replica " "\"%s\".\n", agmt_get_long_name(prp->agmt)); /* RMREPL - need to send schema here */ @@ -427,13 +427,13 @@ retry: */ rc = slapi_lookup_instance_name_by_suffix((char *)slapi_sdn_get_dn(area_sdn), NULL, &instances, 1); if (rc || !instances) { - slapi_log_error(SLAPI_LOG_ERR, repl_plugin_name, "repl5_tot_run - Unable to " + slapi_log_err(SLAPI_LOG_ERR, repl_plugin_name, "repl5_tot_run - Unable to " "get the instance name for the suffix \"%s\".\n", slapi_sdn_get_dn(area_sdn)); goto done; } be = slapi_be_select_by_instance_name(instances[0]); if (!be) { - slapi_log_error(SLAPI_LOG_ERR, repl_plugin_name, "repl5_tot_run - Unable to " + slapi_log_err(SLAPI_LOG_ERR, repl_plugin_name, "repl5_tot_run - Unable to " "get the instance for the suffix \"%s\".\n", slapi_sdn_get_dn(area_sdn)); goto done; } @@ -446,7 +446,7 @@ retry: /* Get suffix */ rc = slapi_search_internal_get_entry(area_sdn, NULL, &suffix, repl_get_plugin_identity(PLUGIN_MULTIMASTER_REPLICATION)); if (rc) { - slapi_log_error(SLAPI_LOG_ERR, repl_plugin_name, "repl5_tot_run - Unable to " + slapi_log_err(SLAPI_LOG_ERR, repl_plugin_name, "repl5_tot_run - Unable to " "get the suffix entry \"%s\".\n", slapi_sdn_get_dn(area_sdn)); goto done; } @@ -467,7 +467,7 @@ retry: /* Send suffix first. */ rc = send_entry(suffix, (void *)&cb_data); if (rc) { - slapi_log_error(SLAPI_LOG_ERR, repl_plugin_name, "repl5_tot_run - Unable to " + slapi_log_err(SLAPI_LOG_ERR, repl_plugin_name, "repl5_tot_run - Unable to " "send the suffix entry \"%s\" to the consumer.\n", slapi_sdn_get_dn(area_sdn)); goto done; } @@ -533,7 +533,7 @@ retry: { rc = repl5_tot_create_async_result_thread(&cb_data); if (rc) { - slapi_log_error(SLAPI_LOG_ERR, repl_plugin_name, "repl5_tot_run - %s" + slapi_log_err(SLAPI_LOG_ERR, repl_plugin_name, "repl5_tot_run - %s" "repl5_tot_create_async_result_thread failed; error - %d\n", agmt_get_long_name(prp->agmt), rc); goto done; @@ -563,7 +563,7 @@ retry: } rc = repl5_tot_destroy_async_result_thread(&cb_data); if (rc) { - slapi_log_error(SLAPI_LOG_ERR, repl_plugin_name, "repl5_tot_run - %s - " + slapi_log_err(SLAPI_LOG_ERR, repl_plugin_name, "repl5_tot_run - %s - " "repl5_tot_destroy_async_result_thread failed; error - %d\n", agmt_get_long_name(prp->agmt), rc); } @@ -583,11 +583,11 @@ retry: if (rc != CONN_OPERATION_SUCCESS) { - slapi_log_error(SLAPI_LOG_ERR, repl_plugin_name, "repl5_tot_run - Total update failed for replica \"%s\", " + slapi_log_err(SLAPI_LOG_ERR, repl_plugin_name, "repl5_tot_run - Total update failed for replica \"%s\", " "error (%d)\n", agmt_get_long_name(prp->agmt), rc); agmt_set_last_init_status(prp->agmt, 0, 0, rc, "Total update aborted"); } else { - slapi_log_error(SLAPI_LOG_INFO, repl_plugin_name, "repl5_tot_run - Finished total update of replica " + slapi_log_err(SLAPI_LOG_INFO, repl_plugin_name, "repl5_tot_run - Finished total update of replica " "\"%s\". Sent %lu entries.\n", agmt_get_long_name(prp->agmt), cb_data.num_entries); agmt_set_last_init_status(prp->agmt, 0, 0, 0, "Total update succeeded"); @@ -599,7 +599,7 @@ done: slapi_ch_free_string(&hostname); if (cb_data.flowcontrol_detection > 1) { - slapi_log_error(SLAPI_LOG_ERR, repl_plugin_name, + slapi_log_err(SLAPI_LOG_ERR, repl_plugin_name, "%s: Total update flow control triggered %d times\n" "You may increase %s and/or decrease %s in the replica agreement configuration\n", agmt_get_long_name(prp->agmt), @@ -645,7 +645,7 @@ repl5_tot_stop(Private_Repl_Protocol *prp) if (!prp->stopped) { /* Isn't listening. Disconnect from the replica. */ - slapi_log_error(SLAPI_LOG_REPL, repl_plugin_name, "repl5_tot_stop - " + slapi_log_err(SLAPI_LOG_REPL, repl_plugin_name, "repl5_tot_stop - " "protocol not stopped after waiting for %d seconds " "for agreement %s\n", PR_IntervalToSeconds(now-start), agmt_get_long_name(prp->agmt)); @@ -843,7 +843,7 @@ int send_entry (Slapi_Entry *e, void *cb_data) if (bere == NULL) { - slapi_log_error(SLAPI_LOG_REPL, repl_plugin_name, "%s: send_entry: Encoding Error\n", + slapi_log_err(SLAPI_LOG_REPL, repl_plugin_name, "%s: send_entry: Encoding Error\n", agmt_get_long_name(prp->agmt)); ((callback_data*)cb_data)->rc = -1; retval = -1; @@ -890,7 +890,7 @@ int send_entry (Slapi_Entry *e, void *cb_data) } *last_busyp = now; - slapi_log_error(SLAPI_LOG_ERR, repl_plugin_name, + slapi_log_err(SLAPI_LOG_ERR, repl_plugin_name, "send_entry - Replica \"%s\" is busy. Waiting %lds while" " it finishes processing its current import queue\n", agmt_get_long_name(prp->agmt), *sleep_on_busyp); diff --git a/ldap/servers/plugins/replication/repl5_total.c b/ldap/servers/plugins/replication/repl5_total.c index 7f84cf9..af570a8 100644 --- a/ldap/servers/plugins/replication/repl5_total.c +++ b/ldap/servers/plugins/replication/repl5_total.c @@ -245,7 +245,7 @@ my_ber_printf_csn(BerElement *ber, const CSN *csn, const CSNType t) case CSN_TYPE_ATTRIBUTE_DELETED: break; default: - slapi_log_error(SLAPI_LOG_ERR, repl_plugin_name, "my_ber_printf_csn - Unknown " + slapi_log_err(SLAPI_LOG_ERR, repl_plugin_name, "my_ber_printf_csn - Unknown " "csn type %d encountered.\n", (int)t); return -1; } @@ -454,7 +454,7 @@ my_ber_scanf_value(BerElement *ber, Slapi_Value **value, PRBool *deleted) if (NULL == ber && NULL == value) { - slapi_log_error(SLAPI_LOG_ERR, repl_plugin_name, "my_ber_scanf_value - BAD 1\n"); + slapi_log_err(SLAPI_LOG_ERR, repl_plugin_name, "my_ber_scanf_value - BAD 1\n"); goto loser; } @@ -463,13 +463,13 @@ my_ber_scanf_value(BerElement *ber, Slapi_Value **value, PRBool *deleted) /* Each value is a sequence */ if (ber_scanf(ber, "{O", &attrval) == LBER_ERROR) { - slapi_log_error(SLAPI_LOG_ERR, repl_plugin_name, "my_ber_scanf_value - BAD 2\n"); + slapi_log_err(SLAPI_LOG_ERR, repl_plugin_name, "my_ber_scanf_value - BAD 2\n"); goto loser; } /* Allocate and fill in the attribute value */ if ((*value = slapi_value_new_berval(attrval)) == NULL) { - slapi_log_error(SLAPI_LOG_ERR, repl_plugin_name, "my_ber_scanf_value - BAD 3\n"); + slapi_log_err(SLAPI_LOG_ERR, repl_plugin_name, "my_ber_scanf_value - BAD 3\n"); goto loser; } @@ -478,7 +478,7 @@ my_ber_scanf_value(BerElement *ber, Slapi_Value **value, PRBool *deleted) { if (ber_scanf(ber, "b", deleted) == LBER_ERROR) { - slapi_log_error(SLAPI_LOG_ERR, repl_plugin_name, "my_ber_scanf_value - BAD 4\n"); + slapi_log_err(SLAPI_LOG_ERR, repl_plugin_name, "my_ber_scanf_value - BAD 4\n"); goto loser; } } @@ -498,7 +498,7 @@ my_ber_scanf_value(BerElement *ber, Slapi_Value **value, PRBool *deleted) len = CSN_STRSIZE; if (ber_scanf(ber, "{es}", &csntype_tmp, csnstring, &len) == LBER_ERROR) { - slapi_log_error(SLAPI_LOG_ERR, repl_plugin_name, "my_ber_scanf_value - BAD 7 - bval is %s\n", attrval->bv_val); + slapi_log_err(SLAPI_LOG_ERR, repl_plugin_name, "my_ber_scanf_value - BAD 7 - bval is %s\n", attrval->bv_val); goto loser; } switch (csntype_tmp) @@ -513,14 +513,14 @@ my_ber_scanf_value(BerElement *ber, Slapi_Value **value, PRBool *deleted) csntype = CSN_TYPE_VALUE_DISTINGUISHED; break; default: - slapi_log_error(SLAPI_LOG_ERR, repl_plugin_name, "my_ber_scanf_value - Error: preposterous CSN type " + slapi_log_err(SLAPI_LOG_ERR, repl_plugin_name, "my_ber_scanf_value - Error: preposterous CSN type " "%d received during total update.\n", csntype_tmp); goto loser; } csn = csn_new_by_string(csnstring); if (csn == NULL) { - slapi_log_error(SLAPI_LOG_ERR, repl_plugin_name, "my_ber_scanf_value - BAD 8\n"); + slapi_log_err(SLAPI_LOG_ERR, repl_plugin_name, "my_ber_scanf_value - BAD 8\n"); goto loser; } value_add_csn(*value, csntype, csn); @@ -529,7 +529,7 @@ my_ber_scanf_value(BerElement *ber, Slapi_Value **value, PRBool *deleted) if (ber_scanf(ber, "}") == LBER_ERROR) /* End of annotated attribute value seq */ { - slapi_log_error(SLAPI_LOG_ERR, repl_plugin_name, "my_ber_scanf_value - BAD 10\n"); + slapi_log_err(SLAPI_LOG_ERR, repl_plugin_name, "my_ber_scanf_value - BAD 10\n"); goto loser; } @@ -799,7 +799,7 @@ loser: slapi_entry_free (e); } *ep = NULL; - slapi_log_error(SLAPI_LOG_ERR, repl_plugin_name, "decode_total_update_extop - Could not decode extended " + slapi_log_err(SLAPI_LOG_ERR, repl_plugin_name, "decode_total_update_extop - Could not decode extended " "operation containing entry for total update.\n"); free_and_return: @@ -851,7 +851,7 @@ multimaster_extop_NSDS50ReplicationEntry(Slapi_PBlock *pb) if (rc != LDAP_SUCCESS) { const char *dn = slapi_entry_get_dn_const(e); - slapi_log_error(SLAPI_LOG_REPL, repl_plugin_name, + slapi_log_err(SLAPI_LOG_REPL, repl_plugin_name, "multimaster_extop_NSDS50ReplicationEntry - " "Error %d: could not import entry dn %s for total update operation conn=%" NSPRIu64 " op=%d\n", rc, dn, connid, opid); @@ -861,7 +861,7 @@ multimaster_extop_NSDS50ReplicationEntry(Slapi_PBlock *pb) } else { - slapi_log_error(SLAPI_LOG_REPL, repl_plugin_name, + slapi_log_err(SLAPI_LOG_REPL, repl_plugin_name, "multimaster_extop_NSDS50ReplicationEntry - " "Error %d: could not decode the total update extop " "for total update operation conn=%" NSPRIu64 " op=%d\n", diff --git a/ldap/servers/plugins/replication/repl5_updatedn_list.c b/ldap/servers/plugins/replication/repl5_updatedn_list.c index 1797934..f715acb 100644 --- a/ldap/servers/plugins/replication/repl5_updatedn_list.c +++ b/ldap/servers/plugins/replication/repl5_updatedn_list.c @@ -52,7 +52,7 @@ replica_updatedn_list_new(const Slapi_Entry *entry) PLHashTable *hash = PL_NewHashTable(4, PL_HashString, PL_CompareStrings, updatedn_compare_dns, NULL, NULL); if (hash == NULL) { - slapi_log_error(SLAPI_LOG_ERR, repl_plugin_name, "replica_new_updatedn_list - " + slapi_log_err(SLAPI_LOG_ERR, repl_plugin_name, "replica_new_updatedn_list - " "Failed to allocate hash table; NSPR error - %d\n", PR_GetError ()); return NULL; @@ -96,7 +96,7 @@ replica_groupdn_list_new(const Slapi_ValueSet *vs) hash = PL_NewHashTable(4, PL_HashString, PL_CompareStrings, updatedn_compare_dns, NULL, NULL); if (hash == NULL) { - slapi_log_error(SLAPI_LOG_ERR, repl_plugin_name, "replica_new_updatedn_list - " + slapi_log_err(SLAPI_LOG_ERR, repl_plugin_name, "replica_new_updatedn_list - " "Failed to allocate hash table; NSPR error - %d\n", PR_GetError ()); return NULL; @@ -150,7 +150,7 @@ replica_updatedn_list_delete(ReplicaUpdateDNList list, const Slapi_ValueSet *vs) Slapi_DN *deldn = (Slapi_DN *)PL_HashTableLookup(hash, slapi_sdn_get_ndn(dn)); if (deldn == NULL) { - slapi_log_error(SLAPI_LOG_REPL, repl_plugin_name, "replica_updatedn_list_delete -" + slapi_log_err(SLAPI_LOG_REPL, repl_plugin_name, "replica_updatedn_list_delete -" "Update DN with value (%s) is not in the update DN list.\n", slapi_sdn_get_ndn(dn)); } else { @@ -245,7 +245,7 @@ replica_updatedn_list_add_ext(ReplicaUpdateDNList list, const Slapi_ValueSet *vs /* make sure that the name is unique */ if (PL_HashTableLookup(hash, ndn) != NULL) { - slapi_log_error(SLAPI_LOG_REPL, repl_plugin_name, "replica_updatedn_list_add - " + slapi_log_err(SLAPI_LOG_REPL, repl_plugin_name, "replica_updatedn_list_add - " "Update DN with value (%s) already in the update DN list\n", ndn); slapi_sdn_free(&dn); diff --git a/ldap/servers/plugins/replication/repl_bind.c b/ldap/servers/plugins/replication/repl_bind.c index 06bc361..ad351dc 100644 --- a/ldap/servers/plugins/replication/repl_bind.c +++ b/ldap/servers/plugins/replication/repl_bind.c @@ -40,7 +40,7 @@ legacy_preop_bind( Slapi_PBlock *pb ) void *conn = NULL; consumer_connection_extension *connext = NULL; #ifdef DEBUG - slapi_log_error(SLAPI_LOG_REPL, REPLICATION_SUBSYSTEM, "legacy_preop_bind: begin\n"); + slapi_log_err(SLAPI_LOG_REPL, REPLICATION_SUBSYSTEM, "legacy_preop_bind: begin\n"); #endif slapi_pblock_get( pb, SLAPI_CONNECTION, &conn ); /* TEL 20120529 - Is there any reason we must protect this connext access? */ diff --git a/ldap/servers/plugins/replication/repl_connext.c b/ldap/servers/plugins/replication/repl_connext.c index 5638d0b..29dc2a7 100644 --- a/ldap/servers/plugins/replication/repl_connext.c +++ b/ldap/servers/plugins/replication/repl_connext.c @@ -31,7 +31,7 @@ void* consumer_connection_extension_constructor (void *object, void *parent) consumer_connection_extension *ext = (consumer_connection_extension*) slapi_ch_malloc (sizeof (consumer_connection_extension)); if (ext == NULL) { - slapi_log_error(SLAPI_LOG_PLUGIN, repl_plugin_name, "consumer_connection_extension_constructor - " + slapi_log_err(SLAPI_LOG_PLUGIN, repl_plugin_name, "consumer_connection_extension_constructor - " "Unable to create replication consumer connection extension - out of memory\n" ); } else @@ -46,7 +46,7 @@ void* consumer_connection_extension_constructor (void *object, void *parent) ext->lock = PR_NewLock(); if (NULL == ext->lock) { - slapi_log_error(SLAPI_LOG_PLUGIN, repl_plugin_name, "consumer_connection_extension_constructor - " + slapi_log_err(SLAPI_LOG_PLUGIN, repl_plugin_name, "consumer_connection_extension_constructor - " "Unable to create replication consumer connection extension lock - out of memory\n" ); /* no need to go through the full destructor, but still need to free up this memory */ slapi_ch_free((void **)&ext); @@ -81,7 +81,7 @@ void consumer_connection_extension_destructor (void *ext, void *object, void *pa slapi_pblock_set(pb, SLAPI_CONNECTION, connext->connection); slapi_pblock_set(pb, SLAPI_TARGET_SDN, (void*)repl_root_sdn); slapi_pblock_get(pb, SLAPI_CONN_ID, &connid); - slapi_log_error(SLAPI_LOG_REPL, repl_plugin_name, + slapi_log_err(SLAPI_LOG_REPL, repl_plugin_name, "consumer_connection_extension_destructor - " "Aborting total update in progress for replicated " "area %s connid=%" NSPRIu64 "\n", slapi_sdn_get_dn(repl_root_sdn), connid); @@ -89,7 +89,7 @@ void consumer_connection_extension_destructor (void *ext, void *object, void *pa } else { - slapi_log_error(SLAPI_LOG_ERR, repl_plugin_name, + slapi_log_err(SLAPI_LOG_ERR, repl_plugin_name, "consumer_connection_extension_destructor - Can't determine root " "of replicated area.\n"); } @@ -154,7 +154,7 @@ consumer_connection_extension_acquire_exclusive_access(void* conn, PRUint64 conn /* step 4, take it! */ connext->in_use_opid = opid; ret = connext; - slapi_log_error(SLAPI_LOG_REPL, repl_plugin_name, + slapi_log_err(SLAPI_LOG_REPL, repl_plugin_name, "consumer_connection_extension_acquire_exclusive_access - " "conn=%" NSPRIu64 " op=%d Acquired consumer connection extension\n", connid, opid); @@ -162,14 +162,14 @@ consumer_connection_extension_acquire_exclusive_access(void* conn, PRUint64 conn else if (opid == connext->in_use_opid) { ret = connext; - slapi_log_error(SLAPI_LOG_REPL, repl_plugin_name, + slapi_log_err(SLAPI_LOG_REPL, repl_plugin_name, "consumer_connection_extension_acquire_exclusive_access - " "conn=%" NSPRIu64 " op=%d Reacquired consumer connection extension\n", connid, opid); } else { - slapi_log_error(SLAPI_LOG_REPL, repl_plugin_name, + slapi_log_err(SLAPI_LOG_REPL, repl_plugin_name, "consumer_connection_extension_acquire_exclusive_access - " "conn=%" NSPRIu64 " op=%d Could not acquire consumer connection extension; it is in use by op=%d\n", connid, opid, connext->in_use_opid); @@ -180,7 +180,7 @@ consumer_connection_extension_acquire_exclusive_access(void* conn, PRUint64 conn } else { - slapi_log_error(SLAPI_LOG_REPL, repl_plugin_name, + slapi_log_err(SLAPI_LOG_REPL, repl_plugin_name, "consumer_connection_extension_acquire_exclusive_access - " "conn=%" NSPRIu64 " op=%d Could not acquire consumer extension, it is NULL!\n", connid, opid); @@ -219,7 +219,7 @@ consumer_connection_extension_relinquish_exclusive_access(void* conn, PRUint64 c /* step 3, see if it is in use */ if (0 > connext->in_use_opid) { - slapi_log_error(SLAPI_LOG_REPL, repl_plugin_name, + slapi_log_err(SLAPI_LOG_REPL, repl_plugin_name, "consumer_connection_extension_relinquish_exclusive_access - " "conn=%" NSPRIu64 " op=%d Consumer connection extension is not in use\n", connid, opid); @@ -228,7 +228,7 @@ consumer_connection_extension_relinquish_exclusive_access(void* conn, PRUint64 c else if (opid == connext->in_use_opid) { /* step 4, relinquish it (normal) */ - slapi_log_error(SLAPI_LOG_REPL, repl_plugin_name, + slapi_log_err(SLAPI_LOG_REPL, repl_plugin_name, "consumer_connection_extension_relinquish_exclusive_access - " "conn=%" NSPRIu64 " op=%d Relinquishing consumer connection extension\n", connid, opid); @@ -238,7 +238,7 @@ consumer_connection_extension_relinquish_exclusive_access(void* conn, PRUint64 c else if (force) { /* step 4, relinquish it (forced) */ - slapi_log_error(SLAPI_LOG_REPL, repl_plugin_name, + slapi_log_err(SLAPI_LOG_REPL, repl_plugin_name, "consumer_connection_extension_relinquish_exclusive_access - " "conn=%" NSPRIu64 " op=%d Forced to relinquish consumer connection extension held by op=%d\n", connid, opid, connext->in_use_opid); @@ -247,7 +247,7 @@ consumer_connection_extension_relinquish_exclusive_access(void* conn, PRUint64 c } else { - slapi_log_error(SLAPI_LOG_REPL, repl_plugin_name, + slapi_log_err(SLAPI_LOG_REPL, repl_plugin_name, "consumer_connection_extension_relinquish_exclusive_access - " "conn=%" NSPRIu64 " op=%d Not relinquishing consumer connection extension, it is held by op=%d!\n", connid, opid, connext->in_use_opid); @@ -258,7 +258,7 @@ consumer_connection_extension_relinquish_exclusive_access(void* conn, PRUint64 c } else { - slapi_log_error(SLAPI_LOG_REPL, repl_plugin_name, + slapi_log_err(SLAPI_LOG_REPL, repl_plugin_name, "consumer_connection_extension_relinquish_exclusive_access - " "conn=%" NSPRIu64 " op=%d Could not relinquish consumer extension, it is NULL!\n", connid, opid); diff --git a/ldap/servers/plugins/replication/repl_extop.c b/ldap/servers/plugins/replication/repl_extop.c index 5166818..948f38d 100644 --- a/ldap/servers/plugins/replication/repl_extop.c +++ b/ldap/servers/plugins/replication/repl_extop.c @@ -666,7 +666,7 @@ multimaster_extop_StartNSDS50ReplicationRequest(Slapi_PBlock *pb) /* Stash info that this is an incremental update session */ connext->repl_protocol_version = REPL_PROTOCOL_50_INCREMENTAL; - slapi_log_error(SLAPI_LOG_REPL, repl_plugin_name, + slapi_log_err(SLAPI_LOG_REPL, repl_plugin_name, "multimaster_extop_StartNSDS50ReplicationRequest - " "conn=%" NSPRIu64 " op=%d repl=\"%s\": Begin incremental protocol\n", connid, opid, repl_root); @@ -693,7 +693,7 @@ multimaster_extop_StartNSDS50ReplicationRequest(Slapi_PBlock *pb) { connext->repl_protocol_version = REPL_PROTOCOL_50_TOTALUPDATE; } - slapi_log_error(SLAPI_LOG_REPL, repl_plugin_name, + slapi_log_err(SLAPI_LOG_REPL, repl_plugin_name, "multimaster_extop_StartNSDS50ReplicationRequest - " "conn=%" NSPRIu64 " op=%d repl=\"%s\": Begin total protocol\n", connid, opid, repl_root); @@ -703,7 +703,7 @@ multimaster_extop_StartNSDS50ReplicationRequest(Slapi_PBlock *pb) { /* Stash info that this is an incremental update session */ connext->repl_protocol_version = REPL_PROTOCOL_50_INCREMENTAL; - slapi_log_error(SLAPI_LOG_REPL, repl_plugin_name, + slapi_log_err(SLAPI_LOG_REPL, repl_plugin_name, "multimaster_extop_StartNSDS50ReplicationRequest - " "conn=%" NSPRIu64 " op=%d repl=\"%s\": Begin 7.1 incremental protocol\n", connid, opid, repl_root); @@ -716,7 +716,7 @@ multimaster_extop_StartNSDS50ReplicationRequest(Slapi_PBlock *pb) { connext->repl_protocol_version = REPL_PROTOCOL_50_TOTALUPDATE; } - slapi_log_error(SLAPI_LOG_REPL, repl_plugin_name, + slapi_log_err(SLAPI_LOG_REPL, repl_plugin_name, "multimaster_extop_StartNSDS50ReplicationRequest - " "conn=%" NSPRIu64 " op=%d repl=\"%s\": Begin 7.1 total protocol\n", connid, opid, repl_root); @@ -739,7 +739,7 @@ multimaster_extop_StartNSDS50ReplicationRequest(Slapi_PBlock *pb) /* see if this replica is being configured and wait for it */ if (replica_is_being_configured(repl_root)) { - slapi_log_error(SLAPI_LOG_REPL, repl_plugin_name, + slapi_log_err(SLAPI_LOG_REPL, repl_plugin_name, "multimaster_extop_StartNSDS50ReplicationRequest - " "conn=%" NSPRIu64 " op=%d replica=\"%s\": " "Replica is being configured: try again later\n", @@ -767,7 +767,7 @@ multimaster_extop_StartNSDS50ReplicationRequest(Slapi_PBlock *pb) if (replica_is_state_flag_set(replica, REPLICA_TOTAL_EXCL_SEND|REPLICA_TOTAL_EXCL_RECV)) { - slapi_log_error(SLAPI_LOG_ERR, repl_plugin_name, + slapi_log_err(SLAPI_LOG_ERR, repl_plugin_name, "multimaster_extop_StartNSDS50ReplicationRequest - " "%s: total update on is initiated on the replica. Cannot execute the total update from other master.\n", repl_root); response = NSDS50_REPL_REPLICA_BUSY; @@ -812,7 +812,7 @@ multimaster_extop_StartNSDS50ReplicationRequest(Slapi_PBlock *pb) rc = replica_update_csngen_state_ext (replica, supplier_ruv, replicacsn); /* too much skew */ if (rc == CSN_LIMIT_EXCEEDED) { - slapi_log_error(SLAPI_LOG_ERR, repl_plugin_name, + slapi_log_err(SLAPI_LOG_ERR, repl_plugin_name, "multimaster_extop_StartNSDS50ReplicationRequest - " "conn=%" NSPRIu64 " op=%d repl=\"%s\": " "Excessive clock skew from supplier RUV\n", @@ -850,7 +850,7 @@ multimaster_extop_StartNSDS50ReplicationRequest(Slapi_PBlock *pb) } if (check_replica_id_uniqueness(replica, supplier_ruv) != 0){ - slapi_log_error(SLAPI_LOG_REPL, repl_plugin_name, + slapi_log_err(SLAPI_LOG_REPL, repl_plugin_name, "multimaster_extop_StartNSDS50ReplicationRequest - " "conn=%" NSPRIu64 " op=%d repl=\"%s\": " "Replica has same replicaID %d as supplier\n", @@ -890,7 +890,7 @@ multimaster_extop_StartNSDS50ReplicationRequest(Slapi_PBlock *pb) if (getenv("SLAPD_TEST_TICKET_374") && (opid > 20)) { int i = 0; int max = 480 * 5; - slapi_log_error(SLAPI_LOG_REPL, repl_plugin_name, + slapi_log_err(SLAPI_LOG_REPL, repl_plugin_name, "multimaster_extop_StartNSDS50ReplicationRequest - " "conn=%" NSPRIu64 " op=%d repl=\"%s\": " "374 - Starting sleep: connext->repl_protocol_version == %d\n", @@ -900,7 +900,7 @@ multimaster_extop_StartNSDS50ReplicationRequest(Slapi_PBlock *pb) usleep(200000); } - slapi_log_error(SLAPI_LOG_REPL, repl_plugin_name, + slapi_log_err(SLAPI_LOG_REPL, repl_plugin_name, "multimaster_extop_StartNSDS50ReplicationRequest - " "conn=%" NSPRIu64 " op=%d repl=\"%s\": " "374 - Finished sleep: connext->repl_protocol_version == %d\n", @@ -995,7 +995,7 @@ multimaster_extop_StartNSDS50ReplicationRequest(Slapi_PBlock *pb) * than assuming a total update was requested. * https://fedorahosted.org/389/ticket/374 */ response = NSDS50_REPL_INTERNAL_ERROR; - slapi_log_error(SLAPI_LOG_REPL, repl_plugin_name, + slapi_log_err(SLAPI_LOG_REPL, repl_plugin_name, "multimaster_extop_StartNSDS50ReplicationRequest - " "conn=%" NSPRIu64 " op=%d repl=\"%s\": " "Unexpected update protocol received: %d. " @@ -1036,7 +1036,7 @@ send_response: resp_log_level = SLAPI_LOG_REPL; } - slapi_log_error (resp_log_level, + slapi_log_err (resp_log_level, repl_plugin_name, "multimaster_extop_StartNSDS50ReplicationRequest - " "conn=%" NSPRIu64 " op=%d replica=\"%s\": " @@ -1090,7 +1090,7 @@ send_response: } slapi_pblock_set(pb, SLAPI_EXT_OP_RET_VALUE, resp_bval); - slapi_log_error(SLAPI_LOG_REPL, repl_plugin_name, + slapi_log_err(SLAPI_LOG_REPL, repl_plugin_name, "multimaster_extop_StartNSDS50ReplicationRequest - " "conn=%" NSPRIu64 " op=%d repl=\"%s\": " "%s: response=%d rc=%d\n", @@ -1463,7 +1463,7 @@ multimaster_extop_abort_cleanruv(Slapi_PBlock *pb) * Decode the payload, and grab our settings */ if(decode_cleanruv_payload(extop_payload, &payload)){ - slapi_log_error(SLAPI_LOG_ERR, repl_plugin_name, "multimaster_extop_abort_cleanruv - " + slapi_log_err(SLAPI_LOG_ERR, repl_plugin_name, "multimaster_extop_abort_cleanruv - " "Abort CleanAllRUV Task - Failed to decode payload. Aborting ext op\n"); return LDAP_OPERATIONS_ERROR; } @@ -1475,14 +1475,14 @@ multimaster_extop_abort_cleanruv(Slapi_PBlock *pb) /* This replica has already been aborted, or was never cleaned, or already finished cleaning */ goto out; } else { - slapi_log_error(SLAPI_LOG_INFO, repl_plugin_name, "multimaster_extop_abort_cleanruv - " + slapi_log_err(SLAPI_LOG_INFO, repl_plugin_name, "multimaster_extop_abort_cleanruv - " "Abort CleanAllRUV Task - Aborting cleanallruv task for rid(%d)\n", rid); } /* * Get the node, so we can get the replica and its agreements */ if((mtnode_ext = replica_config_get_mtnode_by_dn(repl_root)) == NULL){ - slapi_log_error(SLAPI_LOG_ERR, repl_plugin_name, "multimaster_extop_abort_cleanruv - " + slapi_log_err(SLAPI_LOG_ERR, repl_plugin_name, "multimaster_extop_abort_cleanruv - " "Abort CleanAllRUV Task - Failed to get replication node " "from (%s), aborting operation\n", repl_root); rc = LDAP_OPERATIONS_ERROR; @@ -1492,7 +1492,7 @@ multimaster_extop_abort_cleanruv(Slapi_PBlock *pb) object_acquire (mtnode_ext->replica); release_it = 1; } else { - slapi_log_error(SLAPI_LOG_ERR, repl_plugin_name, "multimaster_extop_abort_cleanruv - " + slapi_log_err(SLAPI_LOG_ERR, repl_plugin_name, "multimaster_extop_abort_cleanruv - " "Abort CleanAllRUV Task - Replica is missing from (%s), " "aborting operation\n",repl_root); rc = LDAP_OPERATIONS_ERROR; @@ -1500,7 +1500,7 @@ multimaster_extop_abort_cleanruv(Slapi_PBlock *pb) } r = (Replica*)object_get_data (mtnode_ext->replica); if(r == NULL){ - slapi_log_error(SLAPI_LOG_ERR, repl_plugin_name, "multimaster_extop_abort_cleanruv - " + slapi_log_err(SLAPI_LOG_ERR, repl_plugin_name, "multimaster_extop_abort_cleanruv - " "Abort CleanAllRUV Task - Replica is NULL, aborting task\n"); rc = LDAP_OPERATIONS_ERROR; goto out; @@ -1510,7 +1510,7 @@ multimaster_extop_abort_cleanruv(Slapi_PBlock *pb) */ data = (cleanruv_data*)slapi_ch_calloc(1, sizeof(cleanruv_data)); if (data == NULL) { - slapi_log_error(SLAPI_LOG_REPL, repl_plugin_name, "multimaster_extop_abort_cleanruv - " + slapi_log_err(SLAPI_LOG_REPL, repl_plugin_name, "multimaster_extop_abort_cleanruv - " "Abort CleanAllRUV Task - Failed to allocate " "abort_cleanruv_data. Aborting task.\n"); rc = LDAP_OPERATIONS_ERROR; @@ -1536,7 +1536,7 @@ multimaster_extop_abort_cleanruv(Slapi_PBlock *pb) (void *)data, PR_PRIORITY_NORMAL, PR_GLOBAL_THREAD, PR_UNJOINABLE_THREAD, SLAPD_DEFAULT_THREAD_STACKSIZE); if (thread == NULL) { - slapi_log_error(SLAPI_LOG_REPL, repl_plugin_name, "multimaster_extop_abort_cleanruv - " + slapi_log_err(SLAPI_LOG_REPL, repl_plugin_name, "multimaster_extop_abort_cleanruv - " "Abort CleanAllRUV Task - Unable to create abort " "thread. Aborting task.\n"); release_it = 1; /* have to release mtnode_ext->replica now */ @@ -1600,7 +1600,7 @@ multimaster_extop_cleanruv(Slapi_PBlock *pb) * Decode the payload */ if(decode_cleanruv_payload(extop_payload, &payload)){ - slapi_log_error(SLAPI_LOG_ERR, repl_plugin_name, "multimaster_extop_cleanruv - CleanAllRUV Task - Failed to decode payload. Aborting ext op\n"); + slapi_log_err(SLAPI_LOG_ERR, repl_plugin_name, "multimaster_extop_cleanruv - CleanAllRUV Task - Failed to decode payload. Aborting ext op\n"); goto free_and_return; } rid = atoi(ldap_utf8strtok_r(payload, ":", &iter)); @@ -1624,7 +1624,7 @@ multimaster_extop_cleanruv(Slapi_PBlock *pb) * Get the node, so we can get the replica and its agreements */ if((mtnode_ext = replica_config_get_mtnode_by_dn(repl_root)) == NULL){ - slapi_log_error(SLAPI_LOG_ERR, repl_plugin_name, "multimaster_extop_cleanruv - CleanAllRUV Task - Failed to get replication node " + slapi_log_err(SLAPI_LOG_ERR, repl_plugin_name, "multimaster_extop_cleanruv - CleanAllRUV Task - Failed to get replication node " "from (%s), aborting operation\n", repl_root); goto free_and_return; } @@ -1633,14 +1633,14 @@ multimaster_extop_cleanruv(Slapi_PBlock *pb) object_acquire (mtnode_ext->replica); release_it = 1; } else { - slapi_log_error(SLAPI_LOG_ERR, repl_plugin_name, "multimaster_extop_cleanruv - CleanAllRUV Task - Replica is missing from (%s), " + slapi_log_err(SLAPI_LOG_ERR, repl_plugin_name, "multimaster_extop_cleanruv - CleanAllRUV Task - Replica is missing from (%s), " "aborting operation\n",repl_root); goto free_and_return; } r = (Replica*)object_get_data (mtnode_ext->replica); if(r == NULL){ - slapi_log_error(SLAPI_LOG_ERR, repl_plugin_name, "multimaster_extop_cleanruv - CleanAllRUV Task - Replica is NULL, aborting task\n"); + slapi_log_err(SLAPI_LOG_ERR, repl_plugin_name, "multimaster_extop_cleanruv - CleanAllRUV Task - Replica is NULL, aborting task\n"); goto free_and_return; } @@ -1650,10 +1650,10 @@ multimaster_extop_cleanruv(Slapi_PBlock *pb) * * This will also release mtnode_ext->replica */ - slapi_log_error(SLAPI_LOG_INFO, repl_plugin_name, "multimaster_extop_cleanruv - CleanAllRUV Task - Launching cleanAllRUV thread...\n"); + slapi_log_err(SLAPI_LOG_INFO, repl_plugin_name, "multimaster_extop_cleanruv - CleanAllRUV Task - Launching cleanAllRUV thread...\n"); data = (cleanruv_data*)slapi_ch_calloc(1, sizeof(cleanruv_data)); if (data == NULL) { - slapi_log_error(SLAPI_LOG_ERR, repl_plugin_name, "multimaster_extop_cleanruv - CleanAllRUV Task - Failed to allocate " + slapi_log_err(SLAPI_LOG_ERR, repl_plugin_name, "multimaster_extop_cleanruv - CleanAllRUV Task - Failed to allocate " "cleanruv_Data\n"); goto free_and_return; } @@ -1670,7 +1670,7 @@ multimaster_extop_cleanruv(Slapi_PBlock *pb) (void *)data, PR_PRIORITY_NORMAL, PR_GLOBAL_THREAD, PR_UNJOINABLE_THREAD, SLAPD_DEFAULT_THREAD_STACKSIZE); if (thread == NULL) { - slapi_log_error(SLAPI_LOG_ERR, repl_plugin_name, "multimaster_extop_cleanruv - CleanAllRUV Task - Unable to create cleanAllRUV " + slapi_log_err(SLAPI_LOG_ERR, repl_plugin_name, "multimaster_extop_cleanruv - CleanAllRUV Task - Unable to create cleanAllRUV " "monitoring thread. Aborting task.\n"); ber_bvfree(data->payload); data->payload = NULL; @@ -1697,18 +1697,18 @@ multimaster_extop_cleanruv(Slapi_PBlock *pb) /* we've already been cleaned */ break; } - slapi_log_error(SLAPI_LOG_INFO, repl_plugin_name, "multimaster_extop_cleanruv - CleanAllRUV Task - Checking if we're caught up...\n"); + slapi_log_err(SLAPI_LOG_INFO, repl_plugin_name, "multimaster_extop_cleanruv - CleanAllRUV Task - Checking if we're caught up...\n"); if(ruv_covers_csn_cleanallruv(ruv,maxcsn) || csn_get_replicaid(maxcsn) == 0|| strcmp(force,"yes") == 0){ /* We are caught up */ break; } else { char csnstr[CSN_STRSIZE]; csn_as_string(maxcsn, PR_FALSE, csnstr); - slapi_log_error(SLAPI_LOG_NOTICE, repl_plugin_name, "multimaster_extop_cleanruv - CleanAllRUV Task - Not ruv caught up maxcsn(%s)\n", csnstr); + slapi_log_err(SLAPI_LOG_NOTICE, repl_plugin_name, "multimaster_extop_cleanruv - CleanAllRUV Task - Not ruv caught up maxcsn(%s)\n", csnstr); } DS_Sleep(PR_SecondsToInterval(5)); } - slapi_log_error(SLAPI_LOG_INFO, repl_plugin_name, "multimaster_extop_cleanruv - CleanAllRUV Task - We're caught up...\n"); + slapi_log_err(SLAPI_LOG_INFO, repl_plugin_name, "multimaster_extop_cleanruv - CleanAllRUV Task - We're caught up...\n"); /* * Set cleaned rid in memory only - does not survive a server restart */ @@ -1724,8 +1724,8 @@ multimaster_extop_cleanruv(Slapi_PBlock *pb) * This read-only replica has no easy way to tell when it's safe to release the rid. * So we won't release it, not until a server restart. */ - slapi_log_error(SLAPI_LOG_NOTICE, repl_plugin_name, "multimaster_extop_cleanruv - CleanAllRUV Task - You must restart the server if you want to reuse rid(%d).\n", rid); - slapi_log_error(SLAPI_LOG_INFO, repl_plugin_name, "multimaster_extop_cleanruv - CleanAllRUV Task - Successfully cleaned rid(%d).\n", rid); + slapi_log_err(SLAPI_LOG_NOTICE, repl_plugin_name, "multimaster_extop_cleanruv - CleanAllRUV Task - You must restart the server if you want to reuse rid(%d).\n", rid); + slapi_log_err(SLAPI_LOG_INFO, repl_plugin_name, "multimaster_extop_cleanruv - CleanAllRUV Task - Successfully cleaned rid(%d).\n", rid); rc = LDAP_SUCCESS; } @@ -1792,7 +1792,7 @@ multimaster_extop_cleanruv_get_maxcsn(Slapi_PBlock *pb) * Decode the payload */ if(decode_cleanruv_payload(extop_payload, &payload)){ - slapi_log_error(SLAPI_LOG_ERR, repl_plugin_name, "multimaster_extop_cleanruv_get_maxcsn - CleanAllRUV Task - Get MaxCSN Task: failed to decode payload. Aborting ext op\n"); + slapi_log_err(SLAPI_LOG_ERR, repl_plugin_name, "multimaster_extop_cleanruv_get_maxcsn - CleanAllRUV Task - Get MaxCSN Task: failed to decode payload. Aborting ext op\n"); goto free_and_return; } rid = atoi(ldap_utf8strtok_r(payload, ":", &iter)); @@ -1861,7 +1861,7 @@ multimaster_extop_cleanruv_check_status(Slapi_PBlock *pb) * Decode the payload - which should just be a filter */ if(decode_cleanruv_payload(extop_payload, &filter)){ - slapi_log_error(SLAPI_LOG_ERR, repl_plugin_name, "multimaster_extop_cleanruv_check_status - " + slapi_log_err(SLAPI_LOG_ERR, repl_plugin_name, "multimaster_extop_cleanruv_check_status - " "CleanAllRUV Task - Check Status Task: failed to decode payload. Aborting ext op\n"); goto free_and_return; } diff --git a/ldap/servers/plugins/replication/repl_init.c b/ldap/servers/plugins/replication/repl_init.c index 3fe344d..29855b6 100644 --- a/ldap/servers/plugins/replication/repl_init.c +++ b/ldap/servers/plugins/replication/repl_init.c @@ -72,7 +72,7 @@ legacy_preop_init( Slapi_PBlock *pb ) slapi_pblock_set( pb, SLAPI_PLUGIN_PRE_COMPARE_FN, (void *) legacy_preop_compare ) != 0 || slapi_pblock_set( pb, SLAPI_PLUGIN_PRE_ENTRY_FN, (void *) legacy_pre_entry )) { - slapi_log_error(SLAPI_LOG_PLUGIN, repl_plugin_name, "legacy_preop_init failed\n" ); + slapi_log_err(SLAPI_LOG_PLUGIN, repl_plugin_name, "legacy_preop_init failed\n" ); rc= -1; } return rc; @@ -93,7 +93,7 @@ legacy_postop_init( Slapi_PBlock *pb ) slapi_pblock_set( pb, SLAPI_PLUGIN_POST_MODIFY_FN, (void *) legacy_postop_modify ) != 0 || slapi_pblock_set( pb, SLAPI_PLUGIN_POST_MODRDN_FN, (void *) legacy_postop_modrdn ) != 0 ) { - slapi_log_error(SLAPI_LOG_PLUGIN, repl_plugin_name, "legacy_postop_init failed\n" ); + slapi_log_err(SLAPI_LOG_PLUGIN, repl_plugin_name, "legacy_postop_init failed\n" ); rc= -1; } @@ -115,7 +115,7 @@ legacy_internalpreop_init( Slapi_PBlock *pb ) slapi_pblock_set( pb, SLAPI_PLUGIN_INTERNAL_PRE_MODIFY_FN, (void *) legacy_preop_modify ) != 0 || slapi_pblock_set( pb, SLAPI_PLUGIN_INTERNAL_PRE_MODRDN_FN, (void *) legacy_preop_modrdn ) != 0 ) { - slapi_log_error(SLAPI_LOG_PLUGIN, repl_plugin_name, "legacy_internalpreop_init failed\n" ); + slapi_log_err(SLAPI_LOG_PLUGIN, repl_plugin_name, "legacy_internalpreop_init failed\n" ); rc= -1; } return rc; @@ -136,7 +136,7 @@ legacy_internalpostop_init( Slapi_PBlock *pb ) slapi_pblock_set( pb, SLAPI_PLUGIN_INTERNAL_POST_MODIFY_FN, (void *) legacy_postop_modify ) != 0 || slapi_pblock_set( pb, SLAPI_PLUGIN_INTERNAL_POST_MODRDN_FN, (void *) legacy_postop_modrdn ) != 0 ) { - slapi_log_error(SLAPI_LOG_PLUGIN, repl_plugin_name, "legacy_internalpostop_init failed\n" ); + slapi_log_err(SLAPI_LOG_PLUGIN, repl_plugin_name, "legacy_internalpostop_init failed\n" ); rc= -1; } @@ -155,7 +155,7 @@ legacy_entry_init( Slapi_PBlock *pb ) if( slapi_pblock_set( pb, SLAPI_PLUGIN_VERSION, SLAPI_PLUGIN_VERSION_01 ) != 0 || slapi_pblock_set( pb, SLAPI_PLUGIN_DESCRIPTION, (void *)&legacyentrydesc ) != 0 ) { - slapi_log_error(SLAPI_LOG_PLUGIN, repl_plugin_name, "legacy_entry_init failed\n" ); + slapi_log_err(SLAPI_LOG_PLUGIN, repl_plugin_name, "legacy_entry_init failed\n" ); rc= -1; } return rc; @@ -217,7 +217,7 @@ legacy_start( Slapi_PBlock *pb ) ctrc = create_config_top(); if (ctrc != LDAP_SUCCESS && ctrc != LDAP_ALREADY_EXISTS) { - slapi_log_error(SLAPI_LOG_ERR, repl_plugin_name, "Warning: unable to " + slapi_log_err(SLAPI_LOG_ERR, repl_plugin_name, "Warning: unable to " "create configuration entry %s: %s\n", REPL_CONFIG_TOP, ldap_err2string(ctrc)); } diff --git a/ldap/servers/plugins/replication/repl_opext.c b/ldap/servers/plugins/replication/repl_opext.c index d117c7e..2f622bd 100644 --- a/ldap/servers/plugins/replication/repl_opext.c +++ b/ldap/servers/plugins/replication/repl_opext.c @@ -26,7 +26,7 @@ void* supplier_operation_extension_constructor (void *object, void *parent) supplier_operation_extension *ext = (supplier_operation_extension*) slapi_ch_calloc (1, sizeof (supplier_operation_extension)); if (ext == NULL) { - slapi_log_error(SLAPI_LOG_PLUGIN, repl_plugin_name, "unable to create replication supplier operation extension - out of memory\n" ); + slapi_log_err(SLAPI_LOG_PLUGIN, repl_plugin_name, "unable to create replication supplier operation extension - out of memory\n" ); } else { @@ -57,7 +57,7 @@ void* consumer_operation_extension_constructor (void *object, void *parent) consumer_operation_extension *ext = (consumer_operation_extension*) slapi_ch_calloc (1, sizeof (consumer_operation_extension)); if (ext == NULL) { - slapi_log_error(SLAPI_LOG_PLUGIN, repl_plugin_name, "unable to create replication consumer operation extension - out of memory\n" ); + slapi_log_err(SLAPI_LOG_PLUGIN, repl_plugin_name, "unable to create replication consumer operation extension - out of memory\n" ); } if(object!=NULL && parent!=NULL) { diff --git a/ldap/servers/plugins/replication/repl_ops.c b/ldap/servers/plugins/replication/repl_ops.c index 0155526..76f0f48 100644 --- a/ldap/servers/plugins/replication/repl_ops.c +++ b/ldap/servers/plugins/replication/repl_ops.c @@ -78,7 +78,7 @@ legacy_preop(Slapi_PBlock *pb, const char *caller, int operation_type) if (NULL == operation) { slapi_send_ldap_result(pb, LDAP_UNWILLING_TO_PERFORM, NULL, "Null replication operation is given", 0, NULL); - slapi_log_error(SLAPI_LOG_ERR, repl_plugin_name, + slapi_log_err(SLAPI_LOG_ERR, repl_plugin_name, "Null replication operation is given\n"); return -1; } @@ -91,7 +91,7 @@ legacy_preop(Slapi_PBlock *pb, const char *caller, int operation_type) Just refuse it */ slapi_send_ldap_result(pb, LDAP_UNWILLING_TO_PERFORM, NULL, "Replication operation refused because the consumer is not defined as a replica", 0, NULL); - slapi_log_error(SLAPI_LOG_ERR, repl_plugin_name, + slapi_log_err(SLAPI_LOG_ERR, repl_plugin_name, "Incoming replication operation was refused because " "there's no replica defined for this operation\n"); return -1; @@ -116,7 +116,7 @@ legacy_preop(Slapi_PBlock *pb, const char *caller, int operation_type) slapi_send_ldap_result(pb, LDAP_UNWILLING_TO_PERFORM, NULL, "Replication operation refused because " "the consumer is not defined as a legacy replica", 0, NULL); - slapi_log_error(SLAPI_LOG_ERR, repl_plugin_name, + slapi_log_err(SLAPI_LOG_ERR, repl_plugin_name, "Incoming replication operation was refused because " "there's no legacy replica defined for this operation\n"); return -1; diff --git a/ldap/servers/plugins/replication/repl_session_plugin.c b/ldap/servers/plugins/replication/repl_session_plugin.c index ab40345..b8dd63f 100644 --- a/ldap/servers/plugins/replication/repl_session_plugin.c +++ b/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))) { - LDAPDebug1Arg(LDAP_DEBUG_PLUGIN, - "<-- repl_session_plugin_init -- no replication session" + slapi_log_err(SLAPI_LOG_PLUGIN, + "repl_session_plugin_init", "No replication session" " plugin API registered for GUID [%s] -- end\n", REPL_SESSION_v1_0_GUID); } @@ -41,7 +41,7 @@ repl_session_plugin_call_agmt_init_cb(Repl_Agmt *ra) Slapi_DN *replarea = NULL; repl_session_plugin_agmt_init_cb initfunc = NULL; - LDAPDebug0Args(LDAP_DEBUG_PLUGIN, "--> repl_session_plugin_call_agmt_init_cb - begin\n"); + slapi_log_err(SLAPI_LOG_PLUGIN, "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 +49,7 @@ repl_session_plugin_call_agmt_init_cb(Repl_Agmt *ra) if (initfunc) { replarea = agmt_get_replarea(ra); if (!replarea) { - LDAPDebug0Args(LDAP_DEBUG_ERR, "repl_session_plugin_call_agmt_init_cb - Aborted - No replication area\n"); + slapi_log_err(SLAPI_LOG_ERR, "repl_session_plugin_call_agmt_init_cb", "Aborted - No replication area\n"); return; } cookie = (*initfunc)(replarea); @@ -58,7 +58,7 @@ repl_session_plugin_call_agmt_init_cb(Repl_Agmt *ra) agmt_set_priv(ra, cookie); - LDAPDebug0Args(LDAP_DEBUG_PLUGIN, "<-- repl_session_plugin_call_agmt_init_cb - end\n"); + slapi_log_err(SLAPI_LOG_PLUGIN, "<-- repl_session_plugin_call_agmt_init_cb", " end\n"); return; } @@ -78,7 +78,7 @@ repl_session_plugin_call_pre_acquire_cb(const Repl_Agmt *ra, int is_total, if (thefunc) { replarea = agmt_get_replarea(ra); if (!replarea) { - LDAPDebug0Args(LDAP_DEBUG_ERR, "repl_session_plugin_call_pre_acquire_cb - Aborted - No replication area\n"); + slapi_log_err(SLAPI_LOG_ERR, "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 +103,7 @@ repl_session_plugin_call_post_acquire_cb(const Repl_Agmt *ra, int is_total, if (thefunc) { replarea = agmt_get_replarea(ra); if (!replarea) { - LDAPDebug0Args(LDAP_DEBUG_ERR, "repl_session_plugin_call_post_acquire_cb - Aborted - No replication area\n"); + slapi_log_err(SLAPI_LOG_ERR, "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 +162,7 @@ repl_session_plugin_call_destroy_agmt_cb(const Repl_Agmt *ra) if (thefunc) { replarea = agmt_get_replarea(ra); if (!replarea) { - LDAPDebug0Args(LDAP_DEBUG_ERR, "repl_session_plugin_call_destroy_agmt_cb - Aborted - No replication area\n"); + slapi_log_err(SLAPI_LOG_ERR, "repl_session_plugin_call_destroy_agmt_cb", "Aborted - No replication area\n"); return; } (*thefunc)(agmt_get_priv(ra), replarea); diff --git a/ldap/servers/plugins/replication/replutil.c b/ldap/servers/plugins/replication/replutil.c index 9bf3985..fe95559 100644 --- a/ldap/servers/plugins/replication/replutil.c +++ b/ldap/servers/plugins/replication/replutil.c @@ -168,14 +168,14 @@ int copyfile(char* source, char * destination, int overwrite, int mode) buffer = slapi_ch_malloc(64*1024); if (NULL == buffer) { - slapi_log_error(SLAPI_LOG_ERR, repl_plugin_name, "copyfile - Memory allocation failed\n"); + slapi_log_err(SLAPI_LOG_ERR, repl_plugin_name, "copyfile - Memory allocation failed\n"); goto error; } /* Open source file */ source_fd = OPEN_FUNCTION(source,O_RDONLY,0); if (-1 == source_fd) { - slapi_log_error(SLAPI_LOG_ERR, repl_plugin_name, + slapi_log_err(SLAPI_LOG_ERR, repl_plugin_name, "copyfile - Failed to open source file %s\n", source); goto error; } @@ -183,7 +183,7 @@ int copyfile(char* source, char * destination, int overwrite, int mode) dest_fd = OPEN_FUNCTION(destination,O_CREAT | O_WRONLY, mode); if (-1 == dest_fd) { - slapi_log_error(SLAPI_LOG_ERR, repl_plugin_name, + slapi_log_err(SLAPI_LOG_ERR, repl_plugin_name, "copyfile - Failed to open destination file %s\n", destination); goto error; } @@ -201,7 +201,7 @@ int copyfile(char* source, char * destination, int overwrite, int mode) if (return_value != bytes_to_write) { /* means error */ - slapi_log_error(SLAPI_LOG_ERR, repl_plugin_name, + slapi_log_err(SLAPI_LOG_ERR, repl_plugin_name, "copyfile - Failed to write to destination file %s\n", destination); return_value = -1; break; @@ -365,7 +365,7 @@ parse_changes_string(char *str) if (rc != 0) { /* ONREPL - log warning */ - slapi_log_error(SLAPI_LOG_REPL, repl_plugin_name, + slapi_log_err(SLAPI_LOG_REPL, repl_plugin_name, "Failed to parse the ldif line.\n"); continue; } @@ -425,28 +425,28 @@ IsValidOperation (const slapi_operation_parameters *op) { if (op == NULL) { - slapi_log_error(SLAPI_LOG_ERR, repl_plugin_name, + slapi_log_err(SLAPI_LOG_ERR, repl_plugin_name, "IsValidOperation - NULL operation\n"); return PR_FALSE; } if (op->csn == NULL) { - slapi_log_error(SLAPI_LOG_ERR, repl_plugin_name, + slapi_log_err(SLAPI_LOG_ERR, repl_plugin_name, "IsValidOperation - NULL operation CSN\n"); return PR_FALSE; } if (op->target_address.uniqueid == NULL) { - slapi_log_error(SLAPI_LOG_ERR, repl_plugin_name, + slapi_log_err(SLAPI_LOG_ERR, repl_plugin_name, "IsValidOperation - NULL entry uniqueid\n"); return PR_FALSE; } if (op->target_address.sdn == NULL) { - slapi_log_error(SLAPI_LOG_ERR, repl_plugin_name, + slapi_log_err(SLAPI_LOG_ERR, repl_plugin_name, "IsValidOperation - NULL entry DN\n"); return PR_FALSE; } @@ -456,7 +456,7 @@ IsValidOperation (const slapi_operation_parameters *op) case SLAPI_OPERATION_ADD: if (op->p.p_add.target_entry == NULL) { - slapi_log_error(SLAPI_LOG_ERR, repl_plugin_name, + slapi_log_err(SLAPI_LOG_ERR, repl_plugin_name, "IsValidOperation - NULL entry for add operation\n"); return PR_FALSE; } @@ -467,7 +467,7 @@ IsValidOperation (const slapi_operation_parameters *op) if (op->p.p_modify.modify_mods == NULL || op->p.p_modify.modify_mods[0] == NULL) { - slapi_log_error(SLAPI_LOG_ERR, repl_plugin_name, + slapi_log_err(SLAPI_LOG_ERR, repl_plugin_name, "IsValidOperation - NULL mods for modify operation\n"); return PR_FALSE; } @@ -478,13 +478,13 @@ IsValidOperation (const slapi_operation_parameters *op) if (op->p.p_modrdn.modrdn_mods == NULL || op->p.p_modrdn.modrdn_mods[0] == NULL) { - slapi_log_error(SLAPI_LOG_ERR, repl_plugin_name, + slapi_log_err(SLAPI_LOG_ERR, repl_plugin_name, "IsValidOperation - NULL mods for modrdn operation\n"); return PR_FALSE; } if (op->p.p_modrdn.modrdn_newrdn == NULL) { - slapi_log_error(SLAPI_LOG_ERR, repl_plugin_name, + slapi_log_err(SLAPI_LOG_ERR, repl_plugin_name, "IsValidOperation - NULL new rdn for modrdn operation\n"); return PR_FALSE; } @@ -638,7 +638,7 @@ repl_set_mtn_state_and_referrals( char **referrals_to_set = NULL; PRBool chain_on_update = is_chain_on_update_setup(repl_root_sdn); if (NULL == mtn_state) { - slapi_log_error(SLAPI_LOG_ERR, repl_plugin_name, + slapi_log_err(SLAPI_LOG_ERR, repl_plugin_name, "repl_set_mtn_state_and_referrals - Cannot set NULL state.\n"); return; } @@ -715,7 +715,7 @@ repl_set_mtn_state_and_referrals( } if (rc != LDAP_SUCCESS && rc != LDAP_TYPE_OR_VALUE_EXISTS) { - slapi_log_error(SLAPI_LOG_ERR, repl_plugin_name, "repl_set_mtn_state_and_referrals - " + slapi_log_err(SLAPI_LOG_ERR, repl_plugin_name, "repl_set_mtn_state_and_referrals - " "Could not set referrals for replica %s: %d\n", slapi_sdn_get_dn(repl_root_sdn), rc); } @@ -791,12 +791,12 @@ repl_chain_on_update(Slapi_PBlock *pb, Slapi_DN * target_dn, } #ifdef DEBUG_CHAIN_ON_UPDATE if (is_internal) { - slapi_log_error(SLAPI_LOG_REPL, repl_plugin_name, "repl_chain_on_update - conn=-1 op=%d be " + slapi_log_err(SLAPI_LOG_REPL, repl_plugin_name, "repl_chain_on_update - conn=-1 op=%d be " "%s is the %s backend and is %s\n", opid, mtn_be_names[ii], (chaining_backend == ii) ? "chaining" : "local", (mtn_be_states[ii] == SLAPI_BE_STATE_ON) ? "online" : "offline"); } else { - slapi_log_error(SLAPI_LOG_REPL, repl_plugin_name, "repl_chain_on_update - conn=%" PRIu64 " op=%d be " + slapi_log_err(SLAPI_LOG_REPL, repl_plugin_name, "repl_chain_on_update - conn=%" PRIu64 " op=%d be " "%s is the %s backend and is %s\n", connid, opid, mtn_be_names[ii], (chaining_backend == ii) ? "chaining" : "local", (mtn_be_states[ii] == SLAPI_BE_STATE_ON) ? "online" : "offline"); @@ -809,11 +809,11 @@ repl_chain_on_update(Slapi_PBlock *pb, Slapi_DN * target_dn, * offline replication initialization. */ #ifdef DEBUG_CHAIN_ON_UPDATE if (is_internal) { - slapi_log_error(SLAPI_LOG_REPL, repl_plugin_name, "repl_chain_on_update - conn=-1 op=%d be " + slapi_log_err(SLAPI_LOG_REPL, repl_plugin_name, "repl_chain_on_update - conn=-1 op=%d be " "%s not found. Assuming it is the chaining backend and we are doing an import.\n", opid, mtn_be_names[ii]); } else { - slapi_log_error(SLAPI_LOG_REPL, repl_plugin_name, "repl_chain_on_update - conn=%" PRIu64 " op=%d be " + slapi_log_err(SLAPI_LOG_REPL, repl_plugin_name, "repl_chain_on_update - conn=%" PRIu64 " op=%d be " "%s not found. Assuming it is the chaining backend and we are doing an import.\n", connid, opid, mtn_be_names[ii]); } @@ -841,10 +841,10 @@ repl_chain_on_update(Slapi_PBlock *pb, Slapi_DN * target_dn, (op_type == SLAPI_OPERATION_COMPARE))) { #ifdef DEBUG_CHAIN_ON_UPDATE if (is_internal) { - slapi_log_error(SLAPI_LOG_REPL, repl_plugin_name, "repl_chain_on_update - conn=-1 op=%d op is " + slapi_log_err(SLAPI_LOG_REPL, repl_plugin_name, "repl_chain_on_update - conn=-1 op=%d op is " "%d: using local backend\n", opid, op_type); } else { - slapi_log_error(SLAPI_LOG_REPL, repl_plugin_name, "repl_chain_on_update - conn=%" PRIu64 " op=%d op is " + slapi_log_err(SLAPI_LOG_REPL, repl_plugin_name, "repl_chain_on_update - conn=%" PRIu64 " op=%d op is " "%d: using local backend\n", connid, opid, op_type); } #endif @@ -864,10 +864,10 @@ repl_chain_on_update(Slapi_PBlock *pb, Slapi_DN * target_dn, if (slapi_dn_isroot(requestor_dn)) { #ifdef DEBUG_CHAIN_ON_UPDATE if (is_internal) { - slapi_log_error(SLAPI_LOG_REPL, repl_plugin_name, "repl_chain_on_update - conn=-1 op=%d requestor " + slapi_log_err(SLAPI_LOG_REPL, repl_plugin_name, "repl_chain_on_update - conn=-1 op=%d requestor " "is root - using local backend\n", opid); } else { - slapi_log_error(SLAPI_LOG_REPL, repl_plugin_name, "repl_chain_on_update - conn=%" PRIu64 " op=%d requestor " + slapi_log_err(SLAPI_LOG_REPL, repl_plugin_name, "repl_chain_on_update - conn=%" PRIu64 " op=%d requestor " "is root: using local backend\n", connid, opid); } #endif @@ -886,10 +886,10 @@ repl_chain_on_update(Slapi_PBlock *pb, Slapi_DN * target_dn, if (repl_op) { #ifdef DEBUG_CHAIN_ON_UPDATE if (is_internal) { - slapi_log_error(SLAPI_LOG_REPL, repl_plugin_name, "repl_chain_on_update - conn=-1 op=%d op is " + slapi_log_err(SLAPI_LOG_REPL, repl_plugin_name, "repl_chain_on_update - conn=-1 op=%d op is " "replicated: using local backend\n", opid); } else { - slapi_log_error(SLAPI_LOG_REPL, repl_plugin_name, "repl_chain_on_update - conn=%" PRIu64 " op=%d op is " + slapi_log_err(SLAPI_LOG_REPL, repl_plugin_name, "repl_chain_on_update - conn=%" PRIu64 " op=%d op is " "replicated: using local backend\n", connid, opid); } #endif @@ -903,10 +903,10 @@ repl_chain_on_update(Slapi_PBlock *pb, Slapi_DN * target_dn, if (!config_get_pw_is_global_policy()) { #ifdef DEBUG_CHAIN_ON_UPDATE if (is_internal) { - slapi_log_error(SLAPI_LOG_REPL, repl_plugin_name, "repl_chain_on_update - conn=-1 op=%d using " + slapi_log_err(SLAPI_LOG_REPL, repl_plugin_name, "repl_chain_on_update - conn=-1 op=%d using " "local backend for local password policy\n", opid); } else { - slapi_log_error(SLAPI_LOG_REPL, repl_plugin_name, "repl_chain_on_update - conn=%" PRIu64 " op=%d using " + slapi_log_err(SLAPI_LOG_REPL, repl_plugin_name, "repl_chain_on_update - conn=%" PRIu64 " op=%d using " "local backend for local password policy\n", connid, opid); } #endif @@ -920,10 +920,10 @@ repl_chain_on_update(Slapi_PBlock *pb, Slapi_DN * target_dn, */ #ifdef DEBUG_CHAIN_ON_UPDATE if (is_internal) { - slapi_log_error(SLAPI_LOG_REPL, repl_plugin_name, "repl_chain_on_update - conn=-1 op=%d using " + slapi_log_err(SLAPI_LOG_REPL, repl_plugin_name, "repl_chain_on_update - conn=-1 op=%d using " "chaining backend\n", opid); } else { - slapi_log_error(SLAPI_LOG_REPL, repl_plugin_name, "repl_chain_on_update: conn=%" PRIu64 " op=%d using " + slapi_log_err(SLAPI_LOG_REPL, repl_plugin_name, "repl_chain_on_update: conn=%" PRIu64 " op=%d using " "chaining backend\n", connid, opid); } #endif diff --git a/ldap/servers/plugins/replication/test_repl_session_plugin.c b/ldap/servers/plugins/replication/test_repl_session_plugin.c index 52ddea4..a9a3f7d 100644 --- a/ldap/servers/plugins/replication/test_repl_session_plugin.c +++ b/ldap/servers/plugins/replication/test_repl_session_plugin.c @@ -40,14 +40,14 @@ test_repl_session_plugin_agmt_init_cb(const Slapi_DN *repl_subtree) { char *cookie = NULL; - slapi_log_error(SLAPI_LOG_DEBUG, test_repl_session_plugin_name, + slapi_log_err(SLAPI_LOG_DEBUG, test_repl_session_plugin_name, "test_repl_session_plugin_init_cb() called for suffix \"%s\".\n", slapi_sdn_get_ndn(repl_subtree)); /* allocate a string and set as the cookie */ cookie = slapi_ch_smprintf("cookie test"); - slapi_log_error(SLAPI_LOG_DEBUG, test_repl_session_plugin_name, + slapi_log_err(SLAPI_LOG_DEBUG, test_repl_session_plugin_name, "test_repl_session_plugin_init_cb(): Setting cookie: \"%s\".\n", cookie); @@ -72,7 +72,7 @@ test_repl_session_plugin_pre_acquire_cb(void *cookie, const Slapi_DN *repl_subtr { int rc = 0; - slapi_log_error(SLAPI_LOG_DEBUG, test_repl_session_plugin_name, + slapi_log_err(SLAPI_LOG_DEBUG, test_repl_session_plugin_name, "test_repl_session_plugin_pre_acquire_cb() called for suffix \"%s\", " "is_total: \"%s\", cookie: \"%s\".\n", slapi_sdn_get_ndn(repl_subtree), is_total ? "TRUE" : "FALSE", cookie ? (char *)cookie : "NULL"); @@ -83,7 +83,7 @@ test_repl_session_plugin_pre_acquire_cb(void *cookie, const Slapi_DN *repl_subtr (*data)->bv_val = slapi_ch_smprintf("test-data"); (*data)->bv_len = strlen((*data)->bv_val) + 1; - slapi_log_error(SLAPI_LOG_DEBUG, test_repl_session_plugin_name, + slapi_log_err(SLAPI_LOG_DEBUG, test_repl_session_plugin_name, "test_repl_session_plugin_pre_acquire_cb() sending data: guid: \"%s\" data: \"%s\".\n", *data_guid, (*data)->bv_val); @@ -108,7 +108,7 @@ test_repl_session_plugin_reply_acquire_cb(const char *repl_subtree, int is_total { int rc = 0; - slapi_log_error(SLAPI_LOG_DEBUG, test_repl_session_plugin_name, + slapi_log_err(SLAPI_LOG_DEBUG, test_repl_session_plugin_name, "test_repl_session_plugin_reply_acquire_cb() called for suffix \"%s\", is_total: \"%s\".\n", repl_subtree, is_total ? "TRUE" : "FALSE"); @@ -118,7 +118,7 @@ test_repl_session_plugin_reply_acquire_cb(const char *repl_subtree, int is_total (*data)->bv_val = slapi_ch_smprintf("test-reply-data"); (*data)->bv_len = strlen((*data)->bv_val) + 1; - slapi_log_error(SLAPI_LOG_DEBUG, test_repl_session_plugin_name, + slapi_log_err(SLAPI_LOG_DEBUG, test_repl_session_plugin_name, "test_repl_session_plugin_reply_acquire_cb() sending data: guid: \"%s\" data: \"%s\".\n", *data_guid, (*data)->bv_val); @@ -145,14 +145,14 @@ test_repl_session_plugin_post_acquire_cb(void *cookie, const Slapi_DN *repl_subt { int rc = 0; - slapi_log_error(SLAPI_LOG_DEBUG, test_repl_session_plugin_name, + slapi_log_err(SLAPI_LOG_DEBUG, test_repl_session_plugin_name, "test_repl_session_plugin_post_acquire_cb() called for suffix \"%s\", " "is_total: \"%s\" cookie: \"%s\".\n", slapi_sdn_get_ndn(repl_subtree), is_total ? "TRUE" : "FALSE", cookie ? (char *)cookie : "NULL"); /* log any extra data that was sent from the replica */ if (data_guid && data) { - slapi_log_error(SLAPI_LOG_DEBUG, test_repl_session_plugin_name, + slapi_log_err(SLAPI_LOG_DEBUG, test_repl_session_plugin_name, "test_repl_session_plugin_post_acquire_cb() received data: guid: \"%s\" data: \"%s\".\n", data_guid, data->bv_val); } @@ -179,13 +179,13 @@ test_repl_session_plugin_recv_acquire_cb(const char *repl_subtree, int is_total, { int rc = 0; - slapi_log_error(SLAPI_LOG_DEBUG, test_repl_session_plugin_name, + slapi_log_err(SLAPI_LOG_DEBUG, test_repl_session_plugin_name, "test_repl_session_plugin_recv_acquire_cb() called for suffix \"%s\", is_total: \"%s\".\n", repl_subtree, is_total ? "TRUE" : "FALSE"); /* log any extra data that was sent from the master */ if (data_guid && data) { - slapi_log_error(SLAPI_LOG_DEBUG, test_repl_session_plugin_name, + slapi_log_err(SLAPI_LOG_DEBUG, test_repl_session_plugin_name, "test_repl_session_plugin_recv_acquire_cb() received data: guid: \"%s\" data: \"%s\".\n", data_guid, data->bv_val); } @@ -201,7 +201,7 @@ test_repl_session_plugin_recv_acquire_cb(const char *repl_subtree, int is_total, static void test_repl_session_plugin_destroy_cb(void *cookie, const Slapi_DN *repl_subtree) { - slapi_log_error(SLAPI_LOG_DEBUG, test_repl_session_plugin_name, + slapi_log_err(SLAPI_LOG_DEBUG, test_repl_session_plugin_name, "test_repl_session_plugin_destroy_cb() called for suffix \"%s\".\n", slapi_sdn_get_ndn(repl_subtree)); @@ -230,10 +230,10 @@ static void *test_repl_session_api[] = { static int test_repl_session_plugin_start(Slapi_PBlock *pb) { - slapi_log_error(SLAPI_LOG_PLUGIN, test_repl_session_plugin_name, + slapi_log_err(SLAPI_LOG_PLUGIN, test_repl_session_plugin_name, "--> test_repl_session_plugin_start -- begin\n"); - slapi_log_error(SLAPI_LOG_PLUGIN, test_repl_session_plugin_name, + slapi_log_err(SLAPI_LOG_PLUGIN, test_repl_session_plugin_name, "<-- test_repl_session_plugin_start -- end\n"); return 0; } @@ -241,19 +241,19 @@ test_repl_session_plugin_start(Slapi_PBlock *pb) static int test_repl_session_plugin_close(Slapi_PBlock *pb) { - slapi_log_error(SLAPI_LOG_PLUGIN, test_repl_session_plugin_name, + slapi_log_err(SLAPI_LOG_PLUGIN, test_repl_session_plugin_name, "--> test_repl_session_plugin_close -- begin\n"); slapi_apib_unregister(REPL_SESSION_v1_0_GUID); - slapi_log_error(SLAPI_LOG_PLUGIN, test_repl_session_plugin_name, + slapi_log_err(SLAPI_LOG_PLUGIN, test_repl_session_plugin_name, "<-- test_repl_session_plugin_close -- end\n"); return 0; } int test_repl_session_plugin_init(Slapi_PBlock *pb) { - slapi_log_error(SLAPI_LOG_PLUGIN, test_repl_session_plugin_name, + slapi_log_err(SLAPI_LOG_PLUGIN, test_repl_session_plugin_name, "--> test_repl_session_plugin_init -- begin\n"); if ( slapi_pblock_set( pb, SLAPI_PLUGIN_VERSION, @@ -265,13 +265,13 @@ int test_repl_session_plugin_init(Slapi_PBlock *pb) slapi_pblock_set( pb, SLAPI_PLUGIN_DESCRIPTION, (void *)&test_repl_session_pdesc ) != 0 ) { - slapi_log_error(SLAPI_LOG_ERR, test_repl_session_plugin_name, + slapi_log_err(SLAPI_LOG_ERR, test_repl_session_plugin_name, "<-- test_repl_session_plugin_init -- failed to register plugin -- end\n"); return -1; } if( slapi_apib_register(REPL_SESSION_v1_0_GUID, test_repl_session_api) ) { - slapi_log_error(SLAPI_LOG_DEBUG, test_repl_session_plugin_name, + slapi_log_err(SLAPI_LOG_DEBUG, test_repl_session_plugin_name, "<-- test_repl_session_plugin_start -- failed to register repl_session api -- end\n"); return -1; } @@ -280,12 +280,12 @@ int test_repl_session_plugin_init(Slapi_PBlock *pb) /* Retrieve and save the plugin identity to later pass to internal operations */ if (slapi_pblock_get(pb, SLAPI_PLUGIN_IDENTITY, &test_repl_session_plugin_id) != 0) { - slapi_log_error(SLAPI_LOG_ERR, test_repl_session_plugin_name, + slapi_log_err(SLAPI_LOG_ERR, test_repl_session_plugin_name, "<-- test_repl_session_plugin_init -- failed to retrieve plugin identity -- end\n"); return -1; } - slapi_log_error(SLAPI_LOG_PLUGIN, test_repl_session_plugin_name, + slapi_log_err(SLAPI_LOG_PLUGIN, test_repl_session_plugin_name, "<-- test_repl_session_plugin_init -- end\n"); return 0; } diff --git a/ldap/servers/plugins/replication/urp.c b/ldap/servers/plugins/replication/urp.c index 6201645..64810e9 100644 --- a/ldap/servers/plugins/replication/urp.c +++ b/ldap/servers/plugins/replication/urp.c @@ -68,7 +68,7 @@ urp_modify_operation( Slapi_PBlock *pb ) op_result= LDAP_NO_SUCH_OBJECT; slapi_pblock_set(pb, SLAPI_RESULT_CODE, &op_result); rc = SLAPI_PLUGIN_NOOP; /* Must discard this Modification */ - slapi_log_error (slapi_log_urp, sessionid, + slapi_log_err (slapi_log_urp, sessionid, "urp_modify_operation - No such entry\n"); PROFILE_POINT; /* Modify Conflict; Entry Does Not Exist; Discard Modification */ } @@ -119,7 +119,7 @@ urp_add_operation( Slapi_PBlock *pb ) * setting an error to op_result */ /* op_result = LDAP_SUCCESS; */ - slapi_log_error (slapi_log_urp, sessionid, + slapi_log_err (slapi_log_urp, sessionid, "urp_add_operation - %s - An entry with this uniqueid already exists.\n", slapi_entry_get_dn_const(existing_uniqueid_entry)); op_result= LDAP_ALREADY_EXISTS; @@ -160,7 +160,7 @@ urp_add_operation( Slapi_PBlock *pb ) op_result= LDAP_OPERATIONS_ERROR; slapi_pblock_set(pb, SLAPI_RESULT_CODE, &op_result); rc = SLAPI_PLUGIN_NOOP; /* Abort this Operation */ - slapi_log_error (slapi_log_urp, sessionid, + slapi_log_err (slapi_log_urp, sessionid, "urp_add_operation - %s - Add conflict; Unique ID (%s) already in RDN\n", basedn, adduniqueid); PROFILE_POINT; /* Add Conflict; Entry Exists; Unique ID already in RDN - Abort this update. */ @@ -181,7 +181,7 @@ urp_add_operation( Slapi_PBlock *pb ) if (slapi_entry_attr_find (addentry, ATTR_NSDS5_REPLCONFLICT, &attr) == 0) { /* ATTR_NSDS5_REPLCONFLICT exists */ - slapi_log_error(SLAPI_LOG_ERR, sessionid, + slapi_log_err(SLAPI_LOG_ERR, sessionid, "urp_add_operation - New entry has nsds5ReplConflict already\n"); vals = attr_get_present_values (attr); /* this returns a pointer to the contents */ } @@ -208,7 +208,7 @@ urp_add_operation( Slapi_PBlock *pb ) slapi_pblock_set(pb, SLAPI_ADD_TARGET_SDN, sdn); rdn = slapi_rdn_new_sdn ( slapi_entry_get_sdn_const(addentry) ); - slapi_log_error (slapi_log_urp, sessionid, + slapi_log_err (slapi_log_urp, sessionid, "urp_add_operation - Naming conflict ADD. Add %s instead\n", slapi_rdn_get_rdn(rdn)); slapi_rdn_free(&rdn); @@ -224,7 +224,7 @@ urp_add_operation( Slapi_PBlock *pb ) { op_result= LDAP_OPERATIONS_ERROR; slapi_pblock_set(pb, SLAPI_RESULT_CODE, &op_result); - slapi_log_error (slapi_log_urp, sessionid, + slapi_log_err (slapi_log_urp, sessionid, "urp_add_operation - %s - Entry to be added is a loser; " "urp_annotate_dn failed.\n", basedn); rc = SLAPI_PLUGIN_NOOP; /* Ignore this Operation */ @@ -252,7 +252,7 @@ urp_add_operation( Slapi_PBlock *pb ) * setting an error to op_result */ /* op_result = LDAP_SUCCESS; */ - slapi_log_error (slapi_log_urp, sessionid, + slapi_log_err (slapi_log_urp, sessionid, "urp_add_operation - %s - The CSN of the Operation and the Entry DN are the same.", slapi_entry_get_dn_const(existing_dn_entry)); op_result= LDAP_UNWILLING_TO_PERFORM; @@ -324,7 +324,7 @@ urp_modrdn_operation( Slapi_PBlock *pb ) * error is set to op_result. Just to get rid of this CSN from RUV, * setting an error to op_result */ - slapi_log_error (slapi_log_urp, sessionid, + slapi_log_err (slapi_log_urp, sessionid, "urp_modrdn_operation - %s - operation CSN is newer than the DN CSN.\n", slapi_entry_get_dn_const(target_entry)); op_result= LDAP_UNWILLING_TO_PERFORM; @@ -358,7 +358,7 @@ urp_modrdn_operation( Slapi_PBlock *pb ) slapi_entry_get_sdn (target_entry), "renameTombstone", opcsn); */ op_result = LDAP_NO_SUCH_OBJECT; - slapi_log_error(SLAPI_LOG_REPL, sessionid, + slapi_log_err(SLAPI_LOG_REPL, sessionid, "urp_modrdn_operation - Target_entry %s is a tombstone; returning LDAP_NO_SUCH_OBJECT.\n", slapi_entry_get_dn((Slapi_Entry *)target_entry)); slapi_pblock_set(pb, SLAPI_RESULT_CODE, &op_result); @@ -374,7 +374,7 @@ urp_modrdn_operation( Slapi_PBlock *pb ) } else { - slapi_log_error (slapi_log_urp, sessionid, + slapi_log_err (slapi_log_urp, sessionid, "urp_modrdn_operation - %s - Target entry is a tombstone.\n", slapi_entry_get_dn_const(target_entry)); rc = SLAPI_PLUGIN_NOOP; /* Ignore the modrdn */ @@ -418,7 +418,7 @@ urp_modrdn_operation( Slapi_PBlock *pb ) * but the uniqueids are not. * There might be two replicas with the same ReplicaID. */ - slapi_log_error (slapi_log_urp, sessionid, + slapi_log_err (slapi_log_urp, sessionid, "urp_modrdn_operation - Duplicated CSN for different uniqueids [%s][%s]", existing_uniqueid, op_uniqueid); op_result= LDAP_OPERATIONS_ERROR; @@ -445,7 +445,7 @@ urp_modrdn_operation( Slapi_PBlock *pb ) } mod_namingconflict_attr (op_uniqueid, target_sdn, existing_sdn, opcsn, "MODRDN"); slapi_pblock_set(pb, SLAPI_MODRDN_NEWRDN, newrdn_with_uniqueid); - slapi_log_error (slapi_log_urp, sessionid, + slapi_log_err (slapi_log_urp, sessionid, "urp_modrdn_operation - Naming conflict MODRDN. Rename target entry from %s to %s\n", newrdn, newrdn_with_uniqueid ); rc= slapi_setbit_int(rc, SLAPI_RTN_BIT_FETCH_EXISTING_DN_ENTRY); @@ -549,7 +549,7 @@ urp_modrdn_operation( Slapi_PBlock *pb ) * this will cause replication divergence requiring * admin intercession */ - slapi_log_error(SLAPI_LOG_ERR, sessionid, + slapi_log_err(SLAPI_LOG_ERR, sessionid, "urp_modrdn_operation - Parent %s couldn't be found, nor recreated as a glue entry\n", slapi_sdn_get_dn(newsuperior) ); op_result= LDAP_OPERATIONS_ERROR; @@ -600,7 +600,7 @@ urp_delete_operation( Slapi_PBlock *pb ) op_result= LDAP_NO_SUCH_OBJECT; slapi_pblock_set(pb, SLAPI_RESULT_CODE, &op_result); rc = SLAPI_PLUGIN_FAILURE; /* Don't apply the Delete */ - slapi_log_error (slapi_log_urp, sessionid, + slapi_log_err (slapi_log_urp, sessionid, "urp_delete_operation - Entry %s does not exist; returning NO_SUCH_OBJECT.\n", slapi_entry_get_dn((Slapi_Entry *)deleteentry)); PROFILE_POINT; /* Delete Operation; Entry not exist. */ @@ -611,7 +611,7 @@ urp_delete_operation( Slapi_PBlock *pb ) op_result= LDAP_ALREADY_EXISTS; slapi_pblock_set(pb, SLAPI_RESULT_CODE, &op_result); rc = SLAPI_PLUGIN_NOOP; /* Don't apply the Delete */ - slapi_log_error (slapi_log_urp, sessionid, + slapi_log_err (slapi_log_urp, sessionid, "urp_delete_operation - Entry \"%s\" is already a Tombstone.\n", slapi_entry_get_dn_const(deleteentry)); PROFILE_POINT; /* Delete Operation; Already a Tombstone. */ @@ -637,7 +637,7 @@ urp_delete_operation( Slapi_PBlock *pb ) op_result= LDAP_SUCCESS; slapi_pblock_set(pb, SLAPI_RESULT_CODE, &op_result); rc = SLAPI_PLUGIN_NOOP; /* Don't apply the Delete */ - slapi_log_error (slapi_log_urp, sessionid, + slapi_log_err (slapi_log_urp, sessionid, "urp_delete_operation - Turn entry \"%s\" into a glue_absent_parent entry.\n", slapi_entry_get_dn_const(deleteentry)); PROFILE_POINT; /* Delete Operation; Entry has children. */ @@ -728,7 +728,7 @@ urp_post_delete_operation( Slapi_PBlock *pb ) op_result = entry_to_tombstone ( pb, entry ); if ( op_result == LDAP_SUCCESS ) { - slapi_log_error (slapi_log_urp, sessionid, + slapi_log_err (slapi_log_urp, sessionid, "urp_post_delete_operation - Tombstoned glue entry %s since it has no more children\n", slapi_entry_get_dn_const (entry) ); } @@ -982,7 +982,7 @@ urp_add_resolve_parententry (Slapi_PBlock *pb, char *sessionid, Slapi_Entry *ent sdn = slapi_sdn_dup(slapi_entry_get_sdn_const(entry)); slapi_pblock_set(pb, SLAPI_ADD_TARGET_SDN, sdn); - slapi_log_error (slapi_log_urp, sessionid, + slapi_log_err (slapi_log_urp, sessionid, "Parent was renamed. Renamed the child to %s\n", newdn ); rc= slapi_setbit_int(rc,SLAPI_RTN_BIT_FETCH_EXISTING_DN_ENTRY); PROFILE_POINT; /* Add Conflict; Parent Renamed; Rename Operation Entry */ @@ -1018,13 +1018,13 @@ urp_annotate_dn (char *sessionid, const Slapi_Entry *entry, CSN *opcsn, const ch newrdn = get_rdn_plus_uniqueid ( sessionid, basedn, uniqueid ); if(newrdn) { mod_namingconflict_attr (uniqueid, basesdn, basesdn, opcsn, optype); - slapi_log_error (slapi_log_urp, sessionid, + slapi_log_err (slapi_log_urp, sessionid, "urp_annotate_dn - %s --> %s\n", basedn, newrdn); op_result = urp_fixup_rename_entry ( entry, newrdn, NULL, 0 ); switch(op_result) { case LDAP_SUCCESS: - slapi_log_error (slapi_log_urp, sessionid, + slapi_log_err (slapi_log_urp, sessionid, "urp_annotate_dn - Naming conflict %s. Renamed existing entry to %s\n", optype, newrdn); rc = 1; @@ -1046,19 +1046,19 @@ urp_annotate_dn (char *sessionid, const Slapi_Entry *entry, CSN *opcsn, const ch * for a conflict!! After fix for 558293, this * state can't be reproduced anymore (5-Oct-01) */ - slapi_log_error(SLAPI_LOG_ERR, sessionid, + slapi_log_err(SLAPI_LOG_ERR, sessionid, "urp_annotate_dn - Entry %s exists in cache but not in DB\n", basedn); rc = LDAP_NO_SUCH_OBJECT; break; default: - slapi_log_error (slapi_log_urp, sessionid, + slapi_log_err (slapi_log_urp, sessionid, "urp_annotate_dn - Failed to annotate %s, err=%d\n", newrdn, op_result); } slapi_ch_free ( (void**)&newrdn ); } else { - slapi_log_error(SLAPI_LOG_ERR, sessionid, + slapi_log_err(SLAPI_LOG_ERR, sessionid, "urp_annotate_dn - Failed to create conflict DN from basedn: %s and uniqueid: %s\n", basedn, uniqueid ); } @@ -1092,7 +1092,7 @@ urp_get_min_naming_conflict_entry ( Slapi_PBlock *pb, char *sessionid, CSN *opcs if (NULL == basedn || strncmp (basedn, SLAPI_ATTR_UNIQUEID, strlen(SLAPI_ATTR_UNIQUEID)) == 0) return NULL; - slapi_log_error(SLAPI_LOG_REPL, sessionid, + slapi_log_err(SLAPI_LOG_REPL, sessionid, "urp_get_min_naming_conflict_entry - %s\n", basedn); filter = slapi_filter_sprintf("(%s=%s %s%s)", ATTR_NSDS5_REPLCONFLICT, REASON_ANNOTATE_DN, @@ -1162,7 +1162,7 @@ done: slapi_pblock_destroy(newpb); newpb = NULL; - slapi_log_error(SLAPI_LOG_REPL, sessionid, + slapi_log_err(SLAPI_LOG_REPL, sessionid, "urp_get_min_naming_conflict_entry - Found %d entries\n", i); return min_naming_conflict_entry; @@ -1208,11 +1208,11 @@ urp_naming_conflict_removal ( Slapi_PBlock *pb, char *sessionid, CSN *opcsn, con op_result = urp_fixup_rename_entry((const Slapi_Entry *)min_naming_conflict_entry, newrdnstr, NULL, OP_FLAG_ACTION_INVOKE_FOR_REPLOP); if ( op_result != LDAP_SUCCESS ) { - slapi_log_error (slapi_log_urp, sessionid, + slapi_log_err (slapi_log_urp, sessionid, "urp_naming_conflict_removal - Failed to restore RDN of %s, err=%d\n", oldrdnstr, op_result); goto bailout; } - slapi_log_error (slapi_log_urp, sessionid, + slapi_log_err (slapi_log_urp, sessionid, "urp_naming_conflict_removal - Naming conflict removed by %s. RDN of %s was restored\n", optype, oldrdnstr); /* Step2: Remove ATTR_NSDS5_REPLCONFLICT from the winning entry */ @@ -1222,7 +1222,7 @@ urp_naming_conflict_removal ( Slapi_PBlock *pb, char *sessionid, CSN *opcsn, con */ op_result = del_replconflict_attr (min_naming_conflict_entry, opcsn, OP_FLAG_ACTION_INVOKE_FOR_REPLOP); if (op_result != LDAP_SUCCESS) { - slapi_log_error(SLAPI_LOG_REPL, sessionid, + slapi_log_err(SLAPI_LOG_REPL, sessionid, "urp_naming_conflict_removal - Failed to remove nsds5ReplConflict for %s, err=%d\n", newrdnstr, op_result); } @@ -1242,7 +1242,7 @@ get_dn_plus_uniqueid(char *sessionid, const Slapi_DN *oldsdn, const char *unique char *newdn = NULL; int rc = slapi_rdn_init_all_sdn_ext(rdn, oldsdn, 1); if (rc) { - slapi_log_error(SLAPI_LOG_ERR, sessionid, + slapi_log_err(SLAPI_LOG_ERR, sessionid, "Failed to convert %s to RDN\n", slapi_sdn_get_dn(oldsdn)); goto bail; } @@ -1257,7 +1257,7 @@ get_dn_plus_uniqueid(char *sessionid, const Slapi_DN *oldsdn, const char *unique * This will cause replication divergence and will * require admin intercession */ - slapi_log_error(SLAPI_LOG_WARNING, sessionid, + slapi_log_err(SLAPI_LOG_WARNING, sessionid, "get_dn_plus_uniqueid - Annotated DN %s has naming conflict\n", slapi_sdn_get_dn(oldsdn) ); } else @@ -1286,7 +1286,7 @@ get_rdn_plus_uniqueid(char *sessionid, const char *olddn, const char *uniqueid) Slapi_RDN *rdn = slapi_rdn_new(); int rc = slapi_rdn_init_all_sdn_ext(rdn, sdn, 1); if (rc) { - slapi_log_error(SLAPI_LOG_ERR, sessionid, + slapi_log_err(SLAPI_LOG_ERR, sessionid, "Failed to convert %s to RDN\n", olddn); goto bail; } @@ -1299,7 +1299,7 @@ get_rdn_plus_uniqueid(char *sessionid, const char *olddn, const char *uniqueid) * This will cause replication divergence and will * require admin intercession */ - slapi_log_error(SLAPI_LOG_WARNING, sessionid, + slapi_log_err(SLAPI_LOG_WARNING, sessionid, "get_rdn_plus_uniqueid - Annotated RDN %s has naming conflict\n", olddn); } else diff --git a/ldap/servers/plugins/replication/urp_glue.c b/ldap/servers/plugins/replication/urp_glue.c index 84cf829..1a8dd04 100644 --- a/ldap/servers/plugins/replication/urp_glue.c +++ b/ldap/servers/plugins/replication/urp_glue.c @@ -89,7 +89,7 @@ entry_to_glue(char *sessionid, const Slapi_Entry* entry, const char *reason, CSN } else { - slapi_log_error(SLAPI_LOG_REPL, repl_plugin_name, + slapi_log_err(SLAPI_LOG_REPL, repl_plugin_name, "%s: Target entry %s is already a glue entry reason %s\n", sessionid, dn, reason); } @@ -108,7 +108,7 @@ entry_to_glue(char *sessionid, const Slapi_Entry* entry, const char *reason, CSN op_result = urp_fixup_modify_entry (NULL, sdn, opcsn, &smods, 0); if (op_result == LDAP_SUCCESS) { - slapi_log_error (slapi_log_urp, repl_plugin_name, + slapi_log_err (slapi_log_urp, repl_plugin_name, "%s: Turned the entry %s to glue, reason %s\n", sessionid, dn, reason); } @@ -189,7 +189,7 @@ create_glue_entry ( Slapi_PBlock *pb, char *sessionid, Slapi_DN *dn, const char if ( NULL == uniqueid ) { op_result = LDAP_OPERATIONS_ERROR; - slapi_log_error(SLAPI_LOG_ERR, repl_plugin_name, + slapi_log_err(SLAPI_LOG_ERR, repl_plugin_name, "create_glue_entry - %s: Can't create glue %s, uniqueid=NULL\n", sessionid, dnstr); } else @@ -209,7 +209,7 @@ create_glue_entry ( Slapi_PBlock *pb, char *sessionid, Slapi_DN *dn, const char switch(op_result) { case LDAP_SUCCESS: - slapi_log_error(SLAPI_LOG_NOTICE, repl_plugin_name, + slapi_log_err(SLAPI_LOG_NOTICE, repl_plugin_name, "create_glue_entry - %s: Created glue entry %s uniqueid=%s reason missingEntry\n", sessionid, dnstr, uniqueid); done= 1; @@ -218,7 +218,7 @@ create_glue_entry ( Slapi_PBlock *pb, char *sessionid, Slapi_DN *dn, const char { struct slapi_operation_parameters *op_params; /* This is okay. While creating a glue, a real entry was added. */ - slapi_log_error(SLAPI_LOG_NOTICE, repl_plugin_name, + slapi_log_err(SLAPI_LOG_NOTICE, repl_plugin_name, "create_glue_entry - %s: Skipped creating glue entry %s uniqueid=%s reason Entry Already Exists\n", sessionid, dnstr, uniqueid); op_result = LDAP_SUCCESS; @@ -233,7 +233,7 @@ create_glue_entry ( Slapi_PBlock *pb, char *sessionid, Slapi_DN *dn, const char /* The parent is missing */ { /* JCMREPL - Create the parent ... recursion?... but what's the uniqueid? */ - slapi_log_error(SLAPI_LOG_ERR, repl_plugin_name, + slapi_log_err(SLAPI_LOG_ERR, repl_plugin_name, "create_glue_entry - %s: Can't created glue entry %s uniqueid=%s, error %d; " "Possibly, parent entry is a conflict entry.\n", sessionid, dnstr, uniqueid, op_result); @@ -241,7 +241,7 @@ create_glue_entry ( Slapi_PBlock *pb, char *sessionid, Slapi_DN *dn, const char break; } default: - slapi_log_error(SLAPI_LOG_ERR, repl_plugin_name, + slapi_log_err(SLAPI_LOG_ERR, repl_plugin_name, "create_glue_entry %s: Can't created glue entry %s uniqueid=%s, error %d\n", sessionid, dnstr, uniqueid, op_result); break; diff --git a/ldap/servers/plugins/replication/urp_tombstone.c b/ldap/servers/plugins/replication/urp_tombstone.c index b00e093..b5621a6 100644 --- a/ldap/servers/plugins/replication/urp_tombstone.c +++ b/ldap/servers/plugins/replication/urp_tombstone.c @@ -201,7 +201,7 @@ tombstone_to_glue ( /* Add the reason of turning it to glue - The backend code will use it*/ slapi_entry_add_string(addingentry, ATTR_NSDS5_REPLCONFLICT, reason); } - slapi_log_error(SLAPI_LOG_ERR, repl_plugin_name, + slapi_log_err(SLAPI_LOG_ERR, repl_plugin_name, "tombstone_to_glue - %s - Can't resurrect tombstone to glue reason '%s'. " "Try with conflict dn %s, error=%d\n", sessionid, reason, addingdn, op_result); @@ -216,19 +216,19 @@ tombstone_to_glue ( slapi_ch_free_string(&parentuniqueid); if (op_result == LDAP_SUCCESS) { - slapi_log_error (/*slapi_log_urp*/SLAPI_LOG_ERR, repl_plugin_name, + slapi_log_err (/*slapi_log_urp*/SLAPI_LOG_ERR, repl_plugin_name, "tombstone_to_glue - %s - Resurrected tombstone %s to glue reason '%s'\n", sessionid, addingdn, reason); } else if (LDAP_ALREADY_EXISTS == op_result) { - slapi_log_error(/*slapi_log_urp*/SLAPI_LOG_ERR, repl_plugin_name, + slapi_log_err(/*slapi_log_urp*/SLAPI_LOG_ERR, repl_plugin_name, "tombstone_to_glue - %s - No need to turn tombstone %s to glue; it was already resurrected.\n", sessionid, addingdn); op_result = LDAP_SUCCESS; } else { - slapi_log_error(SLAPI_LOG_ERR, repl_plugin_name, + slapi_log_err(SLAPI_LOG_ERR, repl_plugin_name, "tombstone_to_glue - %s - Can't resurrect tombstone %s to glue reason '%s', error=%d\n", sessionid, addingdn, reason, op_result); } diff --git a/ldap/servers/plugins/replication/windows_connection.c b/ldap/servers/plugins/replication/windows_connection.c index 09497bb..fae17a3 100644 --- a/ldap/servers/plugins/replication/windows_connection.c +++ b/ldap/servers/plugins/replication/windows_connection.c @@ -120,7 +120,7 @@ windows_conn_new(Repl_Agmt *agmt) { Repl_Connection *rpc; - LDAPDebug(LDAP_DEBUG_TRACE, "=> windows_conn_new\n", 0, 0, 0 ); + slapi_log_err(SLAPI_LOG_TRACE, windows_repl_plugin_name, "=> windows_conn_new\n"); rpc = (Repl_Connection *)slapi_ch_malloc(sizeof(repl_connection)); if ((rpc->lock = PR_NewLock()) == NULL) @@ -153,12 +153,12 @@ windows_conn_new(Repl_Agmt *agmt) rpc->timeout.tv_usec = 0; rpc->flag_agmt_changed = 0; rpc->plain = NULL; - LDAPDebug(LDAP_DEBUG_TRACE, "<= windows_conn_new\n", 0, 0, 0 ); + slapi_log_err(SLAPI_LOG_TRACE,windows_repl_plugin_name, "<= windows_conn_new\n"); return rpc; loser: windows_conn_delete(rpc); slapi_ch_free((void**)&rpc); - LDAPDebug(LDAP_DEBUG_TRACE, "<= windows_conn_new - loser\n", 0, 0, 0 ); + slapi_log_err(SLAPI_LOG_TRACE, windows_repl_plugin_name, "<= windows_conn_new - loser\n"); return NULL; } @@ -170,11 +170,11 @@ static PRBool windows_conn_connected(Repl_Connection *conn) { PRBool return_value; - LDAPDebug(LDAP_DEBUG_TRACE, "=> windows_conn_connected\n", 0, 0, 0 ); + slapi_log_err(SLAPI_LOG_TRACE, windows_repl_plugin_name, "=> windows_conn_connected\n"); PR_Lock(conn->lock); return_value = STATE_CONNECTED == conn->state; PR_Unlock(conn->lock); - LDAPDebug(LDAP_DEBUG_TRACE, "<= windows_conn_connected\n", 0, 0, 0 ); + slapi_log_err(SLAPI_LOG_TRACE, windows_repl_plugin_name, "<= windows_conn_connected\n"); return return_value; } @@ -185,14 +185,14 @@ windows_conn_connected(Repl_Connection *conn) static void windows_conn_delete_internal(Repl_Connection *conn) { - LDAPDebug(LDAP_DEBUG_TRACE, "=> windows_conn_delete_internal\n", 0, 0, 0 ); + slapi_log_err(SLAPI_LOG_TRACE, windows_repl_plugin_name, "=> windows_conn_delete_internal\n"); PR_ASSERT(NULL != conn); close_connection_internal(conn); /* slapi_ch_free accepts NULL pointer */ slapi_ch_free((void **)&conn->hostname); slapi_ch_free((void **)&conn->binddn); slapi_ch_free((void **)&conn->plain); - LDAPDebug(LDAP_DEBUG_TRACE, "<= windows_conn_delete_internal\n", 0, 0, 0 ); + slapi_log_err(SLAPI_LOG_TRACE, windows_repl_plugin_name, "<= windows_conn_delete_internal\n"); } /* @@ -204,7 +204,7 @@ windows_conn_delete(Repl_Connection *conn) { PRBool destroy_it = PR_FALSE; - LDAPDebug(LDAP_DEBUG_TRACE, "=> windows_conn_delete\n", 0, 0, 0 ); + slapi_log_err(SLAPI_LOG_TRACE, windows_repl_plugin_name, "=> windows_conn_delete\n"); PR_ASSERT(NULL != conn); PR_Lock(conn->lock); @@ -231,7 +231,7 @@ windows_conn_delete(Repl_Connection *conn) { windows_conn_delete_internal(conn); } - LDAPDebug(LDAP_DEBUG_TRACE, "<= windows_conn_delete\n", 0, 0, 0 ); + slapi_log_err(SLAPI_LOG_TRACE, windows_repl_plugin_name, "<= windows_conn_delete\n"); } @@ -242,22 +242,22 @@ windows_conn_delete(Repl_Connection *conn) void windows_conn_get_error(Repl_Connection *conn, int *operation, int *error) { - LDAPDebug(LDAP_DEBUG_TRACE, "=> windows_conn_get_error\n", 0, 0, 0 ); + slapi_log_err(SLAPI_LOG_TRACE, windows_repl_plugin_name, "=> windows_conn_get_error\n"); PR_Lock(conn->lock); *operation = conn->last_operation; *error = conn->last_ldap_error; PR_Unlock(conn->lock); - LDAPDebug(LDAP_DEBUG_TRACE, "<= windows_conn_get_error\n", 0, 0, 0 ); + slapi_log_err(SLAPI_LOG_TRACE, windows_repl_plugin_name, "<= windows_conn_get_error\n"); } void windows_conn_set_error(Repl_Connection *conn, int error) { - LDAPDebug(LDAP_DEBUG_TRACE, "=> windows_conn_set_error\n", 0, 0, 0 ); + slapi_log_err(SLAPI_LOG_TRACE, windows_repl_plugin_name, "=> windows_conn_set_error\n"); PR_Lock(conn->lock); conn->last_ldap_error = error; PR_Unlock(conn->lock); - LDAPDebug(LDAP_DEBUG_TRACE, "<= windows_conn_set_error\n", 0, 0, 0 ); + slapi_log_err(SLAPI_LOG_TRACE, windows_repl_plugin_name, "<= windows_conn_set_error\n"); } /* @@ -286,7 +286,7 @@ windows_perform_operation(Repl_Connection *conn, int optype, const char *dn, const char *op_string = NULL; const char *extra_op_string = NULL; - LDAPDebug(LDAP_DEBUG_TRACE, "=> windows_perform_operation\n", 0, 0, 0 ); + slapi_log_err(SLAPI_LOG_TRACE, windows_repl_plugin_name, "=> windows_perform_operation\n"); if (windows_conn_connected(conn)) { @@ -347,7 +347,7 @@ windows_perform_operation(Repl_Connection *conn, int optype, const char *dn, char *s = NULL; rc = slapi_ldap_get_lderrno(conn->ld, NULL, &s); - slapi_log_error(SLAPI_LOG_ERR, windows_repl_plugin_name, + slapi_log_err(SLAPI_LOG_ERR, windows_repl_plugin_name, "windows_perform_operation - %s: Received error %d: %s for %s operation\n", agmt_get_long_name(conn->agmt), rc, s ? s : "NULL", op_string); @@ -433,7 +433,7 @@ windows_perform_operation(Repl_Connection *conn, int optype, const char *dn, * enough information to allow them to fix the problem * and retry - bug 170350 */ if (conn->last_ldap_error == LDAP_CONSTRAINT_VIOLATION) { - slapi_log_error(SLAPI_LOG_ERR, windows_repl_plugin_name, + slapi_log_err(SLAPI_LOG_ERR, windows_repl_plugin_name, "windows_perform_operation - %s: Received error [%s] when attempting to %s" " entry [%s]: Please correct the attribute specified " "in the error message. Refer to the Windows Active " @@ -441,7 +441,7 @@ windows_perform_operation(Repl_Connection *conn, int optype, const char *dn, agmt_get_long_name(conn->agmt), errmsg, op_string, dn); } else { - slapi_log_error(SLAPI_LOG_REPL, windows_repl_plugin_name, + slapi_log_err(SLAPI_LOG_REPL, windows_repl_plugin_name, "windows_perform_operation - %s: Received result code %d (%s) for %s operation %s%s\n", agmt_get_long_name(conn->agmt), conn->last_ldap_error, errmsg, @@ -465,7 +465,7 @@ windows_perform_operation(Repl_Connection *conn, int optype, const char *dn, } else { - slapi_log_error(SLAPI_LOG_ERR, windows_repl_plugin_name, + slapi_log_err(SLAPI_LOG_ERR, windows_repl_plugin_name, "windows_perform_operation - %s: Failed to send %s operation: LDAP error %d (%s)\n", agmt_get_long_name(conn->agmt), op_string ? op_string : "NULL", rc, ldap_err2string(rc)); @@ -490,7 +490,7 @@ windows_perform_operation(Repl_Connection *conn, int optype, const char *dn, */ return_value = CONN_NOT_CONNECTED; } - LDAPDebug(LDAP_DEBUG_TRACE, "<= windows_perform_operation\n", 0, 0, 0 ); + slapi_log_err(SLAPI_LOG_TRACE, windows_repl_plugin_name, "<= windows_perform_operation\n"); return return_value; } @@ -695,10 +695,10 @@ windows_search_entry_ext(Repl_Connection *conn, char* searchbase, char *filter, { ConnResult return_value = 0; - LDAPDebug(LDAP_DEBUG_TRACE, "=> windows_search_entry\n", 0, 0, 0 ); + slapi_log_err(SLAPI_LOG_TRACE, windows_repl_plugin_name, "=> windows_search_entry_ext\n"); if (!entry) { - LDAPDebug(LDAP_DEBUG_ERR, "windows_search_entry: NULL entry\n", 0, 0, 0 ); + slapi_log_err(SLAPI_LOG_ERR, windows_repl_plugin_name, "windows_search_entry_ext - NULL entry\n"); return_value = CONN_LOCAL_ERROR; /* entry should never == NULL here */ goto done; } @@ -717,7 +717,7 @@ windows_search_entry_ext(Repl_Connection *conn, char* searchbase, char *filter, slapi_add_controls(&serverctrls_copy, serverctrls, 1 /* make a copy we can free */); - LDAPDebug(LDAP_DEBUG_REPL, "Calling windows entry search request plugin\n", 0, 0, 0 ); + slapi_log_err(SLAPI_LOG_REPL, windows_repl_plugin_name, "windows_search_entry_ext - Calling windows entry search request plugin\n"); winsync_plugin_call_pre_ad_search_cb(conn->agmt, NULL, &searchbase_copy, &scope, &filter_copy, &attrs, &serverctrls_copy); @@ -728,7 +728,7 @@ next: &conn->timeout, 0 /* sizelimit */, &res); if ((LDAP_SUCCESS != ldap_rc) && !IS_DISCONNECT_ERROR(ldap_rc)) { - slapi_log_error(SLAPI_LOG_REPL, windows_repl_plugin_name, + slapi_log_err(SLAPI_LOG_REPL, windows_repl_plugin_name, "Could not retrieve entry from Windows using search " "base [%s] scope [%d] filter [%s]: error %d:%s\n", searchbase_copy, scope, filter_copy, ldap_rc, @@ -748,7 +748,7 @@ next: nummessages = ldap_count_messages(conn->ld, res); numentries = ldap_count_entries(conn->ld, res); numreferences = ldap_count_references(conn->ld, res); - LDAPDebug(LDAP_DEBUG_REPL, "windows_search_entry: received %d messages, %d entries, %d references\n", + slapi_log_err(SLAPI_LOG_REPL, windows_repl_plugin_name, "windows_search_entry_ext - Received %d messages, %d entries, %d references\n", nummessages, numentries, numreferences ); } @@ -797,7 +797,7 @@ next: return_value = CONN_NOT_CONNECTED; } done: - LDAPDebug(LDAP_DEBUG_TRACE, "<= windows_search_entry\n", 0, 0, 0 ); + slapi_log_err(SLAPI_LOG_TRACE, windows_repl_plugin_name, "<= windows_search_entry_ext\n"); return return_value; } @@ -806,7 +806,7 @@ send_dirsync_search(Repl_Connection *conn) { ConnResult return_value; - LDAPDebug(LDAP_DEBUG_TRACE, "=> send_dirsync_search\n", 0, 0, 0 ); + slapi_log_err(SLAPI_LOG_TRACE, windows_repl_plugin_name, "=> send_dirsync_search\n"); if (windows_conn_connected(conn)) { @@ -836,7 +836,7 @@ send_dirsync_search(Repl_Connection *conn) conn->status = STATUS_SEARCHING; op_string = "search"; - LDAPDebug(LDAP_DEBUG_REPL, "Calling dirsync search request plugin\n", 0, 0, 0 ); + slapi_log_err(SLAPI_LOG_REPL, windows_repl_plugin_name, "send_dirsync_search - Calling dirsync search request plugin\n"); userfilter = windows_private_get_windows_userfilter(conn->agmt); if (userfilter) { filter = slapi_ch_strdup(userfilter); @@ -846,7 +846,7 @@ send_dirsync_search(Repl_Connection *conn) winsync_plugin_call_dirsync_search_params_cb(conn->agmt, old_dn, &dn, &scope, &filter, &attrs, &server_controls); - LDAPDebug(LDAP_DEBUG_REPL, "Sending dirsync search request\n", 0, 0, 0 ); + slapi_log_err(SLAPI_LOG_REPL, windows_repl_plugin_name, "send_dirsync_search - Sending dirsync search request\n"); rc = ldap_search_ext( conn->ld, dn, scope, filter, attrs, PR_FALSE, server_controls, NULL /* ClientControls */, 0,0, &msgid); @@ -857,7 +857,7 @@ send_dirsync_search(Repl_Connection *conn) } else { - slapi_log_error(SLAPI_LOG_ERR, windows_repl_plugin_name, + slapi_log_err(SLAPI_LOG_ERR, windows_repl_plugin_name, "send_dirsync_search - %s: Failed to get %s operation: LDAP error %d (%s)\n", agmt_get_long_name(conn->agmt), op_string, rc, ldap_err2string(rc)); @@ -889,7 +889,7 @@ send_dirsync_search(Repl_Connection *conn) */ return_value = CONN_NOT_CONNECTED; } - LDAPDebug(LDAP_DEBUG_TRACE, "<= send_dirsync_search\n", 0, 0, 0 ); + slapi_log_err(SLAPI_LOG_TRACE, windows_repl_plugin_name, "<= send_dirsync_search\n"); return return_value; } @@ -902,12 +902,12 @@ windows_conn_send_add(Repl_Connection *conn, const char *dn, LDAPMod **attrs, LDAPControl **server_controls, LDAPControl ***returned_controls) { ConnResult res = 0; - LDAPDebug(LDAP_DEBUG_TRACE, "=> windows_conn_send_add\n", 0, 0, 0 ); + slapi_log_err(SLAPI_LOG_TRACE, windows_repl_plugin_name, "=> windows_conn_send_add\n"); res = windows_perform_operation(conn, CONN_ADD, dn, attrs, NULL /* newrdn */, NULL /* newparent */, 0 /* deleteoldrdn */, server_controls, NULL /* extop OID */, NULL /* extop payload */, NULL /* retoidp */, NULL /* retdatap */, returned_controls); - LDAPDebug(LDAP_DEBUG_TRACE, "<= windows_conn_send_add\n", 0, 0, 0 ); + slapi_log_err(SLAPI_LOG_TRACE, windows_repl_plugin_name, "<= windows_conn_send_add\n"); return res; } @@ -919,8 +919,8 @@ ConnResult windows_conn_send_delete(Repl_Connection *conn, const char *dn, LDAPControl **server_controls, LDAPControl ***returned_controls) { - LDAPDebug(LDAP_DEBUG_TRACE, "=> windows_conn_send_delete\n", 0, 0, 0 ); - LDAPDebug(LDAP_DEBUG_TRACE, "<= windows_conn_send_delete\n", 0, 0, 0 ); + slapi_log_err(SLAPI_LOG_TRACE, windows_repl_plugin_name, "=> windows_conn_send_delete\n"); + slapi_log_err(SLAPI_LOG_TRACE, windows_repl_plugin_name, "<= windows_conn_send_delete\n"); return windows_perform_operation(conn, CONN_DELETE, dn, NULL /* attrs */, NULL /* newrdn */, NULL /* newparent */, 0 /* deleteoldrdn */, server_controls, NULL /* extop OID */, NULL /* extop payload */, @@ -935,8 +935,8 @@ ConnResult windows_conn_send_modify(Repl_Connection *conn, const char *dn, LDAPMod **mods, LDAPControl **server_controls, LDAPControl ***returned_controls) { - LDAPDebug(LDAP_DEBUG_TRACE, "=> windows_conn_send_modify\n", 0, 0, 0 ); - LDAPDebug(LDAP_DEBUG_TRACE, "<= windows_conn_send_modify\n", 0, 0, 0 ); + slapi_log_err(SLAPI_LOG_TRACE, windows_repl_plugin_name, "=> windows_conn_send_modify\n"); + slapi_log_err(SLAPI_LOG_TRACE, windows_repl_plugin_name, "<= windows_conn_send_modify\n"); return windows_perform_operation(conn, CONN_MODIFY, dn, mods, NULL /* newrdn */, NULL /* newparent */, 0 /* deleteoldrdn */, server_controls, NULL /* extop OID */, NULL /* extop payload */, NULL /* retoidp */, @@ -951,8 +951,8 @@ windows_conn_send_rename(Repl_Connection *conn, const char *dn, const char *newrdn, const char *newparent, int deleteoldrdn, LDAPControl **server_controls, LDAPControl ***returned_controls) { - LDAPDebug(LDAP_DEBUG_TRACE, "=> windows_conn_send_rename\n", 0, 0, 0 ); - LDAPDebug(LDAP_DEBUG_TRACE, "<= windows_conn_send_rename\n", 0, 0, 0 ); + slapi_log_err(SLAPI_LOG_TRACE, windows_repl_plugin_name, "=> windows_conn_send_rename\n"); + slapi_log_err(SLAPI_LOG_TRACE, windows_repl_plugin_name, "<= windows_conn_send_rename\n"); return windows_perform_operation(conn, CONN_RENAME, dn, NULL /* attrs */, newrdn, newparent, deleteoldrdn, server_controls, NULL /* extop OID */, NULL /* extop payload */, NULL /* retoidp */, @@ -971,7 +971,7 @@ Slapi_Entry * windows_conn_get_search_result(Repl_Connection *conn) LDAPMessage *lm = NULL; char *dn = ""; - LDAPDebug(LDAP_DEBUG_TRACE, "=> windows_conn_get_search_result\n", 0, 0, 0 ); + slapi_log_err(SLAPI_LOG_TRACE, windows_repl_plugin_name, "=> windows_conn_get_search_result\n"); if (windows_conn_connected(conn)) { @@ -980,7 +980,7 @@ Slapi_Entry * windows_conn_get_search_result(Repl_Connection *conn) case 0: case -1: case LDAP_RES_SEARCH_REFERENCE: - slapi_log_error(SLAPI_LOG_ERR, windows_repl_plugin_name, "windows_conn_get_search_result - " + slapi_log_err(SLAPI_LOG_ERR, windows_repl_plugin_name, "windows_conn_get_search_result - " "Error in windows_conn_get_search_result, rc=%d\n", rc); break; case LDAP_RES_SEARCH_RESULT: @@ -989,7 +989,7 @@ Slapi_Entry * windows_conn_get_search_result(Repl_Connection *conn) int code = 0; /* Purify says this is a leak : */ if (LDAP_SUCCESS != (rc = ldap_parse_result( conn->ld, res, &code, NULL, NULL, NULL, &returned_controls, 0 ))) { - slapi_log_error(SLAPI_LOG_ERR, windows_repl_plugin_name, "windows_conn_get_search_result - " + slapi_log_err(SLAPI_LOG_ERR, windows_repl_plugin_name, "windows_conn_get_search_result - " "Error reading search result in windows_conn_get_search_result, rc=%d:%s\n", rc, ldap_err2string(rc)); } @@ -999,7 +999,7 @@ Slapi_Entry * windows_conn_get_search_result(Repl_Connection *conn) ldap_controls_free(returned_controls); } if (windows_private_dirsync_has_more(conn->agmt)) { - slapi_log_error(SLAPI_LOG_REPL, windows_repl_plugin_name,"windows_conn_get_search_result - " + slapi_log_err(SLAPI_LOG_REPL, windows_repl_plugin_name, "windows_conn_get_search_result - " "Received hasmore from dirsync\n"); } } @@ -1008,7 +1008,7 @@ Slapi_Entry * windows_conn_get_search_result(Repl_Connection *conn) { if (( dn = ldap_get_dn( conn->ld, res )) != NULL ) { - slapi_log_error(SLAPI_LOG_REPL, windows_repl_plugin_name,"windows_conn_get_search_result - " + slapi_log_err(SLAPI_LOG_REPL, windows_repl_plugin_name, "windows_conn_get_search_result - " "Received entry from dirsync: %s\n", dn); lm = ldap_first_entry( conn->ld, res ); /* @@ -1030,7 +1030,7 @@ Slapi_Entry * windows_conn_get_search_result(Repl_Connection *conn) res = NULL; } - LDAPDebug(LDAP_DEBUG_TRACE, "<= windows_conn_get_search_result\n", 0, 0, 0 ); + slapi_log_err(SLAPI_LOG_TRACE, windows_repl_plugin_name, "<= windows_conn_get_search_result\n"); return e; } @@ -1043,8 +1043,8 @@ windows_conn_send_extended_operation(Repl_Connection *conn, const char *extop_oi struct berval *payload, char **retoidp, struct berval **retdatap, LDAPControl **server_controls, LDAPControl ***returned_controls) { - LDAPDebug(LDAP_DEBUG_TRACE, "=> windows_conn_send_extended_operation\n", 0, 0, 0 ); - LDAPDebug(LDAP_DEBUG_TRACE, "<= windows_conn_send_extended_operation\n", 0, 0, 0 ); + slapi_log_err(SLAPI_LOG_TRACE, windows_repl_plugin_name, "=> windows_conn_send_extended_operation\n"); + slapi_log_err(SLAPI_LOG_TRACE, windows_repl_plugin_name, "<= windows_conn_send_extended_operation\n"); return windows_perform_operation(conn, CONN_EXTENDED_OPERATION, NULL /* dn */, NULL /* attrs */, NULL /* newrdn */, NULL /* newparent */, 0 /* deleteoldrdn */, server_controls, extop_oid, payload, retoidp, retdatap, @@ -1071,7 +1071,7 @@ windows_conn_read_entry_attribute(Repl_Connection *conn, const char *dn, LDAPMessage *res = NULL; char *attrs[2]; - LDAPDebug(LDAP_DEBUG_TRACE, "=> windows_conn_read_entry_attribute\n", 0, 0, 0 ); + slapi_log_err(SLAPI_LOG_TRACE, windows_repl_plugin_name, "=> windows_conn_read_entry_attribute\n"); PR_ASSERT(NULL != type); if (windows_conn_connected(conn)) @@ -1113,7 +1113,7 @@ windows_conn_read_entry_attribute(Repl_Connection *conn, const char *dn, { return_value = CONN_NOT_CONNECTED; } - LDAPDebug(LDAP_DEBUG_TRACE, "<= windows_conn_read_entry_attribute\n", 0, 0, 0 ); + slapi_log_err(SLAPI_LOG_TRACE, windows_repl_plugin_name, "<= windows_conn_read_entry_attribute\n"); return return_value; } @@ -1125,8 +1125,8 @@ windows_conn_read_entry_attribute(Repl_Connection *conn, const char *dn, const char * windows_conn_get_status(Repl_Connection *conn) { - LDAPDebug(LDAP_DEBUG_TRACE, "=> windows_conn_get_status\n", 0, 0, 0 ); - LDAPDebug(LDAP_DEBUG_TRACE, "<= windows_conn_get_status\n", 0, 0, 0 ); + slapi_log_err(SLAPI_LOG_TRACE, windows_repl_plugin_name, "=> windows_conn_get_status\n"); + slapi_log_err(SLAPI_LOG_TRACE, windows_repl_plugin_name, "<= windows_conn_get_status\n"); return conn->status; } @@ -1139,12 +1139,12 @@ windows_conn_get_status(Repl_Connection *conn) void windows_conn_cancel_linger(Repl_Connection *conn) { - LDAPDebug(LDAP_DEBUG_TRACE, "=> windows_conn_cancel_linger\n", 0, 0, 0 ); + slapi_log_err(SLAPI_LOG_TRACE, windows_repl_plugin_name, "=> windows_conn_cancel_linger\n"); PR_ASSERT(NULL != conn); PR_Lock(conn->lock); if (conn->linger_active) { - slapi_log_error(SLAPI_LOG_REPL, windows_repl_plugin_name, + slapi_log_err(SLAPI_LOG_REPL, windows_repl_plugin_name, "windows_conn_cancel_linger - %s: Cancelling linger on the connection\n", agmt_get_long_name(conn->agmt)); conn->linger_active = PR_FALSE; @@ -1157,12 +1157,12 @@ windows_conn_cancel_linger(Repl_Connection *conn) } else { - slapi_log_error(SLAPI_LOG_REPL, windows_repl_plugin_name, + slapi_log_err(SLAPI_LOG_REPL, windows_repl_plugin_name, "windows_conn_cancel_linger - %s: No linger to cancel on the connection\n", agmt_get_long_name(conn->agmt)); } PR_Unlock(conn->lock); - LDAPDebug(LDAP_DEBUG_TRACE, "<= windows_conn_cancel_linger\n", 0, 0, 0 ); + slapi_log_err(SLAPI_LOG_TRACE, windows_repl_plugin_name, "<= windows_conn_cancel_linger\n"); } @@ -1178,10 +1178,10 @@ linger_timeout(time_t event_time, void *arg) PRBool delete_now; Repl_Connection *conn = (Repl_Connection *)arg; - LDAPDebug(LDAP_DEBUG_TRACE, "=> linger_timeout\n", 0, 0, 0 ); + slapi_log_err(SLAPI_LOG_TRACE, windows_repl_plugin_name, "=> linger_timeout\n"); PR_ASSERT(NULL != conn); - slapi_log_error(SLAPI_LOG_REPL, windows_repl_plugin_name, + slapi_log_err(SLAPI_LOG_REPL, windows_repl_plugin_name, "linger_timeout - %s: Linger timeout has expired on the connection\n", agmt_get_long_name(conn->agmt)); PR_Lock(conn->lock); @@ -1197,7 +1197,7 @@ linger_timeout(time_t event_time, void *arg) { windows_conn_delete_internal(conn); } - LDAPDebug(LDAP_DEBUG_TRACE, "<= linger_timeout\n", 0, 0, 0 ); + slapi_log_err(SLAPI_LOG_TRACE, windows_repl_plugin_name, "<= linger_timeout\n"); } @@ -1210,15 +1210,15 @@ windows_conn_start_linger(Repl_Connection *conn) { time_t now; - LDAPDebug(LDAP_DEBUG_TRACE, "=> windows_conn_start_linger\n", 0, 0, 0 ); + slapi_log_err(SLAPI_LOG_TRACE, windows_repl_plugin_name, "=> windows_conn_start_linger\n"); PR_ASSERT(NULL != conn); - slapi_log_error(SLAPI_LOG_REPL, windows_repl_plugin_name, + slapi_log_err(SLAPI_LOG_REPL, windows_repl_plugin_name, "windows_conn_start_linger - %s: Beginning linger on the connection\n", agmt_get_long_name(conn->agmt)); if (!windows_conn_connected(conn)) { - slapi_log_error(SLAPI_LOG_REPL, windows_repl_plugin_name, + slapi_log_err(SLAPI_LOG_REPL, windows_repl_plugin_name, "windows_conn_start_linger - %s: No linger on the closed conn\n", agmt_get_long_name(conn->agmt)); return; @@ -1227,7 +1227,7 @@ windows_conn_start_linger(Repl_Connection *conn) PR_Lock(conn->lock); if (conn->linger_active) { - slapi_log_error(SLAPI_LOG_REPL, windows_repl_plugin_name, + slapi_log_err(SLAPI_LOG_REPL, windows_repl_plugin_name, "windows_conn_start_linger - %s: Linger already active on the connection\n", agmt_get_long_name(conn->agmt)); } @@ -1238,7 +1238,7 @@ windows_conn_start_linger(Repl_Connection *conn) conn->status = STATUS_LINGERING; } PR_Unlock(conn->lock); - LDAPDebug(LDAP_DEBUG_TRACE, "<= windows_conn_start_linger\n", 0, 0, 0 ); + slapi_log_err(SLAPI_LOG_TRACE, windows_repl_plugin_name, "<= windows_conn_start_linger\n"); } @@ -1261,7 +1261,7 @@ windows_conn_connect(Repl_Connection *conn) ConnResult return_value = CONN_OPERATION_SUCCESS; int pw_ret = 1; - LDAPDebug(LDAP_DEBUG_TRACE, "=> windows_conn_connect\n", 0, 0, 0 ); + slapi_log_err(SLAPI_LOG_TRACE, windows_repl_plugin_name, "=> windows_conn_connect\n"); /** Connection already open just return SUCCESS **/ if(conn->state == STATE_CONNECTED) { @@ -1297,7 +1297,7 @@ windows_conn_connect(Repl_Connection *conn) /* Pb occured in decryption: stop now, binding will fail */ if ( pw_ret == -1 ) { - slapi_log_error(SLAPI_LOG_ERR, windows_repl_plugin_name, "windows_conn_connect - " + slapi_log_err(SLAPI_LOG_ERR, windows_repl_plugin_name, "windows_conn_connect - " "%s: Decoding of the credentials failed.\n", agmt_get_long_name(conn->agmt)); @@ -1324,7 +1324,7 @@ windows_conn_connect(Repl_Connection *conn) if (secure > 0) { if (!NSS_IsInitialized()) { - slapi_log_error(SLAPI_LOG_ERR, windows_repl_plugin_name, "windows_conn_connect - " + slapi_log_err(SLAPI_LOG_ERR, windows_repl_plugin_name, "windows_conn_connect - " "%s: SSL Not Initialized, Replication over SSL FAILED\n", agmt_get_long_name(conn->agmt)); return_value = CONN_SSL_NOT_ENABLED; @@ -1340,7 +1340,7 @@ windows_conn_connect(Repl_Connection *conn) #endif /* Now we initialize the LDAP Structure and set options */ - slapi_log_error(SLAPI_LOG_REPL, windows_repl_plugin_name, + slapi_log_err(SLAPI_LOG_REPL, windows_repl_plugin_name, "windows_conn_connect - %s: Trying %s%s slapi_ldap_init_ext\n", agmt_get_long_name(conn->agmt), secure ? "secure" : "non-secure", @@ -1353,7 +1353,7 @@ windows_conn_connect(Repl_Connection *conn) conn->state = STATE_DISCONNECTED; conn->last_operation = CONN_INIT; conn->last_ldap_error = LDAP_LOCAL_ERROR; - slapi_log_error(SLAPI_LOG_ERR, windows_repl_plugin_name, + slapi_log_err(SLAPI_LOG_ERR, windows_repl_plugin_name, "windows_conn_connect - %s: Failed to establish %s%sconnection to the consumer\n", agmt_get_long_name(conn->agmt), secure ? "secure " : "", @@ -1364,8 +1364,8 @@ windows_conn_connect(Repl_Connection *conn) /* slapi_ch_strdup is OK with NULL strings */ binddn = slapi_ch_strdup(conn->binddn); - slapi_log_error(SLAPI_LOG_REPL, windows_repl_plugin_name, - "%s: binddn = %s, passwd = %s\n", + slapi_log_err(SLAPI_LOG_REPL, windows_repl_plugin_name, + "windows_conn_connect - %s: binddn = %s, passwd = %s\n", agmt_get_long_name(conn->agmt), binddn?binddn:"NULL", creds->bv_val?creds->bv_val:"NULL"); @@ -1412,7 +1412,7 @@ windows_conn_connect(Repl_Connection *conn) { /* We assume that a server that doesn't support dirsync is our NT4 LDAP service */ windows_private_set_isnt4(conn->agmt,1); - LDAPDebug(LDAP_DEBUG_REPL, "windows_conn_connect - detected NT4 peer\n", 0, 0, 0 ); + slapi_log_err(SLAPI_LOG_REPL, windows_repl_plugin_name, "windows_conn_connect - detected NT4 peer\n"); } else { windows_private_set_isnt4(conn->agmt,0); @@ -1422,7 +1422,7 @@ windows_conn_connect(Repl_Connection *conn) if (CONN_IS_WIN2K3 == supports) { windows_private_set_iswin2k3(conn->agmt,1); - LDAPDebug(LDAP_DEBUG_REPL, "windows_conn_connect - detected Win2k3 or later peer\n", 0, 0, 0 ); + slapi_log_err(SLAPI_LOG_REPL, windows_repl_plugin_name, "windows_conn_connect - detected Win2k3 or later peer\n"); } else { windows_private_set_iswin2k3(conn->agmt,0); @@ -1446,7 +1446,7 @@ done: creds = NULL; } - LDAPDebug(LDAP_DEBUG_TRACE, "<= windows_conn_connect\n", 0, 0, 0 ); + slapi_log_err(SLAPI_LOG_TRACE, windows_repl_plugin_name, "<= windows_conn_connect\n"); return return_value; } @@ -1454,7 +1454,7 @@ done: static void close_connection_internal(Repl_Connection *conn) { - LDAPDebug(LDAP_DEBUG_TRACE, "=> close_connection_internal\n", 0, 0, 0 ); + slapi_log_err(SLAPI_LOG_TRACE, windows_repl_plugin_name, "=> close_connection_internal\n"); if (NULL != conn->ld) { @@ -1466,21 +1466,21 @@ close_connection_internal(Repl_Connection *conn) conn->state = STATE_DISCONNECTED; conn->status = STATUS_DISCONNECTED; conn->supports_ds50_repl = -1; - slapi_log_error(SLAPI_LOG_REPL, windows_repl_plugin_name, + slapi_log_err(SLAPI_LOG_REPL, windows_repl_plugin_name, "close_connection_internal - %s: Disconnected from the consumer\n", agmt_get_long_name(conn->agmt)); - LDAPDebug(LDAP_DEBUG_TRACE, "<= close_connection_internal\n", 0, 0, 0 ); + slapi_log_err(SLAPI_LOG_TRACE, windows_repl_plugin_name, "<= close_connection_internal\n"); } void windows_conn_disconnect(Repl_Connection *conn) { - LDAPDebug(LDAP_DEBUG_TRACE, "=> windows_conn_disconnect\n", 0, 0, 0 ); + slapi_log_err(SLAPI_LOG_TRACE, windows_repl_plugin_name, "=> windows_conn_disconnect\n"); PR_ASSERT(NULL != conn); PR_Lock(conn->lock); close_connection_internal(conn); PR_Unlock(conn->lock); - LDAPDebug(LDAP_DEBUG_TRACE, "<= windows_conn_disconnect\n", 0, 0, 0 ); + slapi_log_err(SLAPI_LOG_TRACE, windows_repl_plugin_name, "<= windows_conn_disconnect\n"); } @@ -1500,7 +1500,7 @@ windows_conn_replica_supports_ds5_repl(Repl_Connection *conn) ConnResult return_value; int ldap_rc; - LDAPDebug(LDAP_DEBUG_TRACE, "=> windows_conn_replica_supports_ds5_repl\n", 0, 0, 0 ); + slapi_log_err(SLAPI_LOG_TRACE, windows_repl_plugin_name, "=> windows_conn_replica_supports_ds5_repl\n"); if (windows_conn_connected(conn)) { @@ -1569,7 +1569,7 @@ windows_conn_replica_supports_ds5_repl(Repl_Connection *conn) /* Not connected */ return_value = CONN_NOT_CONNECTED; } - LDAPDebug(LDAP_DEBUG_TRACE, "<= windows_conn_replica_supports_ds5_repl\n", 0, 0, 0 ); + slapi_log_err(SLAPI_LOG_TRACE, windows_repl_plugin_name, "<= windows_conn_replica_supports_ds5_repl\n"); return return_value; } @@ -1580,7 +1580,7 @@ windows_conn_replica_supports_dirsync(Repl_Connection *conn) ConnResult return_value; int ldap_rc; - LDAPDebug(LDAP_DEBUG_TRACE, "=> windows_conn_replica_supports_dirsync\n", 0, 0, 0 ); + slapi_log_err(SLAPI_LOG_TRACE, windows_repl_plugin_name, "=> windows_conn_replica_supports_dirsync\n"); if (getenv("WINSYNC_USE_DS")) { /* used to fake out dirsync to think it's talking to a real ad when in fact @@ -1641,7 +1641,7 @@ windows_conn_replica_supports_dirsync(Repl_Connection *conn) /* Not connected */ return_value = CONN_NOT_CONNECTED; } - LDAPDebug(LDAP_DEBUG_TRACE, "<= windows_conn_replica_supports_dirsync\n", 0, 0, 0 ); + slapi_log_err(SLAPI_LOG_TRACE, windows_repl_plugin_name, "<= windows_conn_replica_supports_dirsync\n"); return return_value; } @@ -1653,7 +1653,7 @@ windows_conn_replica_is_win2k3(Repl_Connection *conn) ConnResult return_value; int ldap_rc; - LDAPDebug(LDAP_DEBUG_TRACE, "=> windows_conn_replica_is_win2k3\n", 0, 0, 0 ); + slapi_log_err(SLAPI_LOG_TRACE, windows_repl_plugin_name, "=> windows_conn_replica_is_win2k3\n"); if (windows_conn_connected(conn)) { @@ -1664,9 +1664,9 @@ windows_conn_replica_is_win2k3(Repl_Connection *conn) conn->status = STATUS_SEARCHING; ldap_rc = ldap_search_ext_s(conn->ld, "", LDAP_SCOPE_BASE, - "(objectclass=*)", attrs, 0 /* attrsonly */, - NULL /* server controls */, NULL /* client controls */, - &conn->timeout, LDAP_NO_LIMIT, &res); + "(objectclass=*)", attrs, 0 /* attrsonly */, + NULL /* server controls */, NULL /* client controls */, + &conn->timeout, LDAP_NO_LIMIT, &res); if (LDAP_SUCCESS == ldap_rc) { conn->is_win2k3 = 0; @@ -1707,7 +1707,7 @@ windows_conn_replica_is_win2k3(Repl_Connection *conn) /* Not connected */ return_value = CONN_NOT_CONNECTED; } - LDAPDebug(LDAP_DEBUG_TRACE, "<= windows_conn_replica_is_win2k3\n", 0, 0, 0 ); + slapi_log_err(SLAPI_LOG_TRACE, windows_repl_plugin_name, "<= windows_conn_replica_is_win2k3\n"); return return_value; } @@ -1723,7 +1723,7 @@ attribute_string_value_present(LDAP *ld, LDAPMessage *entry, const char *type, int return_value = 0; ber_len_t vallen; - LDAPDebug(LDAP_DEBUG_TRACE, "=> attribute_string_value_present\n", 0, 0, 0 ); + slapi_log_err(SLAPI_LOG_TRACE, windows_repl_plugin_name, "=> attribute_string_value_present\n"); if (NULL != entry) { @@ -1759,7 +1759,7 @@ attribute_string_value_present(LDAP *ld, LDAPMessage *entry, const char *type, if (NULL != atype) ldap_memfree(atype); } - LDAPDebug(LDAP_DEBUG_TRACE, "<= attribute_string_value_present\n", 0, 0, 0 ); + slapi_log_err(SLAPI_LOG_TRACE, windows_repl_plugin_name, "<= attribute_string_value_present\n"); return return_value; } @@ -1783,24 +1783,24 @@ attribute_string_value_present(LDAP *ld, LDAPMessage *entry, const char *type, void windows_conn_set_timeout(Repl_Connection *conn, long timeout) { - LDAPDebug(LDAP_DEBUG_TRACE, "=> windows_conn_set_timeout\n", 0, 0, 0 ); + slapi_log_err(SLAPI_LOG_TRACE, windows_repl_plugin_name, "=> windows_conn_set_timeout\n"); PR_ASSERT(NULL != conn); PR_ASSERT(timeout >= 0); PR_Lock(conn->lock); conn->timeout.tv_sec = timeout; PR_Unlock(conn->lock); - LDAPDebug(LDAP_DEBUG_TRACE, "<= windows_conn_set_timeout\n", 0, 0, 0 ); + slapi_log_err(SLAPI_LOG_TRACE, windows_repl_plugin_name, "<= windows_conn_set_timeout\n"); } void windows_conn_set_agmt_changed(Repl_Connection *conn) { - LDAPDebug(LDAP_DEBUG_TRACE, "=> windows_conn_set_agmt_changed\n", 0, 0, 0 ); + slapi_log_err(SLAPI_LOG_TRACE, windows_repl_plugin_name, "=> windows_conn_set_agmt_changed\n"); PR_ASSERT(NULL != conn); PR_Lock(conn->lock); if (NULL != conn->agmt) conn->flag_agmt_changed = 1; PR_Unlock(conn->lock); - LDAPDebug(LDAP_DEBUG_TRACE, "<= windows_conn_set_agmt_changed\n", 0, 0, 0 ); + slapi_log_err(SLAPI_LOG_TRACE, windows_repl_plugin_name, "<= windows_conn_set_agmt_changed\n"); } static const char * @@ -1838,7 +1838,7 @@ bind_and_check_pwp(Repl_Connection *conn, char * binddn, char *password) int rc; const char *mech = bind_method_to_mech(conn->bindmethod); - LDAPDebug(LDAP_DEBUG_TRACE, "=> bind_and_check_pwp\n", 0, 0, 0 ); + slapi_log_err(SLAPI_LOG_TRACE, windows_repl_plugin_name, "=> bind_and_check_pwp\n"); rc = slapi_ldap_bind(conn->ld, binddn, password, mech, NULL, &ctrls, NULL, NULL); @@ -1848,7 +1848,7 @@ bind_and_check_pwp(Repl_Connection *conn, char * binddn, char *password) if (conn->last_ldap_error != rc) { conn->last_ldap_error = rc; - slapi_log_error(SLAPI_LOG_ERR, windows_repl_plugin_name, + slapi_log_err(SLAPI_LOG_ERR, windows_repl_plugin_name, "bind_and_check_pwp - %s: Replication bind with %s auth resumed\n", agmt_get_long_name(conn->agmt), mech ? mech : "SIMPLE"); @@ -1862,7 +1862,7 @@ bind_and_check_pwp(Repl_Connection *conn, char * binddn, char *password) if ( !(strcmp( ctrls[ i ]->ldctl_oid, LDAP_CONTROL_PWEXPIRED)) ) { /* Bind is successfull but password has expired */ - slapi_log_error(SLAPI_LOG_ERR, windows_repl_plugin_name, + slapi_log_err(SLAPI_LOG_ERR, windows_repl_plugin_name, "bind_and_check_pwp - %s: Successfully bound %s to consumer, " "but password has expired on consumer.\n", agmt_get_long_name(conn->agmt), binddn); @@ -1874,7 +1874,7 @@ bind_and_check_pwp(Repl_Connection *conn, char * binddn, char *password) (ctrls[ i ]->ldctl_value.bv_len > 0) ) { int password_expiring = atoi( ctrls[ i ]->ldctl_value.bv_val ); - slapi_log_error(SLAPI_LOG_ERR, windows_repl_plugin_name, + slapi_log_err(SLAPI_LOG_ERR, windows_repl_plugin_name, "bind_and_check_pwp - %s: Successfully bound %s to consumer, " "but password is expiring on consumer in %d seconds.\n", agmt_get_long_name(conn->agmt), binddn, password_expiring); @@ -1884,7 +1884,7 @@ bind_and_check_pwp(Repl_Connection *conn, char * binddn, char *password) ldap_controls_free( ctrls ); } - LDAPDebug(LDAP_DEBUG_TRACE, "<= bind_and_check_pwp - CONN_OPERATION_SUCCESS\n", 0, 0, 0 ); + slapi_log_err(SLAPI_LOG_TRACE, windows_repl_plugin_name, "<= bind_and_check_pwp - CONN_OPERATION_SUCCESS\n"); return (CONN_OPERATION_SUCCESS); } @@ -1899,7 +1899,7 @@ bind_and_check_pwp(Repl_Connection *conn, char * binddn, char *password) conn->last_ldap_error = rc; /* errmsg is a pointer directly into the ld structure - do not free */ rc = slapi_ldap_get_lderrno( ld, NULL, &errmsg ); - slapi_log_error(SLAPI_LOG_ERR, windows_repl_plugin_name, + slapi_log_err(SLAPI_LOG_ERR, windows_repl_plugin_name, "bind_and_check_pwp - %s: Replication bind with %s auth failed: LDAP error %d (%s) (%s)\n", agmt_get_long_name(conn->agmt), mech ? mech : "SIMPLE", rc, @@ -1908,14 +1908,14 @@ bind_and_check_pwp(Repl_Connection *conn, char * binddn, char *password) char *errmsg = NULL; /* errmsg is a pointer directly into the ld structure - do not free */ rc = slapi_ldap_get_lderrno( ld, NULL, &errmsg ); - slapi_log_error(SLAPI_LOG_REPL, windows_repl_plugin_name, + slapi_log_err(SLAPI_LOG_REPL, windows_repl_plugin_name, "bind_and_check_pwp - %s: Replication bind with %s auth failed: LDAP error %d (%s) (%s)\n", agmt_get_long_name(conn->agmt), mech ? mech : "SIMPLE", rc, ldap_err2string(rc), errmsg); } - LDAPDebug(LDAP_DEBUG_TRACE, "<= bind_and_check_pwp - CONN_OPERATION_FAILED\n", 0, 0, 0 ); + slapi_log_err(SLAPI_LOG_TRACE, windows_repl_plugin_name, "<= bind_and_check_pwp - CONN_OPERATION_FAILED\n"); return (CONN_OPERATION_FAILED); } } @@ -1944,13 +1944,13 @@ windows_check_user_password(Repl_Connection *conn, Slapi_DN *sdn, char *password rc = ldap_result(conn->ld, msgid, LDAP_MSG_ALL, NULL, &res); if (0 > rc) { /* error */ rc = slapi_ldap_get_lderrno(conn->ld, NULL, NULL); - slapi_log_error(SLAPI_LOG_ERR, windows_repl_plugin_name, + slapi_log_err(SLAPI_LOG_ERR, windows_repl_plugin_name, "windows_check_user_password - Error reading bind response for id " "[%s]: error %d (%s)\n", binddn ? binddn : "(anon)", rc, ldap_err2string(rc)); } else if (rc == 0) { /* timeout */ - slapi_log_error(SLAPI_LOG_ERR, windows_repl_plugin_name, + slapi_log_err(SLAPI_LOG_ERR, windows_repl_plugin_name, "windows_check_user_password - Error: timeout reading " "bind response for [%s]\n", binddn ? binddn : "(anon)"); @@ -1958,7 +1958,7 @@ windows_check_user_password(Repl_Connection *conn, Slapi_DN *sdn, char *password } else { parse_rc = ldap_parse_result( conn->ld, res, &rc, NULL, NULL, NULL, NULL, 1 /* Free res */); if (parse_rc != LDAP_SUCCESS) { - slapi_log_error(SLAPI_LOG_ERR, windows_repl_plugin_name, + slapi_log_err(SLAPI_LOG_ERR, windows_repl_plugin_name, "windows_check_user_password - Error: unable to parse " "bind result for [%s]: " "error %d\n", @@ -1979,7 +1979,7 @@ do_simple_bind (Repl_Connection *conn, LDAP *ld, char * binddn, char *password) { int msgid; - LDAPDebug(LDAP_DEBUG_TRACE, "=> do_simple_bind\n", 0, 0, 0 ); + slapi_log_err(SLAPI_LOG_TRACE, windows_repl_plugin_name, "=> do_simple_bind\n"); if( LDAP_SUCCESS != slapi_ldap_bind( ld, binddn, password, LDAP_SASL_SIMPLE, NULL, NULL, NULL, &msgid ) ) { @@ -1992,7 +1992,7 @@ do_simple_bind (Repl_Connection *conn, LDAP *ld, char * binddn, char *password) if (conn->last_ldap_error != ldaperr) { conn->last_ldap_error = ldaperr; - slapi_log_error(SLAPI_LOG_ERR, windows_repl_plugin_name, + slapi_log_err(SLAPI_LOG_ERR, windows_repl_plugin_name, "do_simple_bind - %s: Simple bind failed, " SLAPI_COMPONENT_NAME_LDAPSDK " error %d (%s) (%s), " SLAPI_COMPONENT_NAME_NSPR " error %d (%s)\n", @@ -2005,11 +2005,11 @@ do_simple_bind (Repl_Connection *conn, LDAP *ld, char * binddn, char *password) else if (conn->last_ldap_error != LDAP_SUCCESS) { conn->last_ldap_error = LDAP_SUCCESS; - slapi_log_error(SLAPI_LOG_INFO, windows_repl_plugin_name, + slapi_log_err(SLAPI_LOG_INFO, windows_repl_plugin_name, "do_simple_bind - %s: Simple bind resumed\n", agmt_get_long_name(conn->agmt)); } - LDAPDebug(LDAP_DEBUG_TRACE, "<= do_simple_bind\n", 0, 0, 0 ); + slapi_log_err(SLAPI_LOG_TRACE, windows_repl_plugin_name, "<= do_simple_bind\n"); return msgid; } @@ -2019,14 +2019,14 @@ repl5_start_debug_timeout(int *setlevel) { Slapi_Eq_Context eqctx = 0; - LDAPDebug(LDAP_DEBUG_TRACE, "=> repl5_start_debug_timeout\n", 0, 0, 0 ); + slapi_log_err(SLAPI_LOG_TRACE, windows_repl_plugin_name, "=> repl5_start_debug_timeout\n"); if (s_debug_timeout && s_debug_level) { time_t now = time(NULL); eqctx = slapi_eq_once(repl5_debug_timeout_callback, setlevel, s_debug_timeout + now); } - LDAPDebug(LDAP_DEBUG_TRACE, "<= repl5_start_debug_timeout\n", 0, 0, 0 ); + slapi_log_err(SLAPI_LOG_TRACE, windows_repl_plugin_name, "<= repl5_start_debug_timeout\n"); return eqctx; } @@ -2035,7 +2035,7 @@ repl5_stop_debug_timeout(Slapi_Eq_Context eqctx, int *setlevel) { char buf[20]; - LDAPDebug(LDAP_DEBUG_TRACE, "=> repl5_stop_debug_timeout\n", 0, 0, 0 ); + slapi_log_err(SLAPI_LOG_TRACE, windows_repl_plugin_name, "=> repl5_stop_debug_timeout\n"); if (eqctx && !*setlevel) { (void)slapi_eq_cancel(eqctx); @@ -2047,7 +2047,7 @@ repl5_stop_debug_timeout(Slapi_Eq_Context eqctx, int *setlevel) config_set_errorlog_level("nsslapd-errorlog-level", buf, NULL, 1); } - LDAPDebug(LDAP_DEBUG_TRACE, "<= repl5_stop_debug_timeout\n", 0, 0, 0 ); + slapi_log_err(SLAPI_LOG_TRACE, windows_repl_plugin_name, "<= repl5_stop_debug_timeout\n"); } static void @@ -2057,15 +2057,15 @@ repl5_debug_timeout_callback(time_t when, void *arg) /* No longer needed as we are including the one in slap.h */ char buf[20]; - LDAPDebug(LDAP_DEBUG_TRACE, "=> repl5_debug_timeout_callback\n", 0, 0, 0 ); + slapi_log_err(SLAPI_LOG_TRACE, windows_repl_plugin_name, "=> repl5_debug_timeout_callback\n"); *setlevel = 1; sprintf(buf, "%d", s_debug_level); config_set_errorlog_level("nsslapd-errorlog-level", buf, NULL, 1); - slapi_log_error(SLAPI_LOG_INFO, windows_repl_plugin_name, + slapi_log_err(SLAPI_LOG_INFO, windows_repl_plugin_name, "repl5_debug_timeout_callback: Set debug level to %d at %ld\n", s_debug_level, when); - LDAPDebug(LDAP_DEBUG_TRACE, "<= repl5_debug_timeout_callback\n", 0, 0, 0 ); + slapi_log_err(SLAPI_LOG_TRACE, windows_repl_plugin_name, "<= repl5_debug_timeout_callback\n"); } diff --git a/ldap/servers/plugins/replication/windows_inc_protocol.c b/ldap/servers/plugins/replication/windows_inc_protocol.c index d8fad4b..e235f2d 100644 --- a/ldap/servers/plugins/replication/windows_inc_protocol.c +++ b/ldap/servers/plugins/replication/windows_inc_protocol.c @@ -130,12 +130,12 @@ windows_inc_delete(Private_Repl_Protocol **prpp) { int rc; windows_inc_private *prp_priv = (windows_inc_private *)(*prpp)->private; - LDAPDebug0Args(LDAP_DEBUG_TRACE, "=> windows_inc_delete\n" ); + slapi_log_err(SLAPI_LOG_TRACE, windows_repl_plugin_name, "=> windows_inc_delete\n" ); /* First, stop the protocol if it isn't already stopped */ /* Then, delete all resources used by the protocol */ rc = slapi_eq_cancel(dirsync); - slapi_log_error(SLAPI_LOG_REPL, windows_repl_plugin_name, - "windows_inc_delete: dirsync: %p, rval: %d\n", dirsync, rc); + slapi_log_err(SLAPI_LOG_REPL, windows_repl_plugin_name, + "windows_inc_delete - dirsync: %p, rval: %d\n", dirsync, rc); /* if backoff is set, delete it (from EQ, as well) */ if (prp_priv->backoff) { backoff_delete(&prp_priv->backoff); @@ -155,14 +155,14 @@ windows_inc_delete(Private_Repl_Protocol **prpp) slapi_ch_free((void **)&(*prpp)->private); slapi_ch_free((void **)prpp); - LDAPDebug0Args(LDAP_DEBUG_TRACE, "<= windows_inc_delete\n" ); + slapi_log_err(SLAPI_LOG_TRACE, windows_repl_plugin_name, "<= windows_inc_delete\n" ); } /* helper function */ void w_set_pause_and_busy_time(Private_Repl_Protocol *prp, long *pausetime, long *busywaittime) { - slapi_log_error(SLAPI_LOG_TRACE, windows_repl_plugin_name, "=> w_set_pause_and_busy_time\n" ); + slapi_log_err(SLAPI_LOG_TRACE, windows_repl_plugin_name, "=> w_set_pause_and_busy_time\n" ); /* If neither are set, set busy time to its default */ if (!*pausetime && !*busywaittime) { @@ -199,7 +199,7 @@ w_set_pause_and_busy_time(Private_Repl_Protocol *prp, long *pausetime, long *bus */ *pausetime = *busywaittime + 1; } - slapi_log_error(SLAPI_LOG_TRACE, windows_repl_plugin_name, "<= w_set_pause_and_busy_time\n" ); + slapi_log_err(SLAPI_LOG_TRACE, windows_repl_plugin_name, "<= w_set_pause_and_busy_time\n" ); } /* @@ -276,7 +276,7 @@ windows_inc_run(Private_Repl_Protocol *prp) PRBool run_dirsync = PR_FALSE; - slapi_log_error(SLAPI_LOG_TRACE, windows_repl_plugin_name, "=> windows_inc_run\n" ); + slapi_log_err(SLAPI_LOG_TRACE, windows_repl_plugin_name, "=> windows_inc_run\n" ); prp->stopped = 0; prp->terminate = 0; @@ -340,12 +340,12 @@ windows_inc_run(Private_Repl_Protocol *prp) current_interval = interval; if(dirsync){ int rc = slapi_eq_cancel(dirsync); - slapi_log_error(SLAPI_LOG_REPL, windows_repl_plugin_name, + slapi_log_err(SLAPI_LOG_REPL, windows_repl_plugin_name, "windows_inc_run - Cancelled dirsync: %p, rval: %d\n", dirsync, rc); } dirsync = slapi_eq_repeat(periodic_dirsync, (void*) prp, (time_t)0 , interval); - slapi_log_error(SLAPI_LOG_REPL, windows_repl_plugin_name, + slapi_log_err(SLAPI_LOG_REPL, windows_repl_plugin_name, "windows_inc_run - New dirsync: %p\n", dirsync); } @@ -387,7 +387,7 @@ windows_inc_run(Private_Repl_Protocol *prp) event_occurred(prp, EVENT_BACKOFF_EXPIRED)) { /* this events - should not occur - log a warning and go to sleep */ - slapi_log_error(SLAPI_LOG_ERR, windows_repl_plugin_name, + slapi_log_err(SLAPI_LOG_ERR, windows_repl_plugin_name, "windows_inc_run - %s: " "Event %s should not occur in state %s; going to sleep\n", agmt_get_long_name(prp->agmt), @@ -403,7 +403,7 @@ windows_inc_run(Private_Repl_Protocol *prp) else { /* wait until window opens or an event occurs */ - slapi_log_error(SLAPI_LOG_REPL, windows_repl_plugin_name, + slapi_log_err(SLAPI_LOG_REPL, windows_repl_plugin_name, "windows_inc_run - %s: " "Waiting for update window to open\n", agmt_get_long_name(prp->agmt)); protocol_sleep(prp, PR_INTERVAL_NO_TIMEOUT); @@ -467,7 +467,7 @@ windows_inc_run(Private_Repl_Protocol *prp) event_occurred(prp, EVENT_BACKOFF_EXPIRED)) { /* this events - should not occur - log a warning and clear the event */ - slapi_log_error(SLAPI_LOG_ERR, windows_repl_plugin_name, "windows_inc_run - %s: " + slapi_log_err(SLAPI_LOG_ERR, windows_repl_plugin_name, "windows_inc_run - %s: " "Event %s should not occur in state %s\n", agmt_get_long_name(prp->agmt), e1 ? event2name(EVENT_WINDOW_OPENED) : event2name(EVENT_BACKOFF_EXPIRED), @@ -510,7 +510,7 @@ windows_inc_run(Private_Repl_Protocol *prp) rc = windows_acquire_replica(prp, &ruv , (run_dirsync == 0) /* yes, check the consumer RUV for incremental, but not if we're going to dirsync afterwards */); - slapi_log_error(SLAPI_LOG_REPL, windows_repl_plugin_name, + slapi_log_err(SLAPI_LOG_REPL, windows_repl_plugin_name, "windows_inc_run - windows_acquire_replica returned %s (%d)\n", acquire2name(rc), rc); @@ -579,7 +579,7 @@ windows_inc_run(Private_Repl_Protocol *prp) { /* This should never happen */ /* this events - should not occur - log a warning and go to sleep */ - slapi_log_error(SLAPI_LOG_ERR, windows_repl_plugin_name, + slapi_log_err(SLAPI_LOG_ERR, windows_repl_plugin_name, "windows_inc_run - %s: Event %s should not occur in state %s\n", agmt_get_long_name(prp->agmt), e1 ? event2name(EVENT_WINDOW_OPENED) : event2name(EVENT_BACKOFF_EXPIRED), @@ -691,7 +691,7 @@ windows_inc_run(Private_Repl_Protocol *prp) time(&now); next_fire_time = backoff_step(prp_priv->backoff); /* And go back to sleep */ - slapi_log_error(SLAPI_LOG_REPL, windows_repl_plugin_name, + slapi_log_err(SLAPI_LOG_REPL, windows_repl_plugin_name, "windows_inc_run - %s: Replication session backing off for %ld seconds\n", agmt_get_long_name(prp->agmt), next_fire_time - now); @@ -728,7 +728,7 @@ windows_inc_run(Private_Repl_Protocol *prp) else if (event_occurred(prp, EVENT_WINDOW_OPENED)) { /* this should never happen - log an error and go to sleep */ - slapi_log_error(SLAPI_LOG_ERR, windows_repl_plugin_name, "windows_inc_run - %s: " + slapi_log_err(SLAPI_LOG_ERR, windows_repl_plugin_name, "windows_inc_run - %s: " "event %s should not occur in state %s; going to sleep\n", agmt_get_long_name(prp->agmt), event2name(EVENT_WINDOW_OPENED), state2name(current_state)); @@ -777,20 +777,20 @@ windows_inc_run(Private_Repl_Protocol *prp) next_state = STATE_STOP_FATAL_ERROR; break; case EXAMINE_RUV_PRISTINE_REPLICA: - slapi_log_error(SLAPI_LOG_WARNING, windows_repl_plugin_name, + slapi_log_err(SLAPI_LOG_WARNING, windows_repl_plugin_name, "windows_inc_run - %s: Replica has no update vector. It has never been initialized.\n", agmt_get_long_name(prp->agmt)); next_state = STATE_BACKOFF_START; break; case EXAMINE_RUV_GENERATION_MISMATCH: - slapi_log_error(SLAPI_LOG_WARNING, windows_repl_plugin_name, + slapi_log_err(SLAPI_LOG_WARNING, windows_repl_plugin_name, "windows_inc_run - %s: The remote replica has a different database generation ID than " "the local database. You may have to reinitialize the remote replica, " "or the local replica.\n", agmt_get_long_name(prp->agmt)); next_state = STATE_BACKOFF_START; break; case EXAMINE_RUV_REPLICA_TOO_OLD: - slapi_log_error(SLAPI_LOG_WARNING, windows_repl_plugin_name, + slapi_log_err(SLAPI_LOG_WARNING, windows_repl_plugin_name, "windows_inc_run - %s: Replica update vector is too out of date to bring " "into sync using the incremental protocol. The replica " "must be reinitialized.\n", agmt_get_long_name(prp->agmt)); @@ -806,14 +806,14 @@ windows_inc_run(Private_Repl_Protocol *prp) replica = NULL; if (rc == CSN_LIMIT_EXCEEDED) /* too much skew */ { - slapi_log_error(SLAPI_LOG_ERR, windows_repl_plugin_name, + slapi_log_err(SLAPI_LOG_ERR, windows_repl_plugin_name, "windows_inc_run - %s: Incremental protocol: fatal error - too much time skew between replicas!\n", agmt_get_long_name(prp->agmt)); next_state = STATE_STOP_FATAL_ERROR; } else if (rc != 0) /* internal error */ { - slapi_log_error(SLAPI_LOG_ERR, windows_repl_plugin_name, + slapi_log_err(SLAPI_LOG_ERR, windows_repl_plugin_name, "windows_inc_run - %s: Incremental protocol: fatal internal error updating the CSN generator!\n", agmt_get_long_name(prp->agmt)); next_state = STATE_STOP_FATAL_ERROR; @@ -920,7 +920,7 @@ windows_inc_run(Private_Repl_Protocol *prp) long loops = pausetime; /* the while loop is so that we don't just sleep and sleep if an event comes in that we should handle immediately (like shutdown) */ - slapi_log_error(SLAPI_LOG_REPL, windows_repl_plugin_name, + slapi_log_err(SLAPI_LOG_REPL, windows_repl_plugin_name, "windows_inc_run - %s: Pausing updates for %ld seconds to allow other suppliers to update consumer\n", agmt_get_long_name(prp->agmt), pausetime); while (loops-- && !(PROTOCOL_IS_SHUTDOWN(prp))) @@ -944,7 +944,7 @@ windows_inc_run(Private_Repl_Protocol *prp) /* XXXggood update state in replica */ agmt_set_last_update_status(prp->agmt, -1, 0, "Incremental update has failed and requires administrator action"); dev_debug("windows_inc_run(STATE_STOP_FATAL_ERROR)"); - slapi_log_error(SLAPI_LOG_ERR, windows_repl_plugin_name, + slapi_log_err(SLAPI_LOG_ERR, windows_repl_plugin_name, "windows_inc_run - %s: Incremental update failed and requires administrator action\n", agmt_get_long_name(prp->agmt)); next_state = STATE_STOP_FATAL_ERROR_PART2; @@ -997,7 +997,7 @@ windows_inc_run(Private_Repl_Protocol *prp) break; } - slapi_log_error(SLAPI_LOG_REPL, windows_repl_plugin_name, + slapi_log_err(SLAPI_LOG_REPL, windows_repl_plugin_name, "windows_inc_run - %s: State: %s -> %s\n", agmt_get_long_name(prp->agmt), state2name(current_state), state2name(next_state)); @@ -1012,7 +1012,7 @@ windows_inc_run(Private_Repl_Protocol *prp) /* ... and disconnect, if currently connected */ windows_conn_disconnect(prp->conn); ruv_destroy ( &ruv ); - slapi_log_error(SLAPI_LOG_TRACE, windows_repl_plugin_name, "<= windows_inc_run\n" ); + slapi_log_err(SLAPI_LOG_TRACE, windows_repl_plugin_name, "<= windows_inc_run\n" ); } /* @@ -1021,7 +1021,7 @@ windows_inc_run(Private_Repl_Protocol *prp) static void protocol_sleep(Private_Repl_Protocol *prp, PRIntervalTime duration) { - slapi_log_error(SLAPI_LOG_TRACE, windows_repl_plugin_name, "=> protocol_sleep\n" ); + slapi_log_err(SLAPI_LOG_TRACE, windows_repl_plugin_name, "=> protocol_sleep\n" ); PR_ASSERT(NULL != prp); PR_Lock(prp->lock); /* we should not go to sleep if there are events available to be processed. @@ -1030,12 +1030,12 @@ protocol_sleep(Private_Repl_Protocol *prp, PRIntervalTime duration) PR_WaitCondVar(prp->cvar, duration); else { - slapi_log_error(SLAPI_LOG_REPL, windows_repl_plugin_name, + slapi_log_err(SLAPI_LOG_REPL, windows_repl_plugin_name, "protocol_sleep - %s: Can't go to sleep: event bits - %x\n", agmt_get_long_name(prp->agmt), prp->eventbits); } PR_Unlock(prp->lock); - slapi_log_error(SLAPI_LOG_TRACE, windows_repl_plugin_name, "<= protocol_sleep\n" ); + slapi_log_err(SLAPI_LOG_TRACE, windows_repl_plugin_name, "<= protocol_sleep\n" ); } @@ -1048,13 +1048,13 @@ protocol_sleep(Private_Repl_Protocol *prp, PRIntervalTime duration) static void event_notify(Private_Repl_Protocol *prp, PRUint32 event) { - slapi_log_error(SLAPI_LOG_TRACE, windows_repl_plugin_name, "=> event_notify\n" ); + slapi_log_err(SLAPI_LOG_TRACE, windows_repl_plugin_name, "=> event_notify\n" ); PR_ASSERT(NULL != prp); PR_Lock(prp->lock); prp->eventbits |= event; PR_NotifyCondVar(prp->cvar); PR_Unlock(prp->lock); - slapi_log_error(SLAPI_LOG_TRACE, windows_repl_plugin_name, "<= event_notify\n" ); + slapi_log_err(SLAPI_LOG_TRACE, windows_repl_plugin_name, "<= event_notify\n" ); } @@ -1067,26 +1067,26 @@ event_occurred(Private_Repl_Protocol *prp, PRUint32 event) { PRUint32 return_value; - slapi_log_error(SLAPI_LOG_TRACE, windows_repl_plugin_name, "=> event_occurred\n" ); + slapi_log_err(SLAPI_LOG_TRACE, windows_repl_plugin_name, "=> event_occurred\n" ); PR_ASSERT(NULL != prp); PR_Lock(prp->lock); return_value = (prp->eventbits & event); prp->eventbits &= ~event; /* Clear event */ PR_Unlock(prp->lock); - slapi_log_error(SLAPI_LOG_TRACE, windows_repl_plugin_name, "<= event_occurred\n" ); + slapi_log_err(SLAPI_LOG_TRACE, windows_repl_plugin_name, "<= event_occurred\n" ); return return_value; } static void reset_events (Private_Repl_Protocol *prp) { - slapi_log_error(SLAPI_LOG_TRACE, windows_repl_plugin_name, "=> reset_events\n" ); + slapi_log_err(SLAPI_LOG_TRACE, windows_repl_plugin_name, "=> reset_events\n" ); PR_ASSERT(NULL != prp); PR_Lock(prp->lock); prp->eventbits = 0; PR_Unlock(prp->lock); - slapi_log_error(SLAPI_LOG_TRACE, windows_repl_plugin_name, "<= reset_events\n" ); + slapi_log_err(SLAPI_LOG_TRACE, windows_repl_plugin_name, "<= reset_events\n" ); } @@ -1094,8 +1094,8 @@ reset_events (Private_Repl_Protocol *prp) static PRBool is_dummy_operation (const slapi_operation_parameters *op) { - slapi_log_error(SLAPI_LOG_TRACE, windows_repl_plugin_name, "=> is_dummy_operation\n" ); - slapi_log_error(SLAPI_LOG_TRACE, windows_repl_plugin_name, "<= is_dummy_operation\n" ); + slapi_log_err(SLAPI_LOG_TRACE, windows_repl_plugin_name, "=> is_dummy_operation\n" ); + slapi_log_err(SLAPI_LOG_TRACE, windows_repl_plugin_name, "<= is_dummy_operation\n" ); return (strcmp (op->target_address.uniqueid, START_ITERATION_ENTRY_UNIQUEID) == 0); } @@ -1104,7 +1104,7 @@ is_dummy_operation (const slapi_operation_parameters *op) void w_cl5_operation_parameters_done (struct slapi_operation_parameters *sop) { - slapi_log_error(SLAPI_LOG_TRACE, windows_repl_plugin_name, "=> w_cl5_operation_parameters_done\n" ); + slapi_log_err(SLAPI_LOG_TRACE, windows_repl_plugin_name, "=> w_cl5_operation_parameters_done\n" ); if(sop!=NULL) { switch(sop->operation_type) { @@ -1139,7 +1139,7 @@ w_cl5_operation_parameters_done (struct slapi_operation_parameters *sop) } } operation_parameters_done(sop); - slapi_log_error(SLAPI_LOG_TRACE, windows_repl_plugin_name, "<= w_cl5_operation_parameters_done\n" ); + slapi_log_err(SLAPI_LOG_TRACE, windows_repl_plugin_name, "<= w_cl5_operation_parameters_done\n" ); } @@ -1166,7 +1166,7 @@ send_updates(Private_Repl_Protocol *prp, RUV *remote_update_vector, PRUint32 *nu RUV *current_ruv = ruv_dup(remote_update_vector); CSN *mincsn = NULL; - slapi_log_error(SLAPI_LOG_TRACE, windows_repl_plugin_name, "=> send_updates\n" ); + slapi_log_err(SLAPI_LOG_TRACE, windows_repl_plugin_name, "=> send_updates\n" ); *num_changes_sent = 0; @@ -1191,92 +1191,92 @@ send_updates(Private_Repl_Protocol *prp, RUV *remote_update_vector, PRUint32 *nu switch (rc) { case CL5_BAD_DATA: /* invalid parameter passed to the function */ - slapi_log_error(SLAPI_LOG_ERR, windows_repl_plugin_name, + slapi_log_err(SLAPI_LOG_ERR, windows_repl_plugin_name, "send_updates - %s: Invalid parameter passed to cl5CreateReplayIterator\n", agmt_get_long_name(prp->agmt)); return_value = UPDATE_FATAL_ERROR; break; case CL5_BAD_FORMAT: /* db data has unexpected format */ - slapi_log_error(SLAPI_LOG_ERR, windows_repl_plugin_name, + slapi_log_err(SLAPI_LOG_ERR, windows_repl_plugin_name, "send_updates - %s: Unexpected format encountered in changelog database\n", agmt_get_long_name(prp->agmt)); return_value = UPDATE_FATAL_ERROR; break; case CL5_BAD_STATE: /* changelog is in an incorrect state for attempted operation */ - slapi_log_error(SLAPI_LOG_ERR, windows_repl_plugin_name, + slapi_log_err(SLAPI_LOG_ERR, windows_repl_plugin_name, "send_updates - %s: Changelog database was in an incorrect state\n", agmt_get_long_name(prp->agmt)); return_value = UPDATE_FATAL_ERROR; break; case CL5_BAD_DBVERSION: /* changelog has invalid dbversion */ - slapi_log_error(SLAPI_LOG_ERR, windows_repl_plugin_name, + slapi_log_err(SLAPI_LOG_ERR, windows_repl_plugin_name, "send_updates - %s: Incorrect dbversion found in changelog database\n", agmt_get_long_name(prp->agmt)); return_value = UPDATE_FATAL_ERROR; break; case CL5_DB_ERROR: /* database error */ - slapi_log_error(SLAPI_LOG_ERR, windows_repl_plugin_name, + slapi_log_err(SLAPI_LOG_ERR, windows_repl_plugin_name, "send_updates - %s: A changelog database error was encountered\n", agmt_get_long_name(prp->agmt)); return_value = UPDATE_FATAL_ERROR; break; case CL5_NOTFOUND: /* we have no changes to send */ - slapi_log_error(SLAPI_LOG_REPL, windows_repl_plugin_name, + slapi_log_err(SLAPI_LOG_REPL, windows_repl_plugin_name, "%s: No changes to send\n", agmt_get_long_name(prp->agmt)); return_value = UPDATE_NO_MORE_UPDATES; break; case CL5_MEMORY_ERROR: /* memory allocation failed */ - slapi_log_error(SLAPI_LOG_ERR, windows_repl_plugin_name, + slapi_log_err(SLAPI_LOG_ERR, windows_repl_plugin_name, "send_updates - %s: Memory allocation error occurred\n", agmt_get_long_name(prp->agmt)); return_value = UPDATE_FATAL_ERROR; break; case CL5_SYSTEM_ERROR: /* NSPR error occurred: use PR_GetError for furhter info */ - slapi_log_error(SLAPI_LOG_ERR, windows_repl_plugin_name, + slapi_log_err(SLAPI_LOG_ERR, windows_repl_plugin_name, "send_updates - %s: An NSPR error (%d) occurred\n", agmt_get_long_name(prp->agmt), PR_GetError()); return_value = UPDATE_TRANSIENT_ERROR; break; case CL5_CSN_ERROR: /* CSN API failed */ - slapi_log_error(SLAPI_LOG_ERR, windows_repl_plugin_name, + slapi_log_err(SLAPI_LOG_ERR, windows_repl_plugin_name, "send_updates - %s: A CSN API failure was encountered\n", agmt_get_long_name(prp->agmt)); return_value = UPDATE_TRANSIENT_ERROR; break; case CL5_RUV_ERROR: /* RUV API failed */ - slapi_log_error(SLAPI_LOG_ERR, windows_repl_plugin_name, + slapi_log_err(SLAPI_LOG_ERR, windows_repl_plugin_name, "send_updates - %s: An RUV API failure occurred\n", agmt_get_long_name(prp->agmt)); return_value = UPDATE_TRANSIENT_ERROR; break; case CL5_OBJSET_ERROR: /* namedobjset api failed */ - slapi_log_error(SLAPI_LOG_ERR, windows_repl_plugin_name, + slapi_log_err(SLAPI_LOG_ERR, windows_repl_plugin_name, "send_updates - %s: A namedobject API failure occurred\n", agmt_get_long_name(prp->agmt)); return_value = UPDATE_TRANSIENT_ERROR; break; case CL5_PURGED_DATA: /* requested data has been purged */ - slapi_log_error(SLAPI_LOG_ERR, windows_repl_plugin_name, + slapi_log_err(SLAPI_LOG_ERR, windows_repl_plugin_name, "send_updates - %s: Data required to update replica has been purged. " "The replica must be reinitialized.\n", agmt_get_long_name(prp->agmt)); return_value = UPDATE_FATAL_ERROR; break; case CL5_MISSING_DATA: /* data should be in the changelog, but is missing */ - slapi_log_error(SLAPI_LOG_ERR, windows_repl_plugin_name, + slapi_log_err(SLAPI_LOG_ERR, windows_repl_plugin_name, "send_updates - %s: Missing data encountered\n", agmt_get_long_name(prp->agmt)); return_value = UPDATE_FATAL_ERROR; break; case CL5_UNKNOWN_ERROR: /* unclassified error */ - slapi_log_error(SLAPI_LOG_ERR, windows_repl_plugin_name, + slapi_log_err(SLAPI_LOG_ERR, windows_repl_plugin_name, "send_updates - %s: An unknown error was ecountered\n", agmt_get_long_name(prp->agmt)); return_value = UPDATE_TRANSIENT_ERROR; break; default: - slapi_log_error(SLAPI_LOG_ERR, windows_repl_plugin_name, + slapi_log_err(SLAPI_LOG_ERR, windows_repl_plugin_name, "send_updates - %s: An unknown error (%d) occurred " "(cl5CreateReplayIterator)\n", agmt_get_long_name(prp->agmt), rc); @@ -1302,7 +1302,7 @@ send_updates(Private_Repl_Protocol *prp, RUV *remote_update_vector, PRUint32 *nu /* check that we don't return dummy entries */ if (is_dummy_operation (entry.op)) { - slapi_log_error(SLAPI_LOG_WARNING, windows_repl_plugin_name, + slapi_log_err(SLAPI_LOG_WARNING, windows_repl_plugin_name, "send_updates - %s: changelog iteration code returned a dummy entry with csn %s, " "skipping ...\n", agmt_get_long_name(prp->agmt), csn_as_string(entry.op->csn, PR_FALSE, csn_str)); @@ -1334,7 +1334,7 @@ send_updates(Private_Repl_Protocol *prp, RUV *remote_update_vector, PRUint32 *nu agmt_inc_last_update_changecount (prp->agmt, csn_get_replicaid(entry.op->csn), 1 /*skipped*/); mark_record_done = 1; } - slapi_log_error(finished ? SLAPI_LOG_WARNING : slapi_log_urp, + slapi_log_err(finished ? SLAPI_LOG_WARNING : slapi_log_urp, windows_repl_plugin_name, "send_updates - %s: Consumer failed to replay change (uniqueid %s, CSN %s): %s. %s.\n", agmt_get_long_name(prp->agmt), @@ -1348,7 +1348,7 @@ send_updates(Private_Repl_Protocol *prp, RUV *remote_update_vector, PRUint32 *nu return_value = UPDATE_TRANSIENT_ERROR; finished = 1; - slapi_log_error(SLAPI_LOG_WARNING, windows_repl_plugin_name, + slapi_log_err(SLAPI_LOG_WARNING, windows_repl_plugin_name, "send_updates - %s: Consumer failed to replay change (uniqueid %s, CSN %s): " "%s. Will retry later.\n", agmt_get_long_name(prp->agmt), @@ -1359,7 +1359,7 @@ send_updates(Private_Repl_Protocol *prp, RUV *remote_update_vector, PRUint32 *nu { return_value = UPDATE_TIMEOUT; finished = 1; - slapi_log_error(SLAPI_LOG_WARNING, windows_repl_plugin_name, + slapi_log_err(SLAPI_LOG_WARNING, windows_repl_plugin_name, "send_updates - %s: Consumer timed out to replay change (uniqueid %s, CSN %s): " "%s.\n", agmt_get_long_name(prp->agmt), @@ -1374,7 +1374,7 @@ send_updates(Private_Repl_Protocol *prp, RUV *remote_update_vector, PRUint32 *nu */ return_value = UPDATE_TRANSIENT_ERROR; finished = 1; - slapi_log_error(SLAPI_LOG_WARNING, windows_repl_plugin_name, + slapi_log_err(SLAPI_LOG_WARNING, windows_repl_plugin_name, "send_updates - %s: Failed to replay change (uniqueid %s, CSN %s): " "Local error. Will retry later.\n", agmt_get_long_name(prp->agmt), @@ -1411,39 +1411,39 @@ send_updates(Private_Repl_Protocol *prp, RUV *remote_update_vector, PRUint32 *nu } break; case CL5_BAD_DATA: - slapi_log_error(SLAPI_LOG_ERR, windows_repl_plugin_name, + slapi_log_err(SLAPI_LOG_ERR, windows_repl_plugin_name, "send_updates - %s: Invalid parameter passed to cl5GetNextOperationToReplay\n", agmt_get_long_name(prp->agmt)); return_value = UPDATE_FATAL_ERROR; finished = 1; break; case CL5_NOTFOUND: - slapi_log_error(SLAPI_LOG_REPL, windows_repl_plugin_name, + slapi_log_err(SLAPI_LOG_REPL, windows_repl_plugin_name, "send_updates - %s: No more updates to send (cl5GetNextOperationToReplay)\n", agmt_get_long_name(prp->agmt)); return_value = UPDATE_NO_MORE_UPDATES; finished = 1; break; case CL5_DB_ERROR: - slapi_log_error(SLAPI_LOG_ERR, windows_repl_plugin_name, + slapi_log_err(SLAPI_LOG_ERR, windows_repl_plugin_name, "send_updates - %s: A database error occurred (cl5GetNextOperationToReplay)\n", agmt_get_long_name(prp->agmt)); return_value = UPDATE_FATAL_ERROR; finished = 1; break; case CL5_BAD_FORMAT: - slapi_log_error(SLAPI_LOG_WARNING, windows_repl_plugin_name, + slapi_log_err(SLAPI_LOG_WARNING, windows_repl_plugin_name, "send_updates - %s: A malformed changelog entry was encountered (cl5GetNextOperationToReplay)\n", agmt_get_long_name(prp->agmt)); break; case CL5_MEMORY_ERROR: - slapi_log_error(SLAPI_LOG_ERR, windows_repl_plugin_name, + slapi_log_err(SLAPI_LOG_ERR, windows_repl_plugin_name, "send_updates - %s: A memory allocation error occurred (cl5GetNextOperationToRepla)\n", agmt_get_long_name(prp->agmt)); return_value = UPDATE_FATAL_ERROR; break; default: - slapi_log_error(SLAPI_LOG_ERR, windows_repl_plugin_name, + slapi_log_err(SLAPI_LOG_ERR, windows_repl_plugin_name, "send_updates - %s: Unknown error code (%d) returned from cl5GetNextOperationToReplay\n", agmt_get_long_name(prp->agmt), rc); return_value = UPDATE_TRANSIENT_ERROR; @@ -1470,7 +1470,7 @@ send_updates(Private_Repl_Protocol *prp, RUV *remote_update_vector, PRUint32 *nu agmt_set_consumer_ruv(prp->agmt,current_ruv); ruv_destroy(¤t_ruv); } - slapi_log_error(SLAPI_LOG_TRACE, windows_repl_plugin_name, "<= send_updates\n" ); + slapi_log_err(SLAPI_LOG_TRACE, windows_repl_plugin_name, "<= send_updates\n" ); return return_value; } @@ -1485,7 +1485,7 @@ windows_inc_stop(Private_Repl_Protocol *prp) PRIntervalTime start, maxwait, now; int seconds = 1200; - slapi_log_error(SLAPI_LOG_TRACE, windows_repl_plugin_name, "=> windows_inc_stop\n" ); + slapi_log_err(SLAPI_LOG_TRACE, windows_repl_plugin_name, "=> windows_inc_stop\n" ); maxwait = PR_SecondsToInterval(seconds); prp->terminate = 1; @@ -1501,19 +1501,19 @@ windows_inc_stop(Private_Repl_Protocol *prp) { /* Isn't listening. Do something drastic. */ return_value = -1; - slapi_log_error(SLAPI_LOG_REPL, windows_repl_plugin_name, + slapi_log_err(SLAPI_LOG_REPL, windows_repl_plugin_name, "windows_inc_stop - %s: Protocol does not stop after %d seconds\n", agmt_get_long_name(prp->agmt), seconds); } else { return_value = 0; - slapi_log_error(SLAPI_LOG_REPL, windows_repl_plugin_name, + slapi_log_err(SLAPI_LOG_REPL, windows_repl_plugin_name, "windows_inc_stop - %s: Protocol stopped after %d seconds\n", agmt_get_long_name(prp->agmt), PR_IntervalToSeconds(now-start)); } - slapi_log_error(SLAPI_LOG_TRACE, windows_repl_plugin_name, "<= windows_inc_stop\n" ); + slapi_log_err(SLAPI_LOG_TRACE, windows_repl_plugin_name, "<= windows_inc_stop\n" ); return return_value; } @@ -1522,8 +1522,8 @@ windows_inc_status(Private_Repl_Protocol *prp) { int return_value = 0; - slapi_log_error(SLAPI_LOG_TRACE, windows_repl_plugin_name, "=> windows_inc_status\n" ); - slapi_log_error(SLAPI_LOG_TRACE, windows_repl_plugin_name, "<= windows_inc_status\n" ); + slapi_log_err(SLAPI_LOG_TRACE, windows_repl_plugin_name, "=> windows_inc_status\n" ); + slapi_log_err(SLAPI_LOG_TRACE, windows_repl_plugin_name, "<= windows_inc_status\n" ); return return_value; } @@ -1531,43 +1531,43 @@ windows_inc_status(Private_Repl_Protocol *prp) static void windows_inc_notify_update(Private_Repl_Protocol *prp) { - slapi_log_error(SLAPI_LOG_TRACE, windows_repl_plugin_name, "=> windows_inc_notify_update\n" ); + slapi_log_err(SLAPI_LOG_TRACE, windows_repl_plugin_name, "=> windows_inc_notify_update\n" ); event_notify(prp, EVENT_TRIGGERING_CRITERIA_MET); - slapi_log_error(SLAPI_LOG_TRACE, windows_repl_plugin_name, "<= windows_inc_notify_update\n" ); + slapi_log_err(SLAPI_LOG_TRACE, windows_repl_plugin_name, "<= windows_inc_notify_update\n" ); } static void windows_inc_update_now(Private_Repl_Protocol *prp) { - slapi_log_error(SLAPI_LOG_TRACE, windows_repl_plugin_name, "=> windows_inc_update_now\n" ); + slapi_log_err(SLAPI_LOG_TRACE, windows_repl_plugin_name, "=> windows_inc_update_now\n" ); event_notify(prp, EVENT_REPLICATE_NOW); - slapi_log_error(SLAPI_LOG_TRACE, windows_repl_plugin_name, "<= windows_inc_update_now\n" ); + slapi_log_err(SLAPI_LOG_TRACE, windows_repl_plugin_name, "<= windows_inc_update_now\n" ); } static void windows_inc_notify_agmt_changed(Private_Repl_Protocol *prp) { - slapi_log_error(SLAPI_LOG_TRACE, windows_repl_plugin_name, "=> windows_inc_notify_agmt_changed\n" ); + slapi_log_err(SLAPI_LOG_TRACE, windows_repl_plugin_name, "=> windows_inc_notify_agmt_changed\n" ); event_notify(prp, EVENT_AGMT_CHANGED); - slapi_log_error(SLAPI_LOG_TRACE, windows_repl_plugin_name, "<= windows_inc_notify_agmt_changed\n" ); + slapi_log_err(SLAPI_LOG_TRACE, windows_repl_plugin_name, "<= windows_inc_notify_agmt_changed\n" ); } static void windows_inc_notify_window_opened (Private_Repl_Protocol *prp) { - slapi_log_error(SLAPI_LOG_TRACE, windows_repl_plugin_name, "=> windows_inc_notify_window_opened\n" ); + slapi_log_err(SLAPI_LOG_TRACE, windows_repl_plugin_name, "=> windows_inc_notify_window_opened\n" ); event_notify(prp, EVENT_WINDOW_OPENED); - slapi_log_error(SLAPI_LOG_TRACE, windows_repl_plugin_name, "<= windows_inc_notify_window_opened\n" ); + slapi_log_err(SLAPI_LOG_TRACE, windows_repl_plugin_name, "<= windows_inc_notify_window_opened\n" ); } static void windows_inc_notify_window_closed (Private_Repl_Protocol *prp) { - slapi_log_error(SLAPI_LOG_TRACE, windows_repl_plugin_name, "=> windows_inc_notify_window_closed\n" ); + slapi_log_err(SLAPI_LOG_TRACE, windows_repl_plugin_name, "=> windows_inc_notify_window_closed\n" ); event_notify(prp, EVENT_WINDOW_CLOSED); - slapi_log_error(SLAPI_LOG_TRACE, windows_repl_plugin_name, "<= windows_inc_notify_window_closed\n" ); + slapi_log_err(SLAPI_LOG_TRACE, windows_repl_plugin_name, "<= windows_inc_notify_window_closed\n" ); } @@ -1577,7 +1577,7 @@ Windows_Inc_Protocol_new(Repl_Protocol *rp) windows_inc_private *rip = NULL; Private_Repl_Protocol *prp = (Private_Repl_Protocol *)slapi_ch_calloc(1, sizeof(Private_Repl_Protocol)); - LDAPDebug0Args(LDAP_DEBUG_TRACE, "=> Windows_Inc_Protocol_new\n" ); + slapi_log_err(SLAPI_LOG_TRACE, windows_repl_plugin_name, "=> Windows_Inc_Protocol_new\n" ); prp->delete = windows_inc_delete; prp->run = windows_inc_run; @@ -1610,13 +1610,13 @@ Windows_Inc_Protocol_new(Repl_Protocol *rp) prp->private = (void *)rip; prp->replica_acquired = PR_FALSE; - slapi_log_error(SLAPI_LOG_TRACE, windows_repl_plugin_name, "<= Windows_Inc_Protocol_new\n" ); + slapi_log_err(SLAPI_LOG_TRACE, windows_repl_plugin_name, "<= Windows_Inc_Protocol_new\n" ); return prp; loser: windows_inc_delete(&prp); - slapi_log_error(SLAPI_LOG_TRACE, windows_repl_plugin_name, "<= Windows_Inc_Protocol_new (loser)\n" ); + slapi_log_err(SLAPI_LOG_TRACE, windows_repl_plugin_name, "<= Windows_Inc_Protocol_new (loser)\n" ); return NULL; } @@ -1628,12 +1628,12 @@ windows_inc_backoff_expired(time_t timer_fire_time, void *arg) { Private_Repl_Protocol *prp = (Private_Repl_Protocol *)arg; - slapi_log_error(SLAPI_LOG_TRACE, windows_repl_plugin_name, "=> windows_inc_backoff_expired\n" ); + slapi_log_err(SLAPI_LOG_TRACE, windows_repl_plugin_name, "=> windows_inc_backoff_expired\n" ); PR_ASSERT(NULL != prp); event_notify(prp, EVENT_BACKOFF_EXPIRED); - slapi_log_error(SLAPI_LOG_TRACE, windows_repl_plugin_name, "<= windows_inc_backoff_expired\n" ); + slapi_log_err(SLAPI_LOG_TRACE, windows_repl_plugin_name, "<= windows_inc_backoff_expired\n" ); } @@ -1659,7 +1659,7 @@ windows_examine_update_vector(Private_Repl_Protocol *prp, RUV *remote_ruv) { int return_value; - slapi_log_error(SLAPI_LOG_TRACE, windows_repl_plugin_name, "=> windows_examine_update_vector\n" ); + slapi_log_err(SLAPI_LOG_TRACE, windows_repl_plugin_name, "=> windows_examine_update_vector\n" ); PR_ASSERT(NULL != prp); if (NULL == prp) @@ -1700,7 +1700,7 @@ windows_examine_update_vector(Private_Repl_Protocol *prp, RUV *remote_ruv) slapi_ch_free((void**)&remote_gen); slapi_ch_free((void**)&local_gen); } - slapi_log_error(SLAPI_LOG_TRACE, windows_repl_plugin_name, "<= windows_examine_update_vector\n" ); + slapi_log_err(SLAPI_LOG_TRACE, windows_repl_plugin_name, "<= windows_examine_update_vector\n" ); return return_value; } @@ -1725,8 +1725,8 @@ acquire2name (int code) static const char* state2name (int state) { - LDAPDebug0Args(LDAP_DEBUG_TRACE, "=> state2name\n" ); - LDAPDebug0Args(LDAP_DEBUG_TRACE, "<= state2name\n" ); + slapi_log_err(SLAPI_LOG_TRACE, windows_repl_plugin_name, "=> state2name\n" ); + slapi_log_err(SLAPI_LOG_TRACE, windows_repl_plugin_name, "<= state2name\n" ); switch (state) { case STATE_START: return "start"; @@ -1747,8 +1747,8 @@ state2name (int state) static const char* event2name (int event) { - LDAPDebug0Args(LDAP_DEBUG_TRACE, "=> event2name\n" ); - LDAPDebug0Args(LDAP_DEBUG_TRACE, "<= event2name\n" ); + slapi_log_err(SLAPI_LOG_TRACE, windows_repl_plugin_name, "=> event2name\n" ); + slapi_log_err(SLAPI_LOG_TRACE, windows_repl_plugin_name, "<= event2name\n" ); switch (event) { case EVENT_WINDOW_OPENED: return "update_window_opened"; @@ -1767,11 +1767,11 @@ event2name (int event) static void periodic_dirsync(time_t when, void *arg) { - slapi_log_error(SLAPI_LOG_TRACE, windows_repl_plugin_name, "=> periodic_dirsync\n" ); + slapi_log_err(SLAPI_LOG_TRACE, windows_repl_plugin_name, "=> periodic_dirsync\n" ); - slapi_log_error(SLAPI_LOG_REPL, windows_repl_plugin_name, - "Running Dirsync \n"); + slapi_log_err(SLAPI_LOG_REPL, windows_repl_plugin_name, + "periodic_dirsync - Running Dirsync \n"); event_notify( (Private_Repl_Protocol*) arg, EVENT_RUN_DIRSYNC); - slapi_log_error(SLAPI_LOG_TRACE, windows_repl_plugin_name, "<= periodic_dirsync\n" ); + slapi_log_err(SLAPI_LOG_TRACE, windows_repl_plugin_name, "<= periodic_dirsync\n" ); } diff --git a/ldap/servers/plugins/replication/windows_private.c b/ldap/servers/plugins/replication/windows_private.c index dd6b5d0..e0ed754 100644 --- a/ldap/servers/plugins/replication/windows_private.c +++ b/ldap/servers/plugins/replication/windows_private.c @@ -111,7 +111,7 @@ check_update_allowed(Repl_Agmt *ra, const char *type, Slapi_Entry *e, int *retva while (get_next_disallow_attr_type(&ii, &distype)) { if (slapi_attr_types_equivalent(type, distype)) { char *tmpstr = slapi_entry_attr_get_charptr(e, type); - slapi_log_error(SLAPI_LOG_REPL, windows_repl_plugin_name, + slapi_log_err(SLAPI_LOG_REPL, windows_repl_plugin_name, "windows_parse_config_entry: setting %s to %s will be " "deferred until current update is completed\n", type, tmpstr); @@ -232,7 +232,7 @@ windows_parse_config_entry(Repl_Agmt *ra, const char *type, Slapi_Entry *e) } else if (strcasecmp(tmpstr, "toWindows") == 0) { windows_private_set_one_way(ra, ONE_WAY_SYNC_TO_AD); } else { - slapi_log_error(SLAPI_LOG_WARNING, windows_repl_plugin_name, + slapi_log_err(SLAPI_LOG_WARNING, windows_repl_plugin_name, "windows_parse_config_entry - Ignoring illegal setting for %s attribute in replication " "agreement \"%s\". Valid values are \"toWindows\" or " "\"fromWindows\".\n", type_oneWaySync, slapi_entry_get_dn(e)); @@ -263,7 +263,7 @@ windows_parse_config_entry(Repl_Agmt *ra, const char *type, Slapi_Entry *e) } else if (strcasecmp(tmpstr, "none") == 0) { windows_private_set_move_action(ra, MOVE_DOES_NOTHING); } else { - slapi_log_error(SLAPI_LOG_WARNING, windows_repl_plugin_name, + slapi_log_err(SLAPI_LOG_WARNING, windows_repl_plugin_name, "windows_parse_config_entry - Ignoring illegal setting for %s attribute in replication " "agreement \"%s\". Valid values are \"delete\" or " "\"unsync\".\n", type_winsyncMoveAction, slapi_entry_get_dn(e)); @@ -374,7 +374,7 @@ Dirsync_Private* windows_private_new() { Dirsync_Private *dp; - slapi_log_error(SLAPI_LOG_TRACE, windows_repl_plugin_name, "=> windows_private_new\n" ); + slapi_log_err(SLAPI_LOG_TRACE, windows_repl_plugin_name, "=> windows_private_new\n" ); dp = (Dirsync_Private *)slapi_ch_calloc(sizeof(Dirsync_Private),1); @@ -389,7 +389,7 @@ Dirsync_Private* windows_private_new() dp->windows_treetop = NULL; dp->directory_treetop = NULL; - slapi_log_error(SLAPI_LOG_TRACE, windows_repl_plugin_name, "<= windows_private_new\n" ); + slapi_log_err(SLAPI_LOG_TRACE, windows_repl_plugin_name, "<= windows_private_new\n" ); return dp; } @@ -399,7 +399,7 @@ void windows_agreement_delete(Repl_Agmt *ra) const subtreePair *sp; Dirsync_Private *dp = (Dirsync_Private *) agmt_get_priv(ra); - slapi_log_error(SLAPI_LOG_TRACE, windows_repl_plugin_name, "=> windows_private_delete\n" ); + slapi_log_err(SLAPI_LOG_TRACE, windows_repl_plugin_name, "=> windows_private_delete\n" ); PR_ASSERT(dp != NULL); @@ -431,7 +431,7 @@ void windows_agreement_delete(Repl_Agmt *ra) slapi_ch_free((void **)&dp->subtree_pairs); slapi_ch_free((void **)&dp); - slapi_log_error(SLAPI_LOG_TRACE, windows_repl_plugin_name, "<= windows_private_delete\n" ); + slapi_log_err(SLAPI_LOG_TRACE, windows_repl_plugin_name, "<= windows_private_delete\n" ); } @@ -439,14 +439,14 @@ int windows_private_get_isnt4(const Repl_Agmt *ra) { Dirsync_Private *dp; - slapi_log_error(SLAPI_LOG_TRACE, windows_repl_plugin_name, "=> windows_private_get_isnt4\n" ); + slapi_log_err(SLAPI_LOG_TRACE, windows_repl_plugin_name, "=> windows_private_get_isnt4\n" ); PR_ASSERT(ra); dp = (Dirsync_Private *) agmt_get_priv(ra); PR_ASSERT (dp); - slapi_log_error(SLAPI_LOG_TRACE, windows_repl_plugin_name, "<= windows_private_get_isnt4\n" ); + slapi_log_err(SLAPI_LOG_TRACE, windows_repl_plugin_name, "<= windows_private_get_isnt4\n" ); return dp->isnt4; } @@ -455,7 +455,7 @@ void windows_private_set_isnt4(const Repl_Agmt *ra, int isit) { Dirsync_Private *dp; - slapi_log_error(SLAPI_LOG_TRACE, windows_repl_plugin_name, "=> windows_private_set_isnt4\n" ); + slapi_log_err(SLAPI_LOG_TRACE, windows_repl_plugin_name, "=> windows_private_set_isnt4\n" ); PR_ASSERT(ra); @@ -464,21 +464,21 @@ void windows_private_set_isnt4(const Repl_Agmt *ra, int isit) dp->isnt4 = isit; - slapi_log_error(SLAPI_LOG_TRACE, windows_repl_plugin_name, "<= windows_private_set_isnt4\n" ); + slapi_log_err(SLAPI_LOG_TRACE, windows_repl_plugin_name, "<= windows_private_set_isnt4\n" ); } int windows_private_get_iswin2k3(const Repl_Agmt *ra) { Dirsync_Private *dp; - slapi_log_error(SLAPI_LOG_TRACE, windows_repl_plugin_name, "=> windows_private_get_iswin2k3\n" ); + slapi_log_err(SLAPI_LOG_TRACE, windows_repl_plugin_name, "=> windows_private_get_iswin2k3\n" ); PR_ASSERT(ra); dp = (Dirsync_Private *) agmt_get_priv(ra); PR_ASSERT (dp); - slapi_log_error(SLAPI_LOG_TRACE, windows_repl_plugin_name, "<= windows_private_get_iswin2k3\n" ); + slapi_log_err(SLAPI_LOG_TRACE, windows_repl_plugin_name, "<= windows_private_get_iswin2k3\n" ); return dp->iswin2k3; } @@ -487,7 +487,7 @@ void windows_private_set_iswin2k3(const Repl_Agmt *ra, int isit) { Dirsync_Private *dp; - slapi_log_error(SLAPI_LOG_TRACE, windows_repl_plugin_name, "=> windows_private_set_iswin2k3\n" ); + slapi_log_err(SLAPI_LOG_TRACE, windows_repl_plugin_name, "=> windows_private_set_iswin2k3\n" ); PR_ASSERT(ra); @@ -496,7 +496,7 @@ void windows_private_set_iswin2k3(const Repl_Agmt *ra, int isit) dp->iswin2k3 = isit; - slapi_log_error(SLAPI_LOG_TRACE, windows_repl_plugin_name, "<= windows_private_set_iswin2k3\n" ); + slapi_log_err(SLAPI_LOG_TRACE, windows_repl_plugin_name, "<= windows_private_set_iswin2k3\n" ); } /* Returns a copy of the Slapi_Filter pointer. The caller should not free it */ @@ -504,7 +504,7 @@ Slapi_Filter* windows_private_get_directory_filter(const Repl_Agmt *ra) { Dirsync_Private *dp; - slapi_log_error(SLAPI_LOG_TRACE, windows_repl_plugin_name, "=> windows_private_get_directory_filter\n" ); + slapi_log_err(SLAPI_LOG_TRACE, windows_repl_plugin_name, "=> windows_private_get_directory_filter\n" ); PR_ASSERT(ra); @@ -530,7 +530,7 @@ Slapi_Filter* windows_private_get_directory_filter(const Repl_Agmt *ra) slapi_ch_free_string(&string_filter); } - slapi_log_error(SLAPI_LOG_TRACE, windows_repl_plugin_name, "<= windows_private_get_directory_filter\n" ); + slapi_log_err(SLAPI_LOG_TRACE, windows_repl_plugin_name, "<= windows_private_get_directory_filter\n" ); return dp->directory_filter; } @@ -541,7 +541,7 @@ windows_private_get_windows_filter(const Repl_Agmt *ra) { Dirsync_Private *dp; - slapi_log_error(SLAPI_LOG_TRACE, windows_repl_plugin_name, "=> windows_private_get_windows_filter\n" ); + slapi_log_err(SLAPI_LOG_TRACE, windows_repl_plugin_name, "=> windows_private_get_windows_filter\n" ); PR_ASSERT(ra); @@ -563,7 +563,7 @@ windows_private_get_windows_filter(const Repl_Agmt *ra) } } - slapi_log_error(SLAPI_LOG_TRACE, windows_repl_plugin_name, "<= windows_private_get_windows_filter\n" ); + slapi_log_err(SLAPI_LOG_TRACE, windows_repl_plugin_name, "<= windows_private_get_windows_filter\n" ); return dp->windows_filter; } @@ -573,7 +573,7 @@ Slapi_Filter* windows_private_get_deleted_filter(const Repl_Agmt *ra) { Dirsync_Private *dp; - slapi_log_error(SLAPI_LOG_TRACE, windows_repl_plugin_name, "=> windows_private_get_deleted_filter\n" ); + slapi_log_err(SLAPI_LOG_TRACE, windows_repl_plugin_name, "=> windows_private_get_deleted_filter\n" ); PR_ASSERT(ra); @@ -587,7 +587,7 @@ Slapi_Filter* windows_private_get_deleted_filter(const Repl_Agmt *ra) slapi_ch_free_string(&string_filter); } - slapi_log_error(SLAPI_LOG_TRACE, windows_repl_plugin_name, "<= windows_private_get_deleted_filter\n" ); + slapi_log_err(SLAPI_LOG_TRACE, windows_repl_plugin_name, "<= windows_private_get_deleted_filter\n" ); return dp->deleted_filter; } @@ -597,14 +597,14 @@ const Slapi_DN* windows_private_get_windows_subtree (const Repl_Agmt *ra) { Dirsync_Private *dp; - slapi_log_error(SLAPI_LOG_TRACE, windows_repl_plugin_name, "=> windows_private_get_windows_subtree\n" ); + slapi_log_err(SLAPI_LOG_TRACE, windows_repl_plugin_name, "=> windows_private_get_windows_subtree\n" ); PR_ASSERT(ra); dp = (Dirsync_Private *) agmt_get_priv(ra); PR_ASSERT (dp); - slapi_log_error(SLAPI_LOG_TRACE, windows_repl_plugin_name, "<= windows_private_get_windows_subtree\n" ); + slapi_log_err(SLAPI_LOG_TRACE, windows_repl_plugin_name, "<= windows_private_get_windows_subtree\n" ); return dp->windows_subtree; } @@ -614,14 +614,14 @@ windows_private_get_windows_domain(const Repl_Agmt *ra) { Dirsync_Private *dp; - slapi_log_error(SLAPI_LOG_TRACE, windows_repl_plugin_name, "=> windows_private_get_windows_domain\n" ); + slapi_log_err(SLAPI_LOG_TRACE, windows_repl_plugin_name, "=> windows_private_get_windows_domain\n" ); PR_ASSERT(ra); dp = (Dirsync_Private *) agmt_get_priv(ra); PR_ASSERT (dp); - slapi_log_error(SLAPI_LOG_TRACE, windows_repl_plugin_name, "<= windows_private_get_windows_domain\n" ); + slapi_log_err(SLAPI_LOG_TRACE, windows_repl_plugin_name, "<= windows_private_get_windows_domain\n" ); return dp->windows_domain; } @@ -631,7 +631,7 @@ windows_private_set_windows_domain(const Repl_Agmt *ra, char *domain) { Dirsync_Private *dp; - slapi_log_error(SLAPI_LOG_TRACE, windows_repl_plugin_name, "=> windows_private_set_windows_domain\n" ); + slapi_log_err(SLAPI_LOG_TRACE, windows_repl_plugin_name, "=> windows_private_set_windows_domain\n" ); PR_ASSERT(ra); @@ -641,7 +641,7 @@ windows_private_set_windows_domain(const Repl_Agmt *ra, char *domain) slapi_ch_free_string(&dp->windows_domain); dp->windows_domain = domain; - slapi_log_error(SLAPI_LOG_TRACE, windows_repl_plugin_name, "<= windows_private_set_windows_domain\n" ); + slapi_log_err(SLAPI_LOG_TRACE, windows_repl_plugin_name, "<= windows_private_set_windows_domain\n" ); } /* Returns a copy of the Slapi_DN pointer, no need to free it */ @@ -649,14 +649,14 @@ const Slapi_DN* windows_private_get_directory_subtree (const Repl_Agmt *ra) { Dirsync_Private *dp; - slapi_log_error(SLAPI_LOG_TRACE, windows_repl_plugin_name, "=> windows_private_get_directory_replarea\n" ); + slapi_log_err(SLAPI_LOG_TRACE, windows_repl_plugin_name, "=> windows_private_get_directory_replarea\n" ); PR_ASSERT(ra); dp = (Dirsync_Private *) agmt_get_priv(ra); PR_ASSERT (dp); - slapi_log_error(SLAPI_LOG_TRACE, windows_repl_plugin_name, "<= windows_private_get_directory_replarea\n" ); + slapi_log_err(SLAPI_LOG_TRACE, windows_repl_plugin_name, "<= windows_private_get_directory_replarea\n" ); return dp->directory_subtree; } @@ -667,7 +667,7 @@ void windows_private_set_windows_subtree (const Repl_Agmt *ra,Slapi_DN* sdn ) Dirsync_Private *dp; - slapi_log_error(SLAPI_LOG_TRACE, windows_repl_plugin_name, "=> windows_private_set_windows_replarea\n" ); + slapi_log_err(SLAPI_LOG_TRACE, windows_repl_plugin_name, "=> windows_private_set_windows_replarea\n" ); PR_ASSERT(ra); PR_ASSERT(sdn); @@ -678,7 +678,7 @@ void windows_private_set_windows_subtree (const Repl_Agmt *ra,Slapi_DN* sdn ) slapi_sdn_free(&dp->windows_subtree); dp->windows_subtree = sdn; - slapi_log_error(SLAPI_LOG_TRACE, windows_repl_plugin_name, "<= windows_private_set_windows_replarea\n" ); + slapi_log_err(SLAPI_LOG_TRACE, windows_repl_plugin_name, "<= windows_private_set_windows_replarea\n" ); } /* Takes a copy of the sdn passed in */ @@ -687,7 +687,7 @@ void windows_private_set_directory_subtree (const Repl_Agmt *ra,Slapi_DN* sdn ) Dirsync_Private *dp; - slapi_log_error(SLAPI_LOG_TRACE, windows_repl_plugin_name, "=> windows_private_set_directory_replarea\n" ); + slapi_log_err(SLAPI_LOG_TRACE, windows_repl_plugin_name, "=> windows_private_set_directory_replarea\n" ); PR_ASSERT(ra); PR_ASSERT(sdn); @@ -698,20 +698,20 @@ void windows_private_set_directory_subtree (const Repl_Agmt *ra,Slapi_DN* sdn ) slapi_sdn_free(&dp->directory_subtree); dp->directory_subtree = sdn; - slapi_log_error(SLAPI_LOG_TRACE, windows_repl_plugin_name, "<= windows_private_set_directory_replarea\n" ); + slapi_log_err(SLAPI_LOG_TRACE, windows_repl_plugin_name, "<= windows_private_set_directory_replarea\n" ); } PRBool windows_private_create_users(const Repl_Agmt *ra) { Dirsync_Private *dp; - slapi_log_error(SLAPI_LOG_TRACE, windows_repl_plugin_name, "=> windows_private_create_users\n" ); + slapi_log_err(SLAPI_LOG_TRACE, windows_repl_plugin_name, "=> windows_private_create_users\n" ); PR_ASSERT(ra); dp = (Dirsync_Private *) agmt_get_priv(ra); PR_ASSERT (dp); - slapi_log_error(SLAPI_LOG_TRACE, windows_repl_plugin_name, "<= windows_private_create_users\n" ); + slapi_log_err(SLAPI_LOG_TRACE, windows_repl_plugin_name, "<= windows_private_create_users\n" ); return dp->create_users_from_dirsync; @@ -722,7 +722,7 @@ void windows_private_set_create_users(const Repl_Agmt *ra, PRBool value) { Dirsync_Private *dp; - slapi_log_error(SLAPI_LOG_TRACE, windows_repl_plugin_name, "=> windows_private_set_create_users\n" ); + slapi_log_err(SLAPI_LOG_TRACE, windows_repl_plugin_name, "=> windows_private_set_create_users\n" ); PR_ASSERT(ra); dp = (Dirsync_Private *) agmt_get_priv(ra); @@ -730,7 +730,7 @@ void windows_private_set_create_users(const Repl_Agmt *ra, PRBool value) dp->create_users_from_dirsync = value; - slapi_log_error(SLAPI_LOG_TRACE, windows_repl_plugin_name, "<= windows_private_set_create_users\n" ); + slapi_log_err(SLAPI_LOG_TRACE, windows_repl_plugin_name, "<= windows_private_set_create_users\n" ); } @@ -738,13 +738,13 @@ PRBool windows_private_create_groups(const Repl_Agmt *ra) { Dirsync_Private *dp; - slapi_log_error(SLAPI_LOG_TRACE, windows_repl_plugin_name, "=> windows_private_create_groups\n" ); + slapi_log_err(SLAPI_LOG_TRACE, windows_repl_plugin_name, "=> windows_private_create_groups\n" ); PR_ASSERT(ra); dp = (Dirsync_Private *) agmt_get_priv(ra); PR_ASSERT (dp); - slapi_log_error(SLAPI_LOG_TRACE, windows_repl_plugin_name, "<= windows_private_create_groups\n" ); + slapi_log_err(SLAPI_LOG_TRACE, windows_repl_plugin_name, "<= windows_private_create_groups\n" ); return dp->create_groups_from_dirsync; @@ -755,7 +755,7 @@ void windows_private_set_create_groups(const Repl_Agmt *ra, PRBool value) { Dirsync_Private *dp; - slapi_log_error(SLAPI_LOG_TRACE, windows_repl_plugin_name, "=> windows_private_set_create_groups\n" ); + slapi_log_err(SLAPI_LOG_TRACE, windows_repl_plugin_name, "=> windows_private_set_create_groups\n" ); PR_ASSERT(ra); dp = (Dirsync_Private *) agmt_get_priv(ra); @@ -763,7 +763,7 @@ void windows_private_set_create_groups(const Repl_Agmt *ra, PRBool value) dp->create_groups_from_dirsync = value; - slapi_log_error(SLAPI_LOG_TRACE, windows_repl_plugin_name, "<= windows_private_set_create_groups\n" ); + slapi_log_err(SLAPI_LOG_TRACE, windows_repl_plugin_name, "<= windows_private_set_create_groups\n" ); } @@ -772,13 +772,13 @@ int windows_private_get_one_way(const Repl_Agmt *ra) { Dirsync_Private *dp; - slapi_log_error(SLAPI_LOG_TRACE, windows_repl_plugin_name, "=> windows_private_get_one_way\n" ); + slapi_log_err(SLAPI_LOG_TRACE, windows_repl_plugin_name, "=> windows_private_get_one_way\n" ); PR_ASSERT(ra); dp = (Dirsync_Private *) agmt_get_priv(ra); PR_ASSERT (dp); - slapi_log_error(SLAPI_LOG_TRACE, windows_repl_plugin_name, "<= windows_private_get_one_way\n" ); + slapi_log_err(SLAPI_LOG_TRACE, windows_repl_plugin_name, "<= windows_private_get_one_way\n" ); return dp->one_way; } @@ -788,7 +788,7 @@ void windows_private_set_one_way(const Repl_Agmt *ra, int value) { Dirsync_Private *dp; - slapi_log_error(SLAPI_LOG_TRACE, windows_repl_plugin_name, "=> windows_private_set_one_way\n" ); + slapi_log_err(SLAPI_LOG_TRACE, windows_repl_plugin_name, "=> windows_private_set_one_way\n" ); PR_ASSERT(ra); dp = (Dirsync_Private *) agmt_get_priv(ra); @@ -796,7 +796,7 @@ void windows_private_set_one_way(const Repl_Agmt *ra, int value) dp->one_way = value; - slapi_log_error(SLAPI_LOG_TRACE, windows_repl_plugin_name, "<= windows_private_set_one_way\n" ); + slapi_log_err(SLAPI_LOG_TRACE, windows_repl_plugin_name, "<= windows_private_set_one_way\n" ); } const char* @@ -804,13 +804,13 @@ windows_private_get_windows_userfilter(const Repl_Agmt *ra) { Dirsync_Private *dp; - slapi_log_error(SLAPI_LOG_TRACE, windows_repl_plugin_name, "=> windows_private_get_windows_userfilter\n" ); + slapi_log_err(SLAPI_LOG_TRACE, windows_repl_plugin_name, "=> windows_private_get_windows_userfilter\n" ); PR_ASSERT(ra); dp = (Dirsync_Private *) agmt_get_priv(ra); PR_ASSERT (dp); - slapi_log_error(SLAPI_LOG_TRACE, windows_repl_plugin_name, "<= windows_private_get_windows_userfilter\n" ); + slapi_log_err(SLAPI_LOG_TRACE, windows_repl_plugin_name, "<= windows_private_get_windows_userfilter\n" ); return dp->windows_userfilter; } @@ -821,7 +821,7 @@ windows_private_set_windows_userfilter(const Repl_Agmt *ra, char *filter) { Dirsync_Private *dp; - slapi_log_error(SLAPI_LOG_TRACE, windows_repl_plugin_name, "=> windows_private_set_windows_userfilter\n" ); + slapi_log_err(SLAPI_LOG_TRACE, windows_repl_plugin_name, "=> windows_private_set_windows_userfilter\n" ); PR_ASSERT(ra); @@ -831,7 +831,7 @@ windows_private_set_windows_userfilter(const Repl_Agmt *ra, char *filter) slapi_ch_free_string(&dp->windows_userfilter); dp->windows_userfilter = filter; - slapi_log_error(SLAPI_LOG_TRACE, windows_repl_plugin_name, "<= windows_private_set_windows_userfilter\n" ); + slapi_log_err(SLAPI_LOG_TRACE, windows_repl_plugin_name, "<= windows_private_set_windows_userfilter\n" ); } const char* @@ -839,13 +839,13 @@ windows_private_get_directory_userfilter(const Repl_Agmt *ra) { Dirsync_Private *dp; - slapi_log_error(SLAPI_LOG_TRACE, windows_repl_plugin_name, "=> windows_private_get_directory_userfilter\n" ); + slapi_log_err(SLAPI_LOG_TRACE, windows_repl_plugin_name, "=> windows_private_get_directory_userfilter\n" ); PR_ASSERT(ra); dp = (Dirsync_Private *) agmt_get_priv(ra); PR_ASSERT (dp); - slapi_log_error(SLAPI_LOG_TRACE, windows_repl_plugin_name, "<= windows_private_get_directory_userfilter\n" ); + slapi_log_err(SLAPI_LOG_TRACE, windows_repl_plugin_name, "<= windows_private_get_directory_userfilter\n" ); return dp->directory_userfilter; } @@ -856,7 +856,7 @@ windows_private_set_directory_userfilter(const Repl_Agmt *ra, char *filter) { Dirsync_Private *dp; - slapi_log_error(SLAPI_LOG_TRACE, windows_repl_plugin_name, "=> windows_private_set_directory_userfilter\n" ); + slapi_log_err(SLAPI_LOG_TRACE, windows_repl_plugin_name, "=> windows_private_set_directory_userfilter\n" ); PR_ASSERT(ra); @@ -866,7 +866,7 @@ windows_private_set_directory_userfilter(const Repl_Agmt *ra, char *filter) slapi_ch_free_string(&dp->directory_userfilter); dp->directory_userfilter = filter; - slapi_log_error(SLAPI_LOG_TRACE, windows_repl_plugin_name, "<= windows_private_set_directory_userfilter\n" ); + slapi_log_err(SLAPI_LOG_TRACE, windows_repl_plugin_name, "<= windows_private_set_directory_userfilter\n" ); } const subtreePair* @@ -874,13 +874,13 @@ windows_private_get_subtreepairs(const Repl_Agmt *ra) { Dirsync_Private *dp; - slapi_log_error(SLAPI_LOG_TRACE, windows_repl_plugin_name, "=> windows_private_get_subtreepairs\n" ); + slapi_log_err(SLAPI_LOG_TRACE, windows_repl_plugin_name, "=> windows_private_get_subtreepairs\n" ); PR_ASSERT(ra); dp = (Dirsync_Private *) agmt_get_priv(ra); PR_ASSERT (dp); - slapi_log_error(SLAPI_LOG_TRACE, windows_repl_plugin_name, "<= windows_private_get_subtreepairs\n" ); + slapi_log_err(SLAPI_LOG_TRACE, windows_repl_plugin_name, "<= windows_private_get_subtreepairs\n" ); return dp->subtree_pairs; } @@ -891,7 +891,7 @@ windows_private_set_subtreepairs(const Repl_Agmt *ra, char **parray) { Dirsync_Private *dp; - slapi_log_error(SLAPI_LOG_TRACE, windows_repl_plugin_name, "=> windows_private_set_subtreepairs\n" ); + slapi_log_err(SLAPI_LOG_TRACE, windows_repl_plugin_name, "=> windows_private_set_subtreepairs\n" ); PR_ASSERT(ra); @@ -901,7 +901,7 @@ windows_private_set_subtreepairs(const Repl_Agmt *ra, char **parray) free_subtree_pairs(&(dp->subtree_pairs)); dp->subtree_pairs = create_subtree_pairs(parray); - slapi_log_error(SLAPI_LOG_TRACE, windows_repl_plugin_name, "<= windows_private_set_subtreepairs\n" ); + slapi_log_err(SLAPI_LOG_TRACE, windows_repl_plugin_name, "<= windows_private_set_subtreepairs\n" ); } /* @@ -931,14 +931,14 @@ create_subtree_pairs(char **pairs) p0 = ldap_utf8strtok_r(*ptr, ":", &saveptr); p1 = ldap_utf8strtok_r(NULL, ":", &saveptr); if ((NULL == p0) || (NULL == p1)) { - LDAPDebug1Arg(LDAP_DEBUG_ERR, + slapi_log_err(SLAPI_LOG_ERR, "create_subtree_pairs: " "Ignoring invalid subtree pairs \"%s\".\n", *ptr); continue; } spp->DSsubtree = slapi_sdn_new_dn_byval(p0); if (NULL == spp->DSsubtree) { - LDAPDebug1Arg(LDAP_DEBUG_ERR, + slapi_log_err(SLAPI_LOG_ERR, "create_subtree_pairs: " "Ignoring invalid DS subtree \"%s\".\n", p0); @@ -946,7 +946,7 @@ create_subtree_pairs(char **pairs) } spp->ADsubtree = slapi_sdn_new_dn_byval(p1); if (NULL == spp->ADsubtree) { - LDAPDebug1Arg(LDAP_DEBUG_ERR, + slapi_log_err(SLAPI_LOG_ERR, "create_subtree_pairs: " "Ignoring invalid AD subtree \"%s\".\n", p1); @@ -982,13 +982,13 @@ windows_private_get_windows_treetop(const Repl_Agmt *ra) { Dirsync_Private *dp; - slapi_log_error(SLAPI_LOG_TRACE, windows_repl_plugin_name, "=> windows_private_get_windows_treetop\n" ); + slapi_log_err(SLAPI_LOG_TRACE, windows_repl_plugin_name, "=> windows_private_get_windows_treetop\n" ); PR_ASSERT(ra); dp = (Dirsync_Private *) agmt_get_priv(ra); PR_ASSERT (dp); - slapi_log_error(SLAPI_LOG_TRACE, windows_repl_plugin_name, "<= windows_private_get_windows_treetop\n" ); + slapi_log_err(SLAPI_LOG_TRACE, windows_repl_plugin_name, "<= windows_private_get_windows_treetop\n" ); return dp->windows_treetop; } @@ -999,7 +999,7 @@ windows_private_set_windows_treetop(const Repl_Agmt *ra, char *treetop) { Dirsync_Private *dp; - slapi_log_error(SLAPI_LOG_TRACE, windows_repl_plugin_name, "=> windows_private_set_windows_treetop\n" ); + slapi_log_err(SLAPI_LOG_TRACE, windows_repl_plugin_name, "=> windows_private_set_windows_treetop\n" ); PR_ASSERT(ra); @@ -1026,7 +1026,7 @@ windows_private_set_windows_treetop(const Repl_Agmt *ra, char *treetop) if (treetop_sdn) { dp->windows_treetop = treetop_sdn; } else { - LDAPDebug0Args(LDAP_DEBUG_ERR, + slapi_log_err(SLAPI_LOG_ERR, windows_repl_plugin_name, "windows_private_set_windows_treetop: " "winSyncSubtreePair contains inconsistent Windows subtrees.\n"); dp->windows_treetop = NULL; @@ -1037,7 +1037,7 @@ windows_private_set_windows_treetop(const Repl_Agmt *ra, char *treetop) } } - slapi_log_error(SLAPI_LOG_TRACE, windows_repl_plugin_name, "<= windows_private_set_windows_treetop\n" ); + slapi_log_err(SLAPI_LOG_TRACE, windows_repl_plugin_name, "<= windows_private_set_windows_treetop\n" ); } const Slapi_DN* @@ -1045,13 +1045,13 @@ windows_private_get_directory_treetop(const Repl_Agmt *ra) { Dirsync_Private *dp; - slapi_log_error(SLAPI_LOG_TRACE, windows_repl_plugin_name, "=> windows_private_get_directory_treetop\n" ); + slapi_log_err(SLAPI_LOG_TRACE, windows_repl_plugin_name, "=> windows_private_get_directory_treetop\n" ); PR_ASSERT(ra); dp = (Dirsync_Private *) agmt_get_priv(ra); PR_ASSERT (dp); - slapi_log_error(SLAPI_LOG_TRACE, windows_repl_plugin_name, "<= windows_private_get_directory_treetop\n" ); + slapi_log_err(SLAPI_LOG_TRACE, windows_repl_plugin_name, "<= windows_private_get_directory_treetop\n" ); return dp->directory_treetop; } @@ -1062,7 +1062,7 @@ windows_private_set_directory_treetop(const Repl_Agmt *ra, char *treetop) { Dirsync_Private *dp; - slapi_log_error(SLAPI_LOG_TRACE, windows_repl_plugin_name, "=> windows_private_set_directory_treetop\n" ); + slapi_log_err(SLAPI_LOG_TRACE, windows_repl_plugin_name, "=> windows_private_set_directory_treetop\n" ); PR_ASSERT(ra); @@ -1089,7 +1089,7 @@ windows_private_set_directory_treetop(const Repl_Agmt *ra, char *treetop) if (treetop_sdn) { dp->directory_treetop = treetop_sdn; } else { - LDAPDebug0Args(LDAP_DEBUG_ERR, + slapi_log_err(SLAPI_LOG_ERR, windows_repl_plugin_name, "windows_private_set_directory_treetop: " "winSyncSubtreePair contains inconsistent Windows subtrees.\n"); dp->directory_treetop = NULL; @@ -1100,7 +1100,7 @@ windows_private_set_directory_treetop(const Repl_Agmt *ra, char *treetop) } } - slapi_log_error(SLAPI_LOG_TRACE, windows_repl_plugin_name, "<= windows_private_set_directory_treetop\n" ); + slapi_log_err(SLAPI_LOG_TRACE, windows_repl_plugin_name, "<= windows_private_set_directory_treetop\n" ); } /* @@ -1116,7 +1116,7 @@ LDAPControl* windows_private_dirsync_control(const Repl_Agmt *ra) Dirsync_Private *dp; char iscritical = PR_TRUE; - slapi_log_error(SLAPI_LOG_TRACE, windows_repl_plugin_name, "=> windows_private_dirsync_control\n" ); + slapi_log_err(SLAPI_LOG_TRACE, windows_repl_plugin_name, "=> windows_private_dirsync_control\n" ); PR_ASSERT(ra); @@ -1134,7 +1134,7 @@ LDAPControl* windows_private_dirsync_control(const Repl_Agmt *ra) ber_free(ber,1); - slapi_log_error(SLAPI_LOG_TRACE, windows_repl_plugin_name, "<= windows_private_dirsync_control\n" ); + slapi_log_err(SLAPI_LOG_TRACE, windows_repl_plugin_name, "<= windows_private_dirsync_control\n" ); return control; @@ -1161,7 +1161,7 @@ void windows_private_update_dirsync_control(const Repl_Agmt *ra,LDAPControl **co int return_value = LDAP_SUCCESS; #endif - slapi_log_error(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" ); PR_ASSERT(ra); @@ -1232,9 +1232,9 @@ choke: } #ifdef FOR_DEBUGGING - LDAPDebug1Arg( LDAP_DEBUG_TRACE, "<= 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_error(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 } @@ -1242,14 +1242,14 @@ PRBool windows_private_dirsync_has_more(const Repl_Agmt *ra) { Dirsync_Private *dp; - slapi_log_error(SLAPI_LOG_TRACE, windows_repl_plugin_name, "=> windows_private_dirsync_has_more\n" ); + slapi_log_err(SLAPI_LOG_TRACE, windows_repl_plugin_name, "=> windows_private_dirsync_has_more\n" ); PR_ASSERT(ra); dp = (Dirsync_Private *) agmt_get_priv(ra); PR_ASSERT (dp); - slapi_log_error(SLAPI_LOG_TRACE, windows_repl_plugin_name, "<= windows_private_dirsync_has_more\n" ); + slapi_log_err(SLAPI_LOG_TRACE, windows_repl_plugin_name, "<= windows_private_dirsync_has_more\n" ); return dp->dirsync_cookie_has_more; @@ -1259,7 +1259,7 @@ void windows_private_null_dirsync_cookie(const Repl_Agmt *ra) { Dirsync_Private *dp; - slapi_log_error(SLAPI_LOG_TRACE, windows_repl_plugin_name, "=> windows_private_null_dirsync_control\n" ); + slapi_log_err(SLAPI_LOG_TRACE, windows_repl_plugin_name, "=> windows_private_null_dirsync_control\n" ); dp = (Dirsync_Private *) agmt_get_priv(ra); PR_ASSERT (dp); @@ -1268,7 +1268,7 @@ void windows_private_null_dirsync_cookie(const Repl_Agmt *ra) slapi_ch_free_string(&dp->dirsync_cookie); dp->dirsync_cookie = NULL; - slapi_log_error(SLAPI_LOG_TRACE, windows_repl_plugin_name, "<= windows_private_null_dirsync_control\n" ); + slapi_log_err(SLAPI_LOG_TRACE, windows_repl_plugin_name, "<= windows_private_null_dirsync_control\n" ); } static @@ -1298,7 +1298,7 @@ windows_private_save_dirsync_cookie(const Repl_Agmt *ra) - slapi_log_error(SLAPI_LOG_TRACE, windows_repl_plugin_name, "=> windows_private_save_dirsync_cookie\n" ); + slapi_log_err(SLAPI_LOG_TRACE, windows_repl_plugin_name, "=> windows_private_save_dirsync_cookie\n" ); PR_ASSERT(ra); dp = (Dirsync_Private *) agmt_get_priv(ra); @@ -1333,7 +1333,7 @@ windows_private_save_dirsync_cookie(const Repl_Agmt *ra) slapi_mods_free(&mods); slapi_sdn_free(&sdn); - slapi_log_error(SLAPI_LOG_TRACE, windows_repl_plugin_name, "<= windows_private_save_dirsync_cookie\n" ); + slapi_log_err(SLAPI_LOG_TRACE, windows_repl_plugin_name, "<= windows_private_save_dirsync_cookie\n" ); return rc; } @@ -1350,7 +1350,7 @@ int windows_private_load_dirsync_cookie(const Repl_Agmt *ra) Slapi_Entry *entry = NULL; Slapi_Attr *attr = NULL; - slapi_log_error(SLAPI_LOG_TRACE, windows_repl_plugin_name, "=> windows_private_load_dirsync_cookie\n" ); + slapi_log_err(SLAPI_LOG_TRACE, windows_repl_plugin_name, "=> windows_private_load_dirsync_cookie\n" ); PR_ASSERT(ra); dp = (Dirsync_Private *) agmt_get_priv(ra); @@ -1400,7 +1400,7 @@ int windows_private_load_dirsync_cookie(const Repl_Agmt *ra) slapi_sdn_free( &sdn); slapi_pblock_destroy (pb); - slapi_log_error(SLAPI_LOG_TRACE, windows_repl_plugin_name, "<= windows_private_load_dirsync_cookie\n" ); + slapi_log_err(SLAPI_LOG_TRACE, windows_repl_plugin_name, "<= windows_private_load_dirsync_cookie\n" ); return rc; } @@ -1410,12 +1410,12 @@ Slapi_Entry *windows_private_get_raw_entry(const Repl_Agmt *ra) { Dirsync_Private *dp; - slapi_log_error(SLAPI_LOG_TRACE, windows_repl_plugin_name, "=> windows_private_get_raw_entry\n" ); + slapi_log_err(SLAPI_LOG_TRACE, windows_repl_plugin_name, "=> windows_private_get_raw_entry\n" ); dp = (Dirsync_Private *) agmt_get_priv(ra); PR_ASSERT (dp); - slapi_log_error(SLAPI_LOG_TRACE, windows_repl_plugin_name, "<= windows_private_get_raw_entry\n" ); + slapi_log_err(SLAPI_LOG_TRACE, windows_repl_plugin_name, "<= windows_private_get_raw_entry\n" ); return dp->raw_entry; } @@ -1425,7 +1425,7 @@ void windows_private_set_raw_entry(const Repl_Agmt *ra, Slapi_Entry *e) { Dirsync_Private *dp; - slapi_log_error(SLAPI_LOG_TRACE, windows_repl_plugin_name, "=> windows_private_set_raw_entry\n" ); + slapi_log_err(SLAPI_LOG_TRACE, windows_repl_plugin_name, "=> windows_private_set_raw_entry\n" ); dp = (Dirsync_Private *) agmt_get_priv(ra); PR_ASSERT (dp); @@ -1439,7 +1439,7 @@ void windows_private_set_raw_entry(const Repl_Agmt *ra, Slapi_Entry *e) dp->raw_entry = e; } - slapi_log_error(SLAPI_LOG_TRACE, windows_repl_plugin_name, "<= windows_private_set_raw_entry\n" ); + slapi_log_err(SLAPI_LOG_TRACE, windows_repl_plugin_name, "<= windows_private_set_raw_entry\n" ); } /* Setting keep to 1 will cause the current raw entry to remain, even if @@ -1449,26 +1449,26 @@ void windows_private_set_keep_raw_entry(const Repl_Agmt *ra, int keep) { Dirsync_Private *dp; - slapi_log_error(SLAPI_LOG_TRACE, windows_repl_plugin_name, "=> windows_private_set_keep_raw_entry\n" ); + slapi_log_err(SLAPI_LOG_TRACE, windows_repl_plugin_name, "=> windows_private_set_keep_raw_entry\n" ); dp = (Dirsync_Private *) agmt_get_priv(ra); PR_ASSERT (dp); dp->keep_raw_entry = keep; - slapi_log_error(SLAPI_LOG_TRACE, windows_repl_plugin_name, "<= windows_private_set_keep_raw_entry\n" ); + slapi_log_err(SLAPI_LOG_TRACE, windows_repl_plugin_name, "<= windows_private_set_keep_raw_entry\n" ); } int windows_private_get_keep_raw_entry(const Repl_Agmt *ra) { Dirsync_Private *dp; - slapi_log_error(SLAPI_LOG_TRACE, windows_repl_plugin_name, "=> windows_private_get_keep_raw_entry\n" ); + slapi_log_err(SLAPI_LOG_TRACE, windows_repl_plugin_name, "=> windows_private_get_keep_raw_entry\n" ); dp = (Dirsync_Private *) agmt_get_priv(ra); PR_ASSERT (dp); - slapi_log_error(SLAPI_LOG_TRACE, windows_repl_plugin_name, "<= windows_private_get_keep_raw_entry\n" ); + slapi_log_err(SLAPI_LOG_TRACE, windows_repl_plugin_name, "<= windows_private_get_keep_raw_entry\n" ); return dp->keep_raw_entry; } @@ -1477,12 +1477,12 @@ void *windows_private_get_api_cookie(const Repl_Agmt *ra) { Dirsync_Private *dp; - slapi_log_error(SLAPI_LOG_TRACE, windows_repl_plugin_name, "=> windows_private_get_api_cookie\n" ); + slapi_log_err(SLAPI_LOG_TRACE, windows_repl_plugin_name, "=> windows_private_get_api_cookie\n" ); dp = (Dirsync_Private *) agmt_get_priv(ra); PR_ASSERT (dp); - slapi_log_error(SLAPI_LOG_TRACE, windows_repl_plugin_name, "<= windows_private_get_api_cookie\n" ); + slapi_log_err(SLAPI_LOG_TRACE, windows_repl_plugin_name, "<= windows_private_get_api_cookie\n" ); return dp->api_cookie; } @@ -1491,13 +1491,13 @@ void windows_private_set_api_cookie(Repl_Agmt *ra, void *api_cookie) { Dirsync_Private *dp; - slapi_log_error(SLAPI_LOG_TRACE, windows_repl_plugin_name, "=> windows_private_set_api_cookie\n" ); + slapi_log_err(SLAPI_LOG_TRACE, windows_repl_plugin_name, "=> windows_private_set_api_cookie\n" ); dp = (Dirsync_Private *) agmt_get_priv(ra); PR_ASSERT (dp); dp->api_cookie = api_cookie; - slapi_log_error(SLAPI_LOG_TRACE, windows_repl_plugin_name, "<= windows_private_set_api_cookie\n" ); + slapi_log_err(SLAPI_LOG_TRACE, windows_repl_plugin_name, "<= windows_private_set_api_cookie\n" ); } time_t @@ -1505,14 +1505,14 @@ windows_private_get_sync_interval(const Repl_Agmt *ra) { Dirsync_Private *dp; - slapi_log_error(SLAPI_LOG_TRACE, windows_repl_plugin_name, "=> windows_private_get_sync_interval\n" ); + slapi_log_err(SLAPI_LOG_TRACE, windows_repl_plugin_name, "=> windows_private_get_sync_interval\n" ); PR_ASSERT(ra); dp = (Dirsync_Private *) agmt_get_priv(ra); PR_ASSERT (dp); - slapi_log_error(SLAPI_LOG_TRACE, windows_repl_plugin_name, "<= windows_private_get_sync_interval\n" ); + slapi_log_err(SLAPI_LOG_TRACE, windows_repl_plugin_name, "<= windows_private_get_sync_interval\n" ); return dp->sync_interval; } @@ -1523,7 +1523,7 @@ windows_private_set_sync_interval(Repl_Agmt *ra, char *str) Dirsync_Private *dp; time_t tmpval = 0; - slapi_log_error(SLAPI_LOG_TRACE, windows_repl_plugin_name, "=> windows_private_set_sync_interval\n" ); + slapi_log_err(SLAPI_LOG_TRACE, windows_repl_plugin_name, "=> windows_private_set_sync_interval\n" ); PR_ASSERT(ra); @@ -1534,7 +1534,7 @@ windows_private_set_sync_interval(Repl_Agmt *ra, char *str) dp->sync_interval = tmpval; } - slapi_log_error(SLAPI_LOG_TRACE, windows_repl_plugin_name, "<= windows_private_set_sync_interval\n" ); + slapi_log_err(SLAPI_LOG_TRACE, windows_repl_plugin_name, "<= windows_private_set_sync_interval\n" ); } int @@ -1542,14 +1542,14 @@ windows_private_get_move_action(const Repl_Agmt *ra) { Dirsync_Private *dp; - slapi_log_error(SLAPI_LOG_TRACE, windows_repl_plugin_name, "=> windows_private_get_move_action\n" ); + slapi_log_err(SLAPI_LOG_TRACE, windows_repl_plugin_name, "=> windows_private_get_move_action\n" ); PR_ASSERT(ra); dp = (Dirsync_Private *) agmt_get_priv(ra); PR_ASSERT (dp); - slapi_log_error(SLAPI_LOG_TRACE, windows_repl_plugin_name, "<= windows_private_get_move_action\n" ); + slapi_log_err(SLAPI_LOG_TRACE, windows_repl_plugin_name, "<= windows_private_get_move_action\n" ); return dp->move_action; } @@ -1559,7 +1559,7 @@ windows_private_set_move_action(const Repl_Agmt *ra, int value) { Dirsync_Private *dp; - slapi_log_error(SLAPI_LOG_TRACE, windows_repl_plugin_name, "=> windows_private_set_move_action\n" ); + slapi_log_err(SLAPI_LOG_TRACE, windows_repl_plugin_name, "=> windows_private_set_move_action\n" ); PR_ASSERT(ra); @@ -1567,7 +1567,7 @@ windows_private_set_move_action(const Repl_Agmt *ra, int value) PR_ASSERT (dp); dp->move_action = value; - slapi_log_error(SLAPI_LOG_TRACE, windows_repl_plugin_name, "<= windows_private_set_move_action\n" ); + slapi_log_err(SLAPI_LOG_TRACE, windows_repl_plugin_name, "<= windows_private_set_move_action\n" ); } static PRCallOnceType winsync_callOnce = {0,0,0}; @@ -1690,7 +1690,7 @@ windows_plugin_callonce(void) void ***theapis = NULL; if (slapi_apib_get_interface_all(guid, &theapis) || (NULL == theapis)) { - LDAPDebug1Arg(LDAP_DEBUG_PLUGIN, + slapi_log_err(SLAPI_LOG_PLUGIN, windows_repl_plugin_name, "<-- windows_plugin_callonce -- no more windows plugin APIs registered " "for GUID [%s] -- end\n", guid); @@ -1698,7 +1698,7 @@ windows_plugin_callonce(void) int idx; for (idx = 0; theapis && theapis[idx]; ++idx) { if (windows_plugin_add(theapis[idx], maxapi)) { - LDAPDebug(LDAP_DEBUG_PLUGIN, + slapi_log_err(SLAPI_LOG_PLUGIN, windows_repl_plugin_name, "<-- windows_plugin_callonce -- already added windows plugin API " "[%d][0x%p] for GUID [%s] -- end\n", idx, theapis[idx], guid); @@ -1756,11 +1756,11 @@ windows_plugin_init(Repl_Agmt *ra) struct winsync_plugin_cookie *list = NULL; void *cookie = NULL; - LDAPDebug0Args(LDAP_DEBUG_PLUGIN, "--> windows_plugin_init_start -- 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_error(SLAPI_LOG_ERR, "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 +1780,7 @@ windows_plugin_init(Repl_Agmt *ra) windows_private_set_api_cookie(ra, list); - LDAPDebug0Args(LDAP_DEBUG_PLUGIN, "<-- windows_plugin_init_start -- end\n"); + slapi_log_err(SLAPI_LOG_PLUGIN, windows_repl_plugin_name, "<-- windows_plugin_init - end\n"); return; } @@ -2176,12 +2176,12 @@ static char *test_winsync_plugin_name = "test_winsync_api"; static void * test_winsync_api_init(const Slapi_DN *ds_subtree, const Slapi_DN *ad_subtree) { - slapi_log_error(SLAPI_LOG_PLUGIN, test_winsync_plugin_name, + slapi_log_err(SLAPI_LOG_PLUGIN, test_winsync_plugin_name, "--> test_winsync_init [%s] [%s] -- begin\n", slapi_sdn_get_dn(ds_subtree), slapi_sdn_get_dn(ad_subtree)); - slapi_log_error(SLAPI_LOG_PLUGIN, test_winsync_plugin_name, + slapi_log_err(SLAPI_LOG_PLUGIN, test_winsync_plugin_name, "<-- test_winsync_init -- end\n"); return NULL; @@ -2192,10 +2192,10 @@ test_winsync_dirsync_search_params_cb(void *cbdata, const char *agmt_dn, char **base, int *scope, char **filter, char ***attrs, LDAPControl ***serverctrls) { - slapi_log_error(SLAPI_LOG_PLUGIN, test_winsync_plugin_name, + slapi_log_err(SLAPI_LOG_PLUGIN, test_winsync_plugin_name, "--> test_winsync_dirsync_search_params_cb -- begin\n"); - slapi_log_error(SLAPI_LOG_PLUGIN, test_winsync_plugin_name, + slapi_log_err(SLAPI_LOG_PLUGIN, test_winsync_plugin_name, "<-- test_winsync_dirsync_search_params_cb -- end\n"); return; @@ -2207,10 +2207,10 @@ test_winsync_pre_ad_search_cb(void *cbdata, const char *agmt_dn, char **base, int *scope, char **filter, char ***attrs, LDAPControl ***serverctrls) { - slapi_log_error(SLAPI_LOG_PLUGIN, test_winsync_plugin_name, + slapi_log_err(SLAPI_LOG_PLUGIN, test_winsync_plugin_name, "--> test_winsync_pre_ad_search_cb -- begin\n"); - slapi_log_error(SLAPI_LOG_PLUGIN, test_winsync_plugin_name, + slapi_log_err(SLAPI_LOG_PLUGIN, test_winsync_plugin_name, "<-- test_winsync_pre_ad_search_cb -- end\n"); return; @@ -2222,10 +2222,10 @@ test_winsync_pre_ds_search_entry_cb(void *cbdata, const char *agmt_dn, char **base, int *scope, char **filter, char ***attrs, LDAPControl ***serverctrls) { - slapi_log_error(SLAPI_LOG_PLUGIN, test_winsync_plugin_name, + slapi_log_err(SLAPI_LOG_PLUGIN, test_winsync_plugin_name, "--> test_winsync_pre_ds_search_cb -- begin\n"); - slapi_log_error(SLAPI_LOG_PLUGIN, test_winsync_plugin_name, + slapi_log_err(SLAPI_LOG_PLUGIN, test_winsync_plugin_name, "<-- test_winsync_pre_ds_search_cb -- end\n"); return; @@ -2237,7 +2237,7 @@ test_winsync_pre_ds_search_all_cb(void *cbdata, const char *agmt_dn, char **base, int *scope, char **filter, char ***attrs, LDAPControl ***serverctrls) { - slapi_log_error(SLAPI_LOG_PLUGIN, test_winsync_plugin_name, + slapi_log_err(SLAPI_LOG_PLUGIN, test_winsync_plugin_name, "--> test_winsync_pre_ds_search_all_cb -- orig filter [%s] -- begin\n", ((filter && *filter) ? *filter : "NULL")); @@ -2249,13 +2249,13 @@ test_winsync_pre_ds_search_all_cb(void *cbdata, const char *agmt_dn, synced with AD already - ntUniqueId and ntUserDomainId are indexed for equality only - need to add presence? */ *filter = slapi_ch_strdup("(&(objectclass=ntuser)(ntUserDomainId=*))"); - slapi_log_error(SLAPI_LOG_PLUGIN, test_winsync_plugin_name, + slapi_log_err(SLAPI_LOG_PLUGIN, test_winsync_plugin_name, "--> test_winsync_pre_ds_search_all_cb -- new filter [%s]\n", *filter ? *filter : "NULL")); } #endif - slapi_log_error(SLAPI_LOG_PLUGIN, test_winsync_plugin_name, + slapi_log_err(SLAPI_LOG_PLUGIN, test_winsync_plugin_name, "<-- test_winsync_pre_ds_search_all_cb -- end\n"); return; @@ -2266,10 +2266,10 @@ test_winsync_pre_ad_mod_user_cb(void *cbdata, const Slapi_Entry *rawentry, Slapi_Entry *ad_entry, Slapi_Entry *ds_entry, Slapi_Mods *smods, int *do_modify) { - slapi_log_error(SLAPI_LOG_PLUGIN, test_winsync_plugin_name, + slapi_log_err(SLAPI_LOG_PLUGIN, test_winsync_plugin_name, "--> test_winsync_pre_ad_mod_user_cb -- begin\n"); - slapi_log_error(SLAPI_LOG_PLUGIN, test_winsync_plugin_name, + slapi_log_err(SLAPI_LOG_PLUGIN, test_winsync_plugin_name, "<-- test_winsync_pre_ad_mod_user_cb -- end\n"); return; @@ -2280,10 +2280,10 @@ test_winsync_pre_ad_mod_group_cb(void *cbdata, const Slapi_Entry *rawentry, Slapi_Entry *ad_entry, Slapi_Entry *ds_entry, Slapi_Mods *smods, int *do_modify) { - slapi_log_error(SLAPI_LOG_PLUGIN, test_winsync_plugin_name, + slapi_log_err(SLAPI_LOG_PLUGIN, test_winsync_plugin_name, "--> test_winsync_pre_ad_mod_group_cb -- begin\n"); - slapi_log_error(SLAPI_LOG_PLUGIN, test_winsync_plugin_name, + slapi_log_err(SLAPI_LOG_PLUGIN, test_winsync_plugin_name, "<-- test_winsync_pre_ad_mod_group_cb -- end\n"); return; @@ -2294,10 +2294,10 @@ test_winsync_pre_ds_mod_user_cb(void *cbdata, const Slapi_Entry *rawentry, Slapi_Entry *ad_entry, Slapi_Entry *ds_entry, Slapi_Mods *smods, int *do_modify) { - slapi_log_error(SLAPI_LOG_PLUGIN, test_winsync_plugin_name, + slapi_log_err(SLAPI_LOG_PLUGIN, test_winsync_plugin_name, "--> test_winsync_pre_ds_mod_user_cb -- begin\n"); - slapi_log_error(SLAPI_LOG_PLUGIN, test_winsync_plugin_name, + slapi_log_err(SLAPI_LOG_PLUGIN, test_winsync_plugin_name, "<-- test_winsync_pre_ds_mod_user_cb -- end\n"); return; @@ -2308,10 +2308,10 @@ test_winsync_pre_ds_mod_group_cb(void *cbdata, const Slapi_Entry *rawentry, Slapi_Entry *ad_entry, Slapi_Entry *ds_entry, Slapi_Mods *smods, int *do_modify) { - slapi_log_error(SLAPI_LOG_PLUGIN, test_winsync_plugin_name, + slapi_log_err(SLAPI_LOG_PLUGIN, test_winsync_plugin_name, "--> test_winsync_pre_ds_mod_group_cb -- begin\n"); - slapi_log_error(SLAPI_LOG_PLUGIN, test_winsync_plugin_name, + slapi_log_err(SLAPI_LOG_PLUGIN, test_winsync_plugin_name, "<-- test_winsync_pre_ds_mod_group_cb -- end\n"); return; @@ -2321,10 +2321,10 @@ static void test_winsync_pre_ds_add_user_cb(void *cbdata, const Slapi_Entry *rawentry, Slapi_Entry *ad_entry, Slapi_Entry *ds_entry) { - slapi_log_error(SLAPI_LOG_PLUGIN, test_winsync_plugin_name, + slapi_log_err(SLAPI_LOG_PLUGIN, test_winsync_plugin_name, "--> test_winsync_pre_ds_add_user_cb -- begin\n"); - slapi_log_error(SLAPI_LOG_PLUGIN, test_winsync_plugin_name, + slapi_log_err(SLAPI_LOG_PLUGIN, test_winsync_plugin_name, "<-- test_winsync_pre_ds_add_user_cb -- end\n"); return; @@ -2334,10 +2334,10 @@ static void test_winsync_pre_ds_add_group_cb(void *cbdata, const Slapi_Entry *rawentry, Slapi_Entry *ad_entry, Slapi_Entry *ds_entry) { - slapi_log_error(SLAPI_LOG_PLUGIN, test_winsync_plugin_name, + slapi_log_err(SLAPI_LOG_PLUGIN, test_winsync_plugin_name, "--> test_winsync_pre_ds_add_group_cb -- begin\n"); - slapi_log_error(SLAPI_LOG_PLUGIN, test_winsync_plugin_name, + slapi_log_err(SLAPI_LOG_PLUGIN, test_winsync_plugin_name, "<-- test_winsync_pre_ds_add_group_cb -- end\n"); return; @@ -2348,7 +2348,7 @@ test_winsync_get_new_ds_user_dn_cb(void *cbdata, const Slapi_Entry *rawentry, Slapi_Entry *ad_entry, char **new_dn_string, const Slapi_DN *ds_suffix, const Slapi_DN *ad_suffix) { - slapi_log_error(SLAPI_LOG_PLUGIN, test_winsync_plugin_name, + slapi_log_err(SLAPI_LOG_PLUGIN, test_winsync_plugin_name, "--> test_winsync_get_new_ds_user_dn_cb -- old dn [%s] -- begin\n", *new_dn_string); @@ -2364,7 +2364,7 @@ test_winsync_get_new_ds_user_dn_cb(void *cbdata, const Slapi_Entry *rawentry, slapi_ldap_value_free(rdns); #endif - slapi_log_error(SLAPI_LOG_PLUGIN, test_winsync_plugin_name, + slapi_log_err(SLAPI_LOG_PLUGIN, test_winsync_plugin_name, "<-- test_winsync_get_new_ds_user_dn_cb -- new dn [%s] -- end\n", *new_dn_string); @@ -2376,10 +2376,10 @@ test_winsync_get_new_ds_group_dn_cb(void *cbdata, const Slapi_Entry *rawentry, Slapi_Entry *ad_entry, char **new_dn_string, const Slapi_DN *ds_suffix, const Slapi_DN *ad_suffix) { - slapi_log_error(SLAPI_LOG_PLUGIN, test_winsync_plugin_name, + slapi_log_err(SLAPI_LOG_PLUGIN, test_winsync_plugin_name, "--> test_winsync_get_new_ds_group_dn_cb -- begin\n"); - slapi_log_error(SLAPI_LOG_PLUGIN, test_winsync_plugin_name, + slapi_log_err(SLAPI_LOG_PLUGIN, test_winsync_plugin_name, "<-- test_winsync_get_new_ds_group_dn_cb -- end\n"); return; @@ -2391,10 +2391,10 @@ test_winsync_pre_ad_mod_user_mods_cb(void *cbdata, const Slapi_Entry *rawentry, const Slapi_DN *local_dn, LDAPMod * const *origmods, Slapi_DN *remote_dn, LDAPMod ***modstosend) { - slapi_log_error(SLAPI_LOG_PLUGIN, test_winsync_plugin_name, + slapi_log_err(SLAPI_LOG_PLUGIN, test_winsync_plugin_name, "--> test_winsync_pre_ad_mod_user_mods_cb -- begin\n"); - slapi_log_error(SLAPI_LOG_PLUGIN, test_winsync_plugin_name, + slapi_log_err(SLAPI_LOG_PLUGIN, test_winsync_plugin_name, "<-- test_winsync_pre_ad_mod_user_mods_cb -- end\n"); return; @@ -2406,10 +2406,10 @@ test_winsync_pre_ad_mod_group_mods_cb(void *cbdata, const Slapi_Entry *rawentry, const Slapi_DN *local_dn, LDAPMod * const *origmods, Slapi_DN *remote_dn, LDAPMod ***modstosend) { - slapi_log_error(SLAPI_LOG_PLUGIN, test_winsync_plugin_name, + slapi_log_err(SLAPI_LOG_PLUGIN, test_winsync_plugin_name, "--> test_winsync_pre_ad_mod_group_mods_cb -- begin\n"); - slapi_log_error(SLAPI_LOG_PLUGIN, test_winsync_plugin_name, + slapi_log_err(SLAPI_LOG_PLUGIN, test_winsync_plugin_name, "<-- test_winsync_pre_ad_mod_group_mods_cb -- end\n"); return; @@ -2419,10 +2419,10 @@ static int test_winsync_can_add_entry_to_ad_cb(void *cbdata, const Slapi_Entry *local_entry, const Slapi_DN *remote_dn) { - slapi_log_error(SLAPI_LOG_PLUGIN, test_winsync_plugin_name, + slapi_log_err(SLAPI_LOG_PLUGIN, test_winsync_plugin_name, "--> test_winsync_can_add_entry_to_ad_cb -- begin\n"); - slapi_log_error(SLAPI_LOG_PLUGIN, test_winsync_plugin_name, + slapi_log_err(SLAPI_LOG_PLUGIN, test_winsync_plugin_name, "<-- test_winsync_can_add_entry_to_ad_cb -- end\n"); /* return 0;*/ /* false - do not allow entries to be added to ad */ @@ -2433,10 +2433,10 @@ static void test_winsync_begin_update_cb(void *cbdata, const Slapi_DN *ds_subtree, const Slapi_DN *ad_subtree, int is_total) { - slapi_log_error(SLAPI_LOG_PLUGIN, test_winsync_plugin_name, + slapi_log_err(SLAPI_LOG_PLUGIN, test_winsync_plugin_name, "--> test_winsync_begin_update_cb -- begin\n"); - slapi_log_error(SLAPI_LOG_PLUGIN, test_winsync_plugin_name, + slapi_log_err(SLAPI_LOG_PLUGIN, test_winsync_plugin_name, "<-- test_winsync_begin_update_cb -- end\n"); return; @@ -2446,10 +2446,10 @@ static void test_winsync_end_update_cb(void *cbdata, const Slapi_DN *ds_subtree, const Slapi_DN *ad_subtree, int is_total) { - slapi_log_error(SLAPI_LOG_PLUGIN, test_winsync_plugin_name, + slapi_log_err(SLAPI_LOG_PLUGIN, test_winsync_plugin_name, "--> test_winsync_end_update_cb -- begin\n"); - slapi_log_error(SLAPI_LOG_PLUGIN, test_winsync_plugin_name, + slapi_log_err(SLAPI_LOG_PLUGIN, test_winsync_plugin_name, "<-- test_winsync_end_update_cb -- end\n"); return; @@ -2459,12 +2459,12 @@ static void test_winsync_destroy_agmt_cb(void *cbdata, const Slapi_DN *ds_subtree, const Slapi_DN *ad_subtree) { - slapi_log_error(SLAPI_LOG_PLUGIN, test_winsync_plugin_name, + slapi_log_err(SLAPI_LOG_PLUGIN, test_winsync_plugin_name, "--> test_winsync_destroy_agmt_cb -- begin\n"); /* free(cbdata); */ - slapi_log_error(SLAPI_LOG_PLUGIN, test_winsync_plugin_name, + slapi_log_err(SLAPI_LOG_PLUGIN, test_winsync_plugin_name, "<-- test_winsync_destroy_agmt_cb -- end\n"); return; @@ -2473,16 +2473,16 @@ test_winsync_destroy_agmt_cb(void *cbdata, const Slapi_DN *ds_subtree, static void test_winsync_post_ad_mod_user_cb(void *cookie, const Slapi_Entry *rawentry, Slapi_Entry *ad_entry, Slapi_Entry *ds_entry, Slapi_Mods *smods, int *result) { - slapi_log_error(SLAPI_LOG_PLUGIN, test_winsync_plugin_name, + slapi_log_err(SLAPI_LOG_PLUGIN, test_winsync_plugin_name, "--> test_winsync_post_ad_mod_user_cb -- begin\n"); #ifdef THIS_IS_JUST_AN_EXAMPLE - slapi_log_error(SLAPI_LOG_PLUGIN, test_winsync_plugin_name, + slapi_log_err(SLAPI_LOG_PLUGIN, test_winsync_plugin_name, "Result of modifying AD entry [%s] was [%d:%s]\n", slapi_entry_get_dn(ad_entry), *result, ldap_err2string(*result)); #endif - slapi_log_error(SLAPI_LOG_PLUGIN, test_winsync_plugin_name, + slapi_log_err(SLAPI_LOG_PLUGIN, test_winsync_plugin_name, "<-- test_winsync_post_ad_mod_user_cb -- end\n"); return; @@ -2491,16 +2491,16 @@ test_winsync_post_ad_mod_user_cb(void *cookie, const Slapi_Entry *rawentry, Slap static void test_winsync_post_ad_mod_group_cb(void *cookie, const Slapi_Entry *rawentry, Slapi_Entry *ad_entry, Slapi_Entry *ds_entry, Slapi_Mods *smods, int *result) { - slapi_log_error(SLAPI_LOG_PLUGIN, test_winsync_plugin_name, + slapi_log_err(SLAPI_LOG_PLUGIN, test_winsync_plugin_name, "--> test_winsync_post_ad_mod_group_cb -- begin\n"); #ifdef THIS_IS_JUST_AN_EXAMPLE - slapi_log_error(SLAPI_LOG_PLUGIN, test_winsync_plugin_name, + slapi_log_err(SLAPI_LOG_PLUGIN, test_winsync_plugin_name, "Result of modifying AD entry [%s] was [%d:%s]\n", slapi_entry_get_dn(ad_entry), *result, ldap_err2string(*result)); #endif - slapi_log_error(SLAPI_LOG_PLUGIN, test_winsync_plugin_name, + slapi_log_err(SLAPI_LOG_PLUGIN, test_winsync_plugin_name, "<-- test_winsync_post_ad_mod_group_cb -- end\n"); return; @@ -2509,16 +2509,16 @@ test_winsync_post_ad_mod_group_cb(void *cookie, const Slapi_Entry *rawentry, Sla static void test_winsync_post_ds_mod_user_cb(void *cookie, const Slapi_Entry *rawentry, Slapi_Entry *ad_entry, Slapi_Entry *ds_entry, Slapi_Mods *smods, int *result) { - slapi_log_error(SLAPI_LOG_PLUGIN, test_winsync_plugin_name, + slapi_log_err(SLAPI_LOG_PLUGIN, test_winsync_plugin_name, "--> test_winsync_post_ds_mod_user_cb -- begin\n"); #ifdef THIS_IS_JUST_AN_EXAMPLE - slapi_log_error(SLAPI_LOG_PLUGIN, test_winsync_plugin_name, + slapi_log_err(SLAPI_LOG_PLUGIN, test_winsync_plugin_name, "Result of modifying DS entry [%s] was [%d:%s]\n", slapi_entry_get_dn(ds_entry), *result, ldap_err2string(*result)); #endif - slapi_log_error(SLAPI_LOG_PLUGIN, test_winsync_plugin_name, + slapi_log_err(SLAPI_LOG_PLUGIN, test_winsync_plugin_name, "<-- test_winsync_post_ds_mod_user_cb -- end\n"); return; @@ -2527,16 +2527,16 @@ test_winsync_post_ds_mod_user_cb(void *cookie, const Slapi_Entry *rawentry, Slap static void test_winsync_post_ds_mod_group_cb(void *cookie, const Slapi_Entry *rawentry, Slapi_Entry *ad_entry, Slapi_Entry *ds_entry, Slapi_Mods *smods, int *result) { - slapi_log_error(SLAPI_LOG_PLUGIN, test_winsync_plugin_name, + slapi_log_err(SLAPI_LOG_PLUGIN, test_winsync_plugin_name, "--> test_winsync_post_ds_mod_group_cb -- begin\n"); #ifdef THIS_IS_JUST_AN_EXAMPLE - slapi_log_error(SLAPI_LOG_PLUGIN, test_winsync_plugin_name, + slapi_log_err(SLAPI_LOG_PLUGIN, test_winsync_plugin_name, "Result of modifying DS entry [%s] was [%d:%s]\n", slapi_entry_get_dn(ds_entry), *result, ldap_err2string(*result)); #endif - slapi_log_error(SLAPI_LOG_PLUGIN, test_winsync_plugin_name, + slapi_log_err(SLAPI_LOG_PLUGIN, test_winsync_plugin_name, "<-- test_winsync_post_ds_mod_group_cb -- end\n"); return; @@ -2545,16 +2545,16 @@ test_winsync_post_ds_mod_group_cb(void *cookie, const Slapi_Entry *rawentry, Sla static void test_winsync_post_ds_add_user_cb(void *cookie, const Slapi_Entry *rawentry, Slapi_Entry *ad_entry, Slapi_Entry *ds_entry, int *result) { - slapi_log_error(SLAPI_LOG_PLUGIN, test_winsync_plugin_name, + slapi_log_err(SLAPI_LOG_PLUGIN, test_winsync_plugin_name, "--> test_winsync_post_ds_add_user_cb -- begin\n"); #ifdef THIS_IS_JUST_AN_EXAMPLE - slapi_log_error(SLAPI_LOG_PLUGIN, test_winsync_plugin_name, + slapi_log_err(SLAPI_LOG_PLUGIN, test_winsync_plugin_name, "Result of adding DS entry [%s] was [%d:%s]\n", slapi_entry_get_dn(ds_entry), *result, ldap_err2string(*result)); #endif - slapi_log_error(SLAPI_LOG_PLUGIN, test_winsync_plugin_name, + slapi_log_err(SLAPI_LOG_PLUGIN, test_winsync_plugin_name, "<-- test_winsync_post_ds_add_user_cb -- end\n"); return; @@ -2563,16 +2563,16 @@ test_winsync_post_ds_add_user_cb(void *cookie, const Slapi_Entry *rawentry, Slap static void test_winsync_post_ds_add_group_cb(void *cookie, const Slapi_Entry *rawentry, Slapi_Entry *ad_entry, Slapi_Entry *ds_entry, int *result) { - slapi_log_error(SLAPI_LOG_PLUGIN, test_winsync_plugin_name, + slapi_log_err(SLAPI_LOG_PLUGIN, test_winsync_plugin_name, "--> test_winsync_post_ds_add_group_cb -- begin\n"); #ifdef THIS_IS_JUST_AN_EXAMPLE - slapi_log_error(SLAPI_LOG_PLUGIN, test_winsync_plugin_name, + slapi_log_err(SLAPI_LOG_PLUGIN, test_winsync_plugin_name, "Result of adding DS entry [%s] was [%d:%s]\n", slapi_entry_get_dn(ds_entry), *result, ldap_err2string(*result)); #endif - slapi_log_error(SLAPI_LOG_PLUGIN, test_winsync_plugin_name, + slapi_log_err(SLAPI_LOG_PLUGIN, test_winsync_plugin_name, "<-- test_winsync_post_ds_add_group_cb -- end\n"); return; @@ -2581,17 +2581,17 @@ test_winsync_post_ds_add_group_cb(void *cookie, const Slapi_Entry *rawentry, Sla static void test_winsync_pre_ad_add_user_cb(void *cookie, Slapi_Entry *ds_entry, Slapi_Entry *ad_entry) { - slapi_log_error(SLAPI_LOG_PLUGIN, test_winsync_plugin_name, + slapi_log_err(SLAPI_LOG_PLUGIN, test_winsync_plugin_name, "--> test_winsync_pre_ad_add_user_cb -- begin\n"); #ifdef THIS_IS_JUST_AN_EXAMPLE - slapi_log_error(SLAPI_LOG_PLUGIN, test_winsync_plugin_name, + slapi_log_err(SLAPI_LOG_PLUGIN, test_winsync_plugin_name, "Adding AD entry [%s] from add of DS entry [%s]\n", slapi_entry_get_dn(ad_entry), slapi_entry_get_dn(ds_entry)); /* make modifications to ad_entry here */ #endif - slapi_log_error(SLAPI_LOG_PLUGIN, test_winsync_plugin_name, + slapi_log_err(SLAPI_LOG_PLUGIN, test_winsync_plugin_name, "<-- test_winsync_pre_ad_add_user_cb -- end\n"); return; @@ -2600,17 +2600,17 @@ test_winsync_pre_ad_add_user_cb(void *cookie, Slapi_Entry *ds_entry, Slapi_Entry static void test_winsync_pre_ad_add_group_cb(void *cookie, Slapi_Entry *ds_entry, Slapi_Entry *ad_entry) { - slapi_log_error(SLAPI_LOG_PLUGIN, test_winsync_plugin_name, + slapi_log_err(SLAPI_LOG_PLUGIN, test_winsync_plugin_name, "--> test_winsync_pre_ad_add_group_cb -- begin\n"); #ifdef THIS_IS_JUST_AN_EXAMPLE - slapi_log_error(SLAPI_LOG_PLUGIN, test_winsync_plugin_name, + slapi_log_err(SLAPI_LOG_PLUGIN, test_winsync_plugin_name, "Adding AD entry [%s] from add of DS entry [%s]\n", slapi_entry_get_dn(ad_entry), slapi_entry_get_dn(ds_entry)); /* make modifications to ad_entry here */ #endif - slapi_log_error(SLAPI_LOG_PLUGIN, test_winsync_plugin_name, + slapi_log_err(SLAPI_LOG_PLUGIN, test_winsync_plugin_name, "<-- test_winsync_pre_ad_add_group_cb -- end\n"); return; @@ -2619,16 +2619,16 @@ test_winsync_pre_ad_add_group_cb(void *cookie, Slapi_Entry *ds_entry, Slapi_Entr static void test_winsync_post_ad_add_user_cb(void *cookie, Slapi_Entry *ds_entry, Slapi_Entry *ad_entry, int *result) { - slapi_log_error(SLAPI_LOG_PLUGIN, test_winsync_plugin_name, + slapi_log_err(SLAPI_LOG_PLUGIN, test_winsync_plugin_name, "--> test_winsync_post_ad_add_user_cb -- begin\n"); #ifdef THIS_IS_JUST_AN_EXAMPLE - slapi_log_error(SLAPI_LOG_PLUGIN, test_winsync_plugin_name, + slapi_log_err(SLAPI_LOG_PLUGIN, test_winsync_plugin_name, "Result of adding AD entry [%s] was [%d:%s]\n", slapi_entry_get_dn(ad_entry), *result, ldap_err2string(*result)); #endif - slapi_log_error(SLAPI_LOG_PLUGIN, test_winsync_plugin_name, + slapi_log_err(SLAPI_LOG_PLUGIN, test_winsync_plugin_name, "<-- test_winsync_post_ad_add_user_cb -- end\n"); return; @@ -2637,16 +2637,16 @@ test_winsync_post_ad_add_user_cb(void *cookie, Slapi_Entry *ds_entry, Slapi_Entr static void test_winsync_post_ad_add_group_cb(void *cookie, Slapi_Entry *ds_entry, Slapi_Entry *ad_entry, int *result) { - slapi_log_error(SLAPI_LOG_PLUGIN, test_winsync_plugin_name, + slapi_log_err(SLAPI_LOG_PLUGIN, test_winsync_plugin_name, "--> test_winsync_post_ad_add_group_cb -- begin\n"); #ifdef THIS_IS_JUST_AN_EXAMPLE - slapi_log_error(SLAPI_LOG_PLUGIN, test_winsync_plugin_name, + slapi_log_err(SLAPI_LOG_PLUGIN, test_winsync_plugin_name, "Result of adding AD entry [%s] was [%d:%s]\n", slapi_entry_get_dn(ad_entry), *result, ldap_err2string(*result)); #endif - slapi_log_error(SLAPI_LOG_PLUGIN, test_winsync_plugin_name, + slapi_log_err(SLAPI_LOG_PLUGIN, test_winsync_plugin_name, "<-- test_winsync_post_ad_add_group_cb -- end\n"); return; @@ -2655,16 +2655,16 @@ test_winsync_post_ad_add_group_cb(void *cookie, Slapi_Entry *ds_entry, Slapi_Ent static void test_winsync_post_ad_mod_user_mods_cb(void *cookie, const Slapi_Entry *rawentry, const Slapi_DN *local_dn, const Slapi_Entry *ds_entry, LDAPMod * const *origmods, Slapi_DN *remote_dn, LDAPMod ***modstosend, int *result) { - slapi_log_error(SLAPI_LOG_PLUGIN, test_winsync_plugin_name, + slapi_log_err(SLAPI_LOG_PLUGIN, test_winsync_plugin_name, "--> test_winsync_post_ad_mod_user_mods_cb -- begin\n"); #ifdef THIS_IS_JUST_AN_EXAMPLE - slapi_log_error(SLAPI_LOG_PLUGIN, test_winsync_plugin_name, + slapi_log_err(SLAPI_LOG_PLUGIN, test_winsync_plugin_name, "Result of modifying AD entry [%s] was [%d:%s]\n", slapi_sdn_get_dn(remote_dn), *result, ldap_err2string(*result)); #endif - slapi_log_error(SLAPI_LOG_PLUGIN, test_winsync_plugin_name, + slapi_log_err(SLAPI_LOG_PLUGIN, test_winsync_plugin_name, "<-- test_winsync_post_ad_mod_user_mods_cb -- end\n"); return; @@ -2673,16 +2673,16 @@ test_winsync_post_ad_mod_user_mods_cb(void *cookie, const Slapi_Entry *rawentry, static void test_winsync_post_ad_mod_group_mods_cb(void *cookie, const Slapi_Entry *rawentry, const Slapi_DN *local_dn, const Slapi_Entry *ds_entry, LDAPMod * const *origmods, Slapi_DN *remote_dn, LDAPMod ***modstosend, int *result) { - slapi_log_error(SLAPI_LOG_PLUGIN, test_winsync_plugin_name, + slapi_log_err(SLAPI_LOG_PLUGIN, test_winsync_plugin_name, "--> test_winsync_post_ad_mod_group_mods_cb -- begin\n"); #ifdef THIS_IS_JUST_AN_EXAMPLE - slapi_log_error(SLAPI_LOG_PLUGIN, test_winsync_plugin_name, + slapi_log_err(SLAPI_LOG_PLUGIN, test_winsync_plugin_name, "Result of modifying AD entry [%s] was [%d:%s]\n", slapi_sdn_get_dn(remote_dn), *result, ldap_err2string(*result)); #endif - slapi_log_error(SLAPI_LOG_PLUGIN, test_winsync_plugin_name, + slapi_log_err(SLAPI_LOG_PLUGIN, test_winsync_plugin_name, "<-- test_winsync_post_ad_mod_group_mods_cb -- end\n"); return; @@ -2807,16 +2807,16 @@ static void *test_winsync_api_v3[] = { static int test_winsync_plugin_start(Slapi_PBlock *pb) { - slapi_log_error(SLAPI_LOG_TRACE, test_winsync_plugin_name, + slapi_log_err(SLAPI_LOG_TRACE, test_winsync_plugin_name, "--> test_winsync_plugin_start -- begin\n"); if( slapi_apib_register(WINSYNC_v3_0_GUID, test_winsync_api_v3) ) { - slapi_log_error(SLAPI_LOG_ERR, test_winsync_plugin_name, + slapi_log_err(SLAPI_LOG_ERR, test_winsync_plugin_name, "test_winsync_plugin_start - Failed to register winsync api -- end\n"); return -1; } - slapi_log_error(SLAPI_LOG_TRACE, test_winsync_plugin_name, + slapi_log_err(SLAPI_LOG_TRACE, test_winsync_plugin_name, "<-- test_winsync_plugin_start -- end\n"); return 0; } @@ -2824,12 +2824,12 @@ test_winsync_plugin_start(Slapi_PBlock *pb) static int test_winsync_plugin_close(Slapi_PBlock *pb) { - slapi_log_error(SLAPI_LOG_TRACE, test_winsync_plugin_name, + slapi_log_err(SLAPI_LOG_TRACE, test_winsync_plugin_name, "--> test_winsync_plugin_close -- begin\n"); slapi_apib_unregister(WINSYNC_v3_0_GUID); - slapi_log_error(SLAPI_LOG_TRACE, test_winsync_plugin_name, + slapi_log_err(SLAPI_LOG_TRACE, test_winsync_plugin_name, "<-- test_winsync_plugin_close -- end\n"); return 0; } @@ -2839,7 +2839,7 @@ test_winsync_plugin_close(Slapi_PBlock *pb) */ int test_winsync_plugin_init(Slapi_PBlock *pb) { - slapi_log_error(SLAPI_LOG_TRACE, test_winsync_plugin_name, + slapi_log_err(SLAPI_LOG_TRACE, test_winsync_plugin_name, "--> test_winsync_plugin_init -- begin\n"); if ( slapi_pblock_set( pb, SLAPI_PLUGIN_VERSION, @@ -2851,7 +2851,7 @@ int test_winsync_plugin_init(Slapi_PBlock *pb) slapi_pblock_set( pb, SLAPI_PLUGIN_DESCRIPTION, (void *)&test_winsync_pdesc ) != 0 ) { - slapi_log_error(SLAPI_LOG_ERR, test_winsync_plugin_name, + slapi_log_err(SLAPI_LOG_ERR, test_winsync_plugin_name, "<-- test_winsync_plugin_init -- failed to register plugin -- end\n"); return -1; } @@ -2859,12 +2859,12 @@ int test_winsync_plugin_init(Slapi_PBlock *pb) /* Retrieve and save the plugin identity to later pass to internal operations */ if (slapi_pblock_get(pb, SLAPI_PLUGIN_IDENTITY, &test_winsync_plugin_id) != 0) { - slapi_log_error(SLAPI_LOG_ERR, test_winsync_plugin_name, + slapi_log_err(SLAPI_LOG_ERR, test_winsync_plugin_name, "test_winsync_plugin_init - Failed to retrieve plugin identity -- end\n"); return -1; } - slapi_log_error(SLAPI_LOG_TRACE, test_winsync_plugin_name, + slapi_log_err(SLAPI_LOG_TRACE, test_winsync_plugin_name, "<-- test_winsync_plugin_init -- end\n"); return 0; } diff --git a/ldap/servers/plugins/replication/windows_protocol_util.c b/ldap/servers/plugins/replication/windows_protocol_util.c index 09ae7b0..87ab252 100644 --- a/ldap/servers/plugins/replication/windows_protocol_util.c +++ b/ldap/servers/plugins/replication/windows_protocol_util.c @@ -260,7 +260,7 @@ windows_ignore_error_and_keep_going(int error) { int return_value = PR_FALSE; - LDAPDebug(LDAP_DEBUG_TRACE, "=> windows_ignore_error_and_keep_going\n", 0, 0, 0 ); + slapi_log_err(SLAPI_LOG_TRACE, windows_repl_plugin_name, "=> windows_ignore_error_and_keep_going\n"); switch (error) { @@ -331,15 +331,15 @@ windows_ignore_error_and_keep_going(int error) return_value = PR_FALSE; break; } - LDAPDebug(LDAP_DEBUG_TRACE, "<= windows_ignore_error_and_keep_going\n", 0, 0, 0 ); + slapi_log_err(SLAPI_LOG_TRACE, windows_repl_plugin_name, "<= windows_ignore_error_and_keep_going\n"); return return_value; } static const char* op2string(int op) { - LDAPDebug(LDAP_DEBUG_TRACE, "=> op2string\n", 0, 0, 0 ); - LDAPDebug(LDAP_DEBUG_TRACE, "<= op2string\n", 0, 0, 0 ); + slapi_log_err(SLAPI_LOG_TRACE, windows_repl_plugin_name, "=> op2string\n"); + slapi_log_err(SLAPI_LOG_TRACE, windows_repl_plugin_name, "<= op2string\n"); switch (op) { case SLAPI_OPERATION_ADD: return "add"; @@ -364,7 +364,7 @@ windows_dump_entry(const char *string, Slapi_Entry *e) if (slapi_is_loglevel_set(SLAPI_LOG_REPL)) { buffer = slapi_entry2str(e,&length); - slapi_log_error(SLAPI_LOG_REPL, windows_repl_plugin_name, "Windows sync entry: %s %s\n", string, buffer); + slapi_log_err(SLAPI_LOG_REPL, windows_repl_plugin_name, "Windows sync entry: %s %s\n", string, buffer); if (buffer) { slapi_ch_free_string(&buffer); @@ -381,7 +381,7 @@ map_dn_values(Private_Repl_Protocol *prp,Slapi_ValueSet *original_values, Slapi_ int i = 0; if (NULL == mapped_values) { - slapi_log_error(SLAPI_LOG_REPL, windows_repl_plugin_name, + slapi_log_err(SLAPI_LOG_REPL, windows_repl_plugin_name, "%s: map_dn_values: arg mapped_values is NULL.\n", agmt_get_long_name(prp->agmt)); return; @@ -404,12 +404,12 @@ map_dn_values(Private_Repl_Protocol *prp,Slapi_ValueSet *original_values, Slapi_ /* Sanity check the data was a valid string */ original_dn_string_length = slapi_value_get_length(original_value); if (0 == original_dn_string_length) { - slapi_log_error(SLAPI_LOG_REPL, windows_repl_plugin_name, "map_dn_values: length of dn is 0\n"); + slapi_log_err(SLAPI_LOG_REPL, windows_repl_plugin_name, "map_dn_values: length of dn is 0\n"); } /* Make a sdn from the string */ original_dn = slapi_sdn_new_dn_byref(original_dn_string); if (!original_dn) { - slapi_log_error(SLAPI_LOG_REPL, windows_repl_plugin_name, "map_dn_values: unable to create Slapi_DN from %s.\n", original_dn_string); + slapi_log_err(SLAPI_LOG_REPL, windows_repl_plugin_name, "map_dn_values: unable to create Slapi_DN from %s.\n", original_dn_string); return; } @@ -443,14 +443,14 @@ map_dn_values(Private_Repl_Protocol *prp,Slapi_ValueSet *original_values, Slapi_ slapi_sdn_free(&remote_dn); } else { - slapi_log_error(SLAPI_LOG_REPL, windows_repl_plugin_name, "map_dn_values: no remote dn found for %s\n", original_dn_string); + slapi_log_err(SLAPI_LOG_REPL, windows_repl_plugin_name, "map_dn_values: no remote dn found for %s\n", original_dn_string); } } else { - slapi_log_error(SLAPI_LOG_REPL, windows_repl_plugin_name, "map_dn_values: this entry is not ours %s\n", original_dn_string); + slapi_log_err(SLAPI_LOG_REPL, windows_repl_plugin_name, "map_dn_values: this entry is not ours %s\n", original_dn_string); } } else { - slapi_log_error(SLAPI_LOG_REPL, windows_repl_plugin_name, "map_dn_values: no local entry found for %s\n", original_dn_string); + slapi_log_err(SLAPI_LOG_REPL, windows_repl_plugin_name, "map_dn_values: no local entry found for %s\n", original_dn_string); } if (local_entry) { @@ -481,15 +481,15 @@ map_dn_values(Private_Repl_Protocol *prp,Slapi_ValueSet *original_values, Slapi_ slapi_sdn_free(&local_dn); } else { - slapi_log_error(SLAPI_LOG_REPL, windows_repl_plugin_name, "map_dn_values: no local dn found for %s\n", original_dn_string); + slapi_log_err(SLAPI_LOG_REPL, windows_repl_plugin_name, "map_dn_values: no local dn found for %s\n", original_dn_string); } } else { - slapi_log_error(SLAPI_LOG_REPL, windows_repl_plugin_name, "map_dn_values: this entry is not ours %s\n", original_dn_string); + slapi_log_err(SLAPI_LOG_REPL, windows_repl_plugin_name, "map_dn_values: this entry is not ours %s\n", original_dn_string); } } else { - slapi_log_error(SLAPI_LOG_REPL, windows_repl_plugin_name, "map_dn_values: no remote entry found for %s\n", original_dn_string); + slapi_log_err(SLAPI_LOG_REPL, windows_repl_plugin_name, "map_dn_values: no remote entry found for %s\n", original_dn_string); } if (remote_entry) { @@ -527,7 +527,7 @@ windows_dump_ruvs(Object *supl_ruv_obj, Object *cons_ruv_obj) { if (slapi_is_loglevel_set(SLAPI_LOG_REPL)) { - slapi_log_error(SLAPI_LOG_REPL, windows_repl_plugin_name, "acquire_replica, supplier RUV:\n"); + slapi_log_err(SLAPI_LOG_REPL, windows_repl_plugin_name, "acquire_replica, supplier RUV:\n"); if (supl_ruv_obj) { RUV* sup = NULL; object_acquire(supl_ruv_obj); @@ -536,9 +536,9 @@ windows_dump_ruvs(Object *supl_ruv_obj, Object *cons_ruv_obj) object_release(supl_ruv_obj); } else { - slapi_log_error(SLAPI_LOG_REPL, windows_repl_plugin_name, "acquire_replica, supplier RUV = null\n"); + slapi_log_err(SLAPI_LOG_REPL, windows_repl_plugin_name, "acquire_replica, supplier RUV = null\n"); } - slapi_log_error(SLAPI_LOG_REPL, windows_repl_plugin_name, "acquire_replica, consumer RUV:\n"); + slapi_log_err(SLAPI_LOG_REPL, windows_repl_plugin_name, "acquire_replica, consumer RUV:\n"); if (cons_ruv_obj) { @@ -548,7 +548,7 @@ windows_dump_ruvs(Object *supl_ruv_obj, Object *cons_ruv_obj) ruv_dump (con,"consumer", NULL); object_release( cons_ruv_obj ); } else { - slapi_log_error(SLAPI_LOG_REPL, windows_repl_plugin_name, "acquire_replica, consumer RUV = null\n"); + slapi_log_err(SLAPI_LOG_REPL, windows_repl_plugin_name, "acquire_replica, consumer RUV = null\n"); } } } @@ -581,11 +581,11 @@ windows_acquire_replica(Private_Repl_Protocol *prp, RUV **ruv, int check_ruv) PRBool is_newer = PR_FALSE; RUV *r = NULL; - LDAPDebug(LDAP_DEBUG_TRACE, "=> windows_acquire_replica\n", 0, 0, 0 ); + slapi_log_err(SLAPI_LOG_TRACE, windows_repl_plugin_name, "=> windows_acquire_replica\n"); if (NULL == ruv) { - slapi_log_error(SLAPI_LOG_ERR, windows_repl_plugin_name, "NULL ruv\n"); + slapi_log_err(SLAPI_LOG_ERR, windows_repl_plugin_name, "NULL ruv\n"); return_value = ACQUIRE_FATAL_ERROR; goto done; } @@ -594,10 +594,10 @@ windows_acquire_replica(Private_Repl_Protocol *prp, RUV **ruv, int check_ruv) if (prp->replica_acquired) /* we already acquire replica */ { - slapi_log_error(SLAPI_LOG_NOTICE, windows_repl_plugin_name, + slapi_log_err(SLAPI_LOG_NOTICE, windows_repl_plugin_name, "%s: Remote replica already acquired\n", agmt_get_long_name(prp->agmt)); - LDAPDebug(LDAP_DEBUG_TRACE, "<= windows_acquire_replica\n", 0, 0, 0 ); + slapi_log_err(SLAPI_LOG_TRACE, windows_repl_plugin_name, "<= windows_acquire_replica\n"); return ACQUIRE_SUCCESS; } @@ -615,7 +615,7 @@ windows_acquire_replica(Private_Repl_Protocol *prp, RUV **ruv, int check_ruv) is_newer = ruv_is_newer ( supl_ruv_obj, cons_ruv_obj ); if (is_newer) { - slapi_log_error(SLAPI_LOG_REPL, windows_repl_plugin_name, "acquire_replica, supplier RUV is newer\n"); + slapi_log_err(SLAPI_LOG_REPL, windows_repl_plugin_name, "acquire_replica, supplier RUV is newer\n"); } /* Handle the pristine case */ @@ -636,7 +636,7 @@ windows_acquire_replica(Private_Repl_Protocol *prp, RUV **ruv, int check_ruv) /* Once we get here we have a valid ruv */ if (is_newer == PR_FALSE && check_ruv) { prp->last_acquire_response_code = NSDS50_REPL_UPTODATE; - LDAPDebug(LDAP_DEBUG_TRACE, "<= windows_acquire_replica - ACQUIRE_CONSUMER_WAS_UPTODATE\n", 0, 0, 0 ); + slapi_log_err(SLAPI_LOG_TRACE, windows_repl_plugin_name, "<= windows_acquire_replica - ACQUIRE_CONSUMER_WAS_UPTODATE\n"); return ACQUIRE_CONSUMER_WAS_UPTODATE; } @@ -682,7 +682,7 @@ windows_acquire_replica(Private_Repl_Protocol *prp, RUV **ruv, int check_ruv) else { /* Couldn't get a current CSN */ - slapi_log_error(SLAPI_LOG_ERR, windows_repl_plugin_name, + slapi_log_err(SLAPI_LOG_ERR, windows_repl_plugin_name, "%s: Unable to obtain current CSN. " "Replication is aborting.\n", agmt_get_long_name(prp->agmt)); @@ -705,7 +705,7 @@ windows_acquire_replica(Private_Repl_Protocol *prp, RUV **ruv, int check_ruv) prp->replica_acquired = PR_TRUE; } done: - LDAPDebug(LDAP_DEBUG_TRACE, "<= windows_acquire_replica\n", 0, 0, 0 ); + slapi_log_err(SLAPI_LOG_TRACE, windows_repl_plugin_name, "<= windows_acquire_replica\n"); return return_value; } @@ -713,7 +713,7 @@ done: void windows_release_replica(Private_Repl_Protocol *prp) { - LDAPDebug(LDAP_DEBUG_TRACE, "=> windows_release_replica\n", 0, 0, 0 ); + slapi_log_err(SLAPI_LOG_TRACE, windows_repl_plugin_name, "=> windows_release_replica\n"); PR_ASSERT(NULL != prp); PR_ASSERT(NULL != prp->conn); @@ -725,7 +725,7 @@ windows_release_replica(Private_Repl_Protocol *prp) prp->replica_acquired = PR_FALSE; - LDAPDebug(LDAP_DEBUG_TRACE, "<= windows_release_replica\n", 0, 0, 0 ); + slapi_log_err(SLAPI_LOG_TRACE, windows_repl_plugin_name, "<= windows_release_replica\n"); } @@ -799,7 +799,7 @@ send_password_modify(Slapi_DN *sdn, continue; } if (0 == strcmp(s, "0")) { - slapi_log_error(SLAPI_LOG_REPL, windows_repl_plugin_name, + slapi_log_err(SLAPI_LOG_REPL, windows_repl_plugin_name, "%s: AD entry %s set \"user must change password at next logon\". ", agmt_get_long_name(prp->agmt), slapi_entry_get_dn(remote_entry)); force_reset_pw = 1; @@ -873,7 +873,7 @@ send_password_modify(Slapi_DN *sdn, PR_smprintf_free(quoted_password); } } else { - slapi_log_error(SLAPI_LOG_REPL, windows_repl_plugin_name, + slapi_log_err(SLAPI_LOG_REPL, windows_repl_plugin_name, "%s: AD already has the current password for %s. " "Not sending password modify to AD.\n", agmt_get_long_name(prp->agmt), slapi_sdn_get_dn(sdn)); @@ -906,7 +906,7 @@ send_accountcontrol_modify(Slapi_DN *sdn, Private_Repl_Protocol *prp, int missin /* if we are adding a new entry, we need to set the entry to be enabled to allow AD login */ if (missing_entry) { - slapi_log_error(SLAPI_LOG_REPL, windows_repl_plugin_name, + slapi_log_err(SLAPI_LOG_REPL, windows_repl_plugin_name, "%s: New Windows entry %s will be enabled.\n", agmt_get_long_name(prp->agmt), slapi_sdn_get_dn(sdn)); acctval &= ~0x2; /* unset the disabled bit, if set */ @@ -1075,7 +1075,7 @@ windows_log_add_entry_remote(const Slapi_DN *local_dn,const Slapi_DN *remote_dn) { const char* local_dn_string = slapi_sdn_get_dn(local_dn); const char* remote_dn_string = slapi_sdn_get_dn(remote_dn); - slapi_log_error(SLAPI_LOG_REPL, windows_repl_plugin_name, "Attempting to add entry %s to AD for local entry %s\n",remote_dn_string,local_dn_string); + slapi_log_err(SLAPI_LOG_REPL, windows_repl_plugin_name, "Attempting to add entry %s to AD for local entry %s\n",remote_dn_string,local_dn_string); } /* @@ -1132,7 +1132,7 @@ process_replay_add(Private_Repl_Protocol *prp, Slapi_Entry *add_entry, Slapi_Ent ConnResult return_value = 0; int rc = 0; - slapi_log_error(SLAPI_LOG_REPL, windows_repl_plugin_name, + slapi_log_err(SLAPI_LOG_REPL, windows_repl_plugin_name, "%s: process_replay_add: dn=\"%s\" (%s,%s)\n", agmt_get_long_name(prp->agmt), slapi_sdn_get_dn(remote_dn), missing_entry ? "not present" : "already present", remote_add_allowed ? "add allowed" : "add not allowed"); @@ -1147,7 +1147,7 @@ process_replay_add(Private_Repl_Protocol *prp, Slapi_Entry *add_entry, Slapi_Ent char *cn_string = NULL; Slapi_DN *tombstone_dn = NULL; - slapi_log_error(SLAPI_LOG_REPL, windows_repl_plugin_name, + slapi_log_err(SLAPI_LOG_REPL, windows_repl_plugin_name, "process_replay_add: %s - dn=\"%s\" appears to have been" " deleted on remote side. Searching for tombstone.\n", agmt_get_long_name(prp->agmt), slapi_sdn_get_dn(remote_dn)); @@ -1198,13 +1198,13 @@ process_replay_add(Private_Repl_Protocol *prp, Slapi_Entry *add_entry, Slapi_Ent * does not exist, we'll create a new entry in AD, which * will end up getting a new GUID generated by AD. */ if (tstone_exists) { - slapi_log_error(SLAPI_LOG_REPL, windows_repl_plugin_name, + slapi_log_err(SLAPI_LOG_REPL, windows_repl_plugin_name, "process_replay_add - %s - Reanimating tombstone (dn=\"%s\") to" " normal entry (dn=\"%s\").\n", agmt_get_long_name(prp->agmt), slapi_sdn_get_dn(tombstone_dn), new_dn_string); reanimate_rc = windows_reanimate_tombstone(prp, tombstone_dn, (const char *)new_dn_string); if (reanimate_rc != 0) { - slapi_log_error(SLAPI_LOG_REPL, windows_repl_plugin_name, + slapi_log_err(SLAPI_LOG_REPL, windows_repl_plugin_name, " process_replay_add - %s - Reanimation of tombstone" " (dn=\"%s\") failed. A new entry (dn=\"%s\")" " will be added instead.\n", agmt_get_long_name(prp->agmt), @@ -1259,7 +1259,7 @@ process_replay_add(Private_Repl_Protocol *prp, Slapi_Entry *add_entry, Slapi_Ent mapped_entry = NULL; if (NULL == entryattrs) { - slapi_log_error(SLAPI_LOG_ERR, windows_repl_plugin_name, + slapi_log_err(SLAPI_LOG_ERR, windows_repl_plugin_name, "process_replay_add - %s - Cannot convert entry to LDAPMods.\n", agmt_get_long_name(prp->agmt)); return_value = CONN_LOCAL_ERROR; @@ -1299,7 +1299,7 @@ process_replay_add(Private_Repl_Protocol *prp, Slapi_Entry *add_entry, Slapi_Ent * missing_entry is set to 0 at the top of this function. */ if (return_value) { - slapi_log_error(SLAPI_LOG_ERR, windows_repl_plugin_name, + slapi_log_err(SLAPI_LOG_ERR, windows_repl_plugin_name, "process_replay_add - %s: Cannot replay add operation.\n", agmt_get_long_name(prp->agmt)); } @@ -1308,7 +1308,7 @@ process_replay_add(Private_Repl_Protocol *prp, Slapi_Entry *add_entry, Slapi_Ent } } else { - slapi_log_error(SLAPI_LOG_ERR, windows_repl_plugin_name, + slapi_log_err(SLAPI_LOG_ERR, windows_repl_plugin_name, "process_replay_add - %s - Failed to create mapped entry dn=\"%s\"\n", agmt_get_long_name(prp->agmt), slapi_sdn_get_dn(remote_dn)); } @@ -1366,7 +1366,7 @@ process_replay_rename(Private_Repl_Protocol *prp, const subtreePair* sp = NULL; if (NULL == local_origsdn || NULL == local_newentry) { - slapi_log_error(SLAPI_LOG_ERR, windows_repl_plugin_name, + slapi_log_err(SLAPI_LOG_ERR, windows_repl_plugin_name, "process_replay_rename - %s is empty\n", (NULL==local_origsdn)?"local sdn":"local entry"); goto bail; @@ -1383,7 +1383,7 @@ process_replay_rename(Private_Repl_Protocol *prp, if ((NULL == remote_subtree || NULL == local_subtree || '\0' == *remote_subtree || '\0' == *local_subtree) && (NULL == subtree_pairs)) { - slapi_log_error(SLAPI_LOG_ERR, windows_repl_plugin_name, + slapi_log_err(SLAPI_LOG_ERR, windows_repl_plugin_name, "process_replay_rename - local subtree \"%s\" or " "remote subtree \"%s\" and " "subtree_pairs are empty\n", @@ -1412,7 +1412,7 @@ process_replay_rename(Private_Repl_Protocol *prp, p = strstr(norm_newparent, local_subtree); } if (NULL == p) { - slapi_log_error(SLAPI_LOG_ERR, windows_repl_plugin_name, + slapi_log_err(SLAPI_LOG_ERR, windows_repl_plugin_name, "process_replay_rename - new superior \"%s\" is not " "in the local subtree \"%s\"\n", norm_newparent, local_subtree); @@ -1440,7 +1440,7 @@ process_replay_rename(Private_Repl_Protocol *prp, * is taken care in modify not in modrdn locally. */ remote_rdn_val = slapi_entry_attr_get_charptr(local_newentry, "cn"); if (NULL == remote_rdn_val) { - slapi_log_error(SLAPI_LOG_ERR, windows_repl_plugin_name, + slapi_log_err(SLAPI_LOG_ERR, windows_repl_plugin_name, "process_replay_rename - local entry \"%s\" has no " "ntUserDomainId\n", slapi_entry_get_dn_const(local_newentry)); @@ -1499,7 +1499,7 @@ process_replay_rename(Private_Repl_Protocol *prp, * additional info: 00000057: LdapErr: DSID-0C090AAB, * comment: Old RDN must be deleted, data 0, v1db1 */ - slapi_log_error(SLAPI_LOG_REPL, windows_repl_plugin_name, + slapi_log_err(SLAPI_LOG_REPL, windows_repl_plugin_name, "process_replay_rename - %s: Renaming %s to %s,%s; " "set deleteoldrdn to 1 " "since AD does not allow old RDN left\n", @@ -1545,7 +1545,7 @@ windows_replay_update(Private_Repl_Protocol *prp, slapi_operation_parameters *op Slapi_Entry *local_entry = NULL; Slapi_Entry *remote_entry = NULL; - slapi_log_error(SLAPI_LOG_TRACE, windows_repl_plugin_name, "=> windows_replay_update\n"); + slapi_log_err(SLAPI_LOG_TRACE, windows_repl_plugin_name, "=> windows_replay_update\n"); local_dn = slapi_sdn_dup( op->target_address.sdn ); @@ -1569,7 +1569,7 @@ windows_replay_update(Private_Repl_Protocol *prp, slapi_operation_parameters *op rc = windows_get_local_entry_by_uniqueid(prp, op->target_address.uniqueid, &local_entry, 1 /* is_global */); if (rc) { - slapi_log_error(SLAPI_LOG_ERR, windows_repl_plugin_name, + slapi_log_err(SLAPI_LOG_ERR, windows_repl_plugin_name, "windows_replay_update - %s - Failed to fetch local entry " "for %s operation dn=\"%s\"\n", agmt_get_long_name(prp->agmt), @@ -1583,13 +1583,13 @@ windows_replay_update(Private_Repl_Protocol *prp, slapi_operation_parameters *op /* We only searched within the subtree in the agreement, so we should not print * an error if we didn't find the entry and the DN is outside of the agreement scope. */ if (is_dn_subject_of_agreement_local(local_dn, prp->agmt)) { - slapi_log_error(SLAPI_LOG_ERR, windows_repl_plugin_name, + slapi_log_err(SLAPI_LOG_ERR, windows_repl_plugin_name, "windows_replay_update - %s - Failed to fetch local entry for %s operation dn=\"%s\"\n", agmt_get_long_name(prp->agmt), op2string(op->operation_type), REPL_GET_DN(&op->target_address)); } else { - slapi_log_error(SLAPI_LOG_REPL, windows_repl_plugin_name, + slapi_log_err(SLAPI_LOG_REPL, windows_repl_plugin_name, "windows_replay_update - %s - Looking at %s operation local dn=\"%s\" (%s)\n", agmt_get_long_name(prp->agmt), op2string(op->operation_type), @@ -1608,7 +1608,7 @@ windows_replay_update(Private_Repl_Protocol *prp, slapi_operation_parameters *op } windows_is_local_entry_user_or_group(local_entry,&is_user,&is_group); - slapi_log_error(SLAPI_LOG_REPL, windows_repl_plugin_name, + slapi_log_err(SLAPI_LOG_REPL, windows_repl_plugin_name, "windows_replay_update - %s -Looking at %s operation local dn=\"%s\" (%s,%s,%s)\n", agmt_get_long_name(prp->agmt), op2string(op->operation_type), @@ -1621,7 +1621,7 @@ windows_replay_update(Private_Repl_Protocol *prp, slapi_operation_parameters *op rc = map_entry_dn_outbound(local_entry,&remote_dn,prp,&missing_entry, 1, &remote_entry); if (rc || NULL == remote_dn) { - slapi_log_error(SLAPI_LOG_ERR, windows_repl_plugin_name, + slapi_log_err(SLAPI_LOG_ERR, windows_repl_plugin_name, "windows_replay_update - %s - Failed map dn for %s operation dn=\"%s\" " "rc=%d remote_dn = [%s]\n", agmt_get_long_name(prp->agmt), @@ -1630,7 +1630,7 @@ windows_replay_update(Private_Repl_Protocol *prp, slapi_operation_parameters *op rc, remote_dn ? slapi_sdn_get_dn(remote_dn) : "(null)"); goto error; } - slapi_log_error(SLAPI_LOG_REPL, windows_repl_plugin_name, + slapi_log_err(SLAPI_LOG_REPL, windows_repl_plugin_name, "Windows_replay_update - %s - Processing %s operation local dn=\"%s\" remote dn=\"%s\"\n", agmt_get_long_name(prp->agmt), op2string(op->operation_type), @@ -1655,7 +1655,7 @@ windows_replay_update(Private_Repl_Protocol *prp, slapi_operation_parameters *op Slapi_Entry *ad_entry = NULL; return_value = process_replay_add(prp,local_entry,local_entry,local_dn,remote_dn,is_user,missing_entry,&password); - slapi_log_error(SLAPI_LOG_REPL, windows_repl_plugin_name, + slapi_log_err(SLAPI_LOG_REPL, windows_repl_plugin_name, "windows_replay_update - %s - " "The modify operation added the sync objectclass and attribute, so " "the entry was added to windows - result [%d]\n", @@ -1698,7 +1698,7 @@ windows_replay_update(Private_Repl_Protocol *prp, slapi_operation_parameters *op * remote_dn is in GUID format. Thus, this MODRDN does not change the remote_dn but the DN on AD only. * Thus, no need to "rename" remote_dn for the following windows_conn_send_modify. */ - slapi_log_error(SLAPI_LOG_REPL, windows_repl_plugin_name, "windows_replay_update - %s - Renaming remote entry \"%s\" with new RDN of \"%s\"\n", + slapi_log_err(SLAPI_LOG_REPL, windows_repl_plugin_name, "windows_replay_update - %s - Renaming remote entry \"%s\" with new RDN of \"%s\"\n", agmt_get_long_name(prp->agmt), slapi_sdn_get_dn(remote_dn), newrdn); return_value = windows_conn_send_rename(prp->conn, slapi_sdn_get_dn(remote_dn), newrdn, NULL, 1 /* delete old RDN */, @@ -1723,7 +1723,7 @@ windows_replay_update(Private_Repl_Protocol *prp, slapi_operation_parameters *op if (slapi_is_loglevel_set(SLAPI_LOG_REPL)) { int i = 0; - slapi_log_error(SLAPI_LOG_REPL, windows_repl_plugin_name, + slapi_log_err(SLAPI_LOG_REPL, windows_repl_plugin_name, "dump mods for replay update:\n"); for(i=0;mapped_mods[i];i++) { @@ -1770,19 +1770,19 @@ bail_modify: if (delete_remote_entry_allowed(local_entry)) { if (missing_entry) { - slapi_log_error(SLAPI_LOG_REPL, windows_repl_plugin_name, + slapi_log_err(SLAPI_LOG_REPL, windows_repl_plugin_name, "windows_replay_update - %s - Remote entry doesn't exist. " "Skipping operation, dn=\"%s\"\n", agmt_get_long_name(prp->agmt), slapi_sdn_get_dn(remote_dn)); } else { return_value = windows_conn_send_delete(prp->conn, slapi_sdn_get_dn(remote_dn), NULL, NULL /* returned controls */); - slapi_log_error(SLAPI_LOG_REPL, windows_repl_plugin_name, + slapi_log_err(SLAPI_LOG_REPL, windows_repl_plugin_name, "windows_replay_update - %s - Deleted remote entry, dn=\"%s\", result=%d\n", agmt_get_long_name(prp->agmt), slapi_sdn_get_dn(remote_dn), return_value); } } else { - slapi_log_error(SLAPI_LOG_REPL, windows_repl_plugin_name, + slapi_log_err(SLAPI_LOG_REPL, windows_repl_plugin_name, "windows_replay_update - %s - Delete not allowed on remote entry, dn=\"%s\"\n", agmt_get_long_name(prp->agmt), slapi_sdn_get_dn(remote_dn)); } @@ -1811,7 +1811,7 @@ bail_modify: break; } default: - slapi_log_error(SLAPI_LOG_WARNING, windows_repl_plugin_name, "windows_replay_update - %s: Unknown " + slapi_log_err(SLAPI_LOG_WARNING, windows_repl_plugin_name, "windows_replay_update - %s: Unknown " "operation type %lu found in changelog - skipping change.\n", agmt_get_long_name(prp->agmt), op->operation_type); } @@ -1838,7 +1838,7 @@ bail_modify: if (return_value) { - slapi_log_error(SLAPI_LOG_REPL, windows_repl_plugin_name, + slapi_log_err(SLAPI_LOG_REPL, windows_repl_plugin_name, "windows_replay_update - %s - Update password returned %d\n", agmt_get_long_name(prp->agmt), return_value ); } @@ -2039,7 +2039,7 @@ windows_create_remote_entry(Private_Repl_Protocol *prp,Slapi_Entry *original_ent "objectclass:top\n" "objectclass:group\n"; - slapi_log_error(SLAPI_LOG_TRACE, windows_repl_plugin_name, "=> windows_create_remote_entry\n"); + slapi_log_err(SLAPI_LOG_TRACE, windows_repl_plugin_name, "=> windows_create_remote_entry\n"); if (NULL == password) { retval = LDAP_PARAM_ERROR; @@ -2128,7 +2128,7 @@ windows_create_remote_entry(Private_Repl_Protocol *prp,Slapi_Entry *original_ent char *new_initials = PL_strndup(initials_value, AD_INITIALS_LENGTH); /* the below hands off memory */ slapi_value_set_string_passin(value, new_initials); - slapi_log_error(SLAPI_LOG_REPL, windows_repl_plugin_name, + slapi_log_err(SLAPI_LOG_REPL, windows_repl_plugin_name, "windows_create_remote_entry - %s - " "Trimming initials attribute to %d characters.\n", agmt_get_long_name(prp->agmt), AD_INITIALS_LENGTH); @@ -2211,7 +2211,7 @@ windows_create_remote_entry(Private_Repl_Protocol *prp,Slapi_Entry *original_ent if (LDAP_INVALID_CREDENTIALS == rc) { /* This password is stored in a non-cleartext format. * We can only sync cleartext passwords. */ - slapi_log_error(SLAPI_LOG_REPL, windows_repl_plugin_name, + slapi_log_err(SLAPI_LOG_REPL, windows_repl_plugin_name, "windows_create_remote_entry %s - " "Password is already hashed. Not syncing.\n", agmt_get_long_name(prp->agmt)); @@ -2219,7 +2219,7 @@ windows_create_remote_entry(Private_Repl_Protocol *prp,Slapi_Entry *original_ent } if ((rc && (LDAP_INVALID_CREDENTIALS != rc)) || (NULL == password_value)) { - slapi_log_error(SLAPI_LOG_REPL, windows_repl_plugin_name, + slapi_log_err(SLAPI_LOG_REPL, windows_repl_plugin_name, "windows_create_remote_entry - %s - " "Failed to retrieve clear text password. " "Not syncing.\n", @@ -2245,7 +2245,7 @@ windows_create_remote_entry(Private_Repl_Protocol *prp,Slapi_Entry *original_ent if (LDAP_INVALID_CREDENTIALS == rc) { /* This password is stored in a non-cleartext format. * We can only sync cleartext passwords. */ - slapi_log_error(SLAPI_LOG_REPL, windows_repl_plugin_name, + slapi_log_err(SLAPI_LOG_REPL, windows_repl_plugin_name, "windows_create_remote_entry - %s - " "Password is already hashed. Not syncing.\n", agmt_get_long_name(prp->agmt)); @@ -2253,7 +2253,7 @@ windows_create_remote_entry(Private_Repl_Protocol *prp,Slapi_Entry *original_ent slapi_ch_free_string(&password_value); } if ((rc && (LDAP_INVALID_CREDENTIALS != rc)) || (NULL == *password)) { - slapi_log_error(SLAPI_LOG_REPL, windows_repl_plugin_name, + slapi_log_err(SLAPI_LOG_REPL, windows_repl_plugin_name, "windows_create_remote_entry - %s - " "Failed to retrieve clear text password. " "Not syncing.\n", @@ -2286,7 +2286,7 @@ error: { windows_dump_entry("Created new remote entry:\n",new_entry); } - slapi_log_error(SLAPI_LOG_TRACE, windows_repl_plugin_name, "<= windows_create_remote_entry: %d\n", retval); + slapi_log_err(SLAPI_LOG_TRACE, windows_repl_plugin_name, "<= windows_create_remote_entry: %d\n", retval); return retval; } @@ -2301,12 +2301,12 @@ windows_entry_already_exists(Slapi_Entry *e){ Slapi_DN *sdn = NULL; Slapi_Entry *entry = NULL; - slapi_log_error(SLAPI_LOG_TRACE, windows_repl_plugin_name, "=> windows_entry_already_exists\n"); + slapi_log_err(SLAPI_LOG_TRACE, windows_repl_plugin_name, "=> windows_entry_already_exists\n"); sdn = slapi_entry_get_sdn(e); rc = slapi_search_internal_get_entry( sdn, NULL, &entry, repl_get_plugin_identity (PLUGIN_MULTIMASTER_REPLICATION)); - slapi_log_error(SLAPI_LOG_TRACE, windows_repl_plugin_name, "<= windows_entry_already_exists\n"); + slapi_log_err(SLAPI_LOG_TRACE, windows_repl_plugin_name, "<= windows_entry_already_exists\n"); if (rc == LDAP_SUCCESS) { @@ -2326,7 +2326,7 @@ windows_delete_local_entry(Slapi_DN *sdn){ Slapi_PBlock *pb = NULL; int return_value = 0; - slapi_log_error(SLAPI_LOG_TRACE, windows_repl_plugin_name, "=> windows_delete_local_entry\n"); + slapi_log_err(SLAPI_LOG_TRACE, windows_repl_plugin_name, "=> windows_delete_local_entry\n"); pb = slapi_pblock_new(); slapi_delete_internal_set_pb(pb, slapi_sdn_get_dn(sdn), NULL, NULL, repl_get_plugin_identity(PLUGIN_MULTIMASTER_REPLICATION), 0); @@ -2335,10 +2335,10 @@ windows_delete_local_entry(Slapi_DN *sdn){ slapi_pblock_destroy(pb); if (return_value) { - slapi_log_error(SLAPI_LOG_REPL, windows_repl_plugin_name, + slapi_log_err(SLAPI_LOG_REPL, windows_repl_plugin_name, "windows_delete_local_entry - Delete operation on local entry %s returned: %d\n", slapi_sdn_get_dn(sdn), return_value); } - slapi_log_error(SLAPI_LOG_TRACE, windows_repl_plugin_name, "<= windows_delete_local_entry: %d\n", return_value); + slapi_log_err(SLAPI_LOG_TRACE, windows_repl_plugin_name, "<= windows_delete_local_entry: %d\n", return_value); return return_value; } @@ -2363,7 +2363,7 @@ mod_already_made(Private_Repl_Protocol *prp, Slapi_Mod *smod, Slapi_Entry *ad_en const char *type = NULL; if (!slapi_mod_isvalid(smod)) { /* bogus */ - slapi_log_error(SLAPI_LOG_REPL, windows_repl_plugin_name, + slapi_log_err(SLAPI_LOG_REPL, windows_repl_plugin_name, "mod_already_made - %s - " "modify operation is null - skipping.\n", agmt_get_long_name(prp->agmt)); @@ -2371,7 +2371,7 @@ mod_already_made(Private_Repl_Protocol *prp, Slapi_Mod *smod, Slapi_Entry *ad_en } if (!ad_entry) { /* mods cannot already have been made */ - slapi_log_error(SLAPI_LOG_REPL, windows_repl_plugin_name, + slapi_log_err(SLAPI_LOG_REPL, windows_repl_plugin_name, "mod_already_made - %s - " "AD entry not found\n", agmt_get_long_name(prp->agmt)); @@ -2387,7 +2387,7 @@ mod_already_made(Private_Repl_Protocol *prp, Slapi_Mod *smod, Slapi_Entry *ad_en Slapi_Value *sv = slapi_value_new(); slapi_value_init_berval(sv, bv); /* copies bv_val */ if (slapi_entry_attr_has_syntax_value(ad_entry, type, sv)) { - slapi_log_error(SLAPI_LOG_REPL, windows_repl_plugin_name, + slapi_log_err(SLAPI_LOG_REPL, windows_repl_plugin_name, "mod_already_made - %s - " "remote entry attr [%s] already has value [%s] - will not send.\n", agmt_get_long_name(prp->agmt), type, @@ -2398,7 +2398,7 @@ mod_already_made(Private_Repl_Protocol *prp, Slapi_Mod *smod, Slapi_Entry *ad_en } /* if all values were removed, no need to send the mod */ if (slapi_mod_get_num_values(smod) == 0) { - slapi_log_error(SLAPI_LOG_REPL, windows_repl_plugin_name, + slapi_log_err(SLAPI_LOG_REPL, windows_repl_plugin_name, "mod_already_made - %s - " "remote entry attr [%s] had all mod values removed - will not send.\n", agmt_get_long_name(prp->agmt), type); @@ -2409,7 +2409,7 @@ mod_already_made(Private_Repl_Protocol *prp, Slapi_Mod *smod, Slapi_Entry *ad_en /* if attribute does not exist, no need to send the delete */ if (slapi_entry_attr_find(ad_entry, type, &attr) || !attr) { - slapi_log_error(SLAPI_LOG_REPL, windows_repl_plugin_name, + slapi_log_err(SLAPI_LOG_REPL, windows_repl_plugin_name, "mod_already_made - %s - " "remote entry attr [%s] already deleted - will not send.\n", agmt_get_long_name(prp->agmt), type); @@ -2422,7 +2422,7 @@ mod_already_made(Private_Repl_Protocol *prp, Slapi_Mod *smod, Slapi_Entry *ad_en Slapi_Value *sv = slapi_value_new(); slapi_value_init_berval(sv, bv); /* copies bv_val */ if (!slapi_entry_attr_has_syntax_value(ad_entry, type, sv)) { - slapi_log_error(SLAPI_LOG_REPL, windows_repl_plugin_name, + slapi_log_err(SLAPI_LOG_REPL, windows_repl_plugin_name, "mod_already_made - %s - " "remote entry attr [%s] already deleted value [%s] - will not send.\n", agmt_get_long_name(prp->agmt), type, @@ -2433,7 +2433,7 @@ mod_already_made(Private_Repl_Protocol *prp, Slapi_Mod *smod, Slapi_Entry *ad_en } /* if all values were removed, no need to send the mod */ if (slapi_mod_get_num_values(smod) == 0) { - slapi_log_error(SLAPI_LOG_REPL, windows_repl_plugin_name, + slapi_log_err(SLAPI_LOG_REPL, windows_repl_plugin_name, "mod_already_made - %s - " "remote entry attr [%s] had all mod values removed - will not send.\n", agmt_get_long_name(prp->agmt), type); @@ -2441,7 +2441,7 @@ mod_already_made(Private_Repl_Protocol *prp, Slapi_Mod *smod, Slapi_Entry *ad_en } } /* else if no values specified, this means delete the attribute */ } else { /* allow this mod */ - slapi_log_error(SLAPI_LOG_REPL, windows_repl_plugin_name, + slapi_log_err(SLAPI_LOG_REPL, windows_repl_plugin_name, "mod_already_made - %s - " "skipping mod op [%d]\n", agmt_get_long_name(prp->agmt), op); @@ -2489,7 +2489,7 @@ windows_get_superior_change(Private_Repl_Protocol *prp, const subtreePair* lsp = NULL; if (NULL == newsuperior) { - slapi_log_error(SLAPI_LOG_ERR, windows_repl_plugin_name, + slapi_log_err(SLAPI_LOG_ERR, windows_repl_plugin_name, "windows_get_superior_change - newsuperior is NULL\n"); goto bail; } @@ -2508,7 +2508,7 @@ windows_get_superior_change(Private_Repl_Protocol *prp, if ((NULL == remote_subtree || NULL == local_subtree || '\0' == *remote_subtree || '\0' == *local_subtree) && (NULL == subtree_pairs)) { - slapi_log_error(SLAPI_LOG_ERR, windows_repl_plugin_name, + slapi_log_err(SLAPI_LOG_ERR, windows_repl_plugin_name, "windows_get_superior_change - local subtree \"%s\" or " "remote subtree \"%s\" and " "subtree_pairs are empty\n", @@ -2520,7 +2520,7 @@ windows_get_superior_change(Private_Repl_Protocol *prp, local_ndn = slapi_sdn_get_ndn(local_dn); if (NULL == mapped_ndn || NULL == local_ndn || '\0' == *mapped_ndn || '\0' == *local_ndn) { - slapi_log_error(SLAPI_LOG_ERR, windows_repl_plugin_name, + slapi_log_err(SLAPI_LOG_ERR, windows_repl_plugin_name, "windows_get_superior_change - local dn \"%s\" or " "mapped dn \"%s\" is empty\n", local_ndn?local_ndn:"empty", mapped_ndn?mapped_ndn:"empty"); @@ -2530,7 +2530,7 @@ windows_get_superior_change(Private_Repl_Protocol *prp, local_pndn = slapi_dn_parent((const char *)local_ndn); /* strdup'ed */ if (NULL == mapped_pndn || NULL == local_pndn || '\0' == *mapped_pndn || '\0' == *local_pndn) { - slapi_log_error(SLAPI_LOG_ERR, windows_repl_plugin_name, + slapi_log_err(SLAPI_LOG_ERR, windows_repl_plugin_name, "windows_get_superior_change - local parent dn \"%s\" or " "remote parent dn \"%s\" is empty\n", local_pndn?local_pndn:"empty", @@ -2604,12 +2604,12 @@ windows_get_superior_change(Private_Repl_Protocol *prp, rc = 0; } } else { - slapi_log_error(SLAPI_LOG_REPL, windows_repl_plugin_name, + slapi_log_err(SLAPI_LOG_REPL, windows_repl_plugin_name, "windows_get_superior_change - local parent \"%s\" is not in " "DirectoryReplicaSubtree \"%s\"\n", local_pndn, local_subtree); } } else { - slapi_log_error(SLAPI_LOG_REPL, windows_repl_plugin_name, + slapi_log_err(SLAPI_LOG_REPL, windows_repl_plugin_name, "windows_get_superior_change - mapped parent \"%s\" is not in " "DirectoryReplicaSubtree \"%s\"\n", mapped_pndn, local_subtree); } @@ -2634,7 +2634,7 @@ windows_check_mods_for_rdn_change(Private_Repl_Protocol *prp, LDAPMod **original Slapi_Mod *smod = slapi_mod_new(); Slapi_Mod *last_smod = smod; - slapi_log_error(SLAPI_LOG_TRACE, windows_repl_plugin_name, "=> windows_check_mods_for_rdn_change\n"); + slapi_log_err(SLAPI_LOG_TRACE, windows_repl_plugin_name, "=> windows_check_mods_for_rdn_change\n"); /* Iterate through the original mods, looking for a modification to the RDN attribute */ slapi_mods_init_byref(&smods, original_mods); @@ -2786,7 +2786,7 @@ done: } } - slapi_log_error(SLAPI_LOG_TRACE, windows_repl_plugin_name, "<= windows_check_mods_for_rdn_change: %d\n", ret); + slapi_log_err(SLAPI_LOG_TRACE, windows_repl_plugin_name, "<= windows_check_mods_for_rdn_change: %d\n", ret); return ret; } @@ -2809,16 +2809,16 @@ windows_map_mods_for_replay(Private_Repl_Protocol *prp, const Slapi_DN *windows_subtree = NULL; const subtreePair* subtree_pairs = NULL; - slapi_log_error(SLAPI_LOG_TRACE, windows_repl_plugin_name, "=> windows_map_mods_for_replay\n"); + slapi_log_err(SLAPI_LOG_TRACE, windows_repl_plugin_name, "=> windows_map_mods_for_replay\n"); if (NULL == prp) { - slapi_log_error(SLAPI_LOG_TRACE, windows_repl_plugin_name, + slapi_log_err(SLAPI_LOG_TRACE, windows_repl_plugin_name, "<= windows_map_mods_for_replay; NULL protocol; NOOP\n"); return; } windows_subtree = windows_private_get_windows_subtree(prp->agmt); subtree_pairs = windows_private_get_subtreepairs(prp->agmt); if ((NULL == windows_subtree) && (NULL == subtree_pairs)) { - slapi_log_error(SLAPI_LOG_TRACE, windows_repl_plugin_name, + slapi_log_err(SLAPI_LOG_TRACE, windows_repl_plugin_name, "<= windows_map_mods_for_replay; NULL agreement subtree; NOOP\n"); return; } @@ -2873,7 +2873,7 @@ windows_map_mods_for_replay(Private_Repl_Protocol *prp, if (mod->mod_bvalues[i]->bv_len > AD_INITIALS_LENGTH) { mod->mod_bvalues[i]->bv_val[AD_INITIALS_LENGTH] = '\0'; mod->mod_bvalues[i]->bv_len = AD_INITIALS_LENGTH; - slapi_log_error(SLAPI_LOG_REPL, windows_repl_plugin_name, + slapi_log_err(SLAPI_LOG_REPL, windows_repl_plugin_name, "%s: windows_map_mods_for_replay: " "Trimming initials attribute to %d characters.\n", agmt_get_long_name(prp->agmt), AD_INITIALS_LENGTH); @@ -3034,7 +3034,7 @@ windows_map_mods_for_replay(Private_Repl_Protocol *prp, } else { /* This password is stored in a non-cleartext format. * We can only sync cleartext passwords. */ - slapi_log_error(SLAPI_LOG_REPL, windows_repl_plugin_name, + slapi_log_err(SLAPI_LOG_REPL, windows_repl_plugin_name, "windows_map_mods_for_replay - %s - " "Password is already hashed. Not syncing.\n", agmt_get_long_name(prp->agmt)); @@ -3068,7 +3068,7 @@ windows_map_mods_for_replay(Private_Repl_Protocol *prp, slapi_mods_done (&smods); /* Extract the mods for the caller */ *returned_mods = slapi_mods_get_ldapmods_passout(&mapped_smods); - slapi_log_error(SLAPI_LOG_TRACE, windows_repl_plugin_name, "<= windows_map_mods_for_replay\n"); + slapi_log_err(SLAPI_LOG_TRACE, windows_repl_plugin_name, "<= windows_map_mods_for_replay\n"); } @@ -3544,7 +3544,7 @@ map_windows_tombstone_dn(Slapi_Entry *e, Slapi_DN **dn, Private_Repl_Protocol *p /* Initialize the output values */ if ((NULL == dn) || (NULL == exists)) { - slapi_log_error(SLAPI_LOG_REPL, windows_repl_plugin_name, + slapi_log_err(SLAPI_LOG_REPL, windows_repl_plugin_name, "map_windows_tombstone_dn - %s - arg dn or exists is NULL.\n", agmt_get_long_name(prp->agmt)); return 1; @@ -3586,7 +3586,7 @@ map_windows_tombstone_dn(Slapi_Entry *e, Slapi_DN **dn, Private_Repl_Protocol *p slapi_entry_free(tombstone); } } else { - slapi_log_error(SLAPI_LOG_REPL, windows_repl_plugin_name, + slapi_log_err(SLAPI_LOG_REPL, windows_repl_plugin_name, "map_windows_tombstone_dn - %s - Failed to map dn=\"%s\" " "to windows tombstone dn.\n", agmt_get_long_name(prp->agmt), slapi_entry_get_dn(e)); @@ -3755,7 +3755,7 @@ map_entry_dn_outbound(Slapi_Entry *e, Slapi_Entry *remote_entry = NULL; if (NULL == e) { - slapi_log_error(SLAPI_LOG_REPL, windows_repl_plugin_name, + slapi_log_err(SLAPI_LOG_REPL, windows_repl_plugin_name, "map_entry_dn_outbound - %s - NULL entry.\n", agmt_get_long_name(prp->agmt)); return -1; @@ -3771,7 +3771,7 @@ map_entry_dn_outbound(Slapi_Entry *e, * check here. Note: for NT4 we always use ntUserDomainId for the samaccountname rdn, never cn. */ if ((NULL == dn) || (NULL == missing_entry)) { - slapi_log_error(SLAPI_LOG_REPL, windows_repl_plugin_name, + slapi_log_err(SLAPI_LOG_REPL, windows_repl_plugin_name, "map_entry_dn_outbound - %s - arg dn or missing_entry is NULL.\n", agmt_get_long_name(prp->agmt)); return -1; @@ -3792,14 +3792,14 @@ map_entry_dn_outbound(Slapi_Entry *e, suffix = slapi_sdn_get_dn(windows_private_get_windows_subtree(prp->agmt)); } if (NULL == suffix) { - slapi_log_error(SLAPI_LOG_REPL, windows_repl_plugin_name, + slapi_log_err(SLAPI_LOG_REPL, windows_repl_plugin_name, "map_entry_dn_outbound - %s - Failed to get the AD suffix of %s.\n", agmt_get_long_name(prp->agmt), slapi_sdn_get_dn(local_sdn)); return -1; } guid = slapi_entry_attr_get_charptr(e,"ntUniqueId"); - slapi_log_error(SLAPI_LOG_REPL, windows_repl_plugin_name, + slapi_log_err(SLAPI_LOG_REPL, windows_repl_plugin_name, "map_entry_dn_outbound - %s - Looking for AD entry for DS " "dn=\"%s\" guid=\"%s\"\n", agmt_get_long_name(prp->agmt), @@ -3810,7 +3810,7 @@ map_entry_dn_outbound(Slapi_Entry *e, int rc = 0; new_dn = make_dn_from_guid(guid, is_nt4, suffix); if (!new_dn) { - slapi_log_error(SLAPI_LOG_REPL, windows_repl_plugin_name, + slapi_log_err(SLAPI_LOG_REPL, windows_repl_plugin_name, "map_entry_dn_outbound - %s - unable to make dn from guid %s.\n", agmt_get_long_name(prp->agmt), guid); retval = -1; @@ -3821,7 +3821,7 @@ map_entry_dn_outbound(Slapi_Entry *e, * without removing the ntUniqueID attribute. We should verify that the entry really * exists in AD. */ rc = windows_get_remote_entry(prp, new_dn, &remote_entry); - slapi_log_error(SLAPI_LOG_REPL, windows_repl_plugin_name, + slapi_log_err(SLAPI_LOG_REPL, windows_repl_plugin_name, "map_entry_dn_outbound - %s - Return code %d from search " "for AD entry dn=\"%s\" or dn=\"%s\"\n", agmt_get_long_name(prp->agmt), rc, @@ -3836,7 +3836,7 @@ map_entry_dn_outbound(Slapi_Entry *e, retval = -1; } } else { - slapi_log_error(SLAPI_LOG_REPL, windows_repl_plugin_name, + slapi_log_err(SLAPI_LOG_REPL, windows_repl_plugin_name, "map_entry_dn_outbound - %s - entry not found - rc %d\n", agmt_get_long_name(prp->agmt), rc); /* We need to re-write the DN to a non-GUID DN if we're syncing to a @@ -3879,7 +3879,7 @@ map_entry_dn_outbound(Slapi_Entry *e, } else { /* No GUID found, try ntUserDomainId */ char *username = slapi_entry_attr_get_charptr(e,"ntUserDomainId"); - slapi_log_error(SLAPI_LOG_REPL, windows_repl_plugin_name, + slapi_log_err(SLAPI_LOG_REPL, windows_repl_plugin_name, "map_entry_dn_outbound - %s - Looking for AD entry for DS " "dn=\"%s\" username=\"%s\"\n", agmt_get_long_name(prp->agmt), @@ -3892,12 +3892,12 @@ map_entry_dn_outbound(Slapi_Entry *e, /* Get the entry's DN */ new_dn = slapi_sdn_new(); slapi_sdn_copy(slapi_entry_get_sdn_const(remote_entry), new_dn); - slapi_log_error(SLAPI_LOG_REPL, windows_repl_plugin_name, + slapi_log_err(SLAPI_LOG_REPL, windows_repl_plugin_name, "map_entry_dn_outbound - %s - found AD entry dn=\"%s\"\n", agmt_get_long_name(prp->agmt), slapi_sdn_get_dn(new_dn)); } else { - slapi_log_error(SLAPI_LOG_REPL, windows_repl_plugin_name, + slapi_log_err(SLAPI_LOG_REPL, windows_repl_plugin_name, "map_entry_dn_outbound - %s - entry not found - rc %d\n", agmt_get_long_name(prp->agmt), retval); if (0 == retval) @@ -3949,7 +3949,7 @@ map_entry_dn_outbound(Slapi_Entry *e, } else { /* This means that we failed to talk to the AD for some reason, the operation should be re-tried */ - slapi_log_error(SLAPI_LOG_ERR, windows_repl_plugin_name, + slapi_log_err(SLAPI_LOG_ERR, windows_repl_plugin_name, "map_entry_dn_outbound - %s - Failed to fetch entry from AD: dn=\"%s\", err=%d\n", agmt_get_long_name(prp->agmt), slapi_sdn_get_dn(slapi_entry_get_sdn_const(e)), retval); @@ -3995,7 +3995,7 @@ map_tombstone_dn_inbound(Slapi_Entry *e, Slapi_DN **dn, const Repl_Agmt *ra) DEL:d4ca4e16-e35b-400d-834a-f02db600f3fa,CN=Deleted Objects,DC=magpie,DC=com */ if (NULL == dn) { - slapi_log_error(SLAPI_LOG_REPL, windows_repl_plugin_name, + slapi_log_err(SLAPI_LOG_REPL, windows_repl_plugin_name, "map_tombstone_dn_inbound - %s - arg dn is NULL.\n", agmt_get_long_name(ra)); return -1; @@ -4071,7 +4071,7 @@ map_entry_dn_inbound_ext(Slapi_Entry *e, Slapi_DN **dn, const Repl_Agmt *ra, int char *container_str = NULL; if (NULL == e) { - slapi_log_error(SLAPI_LOG_REPL, windows_repl_plugin_name, + slapi_log_err(SLAPI_LOG_REPL, windows_repl_plugin_name, "map_entry_dn_inbound - %s - entry is NULL.\n", agmt_get_long_name(ra)); return -1; @@ -4081,7 +4081,7 @@ map_entry_dn_inbound_ext(Slapi_Entry *e, Slapi_DN **dn, const Repl_Agmt *ra, int * If we do not find it, then we need to generate the DN that it would have if added as a new entry. */ if (NULL == dn) { - slapi_log_error(SLAPI_LOG_REPL, windows_repl_plugin_name, + slapi_log_err(SLAPI_LOG_REPL, windows_repl_plugin_name, "map_entry_dn_inbound - %s - arg dn is NULL.\n", agmt_get_long_name(ra)); return -1; @@ -4090,7 +4090,7 @@ map_entry_dn_inbound_ext(Slapi_Entry *e, Slapi_DN **dn, const Repl_Agmt *ra, int windows_is_remote_entry_user_or_group(e,&is_user,&is_group); - slapi_log_error(SLAPI_LOG_REPL, windows_repl_plugin_name, + slapi_log_err(SLAPI_LOG_REPL, windows_repl_plugin_name, "map_entry_dn_inbound - %s - Looking for local entry " "matching AD entry [%s]\n", agmt_get_long_name(ra), @@ -4099,7 +4099,7 @@ map_entry_dn_inbound_ext(Slapi_Entry *e, Slapi_DN **dn, const Repl_Agmt *ra, int guid = extract_guid_from_entry(e, is_nt4); if (guid) { - slapi_log_error(SLAPI_LOG_REPL, windows_repl_plugin_name, + slapi_log_err(SLAPI_LOG_REPL, windows_repl_plugin_name, "map_entry_dn_inbound - %s - Looking for local entry " "by guid [%s]\n", agmt_get_long_name(ra), @@ -4107,7 +4107,7 @@ map_entry_dn_inbound_ext(Slapi_Entry *e, Slapi_DN **dn, const Repl_Agmt *ra, int retval = find_entry_by_guid(guid,&matching_entry,ra); if (retval) { - slapi_log_error(SLAPI_LOG_REPL, windows_repl_plugin_name, + slapi_log_err(SLAPI_LOG_REPL, windows_repl_plugin_name, "map_entry_dn_inbound - %s - Problem looking for guid: %d\n", agmt_get_long_name(ra), retval); if (ENTRY_NOTFOUND == retval) @@ -4126,7 +4126,7 @@ map_entry_dn_inbound_ext(Slapi_Entry *e, Slapi_DN **dn, const Repl_Agmt *ra, int { /* We found the matching entry : get its DN */ new_dn = slapi_sdn_dup(slapi_entry_get_sdn_const(matching_entry)); - slapi_log_error(SLAPI_LOG_REPL, windows_repl_plugin_name, + slapi_log_err(SLAPI_LOG_REPL, windows_repl_plugin_name, "map_entry_dn_inbound - %s- found local entry [%s]\n", agmt_get_long_name(ra), slapi_sdn_get_dn(new_dn)); @@ -4134,7 +4134,7 @@ map_entry_dn_inbound_ext(Slapi_Entry *e, Slapi_DN **dn, const Repl_Agmt *ra, int } else { - slapi_log_error(SLAPI_LOG_REPL, windows_repl_plugin_name, + slapi_log_err(SLAPI_LOG_REPL, windows_repl_plugin_name, "map_entry_dn_inbound - %s - AD entry has no guid!\n", agmt_get_long_name(ra)); } @@ -4146,7 +4146,7 @@ map_entry_dn_inbound_ext(Slapi_Entry *e, Slapi_DN **dn, const Repl_Agmt *ra, int username = extract_username_from_entry(e); if (use_username) { if (username) { - slapi_log_error(SLAPI_LOG_REPL, windows_repl_plugin_name, + slapi_log_err(SLAPI_LOG_REPL, windows_repl_plugin_name, "map_entry_dn_inbound - %s - Looking for local entry " "by uid [%s]\n", agmt_get_long_name(ra), @@ -4154,7 +4154,7 @@ map_entry_dn_inbound_ext(Slapi_Entry *e, Slapi_DN **dn, const Repl_Agmt *ra, int retval = find_entry_by_username(username,&matching_entry,ra); if (retval) { - slapi_log_error(SLAPI_LOG_REPL, windows_repl_plugin_name, + slapi_log_err(SLAPI_LOG_REPL, windows_repl_plugin_name, "map_entry_dn_inbound - %s - problem looking for username: %d\n", agmt_get_long_name(ra), retval); if (ENTRY_NOTFOUND == retval) @@ -4173,7 +4173,7 @@ map_entry_dn_inbound_ext(Slapi_Entry *e, Slapi_DN **dn, const Repl_Agmt *ra, int { /* We found the matching entry : get its DN */ new_dn = slapi_sdn_dup(slapi_entry_get_sdn_const(matching_entry)); - slapi_log_error(SLAPI_LOG_REPL, windows_repl_plugin_name, + slapi_log_err(SLAPI_LOG_REPL, windows_repl_plugin_name, "map_entry_dn_inbound - %s - found local entry by name [%s]\n", agmt_get_long_name(ra), slapi_sdn_get_dn(new_dn)); @@ -4181,7 +4181,7 @@ map_entry_dn_inbound_ext(Slapi_Entry *e, Slapi_DN **dn, const Repl_Agmt *ra, int } else { - slapi_log_error(SLAPI_LOG_REPL, windows_repl_plugin_name, + slapi_log_err(SLAPI_LOG_REPL, windows_repl_plugin_name, "map_entry_dn_inbound - %s - AD entry has no username!\n", agmt_get_long_name(ra)); } @@ -4216,7 +4216,7 @@ map_entry_dn_inbound_ext(Slapi_Entry *e, Slapi_DN **dn, const Repl_Agmt *ra, int suffix = slapi_sdn_get_dn(windows_private_get_directory_subtree(ra)); } if (NULL == suffix) { - slapi_log_error(SLAPI_LOG_REPL, windows_repl_plugin_name, + slapi_log_err(SLAPI_LOG_REPL, windows_repl_plugin_name, "map_entry_dn_inbound - %s - Failed to retrieve local suffix from %s\n", agmt_get_long_name(ra), slapi_sdn_get_dn(remote_sdn)); goto error; @@ -4295,7 +4295,7 @@ is_subject_of_agreement_local(const Slapi_Entry *local_entry, const Repl_Agmt *r if (!local_entry) { /* Error: couldn't find the entry */ - slapi_log_error(SLAPI_LOG_ERR, windows_repl_plugin_name, + slapi_log_err(SLAPI_LOG_ERR, windows_repl_plugin_name, "is_subject_of_agreement_local - Failed to find local entry\n"); goto error; } @@ -4479,7 +4479,7 @@ windows_create_local_entry(Private_Repl_Protocol *prp,Slapi_Entry *remote_entry, "ntGroupDeleteGroup:true\n" "cn:%s\n"; - slapi_log_error(SLAPI_LOG_TRACE, windows_repl_plugin_name, "=> windows_create_local_entry\n"); + slapi_log_err(SLAPI_LOG_TRACE, windows_repl_plugin_name, "=> windows_create_local_entry\n"); windows_is_remote_entry_user_or_group(remote_entry,&is_user,&is_group); user_entry_template = is_nt4 ? local_nt4_user_entry_template : local_user_entry_template; @@ -4549,7 +4549,7 @@ windows_create_local_entry(Private_Repl_Protocol *prp,Slapi_Entry *remote_entry, slapi_entry_add_string(local_entry,"ntUniqueId",guid_str); } else { - slapi_log_error(SLAPI_LOG_REPL, windows_repl_plugin_name, + slapi_log_err(SLAPI_LOG_REPL, windows_repl_plugin_name, "windows_create_local_entry - Extract_guid_from_entry entry %s failed to extract the guid\n", slapi_sdn_get_dn(local_sdn)); /* Fatal error : need the guid */ goto error; @@ -4592,7 +4592,7 @@ windows_create_local_entry(Private_Repl_Protocol *prp,Slapi_Entry *remote_entry, slapi_entry_free(post_entry); if (retval) { - slapi_log_error(SLAPI_LOG_REPL, windows_repl_plugin_name, + slapi_log_err(SLAPI_LOG_REPL, windows_repl_plugin_name, "windows_create_local_entry - add operation of entry %s returned: %d\n", slapi_sdn_get_dn(local_sdn), retval); } @@ -4607,7 +4607,7 @@ error: { slapi_ch_free_string(&username); } - slapi_log_error(SLAPI_LOG_TRACE, windows_repl_plugin_name, "<= windows_create_local_entry\n"); + slapi_log_err(SLAPI_LOG_TRACE, windows_repl_plugin_name, "<= windows_create_local_entry\n"); return retval; } @@ -4677,12 +4677,12 @@ windows_generate_update_mods(Private_Repl_Protocol *prp, Slapi_Entry *target_entry = NULL; /* Iterate over the attributes on the remote entry, updating the local entry where appropriate */ - LDAPDebug(LDAP_DEBUG_TRACE, "=> windows_generate_update_mods\n", 0, 0, 0 ); + slapi_log_err(SLAPI_LOG_TRACE, windows_repl_plugin_name, "=> windows_generate_update_mods\n"); *do_modify = 0; if (!remote_entry || !local_entry) { - slapi_log_error(SLAPI_LOG_REPL, windows_repl_plugin_name, + slapi_log_err(SLAPI_LOG_REPL, windows_repl_plugin_name, "windows_generate_update_mods - %s - remote_entry is [%s] local_entry is [%s] " "cannot generate update mods\n", agmt_get_long_name(prp->agmt), remote_entry ? slapi_entry_get_dn_const(remote_entry) : "NULL", @@ -4782,7 +4782,7 @@ windows_generate_update_mods(Private_Repl_Protocol *prp, /* If it is then we need to replace the local values with the remote values if they are different */ if (!values_equal) { - slapi_log_error(SLAPI_LOG_REPL, windows_repl_plugin_name, + slapi_log_err(SLAPI_LOG_REPL, windows_repl_plugin_name, "windows_generate_update_mods - %s, %s : values are different\n", slapi_entry_get_dn_const(local_entry), local_type); @@ -4824,7 +4824,7 @@ windows_generate_update_mods(Private_Repl_Protocol *prp, char *new_initials = PL_strndup(initials_value, AD_INITIALS_LENGTH); /* the below hands off memory */ slapi_value_set_string_passin(value, new_initials); - slapi_log_error(SLAPI_LOG_REPL, windows_repl_plugin_name, + slapi_log_err(SLAPI_LOG_REPL, windows_repl_plugin_name, "windows_generate_update_mods - %s - " "Trimming initials attribute to %d characters.\n", agmt_get_long_name(prp->agmt), AD_INITIALS_LENGTH); @@ -4839,7 +4839,7 @@ windows_generate_update_mods(Private_Repl_Protocol *prp, *do_modify = 1; } else { - slapi_log_error(SLAPI_LOG_REPL, windows_repl_plugin_name, + slapi_log_err(SLAPI_LOG_REPL, windows_repl_plugin_name, "windows_generate_update_mods - %s, %s : values are equal\n", slapi_entry_get_dn_const(local_entry), local_type); } @@ -4871,7 +4871,7 @@ windows_generate_update_mods(Private_Repl_Protocol *prp, windows_generate_dn_value_mods(local_type, local_attr, smods, mapped_remote_values, local_values,do_modify); - slapi_log_error(SLAPI_LOG_REPL, windows_repl_plugin_name, + slapi_log_err(SLAPI_LOG_REPL, windows_repl_plugin_name, "windows_generate_update_mods - no restricted local values found for " "local attribute %s in local entry %s for remote attribute " "%s in remote entry %s\n", @@ -4883,7 +4883,7 @@ windows_generate_update_mods(Private_Repl_Protocol *prp, } else { windows_generate_dn_value_mods(local_type, local_attr, smods, mapped_remote_values, NULL, do_modify); - slapi_log_error(SLAPI_LOG_REPL, windows_repl_plugin_name, + slapi_log_err(SLAPI_LOG_REPL, windows_repl_plugin_name, "windows_generate_update_mods - no local values found for " "local attribute %s in local entry %s for remote attribute " "%s in remote entry %s\n", @@ -4899,7 +4899,7 @@ windows_generate_update_mods(Private_Repl_Protocol *prp, windows_generate_dn_value_mods(local_type, local_attr, smods, NULL, local_values, do_modify); } else { - slapi_log_error(SLAPI_LOG_REPL, windows_repl_plugin_name, + slapi_log_err(SLAPI_LOG_REPL, windows_repl_plugin_name, "windows_generate_update_mods - could not map the values in " "local attribute %s in local entry %s for remote attribute " "%s in remote entry %s\n", @@ -4916,7 +4916,7 @@ windows_generate_update_mods(Private_Repl_Protocol *prp, { /* !is_present_local || is_guid */ if (!is_present_local) { - slapi_log_error(SLAPI_LOG_REPL, windows_repl_plugin_name, + slapi_log_err(SLAPI_LOG_REPL, windows_repl_plugin_name, "windows_generate_update_mods - %s, %s : values not present on peer entry\n", slapi_sdn_get_dn(slapi_entry_get_sdn_const(local_entry)), local_type); /* If it is currently absent, then we add the value from the remote entry */ if (is_guid) @@ -4981,7 +4981,7 @@ windows_generate_update_mods(Private_Repl_Protocol *prp, char *new_initials = PL_strndup(initials_value, AD_INITIALS_LENGTH); /* the below hands off memory */ slapi_value_set_string_passin(value, new_initials); - slapi_log_error(SLAPI_LOG_REPL, windows_repl_plugin_name, + slapi_log_err(SLAPI_LOG_REPL, windows_repl_plugin_name, "windows_generate_update_mods - %s - " "Trimming initials attribute to %d characters.\n", agmt_get_long_name(prp->agmt), AD_INITIALS_LENGTH); @@ -5047,7 +5047,7 @@ windows_generate_update_mods(Private_Repl_Protocol *prp, slapi_entry_attr_find(local_entry, local_type, &local_attr); if (local_attr) { Slapi_Mod *mysmod = NULL; - slapi_log_error(SLAPI_LOG_REPL, windows_repl_plugin_name, + slapi_log_err(SLAPI_LOG_REPL, windows_repl_plugin_name, "windows_generate_update_mods - Deleting %s attribute from local entry\n", local_type); /* Delete this attr from the local entry */ /* if type is dn and the dn is out of winsync scope, keep them. @@ -5150,7 +5150,7 @@ windows_generate_update_mods(Private_Repl_Protocol *prp, slapi_mods_dump(smods,"windows sync"); } bail: - slapi_log_error(SLAPI_LOG_TRACE, windows_repl_plugin_name, "<= windows_generate_update_mods: %d\n", retval); + slapi_log_err(SLAPI_LOG_TRACE, windows_repl_plugin_name, "<= windows_generate_update_mods: %d\n", retval); return retval; } @@ -5169,7 +5169,7 @@ windows_update_remote_entry(Private_Repl_Protocol *prp,Slapi_Entry *remote_entry if (0 == retval && do_modify) { const char *dn = slapi_sdn_get_dn(slapi_entry_get_sdn_const(remote_entry)); - slapi_log_error(SLAPI_LOG_REPL, windows_repl_plugin_name, + slapi_log_err(SLAPI_LOG_REPL, windows_repl_plugin_name, "windows_update_remote_entry - modifying entry %s\n", dn); retval = windows_conn_send_modify(prp->conn, slapi_sdn_get_dn(slapi_entry_get_sdn_const(remote_entry)),slapi_mods_get_ldapmods_byref(&smods), NULL,NULL); @@ -5203,7 +5203,7 @@ windows_update_remote_entry(Private_Repl_Protocol *prp,Slapi_Entry *remote_entry } else { const char *dn = slapi_sdn_get_dn(slapi_entry_get_sdn_const(remote_entry)); - slapi_log_error(SLAPI_LOG_REPL, windows_repl_plugin_name, + slapi_log_err(SLAPI_LOG_REPL, windows_repl_plugin_name, "windows_update_remote_entry - no mods generated for remote entry: %s\n", dn); } @@ -5244,7 +5244,7 @@ windows_update_local_entry(Private_Repl_Protocol *prp,Slapi_Entry *remote_entry, * if we were creating a new entry. */ retval = map_entry_dn_inbound_ext(remote_entry, &mapped_sdn, prp->agmt, 0 /* use_guid */, 0 /* use_username */); if (retval || (NULL == mapped_sdn)) { - slapi_log_error(SLAPI_LOG_REPL, windows_repl_plugin_name, + slapi_log_err(SLAPI_LOG_REPL, windows_repl_plugin_name, "windows_update_local_entry - Unable to map remote entry to local DN\n"); return retval; } @@ -5277,7 +5277,7 @@ windows_update_local_entry(Private_Repl_Protocol *prp,Slapi_Entry *remote_entry, } /* rename entry */ - slapi_log_error(SLAPI_LOG_REPL, windows_repl_plugin_name, "windows_update_local_entry - " + slapi_log_err(SLAPI_LOG_REPL, windows_repl_plugin_name, "windows_update_local_entry - " "renaming entry \"%s\" - (newrdn: \"%s\", newsuperior: \"%s\"\n", newdn, newrdn ? newrdn:"NULL", newsuperior ? newsuperior:"NULL"); slapi_sdn_init_ndn_byref(&newsuperior_sdn, newsuperior); @@ -5291,7 +5291,7 @@ windows_update_local_entry(Private_Repl_Protocol *prp,Slapi_Entry *remote_entry, slapi_sdn_done(&newsuperior_sdn); slapi_pblock_destroy (pb); if (LDAP_SUCCESS != retval) { - slapi_log_error(SLAPI_LOG_ERR, windows_repl_plugin_name, + slapi_log_err(SLAPI_LOG_ERR, windows_repl_plugin_name, "windows_update_local_entry - Failed to rename entry (\"%s\"); LDAP error - %d " "(newrdn: \"%s\", newsuperior: \"%s\"\n", newdn, retval, newrdn ? newrdn:"NULL", newsuperior ? newsuperior:"NULL"); @@ -5308,7 +5308,7 @@ windows_update_local_entry(Private_Repl_Protocol *prp,Slapi_Entry *remote_entry, orig_local_entry = local_entry; retval = windows_get_local_entry(mapped_sdn, &local_entry); if (retval != 0) { - slapi_log_error(SLAPI_LOG_ERR, windows_repl_plugin_name, + slapi_log_err(SLAPI_LOG_ERR, windows_repl_plugin_name, "windows_update_local_entry - Failed to get local entry \"%s\" after rename\n", slapi_sdn_get_ndn(mapped_sdn)); local_entry = orig_local_entry; @@ -5321,7 +5321,7 @@ windows_update_local_entry(Private_Repl_Protocol *prp,Slapi_Entry *remote_entry, * We need to update the local groups manually... */ local_subtree = agmt_get_replarea(prp->agmt); if (!local_subtree) { - slapi_log_error(SLAPI_LOG_ERR, windows_repl_plugin_name, + slapi_log_err(SLAPI_LOG_ERR, windows_repl_plugin_name, "windows_update_local_entry - Failed to get local subtree from agreement\n"); local_entry = orig_local_entry; orig_local_entry = NULL; @@ -5405,7 +5405,7 @@ windows_update_local_entry(Private_Repl_Protocol *prp,Slapi_Entry *remote_entry, slapi_modify_internal_pb(mod_pb); slapi_pblock_get(pb, SLAPI_PLUGIN_INTOP_RESULT, &retval); if (retval) { - slapi_log_error(SLAPI_LOG_ERR, windows_repl_plugin_name, + slapi_log_err(SLAPI_LOG_ERR, windows_repl_plugin_name, "windows_update_local_entry - " "Failed to modify entry %s replacing %s with %s " "- error %d:%s\n", @@ -5434,7 +5434,7 @@ windows_update_local_entry(Private_Repl_Protocol *prp,Slapi_Entry *remote_entry, if (pb) { const char *dn = slapi_entry_get_dn_const(local_entry); - slapi_log_error(SLAPI_LOG_REPL, windows_repl_plugin_name, + slapi_log_err(SLAPI_LOG_REPL, windows_repl_plugin_name, "windows_update_local_entry - Modifying entry: %s\n", dn); slapi_modify_internal_set_pb_ext (pb, slapi_entry_get_sdn(local_entry), @@ -5457,21 +5457,21 @@ windows_update_local_entry(Private_Repl_Protocol *prp,Slapi_Entry *remote_entry, } if (rc) { - slapi_log_error(SLAPI_LOG_ERR, windows_repl_plugin_name, + slapi_log_err(SLAPI_LOG_ERR, windows_repl_plugin_name, "windows_update_local_entry - Failed to modify entry %s - error %d:%s\n", dn, rc, ldap_err2string(rc)); } slapi_pblock_destroy(pb); } else { - slapi_log_error(SLAPI_LOG_ERR, windows_repl_plugin_name, + slapi_log_err(SLAPI_LOG_ERR, windows_repl_plugin_name, "windows_update_local_entry - Failed to make pb\n"); } } else { const char *dn = slapi_entry_get_dn_const(local_entry); - slapi_log_error(SLAPI_LOG_REPL, windows_repl_plugin_name, + slapi_log_err(SLAPI_LOG_REPL, windows_repl_plugin_name, "windows_update_local_entry - No mods generated for local entry: %s\n", dn); } @@ -5519,7 +5519,7 @@ windows_process_total_add(Private_Repl_Protocol *prp,Slapi_Entry *e, Slapi_DN* r (void)slapi_entry2mods (mapped_entry , NULL /* &entrydn : We don't need it */, &entryattrs); if (NULL == entryattrs) { - slapi_log_error(SLAPI_LOG_ERR, windows_repl_plugin_name,"windows_process_total_add - %s - " + slapi_log_err(SLAPI_LOG_ERR, windows_repl_plugin_name,"windows_process_total_add - %s - " "Cannot convert entry to LDAPMods.\n",agmt_get_long_name(prp->agmt)); retval = CONN_LOCAL_ERROR; } @@ -5556,7 +5556,7 @@ windows_process_total_add(Private_Repl_Protocol *prp,Slapi_Entry *e, Slapi_DN* r /* It's possible that the entry already exists in AD, in which case we fall back to modify it */ if (retval) { - slapi_log_error(SLAPI_LOG_ERR, windows_repl_plugin_name,"windows_process_total_add - %s - " + slapi_log_err(SLAPI_LOG_ERR, windows_repl_plugin_name,"windows_process_total_add - %s - " "Cannot replay add operation.\n",agmt_get_long_name(prp->agmt)); } ldap_mods_free(entryattrs, 1); @@ -5566,7 +5566,7 @@ windows_process_total_add(Private_Repl_Protocol *prp,Slapi_Entry *e, Slapi_DN* r /* set the account control bits only for users */ retval = send_accountcontrol_modify(remote_dn, prp, missing_entry); if (alreadyexists) { - slapi_log_error(SLAPI_LOG_ERR, windows_repl_plugin_name, + slapi_log_err(SLAPI_LOG_ERR, windows_repl_plugin_name, "windows_process_total_add -%s - " "Creating AD entry \"%s\" from DS entry \"%s\" failed. " "AD reserves the account name. Ignoring the error...\n", @@ -5619,7 +5619,7 @@ int windows_process_total_entry(Private_Repl_Protocol *prp,Slapi_Entry *e) const Slapi_DN *local_dn = slapi_entry_get_sdn_const(e); /* First check if the entry is for us */ is_ours = is_subject_of_agreement_local(e, prp->agmt); - slapi_log_error(SLAPI_LOG_REPL, windows_repl_plugin_name, + slapi_log_err(SLAPI_LOG_REPL, windows_repl_plugin_name, "windows_process_total_entry - %s - Looking dn=\"%s\" (%s)\n", agmt_get_long_name(prp->agmt), slapi_sdn_get_dn(slapi_entry_get_sdn_const(e)), is_ours ? "ours" : "not ours"); if (is_ours) @@ -5627,7 +5627,7 @@ int windows_process_total_entry(Private_Repl_Protocol *prp,Slapi_Entry *e) retval = map_entry_dn_outbound(e,&remote_dn,prp,&missing_entry,0 /* we don't want the GUID */, NULL); if (retval || NULL == remote_dn) { - slapi_log_error(SLAPI_LOG_ERR, windows_repl_plugin_name, + slapi_log_err(SLAPI_LOG_ERR, windows_repl_plugin_name, "windows_process_total_entry - %s - Failed map dn for total update dn=\"%s\"\n", agmt_get_long_name(prp->agmt), slapi_sdn_get_dn(local_dn)); goto error; @@ -5662,7 +5662,7 @@ windows_search_local_entry_by_uniqueid(Private_Repl_Protocol *prp, if (is_global) { /* Search from the suffix (rename case) */ local_subtree = agmt_get_replarea(prp->agmt); if (!local_subtree) { - slapi_log_error(SLAPI_LOG_ERR, windows_repl_plugin_name, + slapi_log_err(SLAPI_LOG_ERR, windows_repl_plugin_name, "windows_search_local_entry_by_uniqueid - " "Failed to get local subtree from agreement\n"); return LDAP_PARAM_ERROR; @@ -5786,7 +5786,7 @@ windows_unsync_entry(Private_Repl_Protocol *prp, Slapi_Entry *e) goto done; /* nothing to see here, move along */ } slapi_mods_add_mod_values(smods, LDAP_MOD_DELETE, "objectclass", va); - slapi_log_error(SLAPI_LOG_REPL, windows_repl_plugin_name, + slapi_log_err(SLAPI_LOG_REPL, windows_repl_plugin_name, "windows_unsync_entry - %s - Removing objectclass %s from %s\n", agmt_get_long_name(prp->agmt), slapi_value_get_string(va[0]), slapi_entry_get_dn_const(e)); @@ -5798,7 +5798,7 @@ windows_unsync_entry(Private_Repl_Protocol *prp, Slapi_Entry *e) if (!slapi_entry_attr_find(e, type, &attr) && attr) { if (!PL_strncasecmp(type, "nt", 2)) { /* begins with "nt" */ slapi_mods_add_mod_values(smods, LDAP_MOD_DELETE, type, NULL); - slapi_log_error(SLAPI_LOG_REPL, windows_repl_plugin_name, + slapi_log_err(SLAPI_LOG_REPL, windows_repl_plugin_name, "windows_unsync_entry - %s - Removing attribute %s from %s\n", agmt_get_long_name(prp->agmt), type, slapi_entry_get_dn_const(e)); @@ -5810,7 +5810,7 @@ windows_unsync_entry(Private_Repl_Protocol *prp, Slapi_Entry *e) if (!pb) { goto done; } - slapi_log_error(SLAPI_LOG_REPL, windows_repl_plugin_name, + slapi_log_err(SLAPI_LOG_REPL, windows_repl_plugin_name, "windows_unsync_entry - %s - Modifying entry %s\n", agmt_get_long_name(prp->agmt), slapi_entry_get_dn_const(e)); slapi_modify_internal_set_pb_ext(pb, slapi_entry_get_sdn(e), @@ -5819,7 +5819,7 @@ windows_unsync_entry(Private_Repl_Protocol *prp, Slapi_Entry *e) slapi_modify_internal_pb(pb); slapi_pblock_get (pb, SLAPI_PLUGIN_INTOP_RESULT, &rc); if (rc) { - slapi_log_error(SLAPI_LOG_ERR, windows_repl_plugin_name, + slapi_log_err(SLAPI_LOG_ERR, windows_repl_plugin_name, "windows_unsync_entry - %s - Failed to modify entry %s - error %d:%s\n", agmt_get_long_name(prp->agmt), slapi_entry_get_dn_const(e), rc, ldap_err2string(rc)); @@ -5856,7 +5856,7 @@ windows_process_dirsync_entry(Private_Repl_Protocol *prp,Slapi_Entry *e, int is_ slapi_sdn_free(&local_sdn); } else { - slapi_log_error(SLAPI_LOG_REPL, windows_repl_plugin_name,"windows_process_dirsync_entry - %s - Failed to map tombstone dn.\n",agmt_get_long_name(prp->agmt)); + slapi_log_err(SLAPI_LOG_REPL, windows_repl_plugin_name,"windows_process_dirsync_entry - %s - Failed to map tombstone dn.\n",agmt_get_long_name(prp->agmt)); } } else { @@ -5905,14 +5905,14 @@ retry: remote_entry = NULL; } else { - slapi_log_error(SLAPI_LOG_ERR, windows_repl_plugin_name, + slapi_log_err(SLAPI_LOG_ERR, windows_repl_plugin_name, "windows_process_dirsync_entry - %s - Failed to fetch inbound entry %s.\n", agmt_get_long_name(prp->agmt), slapi_sdn_get_dn(slapi_entry_get_sdn_const(e))); } slapi_entry_free(local_entry); if (rc) { /* Something bad happened */ - slapi_log_error(SLAPI_LOG_REPL, windows_repl_plugin_name, + slapi_log_err(SLAPI_LOG_REPL, windows_repl_plugin_name, "windows_process_dirsync_entry - %s - Failed to update inbound entry for %s.\n", agmt_get_long_name(prp->agmt), slapi_sdn_get_dn(slapi_entry_get_sdn_const(e))); } @@ -5936,7 +5936,7 @@ retry: windows_create_local_entry(prp, e, local_sdn); } else { - slapi_log_error(SLAPI_LOG_REPL, windows_repl_plugin_name,"windows_process_dirsync_entry - %s -" + slapi_log_err(SLAPI_LOG_REPL, windows_repl_plugin_name,"windows_process_dirsync_entry - %s -" " Not allowed to add entry %s.\n",agmt_get_long_name(prp->agmt), slapi_sdn_get_dn(slapi_entry_get_sdn_const(e))); } @@ -5965,7 +5965,7 @@ retry: } } else { /* We should have been able to map the DN, so this is an error */ - slapi_log_error(SLAPI_LOG_REPL, windows_repl_plugin_name, + slapi_log_err(SLAPI_LOG_REPL, windows_repl_plugin_name, "windows_process_dirsync_entry - %s - Failed to map " "inbound entry %s - rc is %d dn is [%s].\n", agmt_get_long_name(prp->agmt), @@ -5989,7 +5989,7 @@ retry: * part is now moved out of scope of the agreement. */ /* Since map_Entry_dn_oubound returned local_sdn, * the entry is either user or group. */ - slapi_log_error(SLAPI_LOG_REPL, windows_repl_plugin_name, + slapi_log_err(SLAPI_LOG_REPL, windows_repl_plugin_name, "windows_process_dirsync_entry - %s - deleting out of " "scope entry %s\n", agmt_get_long_name(prp->agmt), slapi_sdn_get_dn(local_sdn)); @@ -5997,7 +5997,7 @@ retry: } else if (windows_private_get_move_action(prp->agmt) == MOVE_DOES_UNSYNC) { rc = windows_unsync_entry(prp, local_entry); } else { - slapi_log_error(SLAPI_LOG_REPL, windows_repl_plugin_name, + slapi_log_err(SLAPI_LOG_REPL, windows_repl_plugin_name, "windows_process_dirsync_entry - %s - windows " "inbound entry %s has the same name as local " "entry %s but the windows entry is out of the " @@ -6027,7 +6027,7 @@ windows_dirsync_inc_run(Private_Repl_Protocol *prp) int rc = 0; int done = 0; - slapi_log_error(SLAPI_LOG_TRACE, windows_repl_plugin_name, "=> windows_dirsync_inc_run\n"); + slapi_log_err(SLAPI_LOG_TRACE, windows_repl_plugin_name, "=> windows_dirsync_inc_run\n"); while (!done) { Slapi_Entry *e = NULL; @@ -6035,7 +6035,7 @@ windows_dirsync_inc_run(Private_Repl_Protocol *prp) rc = send_dirsync_search(prp->conn); if (rc != CONN_OPERATION_SUCCESS) { - slapi_log_error(SLAPI_LOG_ERR, windows_repl_plugin_name, + slapi_log_err(SLAPI_LOG_ERR, windows_repl_plugin_name, "windows_dirsync_inc_run - Failed to send dirsync search request: %d\n", rc); goto error; } @@ -6054,6 +6054,6 @@ windows_dirsync_inc_run(Private_Repl_Protocol *prp) } } /* While !done */ error: -slapi_log_error(SLAPI_LOG_TRACE, windows_repl_plugin_name, "<= windows_dirsync_inc_run\n"); +slapi_log_err(SLAPI_LOG_TRACE, windows_repl_plugin_name, "<= windows_dirsync_inc_run\n"); } diff --git a/ldap/servers/plugins/replication/windows_tot_protocol.c b/ldap/servers/plugins/replication/windows_tot_protocol.c index ffdf4a5..6749cb6 100644 --- a/ldap/servers/plugins/replication/windows_tot_protocol.c +++ b/ldap/servers/plugins/replication/windows_tot_protocol.c @@ -126,7 +126,7 @@ windows_tot_run(Private_Repl_Protocol *prp) Object *local_ruv_obj = NULL; int one_way; - slapi_log_error(SLAPI_LOG_TRACE, windows_repl_plugin_name, "=> windows_tot_run\n" ); + slapi_log_err(SLAPI_LOG_TRACE, windows_repl_plugin_name, "=> windows_tot_run\n" ); PR_ASSERT(NULL != prp); @@ -169,7 +169,7 @@ windows_tot_run(Private_Repl_Protocol *prp) agmt_set_update_in_progress(prp->agmt, PR_TRUE); - slapi_log_error(SLAPI_LOG_ERR, windows_repl_plugin_name, "windows_tot_run - Beginning total update of replica " + slapi_log_err(SLAPI_LOG_ERR, windows_repl_plugin_name, "windows_tot_run - Beginning total update of replica " "\"%s\".\n", agmt_get_long_name(prp->agmt)); windows_private_null_dirsync_cookie(prp->agmt); @@ -225,12 +225,12 @@ windows_tot_run(Private_Repl_Protocol *prp) windows_release_replica(prp); if (rc != CONN_OPERATION_SUCCESS) { - slapi_log_error(SLAPI_LOG_REPL, windows_repl_plugin_name, "windows_tot_run - %s - " + slapi_log_err(SLAPI_LOG_REPL, windows_repl_plugin_name, "windows_tot_run - %s - " "failed to obtain data to send to the consumer; LDAP error - %d\n", agmt_get_long_name(prp->agmt), rc); agmt_set_last_init_status(prp->agmt, 0, 0, rc, "Total update aborted"); } else { - slapi_log_error(SLAPI_LOG_ERR, windows_repl_plugin_name, "windows_tot_run - Finished total update of replica " + slapi_log_err(SLAPI_LOG_ERR, windows_repl_plugin_name, "windows_tot_run - Finished total update of replica " "\"%s\". Sent %lu entries.\n", agmt_get_long_name(prp->agmt), cb_data.num_entries); agmt_set_last_init_status(prp->agmt, 0, 0, 0, "Total update succeeded"); /* Now update our consumer RUV for this agreement. @@ -238,7 +238,7 @@ windows_tot_run(Private_Repl_Protocol *prp) */ if (slapi_is_loglevel_set(SLAPI_LOG_REPL)) { - slapi_log_error(SLAPI_LOG_REPL, windows_repl_plugin_name, "windows_tot_run - " + slapi_log_err(SLAPI_LOG_REPL, windows_repl_plugin_name, "windows_tot_run - " "Total update setting consumer RUV:\n"); ruv_dump (starting_ruv, "consumer", NULL); } @@ -271,7 +271,7 @@ done: prp->stopped = 1; ruv_destroy(&ruv); - slapi_log_error(SLAPI_LOG_TRACE, windows_repl_plugin_name, "<= windows_tot_run\n" ); + slapi_log_err(SLAPI_LOG_TRACE, windows_repl_plugin_name, "<= windows_tot_run\n" ); } static int @@ -281,7 +281,7 @@ windows_tot_stop(Private_Repl_Protocol *prp) int seconds = 600; PRIntervalTime start, maxwait, now; - slapi_log_error(SLAPI_LOG_TRACE, windows_repl_plugin_name, "=> windows_tot_stop\n" ); + slapi_log_err(SLAPI_LOG_TRACE, windows_repl_plugin_name, "=> windows_tot_stop\n" ); prp->terminate = 1; maxwait = PR_SecondsToInterval(seconds); @@ -295,7 +295,7 @@ windows_tot_stop(Private_Repl_Protocol *prp) if (!prp->stopped) { /* Isn't listening. Disconnect from the replica. */ - slapi_log_error(SLAPI_LOG_REPL, windows_repl_plugin_name, "windows_tot_stop - " + slapi_log_err(SLAPI_LOG_REPL, windows_repl_plugin_name, "windows_tot_stop - " "Protocol not stopped after waiting for %d seconds " "for agreement %s\n", PR_IntervalToSeconds(now-start), agmt_get_long_name(prp->agmt)); @@ -307,7 +307,7 @@ windows_tot_stop(Private_Repl_Protocol *prp) return_value = 0; } - slapi_log_error(SLAPI_LOG_TRACE, windows_repl_plugin_name, "<= windows_tot_stop\n" ); + slapi_log_err(SLAPI_LOG_TRACE, windows_repl_plugin_name, "<= windows_tot_stop\n" ); return return_value; } @@ -318,8 +318,8 @@ static int windows_tot_status(Private_Repl_Protocol *prp) { int return_value = 0; - slapi_log_error(SLAPI_LOG_TRACE, windows_repl_plugin_name, "=> windows_tot_status\n" ); - slapi_log_error(SLAPI_LOG_TRACE, windows_repl_plugin_name, "<= windows_tot_status\n" ); + slapi_log_err(SLAPI_LOG_TRACE, windows_repl_plugin_name, "=> windows_tot_status\n" ); + slapi_log_err(SLAPI_LOG_TRACE, windows_repl_plugin_name, "<= windows_tot_status\n" ); return return_value; } @@ -328,8 +328,8 @@ windows_tot_status(Private_Repl_Protocol *prp) static void windows_tot_noop(Private_Repl_Protocol *prp) { - slapi_log_error(SLAPI_LOG_TRACE, windows_repl_plugin_name, "=> windows_tot_noop\n" ); - slapi_log_error(SLAPI_LOG_TRACE, windows_repl_plugin_name, "<= windows_tot_noop\n" ); + slapi_log_err(SLAPI_LOG_TRACE, windows_repl_plugin_name, "=> windows_tot_noop\n" ); + slapi_log_err(SLAPI_LOG_TRACE, windows_repl_plugin_name, "<= windows_tot_noop\n" ); /* noop */ } @@ -340,7 +340,7 @@ Windows_Tot_Protocol_new(Repl_Protocol *rp) windows_tot_private *rip = NULL; Private_Repl_Protocol *prp = (Private_Repl_Protocol *)slapi_ch_calloc(1, sizeof(Private_Repl_Protocol)); - slapi_log_error(SLAPI_LOG_TRACE, windows_repl_plugin_name, "=> Windows_Tot_Protocol_new\n" ); + slapi_log_err(SLAPI_LOG_TRACE, windows_repl_plugin_name, "=> Windows_Tot_Protocol_new\n" ); prp->delete = windows_tot_delete; prp->run = windows_tot_run; @@ -369,18 +369,18 @@ Windows_Tot_Protocol_new(Repl_Protocol *rp) rip->rp = rp; prp->private = (void *)rip; prp->replica_acquired = PR_FALSE; - slapi_log_error(SLAPI_LOG_TRACE, windows_repl_plugin_name, "<= Windows_Tot_Protocol_new\n" ); + slapi_log_err(SLAPI_LOG_TRACE, windows_repl_plugin_name, "<= Windows_Tot_Protocol_new\n" ); return prp; loser: windows_tot_delete(&prp); - slapi_log_error(SLAPI_LOG_TRACE, windows_repl_plugin_name, "<= Windows_Tot_Protocol_new - Failed\n" ); + slapi_log_err(SLAPI_LOG_TRACE, windows_repl_plugin_name, "<= Windows_Tot_Protocol_new - Failed\n" ); return NULL; } static void windows_tot_delete(Private_Repl_Protocol **prpp) { - LDAPDebug0Args(LDAP_DEBUG_TRACE, "=> windows_tot_delete\n" ); + slapi_log_err(SLAPI_LOG_TRACE, windows_repl_plugin_name, "=> windows_tot_delete\n" ); /* First, stop the protocol if it isn't already stopped */ if (!(*prpp)->stopped) { @@ -399,16 +399,16 @@ windows_tot_delete(Private_Repl_Protocol **prpp) slapi_ch_free((void **)&(*prpp)->private); slapi_ch_free((void **)prpp); - slapi_log_error(SLAPI_LOG_TRACE, windows_repl_plugin_name, "<= windows_tot_delete\n" ); + slapi_log_err(SLAPI_LOG_TRACE, windows_repl_plugin_name, "<= windows_tot_delete\n" ); } static void get_result (int rc, void *cb_data) { - slapi_log_error(SLAPI_LOG_TRACE, windows_repl_plugin_name, "=> get_result\n" ); + slapi_log_err(SLAPI_LOG_TRACE, windows_repl_plugin_name, "=> get_result\n" ); PR_ASSERT (cb_data); ((callback_data*)cb_data)->rc = rc; - slapi_log_error(SLAPI_LOG_TRACE, windows_repl_plugin_name, "<= get_result\n" ); + slapi_log_err(SLAPI_LOG_TRACE, windows_repl_plugin_name, "<= get_result\n" ); } static @@ -418,7 +418,7 @@ int send_entry (Slapi_Entry *e, void *cb_data) Private_Repl_Protocol *prp; unsigned long *num_entriesp; - slapi_log_error(SLAPI_LOG_TRACE, windows_repl_plugin_name, "=> send_entry\n" ); + slapi_log_err(SLAPI_LOG_TRACE, windows_repl_plugin_name, "=> send_entry\n" ); PR_ASSERT (cb_data); @@ -431,13 +431,13 @@ int send_entry (Slapi_Entry *e, void *cb_data) windows_conn_disconnect(prp->conn); prp->stopped = 1; ((callback_data*)cb_data)->rc = -1; - slapi_log_error(SLAPI_LOG_TRACE, windows_repl_plugin_name, "<= send_entry\n" ); + slapi_log_err(SLAPI_LOG_TRACE, windows_repl_plugin_name, "<= send_entry\n" ); return -1; } /* skip ruv tombstone - not relvant to Active Directory */ if (is_ruv_tombstone_entry (e)) { - slapi_log_error(SLAPI_LOG_TRACE, windows_repl_plugin_name, "<= send_entry\n" ); + slapi_log_err(SLAPI_LOG_TRACE, windows_repl_plugin_name, "<= send_entry\n" ); return 0; } @@ -446,7 +446,7 @@ int send_entry (Slapi_Entry *e, void *cb_data) (*num_entriesp)++; - slapi_log_error(SLAPI_LOG_TRACE, windows_repl_plugin_name, "<= send_entry\n" ); + slapi_log_err(SLAPI_LOG_TRACE, windows_repl_plugin_name, "<= send_entry\n" ); if (CONN_OPERATION_SUCCESS == rc) { return 0; diff --git a/ldap/servers/plugins/retrocl/retrocl.c b/ldap/servers/plugins/retrocl/retrocl.c index 977f29b..32b30c7 100644 --- a/ldap/servers/plugins/retrocl/retrocl.c +++ b/ldap/servers/plugins/retrocl/retrocl.c @@ -111,7 +111,7 @@ retrocl_postop_init( Slapi_PBlock *pb ) slapi_pblock_set( pb, postmod, (void *) retrocl_postop_modify ) != 0 || slapi_pblock_set( pb, postmdn, (void *) retrocl_postop_modrdn ) != 0 ) { - slapi_log_error(SLAPI_LOG_PLUGIN, RETROCL_PLUGIN_NAME, "retrocl_postop_init failed\n" ); + slapi_log_err(SLAPI_LOG_PLUGIN, RETROCL_PLUGIN_NAME, "retrocl_postop_init failed\n" ); rc= -1; } @@ -141,7 +141,7 @@ retrocl_internalpostop_init( Slapi_PBlock *pb ) slapi_pblock_set( pb, SLAPI_PLUGIN_INTERNAL_POST_MODIFY_FN, (void *) retrocl_postop_modify ) != 0 || slapi_pblock_set( pb, SLAPI_PLUGIN_INTERNAL_POST_MODRDN_FN, (void *) retrocl_postop_modrdn ) != 0 ) { - slapi_log_error(SLAPI_LOG_PLUGIN, RETROCL_PLUGIN_NAME, "retrocl_internalpostop_init failed\n" ); + slapi_log_err(SLAPI_LOG_PLUGIN, RETROCL_PLUGIN_NAME, "retrocl_internalpostop_init failed\n" ); rc= -1; } @@ -207,7 +207,7 @@ static int retrocl_select_backend(void) slapi_entry_free(referral); if (err != LDAP_SUCCESS || be == NULL || be == defbackend_get_backend()) { - slapi_log_error(SLAPI_LOG_ERR, RETROCL_PLUGIN_NAME, + slapi_log_err(SLAPI_LOG_ERR, RETROCL_PLUGIN_NAME, "retrocl_select_backend - Mapping tree select failed (%d) %s.\n", err, errbuf); /* could not find the backend for cn=changelog, either because @@ -315,14 +315,14 @@ retrocl_remove_legacy_default_aci(void) slapi_modify_internal_pb(mod_pb); slapi_pblock_get(mod_pb, SLAPI_PLUGIN_INTOP_RESULT, &rc); if(rc == LDAP_SUCCESS){ - slapi_log_error(SLAPI_LOG_NOTICE, RETROCL_PLUGIN_NAME, + slapi_log_err(SLAPI_LOG_NOTICE, RETROCL_PLUGIN_NAME, "retrocl_remove_legacy_default_aci - " "Successfully removed vulnerable legacy default aci \"%s\". " "If the aci removal was not desired please use a different \"acl " "name\" so it is not removed at the next plugin startup.\n", RETROCL_ACL); } else { - slapi_log_error(SLAPI_LOG_ERR, RETROCL_PLUGIN_NAME, + slapi_log_err(SLAPI_LOG_ERR, RETROCL_PLUGIN_NAME, "retrocl_remove_legacy_default_aci - " "Failed to removed vulnerable legacy default aci (%s) error %d\n", RETROCL_ACL, rc); @@ -362,7 +362,7 @@ static int retrocl_start (Slapi_PBlock *pb) rc = retrocl_select_backend(); if (rc != 0) { - LDAPDebug1Arg(LDAP_DEBUG_TRACE, "retrocl_start - Couldnt find backend, not trimming retro changelog (%d).\n",rc); + slapi_log_err(SLAPI_LOG_TRACE, RETROCL_PLUGIN_NAME, "retrocl_start - Couldn't find backend, not trimming retro changelog (%d).\n",rc); return rc; } @@ -372,7 +372,7 @@ static int retrocl_start (Slapi_PBlock *pb) retrocl_init_trimming(); if (slapi_pblock_get(pb, SLAPI_ADD_ENTRY, &e) != 0) { - slapi_log_error(SLAPI_LOG_ERR, RETROCL_PLUGIN_NAME, "retrocl_start - Missing config entry.\n"); + slapi_log_err(SLAPI_LOG_ERR, RETROCL_PLUGIN_NAME, "retrocl_start - Missing config entry.\n"); return -1; } @@ -383,7 +383,7 @@ static int retrocl_start (Slapi_PBlock *pb) for (i = 0;i < num_vals; i++){ if(slapi_dn_syntax_check(pb, values[i], 1)){ /* invalid dn syntax */ - slapi_log_error(SLAPI_LOG_ERR, RETROCL_PLUGIN_NAME, + slapi_log_err(SLAPI_LOG_ERR, RETROCL_PLUGIN_NAME, "retrocl_start - Invalid DN (%s) for exclude suffix.\n", values[i] ); slapi_ch_array_free(values); return -1; @@ -403,7 +403,7 @@ static int retrocl_start (Slapi_PBlock *pb) /* Validate the syntax before we create our DN array */ if(slapi_dn_syntax_check(pb, values[i], 1)){ /* invalid dn syntax */ - slapi_log_error(SLAPI_LOG_ERR, RETROCL_PLUGIN_NAME, + slapi_log_err(SLAPI_LOG_ERR, RETROCL_PLUGIN_NAME, "retrocl_start - Invalid DN (%s) for include suffix.\n", values[i] ); slapi_ch_array_free(values); return -1; @@ -428,7 +428,7 @@ static int retrocl_start (Slapi_PBlock *pb) while(retrocl_excludes[x]){ if(slapi_sdn_compare(retrocl_includes[i], retrocl_excludes[x] ) == 0){ /* we have a conflict */ - slapi_log_error(SLAPI_LOG_ERR, RETROCL_PLUGIN_NAME, + slapi_log_err(SLAPI_LOG_ERR, RETROCL_PLUGIN_NAME, "retrocl_start - Include suffix (%s) is also listed in exclude suffix list\n", slapi_sdn_get_dn(retrocl_includes[i])); return -1; @@ -445,7 +445,7 @@ static int retrocl_start (Slapi_PBlock *pb) while(retrocl_excludes[x]){ if(slapi_sdn_issuffix(retrocl_includes[i], retrocl_excludes[x])){ /* we have a conflict */ - slapi_log_error(SLAPI_LOG_ERR, RETROCL_PLUGIN_NAME, + slapi_log_err(SLAPI_LOG_ERR, RETROCL_PLUGIN_NAME, "retrocl_start - include suffix (%s) is a child of the exclude suffix(%s)\n", slapi_sdn_get_dn(retrocl_includes[i]), slapi_sdn_get_dn(retrocl_excludes[i])); @@ -462,10 +462,10 @@ static int retrocl_start (Slapi_PBlock *pb) int n = 0; int i = 0; - slapi_log_error(SLAPI_LOG_PLUGIN, RETROCL_PLUGIN_NAME, "retrocl_start - nsslapd-attribute:\n"); + slapi_log_err(SLAPI_LOG_PLUGIN, RETROCL_PLUGIN_NAME, "retrocl_start - nsslapd-attribute:\n"); for (n=0; values && values[n]; n++) { - slapi_log_error(SLAPI_LOG_PLUGIN, RETROCL_PLUGIN_NAME, "retrocl_start - %s\n", values[n]); + slapi_log_err(SLAPI_LOG_PLUGIN, RETROCL_PLUGIN_NAME, "retrocl_start - %s\n", values[n]); } retrocl_nattributes = n; @@ -473,7 +473,7 @@ static int retrocl_start (Slapi_PBlock *pb) retrocl_attributes = (char **)slapi_ch_calloc(n, sizeof(char *)); retrocl_aliases = (char **)slapi_ch_calloc(n, sizeof(char *)); - slapi_log_error(SLAPI_LOG_PLUGIN, RETROCL_PLUGIN_NAME, "retrocl_start - Attributes:\n"); + slapi_log_err(SLAPI_LOG_PLUGIN, RETROCL_PLUGIN_NAME, "retrocl_start - Attributes:\n"); for (i=0; i 0UL ); - slapi_log_error(SLAPI_LOG_PLUGIN, RETROCL_PLUGIN_NAME, + slapi_log_err(SLAPI_LOG_PLUGIN, RETROCL_PLUGIN_NAME, "write_replog_db: write change record %lu for dn: \"%s\"\n", changenum, dn ); @@ -224,7 +224,7 @@ write_replog_db( if ( entry == NULL ) continue; uniqueId = slapi_entry_get_uniqueid( entry ); - slapi_log_error(SLAPI_LOG_PLUGIN, RETROCL_PLUGIN_NAME, + slapi_log_err(SLAPI_LOG_PLUGIN, RETROCL_PLUGIN_NAME, "write_replog_db: add %s: \"%s\"\n", attributeAlias, uniqueId ); val.bv_val = (char *)uniqueId; @@ -241,7 +241,7 @@ write_replog_db( slapi_pblock_get( pb, SLAPI_IS_REPLICATED_OPERATION, &isReplicated ); attributeValue = isReplicated ? "TRUE" : "FALSE"; - slapi_log_error(SLAPI_LOG_PLUGIN, RETROCL_PLUGIN_NAME, + slapi_log_err(SLAPI_LOG_PLUGIN, RETROCL_PLUGIN_NAME, "write_replog_db: add %s: \"%s\"\n", attributeAlias, attributeValue ); val.bv_val = attributeValue; @@ -275,7 +275,7 @@ write_replog_db( if ( valueSet == NULL ) continue; - slapi_log_error(SLAPI_LOG_PLUGIN, RETROCL_PLUGIN_NAME, + slapi_log_err(SLAPI_LOG_PLUGIN, RETROCL_PLUGIN_NAME, "write_replog_db: add %s\n", attributeAlias ); slapi_entry_add_valueset( e, attributeAlias, valueSet ); @@ -346,7 +346,7 @@ write_replog_db( break; default: - slapi_log_error(SLAPI_LOG_ERR, RETROCL_PLUGIN_NAME, + slapi_log_err(SLAPI_LOG_ERR, RETROCL_PLUGIN_NAME, "write_replog_db - Unknown LDAP operation type %d.\n", optype ); err = SLAPI_PLUGIN_FAILURE; } @@ -362,7 +362,7 @@ write_replog_db( slapi_pblock_get( newPb, SLAPI_PLUGIN_INTOP_RESULT, &ret ); slapi_pblock_destroy(newPb); if ( 0 != ret ) { - slapi_log_error(SLAPI_LOG_ERR, RETROCL_PLUGIN_NAME, + slapi_log_err(SLAPI_LOG_ERR, RETROCL_PLUGIN_NAME, "write_replog_db - An error occured while adding change " "number %lu, dn = %s: %s. \n", changenum, edn, ldap_err2string( ret )); @@ -373,7 +373,7 @@ write_replog_db( retrocl_commit_changenumber(); } } else { - slapi_log_error(SLAPI_LOG_ERR, RETROCL_PLUGIN_NAME, + slapi_log_err(SLAPI_LOG_ERR, RETROCL_PLUGIN_NAME, "write_replog_db - An error occurred while constructing " "change record number %ld.\n", changenum ); retrocl_release_changenumber(); @@ -589,24 +589,24 @@ int retrocl_postob (Slapi_PBlock *pb, int optype) (void)slapi_pblock_get( pb, SLAPI_BACKEND, &be ); if (be == NULL) { - LDAPDebug0Args(LDAP_DEBUG_ERR, "retrocl_postob - Backend is not set\n"); + slapi_log_err(SLAPI_LOG_ERR, RETROCL_PLUGIN_NAME, "retrocl_postob - Backend is not set\n"); return SLAPI_PLUGIN_FAILURE; } if (slapi_be_logchanges(be) == 0) { - LDAPDebug0Args(LDAP_DEBUG_TRACE, "retrocl_postob - Not applying change if not logging\n"); + slapi_log_err(SLAPI_LOG_TRACE, RETROCL_PLUGIN_NAME, "retrocl_postob - Not applying change if not logging\n"); return SLAPI_PLUGIN_SUCCESS; } if (retrocl_be_changelog == NULL || be == retrocl_be_changelog) { - LDAPDebug0Args(LDAP_DEBUG_TRACE, "retrocl_postob - Not applying change if no/cl be\n"); + slapi_log_err(SLAPI_LOG_TRACE, RETROCL_PLUGIN_NAME, "retrocl_postob - Not applying change if no/cl be\n"); return SLAPI_PLUGIN_SUCCESS; } slapi_pblock_get(pb, SLAPI_RESULT_CODE, &rc); if (rc != LDAP_SUCCESS) { - LDAPDebug1Arg(LDAP_DEBUG_TRACE,"retrocl_postob - Not applying change if op failed %d\n",rc); + slapi_log_err(SLAPI_LOG_TRACE, RETROCL_PLUGIN_NAME, "retrocl_postob - Not applying change if op failed %d\n",rc); /* this could also mean that the changenumber is no longer correct * set a flag to check at next assignment */ @@ -615,7 +615,7 @@ int retrocl_postob (Slapi_PBlock *pb, int optype) } if (slapi_op_abandoned(pb)) { - LDAPDebug0Args(LDAP_DEBUG_PLUGIN,"retrocl_postob - Not applying change if op abandoned\n"); + slapi_log_err(SLAPI_LOG_PLUGIN, RETROCL_PLUGIN_NAME, "retrocl_postob - Not applying change if op abandoned\n"); return SLAPI_PLUGIN_SUCCESS; } @@ -630,12 +630,12 @@ int retrocl_postob (Slapi_PBlock *pb, int optype) slapi_pblock_get( pb, SLAPI_OPERATION, &op ); if (op == NULL) { - LDAPDebug0Args(LDAP_DEBUG_TRACE,"retrocl_postob - Not applying change if no op\n"); + slapi_log_err(SLAPI_LOG_TRACE, RETROCL_PLUGIN_NAME, "retrocl_postob - Not applying change if no op\n"); return SLAPI_PLUGIN_SUCCESS; } if (operation_is_flag_set(op, OP_FLAG_TOMBSTONE_ENTRY)){ - LDAPDebug0Args(LDAP_DEBUG_TRACE,"retrocl_postob - Not applying change for nsTombstone entries\n"); + slapi_log_err(SLAPI_LOG_TRACE, RETROCL_PLUGIN_NAME, "retrocl_postob - Not applying change for nsTombstone entries\n"); return SLAPI_PLUGIN_SUCCESS; } /* @@ -677,7 +677,7 @@ int retrocl_postob (Slapi_PBlock *pb, int optype) if((rc = write_replog_db( pb, optype, dn, log_m, flag, curtime, entry, post_entry, newrdn, modrdn_mods, slapi_sdn_get_dn(newsuperior) ))) { - slapi_log_error(SLAPI_LOG_ERR, "retrocl-plugin", + slapi_log_err(SLAPI_LOG_ERR, RETROCL_PLUGIN_NAME, "retrocl_postob - Operation failure [%d]\n", rc); if(rc < 0){ rc = LDAP_OPERATIONS_ERROR; diff --git a/ldap/servers/plugins/retrocl/retrocl_trim.c b/ldap/servers/plugins/retrocl/retrocl_trim.c index d4e20e4..b2b9de9 100644 --- a/ldap/servers/plugins/retrocl/retrocl_trim.c +++ b/ldap/servers/plugins/retrocl/retrocl_trim.c @@ -90,11 +90,11 @@ delete_changerecord( changeNumber cnum ) slapi_pblock_destroy( pb ); if ( delrc != LDAP_SUCCESS ) { - slapi_log_error(SLAPI_LOG_ERR, RETROCL_PLUGIN_NAME, + slapi_log_err(SLAPI_LOG_ERR, RETROCL_PLUGIN_NAME, "delete_changerecord: could not delete change record %lu (rc: %d)\n", cnum, delrc ); } else { - slapi_log_error(SLAPI_LOG_PLUGIN, RETROCL_PLUGIN_NAME, + slapi_log_err(SLAPI_LOG_PLUGIN, RETROCL_PLUGIN_NAME, "delete_changerecord: deleted changelog entry \"%s\"\n", dnbuf); } slapi_ch_free((void **) &dnbuf ); @@ -116,7 +116,7 @@ handle_getchangetime_result( int err, void *callback_data ) cnum_result_t *crt = callback_data; if ( crt == NULL ) { - slapi_log_error(SLAPI_LOG_ERR, RETROCL_PLUGIN_NAME, + slapi_log_err(SLAPI_LOG_ERR, RETROCL_PLUGIN_NAME, "handle_getchangetime_result: callback_data NULL\n" ); } else { crt->crt_err = err; @@ -140,11 +140,11 @@ handle_getchangetime_search( Slapi_Entry *e, void *callback_data) Slapi_Attr *attr; if (crt == NULL) { - slapi_log_error(SLAPI_LOG_ERR, RETROCL_PLUGIN_NAME, + slapi_log_err(SLAPI_LOG_ERR, RETROCL_PLUGIN_NAME, "handle_getchangetime_search: op->o_handler_data NULL\n"); } else if (crt->crt_nentries > 0) { /* only return the first entry, I guess */ - slapi_log_error(SLAPI_LOG_ERR, RETROCL_PLUGIN_NAME, + slapi_log_err(SLAPI_LOG_ERR, RETROCL_PLUGIN_NAME, "handle_getchangetime_search: multiple entries returned\n"); } else { crt->crt_nentries++; @@ -260,7 +260,7 @@ static int trim_changelog(void) did_delete = 0; first_in_log = retrocl_get_first_changenumber(); if ( 0UL == first_in_log ) { - slapi_log_error(SLAPI_LOG_PLUGIN, RETROCL_PLUGIN_NAME, + slapi_log_err(SLAPI_LOG_PLUGIN, RETROCL_PLUGIN_NAME, "trim_changelog: no changelog records " "to trim\n" ); /* Bail out - we can't do any useful work */ @@ -294,7 +294,7 @@ static int trim_changelog(void) } } } else { - LDAPDebug(LDAP_DEBUG_PLUGIN, "not yet time to trim: %ld < (%d+%d)\n", + slapi_log_err(SLAPI_LOG_PLUGIN, RETROCL_PLUGIN_NAME, "Not yet time to trim: %ld < (%d+%d)\n", now, lt, trim_interval); } PR_Lock( ts.ts_s_trim_mutex ); @@ -302,7 +302,7 @@ static int trim_changelog(void) ts.ts_s_last_trim = now; PR_Unlock( ts.ts_s_trim_mutex ); if ( num_deleted > 0 ) { - slapi_log_error(SLAPI_LOG_PLUGIN, RETROCL_PLUGIN_NAME, + slapi_log_err(SLAPI_LOG_PLUGIN, RETROCL_PLUGIN_NAME, "trim_changelog: removed %d change records\n", num_deleted ); } @@ -348,12 +348,12 @@ void retrocl_housekeeping ( time_t cur_time, void *noarg ) int ldrc; if (retrocl_be_changelog == NULL) { - LDAPDebug0Args(LDAP_DEBUG_TRACE, "retrocl_housekeeping - not housekeeping if no cl be\n"); + slapi_log_err(SLAPI_LOG_TRACE, RETROCL_PLUGIN_NAME, "retrocl_housekeeping - not housekeeping if no cl be\n"); return; } if ( !ts.ts_s_initialized ) { - slapi_log_error(SLAPI_LOG_ERR, RETROCL_PLUGIN_NAME, "retrocl_housekeeping - called before " + slapi_log_err(SLAPI_LOG_ERR, RETROCL_PLUGIN_NAME, "retrocl_housekeeping - called before " "trimming constraints set\n" ); return; } @@ -372,7 +372,7 @@ void retrocl_housekeeping ( time_t cur_time, void *noarg ) * But a client might have deleted it over protocol. */ first_time = retrocl_getchangetime( SLAPI_SEQ_FIRST, &ldrc ); - LDAPDebug(LDAP_DEBUG_PLUGIN, + slapi_log_err(SLAPI_LOG_PLUGIN, RETROCL_PLUGIN_NAME, "cltrim: ldrc=%d, first_time=%ld, cur_time=%ld\n", ldrc,first_time,cur_time); if ( LDAP_SUCCESS == ldrc && first_time > (time_t) 0L && @@ -381,18 +381,18 @@ void retrocl_housekeeping ( time_t cur_time, void *noarg ) } } if ( must_trim ) { - LDAPDebug0Args(LDAP_DEBUG_TRACE, "retrocl_housekeeping - changelog about to create thread\n"); + slapi_log_err(SLAPI_LOG_TRACE, RETROCL_PLUGIN_NAME, "retrocl_housekeeping - changelog about to create thread\n"); /* Start a thread to trim the changelog */ ts.ts_s_trimming = 1; if ( PR_CreateThread( PR_USER_THREAD, changelog_trim_thread_fn, NULL, PR_PRIORITY_NORMAL, PR_GLOBAL_THREAD, PR_UNJOINABLE_THREAD, RETROCL_DLL_DEFAULT_THREAD_STACKSIZE ) == NULL ) { - slapi_log_error(SLAPI_LOG_ERR, RETROCL_PLUGIN_NAME, "retrocl_housekeeping - " + slapi_log_err(SLAPI_LOG_ERR, RETROCL_PLUGIN_NAME, "retrocl_housekeeping - " "Unable to create changelog trimming thread\n" ); } } else { - LDAPDebug0Args(LDAP_DEBUG_PLUGIN, + slapi_log_err(SLAPI_LOG_PLUGIN, RETROCL_PLUGIN_NAME, "retrocl_housekeeping - changelog does not need to be trimmed\n"); } } @@ -422,7 +422,7 @@ void retrocl_init_trimming (void) ageval = slapi_parse_duration(cl_maxage); slapi_ch_free_string((char **)&cl_maxage); } else { - slapi_log_error(SLAPI_LOG_ERR, RETROCL_PLUGIN_NAME, + slapi_log_err(SLAPI_LOG_ERR, RETROCL_PLUGIN_NAME, "retrocl_init_trimming: ignoring invalid %s value %s; " "not trimming retro changelog.\n", CONFIG_CHANGELOG_MAXAGE_ATTRIBUTE, cl_maxage); @@ -435,7 +435,7 @@ void retrocl_init_trimming (void) if (cl_trim_interval) { trim_interval = strtol(cl_trim_interval, (char **)NULL, 10); if (0 == trim_interval) { - slapi_log_error(SLAPI_LOG_ERR, RETROCL_PLUGIN_NAME, + slapi_log_err(SLAPI_LOG_ERR, RETROCL_PLUGIN_NAME, "retrocl_init_trimming: ignoring invalid %s value %s; " "resetting the default %d\n", CONFIG_CHANGELOG_TRIM_INTERVAL, cl_trim_interval, @@ -449,7 +449,7 @@ void retrocl_init_trimming (void) ts.ts_s_last_trim = (time_t) 0L; ts.ts_s_trimming = 0; if (( ts.ts_s_trim_mutex = PR_NewLock()) == NULL ) { - slapi_log_error(SLAPI_LOG_ERR, RETROCL_PLUGIN_NAME, "set_changelog_trim_constraints: " + slapi_log_err(SLAPI_LOG_ERR, RETROCL_PLUGIN_NAME, "set_changelog_trim_constraints: " "cannot create new lock.\n" ); exit( 1 ); } diff --git a/ldap/servers/plugins/rever/pbe.c b/ldap/servers/plugins/rever/pbe.c index 0588c73..5044770 100644 --- a/ldap/servers/plugins/rever/pbe.c +++ b/ldap/servers/plugins/rever/pbe.c @@ -13,30 +13,11 @@ #include #include - #include -#include #include -#include -/* -#include -#include -*/ -#include -#include -#include #include -#include -#include -#include -#include - #define NEED_TOK_PBE /* see slap.h - defines tokPBE and ptokPBE */ #include "rever.h" -#include -#include "slapi-plugin.h" -#include -#include struct pk11MechItem { diff --git a/ldap/servers/plugins/rever/rever.c b/ldap/servers/plugins/rever/rever.c index a8242ad..dc023a3 100644 --- a/ldap/servers/plugins/rever/rever.c +++ b/ldap/servers/plugins/rever/rever.c @@ -70,7 +70,7 @@ aes_init( Slapi_PBlock *pb) { int rc; - slapi_log_error(SLAPI_LOG_PLUGIN, plugin_name, "=> aes_init\n" ); + slapi_log_err(SLAPI_LOG_PLUGIN, plugin_name, "=> aes_init\n" ); rc = slapi_pblock_set( pb, SLAPI_PLUGIN_VERSION, (void *) SLAPI_PLUGIN_VERSION_01 ); rc |= slapi_pblock_set( pb, SLAPI_PLUGIN_DESCRIPTION, (void *)&pdesc_aes ); @@ -81,7 +81,7 @@ aes_init( Slapi_PBlock *pb) init_pbe_plugin(); - slapi_log_error(SLAPI_LOG_PLUGIN, plugin_name, "<= aes_init %d\n", rc ); + slapi_log_err(SLAPI_LOG_PLUGIN, plugin_name, "<= aes_init %d\n", rc ); return( rc ); } @@ -131,7 +131,7 @@ des_init( Slapi_PBlock *pb ) { int rc; - slapi_log_error(SLAPI_LOG_PLUGIN, plugin_name, "=> des_init\n" ); + slapi_log_err(SLAPI_LOG_PLUGIN, plugin_name, "=> des_init\n" ); rc = slapi_pblock_set( pb, SLAPI_PLUGIN_VERSION, (void *) SLAPI_PLUGIN_VERSION_01 ); rc |= slapi_pblock_set( pb, SLAPI_PLUGIN_DESCRIPTION, (void *)&pdesc_des ); @@ -142,7 +142,7 @@ des_init( Slapi_PBlock *pb ) init_pbe_plugin(); - slapi_log_error(SLAPI_LOG_PLUGIN, plugin_name, "<= des_init %d\n", rc ); + slapi_log_err(SLAPI_LOG_PLUGIN, plugin_name, "<= des_init %d\n", rc ); return( rc ); } diff --git a/ldap/servers/plugins/rever/rever.h b/ldap/servers/plugins/rever/rever.h index bda92b2..635cbbe 100644 --- a/ldap/servers/plugins/rever/rever.h +++ b/ldap/servers/plugins/rever/rever.h @@ -18,7 +18,7 @@ #include "nspr.h" #include "base64.h" #include "slap.h" -#include "ldaplog.h" +#include #define AES_MECH 1 #define DES_MECH 2 diff --git a/ldap/servers/plugins/roles/roles_cache.c b/ldap/servers/plugins/roles/roles_cache.c index 349f48f..b7303de 100644 --- a/ldap/servers/plugins/roles/roles_cache.c +++ b/ldap/servers/plugins/roles/roles_cache.c @@ -182,7 +182,7 @@ int roles_cache_init() Slapi_DN *sdn = NULL; roles_cache_def *new_suffix = NULL; - slapi_log_error(SLAPI_LOG_PLUGIN, + slapi_log_err(SLAPI_LOG_PLUGIN, ROLES_PLUGIN_SUBSYSTEM, "--> roles_cache_init\n"); if ( global_lock == NULL ) @@ -231,7 +231,7 @@ int roles_cache_init() roles_sp_compare_value, roles_sp_list_types) ) { - slapi_log_error(SLAPI_LOG_ERR, ROLES_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_ERR, ROLES_PLUGIN_SUBSYSTEM, "roles_cache_init - slapi_vattrspi_register failed\n"); slapi_destroy_rwlock(global_lock); @@ -240,7 +240,7 @@ int roles_cache_init() } else if ( slapi_vattrspi_regattr(vattr_handle,NSROLEATTR,"", NULL) ) { - slapi_log_error(SLAPI_LOG_ERR, ROLES_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_ERR, ROLES_PLUGIN_SUBSYSTEM, "roles_cache_init - slapi_vattrspi_regattr failed\n"); slapi_ch_free((void **)&vattr_handle); slapi_destroy_rwlock(global_lock); @@ -248,7 +248,7 @@ int roles_cache_init() return(-1); } - slapi_log_error(SLAPI_LOG_PLUGIN, ROLES_PLUGIN_SUBSYSTEM, "<-- roles_cache_init\n"); + slapi_log_err(SLAPI_LOG_PLUGIN, ROLES_PLUGIN_SUBSYSTEM, "<-- roles_cache_init\n"); return rc; } @@ -263,13 +263,13 @@ static roles_cache_def *roles_cache_create_suffix(Slapi_DN *sdn) roles_cache_def *current_suffix = NULL; roles_cache_def *new_suffix = NULL; - slapi_log_error(SLAPI_LOG_PLUGIN, ROLES_PLUGIN_SUBSYSTEM, "--> roles_cache_create_suffix\n"); + slapi_log_err(SLAPI_LOG_PLUGIN, ROLES_PLUGIN_SUBSYSTEM, "--> roles_cache_create_suffix\n"); /* Allocate a new suffix block */ new_suffix = (roles_cache_def*)slapi_ch_calloc(1, sizeof(roles_cache_def)); if ( new_suffix == NULL ) { - slapi_log_error(SLAPI_LOG_ERR, + slapi_log_err(SLAPI_LOG_ERR, ROLES_PLUGIN_SUBSYSTEM, "roles_cache_create_suffix - Unable to allocate memory, cannot create role cache\n"); return(NULL); @@ -284,7 +284,7 @@ static roles_cache_def *roles_cache_create_suffix(Slapi_DN *sdn) new_suffix->cache_lock == NULL || new_suffix->create_lock == NULL ) { - slapi_log_error(SLAPI_LOG_ERR, ROLES_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_ERR, ROLES_PLUGIN_SUBSYSTEM, "roles_cache_create_suffix - Lock creation failed\n"); roles_cache_role_def_free(new_suffix); return(NULL); @@ -293,7 +293,7 @@ static roles_cache_def *roles_cache_create_suffix(Slapi_DN *sdn) new_suffix->something_changed = slapi_new_condvar(new_suffix->change_lock); if ( new_suffix->something_changed == NULL) { - slapi_log_error(SLAPI_LOG_ERR, ROLES_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_ERR, ROLES_PLUGIN_SUBSYSTEM, "roles_cache_create_suffix - ConVar creation failed\n"); roles_cache_role_def_free(new_suffix); return(NULL); @@ -302,7 +302,7 @@ static roles_cache_def *roles_cache_create_suffix(Slapi_DN *sdn) new_suffix->suffix_created = slapi_new_condvar(new_suffix->create_lock); if ( new_suffix->suffix_created == NULL) { - slapi_log_error(SLAPI_LOG_ERR, ROLES_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_ERR, ROLES_PLUGIN_SUBSYSTEM, "roles_cache_create_suffix - CondVar creation failed\n"); roles_cache_role_def_free(new_suffix); return(NULL); @@ -350,7 +350,7 @@ static roles_cache_def *roles_cache_create_suffix(Slapi_DN *sdn) PR_UNJOINABLE_THREAD, SLAPD_DEFAULT_THREAD_STACKSIZE)) == NULL ) { - slapi_log_error(SLAPI_LOG_ERR, ROLES_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_ERR, ROLES_PLUGIN_SUBSYSTEM, "roles_cache_create_suffix - PR_CreateThread failed\n"); roles_cache_role_def_delete(new_suffix); return(NULL); @@ -363,7 +363,7 @@ static roles_cache_def *roles_cache_create_suffix(Slapi_DN *sdn) } slapi_unlock_mutex(new_suffix->create_lock); - slapi_log_error(SLAPI_LOG_PLUGIN, ROLES_PLUGIN_SUBSYSTEM, "<-- roles_cache_create_suffix\n"); + slapi_log_err(SLAPI_LOG_PLUGIN, ROLES_PLUGIN_SUBSYSTEM, "<-- roles_cache_create_suffix\n"); return(new_suffix); } @@ -376,7 +376,7 @@ static void roles_cache_wait_on_change(void * arg) { roles_cache_def *roles_def = (roles_cache_def*)arg; - slapi_log_error(SLAPI_LOG_PLUGIN, ROLES_PLUGIN_SUBSYSTEM, "--> roles_cache_wait_on_change\n"); + slapi_log_err(SLAPI_LOG_PLUGIN, ROLES_PLUGIN_SUBSYSTEM, "--> roles_cache_wait_on_change\n"); slapi_lock_mutex(roles_def->stop_lock); slapi_lock_mutex(roles_def->change_lock); @@ -403,7 +403,7 @@ static void roles_cache_wait_on_change(void * arg) */ slapi_wait_condvar(roles_def->something_changed, NULL); - slapi_log_error(SLAPI_LOG_PLUGIN, ROLES_PLUGIN_SUBSYSTEM, "roles_cache_wait_on_change - notified\n"); + slapi_log_err(SLAPI_LOG_PLUGIN, ROLES_PLUGIN_SUBSYSTEM, "roles_cache_wait_on_change - notified\n"); if ( roles_def->keeprunning ) { @@ -417,7 +417,7 @@ static void roles_cache_wait_on_change(void * arg) roles_cache_role_def_free(roles_def); - slapi_log_error(SLAPI_LOG_PLUGIN, ROLES_PLUGIN_SUBSYSTEM, "<-- roles_cache_wait_on_change\n"); + slapi_log_err(SLAPI_LOG_PLUGIN, ROLES_PLUGIN_SUBSYSTEM, "<-- roles_cache_wait_on_change\n"); } /* roles_cache_trigger_update_suffix @@ -528,7 +528,7 @@ static void roles_cache_trigger_update_role(char *dn, Slapi_Entry *roles_entry, current_role = roles_list; - slapi_log_error(SLAPI_LOG_PLUGIN, + slapi_log_err(SLAPI_LOG_PLUGIN, ROLES_PLUGIN_SUBSYSTEM, "--> roles_cache_trigger_update_role: %p \n", roles_list); /* Go through all the roles list and trigger the associated structure */ @@ -563,7 +563,7 @@ static void roles_cache_trigger_update_role(char *dn, Slapi_Entry *roles_entry, slapi_rwlock_unlock(global_lock); - slapi_log_error(SLAPI_LOG_PLUGIN, ROLES_PLUGIN_SUBSYSTEM, "<-- roles_cache_trigger_update_role: %p \n", roles_list); + slapi_log_err(SLAPI_LOG_PLUGIN, ROLES_PLUGIN_SUBSYSTEM, "<-- roles_cache_trigger_update_role: %p \n", roles_list); } /* roles_cache_update @@ -580,7 +580,7 @@ static int roles_cache_update(roles_cache_def *suffix_to_update) Slapi_DN *dn = NULL; role_object *to_delete = NULL; - slapi_log_error(SLAPI_LOG_PLUGIN, ROLES_PLUGIN_SUBSYSTEM, "--> roles_cache_update \n"); + slapi_log_err(SLAPI_LOG_PLUGIN, ROLES_PLUGIN_SUBSYSTEM, "--> roles_cache_update \n"); slapi_rwlock_wrlock(suffix_to_update->cache_lock); @@ -589,7 +589,7 @@ static int roles_cache_update(roles_cache_def *suffix_to_update) dn = slapi_sdn_new(); if (!dn) { - slapi_log_error(SLAPI_LOG_PLUGIN, ROLES_PLUGIN_SUBSYSTEM, "Out of memory \n"); + slapi_log_err(SLAPI_LOG_PLUGIN, ROLES_PLUGIN_SUBSYSTEM, "Out of memory \n"); rc = -1; goto done; } @@ -630,7 +630,7 @@ done: slapi_sdn_free(&dn); } - slapi_log_error(SLAPI_LOG_PLUGIN, ROLES_PLUGIN_SUBSYSTEM, "<-- roles_cache_update \n"); + slapi_log_err(SLAPI_LOG_PLUGIN, ROLES_PLUGIN_SUBSYSTEM, "<-- roles_cache_update \n"); return(rc); } @@ -646,7 +646,7 @@ void roles_cache_stop() roles_cache_def *current_role = NULL; roles_cache_def *next_role = NULL; - slapi_log_error(SLAPI_LOG_PLUGIN, ROLES_PLUGIN_SUBSYSTEM, "--> roles_cache_stop\n"); + slapi_log_err(SLAPI_LOG_PLUGIN, ROLES_PLUGIN_SUBSYSTEM, "--> roles_cache_stop\n"); /* Go through all the roles list and trigger the associated structure */ slapi_rwlock_wrlock(global_lock); @@ -665,7 +665,7 @@ void roles_cache_stop() slapi_ch_free((void **)&vattr_handle); roles_list = NULL; - slapi_log_error(SLAPI_LOG_PLUGIN, ROLES_PLUGIN_SUBSYSTEM, "<-- roles_cache_stop\n"); + slapi_log_err(SLAPI_LOG_PLUGIN, ROLES_PLUGIN_SUBSYSTEM, "<-- roles_cache_stop\n"); } /* roles_cache_is_role_entry @@ -693,7 +693,7 @@ static int roles_cache_is_role_entry(struct slapi_entry *entry) if ( slapi_entry_attr_find(entry, "objectclass", &pObjclasses) ) { - slapi_log_error(SLAPI_LOG_ERR, + slapi_log_err(SLAPI_LOG_ERR, ROLES_PLUGIN_SUBSYSTEM, "roles_cache_is_role_entry - Failed to get objectclass from %s\n", slapi_entry_get_dn_const(entry)); @@ -774,7 +774,7 @@ void roles_cache_change_notify(Slapi_PBlock *pb) return ; } - slapi_log_error(SLAPI_LOG_PLUGIN, + slapi_log_err(SLAPI_LOG_PLUGIN, ROLES_PLUGIN_SUBSYSTEM, "--> roles_cache_change_notify\n"); @@ -838,7 +838,7 @@ void roles_cache_change_notify(Slapi_PBlock *pb) } break; default: - slapi_log_error(SLAPI_LOG_ERR, + slapi_log_err(SLAPI_LOG_ERR, ROLES_PLUGIN_SUBSYSTEM, "roles_cache_change_notify - Unknown operation %d\n",operation); return; @@ -848,7 +848,7 @@ void roles_cache_change_notify(Slapi_PBlock *pb) { if ( roles_cache_is_role_entry(e) != 1 ) { - slapi_log_error(SLAPI_LOG_PLUGIN, ROLES_PLUGIN_SUBSYSTEM, "<-- roles_cache_change_notify - Not a role entry\n"); + slapi_log_err(SLAPI_LOG_PLUGIN, ROLES_PLUGIN_SUBSYSTEM, "<-- roles_cache_change_notify - Not a role entry\n"); return; } entry = slapi_entry_dup(e); @@ -876,7 +876,7 @@ void roles_cache_change_notify(Slapi_PBlock *pb) } else { - slapi_log_error(SLAPI_LOG_PLUGIN, ROLES_PLUGIN_SUBSYSTEM, "<-- roles_cache_change_notify - Not a role entry\n"); + slapi_log_err(SLAPI_LOG_PLUGIN, ROLES_PLUGIN_SUBSYSTEM, "<-- roles_cache_change_notify - Not a role entry\n"); return; } } @@ -902,7 +902,7 @@ if ( e != NULL ) for ( i = 0; va[i] != NULL; i++ ) { string = (char*)slapi_value_get_string(va[i]); - slapi_log_error(SLAPI_LOG_PLUGIN, ROLES_PLUGIN_SUBSYSTEM, "roles_cache_change_notify - %s\n",string); + slapi_log_err(SLAPI_LOG_PLUGIN, ROLES_PLUGIN_SUBSYSTEM, "roles_cache_change_notify - %s\n",string); } } } @@ -920,7 +920,7 @@ if ( e != NULL ) } } - slapi_log_error(SLAPI_LOG_PLUGIN, ROLES_PLUGIN_SUBSYSTEM, "<-- roles_cache_change_notify\n"); + slapi_log_err(SLAPI_LOG_PLUGIN, ROLES_PLUGIN_SUBSYSTEM, "<-- roles_cache_change_notify\n"); } @@ -933,7 +933,7 @@ static Slapi_DN* roles_cache_get_top_suffix(Slapi_DN *suffix) Slapi_DN *current_suffix = NULL; Slapi_DN parent_suffix; - slapi_log_error(SLAPI_LOG_PLUGIN, ROLES_PLUGIN_SUBSYSTEM, "--> roles_cache_get_top_suffix\n"); + slapi_log_err(SLAPI_LOG_PLUGIN, ROLES_PLUGIN_SUBSYSTEM, "--> roles_cache_get_top_suffix\n"); if ( suffix == NULL ) { @@ -958,7 +958,7 @@ static Slapi_DN* roles_cache_get_top_suffix(Slapi_DN *suffix) } } /* we should not return that way ... */ - slapi_log_error(SLAPI_LOG_PLUGIN, ROLES_PLUGIN_SUBSYSTEM, "<-- roles_cache_get_top_suffix\n"); + slapi_log_err(SLAPI_LOG_PLUGIN, ROLES_PLUGIN_SUBSYSTEM, "<-- roles_cache_get_top_suffix\n"); slapi_sdn_done(&parent_suffix); slapi_sdn_free(¤t_suffix); return(NULL); @@ -977,7 +977,7 @@ static int roles_cache_add_roles_from_suffix(Slapi_DN *suffix_dn, roles_cache_de roles_cache_search_roles info; Slapi_PBlock *int_search_pb = NULL; - slapi_log_error(SLAPI_LOG_PLUGIN, ROLES_PLUGIN_SUBSYSTEM, "--> roles_cache_add_roles_from_suffix\n"); + slapi_log_err(SLAPI_LOG_PLUGIN, ROLES_PLUGIN_SUBSYSTEM, "--> roles_cache_add_roles_from_suffix\n"); info.suffix_def = suffix_def; info.rc = LDAP_NO_SUCH_OBJECT; @@ -1009,7 +1009,7 @@ static int roles_cache_add_roles_from_suffix(Slapi_DN *suffix_dn, roles_cache_de rc = 0; } - slapi_log_error(SLAPI_LOG_PLUGIN, ROLES_PLUGIN_SUBSYSTEM, "<-- roles_cache_add_roles_from_suffix\n"); + slapi_log_err(SLAPI_LOG_PLUGIN, ROLES_PLUGIN_SUBSYSTEM, "<-- roles_cache_add_roles_from_suffix\n"); return(rc); } @@ -1049,13 +1049,13 @@ static int roles_cache_create_role_under(roles_cache_def** roles_cache_suffix, S int rc; role_object *new_role = NULL; - slapi_log_error(SLAPI_LOG_PLUGIN, + slapi_log_err(SLAPI_LOG_PLUGIN, ROLES_PLUGIN_SUBSYSTEM, "--> roles_cache_create_role_under - %s - %p\n", slapi_sdn_get_dn((*roles_cache_suffix)->suffix_dn), (*roles_cache_suffix)->avl_tree); rc = roles_cache_create_object_from_entry(entry,&new_role,0); - slapi_log_error(SLAPI_LOG_PLUGIN, + slapi_log_err(SLAPI_LOG_PLUGIN, ROLES_PLUGIN_SUBSYSTEM, "roles_cache_create_role_under - create node for entry %s - rc: %d SUFFIX: %p\n", slapi_entry_get_dn_const(entry), rc, (*roles_cache_suffix)->avl_tree); @@ -1064,7 +1064,7 @@ static int roles_cache_create_role_under(roles_cache_def** roles_cache_suffix, S { /* Add to the tree where avl_data is a role_object struct */ rc = roles_cache_insert_object(&((*roles_cache_suffix)->avl_tree),new_role); - slapi_log_error(SLAPI_LOG_PLUGIN, + slapi_log_err(SLAPI_LOG_PLUGIN, ROLES_PLUGIN_SUBSYSTEM, "roles_cache_create_role_under - %s in tree %p rc: %d\n", (char*)slapi_sdn_get_ndn(new_role->dn), (*roles_cache_suffix)->avl_tree, rc); @@ -1089,7 +1089,7 @@ static int roles_cache_create_object_from_entry(Slapi_Entry *role_entry, role_ob role_object *this_role = NULL; char *rolescopeDN = NULL; - slapi_log_error(SLAPI_LOG_PLUGIN, ROLES_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_PLUGIN, ROLES_PLUGIN_SUBSYSTEM, "--> roles_cache_create_object_from_entry\n"); *result = NULL; @@ -1100,7 +1100,7 @@ static int roles_cache_create_object_from_entry(Slapi_Entry *role_entry, role_ob char *ndn = NULL; ndn = slapi_entry_get_ndn( role_entry ); - slapi_log_error(SLAPI_LOG_ERR, ROLES_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_ERR, ROLES_PLUGIN_SUBSYSTEM, "roles_cache_create_object_from_entry - Maximum roles nesting exceeded (%d), not retrieving roles " "from entry %s--probable circular definition\n", MAX_NESTED_ROLES, ndn); @@ -1156,7 +1156,7 @@ static int roles_cache_create_object_from_entry(Slapi_Entry *role_entry, role_ob /* rolescopeDN belongs to the same suffix as the role, we can use this scope */ this_role->rolescopedn = rolescopeSDN; } else { - slapi_log_error(SLAPI_LOG_ERR, ROLES_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_ERR, ROLES_PLUGIN_SUBSYSTEM, "roles_cache_create_object_from_entry - %s: invalid %s - %s not in the same suffix. Scope skipped.\n", (char*) slapi_sdn_get_dn(this_role->dn), ROLE_SCOPE_DN, @@ -1167,7 +1167,7 @@ static int roles_cache_create_object_from_entry(Slapi_Entry *role_entry, role_ob slapi_sdn_free(&top_this_roleSDN); } else { /* this is an invalid DN, just ignore this parameter*/ - slapi_log_error(SLAPI_LOG_ERR, ROLES_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_ERR, ROLES_PLUGIN_SUBSYSTEM, "roles_cache_create_object_from_entry - %s: invalid %s - %s not a valid DN. Scope skipped.\n", (char*) slapi_sdn_get_dn(this_role->dn), ROLE_SCOPE_DN, @@ -1229,7 +1229,7 @@ static int roles_cache_create_object_from_entry(Slapi_Entry *role_entry, role_ob if (cosentries && *cosentries) { slapi_free_search_results_internal(pb); slapi_pblock_destroy(pb); - slapi_log_error(SLAPI_LOG_ERR, ROLES_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_ERR, ROLES_PLUGIN_SUBSYSTEM, "roles_cache_create_object_from_entry - %s: not allowed to refer virtual attribute " "in the value of %s %s. The %s is disabled.\n", (char*)slapi_sdn_get_ndn(this_role->dn), @@ -1282,7 +1282,7 @@ static int roles_cache_create_object_from_entry(Slapi_Entry *role_entry, role_ob /* Make a DN from the string */ slapi_sdn_init_dn_byref(&nested_role_dn,string); - slapi_log_error(SLAPI_LOG_PLUGIN, + slapi_log_err(SLAPI_LOG_PLUGIN, ROLES_PLUGIN_SUBSYSTEM, "roles_cache_create_object_from_entry - dn %s, nested %s\n", (char*)slapi_sdn_get_ndn(this_role->dn),string); @@ -1303,7 +1303,7 @@ static int roles_cache_create_object_from_entry(Slapi_Entry *role_entry, role_ob } default: - slapi_log_error(SLAPI_LOG_ERR, ROLES_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_ERR, ROLES_PLUGIN_SUBSYSTEM, "roles_cache_create_object_from_entry - wrong role type\n"); } @@ -1312,7 +1312,7 @@ static int roles_cache_create_object_from_entry(Slapi_Entry *role_entry, role_ob *result = this_role; } - slapi_log_error(SLAPI_LOG_PLUGIN, ROLES_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_PLUGIN, ROLES_PLUGIN_SUBSYSTEM, "<-- roles_cache_create_object_from_entry\n"); @@ -1335,7 +1335,7 @@ static int roles_cache_determine_class(Slapi_Entry *role_entry) int rc = 0; int type = 0; - slapi_log_error(SLAPI_LOG_PLUGIN, ROLES_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_PLUGIN, ROLES_PLUGIN_SUBSYSTEM, "--> roles_cache_determine_class\n"); rc = slapi_entry_attr_find(role_entry,"objectclass",&attr); @@ -1381,7 +1381,7 @@ static int roles_cache_determine_class(Slapi_Entry *role_entry) return 0; } - slapi_log_error(SLAPI_LOG_PLUGIN, ROLES_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_PLUGIN, ROLES_PLUGIN_SUBSYSTEM, "<-- roles_cache_determine_class\n"); /* Return the appropriate type ordinal */ @@ -1399,7 +1399,7 @@ static int roles_cache_node_cmp( caddr_t d1, caddr_t d2 ) /* role_to_insert and current_role are never NULL in that context */ - slapi_log_error(SLAPI_LOG_PLUGIN, ROLES_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_PLUGIN, ROLES_PLUGIN_SUBSYSTEM, "roles_cache_node_cmp\n"); return (slapi_sdn_compare((Slapi_DN *)role_to_insert->dn, (Slapi_DN *)current_role->dn)); @@ -1412,7 +1412,7 @@ static int roles_cache_node_cmp( caddr_t d1, caddr_t d2 ) static int roles_cache_insert_object(Avlnode **tree, role_object *object) { - slapi_log_error(SLAPI_LOG_PLUGIN, + slapi_log_err(SLAPI_LOG_PLUGIN, ROLES_PLUGIN_SUBSYSTEM, "roles_cache_insert_object - %s in tree %p\n", (char*)slapi_sdn_get_ndn(object->dn), *tree); @@ -1430,7 +1430,7 @@ static int roles_cache_node_nested_cmp( caddr_t d1, caddr_t d2 ) /* role_to_insert and current_role are never NULL in that context */ - slapi_log_error(SLAPI_LOG_PLUGIN, ROLES_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_PLUGIN, ROLES_PLUGIN_SUBSYSTEM, "roles_cache_node_nested_cmp\n"); return slapi_sdn_compare(role_to_insert->dn, current_role->dn); @@ -1442,7 +1442,7 @@ static int roles_cache_node_nested_cmp( caddr_t d1, caddr_t d2 ) */ static int roles_cache_insert_object_nested(Avlnode **tree, role_object_nested *object) { - slapi_log_error(SLAPI_LOG_PLUGIN, + slapi_log_err(SLAPI_LOG_PLUGIN, ROLES_PLUGIN_SUBSYSTEM, "roles_cache_insert_object_nested - %s in tree %p: \n", (char*)slapi_sdn_get_ndn(object->dn), *tree); @@ -1459,7 +1459,7 @@ static int roles_cache_object_nested_from_dn(Slapi_DN *role_dn, role_object_nest { role_object_nested *nested_role = NULL; - slapi_log_error(SLAPI_LOG_PLUGIN, ROLES_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_PLUGIN, ROLES_PLUGIN_SUBSYSTEM, "--> roles_cache_object_nested_from_dn\n"); *result = NULL; @@ -1475,7 +1475,7 @@ static int roles_cache_object_nested_from_dn(Slapi_DN *role_dn, role_object_nest slapi_sdn_copy(role_dn,nested_role->dn); *result = nested_role; - slapi_log_error(SLAPI_LOG_PLUGIN, ROLES_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_PLUGIN, ROLES_PLUGIN_SUBSYSTEM, "<-- roles_cache_object_nested_from_dn\n"); return 0; } @@ -1500,7 +1500,7 @@ int roles_cache_listroles_ext(vattr_context *c, Slapi_Entry *entry, int return_v roles_cache_build_result arg; Slapi_Backend *backend = NULL; - slapi_log_error(SLAPI_LOG_PLUGIN, + slapi_log_err(SLAPI_LOG_PLUGIN, ROLES_PLUGIN_SUBSYSTEM, "--> roles_cache_listroles\n"); backend = slapi_mapping_tree_find_backend_for_sdn(slapi_entry_get_sdn(entry)); @@ -1568,7 +1568,7 @@ int roles_cache_listroles_ext(vattr_context *c, Slapi_Entry *entry, int return_v /* no roles associated */ rc = -1; } - slapi_log_error(SLAPI_LOG_PLUGIN, + slapi_log_err(SLAPI_LOG_PLUGIN, ROLES_PLUGIN_SUBSYSTEM, "<-- roles_cache_listroles\n"); return rc; } @@ -1591,7 +1591,7 @@ static int roles_cache_build_nsrole( caddr_t data, caddr_t arg ) int rc = 0; int tmprc = 0; - slapi_log_error(SLAPI_LOG_PLUGIN, + slapi_log_err(SLAPI_LOG_PLUGIN, ROLES_PLUGIN_SUBSYSTEM, "--> roles_cache_build_nsrole: role %s\n", (char*) slapi_sdn_get_ndn(this_role->dn)); @@ -1628,7 +1628,7 @@ static int roles_cache_build_nsrole( caddr_t data, caddr_t arg ) slapi_value_free(&value); - slapi_log_error(SLAPI_LOG_PLUGIN, + slapi_log_err(SLAPI_LOG_PLUGIN, ROLES_PLUGIN_SUBSYSTEM, "<-- roles_cache_build_nsrole\n"); return rc; @@ -1651,7 +1651,7 @@ int roles_check(Slapi_Entry *entry_to_check, Slapi_DN *role_dn, int *present) int rc = 0; - slapi_log_error(SLAPI_LOG_PLUGIN, + slapi_log_err(SLAPI_LOG_PLUGIN, ROLES_PLUGIN_SUBSYSTEM, "--> roles_check\n"); *present = 0; @@ -1686,7 +1686,7 @@ int roles_check(Slapi_Entry *entry_to_check, Slapi_DN *role_dn, int *present) roles_is_entry_member_of_object((caddr_t)this_role, (caddr_t)&get_nsrole); *present = get_nsrole.present; - slapi_log_error(SLAPI_LOG_PLUGIN, + slapi_log_err(SLAPI_LOG_PLUGIN, ROLES_PLUGIN_SUBSYSTEM, "<-- roles_check\n"); return rc; @@ -1703,7 +1703,7 @@ static int roles_cache_find_node( caddr_t d1, caddr_t d2 ) /* role is not NULL in that context */ - slapi_log_error(SLAPI_LOG_PLUGIN, + slapi_log_err(SLAPI_LOG_PLUGIN, ROLES_PLUGIN_SUBSYSTEM, "roles_cache_find_node: %s %s\n", slapi_sdn_get_dn(data), slapi_sdn_get_dn(role->dn)); @@ -1719,7 +1719,7 @@ static int roles_cache_find_roles_in_suffix(Slapi_DN *target_entry_dn, roles_cac int rc = -1; Slapi_Backend *backend = NULL; - slapi_log_error(SLAPI_LOG_PLUGIN, + slapi_log_err(SLAPI_LOG_PLUGIN, ROLES_PLUGIN_SUBSYSTEM, "--> roles_cache_find_roles_in_suffix\n"); *list_of_roles = NULL; @@ -1753,7 +1753,7 @@ static int roles_cache_find_roles_in_suffix(Slapi_DN *target_entry_dn, roles_cac return rc; } - slapi_log_error(SLAPI_LOG_PLUGIN, + slapi_log_err(SLAPI_LOG_PLUGIN, ROLES_PLUGIN_SUBSYSTEM, "<-- roles_cache_find_roles_in_suffix\n"); return rc; } @@ -1779,18 +1779,18 @@ static int roles_is_entry_member_of_object_ext(vattr_context *c, caddr_t data, c Slapi_Entry *entry_to_check = get_nsrole->is_entry_member_of; - slapi_log_error(SLAPI_LOG_PLUGIN, + slapi_log_err(SLAPI_LOG_PLUGIN, ROLES_PLUGIN_SUBSYSTEM, "--> roles_is_entry_member_of_object\n"); if (!this_role) { - slapi_log_error(SLAPI_LOG_ERR, + slapi_log_err(SLAPI_LOG_ERR, ROLES_PLUGIN_SUBSYSTEM, "roles_is_entry_member_of_object - NULL role\n"); goto done; } if (!roles_is_inscope(entry_to_check, this_role)) { - slapi_log_error(SLAPI_LOG_PLUGIN, + slapi_log_err(SLAPI_LOG_PLUGIN, ROLES_PLUGIN_SUBSYSTEM, "roles_is_entry_member_of_object - Entry not in scope of role\n"); return rc; } @@ -1818,12 +1818,12 @@ static int roles_is_entry_member_of_object_ext(vattr_context *c, caddr_t data, c break; } default: - slapi_log_error(SLAPI_LOG_ERR, + slapi_log_err(SLAPI_LOG_ERR, ROLES_PLUGIN_SUBSYSTEM, "roles_is_entry_member_of_object - invalid role type\n"); } } done: - slapi_log_error(SLAPI_LOG_PLUGIN, + slapi_log_err(SLAPI_LOG_PLUGIN, ROLES_PLUGIN_SUBSYSTEM, "<-- roles_is_entry_member_of_object\n"); return rc; } @@ -1841,7 +1841,7 @@ static int roles_check_managed(Slapi_Entry *entry_to_check, role_object *role, i int rc = 0; Slapi_Attr *attr = NULL; - slapi_log_error(SLAPI_LOG_PLUGIN, + slapi_log_err(SLAPI_LOG_PLUGIN, ROLES_PLUGIN_SUBSYSTEM, "--> roles_check_managed\n"); /* Get the attribute */ rc = slapi_entry_attr_find(entry_to_check,ROLE_MANAGED_ATTR_NAME,&attr); @@ -1861,7 +1861,7 @@ static int roles_check_managed(Slapi_Entry *entry_to_check, role_object *role, i *present = 1; } } - slapi_log_error(SLAPI_LOG_PLUGIN, + slapi_log_err(SLAPI_LOG_PLUGIN, ROLES_PLUGIN_SUBSYSTEM, "<-- roles_check_managed - entry %s role %s present %d\n", slapi_entry_get_dn_const(entry_to_check),(char*)slapi_sdn_get_ndn(role->dn),*present); @@ -1880,7 +1880,7 @@ static int roles_check_filtered(vattr_context *c, Slapi_Entry *entry_to_check, r { int rc = 0; - slapi_log_error(SLAPI_LOG_PLUGIN, + slapi_log_err(SLAPI_LOG_PLUGIN, ROLES_PLUGIN_SUBSYSTEM, "--> roles_check_filtered\n"); rc = slapi_vattr_filter_test_ext(slapi_vattr_get_pblock_from_context(c), entry_to_check, role->filter, 0, 0); @@ -1888,7 +1888,7 @@ static int roles_check_filtered(vattr_context *c, Slapi_Entry *entry_to_check, r { *present = 1; } - slapi_log_error(SLAPI_LOG_PLUGIN, + slapi_log_err(SLAPI_LOG_PLUGIN, ROLES_PLUGIN_SUBSYSTEM, "<-- roles_check_filtered - Entry %s role %s present %d\n", slapi_entry_get_dn_const(entry_to_check),(char*)slapi_sdn_get_ndn(role->dn),*present); @@ -1916,7 +1916,7 @@ static int roles_check_nested(caddr_t data, caddr_t arg) char *ndn = NULL; ndn = slapi_entry_get_ndn( get_nsrole->is_entry_member_of ); - slapi_log_error(SLAPI_LOG_ERR, + slapi_log_err(SLAPI_LOG_ERR, ROLES_PLUGIN_SUBSYSTEM, "roles_check_nested - Maximum roles nesting exceeded (max %d current %d), not checking roles in entry %s--probable circular definition\n", MAX_NESTED_ROLES, @@ -1935,7 +1935,7 @@ static int roles_check_nested(caddr_t data, caddr_t arg) roles_cache_def *roles_cache = NULL; role_object *this_role = NULL; - slapi_log_error(SLAPI_LOG_PLUGIN, + slapi_log_err(SLAPI_LOG_PLUGIN, ROLES_PLUGIN_SUBSYSTEM, "roles_check_nested - entry %s role %s present %d\n", slapi_entry_get_dn_const(get_nsrole->is_entry_member_of), @@ -1960,7 +1960,7 @@ static int roles_check_nested(caddr_t data, caddr_t arg) if ( this_role == NULL ) { /* the nested role doesn't exist */ - slapi_log_error(SLAPI_LOG_ERR, + slapi_log_err(SLAPI_LOG_ERR, ROLES_PLUGIN_SUBSYSTEM, "roles_check_nested - The nested role %s doesn't exist\n", (char*)slapi_sdn_get_ndn(current_nested_role->dn)); @@ -1977,7 +1977,7 @@ static int roles_check_nested(caddr_t data, caddr_t arg) } } } - slapi_log_error(SLAPI_LOG_PLUGIN, + slapi_log_err(SLAPI_LOG_PLUGIN, ROLES_PLUGIN_SUBSYSTEM, "<-- roles_check_nested\n"); return rc; } @@ -1993,7 +1993,7 @@ static int roles_is_inscope(Slapi_Entry *entry_to_check, role_object *this_role) Slapi_DN role_parent; Slapi_DN *scope_dn = NULL; - slapi_log_error(SLAPI_LOG_PLUGIN, + slapi_log_err(SLAPI_LOG_PLUGIN, ROLES_PLUGIN_SUBSYSTEM, "--> roles_is_inscope\n"); if (this_role->rolescopedn) { @@ -2016,7 +2016,7 @@ static int roles_is_inscope(Slapi_Entry *entry_to_check, role_object *this_role) slapi_sdn_done(&role_parent); - slapi_log_error(SLAPI_LOG_PLUGIN, + slapi_log_err(SLAPI_LOG_PLUGIN, ROLES_PLUGIN_SUBSYSTEM, "<-- roles_is_inscope: entry %s role %s result %d\n", slapi_entry_get_dn_const(entry_to_check),(char*)slapi_sdn_get_ndn(scope_dn), rc); @@ -2038,7 +2038,7 @@ static void roles_cache_role_def_delete(roles_cache_def *role_def) roles_cache_def *current = roles_list; roles_cache_def *previous = NULL; - slapi_log_error(SLAPI_LOG_PLUGIN, + slapi_log_err(SLAPI_LOG_PLUGIN, ROLES_PLUGIN_SUBSYSTEM, "--> roles_cache_role_def_delete\n"); while ( current!= NULL ) @@ -2065,7 +2065,7 @@ static void roles_cache_role_def_delete(roles_cache_def *role_def) current = current->next; } } - slapi_log_error(SLAPI_LOG_PLUGIN, + slapi_log_err(SLAPI_LOG_PLUGIN, ROLES_PLUGIN_SUBSYSTEM, "<-- roles_cache_role_def_delete\n"); } @@ -2074,7 +2074,7 @@ static void roles_cache_role_def_delete(roles_cache_def *role_def) */ static void roles_cache_role_def_free(roles_cache_def *role_def) { - slapi_log_error(SLAPI_LOG_PLUGIN, + slapi_log_err(SLAPI_LOG_PLUGIN, ROLES_PLUGIN_SUBSYSTEM, "--> roles_cache_role_def_free\n"); if ( role_def == NULL ) { @@ -2108,7 +2108,7 @@ static void roles_cache_role_def_free(roles_cache_def *role_def) slapi_ch_free((void**)&role_def); - slapi_log_error(SLAPI_LOG_PLUGIN, + slapi_log_err(SLAPI_LOG_PLUGIN, ROLES_PLUGIN_SUBSYSTEM, "<-- roles_cache_role_def_free\n"); } @@ -2117,7 +2117,7 @@ static void roles_cache_role_def_free(roles_cache_def *role_def) */ static void roles_cache_role_object_free(role_object *this_role) { - slapi_log_error(SLAPI_LOG_PLUGIN, + slapi_log_err(SLAPI_LOG_PLUGIN, ROLES_PLUGIN_SUBSYSTEM, "--> roles_cache_role_object_free\n"); if ( this_role == NULL ) @@ -2152,7 +2152,7 @@ static void roles_cache_role_object_free(role_object *this_role) /* Free the object */ slapi_ch_free((void**)&this_role); - slapi_log_error(SLAPI_LOG_PLUGIN, + slapi_log_err(SLAPI_LOG_PLUGIN, ROLES_PLUGIN_SUBSYSTEM, "<-- roles_cache_role_object_free\n"); } @@ -2161,7 +2161,7 @@ static void roles_cache_role_object_free(role_object *this_role) */ static int roles_cache_role_object_nested_free(role_object_nested *this_role) { - slapi_log_error(SLAPI_LOG_PLUGIN, + slapi_log_err(SLAPI_LOG_PLUGIN, ROLES_PLUGIN_SUBSYSTEM, "--> roles_cache_role_object_nested_free\n"); if ( this_role == NULL ) @@ -2174,7 +2174,7 @@ static int roles_cache_role_object_nested_free(role_object_nested *this_role) /* Free the object */ slapi_ch_free((void**)&this_role); - slapi_log_error(SLAPI_LOG_PLUGIN, + slapi_log_err(SLAPI_LOG_PLUGIN, ROLES_PLUGIN_SUBSYSTEM, "<-- roles_cache_role_object_nested_free\n"); return 0; @@ -2184,7 +2184,7 @@ static int roles_cache_dump( caddr_t data, caddr_t arg ) { role_object *this_role = (role_object*)data; - slapi_log_error(SLAPI_LOG_PLUGIN, + slapi_log_err(SLAPI_LOG_PLUGIN, ROLES_PLUGIN_SUBSYSTEM, "roles_cache_dump: %p - %s - %p\n", this_role, (char*)slapi_sdn_get_ndn(this_role->dn), this_role->avl_tree); diff --git a/ldap/servers/plugins/roles/roles_plugin.c b/ldap/servers/plugins/roles/roles_plugin.c index 169c472..065c333 100644 --- a/ldap/servers/plugins/roles/roles_plugin.c +++ b/ldap/servers/plugins/roles/roles_plugin.c @@ -69,7 +69,7 @@ roles_postop_init ( Slapi_PBlock *pb ) slapi_pblock_set(pb, postadd, (void *) roles_post_op ) != 0 || slapi_pblock_set(pb, postdel, (void *) roles_post_op ) != 0 ) { - slapi_log_error(SLAPI_LOG_ERR, ROLES_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_ERR, ROLES_PLUGIN_SUBSYSTEM, "roles_postop_init - Failed to register plugin\n" ); rc = -1; } @@ -92,7 +92,7 @@ roles_internalpostop_init ( Slapi_PBlock *pb ) slapi_pblock_set(pb, SLAPI_PLUGIN_INTERNAL_POST_DELETE_FN, (void *) roles_post_op ) != 0 ) { - slapi_log_error(SLAPI_LOG_ERR, ROLES_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_ERR, ROLES_PLUGIN_SUBSYSTEM, "roles_internalpostop_init - Failed to register plugin\n" ); rc = -1; } @@ -111,7 +111,7 @@ int roles_init( Slapi_PBlock *pb ) int is_betxn = 0; const char *plugin_type = "postoperation"; - slapi_log_error(SLAPI_LOG_PLUGIN, ROLES_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_PLUGIN, ROLES_PLUGIN_SUBSYSTEM, "=> roles_init\n" ); slapi_pblock_get (pb, SLAPI_PLUGIN_IDENTITY, &plugin_identity); @@ -132,7 +132,7 @@ int roles_init( Slapi_PBlock *pb ) slapi_pblock_set(pb, SLAPI_PLUGIN_CLOSE_FN, (void *) roles_close ) != 0 ) { - slapi_log_error(SLAPI_LOG_ERR, ROLES_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_ERR, ROLES_PLUGIN_SUBSYSTEM, "roles_init failed\n" ); rc = -1; goto bailout; @@ -156,7 +156,7 @@ int roles_init( Slapi_PBlock *pb ) plugin_identity); } bailout: - slapi_log_error(SLAPI_LOG_PLUGIN, ROLES_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_PLUGIN, ROLES_PLUGIN_SUBSYSTEM, "<= roles_init %d\n", rc ); return rc; } @@ -170,7 +170,7 @@ static int roles_start( Slapi_PBlock *pb ) int rc = 0; void **statechange_api; - slapi_log_error(SLAPI_LOG_PLUGIN, ROLES_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_PLUGIN, ROLES_PLUGIN_SUBSYSTEM, "=> roles_start\n" ); roles_cache_init(); @@ -193,7 +193,7 @@ static int roles_start( Slapi_PBlock *pb ) (notify_callback) statechange_vattr_cache_invalidator_callback(statechange_api)); } - slapi_log_error(SLAPI_LOG_PLUGIN, ROLES_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_PLUGIN, ROLES_PLUGIN_SUBSYSTEM, "<= roles_start %d\n", rc ); return rc; } @@ -207,7 +207,7 @@ static int roles_close( Slapi_PBlock *pb ) void **statechange_api; int rc = 0; - slapi_log_error(SLAPI_LOG_PLUGIN, ROLES_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_PLUGIN, ROLES_PLUGIN_SUBSYSTEM, "=> roles_close\n" ); roles_cache_stop(); @@ -220,7 +220,7 @@ static int roles_close( Slapi_PBlock *pb ) (notify_callback) statechange_vattr_cache_invalidator_callback(statechange_api)); } - slapi_log_error(SLAPI_LOG_PLUGIN, ROLES_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_PLUGIN, ROLES_PLUGIN_SUBSYSTEM, "<= roles_close - %d\n", rc ); return rc; } @@ -327,11 +327,11 @@ int roles_sp_cleanup(void) */ static int roles_post_op( Slapi_PBlock *pb ) { - slapi_log_error(SLAPI_LOG_PLUGIN, ROLES_PLUGIN_SUBSYSTEM, "--> roles_post_op\n"); + slapi_log_err(SLAPI_LOG_PLUGIN, ROLES_PLUGIN_SUBSYSTEM, "--> roles_post_op\n"); roles_cache_change_notify(pb); - slapi_log_error(SLAPI_LOG_PLUGIN, ROLES_PLUGIN_SUBSYSTEM, "<-- roles_post_op\n"); + slapi_log_err(SLAPI_LOG_PLUGIN, ROLES_PLUGIN_SUBSYSTEM, "<-- roles_post_op\n"); return SLAPI_PLUGIN_SUCCESS; /* always succeed */ } diff --git a/ldap/servers/plugins/rootdn_access/rootdn_access.c b/ldap/servers/plugins/rootdn_access/rootdn_access.c index b92a2b2..e5ebb13 100644 --- a/ldap/servers/plugins/rootdn_access/rootdn_access.c +++ b/ldap/servers/plugins/rootdn_access/rootdn_access.c @@ -109,7 +109,7 @@ rootdn_init(Slapi_PBlock *pb){ int status = 0; char *plugin_identity = NULL; - slapi_log_error(SLAPI_LOG_TRACE, ROOTDN_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_TRACE, ROOTDN_PLUGIN_SUBSYSTEM, "--> rootdn_init\n"); /* Store the plugin identity for later use. Used for internal operations. */ @@ -123,7 +123,7 @@ rootdn_init(Slapi_PBlock *pb){ slapi_pblock_set(pb, SLAPI_PLUGIN_CLOSE_FN, (void *) rootdn_close) != 0 || slapi_pblock_set(pb, SLAPI_PLUGIN_DESCRIPTION, (void *) &pdesc) != 0 ) { - slapi_log_error(SLAPI_LOG_ERR, ROOTDN_PLUGIN_SUBSYSTEM, "rootdn_init - Failed to register plugin\n"); + slapi_log_err(SLAPI_LOG_ERR, ROOTDN_PLUGIN_SUBSYSTEM, "rootdn_init - Failed to register plugin\n"); status = -1; } @@ -139,7 +139,7 @@ rootdn_init(Slapi_PBlock *pb){ NULL, /* ? */ plugin_identity /* access control */ )) { - slapi_log_error(SLAPI_LOG_ERR, ROOTDN_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_ERR, ROOTDN_PLUGIN_SUBSYSTEM, "rootdn_init - Failed to register rootdn preoperation plugin\n"); status = -1; } @@ -148,12 +148,12 @@ rootdn_init(Slapi_PBlock *pb){ * Load the config */ if(rootdn_load_config(pb) != 0){ - slapi_log_error(SLAPI_LOG_ERR, ROOTDN_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_ERR, ROOTDN_PLUGIN_SUBSYSTEM, "rootdn_init - Unable to load plug-in configuration\n"); return -1; } - slapi_log_error(SLAPI_LOG_PLUGIN, ROOTDN_PLUGIN_SUBSYSTEM,"<-- rootdn_init\n"); + slapi_log_err(SLAPI_LOG_PLUGIN, ROOTDN_PLUGIN_SUBSYSTEM,"<-- rootdn_init\n"); return status; } @@ -161,7 +161,7 @@ static int rootdn_preop_bind_init(Slapi_PBlock *pb) { if(slapi_pblock_set(pb, SLAPI_PLUGIN_INTERNAL_PRE_BIND_FN, (void *) rootdn_check_access) != 0){ - slapi_log_error(SLAPI_LOG_ERR, ROOTDN_PLUGIN_SUBSYSTEM,"rootdn_preop_bind_init - " + slapi_log_err(SLAPI_LOG_ERR, ROOTDN_PLUGIN_SUBSYSTEM,"rootdn_preop_bind_init - " "Failed to register function\n"); return -1; } @@ -172,11 +172,11 @@ rootdn_preop_bind_init(Slapi_PBlock *pb) static int rootdn_start(Slapi_PBlock *pb) { - slapi_log_error(SLAPI_LOG_PLUGIN, ROOTDN_PLUGIN_SUBSYSTEM, "--> rootdn_start\n"); + slapi_log_err(SLAPI_LOG_PLUGIN, ROOTDN_PLUGIN_SUBSYSTEM, "--> rootdn_start\n"); rootdn_set_plugin_dn(ROOTDN_PLUGIN_DN); - slapi_log_error(SLAPI_LOG_PLUGIN, ROOTDN_PLUGIN_SUBSYSTEM, "<-- rootdn_start\n"); + slapi_log_err(SLAPI_LOG_PLUGIN, ROOTDN_PLUGIN_SUBSYSTEM, "<-- rootdn_start\n"); return 0; } @@ -221,7 +221,7 @@ rootdn_load_config(Slapi_PBlock *pb) int time; int i; - slapi_log_error(SLAPI_LOG_PLUGIN, ROOTDN_PLUGIN_SUBSYSTEM, "--> rootdn_load_config\n"); + slapi_log_err(SLAPI_LOG_PLUGIN, ROOTDN_PLUGIN_SUBSYSTEM, "--> rootdn_load_config\n"); if ((slapi_pblock_get(pb, SLAPI_PLUGIN_CONFIG_ENTRY, &e) == 0) && e){ /* @@ -241,7 +241,7 @@ rootdn_load_config(Slapi_PBlock *pb) daysAllowed_tmp = strToLower(daysAllowed_tmp); end = strspn(daysAllowed_tmp, "abcdefghijklmnopqrstuvwxyz ,"); if(!end || daysAllowed_tmp[end] != '\0'){ - slapi_log_error(SLAPI_LOG_ERR, ROOTDN_PLUGIN_SUBSYSTEM, "rootdn_load_config - " + slapi_log_err(SLAPI_LOG_ERR, ROOTDN_PLUGIN_SUBSYSTEM, "rootdn_load_config - " "Invalid rootdn-days-allowed value (%s), must be all letters, and comma separators\n", daysAllowed_tmp); slapi_ch_free_string(&daysAllowed_tmp); result = -1; @@ -252,7 +252,7 @@ rootdn_load_config(Slapi_PBlock *pb) token = ldap_utf8strtok_r(copy, ", ", &iter); while(token){ if(strstr("mon tue wed thu fri sat sun",token) == 0){ - slapi_log_error(SLAPI_LOG_ERR, ROOTDN_PLUGIN_SUBSYSTEM, "rootdn_load_config - " + slapi_log_err(SLAPI_LOG_ERR, ROOTDN_PLUGIN_SUBSYSTEM, "rootdn_load_config - " "Invalid rootdn-days-allowed day value(%s), must be \"Mon, Tue, Wed, Thu, Fri, Sat, or Sun\".\n", token); slapi_ch_free_string(&daysAllowed_tmp); slapi_ch_free_string(©); @@ -266,20 +266,20 @@ rootdn_load_config(Slapi_PBlock *pb) if(openTime){ end = strspn(openTime, "0123456789"); if (!end || openTime[end] != '\0'){ - slapi_log_error(SLAPI_LOG_ERR, ROOTDN_PLUGIN_SUBSYSTEM, "rootdn_load_config - " + slapi_log_err(SLAPI_LOG_ERR, ROOTDN_PLUGIN_SUBSYSTEM, "rootdn_load_config - " "Invalid rootdn-open-time value (%s), must be all digits\n", openTime); result = -1; goto free_and_return; } time = atoi(openTime); if(time > 2359 || time < 0){ - slapi_log_error(SLAPI_LOG_ERR, ROOTDN_PLUGIN_SUBSYSTEM, "rootdn_load_config - " + slapi_log_err(SLAPI_LOG_ERR, ROOTDN_PLUGIN_SUBSYSTEM, "rootdn_load_config - " "Invalid value for rootdn-open-time value (%s), value must be between 0000-2359\n", openTime); result = -1; goto free_and_return; } if(strlen(openTime) != 4){ - slapi_log_error(SLAPI_LOG_ERR, ROOTDN_PLUGIN_SUBSYSTEM, "rootdn_load_config - " + slapi_log_err(SLAPI_LOG_ERR, ROOTDN_PLUGIN_SUBSYSTEM, "rootdn_load_config - " "Invalid format for rootdn-open-time value (%s). Should be HHMM\n", openTime); result = -1; goto free_and_return; @@ -294,20 +294,20 @@ rootdn_load_config(Slapi_PBlock *pb) if(closeTime){ end = strspn(closeTime, "0123456789"); if (!end || closeTime[end] != '\0'){ - slapi_log_error(SLAPI_LOG_ERR, ROOTDN_PLUGIN_SUBSYSTEM, "rootdn_load_config - " + slapi_log_err(SLAPI_LOG_ERR, ROOTDN_PLUGIN_SUBSYSTEM, "rootdn_load_config - " "Invalid rootdn-close-time value (%s), must be all digits, and should be HHMM\n",closeTime); result = -1; goto free_and_return; } time = atoi(closeTime); if(time > 2359 || time < 0){ - slapi_log_error(SLAPI_LOG_ERR, ROOTDN_PLUGIN_SUBSYSTEM, "rootdn_load_config - " + slapi_log_err(SLAPI_LOG_ERR, ROOTDN_PLUGIN_SUBSYSTEM, "rootdn_load_config - " "Invalid value for rootdn-close-time value (%s), value must be between 0000-2359\n", closeTime); result = -1; goto free_and_return; } if(strlen(closeTime) != 4){ - slapi_log_error(SLAPI_LOG_ERR, ROOTDN_PLUGIN_SUBSYSTEM, "rootdn_load_config - " + slapi_log_err(SLAPI_LOG_ERR, ROOTDN_PLUGIN_SUBSYSTEM, "rootdn_load_config - " "Invalid format for rootdn-close-time value (%s), should be HHMM\n", closeTime); result = -1; goto free_and_return; @@ -321,7 +321,7 @@ rootdn_load_config(Slapi_PBlock *pb) } if((openTime && closeTime == NULL) || (openTime == NULL && closeTime)){ /* If you are using TOD access control, you must have a open and close time */ - slapi_log_error(SLAPI_LOG_ERR, ROOTDN_PLUGIN_SUBSYSTEM, "rootdn_load_config - " + slapi_log_err(SLAPI_LOG_ERR, ROOTDN_PLUGIN_SUBSYSTEM, "rootdn_load_config - " "There must be a open and a close time. Ignoring time based settings.\n"); slapi_ch_free_string(&closeTime); slapi_ch_free_string(&openTime); @@ -332,7 +332,7 @@ rootdn_load_config(Slapi_PBlock *pb) } if(close_time && open_time && close_time <= open_time){ /* Make sure the closing time is greater than the open time */ - slapi_log_error(SLAPI_LOG_ERR, ROOTDN_PLUGIN_SUBSYSTEM, "rootdn_load_config - " + slapi_log_err(SLAPI_LOG_ERR, ROOTDN_PLUGIN_SUBSYSTEM, "rootdn_load_config - " "The close time must be greater than the open time\n"); result = -1; goto free_and_return; @@ -341,7 +341,7 @@ rootdn_load_config(Slapi_PBlock *pb) for(i = 0; hosts_tmp[i] != NULL; i++){ end = strspn(hosts_tmp[i], "0123456789.*-ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz"); if(!end || hosts_tmp[i][end] != '\0'){ - slapi_log_error(SLAPI_LOG_ERR, ROOTDN_PLUGIN_SUBSYSTEM, "rootdn_load_config - " + slapi_log_err(SLAPI_LOG_ERR, ROOTDN_PLUGIN_SUBSYSTEM, "rootdn_load_config - " "Hostname (%s) contains invalid characters, skipping\n",hosts_tmp[i]); slapi_ch_array_free(hosts_tmp); result = -1; @@ -353,7 +353,7 @@ rootdn_load_config(Slapi_PBlock *pb) for(i = 0; hosts_to_deny_tmp[i] != NULL; i++){ end = strspn(hosts_to_deny_tmp[i], "0123456789.*-ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz"); if(!end || hosts_to_deny_tmp[i][end] != '\0'){ - slapi_log_error(SLAPI_LOG_ERR, ROOTDN_PLUGIN_SUBSYSTEM, "rootdn_load_config - " + slapi_log_err(SLAPI_LOG_ERR, ROOTDN_PLUGIN_SUBSYSTEM, "rootdn_load_config - " "Hostname (%s) contains invalid characters, skipping\n",hosts_to_deny_tmp[i]); slapi_ch_array_free(hosts_to_deny_tmp); result = -1; @@ -365,7 +365,7 @@ rootdn_load_config(Slapi_PBlock *pb) for(i = 0; ips_tmp[i] != NULL; i++){ end = strspn(ips_tmp[i], "0123456789:ABCDEFabcdef."); if(!end || ips_tmp[i][end] != '\0'){ - slapi_log_error(SLAPI_LOG_ERR, ROOTDN_PLUGIN_SUBSYSTEM, "rootdn_load_config - " + slapi_log_err(SLAPI_LOG_ERR, ROOTDN_PLUGIN_SUBSYSTEM, "rootdn_load_config - " "IP address contains invalid characters (%s), skipping\n", ips_tmp[i]); slapi_ch_array_free(ips_tmp); result = -1; @@ -377,7 +377,7 @@ rootdn_load_config(Slapi_PBlock *pb) */ end = strspn(ips_tmp[i], "0123456789.*"); if(!end || ips_tmp[i][end] != '\0'){ - slapi_log_error(SLAPI_LOG_ERR, ROOTDN_PLUGIN_SUBSYSTEM, "rootdn_load_config - " + slapi_log_err(SLAPI_LOG_ERR, ROOTDN_PLUGIN_SUBSYSTEM, "rootdn_load_config - " "IPv4 address contains invalid characters (%s), skipping\n", ips_tmp[i]); slapi_ch_array_free(ips_tmp); result = -1; @@ -390,7 +390,7 @@ rootdn_load_config(Slapi_PBlock *pb) for(i = 0; ips_to_deny_tmp[i] != NULL; i++){ end = strspn(ips_to_deny_tmp[i], "0123456789:ABCDEFabcdef.*"); if(!end || ips_to_deny_tmp[i][end] != '\0'){ - slapi_log_error(SLAPI_LOG_ERR, ROOTDN_PLUGIN_SUBSYSTEM, "rootdn_load_config - " + slapi_log_err(SLAPI_LOG_ERR, ROOTDN_PLUGIN_SUBSYSTEM, "rootdn_load_config - " "IP address contains invalid characters (%s), skipping\n", ips_to_deny_tmp[i]); slapi_ch_array_free(ips_to_deny_tmp); result = -1; @@ -402,7 +402,7 @@ rootdn_load_config(Slapi_PBlock *pb) */ end = strspn(ips_to_deny_tmp[i], "0123456789.*"); if(!end || ips_to_deny_tmp[i][end] != '\0'){ - slapi_log_error(SLAPI_LOG_ERR, ROOTDN_PLUGIN_SUBSYSTEM, "rootdn_load_config - " + slapi_log_err(SLAPI_LOG_ERR, ROOTDN_PLUGIN_SUBSYSTEM, "rootdn_load_config - " "IPv4 address contains invalid characters (%s), skipping\n", ips_to_deny_tmp[i]); slapi_ch_array_free(ips_to_deny_tmp); result = -1; @@ -413,7 +413,7 @@ rootdn_load_config(Slapi_PBlock *pb) } } else { /* failed to get the plugin entry */ - slapi_log_error(SLAPI_LOG_ERR, ROOTDN_PLUGIN_SUBSYSTEM, "rootdn_load_config - " + slapi_log_err(SLAPI_LOG_ERR, ROOTDN_PLUGIN_SUBSYSTEM, "rootdn_load_config - " "Failed to get plugin entry\n"); result = -1; } @@ -433,7 +433,7 @@ free_and_return: slapi_ch_free_string(&openTime); slapi_ch_free_string(&closeTime); - slapi_log_error(SLAPI_LOG_PLUGIN, ROOTDN_PLUGIN_SUBSYSTEM, "<-- rootdn_load_config (%d)\n", result); + slapi_log_err(SLAPI_LOG_PLUGIN, ROOTDN_PLUGIN_SUBSYSTEM, "<-- rootdn_load_config (%d)\n", result); return result; } @@ -473,7 +473,7 @@ rootdn_check_access(Slapi_PBlock *pb){ curr_total = (timeinfo->tm_hour * 3600) + (timeinfo->tm_min * 60); if((curr_total < open_time) || (curr_total >= close_time)){ - slapi_log_error(SLAPI_LOG_PLUGIN, ROOTDN_PLUGIN_SUBSYSTEM, "rootdn_check_access - Bind not in the " + slapi_log_err(SLAPI_LOG_PLUGIN, ROOTDN_PLUGIN_SUBSYSTEM, "rootdn_check_access - Bind not in the " "allowed time window\n"); return -1; } @@ -493,7 +493,7 @@ rootdn_check_access(Slapi_PBlock *pb){ daysAllowed = strToLower(daysAllowed); if(!strstr(daysAllowed, today)){ - slapi_log_error(SLAPI_LOG_PLUGIN, ROOTDN_PLUGIN_SUBSYSTEM, "rootdn_check_access - " + slapi_log_err(SLAPI_LOG_PLUGIN, ROOTDN_PLUGIN_SUBSYSTEM, "rootdn_check_access - " "Bind not allowed for today(%s), only allowed on days: %s\n", today, daysAllowed); return -1; } @@ -510,7 +510,7 @@ rootdn_check_access(Slapi_PBlock *pb){ */ client_addr = (PRNetAddr *)slapi_ch_malloc(sizeof(PRNetAddr)); if ( slapi_pblock_get( pb, SLAPI_CONN_CLIENTNETADDR, client_addr ) != 0 ) { - slapi_log_error(SLAPI_LOG_ERR, ROOTDN_PLUGIN_SUBSYSTEM, "rootdn_check_access - " + slapi_log_err(SLAPI_LOG_ERR, ROOTDN_PLUGIN_SUBSYSTEM, "rootdn_check_access - " "Could not get client address for hosts.\n" ); rc = -1; goto free_and_return; @@ -525,13 +525,13 @@ rootdn_check_access(Slapi_PBlock *pb){ dnsName = slapi_ch_strdup( host_entry->h_name ); } else { /* no hostname */ - slapi_log_error(SLAPI_LOG_PLUGIN, ROOTDN_PLUGIN_SUBSYSTEM, "rootdn_check_access - " + slapi_log_err(SLAPI_LOG_PLUGIN, ROOTDN_PLUGIN_SUBSYSTEM, "rootdn_check_access - " "Client address missing hostname\n"); rc = -1; goto free_and_return; } } else { - slapi_log_error(SLAPI_LOG_PLUGIN, ROOTDN_PLUGIN_SUBSYSTEM, "rootdn_check_access - " + slapi_log_err(SLAPI_LOG_PLUGIN, ROOTDN_PLUGIN_SUBSYSTEM, "rootdn_check_access - " "client IP address could not be resolved\n"); rc = -1; goto free_and_return; @@ -591,7 +591,7 @@ rootdn_check_access(Slapi_PBlock *pb){ if(client_addr == NULL){ client_addr = (PRNetAddr *)slapi_ch_malloc(sizeof(PRNetAddr)); if ( slapi_pblock_get( pb, SLAPI_CONN_CLIENTNETADDR, client_addr ) != 0 ) { - slapi_log_error(SLAPI_LOG_ERR, ROOTDN_PLUGIN_SUBSYSTEM, "rootdn_check_access - Could not get client address for IP.\n" ); + slapi_log_err(SLAPI_LOG_ERR, ROOTDN_PLUGIN_SUBSYSTEM, "rootdn_check_access - Could not get client address for IP.\n" ); rc = -1; goto free_and_return; } @@ -605,13 +605,13 @@ rootdn_check_access(Slapi_PBlock *pb){ v4addr.inet.family = PR_AF_INET; v4addr.inet.ip = client_addr->ipv6.ip.pr_s6_addr32[3]; if( PR_NetAddrToString( &v4addr, ip_str, sizeof( ip_str )) != PR_SUCCESS){ - slapi_log_error(SLAPI_LOG_ERR, ROOTDN_PLUGIN_SUBSYSTEM, "rootdn_check_access - Could not get IPv4 from client address.\n" ); + slapi_log_err(SLAPI_LOG_ERR, ROOTDN_PLUGIN_SUBSYSTEM, "rootdn_check_access - Could not get IPv4 from client address.\n" ); rc = -1; goto free_and_return; } } else { if( PR_NetAddrToString(client_addr, ip_str, sizeof(ip_str)) != PR_SUCCESS){ - slapi_log_error(SLAPI_LOG_ERR, ROOTDN_PLUGIN_SUBSYSTEM, "rootdn_check_access - Could not get IPv6 from client address.\n" ); + slapi_log_err(SLAPI_LOG_ERR, ROOTDN_PLUGIN_SUBSYSTEM, "rootdn_check_access - Could not get IPv6 from client address.\n" ); rc = -1; goto free_and_return; } diff --git a/ldap/servers/plugins/schema_reload/schema_reload.c b/ldap/servers/plugins/schema_reload/schema_reload.c index af0c507..6970e12 100644 --- a/ldap/servers/plugins/schema_reload/schema_reload.c +++ b/ldap/servers/plugins/schema_reload/schema_reload.c @@ -90,7 +90,7 @@ schemareload_start(Slapi_PBlock *pb) int rc = 0; if ((schemareload_lock = PR_NewLock()) == NULL) { - slapi_log_error(SLAPI_LOG_ERR, "schemareload", "schemareload_start - Failed to create global schema reload lock."); + slapi_log_err(SLAPI_LOG_ERR, "schemareload", "schemareload_start - Failed to create global schema reload lock."); return -1; } rc = slapi_plugin_task_register_handler("schema reload task", schemareload_add, pb); @@ -136,7 +136,7 @@ schemareload_thread(void *arg) return; /* no task */ } slapi_task_inc_refcount(task); - slapi_log_error(SLAPI_LOG_PLUGIN, "schemareload", + slapi_log_err(SLAPI_LOG_PLUGIN, "schemareload", "schemareload_thread --> refcount incremented.\n" ); /* Fetch our task data from the task */ td = (task_data *)slapi_task_get_data(task); @@ -148,7 +148,7 @@ schemareload_thread(void *arg) slapi_task_begin(task, total_work); PR_Lock(schemareload_lock); /* make schema reload serialized */ slapi_task_log_notice(task, "Schema reload task starts (schema dir: %s) ...\n", td->schemadir?td->schemadir:"default"); - slapi_log_error(SLAPI_LOG_INFO, "schemareload", "schemareload_thread - Schema reload task starts (schema dir: %s) ...\n", td->schemadir?td->schemadir:"default"); + slapi_log_err(SLAPI_LOG_INFO, "schemareload", "schemareload_thread - Schema reload task starts (schema dir: %s) ...\n", td->schemadir?td->schemadir:"default"); rv = slapi_validate_schema_files(td->schemadir); slapi_task_inc_progress(task); @@ -156,11 +156,11 @@ schemareload_thread(void *arg) if (slapi_is_shutting_down()) { slapi_task_log_notice(task, "Server is shuttoing down; Schema validation aborted."); slapi_task_log_status(task, "Server is shuttoing down; Schema validation aborted."); - slapi_log_error(SLAPI_LOG_ERR, "schemareload", "schemareload_thread - Server is shutting down; Schema validation aborted."); + slapi_log_err(SLAPI_LOG_ERR, "schemareload", "schemareload_thread - Server is shutting down; Schema validation aborted."); } else if (LDAP_SUCCESS == rv) { slapi_task_log_notice(task, "Schema validation passed."); slapi_task_log_status(task, "Schema validation passed."); - slapi_log_error(SLAPI_LOG_INFO, "schemareload", "schemareload_thread - Schema validation passed.\n"); + slapi_log_err(SLAPI_LOG_INFO, "schemareload", "schemareload_thread - Schema validation passed.\n"); rv = slapi_reload_schema_files(td->schemadir); slapi_task_inc_progress(task); @@ -169,23 +169,23 @@ schemareload_thread(void *arg) if (LDAP_SUCCESS == rv) { slapi_task_log_notice(task, "Schema reload task finished."); slapi_task_log_status(task, "Schema reload task finished."); - slapi_log_error(SLAPI_LOG_INFO, "schemareload", "schemareload_thread - Schema reload task finished.\n"); + slapi_log_err(SLAPI_LOG_INFO, "schemareload", "schemareload_thread - Schema reload task finished.\n"); } else { slapi_task_log_notice(task, "Schema reload task failed."); slapi_task_log_status(task, "Schema reload task failed."); - slapi_log_error(SLAPI_LOG_ERR, "schemareload", "schemareload_thread - Schema reload task failed.\n"); + slapi_log_err(SLAPI_LOG_ERR, "schemareload", "schemareload_thread - Schema reload task failed.\n"); } } else { slapi_task_log_notice(task, "Schema validation failed."); slapi_task_log_status(task, "Schema validation failed."); - slapi_log_error(SLAPI_LOG_ERR, "schemareload", "schemareload_thread - Schema validation failed.\n"); + slapi_log_err(SLAPI_LOG_ERR, "schemareload", "schemareload_thread - Schema validation failed.\n"); } PR_Unlock(schemareload_lock); /* this will queue the destruction of the task */ slapi_task_finish(task, rv); slapi_task_dec_refcount(task); - slapi_log_error(SLAPI_LOG_PLUGIN, "schemareload", + slapi_log_err(SLAPI_LOG_PLUGIN, "schemareload", "schemareload_thread <-- refcount decremented.\n"); } @@ -257,7 +257,7 @@ schemareload_add(Slapi_PBlock *pb, Slapi_Entry *e, /* allocate new task now */ task = slapi_plugin_new_task(slapi_entry_get_ndn(e), arg); if (task == NULL) { - slapi_log_error(SLAPI_LOG_ERR, "schemareload", "schemareload_add - Unable to allocate new task!\n"); + slapi_log_err(SLAPI_LOG_ERR, "schemareload", "schemareload_add - Unable to allocate new task!\n"); *returncode = LDAP_OPERATIONS_ERROR; rv = SLAPI_DSE_CALLBACK_ERROR; goto out; @@ -285,7 +285,7 @@ schemareload_add(Slapi_PBlock *pb, Slapi_Entry *e, (void *)task, PR_PRIORITY_NORMAL, PR_GLOBAL_THREAD, PR_UNJOINABLE_THREAD, SLAPD_DEFAULT_THREAD_STACKSIZE); if (thread == NULL) { - slapi_log_error(SLAPI_LOG_ERR, "schemareload", + slapi_log_err(SLAPI_LOG_ERR, "schemareload", "schemareload_add - Unable to create schema reload task thread!\n"); *returncode = LDAP_OPERATIONS_ERROR; rv = SLAPI_DSE_CALLBACK_ERROR; diff --git a/ldap/servers/plugins/statechange/statechange.c b/ldap/servers/plugins/statechange/statechange.c index 542733e..64da26b 100644 --- a/ldap/servers/plugins/statechange/statechange.c +++ b/ldap/servers/plugins/statechange/statechange.c @@ -83,7 +83,7 @@ int statechange_init( Slapi_PBlock *pb ) int postmdn = SLAPI_PLUGIN_POST_MODRDN_FN; int postdel = SLAPI_PLUGIN_POST_DELETE_FN; - slapi_log_error(SLAPI_LOG_TRACE, SCN_PLUGIN_SUBSYSTEM, "--> statechange_init\n"); + slapi_log_err(SLAPI_LOG_TRACE, SCN_PLUGIN_SUBSYSTEM, "--> statechange_init\n"); if ((slapi_pblock_get(pb, SLAPI_PLUGIN_CONFIG_ENTRY, &plugin_entry) == 0) && plugin_entry && @@ -111,12 +111,12 @@ int statechange_init( Slapi_PBlock *pb ) slapi_pblock_set( pb, SLAPI_PLUGIN_DESCRIPTION, (void *)&pdesc ) != 0 ) { - slapi_log_error(SLAPI_LOG_ERR, SCN_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_ERR, SCN_PLUGIN_SUBSYSTEM, "statechange_init - Failed to register plugin\n" ); ret = SLAPI_PLUGIN_FAILURE; } - slapi_log_error(SLAPI_LOG_TRACE, SCN_PLUGIN_SUBSYSTEM, "<-- statechange_init\n"); + slapi_log_err(SLAPI_LOG_TRACE, SCN_PLUGIN_SUBSYSTEM, "<-- statechange_init\n"); return ret; } @@ -130,7 +130,7 @@ static int statechange_start( Slapi_PBlock *pb ) { int ret = SLAPI_PLUGIN_SUCCESS; - slapi_log_error(SLAPI_LOG_TRACE, SCN_PLUGIN_SUBSYSTEM, "--> statechange_start\n"); + slapi_log_err(SLAPI_LOG_TRACE, SCN_PLUGIN_SUBSYSTEM, "--> statechange_start\n"); api[0] = 0; /* reserved for api broker use, must be zero */ api[1] = (void *)_statechange_register; @@ -141,14 +141,14 @@ static int statechange_start( Slapi_PBlock *pb ) if(0 == (buffer_lock = slapi_new_mutex())) /* we never free this mutex */ { /* badness */ - slapi_log_error(SLAPI_LOG_ERR, SCN_PLUGIN_SUBSYSTEM, "statechange_start - Failed to create lock\n"); + slapi_log_err(SLAPI_LOG_ERR, SCN_PLUGIN_SUBSYSTEM, "statechange_start - Failed to create lock\n"); ret = SLAPI_PLUGIN_FAILURE; } else { if( slapi_apib_register(StateChange_v1_0_GUID, api) ) { - slapi_log_error(SLAPI_LOG_ERR, SCN_PLUGIN_SUBSYSTEM, "statechange_start - Failed to publish state change interface\n"); + slapi_log_err(SLAPI_LOG_ERR, SCN_PLUGIN_SUBSYSTEM, "statechange_start - Failed to publish state change interface\n"); ret = SLAPI_PLUGIN_FAILURE; } } @@ -159,7 +159,7 @@ static int statechange_start( Slapi_PBlock *pb ) g_plugin_started = 1; } - slapi_log_error(SLAPI_LOG_TRACE, SCN_PLUGIN_SUBSYSTEM, "<-- statechange_start\n"); + slapi_log_err(SLAPI_LOG_TRACE, SCN_PLUGIN_SUBSYSTEM, "<-- statechange_start\n"); return ret; } @@ -170,7 +170,7 @@ static int statechange_start( Slapi_PBlock *pb ) */ static int statechange_close( Slapi_PBlock *pb ) { - slapi_log_error(SLAPI_LOG_TRACE, SCN_PLUGIN_SUBSYSTEM, "--> statechange_close\n"); + slapi_log_err(SLAPI_LOG_TRACE, SCN_PLUGIN_SUBSYSTEM, "--> statechange_close\n"); g_plugin_started = 0; @@ -183,7 +183,7 @@ static int statechange_close( Slapi_PBlock *pb ) slapi_destroy_mutex(buffer_lock); buffer_lock = NULL; - slapi_log_error(SLAPI_LOG_TRACE, SCN_PLUGIN_SUBSYSTEM, "<-- statechange_close\n"); + slapi_log_err(SLAPI_LOG_TRACE, SCN_PLUGIN_SUBSYSTEM, "<-- statechange_close\n"); return SLAPI_PLUGIN_SUCCESS; } @@ -232,7 +232,7 @@ static int statechange_post_op( Slapi_PBlock *pb, int modtype ) return SLAPI_PLUGIN_SUCCESS; } - slapi_log_error(SLAPI_LOG_TRACE, SCN_PLUGIN_SUBSYSTEM, "--> statechange_post_op\n"); + slapi_log_err(SLAPI_LOG_TRACE, SCN_PLUGIN_SUBSYSTEM, "--> statechange_post_op\n"); /* evaluate this operation against the notification entries */ slapi_lock_mutex(buffer_lock); @@ -240,7 +240,7 @@ static int statechange_post_op( Slapi_PBlock *pb, int modtype ) { slapi_pblock_get( pb, SLAPI_TARGET_SDN, &sdn ); if (NULL == sdn) { - slapi_log_error(SLAPI_LOG_ERR, SCN_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_ERR, SCN_PLUGIN_SUBSYSTEM, "statechange_post_op - Failed to get dn of changed entry" ); goto bail; } @@ -293,7 +293,7 @@ static int statechange_post_op( Slapi_PBlock *pb, int modtype ) } bail: slapi_unlock_mutex(buffer_lock); - slapi_log_error(SLAPI_LOG_TRACE, SCN_PLUGIN_SUBSYSTEM, "<-- statechange_post_op\n"); + slapi_log_err(SLAPI_LOG_TRACE, SCN_PLUGIN_SUBSYSTEM, "<-- statechange_post_op\n"); return SLAPI_PLUGIN_SUCCESS; /* always succeed */ } @@ -327,7 +327,7 @@ static int _statechange_register(char *caller_id, char *dn, char *filter, void * item->caller_data = caller_data; if (writable_filter && (NULL == (item->realfilter = slapi_str2filter(writable_filter)))) { - slapi_log_error(SLAPI_LOG_ERR, SCN_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_ERR, SCN_PLUGIN_SUBSYSTEM, "_statechange_register - Invalid filter in statechange entry [%s]: [%s]\n", dn, filter); slapi_ch_free_string(&item->caller_id); diff --git a/ldap/servers/plugins/sync/sync_init.c b/ldap/servers/plugins/sync/sync_init.c index 32d9126..94f4ca9 100644 --- a/ldap/servers/plugins/sync/sync_init.c +++ b/ldap/servers/plugins/sync/sync_init.c @@ -20,7 +20,7 @@ int sync_init( Slapi_PBlock *pb ) char *plugin_identity = NULL; int rc = 0; - slapi_log_error(SLAPI_LOG_TRACE, SYNC_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_TRACE, SYNC_PLUGIN_SUBSYSTEM, "--> sync_init\n"); /** @@ -39,7 +39,7 @@ int sync_init( Slapi_PBlock *pb ) (void *) sync_close) != 0 || slapi_pblock_set(pb, SLAPI_PLUGIN_DESCRIPTION, (void *) &pdesc) != 0 ) { - slapi_log_error(SLAPI_LOG_ERR, SYNC_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_ERR, SYNC_PLUGIN_SUBSYSTEM, "sync_init - Failed to register plugin\n"); rc = 1; } @@ -55,7 +55,7 @@ int sync_init( Slapi_PBlock *pb ) SYNC_PREOP_DESC,/* plugin desc */ NULL, plugin_identity)) { - slapi_log_error(SLAPI_LOG_ERR, SYNC_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_ERR, SYNC_PLUGIN_SUBSYSTEM, "sync_init - Failed to register preop plugin\n"); rc = 1; } @@ -71,7 +71,7 @@ int sync_init( Slapi_PBlock *pb ) SYNC_POSTOP_DESC, /* plugin desc */ NULL, plugin_identity )) { - slapi_log_error(SLAPI_LOG_ERR, SYNC_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_ERR, SYNC_PLUGIN_SUBSYSTEM, "sync_init - Failed to register postop plugin\n"); rc = 1; } @@ -119,12 +119,12 @@ sync_start(Slapi_PBlock * pb) slapi_register_supported_control( LDAP_CONTROL_SYNC, SLAPI_OPERATION_SEARCH ); - slapi_log_error(SLAPI_LOG_TRACE, SYNC_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_TRACE, SYNC_PLUGIN_SUBSYSTEM, "--> sync_start\n"); if ( slapi_pblock_get( pb, SLAPI_PLUGIN_ARGC, &argc ) != 0 || slapi_pblock_get( pb, SLAPI_PLUGIN_ARGV, &argv ) != 0 ) { - slapi_log_error(SLAPI_LOG_ERR, SYNC_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_ERR, SYNC_PLUGIN_SUBSYSTEM, "sync_start - Unable to get arguments\n" ); return( -1 ); } diff --git a/ldap/servers/plugins/sync/sync_persist.c b/ldap/servers/plugins/sync/sync_persist.c index a122fde..d0c8da2 100644 --- a/ldap/servers/plugins/sync/sync_persist.c +++ b/ldap/servers/plugins/sync/sync_persist.c @@ -202,10 +202,10 @@ sync_queue_change( Slapi_Entry *e, Slapi_Entry *eprev, ber_int_t chgtype ) if ( matched ) { /* Notify update threads */ sync_request_wakeup_all(); - slapi_log_error(SLAPI_LOG_TRACE, SYNC_PLUGIN_SUBSYSTEM, "sync_queue_change - enqueued entry " + slapi_log_err(SLAPI_LOG_TRACE, SYNC_PLUGIN_SUBSYSTEM, "sync_queue_change - enqueued entry " "\"%s\" on %d request listeners\n", slapi_entry_get_dn_const(e), matched ); } else { - slapi_log_error(SLAPI_LOG_TRACE, SYNC_PLUGIN_SUBSYSTEM, "sync_queue_change - entry " + slapi_log_err(SLAPI_LOG_TRACE, SYNC_PLUGIN_SUBSYSTEM, "sync_queue_change - entry " "\"%s\" not enqueued on any request search listeners\n", slapi_entry_get_dn_const(e) ); } @@ -220,15 +220,15 @@ sync_persist_initialize (int argc, char **argv) if ( !SYNC_IS_INITIALIZED()) { sync_request_list = (SyncRequestList *) slapi_ch_calloc( 1, sizeof( SyncRequestList )); if (( sync_request_list->sync_req_rwlock = slapi_new_rwlock()) == NULL ) { - slapi_log_error(SLAPI_LOG_ERR, SYNC_PLUGIN_SUBSYSTEM, "sync_persist_initialize - Cannot initialize lock structure(1).\n"); + slapi_log_err(SLAPI_LOG_ERR, SYNC_PLUGIN_SUBSYSTEM, "sync_persist_initialize - Cannot initialize lock structure(1).\n"); return( -1 ); } if (( sync_request_list->sync_req_cvarlock = PR_NewLock()) == NULL ) { - slapi_log_error(SLAPI_LOG_ERR, SYNC_PLUGIN_SUBSYSTEM, "sync_persist_initialize - Cannot initialize lock structure(2).\n"); + slapi_log_err(SLAPI_LOG_ERR, SYNC_PLUGIN_SUBSYSTEM, "sync_persist_initialize - Cannot initialize lock structure(2).\n"); return( -1 ); } if (( sync_request_list->sync_req_cvar = PR_NewCondVar( sync_request_list->sync_req_cvarlock )) == NULL ) { - slapi_log_error(SLAPI_LOG_ERR, SYNC_PLUGIN_SUBSYSTEM, "sync_persist_initialize - Cannot initialize condition variable.\n"); + slapi_log_err(SLAPI_LOG_ERR, SYNC_PLUGIN_SUBSYSTEM, "sync_persist_initialize - Cannot initialize condition variable.\n"); return( -1 ); } sync_request_list->sync_req_head = NULL; @@ -284,7 +284,7 @@ sync_persist_add (Slapi_PBlock *pb) if(NULL == (req->req_tid)){ int prerr; prerr = PR_GetError(); - slapi_log_error(SLAPI_LOG_ERR, SYNC_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_ERR, SYNC_PLUGIN_SUBSYSTEM, "sync_persist_add - Failed to create persitent thread, error %d (%s)\n", prerr, slapi_pr_strerror(prerr)); /* Now remove the ps from the list so call the function ps_remove */ @@ -391,7 +391,7 @@ sync_request_alloc(void) req->req_pblock = NULL; if (( req->req_lock = PR_NewLock()) == NULL ) { - slapi_log_error(SLAPI_LOG_ERR, SYNC_PLUGIN_SUBSYSTEM, "sync_request_alloc - Cannot initialize lock structure.\n"); + slapi_log_err(SLAPI_LOG_ERR, SYNC_PLUGIN_SUBSYSTEM, "sync_request_alloc - Cannot initialize lock structure.\n"); slapi_ch_free((void **)&req); return( NULL ); } @@ -460,7 +460,7 @@ sync_remove_request( SyncRequest *req ) } SYNC_UNLOCK_WRITE(); if (!removed) { - slapi_log_error(SLAPI_LOG_PLUGIN, SYNC_PLUGIN_SUBSYSTEM, "sync_remove_request - " + slapi_log_err(SLAPI_LOG_PLUGIN, SYNC_PLUGIN_SUBSYSTEM, "sync_remove_request - " "Attempt to remove nonexistent req\n"); } } @@ -547,14 +547,14 @@ sync_send_results( void *arg ) slapi_pblock_get(req->req_pblock, SLAPI_OPERATION_ID, &opid); slapi_pblock_get(req->req_pblock, SLAPI_CONNECTION, &conn); if (NULL == conn) { - slapi_log_error(SLAPI_LOG_ERR, SYNC_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_ERR, SYNC_PLUGIN_SUBSYSTEM, "sync_send_results - conn=%" NSPRIu64 " op=%d Null connection - aborted\n", connid, opid); return; } conn_acq_flag = sync_acquire_connection (conn); if (conn_acq_flag) { - slapi_log_error(SLAPI_LOG_ERR, SYNC_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_ERR, SYNC_PLUGIN_SUBSYSTEM, "sync_send_results - conn=%" NSPRIu64 " op=%d Could not acquire the connection - aborted\n", connid, opid); return; @@ -565,7 +565,7 @@ sync_send_results( void *arg ) while ( (conn_acq_flag == 0) && !req->req_complete && !plugin_closing) { /* Check for an abandoned operation */ if ( op == NULL || slapi_is_operation_abandoned( op ) ) { - slapi_log_error(SLAPI_LOG_PLUGIN, SYNC_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_PLUGIN, SYNC_PLUGIN_SUBSYSTEM, "sync_send_results - conn=%" NSPRIu64 " op=%d Operation no longer active - terminating\n", connid, opid); break; @@ -643,7 +643,7 @@ sync_send_results( void *arg ) ec, ectrls, noattrs?noattrs:attrs, attrsonly ); if (rc) { - slapi_log_error(SLAPI_LOG_CONNS, SYNC_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_CONNS, SYNC_PLUGIN_SUBSYSTEM, "sync_send_results - Error %d sending entry %s\n", rc, slapi_entry_get_dn_const(ec)); } diff --git a/ldap/servers/plugins/sync/sync_refresh.c b/ldap/servers/plugins/sync/sync_refresh.c index 0c825d2..8627667 100644 --- a/ldap/servers/plugins/sync/sync_refresh.c +++ b/ldap/servers/plugins/sync/sync_refresh.c @@ -441,7 +441,7 @@ sync_read_entry_from_changelog( Slapi_Entry *cl_entry, void *cb_data) uniqueid = sync_get_attr_value_from_entry (cl_entry, CL_ATTR_UNIQUEID); if (uniqueid == NULL) { - slapi_log_error(SLAPI_LOG_ERR, SYNC_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_ERR, SYNC_PLUGIN_SUBSYSTEM, "sync_read_entry_from_changelog - Retro Changelog does not provide nsuniquedid." "Check RCL plugin configuration.\n" ); return(1); @@ -449,14 +449,14 @@ sync_read_entry_from_changelog( Slapi_Entry *cl_entry, void *cb_data) chgnr = sync_get_attr_value_from_entry (cl_entry, CL_ATTR_CHANGENUMBER); chgnum = sync_number2ulong(chgnr); if (SYNC_INVALID_CHANGENUM == chgnum) { - slapi_log_error(SLAPI_LOG_ERR, SYNC_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_ERR, SYNC_PLUGIN_SUBSYSTEM, "sync_read_entry_from_changelog - Change number provided by Retro Changelog is invalid: %s\n", chgnr); slapi_ch_free_string(&chgnr); slapi_ch_free_string(&uniqueid); return(1); } if (chgnum < cb->change_start) { - slapi_log_error(SLAPI_LOG_ERR, SYNC_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_ERR, SYNC_PLUGIN_SUBSYSTEM, "sync_read_entry_from_changelog - " "Change number provided by Retro Changelog %s is less than the initial number %lu\n", chgnr, cb->change_start); diff --git a/ldap/servers/plugins/sync/sync_util.c b/ldap/servers/plugins/sync/sync_util.c index 285c60a..2b22910 100644 --- a/ldap/servers/plugins/sync/sync_util.c +++ b/ldap/servers/plugins/sync/sync_util.c @@ -384,7 +384,7 @@ sync_cookie_get_server_info(Slapi_PBlock *pb) slapi_pblock_get(srch_pb, SLAPI_PLUGIN_INTOP_RESULT, &rc); if (rc != 0) { - slapi_log_error(SLAPI_LOG_ERR, SYNC_PLUGIN_SUBSYSTEM, "sync_cookie_get_server_info - " + slapi_log_err(SLAPI_LOG_ERR, SYNC_PLUGIN_SUBSYSTEM, "sync_cookie_get_server_info - " "Unable to read server configuration: error %d\n", rc); } else @@ -392,7 +392,7 @@ sync_cookie_get_server_info(Slapi_PBlock *pb) slapi_pblock_get(srch_pb, SLAPI_PLUGIN_INTOP_SEARCH_ENTRIES, &entries); if (NULL == entries || NULL == entries[0]) { - slapi_log_error(SLAPI_LOG_ERR, SYNC_PLUGIN_SUBSYSTEM, "sync_cookie_get_server_info -" + slapi_log_err(SLAPI_LOG_ERR, SYNC_PLUGIN_SUBSYSTEM, "sync_cookie_get_server_info -" "Server configuration missing\n"); rc = -1; } diff --git a/ldap/servers/plugins/syntaxes/bin.c b/ldap/servers/plugins/syntaxes/bin.c index 8050bcf..1791eb4 100644 --- a/ldap/servers/plugins/syntaxes/bin.c +++ b/ldap/servers/plugins/syntaxes/bin.c @@ -211,11 +211,11 @@ bin_init( Slapi_PBlock *pb ) { int rc; - LDAPDebug(LDAP_DEBUG_PLUGIN, "=> bin_init\n", 0, 0, 0 ); + slapi_log_err(SLAPI_LOG_PLUGIN, SYNTAX_PLUGIN_SUBSYSTEM, "=> bin_init\n"); rc = register_bin_like_plugin( pb, &bin_pdesc, bin_names, BINARY_SYNTAX_OID ); rc |= register_matching_rule_plugins(); - LDAPDebug(LDAP_DEBUG_PLUGIN, "<= bin_init %d\n", rc, 0, 0 ); + slapi_log_err(SLAPI_LOG_PLUGIN, SYNTAX_PLUGIN_SUBSYSTEM, "<= bin_init %d\n", rc); return( rc ); } @@ -225,10 +225,10 @@ octetstring_init( Slapi_PBlock *pb ) { int rc; - LDAPDebug(LDAP_DEBUG_PLUGIN, "=> octetstring_init\n", 0, 0, 0 ); + slapi_log_err(SLAPI_LOG_PLUGIN, SYNTAX_PLUGIN_SUBSYSTEM, "=> octetstring_init\n"); rc = register_bin_like_plugin( pb, &octetstring_pdesc, octetstring_names, OCTETSTRING_SYNTAX_OID ); - LDAPDebug(LDAP_DEBUG_PLUGIN, "<= octetstring_init %d\n", rc, 0, 0 ); + slapi_log_err(SLAPI_LOG_PLUGIN, SYNTAX_PLUGIN_SUBSYSTEM, "<= octetstring_init %d\n", rc); return( rc ); } @@ -238,10 +238,10 @@ jpeg_init( Slapi_PBlock *pb ) { int rc; - LDAPDebug(LDAP_DEBUG_PLUGIN, "=> jpeg_init\n", 0, 0, 0 ); + slapi_log_err(SLAPI_LOG_PLUGIN, SYNTAX_PLUGIN_SUBSYSTEM, "=> jpeg_init\n"); rc = register_bin_like_plugin( pb, &jpeg_pdesc, jpeg_names, JPEG_SYNTAX_OID ); - LDAPDebug(LDAP_DEBUG_PLUGIN, "<= jpeg_init %d\n", rc, 0, 0 ); + slapi_log_err(SLAPI_LOG_PLUGIN, SYNTAX_PLUGIN_SUBSYSTEM, "<= jpeg_init %d\n", rc); return( rc ); } @@ -251,10 +251,10 @@ fax_init( Slapi_PBlock *pb ) { int rc; - LDAPDebug(LDAP_DEBUG_PLUGIN, "=> fax_init\n", 0, 0, 0 ); + slapi_log_err(SLAPI_LOG_PLUGIN, SYNTAX_PLUGIN_SUBSYSTEM, "=> fax_init\n"); rc = register_bin_like_plugin( pb, &fax_pdesc, fax_names, FAX_SYNTAX_OID ); - LDAPDebug(LDAP_DEBUG_PLUGIN, "<= fax_init %d\n", rc, 0, 0 ); + slapi_log_err(SLAPI_LOG_PLUGIN, SYNTAX_PLUGIN_SUBSYSTEM, "<= fax_init %d\n", rc); return( rc ); } diff --git a/ldap/servers/plugins/syntaxes/bitstring.c b/ldap/servers/plugins/syntaxes/bitstring.c index 46e92d6..f91340c 100644 --- a/ldap/servers/plugins/syntaxes/bitstring.c +++ b/ldap/servers/plugins/syntaxes/bitstring.c @@ -104,7 +104,7 @@ bitstring_init( Slapi_PBlock *pb ) { int rc, flags; - LDAPDebug(LDAP_DEBUG_PLUGIN, "=> bitstring_init\n", 0, 0, 0 ); + slapi_log_err(SLAPI_LOG_PLUGIN, SYNTAX_PLUGIN_SUBSYSTEM, "=> bitstring_init\n"); rc = slapi_pblock_set( pb, SLAPI_PLUGIN_VERSION, (void *) SLAPI_PLUGIN_VERSION_01 ); @@ -135,7 +135,7 @@ bitstring_init( Slapi_PBlock *pb ) (void *) bitstring_normalize ); rc |= register_matching_rule_plugins(); - LDAPDebug(LDAP_DEBUG_PLUGIN, "<= bitstring_init %d\n", rc, 0, 0 ); + slapi_log_err(SLAPI_LOG_PLUGIN, SYNTAX_PLUGIN_SUBSYSTEM, "<= bitstring_init %d\n", rc); return( rc ); } diff --git a/ldap/servers/plugins/syntaxes/ces.c b/ldap/servers/plugins/syntaxes/ces.c index fe39f67..0c02a65 100644 --- a/ldap/servers/plugins/syntaxes/ces.c +++ b/ldap/servers/plugins/syntaxes/ces.c @@ -344,12 +344,12 @@ ces_init( Slapi_PBlock *pb ) { int rc; - LDAPDebug(LDAP_DEBUG_PLUGIN, "=> ces_init\n", 0, 0, 0 ); + slapi_log_err(SLAPI_LOG_PLUGIN, SYNTAX_PLUGIN_SUBSYSTEM, "=> ces_init\n"); rc = register_ces_like_plugin(pb,&ia5_pdesc,ia5_names,IA5STRING_SYNTAX_OID, ia5_validate); rc |= register_matching_rule_plugins(); - LDAPDebug(LDAP_DEBUG_PLUGIN, "<= ces_init %d\n", rc, 0, 0 ); + slapi_log_err(SLAPI_LOG_PLUGIN, SYNTAX_PLUGIN_SUBSYSTEM, "<= ces_init %d\n",rc); return( rc ); } @@ -358,12 +358,12 @@ uri_init( Slapi_PBlock *pb ) { int rc; - LDAPDebug(LDAP_DEBUG_PLUGIN, "=> uri_init\n", 0, 0, 0 ); + slapi_log_err(SLAPI_LOG_PLUGIN, SYNTAX_PLUGIN_SUBSYSTEM, "=> uri_init\n"); rc = register_ces_like_plugin(pb,&uri_pdesc,uri_names, "1.3.6.1.4.1.4401.1.1.1", NULL); - LDAPDebug(LDAP_DEBUG_PLUGIN, "<= uri_init %d\n", rc, 0, 0 ); + slapi_log_err(SLAPI_LOG_PLUGIN, SYNTAX_PLUGIN_SUBSYSTEM, "<= uri_init %d\n", rc); return( rc ); } diff --git a/ldap/servers/plugins/syntaxes/cis.c b/ldap/servers/plugins/syntaxes/cis.c index 993abce..918e598 100644 --- a/ldap/servers/plugins/syntaxes/cis.c +++ b/ldap/servers/plugins/syntaxes/cis.c @@ -724,11 +724,11 @@ cis_init( Slapi_PBlock *pb ) { int rc; - LDAPDebug(LDAP_DEBUG_PLUGIN, "=> cis_init\n", 0, 0, 0 ); + slapi_log_err(SLAPI_LOG_PLUGIN, SYNTAX_PLUGIN_SUBSYSTEM, "=> cis_init\n"); rc = register_cis_like_plugin( pb, &dirstring_pdesc, dirstring_names, DIRSTRING_SYNTAX_OID, dirstring_validate ); rc |= register_matching_rule_plugins(); - LDAPDebug(LDAP_DEBUG_PLUGIN, "<= cis_init %d\n", rc, 0, 0 ); + slapi_log_err(SLAPI_LOG_PLUGIN, SYNTAX_PLUGIN_SUBSYSTEM, "<= cis_init %d\n", rc); return( rc ); } @@ -738,10 +738,10 @@ boolean_init( Slapi_PBlock *pb ) { int rc; - LDAPDebug(LDAP_DEBUG_PLUGIN, "=> boolean_init\n", 0, 0, 0 ); + slapi_log_err(SLAPI_LOG_PLUGIN, SYNTAX_PLUGIN_SUBSYSTEM, "=> boolean_init\n"); rc = register_cis_like_plugin( pb, &boolean_pdesc, boolean_names, BOOLEAN_SYNTAX_OID, boolean_validate ); - LDAPDebug(LDAP_DEBUG_PLUGIN, "<= boolean_init %d\n", rc, 0, 0 ); + slapi_log_err(SLAPI_LOG_PLUGIN, SYNTAX_PLUGIN_SUBSYSTEM, "<= boolean_init %d\n", rc); return( rc ); } @@ -750,10 +750,10 @@ time_init( Slapi_PBlock *pb ) { int rc; - LDAPDebug(LDAP_DEBUG_PLUGIN, "=> time_init\n", 0, 0, 0 ); + slapi_log_err(SLAPI_LOG_PLUGIN, SYNTAX_PLUGIN_SUBSYSTEM, "=> time_init\n"); rc = register_cis_like_plugin( pb, &time_pdesc, time_names, GENERALIZEDTIME_SYNTAX_OID, time_validate ); - LDAPDebug(LDAP_DEBUG_PLUGIN, "<= time_init %d\n", rc, 0, 0 ); + slapi_log_err(SLAPI_LOG_PLUGIN, SYNTAX_PLUGIN_SUBSYSTEM, "<= time_init %d\n", rc); return( rc ); } @@ -762,10 +762,10 @@ country_init( Slapi_PBlock *pb ) { int rc; - LDAPDebug(LDAP_DEBUG_PLUGIN, "=> country_init\n", 0, 0, 0 ); + slapi_log_err(SLAPI_LOG_PLUGIN, SYNTAX_PLUGIN_SUBSYSTEM, "=> country_init\n"); rc = register_cis_like_plugin( pb, &country_pdesc, country_names, COUNTRYSTRING_SYNTAX_OID, country_validate ); - LDAPDebug(LDAP_DEBUG_PLUGIN, "<= country_init %d\n", rc, 0, 0 ); + slapi_log_err(SLAPI_LOG_PLUGIN, SYNTAX_PLUGIN_SUBSYSTEM, "<= country_init %d\n", rc); return( rc ); } @@ -774,10 +774,10 @@ postal_init( Slapi_PBlock *pb ) { int rc; - LDAPDebug(LDAP_DEBUG_PLUGIN, "=> postal_init\n", 0, 0, 0 ); + slapi_log_err(SLAPI_LOG_PLUGIN, SYNTAX_PLUGIN_SUBSYSTEM, "=> postal_init\n"); rc = register_cis_like_plugin( pb, &postal_pdesc, postal_names, POSTALADDRESS_SYNTAX_OID, postal_validate ); - LDAPDebug(LDAP_DEBUG_PLUGIN, "<= postal_init %d\n", rc, 0, 0 ); + slapi_log_err(SLAPI_LOG_PLUGIN, SYNTAX_PLUGIN_SUBSYSTEM, "<= postal_init %d\n", rc); return( rc ); } @@ -787,9 +787,9 @@ oid_init( Slapi_PBlock *pb ) { int rc; - LDAPDebug(LDAP_DEBUG_PLUGIN, "=> oid_init\n", 0, 0, 0 ); + slapi_log_err(SLAPI_LOG_PLUGIN, SYNTAX_PLUGIN_SUBSYSTEM, "=> oid_init\n"); rc = register_cis_like_plugin( pb, &oid_pdesc, oid_names, OID_SYNTAX_OID, oid_validate ); - LDAPDebug(LDAP_DEBUG_PLUGIN, "<= oid_init %d\n", rc, 0, 0 ); + slapi_log_err(SLAPI_LOG_PLUGIN, SYNTAX_PLUGIN_SUBSYSTEM, "<= oid_init %d\n", rc); return( rc ); } @@ -798,10 +798,10 @@ printable_init( Slapi_PBlock *pb ) { int rc; - LDAPDebug(LDAP_DEBUG_PLUGIN, "=> printable_init\n", 0, 0, 0 ); + slapi_log_err(SLAPI_LOG_PLUGIN, SYNTAX_PLUGIN_SUBSYSTEM, "=> printable_init\n"); rc = register_cis_like_plugin( pb, &printable_pdesc, printable_names, PRINTABLESTRING_SYNTAX_OID, printable_validate ); - LDAPDebug(LDAP_DEBUG_PLUGIN, "<= printable_init %d\n", rc, 0, 0 ); + slapi_log_err(SLAPI_LOG_PLUGIN, SYNTAX_PLUGIN_SUBSYSTEM, "<= printable_init %d\n", rc); return( rc ); } diff --git a/ldap/servers/plugins/syntaxes/deliverymethod.c b/ldap/servers/plugins/syntaxes/deliverymethod.c index adc000c..6b7df01 100644 --- a/ldap/servers/plugins/syntaxes/deliverymethod.c +++ b/ldap/servers/plugins/syntaxes/deliverymethod.c @@ -49,7 +49,7 @@ delivery_init( Slapi_PBlock *pb ) { int rc, flags; - LDAPDebug(LDAP_DEBUG_PLUGIN, "=> delivery_init\n", 0, 0, 0 ); + slapi_log_err(SLAPI_LOG_PLUGIN, SYNTAX_PLUGIN_SUBSYSTEM, "=> delivery_init\n"); rc = slapi_pblock_set( pb, SLAPI_PLUGIN_VERSION, (void *) SLAPI_PLUGIN_VERSION_01 ); @@ -79,7 +79,7 @@ delivery_init( Slapi_PBlock *pb ) rc |= slapi_pblock_set( pb, SLAPI_PLUGIN_SYNTAX_NORMALIZE, (void *) delivery_normalize ); - LDAPDebug(LDAP_DEBUG_PLUGIN, "<= delivery_init %d\n", rc, 0, 0 ); + slapi_log_err(SLAPI_LOG_PLUGIN, SYNTAX_PLUGIN_SUBSYSTEM, "<= delivery_init %d\n", rc); return( rc ); } diff --git a/ldap/servers/plugins/syntaxes/dn.c b/ldap/servers/plugins/syntaxes/dn.c index 307641e..23af5ec 100644 --- a/ldap/servers/plugins/syntaxes/dn.c +++ b/ldap/servers/plugins/syntaxes/dn.c @@ -110,7 +110,7 @@ dn_init( Slapi_PBlock *pb ) { int rc; - LDAPDebug(LDAP_DEBUG_PLUGIN, "=> dn_init\n", 0, 0, 0 ); + slapi_log_err(SLAPI_LOG_PLUGIN, SYNTAX_PLUGIN_SUBSYSTEM, "=> dn_init\n"); rc = slapi_pblock_set( pb, SLAPI_PLUGIN_VERSION, (void *) SLAPI_PLUGIN_VERSION_01 ); @@ -136,7 +136,7 @@ dn_init( Slapi_PBlock *pb ) (void *) dn_normalize ); rc |= register_matching_rule_plugins(); - LDAPDebug(LDAP_DEBUG_PLUGIN, "<= dn_init %d\n", rc, 0, 0 ); + slapi_log_err(SLAPI_LOG_PLUGIN, SYNTAX_PLUGIN_SUBSYSTEM, "<= dn_init %d\n", rc); return( rc ); } diff --git a/ldap/servers/plugins/syntaxes/facsimile.c b/ldap/servers/plugins/syntaxes/facsimile.c index 2059a7a..dafe7e3 100644 --- a/ldap/servers/plugins/syntaxes/facsimile.c +++ b/ldap/servers/plugins/syntaxes/facsimile.c @@ -49,7 +49,7 @@ facsimile_init( Slapi_PBlock *pb ) { int rc, flags; - LDAPDebug(LDAP_DEBUG_PLUGIN, "=> facsimile_init\n", 0, 0, 0 ); + slapi_log_err(SLAPI_LOG_PLUGIN, SYNTAX_PLUGIN_SUBSYSTEM, "=> facsimile_init\n"); rc = slapi_pblock_set( pb, SLAPI_PLUGIN_VERSION, (void *) SLAPI_PLUGIN_VERSION_01 ); @@ -79,7 +79,7 @@ facsimile_init( Slapi_PBlock *pb ) rc |= slapi_pblock_set( pb, SLAPI_PLUGIN_SYNTAX_NORMALIZE, (void *) facsimile_normalize ); - LDAPDebug(LDAP_DEBUG_PLUGIN, "<= facsimile_init %d\n", rc, 0, 0 ); + slapi_log_err(SLAPI_LOG_PLUGIN, SYNTAX_PLUGIN_SUBSYSTEM, "<= facsimile_init %d\n", rc); return( rc ); } diff --git a/ldap/servers/plugins/syntaxes/guide.c b/ldap/servers/plugins/syntaxes/guide.c index f9bcdb8..2a17741 100644 --- a/ldap/servers/plugins/syntaxes/guide.c +++ b/ldap/servers/plugins/syntaxes/guide.c @@ -59,7 +59,7 @@ guide_init( Slapi_PBlock *pb ) { int rc, flags; - LDAPDebug(LDAP_DEBUG_PLUGIN, "=> guide_init\n", 0, 0, 0 ); + slapi_log_err(SLAPI_LOG_PLUGIN, SYNTAX_PLUGIN_SUBSYSTEM, "=> guide_init\n"); rc = slapi_pblock_set( pb, SLAPI_PLUGIN_VERSION, (void *) SLAPI_PLUGIN_VERSION_01 ); @@ -89,7 +89,7 @@ guide_init( Slapi_PBlock *pb ) rc |= slapi_pblock_set( pb, SLAPI_PLUGIN_SYNTAX_NORMALIZE, (void *) guide_normalize ); - LDAPDebug(LDAP_DEBUG_PLUGIN, "<= guide_init %d\n", rc, 0, 0 ); + slapi_log_err(SLAPI_LOG_PLUGIN, SYNTAX_PLUGIN_SUBSYSTEM, "<= guide_init %d\n", rc); return( rc ); } @@ -98,7 +98,7 @@ enhancedguide_init( Slapi_PBlock *pb ) { int rc, flags; - LDAPDebug(LDAP_DEBUG_PLUGIN, "=> guide_init\n", 0, 0, 0 ); + slapi_log_err(SLAPI_LOG_PLUGIN, SYNTAX_PLUGIN_SUBSYSTEM, "=> guide_init\n"); rc = slapi_pblock_set( pb, SLAPI_PLUGIN_VERSION, (void *) SLAPI_PLUGIN_VERSION_01 ); @@ -126,7 +126,7 @@ enhancedguide_init( Slapi_PBlock *pb ) rc |= slapi_pblock_set( pb, SLAPI_PLUGIN_SYNTAX_VALIDATE, (void *) enhancedguide_validate ); - LDAPDebug(LDAP_DEBUG_PLUGIN, "<= guide_init %d\n", rc, 0, 0 ); + slapi_log_err(SLAPI_LOG_PLUGIN, SYNTAX_PLUGIN_SUBSYSTEM, "<= guide_init %d\n", rc); return( rc ); } diff --git a/ldap/servers/plugins/syntaxes/int.c b/ldap/servers/plugins/syntaxes/int.c index 48df53a..4a5c5da 100644 --- a/ldap/servers/plugins/syntaxes/int.c +++ b/ldap/servers/plugins/syntaxes/int.c @@ -162,7 +162,7 @@ int_init( Slapi_PBlock *pb ) { int rc, flags; - LDAPDebug(LDAP_DEBUG_PLUGIN, "=> int_init\n", 0, 0, 0 ); + slapi_log_err(SLAPI_LOG_PLUGIN, SYNTAX_PLUGIN_SUBSYSTEM, "=> int_init\n"); rc = slapi_pblock_set( pb, SLAPI_PLUGIN_VERSION, (void *) SLAPI_PLUGIN_VERSION_01 ); @@ -189,7 +189,7 @@ int_init( Slapi_PBlock *pb ) (void *) int_normalize ); rc |= register_matching_rule_plugins(); - LDAPDebug(LDAP_DEBUG_PLUGIN, "<= int_init %d\n", rc, 0, 0 ); + slapi_log_err(SLAPI_LOG_PLUGIN, SYNTAX_PLUGIN_SUBSYSTEM, "<= int_init %d\n", rc); return( rc ); } diff --git a/ldap/servers/plugins/syntaxes/nameoptuid.c b/ldap/servers/plugins/syntaxes/nameoptuid.c index 26a4a9a..026bb80 100644 --- a/ldap/servers/plugins/syntaxes/nameoptuid.c +++ b/ldap/servers/plugins/syntaxes/nameoptuid.c @@ -109,7 +109,7 @@ nameoptuid_init( Slapi_PBlock *pb ) { int rc, flags; - LDAPDebug(LDAP_DEBUG_PLUGIN, "=> nameoptuid_init\n", 0, 0, 0 ); + slapi_log_err(SLAPI_LOG_PLUGIN, SYNTAX_PLUGIN_SUBSYSTEM, "=> nameoptuid_init\n"); rc = slapi_pblock_set( pb, SLAPI_PLUGIN_VERSION, (void *) SLAPI_PLUGIN_VERSION_01 ); @@ -140,7 +140,7 @@ nameoptuid_init( Slapi_PBlock *pb ) (void *) nameoptuid_normalize ); rc |= register_matching_rule_plugins(); - LDAPDebug(LDAP_DEBUG_PLUGIN, "<= nameoptuid_init %d\n", rc, 0, 0 ); + slapi_log_err(SLAPI_LOG_PLUGIN, SYNTAX_PLUGIN_SUBSYSTEM, "<= nameoptuid_init %d\n", rc); return( rc ); } diff --git a/ldap/servers/plugins/syntaxes/numericstring.c b/ldap/servers/plugins/syntaxes/numericstring.c index bd5fc71..817cd64 100644 --- a/ldap/servers/plugins/syntaxes/numericstring.c +++ b/ldap/servers/plugins/syntaxes/numericstring.c @@ -167,7 +167,7 @@ numstr_init( Slapi_PBlock *pb ) { int rc, flags; - LDAPDebug(LDAP_DEBUG_PLUGIN, "=> numstr_init\n", 0, 0, 0 ); + slapi_log_err(SLAPI_LOG_PLUGIN, SYNTAX_PLUGIN_SUBSYSTEM, "=> numstr_init\n"); rc = slapi_pblock_set( pb, SLAPI_PLUGIN_VERSION, (void *) SLAPI_PLUGIN_VERSION_01 ); @@ -194,7 +194,7 @@ numstr_init( Slapi_PBlock *pb ) (void *) numstr_normalize ); rc |= register_matching_rule_plugins(); - LDAPDebug(LDAP_DEBUG_PLUGIN, "<= numstr_init %d\n", rc, 0, 0 ); + slapi_log_err(SLAPI_LOG_PLUGIN, SYNTAX_PLUGIN_SUBSYSTEM, "<= numstr_init %d\n", rc); return( rc ); } diff --git a/ldap/servers/plugins/syntaxes/sicis.c b/ldap/servers/plugins/syntaxes/sicis.c index 9059f11..a8fc6b3 100644 --- a/ldap/servers/plugins/syntaxes/sicis.c +++ b/ldap/servers/plugins/syntaxes/sicis.c @@ -54,7 +54,7 @@ sicis_init( Slapi_PBlock *pb ) { int rc, flags; - LDAPDebug(LDAP_DEBUG_PLUGIN, "=> sicis_init\n", 0, 0, 0 ); + slapi_log_err(SLAPI_LOG_PLUGIN, SYNTAX_PLUGIN_SUBSYSTEM, "=> sicis_init\n"); rc = slapi_pblock_set( pb, SLAPI_PLUGIN_VERSION, (void *) SLAPI_PLUGIN_VERSION_01 ); @@ -82,7 +82,7 @@ sicis_init( Slapi_PBlock *pb ) rc |= slapi_pblock_set( pb, SLAPI_PLUGIN_SYNTAX_NORMALIZE, (void *) sicis_normalize ); - LDAPDebug(LDAP_DEBUG_PLUGIN, "<= sicis_init %d\n", rc, 0, 0 ); + slapi_log_err(SLAPI_LOG_PLUGIN, SYNTAX_PLUGIN_SUBSYSTEM, "<= sicis_init %d\n", rc); return( rc ); } diff --git a/ldap/servers/plugins/syntaxes/string.c b/ldap/servers/plugins/syntaxes/string.c index 17ceef9..a7cca4e 100644 --- a/ldap/servers/plugins/syntaxes/string.c +++ b/ldap/servers/plugins/syntaxes/string.c @@ -119,7 +119,7 @@ string_filter_approx( struct berval *bvfilter, Slapi_Value **bvals, int ava_wordcount; char *w1, *w2, *c1, *c2; - slapi_log_error(SLAPI_LOG_TRACE, SYNTAX_PLUGIN_SUBSYSTEM, "=> string_filter_approx\n"); + slapi_log_err(SLAPI_LOG_TRACE, SYNTAX_PLUGIN_SUBSYSTEM, "=> string_filter_approx\n"); /* * try to match words in each filter value in order @@ -183,7 +183,7 @@ string_filter_approx( struct berval *bvfilter, Slapi_Value **bvals, if (0 != rc) { rc = -1; } - slapi_log_error(SLAPI_LOG_TRACE, SYNTAX_PLUGIN_SUBSYSTEM, "<= string_filter_approx %d\n", rc); + slapi_log_err(SLAPI_LOG_TRACE, SYNTAX_PLUGIN_SUBSYSTEM, "<= string_filter_approx %d\n", rc); return( rc ); } @@ -209,7 +209,7 @@ string_filter_sub( Slapi_PBlock *pb, char *initial, char **any, char *final, int free_re = 1; struct subfilt *sf = NULL; - slapi_log_error(SLAPI_LOG_TRACE, SYNTAX_PLUGIN_SUBSYSTEM, "=> string_filter_sub\n"); + slapi_log_err(SLAPI_LOG_TRACE, SYNTAX_PLUGIN_SUBSYSTEM, "=> string_filter_sub\n"); if (pb) { slapi_pblock_get( pb, SLAPI_OPERATION, &op ); } @@ -323,14 +323,14 @@ string_filter_sub( Slapi_PBlock *pb, char *initial, char **any, char *final, tmpbuf = NULL; re = slapi_re_comp( p, &re_result ); if (NULL == re) { - slapi_log_error(SLAPI_LOG_ERR, SYNTAX_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_ERR, SYNTAX_PLUGIN_SUBSYSTEM, "string_filter_sub - re_comp (%s) failed (%s): %s\n", pat, p, re_result?re_result:"unknown" ); rc = LDAP_OPERATIONS_ERROR; goto bailout; } else if (slapi_is_loglevel_set(SLAPI_LOG_TRACE)) { char ebuf[BUFSIZ]; - slapi_log_error(SLAPI_LOG_TRACE, SYNTAX_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_TRACE, SYNTAX_PLUGIN_SUBSYSTEM, "string_filter_sub - re_comp (%s)\n", escape_string(p, ebuf)); } } @@ -379,7 +379,7 @@ string_filter_sub( Slapi_PBlock *pb, char *initial, char **any, char *final, if (slapi_is_loglevel_set(SLAPI_LOG_TRACE)) { char ebuf[BUFSIZ]; - slapi_log_error(SLAPI_LOG_TRACE, SYNTAX_PLUGIN_SUBSYSTEM,"re_exec (%s) %i\n", + slapi_log_err(SLAPI_LOG_TRACE, SYNTAX_PLUGIN_SUBSYSTEM,"re_exec (%s) %i\n", escape_string(realval, ebuf), tmprc); } if ( tmprc == 1 ) { @@ -397,7 +397,7 @@ bailout: slapi_ch_free((void**)&tmpbuf ); /* NULL is fine */ slapi_ch_free((void**)&bigpat ); /* NULL is fine */ - slapi_log_error(SLAPI_LOG_TRACE, SYNTAX_PLUGIN_SUBSYSTEM, "<= string_filter_sub %d\n", rc); + slapi_log_err(SLAPI_LOG_TRACE, SYNTAX_PLUGIN_SUBSYSTEM, "<= string_filter_sub %d\n", rc); return( rc ); } @@ -741,7 +741,7 @@ string_assertion2keys_ava( } break; default: - slapi_log_error(SLAPI_LOG_ERR, SYNTAX_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_ERR, SYNTAX_PLUGIN_SUBSYSTEM, "string_assertion2keys_ava - Unknown ftype 0x%x\n", ftype); break; @@ -923,7 +923,7 @@ substring_comp_keys( PR_ASSERT(NULL != comp_buf); PR_ASSERT(NULL != substrlens); - slapi_log_error(SLAPI_LOG_TRACE, SYNTAX_PLUGIN_SUBSYSTEM, "=> substring_comp_keys - (%s) %d\n", + slapi_log_err(SLAPI_LOG_TRACE, SYNTAX_PLUGIN_SUBSYSTEM, "=> substring_comp_keys - (%s) %d\n", str, prepost); /* prepend ^ for initial substring */ @@ -966,5 +966,5 @@ substring_comp_keys( (*nsubs)++; } - slapi_log_error(SLAPI_LOG_TRACE, SYNTAX_PLUGIN_SUBSYSTEM, "<= substring_comp_keys\n"); + slapi_log_err(SLAPI_LOG_TRACE, SYNTAX_PLUGIN_SUBSYSTEM, "<= substring_comp_keys\n"); } diff --git a/ldap/servers/plugins/syntaxes/syntax_common.c b/ldap/servers/plugins/syntaxes/syntax_common.c index 6ca2555..d2b29a9 100644 --- a/ldap/servers/plugins/syntaxes/syntax_common.c +++ b/ldap/servers/plugins/syntaxes/syntax_common.c @@ -51,7 +51,7 @@ syntax_matching_rule_plugin_init( slapi_pblock_get(pb, SLAPI_PLUGIN_ARGV, &argv); if (!argv || !argv[0]) { - slapi_log_error(SLAPI_LOG_ERR, SYNTAX_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_ERR, SYNTAX_PLUGIN_SUBSYSTEM, "syntax_matching_rule_plugin_init - " "Error: matching rule plugin name not specified\n"); return rc; @@ -78,7 +78,7 @@ syntax_matching_rule_plugin_init( } if (!mrpd) { - slapi_log_error(SLAPI_LOG_ERR, SYNTAX_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_ERR, SYNTAX_PLUGIN_SUBSYSTEM, "syntax_matching_rule_plugin_init - " "Error: matching rule plugin name [%s] not found\n", argv[0]); } else { diff --git a/ldap/servers/plugins/syntaxes/tel.c b/ldap/servers/plugins/syntaxes/tel.c index 006c536..2ce59a4 100644 --- a/ldap/servers/plugins/syntaxes/tel.c +++ b/ldap/servers/plugins/syntaxes/tel.c @@ -151,7 +151,7 @@ tel_init( Slapi_PBlock *pb ) { int rc, flags; - LDAPDebug(LDAP_DEBUG_PLUGIN, "=> tel_init\n", 0, 0, 0 ); + slapi_log_err(SLAPI_LOG_PLUGIN, SYNTAX_PLUGIN_SUBSYSTEM, "=> tel_init\n"); rc = slapi_pblock_set( pb, SLAPI_PLUGIN_VERSION, (void *) SLAPI_PLUGIN_VERSION_01 ); @@ -182,7 +182,7 @@ tel_init( Slapi_PBlock *pb ) (void *) tel_normalize ); rc |= register_matching_rule_plugins(); - LDAPDebug(LDAP_DEBUG_PLUGIN, "<= tel_init %d\n", rc, 0, 0 ); + slapi_log_err(SLAPI_LOG_PLUGIN, SYNTAX_PLUGIN_SUBSYSTEM, "<= tel_init %d\n", rc); return( rc ); } diff --git a/ldap/servers/plugins/syntaxes/teletex.c b/ldap/servers/plugins/syntaxes/teletex.c index 10e7040..41a3429 100644 --- a/ldap/servers/plugins/syntaxes/teletex.c +++ b/ldap/servers/plugins/syntaxes/teletex.c @@ -49,7 +49,7 @@ teletex_init( Slapi_PBlock *pb ) { int rc, flags; - LDAPDebug(LDAP_DEBUG_PLUGIN, "=> teletex_init\n", 0, 0, 0 ); + slapi_log_err(SLAPI_LOG_PLUGIN, SYNTAX_PLUGIN_SUBSYSTEM, "=> teletex_init\n"); rc = slapi_pblock_set( pb, SLAPI_PLUGIN_VERSION, (void *) SLAPI_PLUGIN_VERSION_01 ); @@ -79,7 +79,7 @@ teletex_init( Slapi_PBlock *pb ) rc |= slapi_pblock_set( pb, SLAPI_PLUGIN_SYNTAX_NORMALIZE, (void *) teletex_normalize ); - LDAPDebug(LDAP_DEBUG_PLUGIN, "<= teletex_init %d\n", rc, 0, 0 ); + slapi_log_err(SLAPI_LOG_PLUGIN, SYNTAX_PLUGIN_SUBSYSTEM, "<= teletex_init %d\n", rc); return( rc ); } diff --git a/ldap/servers/plugins/syntaxes/telex.c b/ldap/servers/plugins/syntaxes/telex.c index 2f734ac..2a415e2 100644 --- a/ldap/servers/plugins/syntaxes/telex.c +++ b/ldap/servers/plugins/syntaxes/telex.c @@ -48,7 +48,7 @@ telex_init( Slapi_PBlock *pb ) { int rc, flags; - LDAPDebug(LDAP_DEBUG_PLUGIN, "=> telex_init\n", 0, 0, 0 ); + slapi_log_err(SLAPI_LOG_PLUGIN, SYNTAX_PLUGIN_SUBSYSTEM, "=> telex_init\n"); rc = slapi_pblock_set( pb, SLAPI_PLUGIN_VERSION, (void *) SLAPI_PLUGIN_VERSION_01 ); @@ -78,7 +78,7 @@ telex_init( Slapi_PBlock *pb ) rc |= slapi_pblock_set( pb, SLAPI_PLUGIN_SYNTAX_NORMALIZE, (void *) telex_normalize ); - LDAPDebug(LDAP_DEBUG_PLUGIN, "<= telex_init %d\n", rc, 0, 0 ); + slapi_log_err(SLAPI_LOG_PLUGIN, SYNTAX_PLUGIN_SUBSYSTEM, "<= telex_init %d\n", rc); return( rc ); } diff --git a/ldap/servers/plugins/syntaxes/validate_task.c b/ldap/servers/plugins/syntaxes/validate_task.c index 203f1d3..eae2d2a 100644 --- a/ldap/servers/plugins/syntaxes/validate_task.c +++ b/ldap/servers/plugins/syntaxes/validate_task.c @@ -132,7 +132,7 @@ syntax_validate_task_add(Slapi_PBlock *pb, Slapi_Entry *e, (void *)task, PR_PRIORITY_NORMAL, PR_GLOBAL_THREAD, PR_UNJOINABLE_THREAD, SLAPD_DEFAULT_THREAD_STACKSIZE); if (thread == NULL) { - slapi_log_error(SLAPI_LOG_ERR, SYNTAX_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_ERR, SYNTAX_PLUGIN_SUBSYSTEM, "syntax_validate_task_add - Unable to create task thread!\n"); *returncode = LDAP_OPERATIONS_ERROR; rv = SLAPI_DSE_CALLBACK_ERROR; @@ -176,7 +176,7 @@ syntax_validate_task_thread(void *arg) return; /* no task */ } slapi_task_inc_refcount(task); - slapi_log_error(SLAPI_LOG_PLUGIN, SYNTAX_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_PLUGIN, SYNTAX_PLUGIN_SUBSYSTEM, "syntax_validate_task_thread - refcount incremented.\n" ); /* Fetch our task data from the task */ td = (task_data *)slapi_task_get_data(task); @@ -185,7 +185,7 @@ syntax_validate_task_thread(void *arg) slapi_task_begin(task, 1); slapi_task_log_notice(task, "Syntax validation task starting (arg: %s) ...\n", td->filter_str); - slapi_log_error(SLAPI_LOG_ERR, SYNTAX_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_ERR, SYNTAX_PLUGIN_SUBSYSTEM, "syntax_validate_task_thread - Starting (base: \"%s\", filter: \"%s\") ...\n", td->dn, td->filter_str); @@ -205,7 +205,7 @@ syntax_validate_task_thread(void *arg) " invalid entries.\n", slapi_counter_get_value(td->invalid_entries)); slapi_task_log_status(task, "Syntax validate task complete. Found %" NSPRIu64 " invalid entries.\n", slapi_counter_get_value(td->invalid_entries)); - slapi_log_error(SLAPI_LOG_ERR, SYNTAX_PLUGIN_SUBSYSTEM, "syntax_validate_task_thread - Complete." + slapi_log_err(SLAPI_LOG_ERR, SYNTAX_PLUGIN_SUBSYSTEM, "syntax_validate_task_thread - Complete." " Found %" NSPRIu64 " invalid entries.\n", slapi_counter_get_value(td->invalid_entries)); slapi_task_inc_progress(task); @@ -213,7 +213,7 @@ syntax_validate_task_thread(void *arg) /* this will queue the destruction of the task */ slapi_task_finish(task, rc); slapi_task_dec_refcount(task); - slapi_log_error(SLAPI_LOG_PLUGIN, SYNTAX_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_PLUGIN, SYNTAX_PLUGIN_SUBSYSTEM, "syntax_validate_task_thread - refcount decremented.\n"); } @@ -244,7 +244,7 @@ syntax_validate_task_callback(Slapi_Entry *e, void *callback_data) pb = slapi_pblock_new(); slapi_entry_syntax_check(pb, e, 1); slapi_pblock_get(pb, SLAPI_PB_RESULT_TEXT, &error_text); - slapi_log_error(SLAPI_LOG_ERR, SYNTAX_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_ERR, SYNTAX_PLUGIN_SUBSYSTEM, "syntax_validate_task_callback - Entry \"%s\" violates syntax.\n%s", dn, error_text); slapi_pblock_destroy(pb); diff --git a/ldap/servers/plugins/syntaxes/value.c b/ldap/servers/plugins/syntaxes/value.c index ef496ee..e8296be 100644 --- a/ldap/servers/plugins/syntaxes/value.c +++ b/ldap/servers/plugins/syntaxes/value.c @@ -368,8 +368,8 @@ value_cmp( } else if (syntax & SYNTAX_CES) { rc = strcmp( v1->bv_val, v2->bv_val ); } else { /* error - unknown syntax */ - LDAPDebug(LDAP_DEBUG_PLUGIN, - "invalid syntax [%d]\n", syntax, 0, 0); + slapi_log_err(SLAPI_LOG_PLUGIN, SYNTAX_PLUGIN_SUBSYSTEM, + "value_cmp - invalid syntax [%d]\n", syntax); } if ((syntax & SYNTAX_INT) && !v1sign && !v2sign) { /* both negative */ diff --git a/ldap/servers/plugins/uiduniq/7bit.c b/ldap/servers/plugins/uiduniq/7bit.c index ceafa7a..52f53da 100644 --- a/ldap/servers/plugins/uiduniq/7bit.c +++ b/ldap/servers/plugins/uiduniq/7bit.c @@ -67,7 +67,7 @@ static char *moreInfo = static int op_error(int internal_error) { - slapi_log_error(SLAPI_LOG_PLUGIN, plugin_name, + slapi_log_err(SLAPI_LOG_PLUGIN, plugin_name, "op_error - %d\n", internal_error); return LDAP_OPERATIONS_ERROR; @@ -78,7 +78,7 @@ issue_error(Slapi_PBlock *pb, int result, char *type, char *value) { char *moreinfop; - slapi_log_error(SLAPI_LOG_PLUGIN, plugin_name, + slapi_log_err(SLAPI_LOG_PLUGIN, plugin_name, "issue_error - %s result %d\n", type, result); if (value == NULL) { @@ -105,7 +105,7 @@ bit_check_one_berval(const struct berval *value, char **violated) int i; #ifdef DEBUG - slapi_log_error(SLAPI_LOG_PLUGIN, plugin_name, "bit_check_one_berval - 7-bit checking begin\n"); + slapi_log_err(SLAPI_LOG_PLUGIN, plugin_name, "bit_check_one_berval - 7-bit checking begin\n"); #endif result = LDAP_SUCCESS; @@ -166,7 +166,7 @@ bit_check(Slapi_Attr *attr, struct berval **values, char **violated) } #ifdef DEBUG - slapi_log_error(SLAPI_LOG_PLUGIN, plugin_name, + slapi_log_err(SLAPI_LOG_PLUGIN, plugin_name, "bit_check - 7 bit check result = %d\n", result); #endif @@ -186,7 +186,7 @@ preop_add(Slapi_PBlock *pb) char *pwd = NULL; char *origpwd = NULL; #ifdef DEBUG - slapi_log_error(SLAPI_LOG_PLUGIN, plugin_name, "preop_add - ADD begin\n"); + slapi_log_err(SLAPI_LOG_PLUGIN, plugin_name, "preop_add - ADD begin\n"); #endif result = LDAP_SUCCESS; @@ -238,7 +238,7 @@ preop_add(Slapi_PBlock *pb) dn = slapi_sdn_get_dn(sdn); #ifdef DEBUG - slapi_log_error(SLAPI_LOG_PLUGIN, plugin_name, "preop_add - ADD target=%s\n", dn); + slapi_log_err(SLAPI_LOG_PLUGIN, plugin_name, "preop_add - ADD target=%s\n", dn); #endif /* @@ -290,7 +290,7 @@ preop_add(Slapi_PBlock *pb) if (slapi_dn_issuffix(dn, *subtreeDN)) { #ifdef DEBUG - slapi_log_error(SLAPI_LOG_PLUGIN, plugin_name, + slapi_log_err(SLAPI_LOG_PLUGIN, plugin_name, "preop_add - ADD subtree=%s\n", *subtreeDN); #endif @@ -348,7 +348,7 @@ preop_modify(Slapi_PBlock *pb) int checkmodsCapacity = 0; /* max capacity of checkmods */ #ifdef DEBUG - slapi_log_error(SLAPI_LOG_PLUGIN, plugin_name, + slapi_log_err(SLAPI_LOG_PLUGIN, plugin_name, "preop_modify - MODIFY begin\n"); #endif @@ -472,7 +472,7 @@ preop_modify(Slapi_PBlock *pb) if (slapi_dn_issuffix(target, *subtreeDN)) { #ifdef DEBUG - slapi_log_error(SLAPI_LOG_PLUGIN, plugin_name, + slapi_log_err(SLAPI_LOG_PLUGIN, plugin_name, "preop_modify - MODIFY subtree=%s\n", *subtreeDN); #endif /* @@ -511,7 +511,7 @@ preop_modrdn(Slapi_PBlock *pb) char *violated = NULL; #ifdef DEBUG - slapi_log_error(SLAPI_LOG_PLUGIN, plugin_name, + slapi_log_err(SLAPI_LOG_PLUGIN, plugin_name, "preop_modrdn - MODRDN begin\n"); #endif @@ -572,7 +572,7 @@ preop_modrdn(Slapi_PBlock *pb) if (err) { result = op_error(33); break; } #ifdef DEBUG - slapi_log_error(SLAPI_LOG_PLUGIN, plugin_name, + slapi_log_err(SLAPI_LOG_PLUGIN, plugin_name, "preop_modrdn - MODRDN newrdn=%s\n", rdn); #endif @@ -593,7 +593,7 @@ preop_modrdn(Slapi_PBlock *pb) err = slapi_entry_add_rdn_values(e); if (err) { - slapi_log_error(SLAPI_LOG_PLUGIN, plugin_name, + slapi_log_err(SLAPI_LOG_PLUGIN, plugin_name, "preop_modrdn - MODRDN bad rdn value=%s\n", rdn); break; /* Bad DN */ } @@ -638,7 +638,7 @@ preop_modrdn(Slapi_PBlock *pb) if (slapi_dn_issuffix(slapi_sdn_get_dn(superior), *subtreeDN)) { #ifdef DEBUG - slapi_log_error(SLAPI_LOG_PLUGIN, plugin_name, + slapi_log_err(SLAPI_LOG_PLUGIN, plugin_name, "preop_modrdn - MODRDN subtree=%s\n", *subtreeDN); #endif @@ -713,7 +713,7 @@ NS7bitAttr_Init(Slapi_PBlock *pb) if (err) break; for (attr_count = 0; argv && argv[attr_count]; attr_count++) { - slapi_log_error(SLAPI_LOG_PLUGIN, plugin_name, "NS7bitAttr_Init - %d: %s\n", + slapi_log_err(SLAPI_LOG_PLUGIN, plugin_name, "NS7bitAttr_Init - %d: %s\n", attr_count, argv[attr_count]); } /* @@ -730,7 +730,7 @@ NS7bitAttr_Init(Slapi_PBlock *pb) for(;argc > 0;argc--, argv++) { err = slapi_dn_syntax_check(pb, *argv, 1); if (err) { - slapi_log_error(SLAPI_LOG_ERR, plugin_name, "NS7bitAttr_Init - " + slapi_log_err(SLAPI_LOG_ERR, plugin_name, "NS7bitAttr_Init - " "Invalid suffix: %s\n", *argv); continue; } @@ -761,28 +761,28 @@ NS7bitAttr_Init(Slapi_PBlock *pb) if (err) { if(err == -1){ - slapi_log_error(SLAPI_LOG_PLUGIN, plugin_name, "NS7bitAttr_Init - Error: %d\n", err); + slapi_log_err(SLAPI_LOG_PLUGIN, plugin_name, "NS7bitAttr_Init - Error: %d\n", err); } else if(err == -2){ - slapi_log_error(SLAPI_LOG_ERR, plugin_name, "NS7bitAttr_Init - " + slapi_log_err(SLAPI_LOG_ERR, plugin_name, "NS7bitAttr_Init - " "Invalid plugin arguments - missing arguments\n"); } else if(err == -3){ - slapi_log_error(SLAPI_LOG_ERR, plugin_name, "NS7bitAttr_Init - " + slapi_log_err(SLAPI_LOG_ERR, plugin_name, "NS7bitAttr_Init - " "Invalid plugin arguments - missing \",\" separator argument\n"); } else if(err == -4){ - slapi_log_error(SLAPI_LOG_ERR, plugin_name, "NS7bitAttr_Init - " + slapi_log_err(SLAPI_LOG_ERR, plugin_name, "NS7bitAttr_Init - " "Invalid plugin arguments - missing attributes\n"); } else if(err == -5){ - slapi_log_error(SLAPI_LOG_ERR, plugin_name, "NS7bitAttr_Init - " + slapi_log_err(SLAPI_LOG_ERR, plugin_name, "NS7bitAttr_Init - " "Invalid plugin arguments - missing suffix\n"); } else if(err == -6){ - slapi_log_error(SLAPI_LOG_ERR, plugin_name, "NS7bitAttr_Init - " + slapi_log_err(SLAPI_LOG_ERR, plugin_name, "NS7bitAttr_Init - " "Invalid plugin arguments - Invalid suffix list\n"); } err = -1; } else - slapi_log_error(SLAPI_LOG_PLUGIN, plugin_name, "NS7bitAttr_Init - plugin loaded\n"); + slapi_log_err(SLAPI_LOG_PLUGIN, plugin_name, "NS7bitAttr_Init - plugin loaded\n"); return err; } diff --git a/ldap/servers/plugins/uiduniq/uid.c b/ldap/servers/plugins/uiduniq/uid.c index 2aba17a..1b8cfa0 100644 --- a/ldap/servers/plugins/uiduniq/uid.c +++ b/ldap/servers/plugins/uiduniq/uid.c @@ -178,7 +178,7 @@ uniqueness_entry_to_config(Slapi_PBlock *pb, Slapi_Entry *config_entry) /* We are going to fill tmp_config in a first phase */ if ((tmp_config = (attr_uniqueness_config_t *) slapi_ch_calloc(1, sizeof (attr_uniqueness_config_t))) == NULL) { - slapi_log_error(SLAPI_LOG_ERR, plugin_name, "uniqueness_entry_to_config - " + slapi_log_err(SLAPI_LOG_ERR, plugin_name, "uniqueness_entry_to_config - " "Failed to allocate configuration\n"); rc = SLAPI_PLUGIN_FAILURE; goto done; @@ -210,7 +210,7 @@ uniqueness_entry_to_config(Slapi_PBlock *pb, Slapi_Entry *config_entry) tmp_config->attrs = (const char **) slapi_ch_calloc(i + 1, sizeof(char *)); for (i = 0; values && values[i]; i++) { tmp_config->attrs[i] = slapi_ch_strdup(values[i]); - slapi_log_error(SLAPI_LOG_PLUGIN, plugin_name, "uniqueness_entry_to_config - " + slapi_log_err(SLAPI_LOG_PLUGIN, plugin_name, "uniqueness_entry_to_config - " "Adding attribute %s to uniqueness set\n", tmp_config->attrs[i]); } slapi_ch_array_free(values); @@ -226,7 +226,7 @@ uniqueness_entry_to_config(Slapi_PBlock *pb, Slapi_Entry *config_entry) /* copy the valid subtree DN into the config */ for (i = 0, nb_subtrees = 0; values && values[i]; i++) { if (slapi_dn_syntax_check(pb, values[i], 1)) { /* syntax check failed */ - slapi_log_error(SLAPI_LOG_ERR, plugin_name, "uniqueness_entry_to_config - " + slapi_log_err(SLAPI_LOG_ERR, plugin_name, "uniqueness_entry_to_config - " "Invalid DN (skipped): %s\n", values[i]); continue; } @@ -246,7 +246,7 @@ uniqueness_entry_to_config(Slapi_PBlock *pb, Slapi_Entry *config_entry) /* copy the valid subtree DN into the config */ for (i = 0, nb_subtrees = 0; values && values[i]; i++) { if (slapi_dn_syntax_check(pb, values[i], 1)) { /* syntax check failed */ - slapi_log_error(SLAPI_LOG_ERR, plugin_name, "uniqueness_entry_to_config - " + slapi_log_err(SLAPI_LOG_ERR, plugin_name, "uniqueness_entry_to_config - " "Invalid DN (skipped): %s\n", values[i]); continue; } @@ -277,7 +277,7 @@ uniqueness_entry_to_config(Slapi_PBlock *pb, Slapi_Entry *config_entry) /* using the old style of configuration */ result = getArguments(pb, &attrName, &markerObjectClass, &requiredObjectClass); if (LDAP_OPERATIONS_ERROR == result) { - slapi_log_error(SLAPI_LOG_PLUGIN, plugin_name, "uniqueness_entry_to_config - " + slapi_log_err(SLAPI_LOG_PLUGIN, plugin_name, "uniqueness_entry_to_config - " "Unable to parse old style\n"); rc = SLAPI_PLUGIN_FAILURE; goto done; @@ -295,7 +295,7 @@ uniqueness_entry_to_config(Slapi_PBlock *pb, Slapi_Entry *config_entry) */ if (slapi_pblock_get(pb, SLAPI_PLUGIN_ARGC, &argc) || slapi_pblock_get(pb, SLAPI_PLUGIN_ARGV, &argv)) { - slapi_log_error(SLAPI_LOG_PLUGIN, plugin_name, "uniqueness_entry_to_config - " + slapi_log_err(SLAPI_LOG_PLUGIN, plugin_name, "uniqueness_entry_to_config - " "Only attribute name is valid\n"); rc = SLAPI_PLUGIN_FAILURE; goto done; @@ -310,7 +310,7 @@ uniqueness_entry_to_config(Slapi_PBlock *pb, Slapi_Entry *config_entry) /* Store the subtrees */ nb_subtrees = 0; if ((tmp_config->subtrees = (Slapi_DN **) slapi_ch_calloc(argc + 1, sizeof (Slapi_DN *))) == NULL) { - slapi_log_error(SLAPI_LOG_ERR, plugin_name, "uniqueness_entry_to_config - " + slapi_log_err(SLAPI_LOG_ERR, plugin_name, "uniqueness_entry_to_config - " "Fail to allocate subtree array\n"); rc = SLAPI_PLUGIN_FAILURE; goto done; @@ -319,7 +319,7 @@ uniqueness_entry_to_config(Slapi_PBlock *pb, Slapi_Entry *config_entry) for (; argc > 0; argc--, argv++) { if (slapi_dn_syntax_check(pb, *argv, 1)) { /* syntax check failed */ - slapi_log_error(SLAPI_LOG_ERR, plugin_name, "uniqueness_entry_to_config - " + slapi_log_err(SLAPI_LOG_ERR, plugin_name, "uniqueness_entry_to_config - " "Invalid DN (skipped): %s\n", *argv); continue; } @@ -363,7 +363,7 @@ uniqueness_entry_to_config(Slapi_PBlock *pb, Slapi_Entry *config_entry) /* Time to check that the new configuration is valid */ /* Check that we have 1 or more value */ if (tmp_config->attrs == NULL) { - slapi_log_error(SLAPI_LOG_ERR, plugin_name, "uniqueness_entry_to_config - Attribute name not defined \n"); + slapi_log_err(SLAPI_LOG_ERR, plugin_name, "uniqueness_entry_to_config - Attribute name not defined \n"); rc = SLAPI_PLUGIN_FAILURE; goto done; } @@ -384,13 +384,13 @@ uniqueness_entry_to_config(Slapi_PBlock *pb, Slapi_Entry *config_entry) if (tmp_config->subtrees == NULL) { /* Uniqueness is enforced on entries matching objectclass */ if (tmp_config->subtree_entries_oc == NULL) { - slapi_log_error(SLAPI_LOG_ERR, plugin_name, "uniqueness_entry_to_config - Objectclass for subtree entries is not defined\n"); + slapi_log_err(SLAPI_LOG_ERR, plugin_name, "uniqueness_entry_to_config - Objectclass for subtree entries is not defined\n"); rc = SLAPI_PLUGIN_FAILURE; goto done; } } else if (tmp_config->subtrees[0] == NULL) { /* Uniqueness is enforced on subtrees but none are defined */ - slapi_log_error(SLAPI_LOG_ERR, plugin_name, "uniqueness_entry_to_config - No valid subtree is defined \n"); + slapi_log_err(SLAPI_LOG_ERR, plugin_name, "uniqueness_entry_to_config - No valid subtree is defined \n"); rc = SLAPI_PLUGIN_FAILURE; goto done; } @@ -426,7 +426,7 @@ freePblock( Slapi_PBlock *spb ) { static int uid_op_error(int internal_error) { - slapi_log_error( + slapi_log_err( SLAPI_LOG_PLUGIN, plugin_name, "Internal error: %d\n", @@ -580,7 +580,7 @@ search(Slapi_DN *baseDN, const char **attrNames, Slapi_Attr *attr, #ifdef DEBUG /* Fix this later to print all the attr names */ - slapi_log_error(SLAPI_LOG_PLUGIN, plugin_name, + slapi_log_err(SLAPI_LOG_PLUGIN, plugin_name, "search - SEARCH baseDN=%s attr=%s target=%s\n", slapi_sdn_get_dn(baseDN), attrNames[0], target?slapi_sdn_get_dn(target):"None"); #endif @@ -622,7 +622,7 @@ search(Slapi_DN *baseDN, const char **attrNames, Slapi_Attr *attr, } #ifdef DEBUG - slapi_log_error(SLAPI_LOG_PLUGIN, plugin_name, + slapi_log_err(SLAPI_LOG_PLUGIN, plugin_name, "search - SEARCH result = %d\n", result); #endif @@ -658,7 +658,7 @@ search_one_berval(Slapi_DN *baseDN, const char **attrNames, filter = create_filter(attrNames, value, requiredObjectClass); #ifdef DEBUG - slapi_log_error(SLAPI_LOG_PLUGIN, plugin_name, + slapi_log_err(SLAPI_LOG_PLUGIN, plugin_name, "search_one_berval - SEARCH filter=%s\n", filter); #endif @@ -690,7 +690,7 @@ search_one_berval(Slapi_DN *baseDN, const char **attrNames, for(;*entries;entries++) { #ifdef DEBUG - slapi_log_error(SLAPI_LOG_PLUGIN, plugin_name, + slapi_log_err(SLAPI_LOG_PLUGIN, plugin_name, "search_one_berval - SEARCH entry dn=%s\n", slapi_entry_get_dn(*entries)); #endif @@ -726,7 +726,7 @@ search_one_berval(Slapi_DN *baseDN, const char **attrNames, } #ifdef DEBUG - slapi_log_error(SLAPI_LOG_PLUGIN, plugin_name, + slapi_log_err(SLAPI_LOG_PLUGIN, plugin_name, "search_one_berval - SEARCH complete result=%d\n", result); #endif END @@ -950,7 +950,7 @@ preop_add(Slapi_PBlock *pb) char * attr_friendly = NULL; #ifdef DEBUG - slapi_log_error(SLAPI_LOG_PLUGIN, plugin_name, "ADD begin\n"); + slapi_log_err(SLAPI_LOG_PLUGIN, plugin_name, "ADD begin\n"); #endif result = LDAP_SUCCESS; @@ -981,7 +981,7 @@ preop_add(Slapi_PBlock *pb) } slapi_pblock_get(pb, SLAPI_PLUGIN_PRIVATE, &config); if (config == NULL) { - slapi_log_error(SLAPI_LOG_ERR, plugin_name, "preop_add - Failed to retrieve the config\n"); + slapi_log_err(SLAPI_LOG_ERR, plugin_name, "preop_add - Failed to retrieve the config\n"); result = LDAP_OPERATIONS_ERROR; break; } @@ -1001,7 +1001,7 @@ preop_add(Slapi_PBlock *pb) if (err) { result = uid_op_error(51); break; } #ifdef DEBUG - slapi_log_error(SLAPI_LOG_PLUGIN, plugin_name, "preop_add - ADD target=%s\n", slapi_sdn_get_dn(sdn)); + slapi_log_err(SLAPI_LOG_PLUGIN, plugin_name, "preop_add - ADD target=%s\n", slapi_sdn_get_dn(sdn)); #endif /* @@ -1052,7 +1052,7 @@ preop_add(Slapi_PBlock *pb) if (result) { - slapi_log_error(SLAPI_LOG_PLUGIN, plugin_name, + slapi_log_err(SLAPI_LOG_PLUGIN, plugin_name, "preop_add - ADD result %d\n", result); if (result == LDAP_CONSTRAINT_VIOLATION) { @@ -1103,7 +1103,7 @@ preop_modify(Slapi_PBlock *pb) char *attr_friendly = NULL; #ifdef DEBUG - slapi_log_error(SLAPI_LOG_PLUGIN, plugin_name, + slapi_log_err(SLAPI_LOG_PLUGIN, plugin_name, "preop_modify - MODIFY begin\n"); #endif @@ -1131,7 +1131,7 @@ preop_modify(Slapi_PBlock *pb) slapi_pblock_get(pb, SLAPI_PLUGIN_PRIVATE, &config); if (config == NULL) { - slapi_log_error(SLAPI_LOG_ERR, plugin_name, "preop_modify - Failed to retrieve the config\n"); + slapi_log_err(SLAPI_LOG_ERR, plugin_name, "preop_modify - Failed to retrieve the config\n"); result = LDAP_OPERATIONS_ERROR; break; } @@ -1219,7 +1219,7 @@ preop_modify(Slapi_PBlock *pb) freePblock(spb); if (result) { - slapi_log_error(SLAPI_LOG_PLUGIN, plugin_name, + slapi_log_err(SLAPI_LOG_PLUGIN, plugin_name, "preop_modify - MODIFY result %d\n", result); if (result == LDAP_CONSTRAINT_VIOLATION) { @@ -1255,7 +1255,7 @@ preop_modrdn(Slapi_PBlock *pb) struct attr_uniqueness_config *config = NULL; #ifdef DEBUG - slapi_log_error(SLAPI_LOG_PLUGIN, plugin_name, + slapi_log_err(SLAPI_LOG_PLUGIN, plugin_name, "preop_modrdn - MODRDN begin\n"); #endif @@ -1283,7 +1283,7 @@ preop_modrdn(Slapi_PBlock *pb) slapi_pblock_get(pb, SLAPI_PLUGIN_PRIVATE, &config); if (config == NULL) { - slapi_log_error(SLAPI_LOG_ERR, plugin_name, "preop_modrdn - Failed to retrieve the config\n"); + slapi_log_err(SLAPI_LOG_ERR, plugin_name, "preop_modrdn - Failed to retrieve the config\n"); result = LDAP_OPERATIONS_ERROR; break; } @@ -1319,7 +1319,7 @@ preop_modrdn(Slapi_PBlock *pb) err = slapi_pblock_get(pb, SLAPI_MODRDN_NEWRDN, &rdn); if (err) { result = uid_op_error(33); break; } #ifdef DEBUG - slapi_log_error(SLAPI_LOG_PLUGIN, plugin_name, + slapi_log_err(SLAPI_LOG_PLUGIN, plugin_name, "preop_modrdn - MODRDN newrdn=%s\n", rdn); #endif @@ -1386,7 +1386,7 @@ preop_modrdn(Slapi_PBlock *pb) if (result) { - slapi_log_error(SLAPI_LOG_PLUGIN, plugin_name, + slapi_log_err(SLAPI_LOG_PLUGIN, plugin_name, "preop_modrdn - MODRDN result %d\n", result); if (result == LDAP_CONSTRAINT_VIOLATION) { @@ -1501,11 +1501,11 @@ NSUniqueAttr_Init(Slapi_PBlock *pb) END if (err) { - slapi_log_error(SLAPI_LOG_PLUGIN, plugin_name, "NSUniqueAttr_Init - Error: %d\n", err); + slapi_log_err(SLAPI_LOG_PLUGIN, plugin_name, "NSUniqueAttr_Init - Error: %d\n", err); err = -1; } else - slapi_log_error(SLAPI_LOG_PLUGIN, plugin_name, "NSUniqueAttr_Init - plugin loaded\n"); + slapi_log_err(SLAPI_LOG_PLUGIN, plugin_name, "NSUniqueAttr_Init - plugin loaded\n"); return err; } diff --git a/ldap/servers/plugins/uiduniq/utils.c b/ldap/servers/plugins/uiduniq/utils.c index 61b1a86..4fad2f0 100644 --- a/ldap/servers/plugins/uiduniq/utils.c +++ b/ldap/servers/plugins/uiduniq/utils.c @@ -39,7 +39,7 @@ static char *plugin_name = "utils"; */ int op_error(int internal_error) { - slapi_log_error(SLAPI_LOG_PLUGIN, plugin_name, + slapi_log_err(SLAPI_LOG_PLUGIN, plugin_name, "Internal error: %d\n", internal_error); return LDAP_OPERATIONS_ERROR; diff --git a/ldap/servers/plugins/usn/usn.c b/ldap/servers/plugins/usn/usn.c index 3a7796b..6fe8d2e 100644 --- a/ldap/servers/plugins/usn/usn.c +++ b/ldap/servers/plugins/usn/usn.c @@ -52,7 +52,7 @@ usn_init(Slapi_PBlock *pb) int is_betxn = 0; const char *plugintype; - slapi_log_error(SLAPI_LOG_TRACE, USN_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_TRACE, USN_PLUGIN_SUBSYSTEM, "--> usn_init\n"); slapi_pblock_get(pb, SLAPI_PLUGIN_IDENTITY, &identity); @@ -68,7 +68,7 @@ usn_init(Slapi_PBlock *pb) SLAPI_PLUGIN_VERSION_01) != 0 || slapi_pblock_set(pb, SLAPI_PLUGIN_DESCRIPTION, (void *)&pdesc) != 0) { - slapi_log_error(SLAPI_LOG_ERR, USN_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_ERR, USN_PLUGIN_SUBSYSTEM, "usn_init - Failed to register version & description\n"); rc = -1; goto bail; @@ -77,7 +77,7 @@ usn_init(Slapi_PBlock *pb) (void *)usn_start) != 0 || slapi_pblock_set(pb, SLAPI_PLUGIN_CLOSE_FN, (void *)usn_close) != 0 ) { - slapi_log_error(SLAPI_LOG_ERR, USN_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_ERR, USN_PLUGIN_SUBSYSTEM, "usn_init - Failed to register close callback & task\n"); rc = -1; goto bail; @@ -109,7 +109,7 @@ usn_init(Slapi_PBlock *pb) "USN bepostoperation plugin", NULL, identity); usn_set_identity(identity); bail: - slapi_log_error(SLAPI_LOG_TRACE, USN_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_TRACE, USN_PLUGIN_SUBSYSTEM, "<-- usn_init\n"); return rc; } @@ -122,7 +122,7 @@ usn_preop_init(Slapi_PBlock *pb) int predel = SLAPI_PLUGIN_PRE_DELETE_FN; if (slapi_pblock_set(pb, predel, (void *)usn_preop_delete) != 0) { - slapi_log_error(SLAPI_LOG_ERR, USN_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_ERR, USN_PLUGIN_SUBSYSTEM, "usn_preop_init - Failed to register preop plugin\n"); rc = SLAPI_PLUGIN_FAILURE; } @@ -143,7 +143,7 @@ usn_bepreop_init(Slapi_PBlock *pb) * transaction start */ if ((slapi_pblock_set(pb, premod, (void *)usn_bepreop_modify) != 0) || (slapi_pblock_set(pb, premdn, (void *)usn_bepreop_modify) != 0)) { - slapi_log_error(SLAPI_LOG_ERR, USN_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_ERR, USN_PLUGIN_SUBSYSTEM, "usn_bepreop_init - Failed to register bepreop plugin\n"); rc = SLAPI_PLUGIN_FAILURE; } @@ -160,7 +160,7 @@ usn_betxnpreop_init(Slapi_PBlock *pb) if ((slapi_pblock_set(pb, preadd, (void *)usn_betxnpreop_add) != 0) || (slapi_pblock_set(pb, predel, (void *)usn_betxnpreop_delete) != 0)) { - slapi_log_error(SLAPI_LOG_ERR, USN_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_ERR, USN_PLUGIN_SUBSYSTEM, "usn_betxnpreop_init - Failed to register betxnpreop plugin\n"); rc = SLAPI_PLUGIN_FAILURE; } @@ -195,7 +195,7 @@ usn_bepostop_init(Slapi_PBlock *pb) (slapi_pblock_set(pb, postdel, (void *)usn_bepostop_delete) != 0) || (slapi_pblock_set(pb, postmod, (void *)usn_bepostop_modify) != 0) || (slapi_pblock_set(pb, postmdn, (void *)usn_bepostop) != 0)) { - slapi_log_error(SLAPI_LOG_ERR, USN_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_ERR, USN_PLUGIN_SUBSYSTEM, "usn_bepostop_init - Failed to register bepostop plugin\n"); rc = SLAPI_PLUGIN_FAILURE; } @@ -227,7 +227,7 @@ usn_start(Slapi_PBlock *pb) int rc = SLAPI_PLUGIN_SUCCESS; Slapi_Value *value; - slapi_log_error(SLAPI_LOG_TRACE, USN_PLUGIN_SUBSYSTEM, "--> usn_start\n"); + slapi_log_err(SLAPI_LOG_TRACE, USN_PLUGIN_SUBSYSTEM, "--> usn_start\n"); rc = usn_rootdse_init(pb); rc |= usn_cleanup_start(pb); @@ -245,7 +245,7 @@ usn_start(Slapi_PBlock *pb) for (i = slapi_valueset_first_value(vs, &v); i != -1; i = slapi_valueset_next_value(vs, i, &v)) { - slapi_log_error(SLAPI_LOG_ERR, USN_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_ERR, USN_PLUGIN_SUBSYSTEM, "nsds5ReplicatedAttributeList: %s\n", slapi_value_get_string(v)); } @@ -261,7 +261,7 @@ usn_start(Slapi_PBlock *pb) slapi_value_free(&value); bail: - slapi_log_error(SLAPI_LOG_TRACE, USN_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_TRACE, USN_PLUGIN_SUBSYSTEM, "<-- usn_start (rc: %d)\n", rc); return rc; } @@ -269,13 +269,13 @@ bail: static int usn_close(Slapi_PBlock *pb) { - slapi_log_error(SLAPI_LOG_TRACE, USN_PLUGIN_SUBSYSTEM, "--> usn_close\n"); + slapi_log_err(SLAPI_LOG_TRACE, USN_PLUGIN_SUBSYSTEM, "--> usn_close\n"); usn_cleanup_close(); slapi_config_remove_callback(SLAPI_OPERATION_SEARCH, DSE_FLAG_PREOP, "", LDAP_SCOPE_BASE, "(objectclass=*)", usn_rootdse_search); - slapi_log_error(SLAPI_LOG_TRACE, USN_PLUGIN_SUBSYSTEM, "<-- usn_close\n"); + slapi_log_err(SLAPI_LOG_TRACE, USN_PLUGIN_SUBSYSTEM, "<-- usn_close\n"); return SLAPI_PLUGIN_SUCCESS; } @@ -288,18 +288,18 @@ usn_preop_delete(Slapi_PBlock *pb) { Slapi_Operation *op = NULL; - slapi_log_error(SLAPI_LOG_TRACE, USN_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_TRACE, USN_PLUGIN_SUBSYSTEM, "--> usn_preop_delete\n"); slapi_pblock_get(pb, SLAPI_OPERATION, &op); if (NULL == op) { - slapi_log_error(SLAPI_LOG_ERR, USN_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_ERR, USN_PLUGIN_SUBSYSTEM, "usn_preop_delete - Failed; no operation.\n"); return SLAPI_PLUGIN_FAILURE; } slapi_operation_set_replica_attr_handler(op, (void *)usn_get_attr); - slapi_log_error(SLAPI_LOG_TRACE, USN_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_TRACE, USN_PLUGIN_SUBSYSTEM, "<-- usn_preop_delete\n"); return SLAPI_PLUGIN_SUCCESS; @@ -316,7 +316,7 @@ _usn_add_next_usn(Slapi_Entry *e, Slapi_Backend *be) return; } - slapi_log_error(SLAPI_LOG_TRACE, USN_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_TRACE, USN_PLUGIN_SUBSYSTEM, "--> _usn_add_next_usn\n"); /* add next USN to the entry; "be" contains the usn counter */ @@ -336,7 +336,7 @@ _usn_add_next_usn(Slapi_Entry *e, Slapi_Backend *be) } slapi_ch_free_string(&usn_berval.bv_val); - slapi_log_error(SLAPI_LOG_TRACE, USN_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_TRACE, USN_PLUGIN_SUBSYSTEM, "<-- _usn_add_next_usn\n"); return; @@ -355,7 +355,7 @@ _usn_mod_next_usn(LDAPMod ***mods, Slapi_Backend *be) return LDAP_UNWILLING_TO_PERFORM; } - slapi_log_error(SLAPI_LOG_TRACE, USN_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_TRACE, USN_PLUGIN_SUBSYSTEM, "--> _usn_mod_next_usn\n"); /* add next USN to the mods; "be" contains the usn counter */ @@ -373,7 +373,7 @@ _usn_mod_next_usn(LDAPMod ***mods, Slapi_Backend *be) *mods = slapi_mods_get_ldapmods_passout(&smods); - slapi_log_error(SLAPI_LOG_TRACE, USN_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_TRACE, USN_PLUGIN_SUBSYSTEM, "<-- _usn_mod_next_usn\n"); return LDAP_SUCCESS; } @@ -388,7 +388,7 @@ usn_betxnpreop_add(Slapi_PBlock *pb) Slapi_Backend *be = NULL; int rc = SLAPI_PLUGIN_SUCCESS; - slapi_log_error(SLAPI_LOG_TRACE, USN_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_TRACE, USN_PLUGIN_SUBSYSTEM, "--> usn_betxnpreop_add\n"); /* add next USN to the entry; "be" contains the usn counter */ @@ -408,7 +408,7 @@ usn_betxnpreop_add(Slapi_PBlock *pb) } _usn_add_next_usn(e, be); bail: - slapi_log_error(SLAPI_LOG_TRACE, USN_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_TRACE, USN_PLUGIN_SUBSYSTEM, "<-- usn_betxnpreop_add\n"); return rc; @@ -425,7 +425,7 @@ usn_betxnpreop_delete(Slapi_PBlock *pb) Slapi_Backend *be = NULL; int rc = SLAPI_PLUGIN_SUCCESS; - slapi_log_error(SLAPI_LOG_TRACE, USN_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_TRACE, USN_PLUGIN_SUBSYSTEM, "--> usn_betxnpreop_delete\n"); /* add next USN to the entry; "be" contains the usn counter */ @@ -445,7 +445,7 @@ usn_betxnpreop_delete(Slapi_PBlock *pb) } _usn_add_next_usn(e, be); bail: - slapi_log_error(SLAPI_LOG_TRACE, USN_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_TRACE, USN_PLUGIN_SUBSYSTEM, "<-- usn_betxnpreop_delete\n"); return rc; @@ -463,14 +463,14 @@ usn_bepreop_modify (Slapi_PBlock *pb) Slapi_Backend *be = NULL; int rc = SLAPI_PLUGIN_SUCCESS; - slapi_log_error(SLAPI_LOG_TRACE, USN_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_TRACE, USN_PLUGIN_SUBSYSTEM, "--> usn_bepreop_modify\n"); /* add/replace next USN to the mods; "be" contains the usn counter */ slapi_pblock_get(pb, SLAPI_MODIFY_MODS, &mods); slapi_pblock_get(pb, SLAPI_BACKEND, &be); if (NULL == be) { - slapi_log_error(SLAPI_LOG_ERR, USN_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_ERR, USN_PLUGIN_SUBSYSTEM, "usn_bepreop_modify - No backend.\n"); rc = LDAP_PARAM_ERROR; slapi_pblock_set(pb, SLAPI_RESULT_CODE, &rc); @@ -481,7 +481,7 @@ usn_bepreop_modify (Slapi_PBlock *pb) slapi_pblock_set(pb, SLAPI_MODIFY_MODS, mods); } bail: - slapi_log_error(SLAPI_LOG_TRACE, USN_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_TRACE, USN_PLUGIN_SUBSYSTEM, "<-- usn_bepreop_modify\n"); return rc; } @@ -493,7 +493,7 @@ usn_bepostop (Slapi_PBlock *pb) int rc = SLAPI_PLUGIN_FAILURE; Slapi_Backend *be = NULL; - slapi_log_error(SLAPI_LOG_TRACE, USN_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_TRACE, USN_PLUGIN_SUBSYSTEM, "--> usn_bepostop\n"); /* if op is not successful, don't increment the counter */ @@ -516,7 +516,7 @@ usn_bepostop (Slapi_PBlock *pb) slapi_counter_increment(be->be_usn_counter); } bail: - slapi_log_error(SLAPI_LOG_TRACE, USN_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_TRACE, USN_PLUGIN_SUBSYSTEM, "<-- usn_bepostop\n"); return rc; @@ -531,7 +531,7 @@ usn_bepostop_modify (Slapi_PBlock *pb) LDAPMod **mods = NULL; int i; - slapi_log_error(SLAPI_LOG_TRACE, USN_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_TRACE, USN_PLUGIN_SUBSYSTEM, "--> usn_bepostop_modify\n"); /* if op is not successful, don't increment the counter */ @@ -546,7 +546,7 @@ usn_bepostop_modify (Slapi_PBlock *pb) for (i = 0; mods && mods[i]; i++) { if (0 == strcasecmp(mods[i]->mod_type, SLAPI_ATTR_ENTRYUSN)) { if (mods[i]->mod_op & LDAP_MOD_IGNORE) { - slapi_log_error(SLAPI_LOG_TRACE, USN_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_TRACE, USN_PLUGIN_SUBSYSTEM, "usn_bepostop_modify - MOD_IGNORE detected\n"); goto bail; /* conflict occurred. skip incrementing the counter. */ @@ -568,7 +568,7 @@ usn_bepostop_modify (Slapi_PBlock *pb) slapi_counter_increment(be->be_usn_counter); } bail: - slapi_log_error(SLAPI_LOG_TRACE, USN_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_TRACE, USN_PLUGIN_SUBSYSTEM, "<-- usn_bepostop_modify\n"); return rc; @@ -582,7 +582,7 @@ usn_bepostop_delete (Slapi_PBlock *pb) int rc = SLAPI_PLUGIN_FAILURE; Slapi_Backend *be = NULL; - slapi_log_error(SLAPI_LOG_TRACE, USN_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_TRACE, USN_PLUGIN_SUBSYSTEM, "--> usn_bepostop_delete\n"); /* if op is not successful, don't increment the counter */ @@ -605,7 +605,7 @@ usn_bepostop_delete (Slapi_PBlock *pb) slapi_counter_increment(be->be_usn_counter); } bail: - slapi_log_error(SLAPI_LOG_TRACE, USN_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_TRACE, USN_PLUGIN_SUBSYSTEM, "<-- usn_bepostop_delete\n"); return rc; @@ -662,7 +662,7 @@ usn_rootdse_search(Slapi_PBlock *pb, Slapi_Entry* e, Slapi_Entry* entryAfter, char *attr_subp = NULL; int isglobal = config_get_entryusn_global(); - slapi_log_error(SLAPI_LOG_TRACE, USN_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_TRACE, USN_PLUGIN_SUBSYSTEM, "--> usn_rootdse_search\n"); usn_berval.bv_val = counter_buf; @@ -725,7 +725,7 @@ usn_rootdse_search(Slapi_PBlock *pb, Slapi_Entry* e, Slapi_Entry* entryAfter, slapi_ch_free_string(&cookie); slapi_ch_free_string(&attr); - slapi_log_error(SLAPI_LOG_TRACE, USN_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_TRACE, USN_PLUGIN_SUBSYSTEM, "<-- usn_rootdse_search\n"); return SLAPI_DSE_CALLBACK_OK; } diff --git a/ldap/servers/plugins/usn/usn_cleanup.c b/ldap/servers/plugins/usn/usn_cleanup.c index 1e20f1e..4338854 100644 --- a/ldap/servers/plugins/usn/usn_cleanup.c +++ b/ldap/servers/plugins/usn/usn_cleanup.c @@ -59,15 +59,15 @@ usn_cleanup_thread(void *arg) if (!task) { return; /* no task */ } - slapi_log_error(SLAPI_LOG_TRACE, USN_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_TRACE, USN_PLUGIN_SUBSYSTEM, "--> usn_cleanup_thread\n"); slapi_task_inc_refcount(task); - slapi_log_error(SLAPI_LOG_PLUGIN, USN_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_PLUGIN, USN_PLUGIN_SUBSYSTEM, "usn_cleanup_thread - refcount incremented.\n" ); if (NULL == usn_get_identity()) { /* plugin is not initialized */ slapi_task_log_notice(task, "USN plugin is not initialized\n"); - slapi_log_error(SLAPI_LOG_ERR, USN_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_ERR, USN_PLUGIN_SUBSYSTEM, "usn_cleanup_thread - USN plugin is not initialized\n"); rv = -1; filter = NULL; /* so we don't try to free it */ @@ -102,7 +102,7 @@ usn_cleanup_thread(void *arg) slapi_task_log_status(task, "USN tombstone cleanup: no such suffix %s.\n", cleanup_data->suffix); - slapi_log_error(SLAPI_LOG_ERR, USN_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_ERR, USN_PLUGIN_SUBSYSTEM, "usn_cleanup_thread - No such suffix %s.\n", cleanup_data->suffix); goto bail; @@ -113,7 +113,7 @@ usn_cleanup_thread(void *arg) slapi_task_log_status(task, "USN tombstone cleanup: searching tombstone entries in " "%s failed; (%d).\n", cleanup_data->suffix, rv); - slapi_log_error(SLAPI_LOG_ERR, USN_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_ERR, USN_PLUGIN_SUBSYSTEM, "usn_cleanup_thread - Searching tombstone entries in " "%s failed; (%d).\n", cleanup_data->suffix, rv); goto bail; @@ -122,7 +122,7 @@ usn_cleanup_thread(void *arg) slapi_task_log_notice(task, "USN tombstone cleanup task starts (suffix: %s) ...\n", cleanup_data->suffix); - slapi_log_error(SLAPI_LOG_INFO, USN_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_INFO, USN_PLUGIN_SUBSYSTEM, "usn_cleanup_thread - USN tombstone cleanup task starts (suffix: %s) ...\n", cleanup_data->suffix); @@ -138,7 +138,7 @@ usn_cleanup_thread(void *arg) if(slapi_is_shutting_down()){ slapi_task_log_notice(task, "USN tombstone cleanup task aborted due to shutdown."); slapi_task_log_status(task, "USN tombstone cleanup task aborted due to shutdown."); - slapi_log_error(SLAPI_LOG_NOTICE, USN_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_NOTICE, USN_PLUGIN_SUBSYSTEM, "usn_cleanup_thread - Task aborted due to shutdown.\n"); goto bail; } @@ -154,7 +154,7 @@ usn_cleanup_thread(void *arg) slapi_task_log_status(task, "USN tombstone cleanup: deleting %s failed; (%d).\n", slapi_sdn_get_dn(sdn), delrv); - slapi_log_error(SLAPI_LOG_ERR, USN_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_ERR, USN_PLUGIN_SUBSYSTEM, "usn_cleanup_thread - Deleting %s failed; (%d).\n", slapi_sdn_get_dn(sdn), delrv); rv = delrv; @@ -165,7 +165,7 @@ usn_cleanup_thread(void *arg) } slapi_task_log_notice(task, "USN tombstone cleanup task finished."); slapi_task_log_status(task, "USN tombstone cleanup task finished."); - slapi_log_error(SLAPI_LOG_INFO, USN_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_INFO, USN_PLUGIN_SUBSYSTEM, "usn_cleanup_thread - USN tombstone cleanup task finished.\n"); bail: slapi_free_search_results_internal(search_pb); @@ -178,9 +178,9 @@ bail: /* this will queue the destruction of the task */ slapi_task_finish(task, rv); slapi_task_dec_refcount(task); - slapi_log_error(SLAPI_LOG_PLUGIN, USN_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_PLUGIN, USN_PLUGIN_SUBSYSTEM, "usn_cleanup_thread - refcount decremented.\n"); - slapi_log_error(SLAPI_LOG_TRACE, USN_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_TRACE, USN_PLUGIN_SUBSYSTEM, "<-- usn_cleanup_thread\n"); } @@ -198,7 +198,7 @@ _usn_cleanup_is_mmr_enabled(const char *suffix) base_dn = slapi_create_dn_string("cn=replica,cn=\"%s\",%s", suffix, MAPPING_TREE_BASE_DN); if (NULL == base_dn) { - slapi_log_error(SLAPI_LOG_ERR, USN_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_ERR, USN_PLUGIN_SUBSYSTEM, "_usn_cleanup_is_mmr_enabled - Failed to normalize " "mappingtree dn for %s\n", suffix); return 1; @@ -240,7 +240,7 @@ usn_cleanup_add(Slapi_PBlock *pb, Slapi_Entry *e, Slapi_Entry *eAfter, Slapi_Backend *be = NULL; const Slapi_DN *be_suffix = NULL; - slapi_log_error(SLAPI_LOG_TRACE, USN_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_TRACE, USN_PLUGIN_SUBSYSTEM, "--> usn_cleanup_add\n"); *returncode = LDAP_SUCCESS; @@ -261,7 +261,7 @@ usn_cleanup_add(Slapi_PBlock *pb, Slapi_Entry *e, Slapi_Entry *eAfter, maxusn = slapi_entry_attr_get_charptr(e, "maxusn_to_delete"); if (!suffix && !backend) { - slapi_log_error(SLAPI_LOG_ERR, USN_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_ERR, USN_PLUGIN_SUBSYSTEM, "usn_cleanup_add - Both suffix and backend are missing.\n"); *returncode = LDAP_PARAM_ERROR; rv = SLAPI_DSE_CALLBACK_ERROR; @@ -275,7 +275,7 @@ usn_cleanup_add(Slapi_PBlock *pb, Slapi_Entry *e, Slapi_Entry *eAfter, if (be_suffix) { suffix = slapi_ch_strdup(slapi_sdn_get_ndn(be_suffix)); } else { - slapi_log_error(SLAPI_LOG_ERR, USN_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_ERR, USN_PLUGIN_SUBSYSTEM, "usn_cleanup_add - Backend %s is invalid.\n", backend); *returncode = LDAP_PARAM_ERROR; rv = SLAPI_DSE_CALLBACK_ERROR; @@ -286,7 +286,7 @@ usn_cleanup_add(Slapi_PBlock *pb, Slapi_Entry *e, Slapi_Entry *eAfter, /* The suffix is the target of replication, * we don't want to clean up tombstones used by MMR */ if (_usn_cleanup_is_mmr_enabled(suffix)) { - slapi_log_error(SLAPI_LOG_ERR, USN_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_ERR, USN_PLUGIN_SUBSYSTEM, "usn_cleanup_add - Suffix %s is replicated. Unwilling to " "perform cleaning up tombstones.\n", suffix); *returncode = LDAP_UNWILLING_TO_PERFORM; @@ -297,7 +297,7 @@ usn_cleanup_add(Slapi_PBlock *pb, Slapi_Entry *e, Slapi_Entry *eAfter, /* allocate new task now */ task = slapi_plugin_new_task(slapi_entry_get_ndn(e), arg); if (task == NULL) { - slapi_log_error(SLAPI_LOG_ERR, USN_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_ERR, USN_PLUGIN_SUBSYSTEM, "usn_cleanup_add - Unable to allocate new task.\n"); *returncode = LDAP_OPERATIONS_ERROR; rv = SLAPI_DSE_CALLBACK_ERROR; @@ -323,7 +323,7 @@ usn_cleanup_add(Slapi_PBlock *pb, Slapi_Entry *e, Slapi_Entry *eAfter, (void *)task, PR_PRIORITY_NORMAL, PR_GLOBAL_THREAD, PR_UNJOINABLE_THREAD, SLAPD_DEFAULT_THREAD_STACKSIZE); if (thread == NULL) { - slapi_log_error(SLAPI_LOG_ERR, USN_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_ERR, USN_PLUGIN_SUBSYSTEM, "usn_cleanup_add - Unable to create task thread.\n"); *returncode = LDAP_OPERATIONS_ERROR; rv = SLAPI_DSE_CALLBACK_ERROR; @@ -337,7 +337,7 @@ bail: slapi_ch_free_string(&suffix); slapi_ch_free_string(&backend); slapi_ch_free_string(&maxusn); - slapi_log_error(SLAPI_LOG_TRACE, USN_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_TRACE, USN_PLUGIN_SUBSYSTEM, "<-- usn_cleanup_add\n"); return rv; } @@ -345,7 +345,7 @@ bail: static void usn_cleanup_task_destructor(Slapi_Task *task) { - slapi_log_error(SLAPI_LOG_PLUGIN, USN_PLUGIN_SUBSYSTEM, "usn_cleanup_task_destructor -->\n"); + slapi_log_err(SLAPI_LOG_PLUGIN, USN_PLUGIN_SUBSYSTEM, "usn_cleanup_task_destructor -->\n"); if (task) { struct usn_cleanup_data *mydata = (struct usn_cleanup_data *)slapi_task_get_data(task); while (slapi_task_get_refcount(task) > 0) { @@ -360,5 +360,5 @@ usn_cleanup_task_destructor(Slapi_Task *task) slapi_ch_free((void **)&mydata); } } - slapi_log_error(SLAPI_LOG_PLUGIN, USN_PLUGIN_SUBSYSTEM, "usn_cleanup_task_destructor <--\n"); + slapi_log_err(SLAPI_LOG_PLUGIN, USN_PLUGIN_SUBSYSTEM, "usn_cleanup_task_destructor <--\n"); } diff --git a/ldap/servers/plugins/vattrsp_template/vattrsp.c b/ldap/servers/plugins/vattrsp_template/vattrsp.c index 149dc9d..7c67f0d 100644 --- a/ldap/servers/plugins/vattrsp_template/vattrsp.c +++ b/ldap/servers/plugins/vattrsp_template/vattrsp.c @@ -103,7 +103,7 @@ int vattrsp_init( Slapi_PBlock *pb ) int ret = 0; void * plugin_identity=NULL; - slapi_log_error(SLAPI_LOG_TRACE, VATTRSP_PLUGIN_SUBSYSTEM,"--> vattrsp_init\n"); + slapi_log_err(SLAPI_LOG_TRACE, VATTRSP_PLUGIN_SUBSYSTEM,"--> vattrsp_init\n"); /* * Store the plugin identity for later use. @@ -123,12 +123,12 @@ int vattrsp_init( Slapi_PBlock *pb ) slapi_pblock_set( pb, SLAPI_PLUGIN_DESCRIPTION, (void *)&pdesc ) != 0 ) { - slapi_log_error(SLAPI_LOG_ERR, VATTRSP_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_ERR, VATTRSP_PLUGIN_SUBSYSTEM, "vattrsp_init - Failed to register plugin\n" ); ret = -1; } - slapi_log_error(SLAPI_LOG_TRACE, VATTRSP_PLUGIN_SUBSYSTEM,"<-- vattrsp_init\n"); + slapi_log_err(SLAPI_LOG_TRACE, VATTRSP_PLUGIN_SUBSYSTEM,"<-- vattrsp_init\n"); return ret; } @@ -158,7 +158,7 @@ int vattrsp_start( Slapi_PBlock *pb ) { int ret = 0; - slapi_log_error(SLAPI_LOG_TRACE, VATTRSP_PLUGIN_SUBSYSTEM,"--> vattrsp_start\n"); + slapi_log_err(SLAPI_LOG_TRACE, VATTRSP_PLUGIN_SUBSYSTEM,"--> vattrsp_start\n"); /* register this vattr service provider with vattr subsystem */ if (slapi_vattrspi_register((vattr_sp_handle **)&vattr_handle, @@ -166,7 +166,7 @@ int vattrsp_start( Slapi_PBlock *pb ) vattrsp_vattr_compare, vattrsp_vattr_types) != 0) { - slapi_log_error(SLAPI_LOG_ERR, VATTRSP_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_ERR, VATTRSP_PLUGIN_SUBSYSTEM, "vattrsp_start - Cannot register as service provider\n" ); ret = -1; goto out; @@ -180,7 +180,7 @@ int vattrsp_start( Slapi_PBlock *pb ) slapi_vattrspi_regattr((vattr_sp_handle *)vattr_handle, "dummyAttr", NULL, NULL); out: - slapi_log_error(SLAPI_LOG_TRACE, VATTRSP_PLUGIN_SUBSYSTEM,"<-- vattrsp_start\n"); + slapi_log_err(SLAPI_LOG_TRACE, VATTRSP_PLUGIN_SUBSYSTEM,"<-- vattrsp_start\n"); return ret; } @@ -196,11 +196,11 @@ out: */ int vattrsp_close( Slapi_PBlock *pb ) { - slapi_log_error(SLAPI_LOG_TRACE, VATTRSP_PLUGIN_SUBSYSTEM,"--> vattrsp_close\n"); + slapi_log_err(SLAPI_LOG_TRACE, VATTRSP_PLUGIN_SUBSYSTEM,"--> vattrsp_close\n"); /* clean up stuff here */ - slapi_log_error(SLAPI_LOG_TRACE, VATTRSP_PLUGIN_SUBSYSTEM,"<-- vattrsp_close\n"); + slapi_log_err(SLAPI_LOG_TRACE, VATTRSP_PLUGIN_SUBSYSTEM,"<-- vattrsp_close\n"); return 0; } @@ -233,7 +233,7 @@ int vattrsp_vattr_get( { int ret = SLAPI_VIRTUALATTRS_NOT_FOUND; - slapi_log_error(SLAPI_LOG_TRACE, VATTRSP_PLUGIN_SUBSYSTEM,"--> vattrsp_vattr_get\n"); + slapi_log_err(SLAPI_LOG_TRACE, VATTRSP_PLUGIN_SUBSYSTEM,"--> vattrsp_vattr_get\n"); /* usual to schema check an attribute * there may be sanity checks which can @@ -290,7 +290,7 @@ int vattrsp_vattr_get( *type_name_disposition = SLAPI_VIRTUALATTRS_TYPE_NAME_MATCHED_EXACTLY_OR_ALIAS; } - slapi_log_error(SLAPI_LOG_TRACE, VATTRSP_PLUGIN_SUBSYSTEM,"<-- vattrsp_cache_vattr_get\n"); + slapi_log_err(SLAPI_LOG_TRACE, VATTRSP_PLUGIN_SUBSYSTEM,"<-- vattrsp_cache_vattr_get\n"); return ret; } @@ -320,11 +320,11 @@ int vattrsp_vattr_compare( { int ret = SLAPI_VIRTUALATTRS_NOT_FOUND; /* assume failure */ - slapi_log_error(SLAPI_LOG_TRACE, VATTRSP_PLUGIN_SUBSYSTEM,"--> vattrsp_vattr_compare\n"); + slapi_log_err(SLAPI_LOG_TRACE, VATTRSP_PLUGIN_SUBSYSTEM,"--> vattrsp_vattr_compare\n"); /* TODO: do your thing, compare the attribute */ - slapi_log_error(SLAPI_LOG_TRACE, VATTRSP_PLUGIN_SUBSYSTEM,"<-- vattrsp_vattr_compare\n"); + slapi_log_err(SLAPI_LOG_TRACE, VATTRSP_PLUGIN_SUBSYSTEM,"<-- vattrsp_vattr_compare\n"); return ret; } @@ -363,7 +363,7 @@ int vattrsp_vattr_types( char *attr = "dummyAttr"; /* an attribute type that we will deliver */ int props = 0; /* properties of the attribute, make this SLAPI_ATTR_FLAG_OPATTR for operational attributes */ - slapi_log_error(SLAPI_LOG_TRACE, VATTRSP_PLUGIN_SUBSYSTEM,"--> vattrsp_vattr_types\n"); + slapi_log_err(SLAPI_LOG_TRACE, VATTRSP_PLUGIN_SUBSYSTEM,"--> vattrsp_vattr_types\n"); /* TODO: for each type you will supply... */ if(ret) @@ -380,7 +380,7 @@ int vattrsp_vattr_types( slapi_vattrspi_add_type(type_context,&thang,0); } - slapi_log_error(SLAPI_LOG_TRACE, VATTRSP_PLUGIN_SUBSYSTEM,"<-- vattrsp_vattr_types\n"); + slapi_log_err(SLAPI_LOG_TRACE, VATTRSP_PLUGIN_SUBSYSTEM,"<-- vattrsp_vattr_types\n"); return ret; } diff --git a/ldap/servers/plugins/views/views.c b/ldap/servers/plugins/views/views.c index 6bba173..b705dda 100644 --- a/ldap/servers/plugins/views/views.c +++ b/ldap/servers/plugins/views/views.c @@ -151,7 +151,7 @@ int views_init( Slapi_PBlock *pb ) int ret = SLAPI_PLUGIN_SUCCESS; void * plugin_identity=NULL; - slapi_log_error(SLAPI_LOG_TRACE, VIEWS_PLUGIN_SUBSYSTEM, "--> views_init\n"); + slapi_log_err(SLAPI_LOG_TRACE, VIEWS_PLUGIN_SUBSYSTEM, "--> views_init\n"); /* ** Store the plugin identity for later use. @@ -170,12 +170,12 @@ int views_init( Slapi_PBlock *pb ) slapi_pblock_set( pb, SLAPI_PLUGIN_DESCRIPTION, (void *)&pdesc ) != 0 ) { - slapi_log_error(SLAPI_LOG_ERR, VIEWS_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_ERR, VIEWS_PLUGIN_SUBSYSTEM, "views_init: failed to register plugin\n" ); ret = SLAPI_PLUGIN_FAILURE; } - slapi_log_error(SLAPI_LOG_TRACE, VIEWS_PLUGIN_SUBSYSTEM, "<-- views_init\n"); + slapi_log_err(SLAPI_LOG_TRACE, VIEWS_PLUGIN_SUBSYSTEM, "<-- views_init\n"); return ret; } @@ -204,7 +204,7 @@ static int views_start( Slapi_PBlock *pb ) int ret = SLAPI_PLUGIN_SUCCESS; void **statechange_api; - slapi_log_error(SLAPI_LOG_TRACE, VIEWS_PLUGIN_SUBSYSTEM, "--> views_start\n"); + slapi_log_err(SLAPI_LOG_TRACE, VIEWS_PLUGIN_SUBSYSTEM, "--> views_start\n"); theCache.cache_built = 0; g_views_cache_lock = slapi_new_rwlock(); @@ -237,7 +237,7 @@ static int views_start( Slapi_PBlock *pb ) if( slapi_apib_register(Views_v1_0_GUID, api) ) { - slapi_log_error(SLAPI_LOG_ERR, VIEWS_PLUGIN_SUBSYSTEM, "views_start - Failed to publish views interface\n"); + slapi_log_err(SLAPI_LOG_ERR, VIEWS_PLUGIN_SUBSYSTEM, "views_start - Failed to publish views interface\n"); if(statechange_api){ statechange_unregister(statechange_api, NULL, @@ -253,7 +253,7 @@ static int views_start( Slapi_PBlock *pb ) op_counter = slapi_counter_new(); } - slapi_log_error(SLAPI_LOG_TRACE, VIEWS_PLUGIN_SUBSYSTEM, "<-- views_start\n"); + slapi_log_err(SLAPI_LOG_TRACE, VIEWS_PLUGIN_SUBSYSTEM, "<-- views_start\n"); return ret; } @@ -351,7 +351,7 @@ bail: static int views_close( Slapi_PBlock *pb ) { void **statechange_api; - slapi_log_error(SLAPI_LOG_TRACE, VIEWS_PLUGIN_SUBSYSTEM, "--> views_close\n"); + slapi_log_err(SLAPI_LOG_TRACE, VIEWS_PLUGIN_SUBSYSTEM, "--> views_close\n"); g_plugin_started = 0; @@ -374,7 +374,7 @@ static int views_close( Slapi_PBlock *pb ) slapi_destroy_rwlock(g_views_cache_lock); g_views_cache_lock = NULL; - slapi_log_error(SLAPI_LOG_TRACE, VIEWS_PLUGIN_SUBSYSTEM, "<-- views_close\n"); + slapi_log_err(SLAPI_LOG_TRACE, VIEWS_PLUGIN_SUBSYSTEM, "<-- views_close\n"); return SLAPI_PLUGIN_SUCCESS; } @@ -384,7 +384,7 @@ static void views_cache_free(void) viewEntry *head = theCache.pCacheViews; viewEntry *current; - slapi_log_error(SLAPI_LOG_TRACE, VIEWS_PLUGIN_SUBSYSTEM, "--> views_cache_free\n"); + slapi_log_err(SLAPI_LOG_TRACE, VIEWS_PLUGIN_SUBSYSTEM, "--> views_cache_free\n"); /* free the cache */ current = head; @@ -413,7 +413,7 @@ static void views_cache_free(void) theCache.view_count = 0; - slapi_log_error(SLAPI_LOG_TRACE, VIEWS_PLUGIN_SUBSYSTEM, "<-- views_cache_free\n"); + slapi_log_err(SLAPI_LOG_TRACE, VIEWS_PLUGIN_SUBSYSTEM, "<-- views_cache_free\n"); } /* @@ -431,7 +431,7 @@ static int views_cache_create(void) return SLAPI_PLUGIN_SUCCESS; } - slapi_log_error(SLAPI_LOG_TRACE, VIEWS_PLUGIN_SUBSYSTEM, "--> views_cache_create\n"); + slapi_log_err(SLAPI_LOG_TRACE, VIEWS_PLUGIN_SUBSYSTEM, "--> views_cache_create\n"); /* lock cache */ views_write_lock(); @@ -474,7 +474,7 @@ static int views_cache_create(void) if(ret != 0) { /* currently we cannot go on without the indexes */ - slapi_log_error(SLAPI_LOG_ERR, VIEWS_PLUGIN_SUBSYSTEM, "views_cache_create - Failed to index cache\n"); + slapi_log_err(SLAPI_LOG_ERR, VIEWS_PLUGIN_SUBSYSTEM, "views_cache_create - Failed to index cache\n"); } else theCache.cache_built = 1; @@ -491,7 +491,7 @@ static int views_cache_create(void) /* unlock cache */ views_unlock(); slapi_counter_decrement(op_counter); - slapi_log_error(SLAPI_LOG_TRACE, VIEWS_PLUGIN_SUBSYSTEM, "<-- views_cache_create\n"); + slapi_log_err(SLAPI_LOG_TRACE, VIEWS_PLUGIN_SUBSYSTEM, "<-- views_cache_create\n"); return ret; } @@ -797,7 +797,7 @@ static void views_cache_create_applied_filter(viewEntry *pView) pCurrentFilter = slapi_str2filter( buf ); if (!pCurrentFilter) { - slapi_log_error(SLAPI_LOG_ERR, VIEWS_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_ERR, VIEWS_PLUGIN_SUBSYSTEM, "views_cache_create_applied_filter - View filter [%s] in entry [%s] is not valid\n", buf, current->pDn); } @@ -973,7 +973,7 @@ Slapi_Filter *views_cache_create_descendent_filter(viewEntry *ancestor, PRBool u { pCurrentFilter = slapi_str2filter( buf ); if (!pCurrentFilter) { - slapi_log_error(SLAPI_LOG_ERR, VIEWS_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_ERR, VIEWS_PLUGIN_SUBSYSTEM, "views_cache_create_descendent_filter - View filter [%s] in entry [%s] is invalid\n", buf, currentChild->pDn); } @@ -1037,7 +1037,7 @@ static void views_cache_create_inclusion_filter(viewEntry *pView) sprintf(buf, "(%s)", viewRDNstr ); viewSubFilter = slapi_str2filter( buf ); if (!viewSubFilter) { - slapi_log_error(SLAPI_LOG_ERR, VIEWS_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_ERR, VIEWS_PLUGIN_SUBSYSTEM, "views_cache_create_inclusion_filter - View filter [%s] in entry [%s] is invalid\n", buf, current->pDn); } @@ -1139,7 +1139,7 @@ static int views_cache_build_view_list(viewEntry **pViews) int suffixIndex = 0; int valIndex = 0; - slapi_log_error(SLAPI_LOG_TRACE, VIEWS_PLUGIN_SUBSYSTEM, "--> views_cache_build_view_list\n"); + slapi_log_err(SLAPI_LOG_TRACE, VIEWS_PLUGIN_SUBSYSTEM, "--> views_cache_build_view_list\n"); /* the views may be anywhere in the DIT, @@ -1149,7 +1149,7 @@ static int views_cache_build_view_list(viewEntry **pViews) attrs[0] = "namingcontexts"; attrs[1] = 0; - slapi_log_error(SLAPI_LOG_PLUGIN, VIEWS_PLUGIN_SUBSYSTEM, "views_cache_build_view_list - Building view cache.\n"); + slapi_log_err(SLAPI_LOG_PLUGIN, VIEWS_PLUGIN_SUBSYSTEM, "views_cache_build_view_list - Building view cache.\n"); pSuffixSearch = slapi_search_internal("",LDAP_SCOPE_BASE,"(objectclass=*)",NULL,attrs,0); if(pSuffixSearch) @@ -1201,7 +1201,7 @@ static int views_cache_build_view_list(viewEntry **pViews) } else { - slapi_log_error(SLAPI_LOG_PLUGIN, VIEWS_PLUGIN_SUBSYSTEM, "views_cache_build_view_list - Failed to find suffixes\n"); + slapi_log_err(SLAPI_LOG_PLUGIN, VIEWS_PLUGIN_SUBSYSTEM, "views_cache_build_view_list - Failed to find suffixes\n"); ret = SLAPI_PLUGIN_FAILURE; } @@ -1213,7 +1213,7 @@ static int views_cache_build_view_list(viewEntry **pViews) } - slapi_log_error(SLAPI_LOG_TRACE, VIEWS_PLUGIN_SUBSYSTEM, "<-- views_cache_build_view_list\n"); + slapi_log_err(SLAPI_LOG_TRACE, VIEWS_PLUGIN_SUBSYSTEM, "<-- views_cache_build_view_list\n"); return ret; } @@ -1335,7 +1335,7 @@ static int views_cache_add_dn_views(char *dn, viewEntry **pViews) */ static void views_cache_add_ll_entry(void** attrval, void *theVal) { - slapi_log_error(SLAPI_LOG_TRACE, VIEWS_PLUGIN_SUBSYSTEM, "--> views_cache_add_ll_entry\n"); + slapi_log_err(SLAPI_LOG_TRACE, VIEWS_PLUGIN_SUBSYSTEM, "--> views_cache_add_ll_entry\n"); if(*attrval) { @@ -1352,7 +1352,7 @@ static void views_cache_add_ll_entry(void** attrval, void *theVal) *attrval = theVal; } - slapi_log_error(SLAPI_LOG_TRACE, VIEWS_PLUGIN_SUBSYSTEM, "<-- views_cache_add_ll_entry\n"); + slapi_log_err(SLAPI_LOG_TRACE, VIEWS_PLUGIN_SUBSYSTEM, "<-- views_cache_add_ll_entry\n"); } @@ -1377,7 +1377,7 @@ static void views_update_views_cache( Slapi_Entry *e, char *dn, int modtype, Sla return; } - slapi_log_error(SLAPI_LOG_TRACE, VIEWS_PLUGIN_SUBSYSTEM, "--> views_update_views_cache\n"); + slapi_log_err(SLAPI_LOG_TRACE, VIEWS_PLUGIN_SUBSYSTEM, "--> views_update_views_cache\n"); views_write_lock(); @@ -1667,7 +1667,7 @@ unlock_cache: } slapi_counter_decrement(op_counter); - slapi_log_error(SLAPI_LOG_TRACE, VIEWS_PLUGIN_SUBSYSTEM, "<-- views_update_views_cache\n"); + slapi_log_err(SLAPI_LOG_TRACE, VIEWS_PLUGIN_SUBSYSTEM, "<-- views_update_views_cache\n"); } @@ -1876,7 +1876,7 @@ static void views_cache_backend_state_change(void *handle, char *be_name, PR_UNJOINABLE_THREAD, SLAPD_DEFAULT_THREAD_STACKSIZE)) == NULL ) { - slapi_log_error(SLAPI_LOG_ERR, VIEWS_PLUGIN_SUBSYSTEM, + slapi_log_err(SLAPI_LOG_ERR, VIEWS_PLUGIN_SUBSYSTEM, "views_cache_backend_state_change - PR_CreateThread failed\n" ); } } diff --git a/ldap/servers/plugins/whoami/whoami.c b/ldap/servers/plugins/whoami/whoami.c index 450be84..0169701 100644 --- a/ldap/servers/plugins/whoami/whoami.c +++ b/ldap/servers/plugins/whoami/whoami.c @@ -43,14 +43,14 @@ int whoami_exop( Slapi_PBlock *pb ) if ( slapi_pblock_get( pb, SLAPI_EXT_OP_REQ_OID, &oid ) != 0 ) { - slapi_log_error(SLAPI_LOG_ERR, PLUGIN_NAME, "whoami_exop - Could not get OID from request\n" ); + slapi_log_err(SLAPI_LOG_ERR, PLUGIN_NAME, "whoami_exop - Could not get OID from request\n" ); slapi_send_ldap_result( pb, LDAP_OPERATIONS_ERROR, NULL, "Could not get OID from request\n", 0, NULL ); return( SLAPI_PLUGIN_EXTENDED_SENT_RESULT ); } if ( slapi_pblock_get( pb, SLAPI_EXT_OP_REQ_VALUE, &bval ) != 0 || bval->bv_val != NULL ) { - slapi_log_error(SLAPI_LOG_ERR, PLUGIN_NAME, "whoami_exop - Could not get correct request value from request\n" ); + slapi_log_err(SLAPI_LOG_ERR, PLUGIN_NAME, "whoami_exop - Could not get correct request value from request\n" ); slapi_send_ldap_result( pb, LDAP_OPERATIONS_ERROR, NULL, "Could not get correct request value from request\n", 0, NULL ); return( SLAPI_PLUGIN_EXTENDED_SENT_RESULT ); } @@ -59,7 +59,7 @@ int whoami_exop( Slapi_PBlock *pb ) if( slapi_pblock_get( pb, SLAPI_CONN_DN, &client_dn ) !=0 ) { - slapi_log_error(SLAPI_LOG_ERR, PLUGIN_NAME, "whoami_exop - Could not get client_dn" ); + slapi_log_err(SLAPI_LOG_ERR, PLUGIN_NAME, "whoami_exop - Could not get client_dn" ); slapi_send_ldap_result( pb, LDAP_OPERATIONS_ERROR, NULL, "Could not get client_dn\n", 0, NULL ); return( SLAPI_PLUGIN_EXTENDED_SENT_RESULT ); } @@ -80,7 +80,7 @@ int whoami_exop( Slapi_PBlock *pb ) if ( slapi_pblock_set( pb, SLAPI_EXT_OP_RET_OID, NULL ) != 0 || slapi_pblock_set( pb, SLAPI_EXT_OP_RET_VALUE, &retbval ) != 0 ) { - slapi_log_error(SLAPI_LOG_ERR, PLUGIN_NAME, "whoami_exop - Could not set return values" ); + slapi_log_err(SLAPI_LOG_ERR, PLUGIN_NAME, "whoami_exop - Could not set return values" ); slapi_send_ldap_result( pb, LDAP_OPERATIONS_ERROR, NULL, "Could not set return values", 0, NULL ); slapi_ch_free_string( &client_dn ); slapi_ch_free_string( &fdn ); @@ -110,7 +110,7 @@ int whoami_init( Slapi_PBlock *pb ) slapi_pblock_set( pb, SLAPI_PLUGIN_EXT_OP_FN, ( void * )whoami_exop ) != 0 || slapi_pblock_set( pb, SLAPI_PLUGIN_EXT_OP_OIDLIST, ( void * )whoami_exop_oid_list ) !=0 ) { - slapi_log_error(SLAPI_LOG_ERR, PLUGIN_NAME, "whoami_init - Failed to register plug-in.\n" ); + slapi_log_err(SLAPI_LOG_ERR, PLUGIN_NAME, "whoami_init - Failed to register plug-in.\n" ); return( -1 ); } diff --git a/ldap/servers/slapd/abandon.c b/ldap/servers/slapd/abandon.c index c391435..18ff8ce 100644 --- a/ldap/servers/slapd/abandon.c +++ b/ldap/servers/slapd/abandon.c @@ -38,7 +38,7 @@ do_abandon( Slapi_PBlock *pb ) Operation *o; BerElement *ber = pb->pb_op->o_ber; - LDAPDebug(LDAP_DEBUG_TRACE, "do_abandon\n", 0, 0, 0 ); + slapi_log_err(SLAPI_LOG_TRACE, "do_abandon", "->\n"); /* * Parse the abandon request. It looks like this: @@ -47,9 +47,8 @@ do_abandon( Slapi_PBlock *pb ) */ if ( ber_scanf( ber, "i", &id ) == LBER_ERROR ) { - LDAPDebug(LDAP_DEBUG_ERR, - "do_abandon - ber_scanf failed (op=Abandon; params=ID)\n", - 0, 0 ,0 ); + slapi_log_err(SLAPI_LOG_ERR, + "do_abandon", "ber_scanf failed (op=Abandon; params=ID)\n"); return; } @@ -61,14 +60,14 @@ do_abandon( Slapi_PBlock *pb ) * pass them to the backend. */ if ( (err = get_ldapmessage_controls( pb, ber, NULL )) != 0 ) { - LDAPDebug(LDAP_DEBUG_ERR, - "do_abandon - get_ldapmessage_controls failed: %d (%s) (op=Abandon)\n", - err, ldap_err2string( err ), 0); + slapi_log_err(SLAPI_LOG_ERR, + "do_abandon", "get_ldapmessage_controls failed: %d (%s) (op=Abandon)\n", + err, ldap_err2string( err )); /* LDAP does not allow any response to an abandon */ return; } - LDAPDebug(LDAP_DEBUG_ARGS, "do_abandon - id %d\n", id, 0 ,0 ); + slapi_log_err(SLAPI_LOG_ARGS, "do_abandon", "id %d\n", id); /* * find the operation being abandoned and set the o_abandon @@ -97,7 +96,7 @@ do_abandon( Slapi_PBlock *pb ) if (ts) { operation_set_target_spec (pb->pb_op, ts); } else { - LDAPDebug(LDAP_DEBUG_TRACE, "do_abandon - no target spec of abandoned operation\n", 0,0,0); + slapi_log_err(SLAPI_LOG_TRACE, "do_abandon", "no target spec of abandoned operation\n"); } operation_set_abandoned_op (pb->pb_op, o->o_abandoned_op); @@ -116,7 +115,7 @@ do_abandon( Slapi_PBlock *pb ) suppressed_by_plugin = 1; } } else { - LDAPDebug0Args(LDAP_DEBUG_TRACE, "do_abandon - op not found\n"); + slapi_log_err(SLAPI_LOG_TRACE, "do_abandon", "op not found\n"); } if ( 0 == pagedresults_free_one_msgid_nolock(pb->pb_conn, id) ) { diff --git a/ldap/servers/slapd/add.c b/ldap/servers/slapd/add.c index 81440ae..240fa41 100644 --- a/ldap/servers/slapd/add.c +++ b/ldap/servers/slapd/add.c @@ -61,7 +61,7 @@ do_add( Slapi_PBlock *pb ) int rc; PRBool searchsubentry=PR_TRUE; - LDAPDebug(LDAP_DEBUG_TRACE, "do_add\n", 0, 0, 0 ); + slapi_log_err(SLAPI_LOG_TRACE, "do_add", "==>\n"); slapi_pblock_get( pb, SLAPI_OPERATION, &operation); ber = operation->o_ber; @@ -86,8 +86,8 @@ do_add( Slapi_PBlock *pb ) Slapi_DN mysdn; if ( ber_scanf( ber, "{a", &rawdn ) == LBER_ERROR ) { slapi_ch_free_string(&rawdn); - LDAPDebug(LDAP_DEBUG_ERR, - "do_add - ber_scanf failed (op=Add; params=DN)\n", 0, 0, 0 ); + slapi_log_err(SLAPI_LOG_ERR, "do_add", + "ber_scanf failed (op=Add; params=DN)\n"); op_shared_log_error_access (pb, "ADD", "???", "decoding error"); send_ldap_result( pb, LDAP_PROTOCOL_ERROR, NULL, "decoding error", 0, NULL ); @@ -121,7 +121,7 @@ do_add( Slapi_PBlock *pb ) slapi_entry_init_ext(e, &mysdn, NULL); slapi_sdn_done(&mysdn); } - LDAPDebug(LDAP_DEBUG_ARGS, " do_add: dn (%s)\n", slapi_entry_get_dn_const(e), 0, 0 ); + slapi_log_err(SLAPI_LOG_ARGS, "do_add", "dn (%s)\n", (char *)slapi_entry_get_dn_const(e)); /* get the attrs */ for ( tag = ber_first_element( ber, &len, &last ); @@ -140,7 +140,7 @@ do_add( Slapi_PBlock *pb ) } if ( vals == NULL ) { - LDAPDebug(LDAP_DEBUG_ERR, "do_add - no values for type %s\n", type, 0, 0 ); + slapi_log_err(SLAPI_LOG_ERR, "do_add - no values for type %s\n", type, 0, 0 ); op_shared_log_error_access (pb, "ADD", slapi_sdn_get_dn (slapi_entry_get_sdn_const(e)), "null value"); send_ldap_result( pb, LDAP_PROTOCOL_ERROR, NULL, NULL, 0, NULL ); @@ -339,7 +339,7 @@ int slapi_add_internal_set_pb (Slapi_PBlock *pb, const char *dn, LDAPMod **attrs if (pb == NULL || dn == NULL || attrs == NULL) { - slapi_log_error(SLAPI_LOG_PLUGIN, NULL, "slapi_add_internal_set_pb: invalid argument\n"); + slapi_log_err(SLAPI_LOG_PLUGIN, NULL, "slapi_add_internal_set_pb: invalid argument\n"); return LDAP_PARAM_ERROR; } @@ -361,7 +361,7 @@ void slapi_add_entry_internal_set_pb (Slapi_PBlock *pb, Slapi_Entry *e, LDAPCont PR_ASSERT (pb != NULL); if (pb == NULL || e == NULL) { - slapi_log_error(SLAPI_LOG_PLUGIN, NULL, "slapi_add_entry_internal_set_pb: invalid argument\n"); + slapi_log_err(SLAPI_LOG_PLUGIN, NULL, "slapi_add_entry_internal_set_pb: invalid argument\n"); return; } @@ -596,7 +596,7 @@ static void op_shared_add (Slapi_PBlock *pb) * PSEUDO_ATTR_UNHASHEDUSERPASSWORD attribute */ char *test_str = slapi_get_first_clear_text_pw(e); if (test_str) { - LDAPDebug1Arg(LDAP_DEBUG_ANY, + slapi_log_err(SLAPI_LOG_ERR, "Value from extension: %s\n", test_str); slapi_ch_free_string(&test_str); } @@ -604,7 +604,7 @@ static void op_shared_add (Slapi_PBlock *pb) test_str = slapi_entry_attr_get_charptr(e, PSEUDO_ATTR_UNHASHEDUSERPASSWORD); if (test_str) { - LDAPDebug1Arg(LDAP_DEBUG_ANY, + slapi_log_err(SLAPI_LOG_ERR, "Value from attr: %s\n", test_str); slapi_ch_free_string(&test_str); } @@ -787,7 +787,7 @@ add_created_attrs(Slapi_PBlock *pb, Slapi_Entry *e) struct slapi_componentid *cid = NULL; slapdFrontendConfig_t *slapdFrontendConfig = getFrontendConfig(); - LDAPDebug(LDAP_DEBUG_TRACE, "add_created_attrs\n", 0, 0, 0); + slapi_log_err(SLAPI_LOG_TRACE, "add_created_attrs", "==>\n"); bvals[0] = &bv; bvals[1] = NULL; @@ -881,7 +881,8 @@ static int check_rdn_for_created_attrs(Slapi_Entry *e) for (i = 0; type[i] != NULL; i++) { if (slapi_rdn_contains_attr(rdn, type[i], &value)) { - LDAPDebug(LDAP_DEBUG_TRACE, "Invalid DN. RDN contains %s attribute\n", type[i], 0, 0); + slapi_log_err(SLAPI_LOG_TRACE, "check_rdn_for_created_attrs", + "Invalid DN. RDN contains %s attribute\n", type[i]); rc = 1; break; } @@ -889,7 +890,7 @@ static int check_rdn_for_created_attrs(Slapi_Entry *e) slapi_rdn_free(&rdn); } else { - LDAPDebug(LDAP_DEBUG_TRACE, "check_rdn_for_created_attrs: Error allocating RDN\n", 0, 0, 0); + slapi_log_err(SLAPI_LOG_TRACE, "check_rdn_for_created_attrs", "Error allocating RDN\n"); rc = -1; } @@ -907,8 +908,8 @@ static void handle_fast_add(Slapi_PBlock *pb, Slapi_Entry *entry) if ((be == NULL) || (be->be_wire_import == NULL)) { /* can this even happen? */ - LDAPDebug(LDAP_DEBUG_ERR, - "handle_fast_add - Backend not supported\n", 0, 0, 0); + slapi_log_err(SLAPI_LOG_ERR, + "handle_fast_add", "Backend not supported\n"); send_ldap_result(pb, LDAP_NOT_SUPPORTED, NULL, NULL, 0, NULL); return; } @@ -924,7 +925,7 @@ static void handle_fast_add(Slapi_PBlock *pb, Slapi_Entry *entry) if (operation_is_flag_set(operation, OP_FLAG_ACTION_SCHEMA_CHECK) && (slapi_entry_schema_check(pb, entry) != 0)) { char *errtext; - LDAPDebug(LDAP_DEBUG_TRACE, "handle_fast_add - Entry failed schema check\n", 0, 0, 0); + slapi_log_err(SLAPI_LOG_TRACE, "handle_fast_add", "Entry failed schema check\n"); slapi_pblock_get(pb, SLAPI_PB_RESULT_TEXT, &errtext); send_ldap_result(pb, LDAP_OBJECT_CLASS_VIOLATION, NULL, errtext, 0, NULL); slapi_entry_free(entry); @@ -934,7 +935,7 @@ static void handle_fast_add(Slapi_PBlock *pb, Slapi_Entry *entry) /* syntax check */ if (slapi_entry_syntax_check(pb, entry, 0) != 0) { char *errtext; - LDAPDebug(LDAP_DEBUG_TRACE, "handle_fast_add - Entry failed syntax check\n", 0, 0, 0); + slapi_log_err(SLAPI_LOG_TRACE, "handle_fast_add", "Entry failed syntax check\n"); slapi_pblock_get(pb, SLAPI_PB_RESULT_TEXT, &errtext); send_ldap_result(pb, LDAP_INVALID_SYNTAX, NULL, errtext, 0, NULL); slapi_entry_free(entry); @@ -954,9 +955,8 @@ static void handle_fast_add(Slapi_PBlock *pb, Slapi_Entry *entry) slapi_pblock_set(pb, SLAPI_BULK_IMPORT_STATE, &ret); ret = (*be->be_wire_import)(pb); if (ret != 0) { - LDAPDebug(LDAP_DEBUG_ERR, - "handle_fast_add - wire import: error during import (%d)\n", - ret, 0, 0); + slapi_log_err(SLAPI_LOG_ERR, "handle_fast_add", + "wire import: Error during import (%d)\n", ret); send_ldap_result(pb, LDAP_OPERATIONS_ERROR, NULL, NULL, 0, NULL); /* It's our responsibility to free the entry if @@ -988,8 +988,8 @@ add_uniqueid (Slapi_Entry *e) } else { - LDAPDebug(LDAP_DEBUG_ERR, "add_uniqueid - Uniqueid generation failed for %s; error = %d\n", - slapi_entry_get_dn_const(e), rc, 0); + slapi_log_err(SLAPI_LOG_ERR, "add_uniqueid", "Uniqueid generation failed for %s; error = %d\n", + slapi_entry_get_dn_const(e), rc); } return( rc ); diff --git a/ldap/servers/slapd/attr.c b/ldap/servers/slapd/attr.c index 4d87209..170bdd3 100644 --- a/ldap/servers/slapd/attr.c +++ b/ldap/servers/slapd/attr.c @@ -916,7 +916,7 @@ attr_add_valuearray(Slapi_Attr *a, Slapi_Value **vals, const char *dn) } } - slapi_log_error(SLAPI_LOG_TRACE, NULL, "add value \"%s\" to " + slapi_log_err(SLAPI_LOG_TRACE, "attr_add_valuearray", "add value \"%s\" to " "attribute type \"%s\" in entry \"%s\" failed: %s\n", duplicate_string, a->a_type, @@ -986,14 +986,14 @@ attr_get_value_cmp_fn(const Slapi_Attr *attr, value_compare_fn_type *compare_fn) { int rc = LDAP_PROTOCOL_ERROR; - LDAPDebug0Args(LDAP_DEBUG_TRACE, - "=> slapi_attr_get_value_cmp_fn\n"); + slapi_log_err(SLAPI_LOG_TRACE, "attr_get_value_cmp_fn", + "=> attr_get_value_cmp_fn\n"); *compare_fn = NULL; if (attr == NULL) { - LDAPDebug0Args(LDAP_DEBUG_TRACE, - "<= slapi_attr_get_value_cmp_fn no attribute given\n"); + slapi_log_err(SLAPI_LOG_TRACE, "attr_get_value_cmp_fn", + "No attribute given\n"); rc = LDAP_PARAM_ERROR; /* unkonwn */ goto done; } @@ -1005,22 +1005,22 @@ attr_get_value_cmp_fn(const Slapi_Attr *attr, value_compare_fn_type *compare_fn) } if ((attr->a_plugin->plg_syntax_flags & SLAPI_PLUGIN_SYNTAX_FLAG_ORDERING) == 0) { - LDAPDebug2Args(LDAP_DEBUG_TRACE, - "<= slapi_attr_get_value_cmp_fn syntax [%s] for attribute [%s] does not support ordering\n", + slapi_log_err(SLAPI_LOG_TRACE, "attr_get_value_cmp_fn", + "Syntax [%s] for attribute [%s] does not support ordering\n", attr->a_plugin->plg_syntax_oid, attr->a_type); goto done; } if (attr->a_plugin->plg_syntax_filter_ava == NULL) { - LDAPDebug2Args(LDAP_DEBUG_TRACE, - "<= slapi_attr_get_value_cmp_fn syntax [%s] for attribute [%s] does not support equality matching\n", + slapi_log_err(SLAPI_LOG_TRACE, "attr_get_value_cmp_fn", + "Syntax [%s] for attribute [%s] does not support equality matching\n", attr->a_plugin->plg_syntax_oid, attr->a_type); goto done; } if (attr->a_plugin->plg_syntax_compare == NULL) { - LDAPDebug2Args(LDAP_DEBUG_TRACE, - "<= slapi_attr_get_value_cmp_fn syntax [%s] for attribute [%s] does not have a compare function\n", + slapi_log_err(SLAPI_LOG_TRACE, "attr_get_value_cmp_fn", + "Syntax [%s] for attribute [%s] does not have a compare function\n", attr->a_plugin->plg_syntax_oid, attr->a_type); goto done; } @@ -1029,7 +1029,7 @@ attr_get_value_cmp_fn(const Slapi_Attr *attr, value_compare_fn_type *compare_fn) rc = LDAP_SUCCESS; done: - LDAPDebug0Args(LDAP_DEBUG_TRACE, "<= slapi_attr_get_value_cmp_fn \n"); + slapi_log_err(SLAPI_LOG_TRACE, "attr_get_value_cmp_fn","<= attr_get_value_cmp_fn \n"); return rc; } diff --git a/ldap/servers/slapd/attrlist.c b/ldap/servers/slapd/attrlist.c index 1ab5e17..3e8e8b8 100644 --- a/ldap/servers/slapd/attrlist.c +++ b/ldap/servers/slapd/attrlist.c @@ -284,7 +284,7 @@ int attrlist_replace(Slapi_Attr **alist, const char *type, struct berval **vals) } rc = attr_replace(*a, values); /* values is consumed */ if (rc) { - slapi_log_error(SLAPI_LOG_ERR, "attrlist_replace", + slapi_log_err(SLAPI_LOG_ERR, "attrlist_replace", "attr_replace (%s, %s) failed.\n", type, vals[0]->bv_val); if (created) { @@ -319,7 +319,7 @@ int attrlist_replace_with_flags(Slapi_Attr **alist, const char *type, struct ber } rc = attr_replace(*a, values); if (rc) { - slapi_log_error(SLAPI_LOG_ERR, "attrlist_replace_with_flags", + slapi_log_err(SLAPI_LOG_ERR, "attrlist_replace_with_flags", "attr_replace (%s, %s) failed.\n", type, vals[0]->bv_val); if (created) { diff --git a/ldap/servers/slapd/attrsyntax.c b/ldap/servers/slapd/attrsyntax.c index 5083b5e..956c7b8 100644 --- a/ldap/servers/slapd/attrsyntax.c +++ b/ldap/servers/slapd/attrsyntax.c @@ -119,14 +119,14 @@ check_oid( const char *oid ) { if ( oid == NULL) { /* this is bad */ - LDAPDebug(LDAP_DEBUG_ERR, "check_oid - NULL passed to check_oid\n",0,0,0); + slapi_log_err(SLAPI_LOG_ERR, "check_oid", "NULL passed to check_oid\n"); return 0; } length_oid = strlen(oid); if (length_oid < 4) { /* this is probably bad */ - LDAPDebug(LDAP_DEBUG_ERR, "check_oid - Bad oid %s passed to check_oid\n",oid,0,0); + slapi_log_err(SLAPI_LOG_ERR, "check_oid", "Bad oid %s passed to check_oid\n",oid); return 0; } @@ -141,14 +141,14 @@ check_oid( const char *oid ) { if ( !isdigit(oid[0]) || !isdigit(oid[length_oid-1]) ) { - LDAPDebug(LDAP_DEBUG_ERR, "check_oid - Non numeric oid %s passed to check_oid\n",oid,0,0); + slapi_log_err(SLAPI_LOG_ERR, "check_oid", "Non numeric oid %s passed to check_oid\n",oid); return 0; } /* check to see that it contains only digits and dots */ for ( i = 0; i < length_oid; i++ ) { if ( !isdigit(oid[i]) && oid[i] != '.' ){ - LDAPDebug(LDAP_DEBUG_ERR, "check_oid - Non numeric oid %s passed to check_oid\n",oid,0,0); + slapi_log_err(SLAPI_LOG_ERR, "check_oid", "Non numeric oid %s passed to check_oid\n",oid); return 0; } } @@ -174,8 +174,8 @@ attr_syntax_check_oids() PLHashEntry *he = oid2asi->buckets[ii-1]; for (; he; he = he->next) { if (!check_oid(he->key)) { - LDAPDebug(LDAP_DEBUG_ERR, "attr_syntax_check_oids - bad oid %s in bucket %d\n", - he->key, ii-1, 0); + slapi_log_err(SLAPI_LOG_ERR, "attr_syntax_check_oids", "bad oid %s in bucket %d\n", + he->key, ii-1); nbad++; } } @@ -670,9 +670,9 @@ int default_dirstring_values2keys( Slapi_PBlock *pb, Slapi_Value **bvals,Slapi_V case LDAP_FILTER_SUBSTRINGS: default: /* default plugin only handles equality so far */ - LDAPDebug(LDAP_DEBUG_ERR, - "default_dirstring_values2keys - Unsupported ftype 0x%x\n", - ftype, 0, 0 ); + slapi_log_err(SLAPI_LOG_ERR, + "default_dirstring_values2keys", "Unsupported ftype 0x%x\n", + ftype); break; } return(0); @@ -1038,7 +1038,7 @@ attr_syntax_create( now, just log an error, and address each case */ if (mr_equality && !slapi_matchingrule_is_compat(mr_equality, attr_syntax)) { - slapi_log_error(SLAPI_LOG_ERR, "attr_syntax_create", + slapi_log_err(SLAPI_LOG_ERR, "attr_syntax_create", "Error: the EQUALITY matching rule [%s] is not compatible " "with the syntax [%s] for the attribute [%s]\n", mr_equality, attr_syntax, attr_names[0]); @@ -1049,7 +1049,7 @@ attr_syntax_create( } a.asi_mr_eq_plugin = plugin_mr_find( mr_equality ); if (mr_ordering && !slapi_matchingrule_is_compat(mr_ordering, attr_syntax)) { - slapi_log_error(SLAPI_LOG_ERR, "attr_syntax_create", + slapi_log_err(SLAPI_LOG_ERR, "attr_syntax_create", "Error: the ORDERING matching rule [%s] is not compatible " "with the syntax [%s] for the attribute [%s]\n", mr_ordering, attr_syntax, attr_names[0]); @@ -1060,7 +1060,7 @@ attr_syntax_create( } a.asi_mr_ord_plugin = plugin_mr_find( mr_ordering ); if (mr_substring && !slapi_matchingrule_is_compat(mr_substring, attr_syntax)) { - slapi_log_error(SLAPI_LOG_ERR, "attr_syntax_create", + slapi_log_err(SLAPI_LOG_ERR, "attr_syntax_create", "Error: the SUBSTR matching rule [%s] is not compatible " "with the syntax [%s] for the attribute [%s]\n", mr_substring, attr_syntax, attr_names[0]); @@ -1473,7 +1473,7 @@ attr_syntax_init(void) if(oid2asi) PL_HashTableDestroy(oid2asi); oid2asi = NULL; - slapi_log_error(SLAPI_LOG_ERR, "attr_syntax_init", + slapi_log_err(SLAPI_LOG_ERR, "attr_syntax_init", "slapi_new_rwlock() for oid2asi lock failed\n" ); return 1; } @@ -1496,7 +1496,7 @@ attr_syntax_init(void) if(name2asi) PL_HashTableDestroy(name2asi); name2asi = NULL; - slapi_log_error(SLAPI_LOG_ERR, "attr_syntax_init", + slapi_log_err(SLAPI_LOG_ERR, "attr_syntax_init", "slapi_new_rwlock() for oid2asi lock failed\n" ); return 1; } @@ -1537,14 +1537,14 @@ attr_syntax_internal_asi_add_ht(struct asyntaxinfo *asip) PL_CompareValues, 0, 0); } if (!internalasi) { - slapi_log_error(SLAPI_LOG_ERR, "attr_syntax_internal_asi_add_ht", + slapi_log_err(SLAPI_LOG_ERR, "attr_syntax_internal_asi_add_ht", "Failed to create HashTable.\n"); return 1; } if (!PL_HashTableLookup(internalasi, asip->asi_oid)) { struct asyntaxinfo *asip_copy = attr_syntax_dup(asip); if (!asip_copy) { - slapi_log_error(SLAPI_LOG_ERR, "attr_syntax_internal_asi_add_ht", + slapi_log_err(SLAPI_LOG_ERR, "attr_syntax_internal_asi_add_ht", "Failed to duplicate asyntaxinfo: %s.\n", asip->asi_name); return 1; @@ -1583,7 +1583,7 @@ slapi_add_internal_attr_syntax( const char *name, const char *oid, rc = attr_syntax_add( asip, 0 ); if ( rc == LDAP_SUCCESS ) { if (attr_syntax_internal_asi_add_ht(asip)) { - slapi_log_error(SLAPI_LOG_ERR, + slapi_log_err(SLAPI_LOG_ERR, "slapi_add_internal_attr_syntax", "Failed to stash internal asyntaxinfo: %s.\n", asip->asi_name); @@ -1622,7 +1622,7 @@ slapi_reload_internal_attr_syntax() { int rc = LDAP_SUCCESS; if (!internalasi) { - slapi_log_error(SLAPI_LOG_TRACE, "attr_reload_internal_attr_syntax", + slapi_log_err(SLAPI_LOG_TRACE, "attr_reload_internal_attr_syntax", "No internal attribute syntax to reload.\n"); return rc; } diff --git a/ldap/servers/slapd/auditlog.c b/ldap/servers/slapd/auditlog.c index 9d0f144..59ba476 100644 --- a/ldap/servers/slapd/auditlog.c +++ b/ldap/servers/slapd/auditlog.c @@ -372,7 +372,7 @@ write_audit_file( break; default: /* Unsupported log type, we should make some noise */ - LDAPDebug1Arg(LDAP_DEBUG_ERR, "write_audit_log - Invalid log type specified. logtype %d\n", logtype); + slapi_log_err(SLAPI_LOG_ERR, "write_audit_log", "Invalid log type specified. logtype %d\n", logtype); break; } diff --git a/ldap/servers/slapd/auth.c b/ldap/servers/slapd/auth.c index a109847..c787dd4 100644 --- a/ldap/servers/slapd/auth.c +++ b/ldap/servers/slapd/auth.c @@ -59,7 +59,7 @@ slapu_search_s( LDAP* ld, const char* rawbaseDN, int scope, const char* filter, slapi_sdn_free(&sdn); return err; } - LDAPDebug(LDAP_DEBUG_TRACE, "=> slapu_search_s (\"%s\", %i, %s)\n", + slapi_log_err(SLAPI_LOG_TRACE, "slapu_search_s", "=> (\"%s\", %i, %s)\n", baseDN, scope, filter); if (filter == NULL) filter = "objectclass=*"; @@ -86,18 +86,18 @@ slapu_search_s( LDAP* ld, const char* rawbaseDN, int scope, const char* filter, pb = NULL; if (scope == LDAP_SCOPE_SUBTREE) { char fbuf[ BUFSIZ ]; - LDAPDebug(LDAP_DEBUG_ERR, "slapu_search_s - (\"%s\", subtree, %s) err %i\n", + slapi_log_err(SLAPI_LOG_ERR, "slapu_search_s", "(\"%s\", subtree, %s) err %i\n", baseDN, escape_string( (char*)filter, fbuf ), err); } } } else { char fbuf[ BUFSIZ ]; - LDAPDebug(LDAP_DEBUG_ERR, "slapu_search_s - (\"%s\", %i, %s) NULL\n", + slapi_log_err(SLAPI_LOG_ERR, "slapu_search_s", "(\"%s\", %i, %s) NULL\n", baseDN, scope, escape_string( (char*)filter, fbuf )); } slapi_sdn_free(&sdn); *result = (LDAPMessage*)pb; - LDAPDebug(LDAP_DEBUG_TRACE, "<= slapu_search_s %i\n", err, 0, 0); + slapi_log_err(SLAPI_LOG_TRACE, "<= slapu_search_s", "%i\n", err); return err; } @@ -260,16 +260,12 @@ client_auth_init () if (client_auth_config_file == NULL) { char *confdir = config_get_configdir(); if (NULL == confdir) { - LDAPDebug(LDAP_DEBUG_ERR, - "client_auth_init - Failed to get configdir\n", - 0, 0, 0); + slapi_log_err(SLAPI_LOG_ERR, "client_auth_init", "Failed to get configdir\n"); return; } client_auth_config_file = PR_smprintf("%s/certmap.conf", confdir); if (NULL == client_auth_config_file) { - LDAPDebug(LDAP_DEBUG_ERR, - "client_auth_init - Failed to duplicate \"%s/certmap\"\n", - confdir, 0, 0); + slapi_log_err(SLAPI_LOG_ERR, "client_auth_init", "Failed to duplicate \"%s/certmap\"\n", confdir); slapi_ch_free_string(&confdir); return; } @@ -277,8 +273,7 @@ client_auth_init () } err = ldaputil_init (client_auth_config_file, "", NULL, "slapd", NULL); if (err != LDAPU_SUCCESS) { - LDAPDebug(LDAP_DEBUG_TRACE, "client_auth_init - ldaputil_init(%s,...) %i\n", - client_auth_config_file, err, 0); + slapi_log_err(SLAPI_LOG_TRACE, "client_auth_init", "ldaputil_init(%s,...) %i\n", client_auth_config_file, err); } else { LDAPUVTable_t vtable = { NULL /* ssl_init */, @@ -331,7 +326,7 @@ subject_of (CERTCertificate* cert) if (cert != NULL) { int err = ldapu_get_cert_subject_dn (cert, &dn); if (err != LDAPU_SUCCESS) { - LDAPDebug(LDAP_DEBUG_ERR, "subject_of - ldapu_get_cert_subject_dn(%p) %i (%s)\n", + slapi_log_err(SLAPI_LOG_ERR, "subject_of", "ldapu_get_cert_subject_dn(%p) %i (%s)\n", (void*)cert, err, ldapu_err2string (err)); } } @@ -345,7 +340,7 @@ issuer_of (CERTCertificate* cert) if (cert != NULL) { int err = ldapu_get_cert_issuer_dn (cert, &dn); if (err != LDAPU_SUCCESS) { - LDAPDebug(LDAP_DEBUG_ERR, "issuer_of - ldapu_get_cert_issuer_dn(%p) %i (%s)\n", + slapi_log_err(SLAPI_LOG_ERR, "issuer_of", "ldapu_get_cert_issuer_dn(%p) %i (%s)\n", (void*)cert, err, ldapu_err2string (err)); } } @@ -487,12 +482,12 @@ handle_handshake_done (PRFileDesc *prfd, void* clientData) } else { extraErrorMsg = "no entry"; - LDAPDebug(LDAP_DEBUG_TRACE, "<= ldapu_cert_to_ldap_entry() %s\n", - extraErrorMsg, 0, 0); + slapi_log_err(SLAPI_LOG_TRACE, "handle_handshake_done", "<= ldapu_cert_to_ldap_entry() %s\n", + extraErrorMsg); } } else { extraErrorMsg = ldapu_err2string(err); - LDAPDebug(LDAP_DEBUG_TRACE, "<= ldapu_cert_to_ldap_entry() %i (%s)%s\n", + slapi_log_err(SLAPI_LOG_TRACE, "handle_handshake_done", "<= ldapu_cert_to_ldap_entry() %i (%s)%s\n", err, extraErrorMsg, chain ? "" : " NULL"); } slapi_ch_free_string(&basedn); diff --git a/ldap/servers/slapd/ava.c b/ldap/servers/slapd/ava.c index 50c95ca..7f7048b 100644 --- a/ldap/servers/slapd/ava.c +++ b/ldap/servers/slapd/ava.c @@ -30,7 +30,7 @@ get_ava( if ( ber_scanf( ber, "{ao}", &type, &ava->ava_value ) == LBER_ERROR ) { slapi_ch_free_string( &type ); ava_done(ava); - LDAPDebug(LDAP_DEBUG_ERR, "get_ava - ber_scanf\n", 0, 0, 0 ); + slapi_log_err(SLAPI_LOG_ERR, "get_ava", "ber_scanf\n"); return( LDAP_PROTOCOL_ERROR ); } ava->ava_type = slapi_attr_syntax_normalize(type); diff --git a/ldap/servers/slapd/back-ldbm/ancestorid.c b/ldap/servers/slapd/back-ldbm/ancestorid.c index b0998ed..459a3df 100644 --- a/ldap/servers/slapd/back-ldbm/ancestorid.c +++ b/ldap/servers/slapd/back-ldbm/ancestorid.c @@ -64,14 +64,14 @@ static int ldbm_get_nonleaf_ids(backend *be, DB_TXN *txn, IDList **idl, ImportJo /* Open the parentid index file */ ret = dblayer_get_index_file(be, ai, &db, DBOPEN_CREATE); if (ret != 0) { - ldbm_nasty(sourcefile,13010,ret); + ldbm_nasty("ldbm_get_nonleaf_ids", sourcefile,13010,ret); goto out; } /* Get a cursor so we can walk through the parentid */ ret = db->cursor(db,txn,&dbc,0); if (ret != 0 ) { - ldbm_nasty(sourcefile,13020,ret); + ldbm_nasty("ldbm_get_nonleaf_ids", sourcefile,13020,ret); goto out; } import_log_notice(job, SLAPI_LOG_INFO, "ldbm_get_nonleaf_ids", "Gathering ancestorid non-leaf IDs..."); @@ -102,14 +102,14 @@ static int ldbm_get_nonleaf_ids(backend *be, DB_TXN *txn, IDList **idl, ImportJo "Finished gathering ancestorid non-leaf IDs."); /* Check for success */ if (ret == DB_NOTFOUND) ret = 0; - if (ret != 0) ldbm_nasty(sourcefile,13030,ret); + if (ret != 0) ldbm_nasty("ldbm_get_nonleaf_ids", sourcefile,13030,ret); out: /* Close the cursor */ if (dbc != NULL) { if (ret == 0) { ret = dbc->c_close(dbc); - if (ret != 0) ldbm_nasty(sourcefile,13040,ret); + if (ret != 0) ldbm_nasty("ldbm_get_nonleaf_ids", sourcefile,13040,ret); } else { (void)dbc->c_close(dbc); } @@ -123,8 +123,8 @@ static int ldbm_get_nonleaf_ids(backend *be, DB_TXN *txn, IDList **idl, ImportJo /* Return the idlist */ if (ret == 0) { *idl = nodes; - LDAPDebug(LDAP_DEBUG_TRACE, "found %lu nodes for ancestorid\n", - (u_long)IDL_NIDS(nodes), 0, 0); + slapi_log_err(SLAPI_LOG_TRACE, "ldbm_get_nonleaf_ids", "Found %lu nodes for ancestorid\n", + (u_long)IDL_NIDS(nodes)); } else { idl_free(&nodes); *idl = NULL; @@ -204,14 +204,14 @@ static int ldbm_ancestorid_default_create_index(backend *be, ImportJob *job) /* Open the ancestorid index file */ ret = dblayer_get_index_file(be, ai_aid, &db_aid, DBOPEN_CREATE); if (ret != 0) { - ldbm_nasty(sourcefile,13050,ret); + ldbm_nasty("ldbm_ancestorid_default_create_index", sourcefile,13050,ret); goto out; } /* Maybe nothing to do */ if (nodes == NULL || nodes->b_nids == 0) { - LDAPDebug(LDAP_DEBUG_ERR, "ldbm_ancestorid_default_create_index - " - "Nothing to do to build ancestorid index\n", 0, 0, 0); + slapi_log_err(SLAPI_LOG_ERR, "ldbm_ancestorid_default_create_index", + "Nothing to do to build ancestorid index\n"); goto out; } @@ -224,7 +224,7 @@ static int ldbm_ancestorid_default_create_index(backend *be, ImportJob *job) /* Open the parentid index file */ ret = dblayer_get_index_file(be, ai_pid, &db_pid, DBOPEN_CREATE); if (ret != 0) { - ldbm_nasty("ldbm_ancestorid_default_create_index",13060,ret); + ldbm_nasty("ldbm_ancestorid_default_create_index",sourcefile,13060,ret); goto out; } @@ -249,7 +249,7 @@ static int ldbm_ancestorid_default_create_index(backend *be, ImportJob *job) ret = NEW_IDL_NO_ALLID; children = idl_fetch(be, db_pid, &key, txn, ai_pid, &ret); if (ret != 0) { - ldbm_nasty(sourcefile,13070,ret); + ldbm_nasty("ldbm_ancestorid_default_create_index", sourcefile,13070,ret); break; } @@ -274,8 +274,8 @@ static int ldbm_ancestorid_default_create_index(backend *be, ImportJob *job) descendants = idl_union_allids(be, ai_aid, ididl->idl, children); idl_free(&children); if (id2idl_hash_remove(ht, &id) == 0) { - LDAPDebug(LDAP_DEBUG_ERR, "ldbm_ancestorid_default_create_index - " - "id2idl_hash_remove() failed\n", 0,0,0); + slapi_log_err(SLAPI_LOG_ERR, "ldbm_ancestorid_default_create_index", + "id2idl_hash_remove() failed\n"); } else { id2idl_free(&ididl); } @@ -309,8 +309,8 @@ static int ldbm_ancestorid_default_create_index(backend *be, ImportJob *job) ididl->keyid = parentid; ididl->idl = descendants; if (id2idl_hash_add(ht, &parentid, ididl, NULL) == 0) { - LDAPDebug(LDAP_DEBUG_ERR, "ldbm_ancestorid_default_create_index - " - "id2idl_hash_add failed\n", 0,0,0); + slapi_log_err(SLAPI_LOG_ERR, "ldbm_ancestorid_default_create_index ", + "id2idl_hash_add failed\n"); } } @@ -394,9 +394,9 @@ static int ldbm_ancestorid_new_idl_create_index(backend *be, ImportJob *job) /* Bail now if we did not get here honestly. */ if (!idl_get_idl_new()) { - LDAPDebug(LDAP_DEBUG_ERR, "ldbm_ancestorid_new_idl_create_index - " + slapi_log_err(SLAPI_LOG_ERR, "ldbm_ancestorid_new_idl_create_index", "Cannot create ancestorid index. " - "New IDL version called but idl_new is false!\n", 0,0,0); + "New IDL version called but idl_new is false!\n"); return 1; } @@ -413,14 +413,14 @@ static int ldbm_ancestorid_new_idl_create_index(backend *be, ImportJob *job) /* Open the ancestorid index file */ ret = dblayer_get_index_file(be, ai_aid, &db_aid, DBOPEN_CREATE); if (ret != 0) { - ldbm_nasty(sourcefile,13050,ret); + ldbm_nasty("ldbm_ancestorid_new_idl_create_index", sourcefile,13050,ret); goto out; } /* Maybe nothing to do */ if (nodes == NULL || nodes->b_nids == 0) { - LDAPDebug(LDAP_DEBUG_ERR, "ldbm_ancestorid_new_idl_create_index - " - "Nothing to do to build ancestorid index\n", 0, 0, 0); + slapi_log_err(SLAPI_LOG_ERR, "ldbm_ancestorid_new_idl_create_index", + "Nothing to do to build ancestorid index\n"); goto out; } @@ -430,7 +430,7 @@ static int ldbm_ancestorid_new_idl_create_index(backend *be, ImportJob *job) /* Open the parentid index file */ ret = dblayer_get_index_file(be, ai_pid, &db_pid, DBOPEN_CREATE); if (ret != 0) { - ldbm_nasty(sourcefile,13060,ret); + ldbm_nasty("ldbm_ancestorid_new_idl_create_index", sourcefile,13060,ret); goto out; } @@ -455,7 +455,7 @@ static int ldbm_ancestorid_new_idl_create_index(backend *be, ImportJob *job) ret = NEW_IDL_NO_ALLID; children = idl_fetch(be, db_pid, &key, txn, ai_pid, &ret); if (ret != 0) { - ldbm_nasty(sourcefile,13070,ret); + ldbm_nasty("ldbm_ancestorid_new_idl_create_index", sourcefile,13070,ret); break; } @@ -496,7 +496,7 @@ static int ldbm_ancestorid_new_idl_create_index(backend *be, ImportJob *job) while (1) { ret = ldbm_parentid(be, txn, id, &parentid); if (ret != 0) { - slapi_log_error(SLAPI_LOG_ERR, "ldbm_ancestorid_new_idl_create_index", + slapi_log_err(SLAPI_LOG_ERR, "ldbm_ancestorid_new_idl_create_index", "Failure: ldbm_parentid on node index [" ID_FMT "] of [" ID_FMT "]\n", nids, nodes->b_nids); idl_free(&children); @@ -539,8 +539,8 @@ static int ldbm_ancestorid_new_idl_create_index(backend *be, ImportJob *job) import_log_notice(job, SLAPI_LOG_INFO, "ldbm_ancestorid_new_idl_create_index", "Created ancestorid index (new idl)."); } else { - LDAPDebug(LDAP_DEBUG_ERR, "ldbm_ancestorid_new_idl_create_index - " - "Failed to create ancestorid index\n", 0,0,0); + slapi_log_err(SLAPI_LOG_ERR, "ldbm_ancestorid_new_idl_create_index", + "Failed to create ancestorid index\n"); } /* Free any leftover idlists */ @@ -580,7 +580,7 @@ static int ldbm_parentid(backend *be, DB_TXN *txn, ID id, ID *ppid) /* Open the id2entry file */ ret = dblayer_get_id2entry(be, &db); if (ret != 0) { - ldbm_nasty(sourcefile,13100,ret); + ldbm_nasty("ldbm_parentid", sourcefile,13100,ret); goto out; } @@ -594,8 +594,8 @@ static int ldbm_parentid(backend *be, DB_TXN *txn, ID id, ID *ppid) /* Read id2entry */ ret = db->get(db, txn, &key, &data, 0); if (ret != 0) { - ldbm_nasty(sourcefile,13110,ret); - slapi_log_error(SLAPI_LOG_ERR, "ldbm_parentid", + ldbm_nasty("ldbm_parentid", sourcefile,13110,ret); + slapi_log_err(SLAPI_LOG_ERR, "ldbm_parentid", "Unable to find entry id [" ID_FMT "] (original [" ID_FMT "])" " in id2entry\n", stored_id, id); goto out; @@ -649,7 +649,8 @@ static int check_cache(id2idl_hash *ht) } if (found > 0) { - LDAPDebug(LDAP_DEBUG_ERR, "check_cache - parentid index is not complete (%lu extra keys in ancestorid cache)\n", found,0,0); + slapi_log_err(SLAPI_LOG_ERR, "check_cache", + "parentid index is not complete (%lu extra keys in ancestorid cache)\n", found); ret = -1; } @@ -716,20 +717,20 @@ static int ancestorid_addordel( if (flags & BE_INDEX_ADD) { #if 1 - LDAPDebug(LDAP_DEBUG_TRACE, "ancestorid_addordel - Insert ancestorid %lu:%lu\n", - (u_long)node_id, (u_long)id, 0); + slapi_log_err(SLAPI_LOG_TRACE, "ancestorid_addordel", "Insert ancestorid %lu:%lu\n", + (u_long)node_id, (u_long)id); #endif ret = idl_insert_key(be, db, &key, id, txn, ai, allids); } else { #if 1 - LDAPDebug(LDAP_DEBUG_TRACE, "ancestorid_addordel - Delete ancestorid %lu:%lu\n", - (u_long)node_id, (u_long)id, 0); + slapi_log_err(SLAPI_LOG_TRACE, "ancestorid_addordel", "Delete ancestorid %lu:%lu\n", + (u_long)node_id, (u_long)id); #endif ret = idl_delete_key(be, db, &key, id, txn, ai); } if (ret != 0) { - ldbm_nasty(sourcefile,13120,ret); + ldbm_nasty("ancestorid_addordel", sourcefile,13120,ret); } return ret; @@ -772,7 +773,7 @@ static int ldbm_ancestorid_index_update( ainfo_get(be, LDBM_ANCESTORID_STR, &ai); ret = dblayer_get_index_file(be, ai, &db, DBOPEN_CREATE); if (ret != 0) { - ldbm_nasty(sourcefile,13130,ret); + ldbm_nasty("ldbm_ancestorid_index_update", sourcefile,13130,ret); goto out; } @@ -804,8 +805,8 @@ static int ldbm_ancestorid_index_update( err = entryrdn_index_read(be, &sdn, &node_id, txn); if (err) { if (DB_NOTFOUND != err) { - ldbm_nasty(sourcefile,13141,err); - LDAPDebug1Arg(LDAP_DEBUG_ERR, "ldbm_ancestorid_index_update - " + ldbm_nasty("ldbm_ancestorid_index_update", sourcefile,13141,err); + slapi_log_err(SLAPI_LOG_ERR, "ldbm_ancestorid_index_update", "entryrdn_index_read(%s)\n", slapi_sdn_get_dn(&sdn)); ret = err; } @@ -820,7 +821,7 @@ static int ldbm_ancestorid_index_update( idl = index_read(be, LDBM_ENTRYDN_STR, indextype_EQUALITY, &ndnv, txn, &err); if (idl == NULL) { if (err != 0 && err != DB_NOTFOUND) { - ldbm_nasty(sourcefile,13140,err); + ldbm_nasty("ldbm_ancestorid_index_update", sourcefile,13140,err); ret = err; } break; @@ -976,14 +977,14 @@ _sdn_suffix_cmp( /* return the DN */ slapi_sdn_set_dn_passin(common, ndnstr); - LDAPDebug(LDAP_DEBUG_TRACE, "_sdn_suffix_cmp - common suffix <%s>\n", - slapi_sdn_get_dn(common), 0, 0); + slapi_log_err(SLAPI_LOG_TRACE, "_sdn_suffix_cmp", "Common suffix <%s>\n", + slapi_sdn_get_dn(common)); out: slapi_ldap_value_free(rdns1); slapi_ldap_value_free(rdns2); - LDAPDebug(LDAP_DEBUG_TRACE, "_sdn_suffix_cmp - (<%s>, <%s>) => %d\n", + slapi_log_err(SLAPI_LOG_TRACE, "_sdn_suffix_cmp", "(<%s>, <%s>) => %d\n", slapi_sdn_get_dn(left), slapi_sdn_get_dn(right), ret); return ret; diff --git a/ldap/servers/slapd/back-ldbm/archive.c b/ldap/servers/slapd/back-ldbm/archive.c index 081cda0..7425a07 100644 --- a/ldap/servers/slapd/back-ldbm/archive.c +++ b/ldap/servers/slapd/back-ldbm/archive.c @@ -39,7 +39,7 @@ int ldbm_back_archive2ldbm( Slapi_PBlock *pb ) li->li_flags = run_from_cmdline = (task_flags & SLAPI_TASK_RUNNING_FROM_COMMANDLINE); if ( !rawdirectory || !*rawdirectory ) { - LDAPDebug0Args(LDAP_DEBUG_ERR, "ldbm_back_archive2ldbm - No archive name\n"); + slapi_log_err(SLAPI_LOG_ERR, "ldbm_back_archive2ldbm", "No archive name\n"); return -1; } @@ -47,11 +47,11 @@ int ldbm_back_archive2ldbm( Slapi_PBlock *pb ) return_value = dbversion_read(li, directory, &dbversion, &dataversion); if (return_value) { if (ENOENT == return_value) { - LDAPDebug1Arg(LDAP_DEBUG_ERR, "ldbm_back_archive2ldbm - No back up \"%s\" exists.\n", + slapi_log_err(SLAPI_LOG_ERR, "ldbm_back_archive2ldbm", "No back up \"%s\" exists.\n", directory); return -1; } - LDAPDebug1Arg(LDAP_DEBUG_WARNING, "ldbm_back_archive2ldbm - " + slapi_log_err(SLAPI_LOG_WARNING, "ldbm_back_archive2ldbm", "Unable to read dbversion file in %s\n", directory); } @@ -72,14 +72,14 @@ int ldbm_back_archive2ldbm( Slapi_PBlock *pb ) /* initialize a restore file to be able to detect a startup after restore */ if (dblayer_restore_file_init(li)) { - LDAPDebug0Args(LDAP_DEBUG_ERR, "ldbm_back_archive2ldbm - Failed to write restore file.\n"); + slapi_log_err(SLAPI_LOG_ERR, "ldbm_back_archive2ldbm", "Failed to write restore file.\n"); return -1; } } if (backendname) { inst = ldbm_instance_find_by_name(li, backendname); if (NULL == inst) { - LDAPDebug1Arg(LDAP_DEBUG_ERR, "ldbm_back_archive2ldbm - Backend \"%s\" does not exist.\n", + slapi_log_err(SLAPI_LOG_ERR, "ldbm_back_archive2ldbm", "Backend \"%s\" does not exist.\n", backendname); return -1; } @@ -90,11 +90,10 @@ int ldbm_back_archive2ldbm( Slapi_PBlock *pb ) /* task does not support restore old idl onto new idl server */ if (is_old_to_new) { - LDAPDebug(LDAP_DEBUG_ERR, - "ldbm_back_archive2ldbm - Backup has old idl format; " + slapi_log_err(SLAPI_LOG_ERR, + "ldbm_back_archive2ldbm", "Backup has old idl format; " "to restore old formated backup onto the new server, " - "please use command line utility \"bak2db\" .\n", - 0, 0, 0); + "please use command line utility \"bak2db\" .\n"); if (task) { slapi_task_log_notice(task, @@ -111,10 +110,10 @@ int ldbm_back_archive2ldbm( Slapi_PBlock *pb ) /* check if an import/restore is already ongoing... */ if (instance_set_busy(inst) != 0) { - LDAPDebug(LDAP_DEBUG_WARNING, - "ldbm_back_archive2ldbm - '%s' is already in the middle of " + slapi_log_err(SLAPI_LOG_WARNING, + "ldbm_back_archive2ldbm", "'%s' is already in the middle of " "another task and cannot be disturbed.\n", - inst->inst_name, 0, 0); + inst->inst_name); if (task) { slapi_task_log_notice(task, "Backend '%s' is already in the middle of " @@ -142,8 +141,8 @@ int ldbm_back_archive2ldbm( Slapi_PBlock *pb ) for (inst_obj = objset_first_obj(li->li_instance_set); inst_obj; inst_obj = objset_next_obj(li->li_instance_set, inst_obj)) { inst = (ldbm_instance *)object_get_data(inst_obj); - LDAPDebug(LDAP_DEBUG_INFO, "ldbm_back_archive2ldbm - Bringing %s offline...\n", - inst->inst_name, 0, 0); + slapi_log_err(SLAPI_LOG_INFO, "ldbm_back_archive2ldbm", "Bringing %s offline...\n", + inst->inst_name); if (task) { slapi_task_log_notice(task, "Bringing %s offline...", inst->inst_name); @@ -165,13 +164,13 @@ int ldbm_back_archive2ldbm( Slapi_PBlock *pb ) /* tell the database to restore */ return_value = dblayer_restore(li, directory, task, backendname); if (0 != return_value) { - LDAPDebug(LDAP_DEBUG_ERR, - "ldbm_back_archive2ldbm - Failed to read backup file set. " + slapi_log_err(SLAPI_LOG_ERR, + "ldbm_back_archive2ldbm", "Failed to read backup file set. " "Either the directory specified doesn't exist, " "or it exists but doesn't contain a valid backup set, " "or file permissions prevent the server reading " "the backup set. error=%d (%s)\n", - return_value, dblayer_strerror(return_value), 0 ); + return_value, dblayer_strerror(return_value)); if (task) { slapi_task_log_notice(task, "Failed to read the backup file set " "from %s", directory); @@ -206,8 +205,8 @@ int ldbm_back_archive2ldbm( Slapi_PBlock *pb ) *p = '\0'; } bakup_dir = slapi_ch_smprintf("%s%ctmp_%010ld", directory, c, time(0)); - LDAPDebug(LDAP_DEBUG_INFO, - "ldbm_back_archive2ldbm - backup dir: %s\n", bakup_dir, 0, 0); + slapi_log_err(SLAPI_LOG_INFO, + "ldbm_back_archive2ldbm", "Backup dir: %s\n", bakup_dir); if (p) *p = c; slapi_pblock_set( pb, SLAPI_SEQ_VAL, bakup_dir ); @@ -225,8 +224,9 @@ int ldbm_back_archive2ldbm( Slapi_PBlock *pb ) /* error case (607331) * just to go back to the previous state if possible */ if ((return_value = dblayer_start(li, DBLAYER_NORMAL_MODE))) { - LDAPDebug1Arg(LDAP_DEBUG_ERR, - "ldbm_back_archive2ldbm - Unable to to start database in [%s]\n", li->li_directory); + slapi_log_err(SLAPI_LOG_ERR, + "ldbm_back_archive2ldbm", "Unable to to start database in [%s]\n", + li->li_directory); if (task) { slapi_task_log_notice(task, "Failed to start the database in " "%s", li->li_directory); @@ -241,9 +241,9 @@ int ldbm_back_archive2ldbm( Slapi_PBlock *pb ) inst = (ldbm_instance *)object_get_data(inst_obj); ret = dblayer_instance_start(inst->inst_be, DBLAYER_NORMAL_MODE); if (ret != 0) { - LDAPDebug(LDAP_DEBUG_ERR, - "ldbm_back_archive2ldbm - Unable to restart '%s'\n", - inst->inst_name, 0, 0); + slapi_log_err(SLAPI_LOG_ERR, + "ldbm_back_archive2ldbm", "Unable to restart '%s'\n", + inst->inst_name); if (task) { slapi_task_log_notice(task, "Unable to restart '%s'", inst->inst_name); @@ -282,8 +282,7 @@ int ldbm_back_ldbm2archive( Slapi_PBlock *pb ) slapi_pblock_get( pb, SLAPI_BACKEND_TASK, &task ); if ( !rawdirectory || !*rawdirectory ) { - LDAPDebug(LDAP_DEBUG_ERR, "ldbm_back_ldbm2archive - No archive name\n", - 0, 0, 0 ); + slapi_log_err(SLAPI_LOG_ERR, "ldbm_back_ldbm2archive", "No archive name\n"); return -1; } @@ -295,8 +294,7 @@ int ldbm_back_ldbm2archive( Slapi_PBlock *pb ) if (0 != (return_value = dblayer_start(li, DBLAYER_ARCHIVE_MODE|DBLAYER_NO_DBTHREADS_MODE))) { - LDAPDebug(LDAP_DEBUG_ERR, "ldbm_back_ldbm2archive - Failed to init database\n", - 0, 0, 0); + slapi_log_err(SLAPI_LOG_ERR, "ldbm_back_ldbm2archive", "Failed to init database\n"); if (task) { slapi_task_log_notice(task, "Failed to init database"); } @@ -309,8 +307,8 @@ int ldbm_back_ldbm2archive( Slapi_PBlock *pb ) if (stat(directory, &sbuf) == 0) { if (slapd_comp_path(directory, li->li_directory) == 0) { - LDAPDebug(LDAP_DEBUG_ERR, - "ldbm_back_ldbm2archive - Cannot archive to the db directory.\n", 0, 0, 0); + slapi_log_err(SLAPI_LOG_ERR, + "ldbm_back_ldbm2archive", "Cannot archive to the db directory.\n"); if (task) { slapi_task_log_notice(task, "Cannot archive to the db directory."); @@ -320,8 +318,8 @@ int ldbm_back_ldbm2archive( Slapi_PBlock *pb ) } dir_bak = slapi_ch_smprintf("%s.bak", directory); - LDAPDebug(LDAP_DEBUG_INFO, "ldbm_back_ldbm2archive - %s exists. Renaming to %s\n", - directory, dir_bak, 0); + slapi_log_err(SLAPI_LOG_INFO, "ldbm_back_ldbm2archive", "%s exists. Renaming to %s\n", + directory, dir_bak); if (task) { slapi_task_log_notice(task, "%s exists. Renaming to %s", directory, dir_bak); @@ -329,9 +327,9 @@ int ldbm_back_ldbm2archive( Slapi_PBlock *pb ) if (stat(dir_bak, &sbuf) == 0) { return_value = ldbm_delete_dirs(dir_bak); if (0 != return_value) { - LDAPDebug(LDAP_DEBUG_ERR, - "ldbm_back_ldbm2archive - %s exists and failed to delete it.\n", - dir_bak, 0, 0); + slapi_log_err(SLAPI_LOG_ERR, + "ldbm_back_ldbm2archive", "%s exists and failed to delete it.\n", + dir_bak); if (task) { slapi_task_log_notice(task, "%s exists and failed to delete it.", dir_bak); @@ -343,12 +341,12 @@ int ldbm_back_ldbm2archive( Slapi_PBlock *pb ) return_value = PR_Rename(directory, dir_bak); if (return_value != PR_SUCCESS) { PRErrorCode prerr = PR_GetError(); - LDAPDebug(LDAP_DEBUG_ERR, - "ldbm_back_ldbm2archive - Failed to rename \"%s\" to \"%s\".\n", - directory, dir_bak, 0); - LDAPDebug(LDAP_DEBUG_ERR, - "ldbm_back_ldbm2archive - "SLAPI_COMPONENT_NAME_NSPR " error %d (%s)\n", - prerr, slapd_pr_strerror(prerr), 0); + slapi_log_err(SLAPI_LOG_ERR, + "ldbm_back_ldbm2archive", "Failed to rename \"%s\" to \"%s\".\n", + directory, dir_bak); + slapi_log_err(SLAPI_LOG_ERR, + "ldbm_back_ldbm2archive", SLAPI_COMPONENT_NAME_NSPR " error %d (%s)\n", + prerr, slapd_pr_strerror(prerr)); if (task) { slapi_task_log_notice(task, "Failed to rename \"%s\" to \"%s\".", @@ -364,8 +362,8 @@ int ldbm_back_ldbm2archive( Slapi_PBlock *pb ) if (0 != MKDIR(directory,SLAPD_DEFAULT_DIR_MODE) && EEXIST != errno) { char *msg = dblayer_strerror(errno); - LDAPDebug(LDAP_DEBUG_ERR, - "ldbm_back_ldbm2archive - mkdir(%s) failed; errno %i (%s)\n", + slapi_log_err(SLAPI_LOG_ERR, + "ldbm_back_ldbm2archive", "mkdir(%s) failed; errno %i (%s)\n", directory, errno, msg ? msg : "unknown"); if (task) { slapi_task_log_notice(task, "mkdir(%s) failed; errno %i (%s)", @@ -386,10 +384,10 @@ int ldbm_back_ldbm2archive( Slapi_PBlock *pb ) /* check if an import/restore is already ongoing... */ if (instance_set_busy(inst) != 0 || dblayer_in_import(inst) != 0) { - LDAPDebug(LDAP_DEBUG_WARNING, - "ldbm_back_ldbm2archive - Backend '%s' is already in the middle of " + slapi_log_err(SLAPI_LOG_WARNING, + "ldbm_back_ldbm2archive", "Backend '%s' is already in the middle of " "another task and cannot be disturbed.\n", - inst->inst_name, 0, 0); + inst->inst_name); if (task) { slapi_task_log_notice(task, "Backend '%s' is already in the middle of " @@ -416,11 +414,11 @@ int ldbm_back_ldbm2archive( Slapi_PBlock *pb ) return_value = plugin_call_plugins (pb, SLAPI_PLUGIN_BE_PRE_BACKUP_FN); if (return_value) { - LDAPDebug1Arg(LDAP_DEBUG_BACKLDBM, - "ldbm_back_ldbm2archive - pre-backup-plugin failed (%d).\n", return_value); + slapi_log_err(SLAPI_LOG_BACKLDBM, + "ldbm_back_ldbm2archive", "pre-backup-plugin failed (%d).\n", return_value); if (is_slapd_running() && run_from_cmdline) { - LDAPDebug0Args(LDAP_DEBUG_ERR, - "ldbm_back_ldbm2archive - Standalone db2bak is not supported when a " + slapi_log_err(SLAPI_LOG_ERR, + "ldbm_back_ldbm2archive", "Standalone db2bak is not supported when a " "multimaster replication enabled server is " "coexisting.\nPlease use db2bak.pl, instead.\n"); goto err; @@ -432,8 +430,8 @@ int ldbm_back_ldbm2archive( Slapi_PBlock *pb ) return_value = plugin_call_plugins (pb, SLAPI_PLUGIN_BE_POST_BACKUP_FN); if (return_value) { - LDAPDebug1Arg(LDAP_DEBUG_BACKLDBM, - "ldbm_back_ldbm2archive - post-backup-plugin failed (%d).\n", return_value); + slapi_log_err(SLAPI_LOG_BACKLDBM, + "ldbm_back_ldbm2archive", "post-backup-plugin failed (%d).\n", return_value); } if (! run_from_cmdline) { @@ -450,8 +448,8 @@ int ldbm_back_ldbm2archive( Slapi_PBlock *pb ) err: if (return_value) { if (dir_bak) { - LDAPDebug2Args(LDAP_DEBUG_ERR, - "ldbm_back_ldbm2archive - Failed renaming %s back to %s\n", + slapi_log_err(SLAPI_LOG_ERR, + "ldbm_back_ldbm2archive", "Failed renaming %s back to %s\n", dir_bak, directory); if (task) { slapi_task_log_notice(task, @@ -459,8 +457,8 @@ err: dir_bak, directory); } } else { - LDAPDebug1Arg(LDAP_DEBUG_ERR, - "ldbm_back_ldbm2archive - Failed removing %s\n", directory); + slapi_log_err(SLAPI_LOG_ERR, + "ldbm_back_ldbm2archive", "Failed removing %s\n", directory); if (task) { slapi_task_log_notice(task, "db2archive failed: removing %s", directory); @@ -469,11 +467,11 @@ err: ldbm_delete_dirs(directory); if (dir_bak && (PR_SUCCESS != PR_Rename(dir_bak, directory))) { PRErrorCode prerr = PR_GetError(); - LDAPDebug2Args(LDAP_DEBUG_ERR, - "ldbm_back_ldbm2archive - Failed to rename \"%s\" to \"%s\".\n", + slapi_log_err(SLAPI_LOG_ERR, + "ldbm_back_ldbm2archive", "Failed to rename \"%s\" to \"%s\".\n", dir_bak, directory); - LDAPDebug2Args(LDAP_DEBUG_ERR, - "ldbm_back_ldbm2archive - " SLAPI_COMPONENT_NAME_NSPR " error %d (%s)\n", + slapi_log_err(SLAPI_LOG_ERR, + "ldbm_back_ldbm2archive", SLAPI_COMPONENT_NAME_NSPR " error %d (%s)\n", prerr, slapd_pr_strerror(prerr)); if (task) { slapi_task_log_notice(task, @@ -489,8 +487,7 @@ out: /* close the database down again */ if (run_from_cmdline && 0 != dblayer_close(li,DBLAYER_ARCHIVE_MODE|DBLAYER_NO_DBTHREADS_MODE)) { - LDAPDebug(LDAP_DEBUG_ERR, "ldbm_back_ldbm2archive - Failed to close database\n", - 0, 0, 0); + slapi_log_err(SLAPI_LOG_ERR, "ldbm_back_ldbm2archive", "Failed to close database\n"); if (task) { slapi_task_log_notice(task, "Failed to close database"); } diff --git a/ldap/servers/slapd/back-ldbm/back-ldbm.h b/ldap/servers/slapd/back-ldbm/back-ldbm.h index fe9e345..8b63e2c 100644 --- a/ldap/servers/slapd/back-ldbm/back-ldbm.h +++ b/ldap/servers/slapd/back-ldbm/back-ldbm.h @@ -105,7 +105,6 @@ typedef unsigned short u_int16_t; #include "slapi-plugin.h" #include "slapi-private.h" #include "avl.h" -#include "ldaplog.h" #include "portable.h" #include "proto-slap.h" diff --git a/ldap/servers/slapd/back-ldbm/cache.c b/ldap/servers/slapd/back-ldbm/cache.c index 7f1c280..3a86d86 100644 --- a/ldap/servers/slapd/back-ldbm/cache.c +++ b/ldap/servers/slapd/back-ldbm/cache.c @@ -43,15 +43,18 @@ #ifdef LDAP_CACHE_DEBUG #define ASSERT(_x) do { \ if (!(_x)) { \ - LDAPDebug(LDAP_DEBUG_ERR, "BAD CACHE ASSERTION at %s/%d: %s\n", \ + slapi_log_err(SLAPI_LOG_ERR, "cache", "BAD CACHE ASSERTION at %s/%d: %s\n", \ __FILE__, __LINE__, #_x); \ *(char *)0L = 23; \ } \ } while (0) -#define LOG(_a, _x1, _x2, _x3) LDAPDebug(LDAP_DEBUG_CACHE, _a, _x1, _x2, _x3) + +# define LOG(...) slapi_log_err(SLAPI_LOG_CACHE, (char*)__func__, __VA_ARGS__) +//# define LOG(_a, _x1, _x2, _x3) slapi_log_err(SLAPI_LOG_CACHE, _a, _x1, _x2, _x3) #else #define ASSERT(_x) ; -#define LOG(_a, _x1, _x2, _x3) ; +//#define LOG(_a, _x1, _x2, _x3) ; +#define LOG(...) #endif #define LRU_DETACH(cache, e) lru_detach((cache), (void *)(e)) @@ -270,7 +273,7 @@ dump_hash(Hashtable *ht) PR_snprintf(ep_id, 16, "%u-%u", ((struct backcommon *)e)->ep_id, ((struct backcommon *)e)->ep_refcnt); len = strlen(ep_id); if (ids_size < len + 1) { - LDAPDebug1Arg(LDAP_DEBUG_DEBUG, "%s\n", ep_ids); + slapi_log_err(SLAPI_LOG_DEBUG, "dump_hash", "%s\n", ep_ids); p = ep_ids; ids_size = 80; } PR_snprintf(p, ids_size, "%s:", ep_id); @@ -278,7 +281,7 @@ dump_hash(Hashtable *ht) } while ((e = HASH_NEXT(ht, e))); } if (p != ep_ids) { - LDAPDebug1Arg(LDAP_DEBUG_DEBUG, "%s\n", ep_ids); + slapi_log_err(SLAPI_LOG_DEBUG, "dump_hash", "%s\n", ep_ids); } } #endif @@ -330,7 +333,7 @@ lru_verify(struct cache *cache, void *ptr, int in) struct backcommon *e; if (NULL == ptr) { - LOG("=> lru_verify\n<= lru_verify (null entry)\n", 0, 0, 0); + LOG("=> lru_verify\n<= lru_verify (null entry)\n"); return; } e = (struct backcommon *)ptr; @@ -381,7 +384,7 @@ static void lru_detach(struct cache *cache, void *ptr) struct backcommon *e; if (NULL == ptr) { - LOG("=> lru_detach\n<= lru_detach (null entry)\n", 0, 0, 0); + LOG("=> lru_detach\n<= lru_detach (null entry)\n"); return; } e = (struct backcommon *)ptr; @@ -409,7 +412,7 @@ static void lru_delete(struct cache *cache, void *ptr) struct backcommon *e; if (NULL == ptr) { - LOG("=> lru_delete\n<= lru_delete (null entry)\n", 0, 0, 0); + LOG("=> lru_delete\n<= lru_delete (null entry)\n"); return; } e = (struct backcommon *)ptr; @@ -436,7 +439,7 @@ static void lru_add(struct cache *cache, void *ptr) struct backcommon *e; if (NULL == ptr) { - LOG("=> lru_add\n<= lru_add (null entry)\n", 0, 0, 0); + LOG("=> lru_add\n<= lru_add (null entry)\n"); return; } e = (struct backcommon *)ptr; @@ -489,7 +492,7 @@ static void cache_make_hashes(struct cache *cache, int type) /* initialize the cache */ int cache_init(struct cache *cache, size_t maxsize, long maxentries, int type) { - LDAPDebug(LDAP_DEBUG_TRACE, "=> cache_init\n", 0, 0, 0); + slapi_log_err(SLAPI_LOG_TRACE, "cache_init", "-->\n"); cache->c_maxsize = maxsize; cache->c_maxentries = maxentries; cache->c_curentries = 0; @@ -507,8 +510,8 @@ int cache_init(struct cache *cache, size_t maxsize, long maxentries, int type) } cache->c_tries = slapi_counter_new(); } else { - LDAPDebug0Args(LDAP_DEBUG_NOTICE, - "cache_init - slapi counter is not available.\n"); + slapi_log_err(SLAPI_LOG_NOTICE, + "cache_init", "slapi counter is not available.\n"); cache->c_cursize = NULL; cache->c_hits = NULL; cache->c_tries = NULL; @@ -518,10 +521,10 @@ int cache_init(struct cache *cache, size_t maxsize, long maxentries, int type) if (((cache->c_mutex = PR_NewMonitor()) == NULL) || ((cache->c_emutexalloc_mutex = PR_NewLock()) == NULL)) { - LDAPDebug0Args(LDAP_DEBUG_ERR, "cache_init - PR_NewMonitor failed\n"); + slapi_log_err(SLAPI_LOG_ERR, "cache_init", "PR_NewMonitor failed\n"); return 0; } - LDAPDebug(LDAP_DEBUG_TRACE, "<= cache_init\n", 0, 0, 0); + slapi_log_err(SLAPI_LOG_TRACE, "cache_init", "<--\n"); return 1; } @@ -542,7 +545,7 @@ entrycache_flush(struct cache *cache) { struct backentry *e = NULL; - LOG("=> entrycache_flush\n", 0, 0, 0); + LOG("=> entrycache_flush\n"); /* all entries on the LRU list are guaranteed to have a refcnt = 0 * (iow, nobody's using them), so just delete from the tail down @@ -561,8 +564,8 @@ entrycache_flush(struct cache *cache) ASSERT(e->ep_refcnt == 0); e->ep_refcnt++; if (entrycache_remove_int(cache, e) < 0) { - LDAPDebug(LDAP_DEBUG_ERR, - "entrycache_flush - Unable to delete entry\n", 0, 0, 0); + slapi_log_err(SLAPI_LOG_ERR, + "entrycache_flush", "Unable to delete entry\n"); break; } if(e == CACHE_LRU_HEAD(cache, struct backentry *)) { @@ -572,7 +575,7 @@ entrycache_flush(struct cache *cache) if (e) LRU_DETACH(cache, e); LOG("<= entrycache_flush (down to %lu entries, %lu bytes)\n", - cache->c_curentries, slapi_counter_get_value(cache->c_cursize), 0); + cache->c_curentries, slapi_counter_get_value(cache->c_cursize)); return e; } @@ -593,11 +596,11 @@ static void entrycache_clear_int(struct cache *cache) } cache->c_maxsize = size; if (cache->c_curentries > 0) { - LDAPDebug1Arg(LDAP_DEBUG_WARNING, - "entrycache_clear_int - There are still %ld entries " + slapi_log_err(SLAPI_LOG_WARNING, + "entrycache_clear_int", "There are still %ld entries " "in the entry cache.\n", cache->c_curentries); #ifdef LDAP_CACHE_DEBUG - LDAPDebug0Args(LDAP_DEBUG_DEBUG, "entrycache_clear_int - ID(s) in entry cache:\n"); + slapi_log_err(SLAPI_LOG_DEBUG, "entrycache_clear_int", "ID(s) in entry cache:\n"); dump_hash(cache->c_idtable); #endif } @@ -655,13 +658,13 @@ static void entrycache_set_max_size(struct cache *cache, size_t bytes) if (bytes < MINCACHESIZE) { bytes = MINCACHESIZE; - LDAPDebug(LDAP_DEBUG_WARNING, - "entrycache_set_max_size - Minimum cache size is %lu -- rounding up\n", - MINCACHESIZE, 0, 0); + slapi_log_err(SLAPI_LOG_WARNING, + "entrycache_set_max_size", "Minimum cache size is %lu -- rounding up\n", + MINCACHESIZE); } cache_lock(cache); cache->c_maxsize = bytes; - LOG("entry cache size set to %lu\n", bytes, 0, 0); + LOG("entry cache size set to %lu\n", bytes); /* check for full cache, and clear out if necessary */ if (CACHE_FULL(cache)) eflush = entrycache_flush(cache); @@ -683,10 +686,10 @@ static void entrycache_set_max_size(struct cache *cache, size_t bytes) * ldbm_instance_config */ if (! util_is_cachesize_sane(&bytes)) { - LDAPDebug(LDAP_DEBUG_WARNING, - "entrycache_set_max_size - Possible CONFIGURATION ERROR -- cachesize " + slapi_log_err(SLAPI_LOG_WARNING, + "entrycache_set_max_size", "Possible CONFIGURATION ERROR -- cachesize " "(%lu) may be configured to use more than the available " - "physical memory.\n", bytes, 0, 0); + "physical memory.\n", bytes); } } @@ -702,9 +705,9 @@ void cache_set_max_entries(struct cache *cache, long entries) cache_lock(cache); cache->c_maxentries = entries; if (entries >= 0) { - LOG("entry cache entry-limit set to %lu\n", entries, 0, 0); + LOG("entry cache entry-limit set to %lu\n", entries); } else { - LOG("entry cache entry-limit turned off\n", 0, 0, 0); + LOG("entry cache entry-limit turned off\n"); } /* check for full cache, and clear out if necessary */ @@ -849,7 +852,7 @@ entrycache_remove_int(struct cache *cache, struct backentry *e) } else { - LOG("remove %s from dn hash failed\n", ndn, 0, 0); + LOG("remove %s from dn hash failed\n", ndn); } /* if entry was added tentatively, it will be in the dntable but not in the idtable - we cannot just remove it from @@ -865,7 +868,7 @@ entrycache_remove_int(struct cache *cache, struct backentry *e) } else { - LOG("remove %s (%d) from id hash failed\n", ndn, e->ep_id, 0); + LOG("remove %s (%d) from id hash failed\n", ndn, e->ep_id); } } #ifdef UUIDCACHE_ON @@ -876,7 +879,7 @@ entrycache_remove_int(struct cache *cache, struct backentry *e) } else { - LOG("remove %d from uuid hash failed\n", uuid, 0, 0); + LOG("remove %d from uuid hash failed\n", uuid); } #endif if (ret == 0) { @@ -896,7 +899,7 @@ entrycache_remove_int(struct cache *cache, struct backentry *e) dump_hash(cache->c_idtable); } #endif - LOG("<= entrycache_remove_int: %d\n", ret, 0, 0); + LOG("<= entrycache_remove_int: %d\n", ret); return ret; } @@ -916,7 +919,7 @@ int cache_remove(struct cache *cache, void *ptr) struct backcommon *e; if (NULL == ptr) { - LOG("=> lru_remove\n<= lru_remove (null entry)\n", 0, 0, 0); + LOG("=> lru_remove\n<= lru_remove (null entry)\n"); return ret; } e = (struct backcommon *)ptr; @@ -941,7 +944,7 @@ int cache_replace(struct cache *cache, void *oldptr, void *newptr) struct backcommon *olde; if (NULL == oldptr || NULL == newptr) { - LOG("=> lru_replace\n<= lru_replace (null entry)\n", 0, 0, 0); + LOG("=> lru_replace\n<= lru_replace (null entry)\n"); return 0; } olde = (struct backcommon *)oldptr; @@ -975,7 +978,7 @@ static int entrycache_replace(struct cache *cache, struct backentry *olde, struct backentry *alte = NULL; LOG("=> entrycache_replace (%s) -> (%s)\n", backentry_get_ndn(olde), - backentry_get_ndn(newe), 0); + backentry_get_ndn(newe)); /* remove from all hashtables -- this function may be called from places * where the entry isn't in all the tables yet, so we don't care if any @@ -1017,7 +1020,7 @@ static int entrycache_replace(struct cache *cache, struct backentry *olde, slapi_counter_subtract(cache->c_cursize, newe->ep_size); cache->c_curentries--; newe->ep_refcnt--; - LOG("entry cache replace remove entry size %lu\n", newe->ep_size, 0, 0); + LOG("entry cache replace remove entry size %lu\n", newe->ep_size); } } /* @@ -1049,15 +1052,15 @@ static int entrycache_replace(struct cache *cache, struct backentry *olde, */ if (!add_hash(cache->c_dntable, (void *)newndn, strlen(newndn), newe, (void **)&alte)) { LOG("entry cache replace (%s): can't add to dn table (returned %s)\n", - newndn, alte?slapi_entry_get_dn(alte->ep_entry):"none", 0); + newndn, alte?slapi_entry_get_dn(alte->ep_entry):"none"); cache_unlock(cache); return 1; } if (!add_hash(cache->c_idtable, &(newe->ep_id), sizeof(ID), newe, (void **)&alte)) { LOG("entry cache replace (%s): can't add to id table (returned %s)\n", - newndn, alte?slapi_entry_get_dn(alte->ep_entry):"none", 0); + newndn, alte?slapi_entry_get_dn(alte->ep_entry):"none"); if(remove_hash(cache->c_dntable, (void *)newndn, strlen(newndn)) == 0){ - LOG("entry cache replace: failed to remove dn table\n", 0, 0, 0); + LOG("entry cache replace: failed to remove dn table\n"); } cache_unlock(cache); return 1; @@ -1067,10 +1070,10 @@ static int entrycache_replace(struct cache *cache, struct backentry *olde, newe, NULL)) { LOG("entry cache replace: can't add uuid\n", 0, 0, 0); if(remove_hash(cache->c_dntable, (void *)newndn, strlen(newndn)) == 0){ - LOG("entry cache replace: failed to remove dn table(uuid cache)\n", 0, 0, 0); + LOG("entry cache replace: failed to remove dn table(uuid cache)\n"); } if(remove_hash(cache->c_idtable, &(newe->ep_id), sizeof(ID)) == 0){ - LOG("entry cache replace: failed to remove id table(uuid cache)\n", 0, 0, 0); + LOG("entry cache replace: failed to remove id table(uuid cache)\n"); } cache_unlock(cache); return 1; @@ -1087,7 +1090,7 @@ static int entrycache_replace(struct cache *cache, struct backentry *olde, newe->ep_state = 0; cache_unlock(cache); LOG("<= entrycache_replace OK, cache size now %lu cache count now %ld\n", - slapi_counter_get_value(cache->c_cursize), cache->c_curentries, 0); + slapi_counter_get_value(cache->c_cursize), cache->c_curentries); return 0; } @@ -1100,7 +1103,7 @@ void cache_return(struct cache *cache, void **ptr) if (NULL == ptr || NULL == *ptr) { - LOG("=> cache_return\n<= cache_return (null entry)\n", 0, 0, 0); + LOG("=> cache_return\n<= cache_return (null entry)\n"); return; } bep = *(struct backcommon **)ptr; @@ -1120,7 +1123,7 @@ entrycache_return(struct cache *cache, struct backentry **bep) e = *bep; if (!e) { - LDAPDebug0Args(LDAP_DEBUG_ERR, "entrycache_return - backentry is NULL\n"); + slapi_log_err(SLAPI_LOG_ERR, "entrycache_return", "Backentry is NULL\n"); return; } LOG("entrycache_return - (%s) entry count: %d, entry in cache:%ld\n", @@ -1144,7 +1147,7 @@ entrycache_return(struct cache *cache, struct backentry **bep) * we don't/can't always call cache_remove(). */ if (remove_hash(cache->c_dntable, (void *)ndn, strlen(ndn)) == 0) { - LOG("entrycache_return -Failed to remove %s from dn table\n", ndn, 0, 0); + LOG("entrycache_return -Failed to remove %s from dn table\n", ndn); } } backentry_free(bep); @@ -1163,7 +1166,7 @@ entrycache_return(struct cache *cache, struct backentry **bep) backentry_free(&eflush); eflush = eflushtemp; } - LOG("entrycache_return - returning.\n", 0, 0, 0); + LOG("entrycache_return - returning.\n"); } @@ -1172,7 +1175,7 @@ struct backentry *cache_find_dn(struct cache *cache, const char *dn, unsigned lo { struct backentry *e; - LOG("=> cache_find_dn - (%s)\n", dn, 0, 0); + LOG("=> cache_find_dn - (%s)\n", dn); /*entry normalized by caller (dn2entry.c) */ cache_lock(cache); @@ -1181,7 +1184,7 @@ struct backentry *cache_find_dn(struct cache *cache, const char *dn, unsigned lo if (e->ep_state != 0) { /* entry is deleted or not fully created yet */ cache_unlock(cache); - LOG("<= cache_find_dn (NOT FOUND)\n", 0, 0, 0); + LOG("<= cache_find_dn (NOT FOUND)\n"); return NULL; } if (e->ep_refcnt == 0) @@ -1194,7 +1197,7 @@ struct backentry *cache_find_dn(struct cache *cache, const char *dn, unsigned lo } slapi_counter_increment(cache->c_tries); - LOG("<= cache_find_dn - (%sFOUND)\n", e ? "" : "NOT ", 0, 0); + LOG("<= cache_find_dn - (%sFOUND)\n", e ? "" : "NOT "); return e; } @@ -1204,7 +1207,7 @@ struct backentry *cache_find_id(struct cache *cache, ID id) { struct backentry *e; - LOG("=> cache_find_id (%lu)\n", (u_long)id, 0, 0); + LOG("=> cache_find_id (%lu)\n", (u_long)id); cache_lock(cache); if (find_hash(cache->c_idtable, &id, sizeof(ID), (void **)&e)) { @@ -1212,7 +1215,7 @@ struct backentry *cache_find_id(struct cache *cache, ID id) if (e->ep_state != 0) { /* entry is deleted or not fully created yet */ cache_unlock(cache); - LOG("<= cache_find_id (NOT FOUND)\n", 0, 0, 0); + LOG("<= cache_find_id (NOT FOUND)\n"); return NULL; } if (e->ep_refcnt == 0) @@ -1225,7 +1228,7 @@ struct backentry *cache_find_id(struct cache *cache, ID id) } slapi_counter_increment(cache->c_tries); - LOG("<= cache_find_id (%sFOUND)\n", e ? "" : "NOT ", 0, 0); + LOG("<= cache_find_id (%sFOUND)\n", e ? "" : "NOT "); return e; } @@ -1235,7 +1238,7 @@ struct backentry *cache_find_uuid(struct cache *cache, const char *uuid) { struct backentry *e; - LOG("=> cache_find_uuid (%s)\n", uuid, 0, 0); + LOG("=> cache_find_uuid (%s)\n", uuid); cache_lock(cache); if (find_hash(cache->c_uuidtable, uuid, strlen(uuid), (void **)&e)) { @@ -1243,7 +1246,7 @@ struct backentry *cache_find_uuid(struct cache *cache, const char *uuid) if (e->ep_state != 0) { /* entry is deleted or not fully created yet */ cache_unlock(cache); - LOG("<= cache_find_uuid (NOT FOUND)\n", 0, 0, 0); + LOG("<= cache_find_uuid (NOT FOUND)\n"); return NULL; } if (e->ep_refcnt == 0) @@ -1256,7 +1259,7 @@ struct backentry *cache_find_uuid(struct cache *cache, const char *uuid) } slapi_counter_increment(cache->c_tries); - LOG("<= cache_find_uuid (%sFOUND)\n", e ? "" : "NOT ", 0, 0); + LOG("<= cache_find_uuid (%sFOUND)\n", e ? "" : "NOT "); return e; } #endif @@ -1277,7 +1280,7 @@ entrycache_add_int(struct cache *cache, struct backentry *e, int state, int already_in = 0; LOG("=> entrycache_add_int( \"%s\", %ld )\n", backentry_get_ndn(e), - e->ep_id, 0); + (long int)e->ep_id); if(e->ep_size == 0){ /* @@ -1292,7 +1295,7 @@ entrycache_add_int(struct cache *cache, struct backentry *e, int state, cache_lock(cache); if (! add_hash(cache->c_dntable, (void *)ndn, strlen(ndn), e, (void **)&my_alt)) { - LOG("entry \"%s\" already in dn cache\n", ndn, 0, 0); + LOG("entry \"%s\" already in dn cache\n", ndn); /* add_hash filled in 'my_alt' if necessary */ if (my_alt == e) { @@ -1302,7 +1305,7 @@ entrycache_add_int(struct cache *cache, struct backentry *e, int state, * and the old entry was a placeholder and the new one isn't? * sounds like a confirmation of a previous add! */ - LOG("confirming a previous add\n", 0, 0, 0); + LOG("confirming a previous add\n"); already_in = 1; } else @@ -1373,7 +1376,7 @@ entrycache_add_int(struct cache *cache, struct backentry *e, int state, if (state == 0) { /* neither of these should fail, or something is very wrong. */ if (! add_hash(cache->c_idtable, &(e->ep_id), sizeof(ID), e, NULL)) { - LOG("entry %s already in id cache!\n", ndn, 0, 0); + LOG("entry %s already in id cache!\n", ndn); if (already_in) { /* there's a bug in the implementatin of 'modify' and 'modrdn' * that i'm working around here. basically they do a @@ -1390,12 +1393,12 @@ entrycache_add_int(struct cache *cache, struct backentry *e, int state, * remove the old entry and add the new one, and all will be * fine (i think). */ - LOG("<= entrycache_add_int (ignoring)\n", 0, 0, 0); + LOG("<= entrycache_add_int (ignoring)\n"); cache_unlock(cache); return 0; } if(remove_hash(cache->c_dntable, (void *)ndn, strlen(ndn)) == 0){ - LOG("entrycache_add_int: failed to remove %s from dn table\n", ndn, 0, 0); + LOG("entrycache_add_int: failed to remove %s from dn table\n", ndn); } e->ep_state |= ENTRY_STATE_NOTINCACHE; cache_unlock(cache); @@ -1411,10 +1414,10 @@ entrycache_add_int(struct cache *cache, struct backentry *e, int state, LOG("entry %s already in uuid cache!\n", backentry_get_ndn(e), 0, 0); if(remove_hash(cache->c_dntable, (void *)ndn, strlen(ndn)) == 0){ - LOG("entrycache_add_int: failed to remove dn table(uuid cache)\n", 0, 0, 0); + LOG("entrycache_add_int: failed to remove dn table(uuid cache)\n"); } if(remove_hash(cache->c_idtable, &(e->ep_id), sizeof(ID)) == 0){ - LOG("entrycache_add_int: failed to remove id table(uuid cache)\n", 0, 0, 0); + LOG("entrycache_add_int: failed to remove id table(uuid cache)\n"; } e->ep_state |= ENTRY_STATE_NOTINCACHE; cache_unlock(cache); @@ -1436,7 +1439,7 @@ entrycache_add_int(struct cache *cache, struct backentry *e, int state, e->ep_size, slapi_counter_get_value(cache->c_cursize), cache->c_maxsize); if (cache->c_maxentries >= 0) { LOG(" total entries %ld out of %ld\n", - cache->c_curentries, cache->c_maxentries, 0); + cache->c_curentries, cache->c_maxentries); } /* check for full cache, and clear out if necessary */ if (CACHE_FULL(cache)) @@ -1450,7 +1453,7 @@ entrycache_add_int(struct cache *cache, struct backentry *e, int state, backentry_free(&eflush); eflush = eflushtemp; } - LOG("<= entrycache_add_int OK\n", 0, 0, 0); + LOG("<= entrycache_add_int OK\n"); return 0; } @@ -1470,7 +1473,7 @@ int cache_add(struct cache *cache, void *ptr, void **alt) struct backcommon *e; if (NULL == ptr) { - LOG("=> cache_add\n<= cache_add (null entry)\n", 0, 0, 0); + LOG("=> cache_add\n<= cache_add (null entry)\n"); return 0; } e = (struct backcommon *)ptr; @@ -1511,7 +1514,7 @@ void cache_unlock(struct cache *cache) */ int cache_lock_entry(struct cache *cache, struct backentry *e) { - LOG("=> cache_lock_entry (%s)\n", backentry_get_ndn(e), 0, 0); + LOG("=> cache_lock_entry (%s)\n", backentry_get_ndn(e)); if (! e->ep_mutexp) { /* make sure only one thread does this */ @@ -1520,11 +1523,11 @@ int cache_lock_entry(struct cache *cache, struct backentry *e) e->ep_mutexp = PR_NewMonitor(); if (!e->ep_mutexp) { PR_Unlock(cache->c_emutexalloc_mutex); - LOG("<= cache_lock_entry (DELETED)\n", 0, 0, 0); - LDAPDebug1Arg(LDAP_DEBUG_ERR, - "cache_lock_entry - Failed to create a lock for %s\n", + LOG("<= cache_lock_entry (DELETED)\n"); + slapi_log_err(SLAPI_LOG_ERR, + "cache_lock_entry", "Failed to create a lock for %s\n", backentry_get_ndn(e)); - LOG("<= cache_lock_entry (FAILED)\n", 0, 0, 0); + LOG("<= cache_lock_entry (FAILED)\n"); return 1; } } @@ -1539,21 +1542,21 @@ int cache_lock_entry(struct cache *cache, struct backentry *e) if (e->ep_state & (ENTRY_STATE_DELETED|ENTRY_STATE_NOTINCACHE)) { cache_unlock(cache); PR_ExitMonitor(e->ep_mutexp); - LOG("<= cache_lock_entry (DELETED)\n", 0, 0, 0); + LOG("<= cache_lock_entry (DELETED)\n"); return RETRY_CACHE_LOCK; } cache_unlock(cache); - LOG("<= cache_lock_entry (FOUND)\n", 0, 0, 0); + LOG("<= cache_lock_entry (FOUND)\n"); return 0; } /* the opposite of above */ void cache_unlock_entry(struct cache *cache, struct backentry *e) { - LOG("=> cache_unlock_entry\n", 0, 0, 0); + LOG("=> cache_unlock_entry\n"); if (PR_ExitMonitor(e->ep_mutexp)) { - LOG("=> cache_unlock_entry - monitor was not entered!!!\n", 0, 0, 0); + LOG("=> cache_unlock_entry - monitor was not entered!!!\n"); } } @@ -1580,8 +1583,8 @@ dncache_clear_int(struct cache *cache) } cache->c_maxsize = size; if (cache->c_curentries > 0) { - LDAPDebug1Arg(LDAP_DEBUG_WARNING, - "dncache_clear_int - There are still %ld dn's " + slapi_log_err(SLAPI_LOG_WARNING, + "dncache_clear_int", "There are still %ld dn's " "in the dn cache. :/\n", cache->c_curentries); } } @@ -1604,13 +1607,13 @@ dncache_set_max_size(struct cache *cache, size_t bytes) if (bytes < MINCACHESIZE) { bytes = MINCACHESIZE; - LDAPDebug(LDAP_DEBUG_WARNING, - "dncache_set_max_size - Minimum cache size is %lu -- rounding up\n", - MINCACHESIZE, 0, 0); + slapi_log_err(SLAPI_LOG_WARNING, + "dncache_set_max_size", "Minimum cache size is %lu -- rounding up\n", + MINCACHESIZE); } cache_lock(cache); cache->c_maxsize = bytes; - LOG("entry cache size set to %lu\n", bytes, 0, 0); + LOG("entry cache size set to %lu\n", bytes); /* check for full cache, and clear out if necessary */ if (CACHE_FULL(cache)) { dnflush = dncache_flush(cache); @@ -1633,8 +1636,8 @@ dncache_set_max_size(struct cache *cache, size_t bytes) * ldbm_instance_config */ if (! util_is_cachesize_sane(&bytes)) { - LDAPDebug1Arg(LDAP_DEBUG_WARNING, - "dncache_set_max_size - Possible CONFIGURATION ERROR -- cachesize " + slapi_log_err(SLAPI_LOG_WARNING, + "dncache_set_max_size", "Possible CONFIGURATION ERROR -- cachesize " "(%lu) may be configured to use more than the available " "physical memory.\n", bytes); } @@ -1651,7 +1654,7 @@ dncache_remove_int(struct cache *cache, struct backdn *bdn) return 0; } - LOG("=> dncache_remove_int (%s)\n", slapi_sdn_get_dn(bdn->dn_sdn), 0, 0); + LOG("=> dncache_remove_int (%s)\n", slapi_sdn_get_dn(bdn->dn_sdn)); if (bdn->ep_state & ENTRY_STATE_NOTINCACHE) { return ret; @@ -1664,7 +1667,7 @@ dncache_remove_int(struct cache *cache, struct backdn *bdn) } else { - LOG("remove %d from id hash failed\n", bdn->ep_id, 0, 0); + LOG("remove %d from id hash failed\n", bdn->ep_id); } if (ret == 0) { /* won't be on the LRU list since it has a refcount on it */ @@ -1678,7 +1681,7 @@ dncache_remove_int(struct cache *cache, struct backdn *bdn) /* mark for deletion (will be erased when refcount drops to zero) */ bdn->ep_state |= ENTRY_STATE_DELETED; - LOG("<= dncache_remove_int: %d\n", ret, 0, 0); + LOG("<= dncache_remove_int: %d\n", ret); return ret; } @@ -1734,7 +1737,7 @@ dncache_find_id(struct cache *cache, ID id) return bdn; } - LOG("=> dncache_find_id (%lu)\n", (u_long)id, 0, 0); + LOG("=> dncache_find_id (%lu)\n", (u_long)id); cache_lock(cache); if (find_hash(cache->c_idtable, &id, sizeof(ID), (void **)&bdn)) { @@ -1742,7 +1745,7 @@ dncache_find_id(struct cache *cache, ID id) if (bdn->ep_state != 0) { /* entry is deleted or not fully created yet */ cache_unlock(cache); - LOG("<= dncache_find_id (NOT FOUND)\n", 0, 0, 0); + LOG("<= dncache_find_id (NOT FOUND)\n"); return NULL; } if (bdn->ep_refcnt == 0) @@ -1755,7 +1758,7 @@ dncache_find_id(struct cache *cache, ID id) } slapi_counter_increment(cache->c_tries); - LOG("<= cache_find_id (%sFOUND)\n", bdn ? "" : "NOT ", 0, 0); + LOG("<= cache_find_id (%sFOUND)\n", bdn ? "" : "NOT "); return bdn; } @@ -1774,13 +1777,13 @@ dncache_add_int(struct cache *cache, struct backdn *bdn, int state, } LOG("=> dncache_add_int( \"%s\", %ld )\n", slapi_sdn_get_dn(bdn->dn_sdn), - bdn->ep_id, 0); + (long int)bdn->ep_id); cache_lock(cache); if (! add_hash(cache->c_idtable, &(bdn->ep_id), sizeof(ID), bdn, (void **)&my_alt)) { - LOG("entry %s already in id cache!\n", slapi_sdn_get_dn(bdn->dn_sdn), 0, 0); + LOG("entry %s already in id cache!\n", slapi_sdn_get_dn(bdn->dn_sdn)); if (my_alt == bdn) { if ((bdn->ep_state & ENTRY_STATE_CREATING) && (state == 0)) @@ -1789,7 +1792,7 @@ dncache_add_int(struct cache *cache, struct backdn *bdn, int state, * and the old entry was a placeholder and the new one isn't? * sounds like a confirmation of a previous add! */ - LOG("confirming a previous add\n", 0, 0, 0); + LOG("confirming a previous add\n"); already_in = 1; } else @@ -1819,14 +1822,14 @@ dncache_add_int(struct cache *cache, struct backdn *bdn, int state, { if (my_alt->ep_state & ENTRY_STATE_CREATING) { - LOG("the entry is reserved\n", 0, 0, 0); + LOG("the entry is reserved\n"); bdn->ep_state |= ENTRY_STATE_NOTINCACHE; cache_unlock(cache); return -1; } else if (state != 0) { - LOG("the entry already exists. cannot reserve it.\n", 0, 0, 0); + LOG("the entry already exists. cannot reserve it.\n"); bdn->ep_state |= ENTRY_STATE_NOTINCACHE; cache_unlock(cache); return -1; @@ -1861,7 +1864,7 @@ dncache_add_int(struct cache *cache, struct backdn *bdn, int state, cache->c_maxsize); if (cache->c_maxentries >= 0) { LOG(" total entries %ld out of %ld\n", - cache->c_curentries, cache->c_maxentries, 0); + cache->c_curentries, cache->c_maxentries); } /* check for full cache, and clear out if necessary */ if (CACHE_FULL(cache)) { @@ -1876,7 +1879,7 @@ dncache_add_int(struct cache *cache, struct backdn *bdn, int state, backdn_free(&dnflush); dnflush = dnflushtemp; } - LOG("<= dncache_add_int OK\n", 0, 0, 0); + LOG("<= dncache_add_int OK\n"); return 0; } @@ -1889,8 +1892,8 @@ dncache_replace(struct cache *cache, struct backdn *olddn, struct backdn *newdn) return 0; } - LOG("=> dncache_replace (%s) -> (%s)\n", - slapi_sdn_get_dn(olddn->dn_sdn), slapi_sdn_get_dn(newdn->dn_sdn), 0); + LOG("(%s) -> (%s)\n", + slapi_sdn_get_dn(olddn->dn_sdn), slapi_sdn_get_dn(newdn->dn_sdn)); /* remove from all hashtable -- this function may be called from places * where the entry isn't in all the table yet, so we don't care if any @@ -1907,7 +1910,7 @@ dncache_replace(struct cache *cache, struct backdn *olddn, struct backdn *newdn) found = remove_hash(cache->c_idtable, &(olddn->ep_id), sizeof(ID)); if (!found) { - LOG("dn cache replace: cache index tables out of sync\n", 0, 0, 0); + LOG("cache index tables out of sync\n"); cache_unlock(cache); return 1; } @@ -1918,7 +1921,7 @@ dncache_replace(struct cache *cache, struct backdn *olddn, struct backdn *newdn) * tested enough that we believe it works.) */ if (!add_hash(cache->c_idtable, &(newdn->ep_id), sizeof(ID), newdn, NULL)) { - LOG("dn cache replace: can't add id\n", 0, 0, 0); + LOG("dn cache replace: can't add id\n"); cache_unlock(cache); return 1; } @@ -1935,8 +1938,8 @@ dncache_replace(struct cache *cache, struct backdn *olddn, struct backdn *newdn) olddn->ep_state = ENTRY_STATE_DELETED; newdn->ep_state = 0; cache_unlock(cache); - LOG("<= dncache_replace OK, cache size now %lu cache count now %ld\n", - slapi_counter_get_value(cache->c_cursize), cache->c_curentries, 0); + LOG("<-- OK, cache size now %lu cache count now %ld\n", + slapi_counter_get_value(cache->c_cursize), cache->c_curentries); return 0; } @@ -1949,7 +1952,7 @@ dncache_flush(struct cache *cache) return dn; } - LOG("=> dncache_flush\n", 0, 0, 0); + LOG("->\n"); /* all entries on the LRU list are guaranteed to have a refcnt = 0 * (iow, nobody's using them), so just delete from the tail down @@ -1968,8 +1971,7 @@ dncache_flush(struct cache *cache) ASSERT(dn->ep_refcnt == 0); dn->ep_refcnt++; if (dncache_remove_int(cache, dn) < 0) { - LDAPDebug(LDAP_DEBUG_ERR, "dncache_flush - Unable to delete entry\n", - 0, 0, 0); + slapi_log_err(SLAPI_LOG_ERR, "dncache_flush", "Unable to delete entry\n"); break; } if(dn == CACHE_LRU_HEAD(cache, struct backdn *)) { @@ -1978,8 +1980,8 @@ dncache_flush(struct cache *cache) } if (dn) LRU_DETACH(cache, dn); - LOG("<= dncache_flush (down to %lu dns, %lu bytes)\n", cache->c_curentries, - slapi_counter_get_value(cache->c_cursize), 0); + LOG("(down to %lu dns, %lu bytes)\n", cache->c_curentries, + slapi_counter_get_value(cache->c_cursize)); return dn; } @@ -2031,13 +2033,13 @@ check_entry_cache(struct cache *cache, struct backentry *e) if (debug_e) { /* e is in cache */ CACHE_RETURN(cache, &debug_e); if ((e != debug_e) && !(e->ep_state & ENTRY_STATE_DELETED)) { - slapi_log_error(SLAPI_LOG_DEBUG, "check_entry_cache", + slapi_log_err(SLAPI_LOG_DEBUG, "check_entry_cache", "entry 0x%p is not in dn cache but 0x%p having the same dn %s is " "although in_cache flag is set!!!\n", e, debug_e, slapi_sdn_get_dn(sdn)); } } else if (!(e->ep_state & ENTRY_STATE_DELETED)) { - slapi_log_error(SLAPI_LOG_DEBUG, "check_entry_cache", + slapi_log_err(SLAPI_LOG_DEBUG, "check_entry_cache", "%s (id %d) is not in dn cache although in_cache flag is set!!!\n", slapi_sdn_get_dn(sdn), e->ep_id); } @@ -2045,13 +2047,13 @@ check_entry_cache(struct cache *cache, struct backentry *e) if (debug_e) { /* e is in cache */ CACHE_RETURN(cache, &debug_e); if ((e != debug_e) && !(e->ep_state & ENTRY_STATE_DELETED)) { - slapi_log_error(SLAPI_LOG_DEBUG, "check_entry_cache", + slapi_log_err(SLAPI_LOG_DEBUG, "check_entry_cache", "entry 0x%p is not in id cache but 0x%p having the same id %d is " "although in_cache flag is set!!!\n", e, debug_e, e->ep_id); } } else { - slapi_log_error(SLAPI_LOG_CACHE, "check_entry_cache", + slapi_log_err(SLAPI_LOG_CACHE, "check_entry_cache", "%s (id %d) is not in id cache although in_cache flag is set!!!\n", slapi_sdn_get_dn(sdn), e->ep_id); } @@ -2059,7 +2061,7 @@ check_entry_cache(struct cache *cache, struct backentry *e) if (debug_e) { /* e is in cache */ CACHE_RETURN(cache, &debug_e); if (e == debug_e) { - slapi_log_error(SLAPI_LOG_DEBUG, "check_entry_cache", + slapi_log_err(SLAPI_LOG_DEBUG, "check_entry_cache", "%s (id %d) is in dn cache although in_cache flag is not set!!!\n", slapi_sdn_get_dn(sdn), e->ep_id); } @@ -2068,7 +2070,7 @@ check_entry_cache(struct cache *cache, struct backentry *e) if (debug_e) { /* e is in cache: bad */ CACHE_RETURN(cache, &debug_e); if (e == debug_e) { - slapi_log_error(SLAPI_LOG_CACHE, "check_entry_cache", + slapi_log_err(SLAPI_LOG_CACHE, "check_entry_cache", "%s (id %d) is in id cache although in_cache flag is not set!!!\n", slapi_sdn_get_dn(sdn), e->ep_id); } diff --git a/ldap/servers/slapd/back-ldbm/cleanup.c b/ldap/servers/slapd/back-ldbm/cleanup.c index 1111352..45d1d0d 100644 --- a/ldap/servers/slapd/back-ldbm/cleanup.c +++ b/ldap/servers/slapd/back-ldbm/cleanup.c @@ -20,16 +20,16 @@ int ldbm_back_cleanup( Slapi_PBlock *pb ) struct ldbminfo *li; Slapi_Backend *be; - LDAPDebug(LDAP_DEBUG_TRACE, "ldbm backend cleaning up\n", 0, 0, 0 ); + slapi_log_err(SLAPI_LOG_TRACE, "ldbm_back_cleanup", "ldbm backend cleaning up\n"); slapi_pblock_get( pb, SLAPI_PLUGIN_PRIVATE, &li ); slapi_pblock_get( pb, SLAPI_BACKEND, &be ); if (be->be_state != BE_STATE_STOPPED && be->be_state != BE_STATE_DELETED) { - LDAPDebug(LDAP_DEBUG_TRACE, - "ldbm_back_cleanup: warning - backend is in a wrong state - %d\n", - be->be_state, 0, 0 ); + slapi_log_err(SLAPI_LOG_TRACE, + "ldbm_back_cleanup", "Warning - backend is in a wrong state - %d\n", + be->be_state); return 0; } @@ -38,9 +38,9 @@ int ldbm_back_cleanup( Slapi_PBlock *pb ) if (be->be_state != BE_STATE_STOPPED && be->be_state != BE_STATE_DELETED) { - LDAPDebug(LDAP_DEBUG_TRACE, - "ldbm_back_cleanup: warning - backend is in a wrong state - %d\n", - be->be_state, 0, 0 ); + slapi_log_err(SLAPI_LOG_TRACE, + "ldbm_back_cleanup", "Warning - backend is in a wrong state - %d\n", + be->be_state); PR_Unlock (be->be_state_lock); return 0; } diff --git a/ldap/servers/slapd/back-ldbm/close.c b/ldap/servers/slapd/back-ldbm/close.c index aca0fa6..06075ed 100644 --- a/ldap/servers/slapd/back-ldbm/close.c +++ b/ldap/servers/slapd/back-ldbm/close.c @@ -19,7 +19,7 @@ int ldbm_back_close( Slapi_PBlock *pb ) { struct ldbminfo *li; - LDAPDebug(LDAP_DEBUG_TRACE, "ldbm_back_close - ldbm backend syncing\n", 0, 0, 0 ); + slapi_log_err(SLAPI_LOG_TRACE, "ldbm_back_close", "ldbm backend syncing\n"); slapi_pblock_get( pb, SLAPI_PLUGIN_PRIVATE, &li ); /* Kill off any sleeping threads by setting this flag */ @@ -32,7 +32,7 @@ int ldbm_back_close( Slapi_PBlock *pb ) /* close down all the ldbm instances */ dblayer_close( li, DBLAYER_NORMAL_MODE ); - LDAPDebug(LDAP_DEBUG_TRACE, "ldbm_back_close - ldbm backend done syncing\n", 0, 0, 0 ); + slapi_log_err(SLAPI_LOG_TRACE, "ldbm_back_close", "ldbm backend done syncing\n"); return 0; } @@ -40,10 +40,10 @@ int ldbm_back_flush( Slapi_PBlock *pb ) { struct ldbminfo *li; - LDAPDebug(LDAP_DEBUG_TRACE, "ldbm_back_close -ldbm backend flushing\n", 0, 0, 0 ); + slapi_log_err(SLAPI_LOG_TRACE, "ldbm_back_close", "ldbm backend flushing\n"); slapi_pblock_get( pb, SLAPI_PLUGIN_PRIVATE, &li ); dblayer_flush( li ); - LDAPDebug(LDAP_DEBUG_TRACE, "ldbm_back_close -ldbm backend done flushing\n", 0, 0, 0 ); + slapi_log_err(SLAPI_LOG_TRACE, "ldbm_back_close", "ldbm backend done flushing\n"); return 0; } @@ -56,5 +56,5 @@ void ldbm_back_instance_set_destructor(void **arg) /* This function is called when the instance set is destroyed. * I can't really think of anything we should do here, but that * may change in the future. */ - LDAPDebug(LDAP_DEBUG_INFO, "ldbm_back_instance_set_destructor - Set of instances destroyed\n", 0, 0, 0); + slapi_log_err(SLAPI_LOG_INFO, "ldbm_back_instance_set_destructor", "Set of instances destroyed\n"); } diff --git a/ldap/servers/slapd/back-ldbm/dbhelp.c b/ldap/servers/slapd/back-ldbm/dbhelp.c index 7edf4c9..d273e8b 100644 --- a/ldap/servers/slapd/back-ldbm/dbhelp.c +++ b/ldap/servers/slapd/back-ldbm/dbhelp.c @@ -41,10 +41,10 @@ dblayer_copy_file_keybykey(DB_ENV *env, int mode = 0; char *p = NULL; - LDAPDebug(LDAP_DEBUG_TRACE, "=> dblayer_copy_file_keybykey\n", 0, 0, 0 ); + slapi_log_err(SLAPI_LOG_TRACE, "dblayer_copy_file_keybykey", "=>\n"); if (!env) { - LDAPDebug(LDAP_DEBUG_ERR, "dblayer_copy_file_keybykey - Out of memory\n", 0, 0, 0); + slapi_log_err(SLAPI_LOG_ERR, "dblayer_copy_file_keybykey", "Out of memory\n"); goto error; } @@ -55,28 +55,33 @@ dblayer_copy_file_keybykey(DB_ENV *env, /* Open the source file */ retval = db_create(&source_file, env, 0); if (retval) { - LDAPDebug(LDAP_DEBUG_ERR, "dblayer_copy_file_keybykey - Create error %d: %s\n", retval, db_strerror(retval), 0); + slapi_log_err(SLAPI_LOG_ERR, "dblayer_copy_file_keybykey", "Create error %d: %s\n", + retval, db_strerror(retval)); goto error; } retval = (source_file->open)(source_file, NULL, source_file_name, NULL, DB_UNKNOWN, DB_RDONLY, 0); if (retval) { - LDAPDebug(LDAP_DEBUG_ERR, "dblayer_copy_file_keybykey - Open error %d: %s\n", retval, db_strerror(retval), 0); + slapi_log_err(SLAPI_LOG_ERR, "dblayer_copy_file_keybykey", "Open error %d: %s\n", + retval, db_strerror(retval)); goto error; } /* Get the info we need from the source file */ retval = source_file->get_flags(source_file, &dbflags); if (retval) { - LDAPDebug(LDAP_DEBUG_ERR, "dblayer_copy_file_keybykey - get_flags error %d: %s\n", retval, db_strerror(retval), 0); + slapi_log_err(SLAPI_LOG_ERR, "dblayer_copy_file_keybykey", "get_flags error %d: %s\n", + retval, db_strerror(retval)); goto error; } retval = source_file->get_type(source_file, &dbtype); if (retval) { - LDAPDebug(LDAP_DEBUG_ERR, "dblayer_copy_file_keybykey - get_type error %d: %s\n", retval, db_strerror(retval), 0); + slapi_log_err(SLAPI_LOG_ERR, "dblayer_copy_file_keybykey", + "get_type error %d: %s\n", retval, db_strerror(retval)); goto error; } retval = source_file->get_pagesize(source_file, &dbpagesize); if (retval) { - LDAPDebug(LDAP_DEBUG_ERR, "dblayer_copy_file_keybykey - get_pagesize error %d: %s\n", retval, db_strerror(retval), 0); + slapi_log_err(SLAPI_LOG_ERR, "dblayer_copy_file_keybykey", + "get_pagesize error %d: %s\n", retval, db_strerror(retval)); goto error; } /* Open the destination file @@ -84,17 +89,20 @@ dblayer_copy_file_keybykey(DB_ENV *env, */ retval = db_create(&destination_file, env, 0); if (retval) { - LDAPDebug(LDAP_DEBUG_ERR, "dblayer_copy_file_keybykey - Create error %d: %s\n", retval, db_strerror(retval), 0); + slapi_log_err(SLAPI_LOG_ERR, "dblayer_copy_file_keybykey", + "Create error %d: %s\n", retval, db_strerror(retval)); goto error; } retval = destination_file->set_flags(destination_file,dbflags); if (retval) { - LDAPDebug(LDAP_DEBUG_ERR, "dblayer_copy_file_keybykey - set_flags error %d: %s\n", retval, db_strerror(retval), 0); + slapi_log_err(SLAPI_LOG_ERR, "dblayer_copy_file_keybykey", + "Set_flags error %d: %s\n", retval, db_strerror(retval)); goto error; } retval = destination_file->set_pagesize(destination_file,dbpagesize); if (retval) { - LDAPDebug(LDAP_DEBUG_ERR, "dblayer_copy_file_keybykey - set_pagesize error %d: %s\n", retval, db_strerror(retval), 0); + slapi_log_err(SLAPI_LOG_ERR, "dblayer_copy_file_keybykey", + "set_pagesize error %d: %s\n", retval, db_strerror(retval)); goto error; } @@ -111,8 +119,8 @@ dblayer_copy_file_keybykey(DB_ENV *env, /* entryrdn.db */ struct attrinfo *ai = NULL; if (NULL == inst) { - LDAPDebug0Args(LDAP_DEBUG_ERR, - "dblayer_copy_file_keybykey (entryrdn) - " + slapi_log_err(SLAPI_LOG_ERR, + "dblayer_copy_file_keybykey", "(entryrdn) - " "dup_cmp_fn cannot be retrieved since inst is NULL.\n"); goto error; } @@ -121,8 +129,8 @@ dblayer_copy_file_keybykey(DB_ENV *env, /* If set, use the special dup compare callback */ retval = destination_file->set_dup_compare(destination_file, ai->ai_dup_cmp_fn); if (retval) { - LDAPDebug2Args(LDAP_DEBUG_ERR, - "dblayer_copy_file_keybykey (entryrdn) - set_dup_compare error %d: %s\n", + slapi_log_err(SLAPI_LOG_ERR, + "dblayer_copy_file_keybykey", "(entryrdn) - set_dup_compare error %d: %s\n", retval, db_strerror(retval)); goto error; } @@ -130,8 +138,8 @@ dblayer_copy_file_keybykey(DB_ENV *env, } else if (idl_get_idl_new() && (dbflags & DB_DUP) && (dbflags & DB_DUPSORT)) { retval = destination_file->set_dup_compare(destination_file, idl_new_compare_dups); if (retval) { - LDAPDebug2Args(LDAP_DEBUG_ERR, - "dblayer_copy_file_keybykey - set_dup_compare error %d: %s\n", + slapi_log_err(SLAPI_LOG_ERR, + "dblayer_copy_file_keybykey", "set_dup_compare error %d: %s\n", retval, db_strerror(retval)); goto error; } @@ -139,13 +147,15 @@ dblayer_copy_file_keybykey(DB_ENV *env, retval = (destination_file->open)(destination_file, NULL, destination_file_name, NULL, dbtype, DB_CREATE | DB_EXCL, mode); if (retval) { - LDAPDebug(LDAP_DEBUG_ERR, "dblayer_copy_file_keybykey - Open error %d: %s\n", retval, db_strerror(retval), 0); + slapi_log_err(SLAPI_LOG_ERR, "dblayer_copy_file_keybykey", "Open error %d: %s\n", + retval, db_strerror(retval)); goto error; } /* Open a cursor on the source file */ retval = source_file->cursor(source_file,NULL,&source_cursor,0); if (retval) { - LDAPDebug(LDAP_DEBUG_ERR, "dblayer_copy_file_keybykey - Create cursor error %d: %s\n", retval, db_strerror(retval), 0); + slapi_log_err(SLAPI_LOG_ERR, "dblayer_copy_file_keybykey", + "Create cursor error %d: %s\n", retval, db_strerror(retval)); goto error; } /* Seek to the first key */ @@ -160,7 +170,8 @@ dblayer_copy_file_keybykey(DB_ENV *env, * In either case, set finished=1 so we can hop down and close the cursor. */ if ( DB_NOTFOUND != retval ) { - LDAPDebug(LDAP_DEBUG_ERR, "dblayer_copy_file_keybykey - c_get error %d: %s\n", retval, db_strerror(retval), 0); + slapi_log_err(SLAPI_LOG_ERR, "dblayer_copy_file_keybykey", "c_get error %d: %s\n", + retval, db_strerror(retval)); goto error; } retval = 0; /* DB_NOTFOUND was OK... */ @@ -169,7 +180,8 @@ dblayer_copy_file_keybykey(DB_ENV *env, /* For each key, insert into the destination file */ retval = destination_file->put(destination_file, NULL, &key, &data, 0); if (retval) { - LDAPDebug(LDAP_DEBUG_ERR, "dblayer_copy_file_keybykey - put error %d: %s\n", retval, db_strerror(retval), 0); + slapi_log_err(SLAPI_LOG_ERR, "dblayer_copy_file_keybykey", "put error %d: %s\n", + retval, db_strerror(retval)); goto error; } cursor_flag = DB_NEXT; @@ -181,7 +193,8 @@ error: if (source_cursor) { retval_cleanup = source_cursor->c_close(source_cursor); if (retval_cleanup) { - LDAPDebug(LDAP_DEBUG_ERR, "dblayer_copy_file_keybykey - Close cursor error %d: %s\n", retval_cleanup, db_strerror(retval_cleanup), 0); + slapi_log_err(SLAPI_LOG_ERR, "dblayer_copy_file_keybykey", + "Close cursor error %d: %s\n", retval_cleanup, db_strerror(retval_cleanup)); retval += retval_cleanup; } } @@ -190,7 +203,8 @@ error: retval_cleanup = source_file->close(source_file,0); source_file = NULL; if (retval_cleanup) { - LDAPDebug(LDAP_DEBUG_ERR, "dblayer_copy_file_keybykey - Close error %d: %s\n", retval_cleanup, db_strerror(retval_cleanup), 0); + slapi_log_err(SLAPI_LOG_ERR, "dblayer_copy_file_keybykey", + "Close error %d: %s\n", retval_cleanup, db_strerror(retval_cleanup)); retval += retval_cleanup; } } @@ -199,12 +213,13 @@ error: retval_cleanup = destination_file->close(destination_file,0); destination_file = NULL; if (retval_cleanup) { - LDAPDebug(LDAP_DEBUG_ERR, "dblayer_copy_file_keybykey - Close error %d: %s\n", retval_cleanup, db_strerror(retval_cleanup), 0); + slapi_log_err(SLAPI_LOG_ERR, "dblayer_copy_file_keybykey", + "Close error %d: %s\n", retval_cleanup, db_strerror(retval_cleanup)); retval += retval_cleanup; } } - LDAPDebug(LDAP_DEBUG_TRACE, "<= dblayer_copy_file_keybykey\n", 0, 0, 0 ); + slapi_log_err(SLAPI_LOG_TRACE, "dblayer_copy_file_keybykey", "<=\n"); return retval; } @@ -219,19 +234,19 @@ dblayer_copy_file_resetlsns(char *home_dir, int retval = 0; DB_ENV *env = NULL; - LDAPDebug(LDAP_DEBUG_TRACE, "=> dblayer_copy_file_resetlsns\n", 0, 0, 0 ); + slapi_log_err(SLAPI_LOG_TRACE, "dblayer_copy_file_resetlsns", "=>\n"); /* Make the environment */ retval = dblayer_make_private_simple_env(home_dir,&env); if (retval || !env) { - LDAPDebug(LDAP_DEBUG_ERR, "dblayer_copy_file_resetlsns - Call to dblayer_make_private_simple_env failed!\n" - "Unable to open an environment.", 0, 0, 0); + slapi_log_err(SLAPI_LOG_ERR, "dblayer_copy_file_resetlsns", "Call to dblayer_make_private_simple_env failed!\n" + "Unable to open an environment."); goto out; } /* Do the copy */ retval = dblayer_copy_file_keybykey(env, source_file_name, destination_file_name, overwrite, priv, inst); if (retval) { - LDAPDebug(LDAP_DEBUG_ERR, "dblayer_copy_file_resetlsns - Copy did not complete successfully.", 0, 0, 0); + slapi_log_err(SLAPI_LOG_ERR, "dblayer_copy_file_resetlsns", "Copy did not complete successfully."); } out: /* Close the environment */ @@ -241,12 +256,13 @@ out: if (retval2) { if (0 == retval) { retval = retval2; - LDAPDebug(LDAP_DEBUG_ERR, "dblayer_copy_file_resetlsns - error %d: %s\n", retval, db_strerror(retval), 0); + slapi_log_err(SLAPI_LOG_ERR, "dblayer_copy_file_resetlsns", + "error %d: %s\n", retval, db_strerror(retval)); } } } - LDAPDebug(LDAP_DEBUG_TRACE, "<= dblayer_copy_file_resetlsns\n", 0, 0, 0 ); + slapi_log_err(SLAPI_LOG_TRACE, "dblayer_copy_file_resetlsns", "<=\n"); return retval; } @@ -275,16 +291,18 @@ int dblayer_make_private_recovery_env(char *db_home_dir, dblayer_private *priv, int retval = 0; DB_ENV *ret_env = NULL; - LDAPDebug(LDAP_DEBUG_TRACE, "=> dblayer_make_private_recovery_env\n", 0, 0, 0 ); + slapi_log_err(SLAPI_LOG_TRACE, "dblayer_make_private_recovery_env", "=>\n"); if (NULL == env) { - LDAPDebug(LDAP_DEBUG_ERR, "dblayer_make_private_recovery_env - Null environment. Cannot continue.", 0, 0, 0); + slapi_log_err(SLAPI_LOG_ERR, "dblayer_make_private_recovery_env", + "Null environment. Cannot continue."); return -1; } *env = NULL; retval = db_env_create(&ret_env,0); if (retval) { - LDAPDebug(LDAP_DEBUG_ERR, "dblayer_make_private_recovery_env - Create error %d: %s\n", retval, db_strerror(retval), 0); + slapi_log_err(SLAPI_LOG_ERR, "dblayer_make_private_recovery_env", + "Create error %d: %s\n", retval, db_strerror(retval)); goto error; } dblayer_set_env_debugging(ret_env, priv); @@ -293,12 +311,13 @@ int dblayer_make_private_recovery_env(char *db_home_dir, dblayer_private *priv, if (0 == retval) { *env = ret_env; } else { - LDAPDebug(LDAP_DEBUG_ERR, "dblayer_make_private_recovery_env - Open error %d: %s\n", retval, db_strerror(retval), 0); + slapi_log_err(SLAPI_LOG_ERR, "dblayer_make_private_recovery_env", + "Open error %d: %s\n", retval, db_strerror(retval)); goto error; } error: - LDAPDebug(LDAP_DEBUG_TRACE, "<= dblayer_make_private_recovery_env\n", 0, 0, 0 ); + slapi_log_err(SLAPI_LOG_TRACE, "dblayer_make_private_recovery_env", "<=\n"); return retval; } @@ -308,16 +327,18 @@ int dblayer_make_private_simple_env(char *db_home_dir, DB_ENV **env) int retval = 0; DB_ENV *ret_env = NULL; - LDAPDebug(LDAP_DEBUG_TRACE, "=> dblayer_make_private_simple_env\n", 0, 0, 0 ); + slapi_log_err(SLAPI_LOG_TRACE, "dblayer_make_private_simple_env", "=>\n"); if (NULL == env) { - LDAPDebug(LDAP_DEBUG_ERR, "dblayer_make_private_simple_env - Null environment. Cannot continue.", 0, 0, 0); + slapi_log_err(SLAPI_LOG_ERR, "dblayer_make_private_simple_env", + "Null environment. Cannot continue."); return -1; } *env = NULL; retval = db_env_create(&ret_env,0); if (retval) { - LDAPDebug(LDAP_DEBUG_ERR, "dblayer_make_private_simple_env - error %d: %s\n", retval, db_strerror(retval), 0); + slapi_log_err(SLAPI_LOG_ERR, "dblayer_make_private_simple_env", + "Error %d: %s\n", retval, db_strerror(retval)); goto error; } @@ -325,11 +346,12 @@ int dblayer_make_private_simple_env(char *db_home_dir, DB_ENV **env) if (0 == retval) { *env = ret_env; } else { - LDAPDebug(LDAP_DEBUG_ERR, "dblayer_make_private_simple_env - error %d: %s\n", retval, db_strerror(retval), 0); + slapi_log_err(SLAPI_LOG_ERR, "dblayer_make_private_simple_env", + "Error %d: %s\n", retval, db_strerror(retval)); goto error; } error: - LDAPDebug(LDAP_DEBUG_TRACE, "<= dblayer_make_private_simple_env\n", 0, 0, 0 ); + slapi_log_err(SLAPI_LOG_TRACE, "dblayer_make_private_simple_env","<=\n"); return retval; } diff --git a/ldap/servers/slapd/back-ldbm/dblayer.c b/ldap/servers/slapd/back-ldbm/dblayer.c index 54f05ba..c246756 100644 --- a/ldap/servers/slapd/back-ldbm/dblayer.c +++ b/ldap/servers/slapd/back-ldbm/dblayer.c @@ -321,12 +321,12 @@ dblayer_set_batch_transactions(void *arg, void *value, char *errorbuf, int phase } else if(val > 0) { if(trans_batch_limit == FLUSH_REMOTEOFF){ /* this requires a server restart to take effect */ - LDAPDebug(LDAP_DEBUG_NOTICE,"dblayer_set_batch_transactions - Enabling batch transactions " - "requires a server restart.\n",0,0,0); + slapi_log_err(SLAPI_LOG_NOTICE,"dblayer_set_batch_transactions", "Enabling batch transactions " + "requires a server restart.\n"); } else if (!log_flush_thread){ /* we are already disabled, log a reminder of that fact. */ - LDAPDebug(LDAP_DEBUG_NOTICE,"dblayer_set_batch_transactions - Batch transactions was " - "previously disabled, this update requires a server restart.\n",0,0,0); + slapi_log_err(SLAPI_LOG_NOTICE,"dblayer_set_batch_transactions", "Batch transactions was " + "previously disabled, this update requires a server restart.\n"); } trans_batch_limit=val; } @@ -356,8 +356,8 @@ dblayer_set_batch_txn_min_sleep(void *arg, void *value, char *errorbuf, int phas } else if(val > 0) { if(trans_batch_txn_min_sleep == FLUSH_REMOTEOFF || !log_flush_thread){ /* this really has no effect until batch transactions are enabled */ - LDAPDebug(LDAP_DEBUG_WARNING, "dblayer_set_batch_txn_min_sleep - Warning batch transactions " - "is not enabled.\n",0,0,0); + slapi_log_err(SLAPI_LOG_WARNING, "dblayer_set_batch_txn_min_sleep", "Warning batch transactions " + "is not enabled.\n"); } trans_batch_txn_min_sleep = val; } @@ -387,8 +387,9 @@ dblayer_set_batch_txn_max_sleep(void *arg, void *value, char *errorbuf, int phas } else if(val > 0) { if(trans_batch_txn_max_sleep == FLUSH_REMOTEOFF || !log_flush_thread){ /* this really has no effect until batch transactions are enabled */ - LDAPDebug(LDAP_DEBUG_WARNING ,"dblayer_set_batch_txn_max_sleep - Warning batch transactions " - "is not enabled.\n",0,0,0); + slapi_log_err(SLAPI_LOG_WARNING, + "dblayer_set_batch_txn_max_sleep", "Warning batch transactions " + "is not enabled.\n"); } trans_batch_txn_max_sleep = val; } @@ -431,7 +432,7 @@ dblayer_txn_checkpoint(struct ldbminfo *li, struct dblayer_private_env *env, return ret; } DB_CHECKPOINT_LOCK(use_lock, env->dblayer_env_lock); - ret = TXN_CHECKPOINT(env->dblayer_DB_ENV, 0, 0, db_force?DB_FORCE:0); + ret = TXN_CHECKPOINT(env->dblayer_DB_ENV, db_force?DB_FORCE:0,0,0); DB_CHECKPOINT_UNLOCK(use_lock, env->dblayer_env_lock); return ret; } @@ -453,7 +454,7 @@ static int _dblayer_check_version(dblayer_private *priv) } /* DB3X: always POST 24 :) */ priv->dblayer_lib_version = DBLAYER_LIB_VERSION_POST_24; - LDAPDebug(LDAP_DEBUG_TRACE,"version check: %s (%d.%d)\n", string, major, minor); + slapi_log_err(SLAPI_LOG_TRACE, "_dblayer_check_version", "version check: %s (%d.%d)\n", string, major, minor); return ret; } @@ -480,9 +481,9 @@ dblayer_get_home_dir(struct ldbminfo *li, int *dbhome) } if (NULL == home_dir) { - LDAPDebug(LDAP_DEBUG_WARNING,"Db home directory is not set. " + slapi_log_err(SLAPI_LOG_WARNING, "dblayer_get_home_dir", "Db home directory is not set. " "Possibly %s (optionally %s) is missing in the config file.\n", - CONFIG_DIRECTORY, CONFIG_DB_HOME_DIRECTORY, 0); + CONFIG_DIRECTORY, CONFIG_DB_HOME_DIRECTORY); } return home_dir; } @@ -510,7 +511,7 @@ void dblayer_log_print(const char* prefix, char *buffer) #endif { /* We ignore the prefix since we know who we are anyway */ - LDAPDebug(LDAP_DEBUG_ERR,"libdb - %s\n", buffer, 0, 0); + slapi_log_err(SLAPI_LOG_ERR,"libdb - %s\n", (char *)buffer); } void dblayer_remember_disk_filled(struct ldbminfo *li) @@ -664,7 +665,7 @@ static int dblayer_override_libdb_functions(DB_ENV *pEnv, dblayer_private *priv) db_env_set_func_seek((int (*)(int, off_t, int))dblayer_seek24_large); #endif - LDAPDebug(LDAP_DEBUG_TRACE, "Enabled 64-bit files\n", 0, 0, 0); + slapi_log_err(SLAPI_LOG_TRACE, "dblayer_override_libdb_function", "Enabled 64-bit files\n"); #endif /* DB_USE_64LFS */ return 0; } @@ -759,8 +760,8 @@ static void dblayer_select_ncache(size_t cachesize, int *ncachep) #if defined(__LP64__) || defined (_LP64) if ( (sizeof(cachesize) > 4) && (cachesize > (4L * GIGABYTE))) { *ncachep = (cachesize / (4L * GIGABYTE)) + 1; - LDAPDebug(LDAP_DEBUG_NOTICE, "dblayer_select_ncache - Setting ncache to: %d to keep each chunk below 4Gbytes\n", - *ncachep, 0, 0); + slapi_log_err(SLAPI_LOG_NOTICE, "dblayer_select_ncache", "Setting ncache to: %d to keep each chunk below 4Gbytes\n", + *ncachep); } #endif } @@ -818,8 +819,8 @@ cleanup: slapi_ch_free((void **)&head[i]); } if (myncache == mymaxncache) { - LDAPDebug(LDAP_DEBUG_ERR, - "dblayer_get_ncache - cachesize %lu too big\n", cachesize, 0, 0); + slapi_log_err(SLAPI_LOG_ERR, + "dblayer_get_ncache", "cachesize %lu too big\n", cachesize); myncache = 0; found = -1; } @@ -874,41 +875,41 @@ static void dblayer_init_dbenv(DB_ENV *pEnv, dblayer_private *priv) static void dblayer_dump_config_tracing(dblayer_private *priv) { if (priv->dblayer_home_directory) { - LDAPDebug(LDAP_DEBUG_TRACE,"home_directory=%s\n",priv->dblayer_home_directory,0,0); + slapi_log_err(SLAPI_LOG_TRACE, "dblayer_dump_config_tracing", "home_directory=%s\n",priv->dblayer_home_directory); } if (priv->dblayer_log_directory) { - LDAPDebug(LDAP_DEBUG_TRACE,"log_directory=%s\n",priv->dblayer_log_directory,0,0); + slapi_log_err(SLAPI_LOG_TRACE, "dblayer_dump_config_tracing", "log_directory=%s\n",priv->dblayer_log_directory); } if (priv->dblayer_dbhome_directory) { - LDAPDebug(LDAP_DEBUG_TRACE,"dbhome_directory=%s\n",priv->dblayer_dbhome_directory,0,0); - } - LDAPDebug(LDAP_DEBUG_TRACE,"trickle_percentage=%d\n",priv->dblayer_trickle_percentage,0,0); - LDAPDebug(LDAP_DEBUG_TRACE,"page_size=%lu\n",priv->dblayer_page_size,0,0); - LDAPDebug(LDAP_DEBUG_TRACE,"index_page_size=%lu\n",priv->dblayer_index_page_size,0,0); - LDAPDebug(LDAP_DEBUG_TRACE,"cachesize=%lu\n",priv->dblayer_cachesize,0,0); - LDAPDebug(LDAP_DEBUG_TRACE,"previous_cachesize=%lu\n",priv->dblayer_previous_cachesize,0,0); - LDAPDebug(LDAP_DEBUG_TRACE,"ncache=%d\n",priv->dblayer_ncache,0,0); - LDAPDebug(LDAP_DEBUG_TRACE,"previous_ncache=%d\n",priv->dblayer_previous_ncache,0,0); - LDAPDebug(LDAP_DEBUG_TRACE,"recovery_required=%d\n",priv->dblayer_recovery_required,0,0); - LDAPDebug(LDAP_DEBUG_TRACE,"durable_transactions=%d\n",priv->dblayer_durable_transactions,0,0); - LDAPDebug(LDAP_DEBUG_TRACE,"checkpoint_interval=%d\n",priv->dblayer_checkpoint_interval,0,0); - LDAPDebug(LDAP_DEBUG_TRACE,"transaction_batch_val=%d\n",trans_batch_limit,0,0); - LDAPDebug(LDAP_DEBUG_TRACE,"circular_logging=%d\n",priv->dblayer_circular_logging,0,0); - LDAPDebug(LDAP_DEBUG_TRACE,"idl_divisor=%d\n",priv->dblayer_idl_divisor,0,0); - LDAPDebug(LDAP_DEBUG_TRACE,"logfile_size=%lu\n",priv->dblayer_logfile_size,0,0); - LDAPDebug(LDAP_DEBUG_TRACE,"logbuf_size=%lu\n",priv->dblayer_logbuf_size,0,0); - LDAPDebug(LDAP_DEBUG_TRACE,"file_mode=%d\n",priv->dblayer_file_mode,0,0); - LDAPDebug(LDAP_DEBUG_TRACE,"cache_config=%d\n",priv->dblayer_cache_config,0,0); - LDAPDebug(LDAP_DEBUG_TRACE,"lib_version=%d\n",priv->dblayer_lib_version,0,0); - LDAPDebug(LDAP_DEBUG_TRACE,"spin_count=%d\n",priv->dblayer_spin_count,0,0); - LDAPDebug(LDAP_DEBUG_TRACE,"named_regions=%d\n",priv->dblayer_named_regions,0,0); - LDAPDebug(LDAP_DEBUG_TRACE,"private mem=%d\n",priv->dblayer_private_mem,0,0); - LDAPDebug(LDAP_DEBUG_TRACE,"private import mem=%d\n",priv->dblayer_private_import_mem,0,0); - LDAPDebug(LDAP_DEBUG_TRACE,"shm_key=%ld\n",priv->dblayer_shm_key,0,0); - LDAPDebug(LDAP_DEBUG_TRACE,"lockdown=%d\n",priv->dblayer_lockdown,0,0); - LDAPDebug(LDAP_DEBUG_TRACE,"locks=%d\n",priv->dblayer_lock_config,0,0); - LDAPDebug(LDAP_DEBUG_TRACE,"previous_locks=%d\n",priv->dblayer_previous_lock_config,0,0); - LDAPDebug(LDAP_DEBUG_TRACE,"tx_max=%d\n",priv->dblayer_tx_max,0,0); + slapi_log_err(SLAPI_LOG_TRACE, "dblayer_dump_config_tracing", "dbhome_directory=%s\n",priv->dblayer_dbhome_directory); + } + slapi_log_err(SLAPI_LOG_TRACE, "dblayer_dump_config_tracing", "trickle_percentage=%d\n",priv->dblayer_trickle_percentage); + slapi_log_err(SLAPI_LOG_TRACE, "dblayer_dump_config_tracing", "page_size=%lu\n",priv->dblayer_page_size); + slapi_log_err(SLAPI_LOG_TRACE, "dblayer_dump_config_tracing", "index_page_size=%lu\n",priv->dblayer_index_page_size); + slapi_log_err(SLAPI_LOG_TRACE, "dblayer_dump_config_tracing", "cachesize=%lu\n",priv->dblayer_cachesize); + slapi_log_err(SLAPI_LOG_TRACE, "dblayer_dump_config_tracing", "previous_cachesize=%lu\n",priv->dblayer_previous_cachesize); + slapi_log_err(SLAPI_LOG_TRACE, "dblayer_dump_config_tracing", "ncache=%d\n",priv->dblayer_ncache); + slapi_log_err(SLAPI_LOG_TRACE, "dblayer_dump_config_tracing", "previous_ncache=%d\n",priv->dblayer_previous_ncache); + slapi_log_err(SLAPI_LOG_TRACE, "dblayer_dump_config_tracing", "recovery_required=%d\n",priv->dblayer_recovery_required); + slapi_log_err(SLAPI_LOG_TRACE, "dblayer_dump_config_tracing", "durable_transactions=%d\n",priv->dblayer_durable_transactions); + slapi_log_err(SLAPI_LOG_TRACE, "dblayer_dump_config_tracing", "checkpoint_interval=%d\n",priv->dblayer_checkpoint_interval); + slapi_log_err(SLAPI_LOG_TRACE, "dblayer_dump_config_tracing", "transaction_batch_val=%d\n",trans_batch_limit); + slapi_log_err(SLAPI_LOG_TRACE, "dblayer_dump_config_tracing", "circular_logging=%d\n",priv->dblayer_circular_logging); + slapi_log_err(SLAPI_LOG_TRACE, "dblayer_dump_config_tracing", "idl_divisor=%d\n",priv->dblayer_idl_divisor); + slapi_log_err(SLAPI_LOG_TRACE, "dblayer_dump_config_tracing", "logfile_size=%lu\n",priv->dblayer_logfile_size); + slapi_log_err(SLAPI_LOG_TRACE, "dblayer_dump_config_tracing", "logbuf_size=%lu\n",priv->dblayer_logbuf_size); + slapi_log_err(SLAPI_LOG_TRACE, "dblayer_dump_config_tracing", "file_mode=%d\n",priv->dblayer_file_mode); + slapi_log_err(SLAPI_LOG_TRACE, "dblayer_dump_config_tracing", "cache_config=%d\n",priv->dblayer_cache_config); + slapi_log_err(SLAPI_LOG_TRACE, "dblayer_dump_config_tracing", "lib_version=%d\n",priv->dblayer_lib_version); + slapi_log_err(SLAPI_LOG_TRACE, "dblayer_dump_config_tracing", "spin_count=%d\n",priv->dblayer_spin_count); + slapi_log_err(SLAPI_LOG_TRACE, "dblayer_dump_config_tracing", "named_regions=%d\n",priv->dblayer_named_regions); + slapi_log_err(SLAPI_LOG_TRACE, "dblayer_dump_config_tracing", "private mem=%d\n",priv->dblayer_private_mem); + slapi_log_err(SLAPI_LOG_TRACE, "dblayer_dump_config_tracing", "private import mem=%d\n",priv->dblayer_private_import_mem); + slapi_log_err(SLAPI_LOG_TRACE, "dblayer_dump_config_tracing", "shm_key=%ld\n",priv->dblayer_shm_key); + slapi_log_err(SLAPI_LOG_TRACE, "dblayer_dump_config_tracing", "lockdown=%d\n",priv->dblayer_lockdown); + slapi_log_err(SLAPI_LOG_TRACE, "dblayer_dump_config_tracing", "locks=%d\n",priv->dblayer_lock_config); + slapi_log_err(SLAPI_LOG_TRACE, "dblayer_dump_config_tracing", "previous_locks=%d\n",priv->dblayer_previous_lock_config); + slapi_log_err(SLAPI_LOG_TRACE, "dblayer_dump_config_tracing", "tx_max=%d\n",priv->dblayer_tx_max); } /* Check a given filesystem directory for access we need */ @@ -983,9 +984,9 @@ static int dblayer_grok_directory(char *directory, int flags) } /* If we're here, it means that we did not have the requested * permission on this file */ - LDAPDebug(LDAP_DEBUG_WARNING, - "dblayer_grok_directory - No %s permission to file %s\n", - access_string,filename,0); + slapi_log_err(SLAPI_LOG_WARNING, + "dblayer_grok_directory", "No %s permission to file %s\n", + access_string,filename); } else { PR_Close(prfd); /* okay */ } @@ -1062,9 +1063,9 @@ dblayer_make_env(struct dblayer_private_env **env, struct ldbminfo *li) sizeof(dblayer_private_env)); if ((ret = db_env_create(&pEnv->dblayer_DB_ENV, 0)) != 0) { - LDAPDebug(LDAP_DEBUG_ERR, - "dblayer_make_env - Failed to create DB_ENV (returned: %d).\n", - ret, 0, 0); + slapi_log_err(SLAPI_LOG_ERR, + "dblayer_make_env", "Failed to create DB_ENV (returned: %d).\n", + ret); } DB_ENV_SET_REGION_INIT(pEnv->dblayer_DB_ENV); @@ -1120,9 +1121,9 @@ dblayer_make_env(struct dblayer_private_env **env, struct ldbminfo *li) *env = pEnv; pEnv = NULL; /* do not free below */ } else { - LDAPDebug(LDAP_DEBUG_ERR, - "dblayer_make_env - Failed to create RWLock (returned: %d).\n", - ret, 0, 0); + slapi_log_err(SLAPI_LOG_ERR, + "dblayer_make_env", "Failed to create RWLock (returned: %d).\n", + ret); } fail: @@ -1241,9 +1242,9 @@ no_diskspace(struct ldbminfo *li, int dbenv_flags) char *region_dir; if (statvfs(li->li_directory, &db_buf) < 0){ - LDAPDebug(LDAP_DEBUG_ERR, - "no_diskspace - Cannot get file system info for (%s); file system corrupted?\n", - li->li_directory, 0, 0); + slapi_log_err(SLAPI_LOG_ERR, + "no_diskspace", "Cannot get file system info for (%s); file system corrupted?\n", + li->li_directory); return 1; } else { /* @@ -1257,9 +1258,9 @@ no_diskspace(struct ldbminfo *li, int dbenv_flags) /* Calculate the available space as long as we are not using shared memory */ if(using_region_files){ if(statvfs(li->li_dblayer_private->dblayer_dbhome_directory, &dbhome_buf) < 0){ - LDAPDebug(LDAP_DEBUG_ERR, - "no_diskspace - Cannot get file system info for (%s); file system corrupted?\n", - li->li_dblayer_private->dblayer_dbhome_directory, 0, 0); + slapi_log_err(SLAPI_LOG_ERR, + "no_diskspace", "Cannot get file system info for (%s); file system corrupted?\n", + li->li_dblayer_private->dblayer_dbhome_directory); return 1; } fsiz = ((PRUint64)dbhome_buf.f_bavail) * ((PRUint64)dbhome_buf.f_bsize); @@ -1278,8 +1279,8 @@ no_diskspace(struct ldbminfo *li, int dbenv_flags) /* Check if we have enough space */ if (fsiz < expected_siz){ - LDAPDebug(LDAP_DEBUG_ERR, - "no_diskspace - No enough space left on device (%s) (%lu bytes); " + slapi_log_err(SLAPI_LOG_ERR, + "no_diskspace", "No enough space left on device (%s) (%lu bytes); " "at least %lu bytes space is needed for db region files\n", region_dir, fsiz, expected_siz); return 1; @@ -1324,12 +1325,12 @@ dblayer_start(struct ldbminfo *li, int dbmode) if (NULL != priv->dblayer_env) { if (CATASTROPHIC == priv->dblayer_env) { - LDAPDebug(LDAP_DEBUG_CRIT, - "dblayer_start - DB previously failed to start.\n", 0, 0, 0); + slapi_log_err(SLAPI_LOG_CRIT, + "dblayer_start", "DB previously failed to start.\n"); return -1; } else { - LDAPDebug(LDAP_DEBUG_WARNING, - "dblayer_start - DB already started.\n", 0, 0, 0); + slapi_log_err(SLAPI_LOG_WARNING, + "dblayer_start", "DB already started.\n"); return 0; } } @@ -1337,8 +1338,8 @@ dblayer_start(struct ldbminfo *li, int dbmode) /* DBDB we should pick these up in our config routine, and do away with * the li_ one */ if (NULL == li->li_directory || '\0' == *li->li_directory) { - LDAPDebug(LDAP_DEBUG_CRIT, - "dblayer_start - DB directory is not specified.\n", 0, 0, 0); + slapi_log_err(SLAPI_LOG_CRIT, + "dblayer_start", "DB directory is not specified.\n"); return -1; } PR_Lock(li->li_config_mutex); @@ -1364,9 +1365,9 @@ dblayer_start(struct ldbminfo *li, int dbmode) return_value = dblayer_grok_directory(region_dir, DBLAYER_DIRECTORY_READWRITE_ACCESS); if (0 != return_value) { - LDAPDebug(LDAP_DEBUG_CRIT,"dblayer_start - Can't start because the database " + slapi_log_err(SLAPI_LOG_CRIT,"dblayer_start", "Can't start because the database " "directory \"%s\" either doesn't exist, or is not " - "accessible\n", region_dir, 0, 0); + "accessible\n", region_dir); return return_value; } @@ -1376,9 +1377,9 @@ dblayer_start(struct ldbminfo *li, int dbmode) return_value = dblayer_grok_directory(log_dir, DBLAYER_DIRECTORY_READWRITE_ACCESS); if (0 != return_value) { - LDAPDebug(LDAP_DEBUG_CRIT,"dblayer_start - Can't start because the log " + slapi_log_err(SLAPI_LOG_CRIT,"dblayer_start", "Can't start because the log " "directory \"%s\" either doesn't exist, or is not " - "accessible\n", log_dir, 0, 0); + "accessible\n", log_dir); return return_value; } } @@ -1387,10 +1388,10 @@ dblayer_start(struct ldbminfo *li, int dbmode) * the available phys mem */ if (!util_is_cachesize_sane(&(priv->dblayer_cachesize))) { /* Oops---looks like the admin misconfigured, let's warn them */ - LDAPDebug(LDAP_DEBUG_WARNING,"dblayer_start - Likely CONFIGURATION ERROR -" + slapi_log_err(SLAPI_LOG_WARNING,"dblayer_start", "Likely CONFIGURATION ERROR -" "dbcachesize is configured to use more than the available " "physical memory, decreased to the largest available size (%lu bytes).\n", - priv->dblayer_cachesize, 0, 0); + priv->dblayer_cachesize); li->li_dbcachesize = priv->dblayer_cachesize; } @@ -1422,14 +1423,14 @@ dblayer_start(struct ldbminfo *li, int dbmode) if (priv->dblayer_recovery_required) { open_flags |= DB_RECOVER; if (DBLAYER_RESTORE_MODE & dbmode) { - LDAPDebug(LDAP_DEBUG_NOTICE, "dblayer_start - Recovering database after restore " - "from archive.\n", 0, 0, 0); + slapi_log_err(SLAPI_LOG_NOTICE, "dblayer_start", "Recovering database after restore " + "from archive.\n"); } else if (DBLAYER_CLEAN_RECOVER_MODE & dbmode) { - LDAPDebug(LDAP_DEBUG_NOTICE, "dblayer_start - Clean up db environment and start " - "from archive.\n", 0, 0, 0); + slapi_log_err(SLAPI_LOG_NOTICE, "dblayer_start", "Clean up db environment and start " + "from archive.\n"); } else { - LDAPDebug(LDAP_DEBUG_NOTICE, "dblayer_start - Detected Disorderly Shutdown last " - "time Directory Server was running, recovering database.\n", 0, 0, 0); + slapi_log_err(SLAPI_LOG_NOTICE, "dblayer_start", "Detected Disorderly Shutdown last " + "time Directory Server was running, recovering database.\n"); slapi_disordely_shutdown(PR_TRUE); } } @@ -1448,10 +1449,9 @@ dblayer_start(struct ldbminfo *li, int dbmode) } if (priv->dblayer_private_mem) { - LDAPDebug(LDAP_DEBUG_INFO, + slapi_log_err(SLAPI_LOG_INFO, "dblayer_start", "Server is running with nsslapd-db-private-mem on; " - "No other process is allowed to access the database\n", - 0, 0, 0); + "No other process is allowed to access the database\n"); open_flags |= DB_PRIVATE; } @@ -1473,12 +1473,12 @@ dblayer_start(struct ldbminfo *li, int dbmode) (priv->dblayer_lock_config != priv->dblayer_previous_lock_config)) && !(dbmode & (DBLAYER_ARCHIVE_MODE|DBLAYER_EXPORT_MODE)) ) { if (priv->dblayer_cachesize != priv->dblayer_previous_cachesize) { - LDAPDebug(LDAP_DEBUG_NOTICE, "dblayer_start - Resizing db cache size: %lu -> %lu\n", - priv->dblayer_previous_cachesize, priv->dblayer_cachesize, 0); + slapi_log_err(SLAPI_LOG_NOTICE, "dblayer_start", "Resizing db cache size: %lu -> %lu\n", + priv->dblayer_previous_cachesize, priv->dblayer_cachesize); } if (priv->dblayer_ncache != priv->dblayer_previous_ncache) { - LDAPDebug(LDAP_DEBUG_NOTICE, "dblayer_start - Resizing db cache count: %d -> %d\n", - priv->dblayer_previous_ncache, priv->dblayer_ncache, 0); + slapi_log_err(SLAPI_LOG_NOTICE, "dblayer_start", "Resizing db cache count: %d -> %d\n", + priv->dblayer_previous_ncache, priv->dblayer_ncache); } if (priv->dblayer_lock_config != priv->dblayer_previous_lock_config) { /* @@ -1486,13 +1486,13 @@ dblayer_start(struct ldbminfo *li, int dbmode) * We don't allow lower value than that. */ if (priv->dblayer_lock_config <= BDB_LOCK_NB_MIN) { - LDAPDebug1Arg(LDAP_DEBUG_NOTICE, "dblayer_start - New max db lock count is too small. " + slapi_log_err(SLAPI_LOG_NOTICE, "dblayer_start", "New max db lock count is too small. " "Resetting it to the default value %d.\n", BDB_LOCK_NB_MIN); priv->dblayer_lock_config = BDB_LOCK_NB_MIN; } if (priv->dblayer_lock_config != priv->dblayer_previous_lock_config) { - LDAPDebug(LDAP_DEBUG_NOTICE, "dblayer_start - resizing max db lock count: %d -> %d\n", - priv->dblayer_previous_lock_config, priv->dblayer_lock_config, 0); + slapi_log_err(SLAPI_LOG_NOTICE, "dblayer_start", "Resizing max db lock count: %d -> %d\n", + priv->dblayer_previous_lock_config, priv->dblayer_lock_config); } } dblayer_reset_env(li); @@ -1501,9 +1501,9 @@ dblayer_start(struct ldbminfo *li, int dbmode) * the DB_ENV (pEnv) needs to be created again. */ if ((return_value = dblayer_make_env(&pEnv, li)) != 0) { - LDAPDebug(LDAP_DEBUG_CRIT, - "dblayer_start - Failed to create DBENV (returned: %d).\n", - return_value, 0, 0); + slapi_log_err(SLAPI_LOG_CRIT, + "dblayer_start", "Failed to create DBENV (returned: %d).\n", + return_value); } dblayer_free_env(&priv->dblayer_env); priv->dblayer_env = pEnv; @@ -1514,8 +1514,8 @@ dblayer_start(struct ldbminfo *li, int dbmode) if(priv->dblayer_logbuf_size >= 32768) { pEnv->dblayer_DB_ENV->set_lg_bsize(pEnv->dblayer_DB_ENV,priv->dblayer_logbuf_size); } else { - LDAPDebug(LDAP_DEBUG_NOTICE, "dblayer_start - Using default value for log bufsize because configured value (%lu) is too small.\n", - priv->dblayer_logbuf_size, 0, 0); + slapi_log_err(SLAPI_LOG_NOTICE, "dblayer_start", "Using default value for log bufsize because configured value (%lu) is too small.\n", + priv->dblayer_logbuf_size); } } @@ -1537,19 +1537,19 @@ dblayer_start(struct ldbminfo *li, int dbmode) return_value = thisenv->remove(thisenv, region_dir, DB_FORCE); if (0 != return_value) { - LDAPDebug(LDAP_DEBUG_CRIT, - "dblayer_start - Failed to remove old db env " + slapi_log_err(SLAPI_LOG_CRIT, + "dblayer_start", "Failed to remove old db env " "in %s: %s\n", region_dir, - dblayer_strerror(return_value), 0); + dblayer_strerror(return_value)); return return_value; } dbmode = DBLAYER_NORMAL_MODE; if ((return_value = dblayer_make_env(&pEnv, li)) != 0) { - LDAPDebug(LDAP_DEBUG_CRIT, - "dblayer_start - Failed to create DBENV (returned: %d).\n", - return_value, 0, 0); + slapi_log_err(SLAPI_LOG_CRIT, + "dblayer_start", "Failed to create DBENV (returned: %d).\n", + return_value); return return_value; } } @@ -1566,29 +1566,29 @@ dblayer_start(struct ldbminfo *li, int dbmode) * https://blackflag.mcom.com/show_bug.cgi?id=557319 * Crash ns-slapd while running scalab01 after restart slapd */ - LDAPDebug(LDAP_DEBUG_CRIT, - "dblayer_start - mmap in opening database environment (recovery mode) " + slapi_log_err(SLAPI_LOG_CRIT, + "dblayer_start", "mmap in opening database environment (recovery mode) " "failed trying to allocate %lu bytes. (OS err %d - %s)\n", li->li_dbcachesize, return_value, dblayer_strerror(return_value)); dblayer_free_env(&priv->dblayer_env); priv->dblayer_env = CATASTROPHIC; } else { - LDAPDebug(LDAP_DEBUG_CRIT, "dblayer_start - Database Recovery Process FAILED. " + slapi_log_err(SLAPI_LOG_CRIT, "dblayer_start", "Database Recovery Process FAILED. " "The database is not recoverable. err=%d: %s\n", - return_value, dblayer_strerror(return_value), 0); - LDAPDebug(LDAP_DEBUG_CRIT, - "dblayer_start - Please make sure there is enough disk space for " + return_value, dblayer_strerror(return_value)); + slapi_log_err(SLAPI_LOG_CRIT, + "dblayer_start", "Please make sure there is enough disk space for " "dbcache (%lu bytes) and db region files\n", - li->li_dbcachesize, 0, 0); + li->li_dbcachesize); } return return_value; } else { open_flags &= ~(DB_RECOVER | DB_RECOVER_FATAL); pEnv->dblayer_DB_ENV->close(pEnv->dblayer_DB_ENV, 0); if ((return_value = dblayer_make_env(&pEnv, li)) != 0) { - LDAPDebug(LDAP_DEBUG_CRIT, - "dblayer_start - Failed to create DBENV (returned: %d).\n", - return_value, 0, 0); + slapi_log_err(SLAPI_LOG_CRIT, + "dblayer_start", "Failed to create DBENV (returned: %d).\n", + return_value); return return_value; } dblayer_free_env(&priv->dblayer_env); @@ -1665,15 +1665,15 @@ dblayer_start(struct ldbminfo *li, int dbmode) * https://blackflag.mcom.com/show_bug.cgi?id=557319 * Crash ns-slapd while running scalab01 after restart slapd */ - LDAPDebug(LDAP_DEBUG_CRIT, - "dblayer_start - mmap in opening database environment " - "failed trying to allocate %d bytes. (OS err %lu - %s)\n", + slapi_log_err(SLAPI_LOG_CRIT, + "dblayer_start", "mmap in opening database environment " + "failed trying to allocate %lu bytes. (OS err %d - %s)\n", li->li_dbcachesize, return_value, dblayer_strerror(return_value)); dblayer_free_env(&priv->dblayer_env); priv->dblayer_env = CATASTROPHIC; } else { - LDAPDebug(LDAP_DEBUG_CRIT, - "dblayer_start - Opening database environment (%s) failed. err=%d: %s\n", + slapi_log_err(SLAPI_LOG_CRIT, + "dblayer_start", "Opening database environment (%s) failed. err=%d: %s\n", region_dir, return_value, dblayer_strerror(return_value)); } } @@ -1708,12 +1708,12 @@ check_and_set_import_cache(struct ldbminfo *li) char s[64]; /* big enough to hold %ld */ if (util_info_sys_pages(&pagesize, &pages, &procpages, &availpages) != 0 || 0 == pagesize || 0 == pages) { - LDAPDebug2Args(LDAP_DEBUG_ERR, "check_and_set_import_cache - " + slapi_log_err(SLAPI_LOG_ERR, "check_and_set_import_cache", "Failed to get pagesize: %ld or pages: %ld\n", pagesize, pages); return ENOENT; } - LDAPDebug(LDAP_DEBUG_INFO, "check_and_set_import_cache - " + slapi_log_err(SLAPI_LOG_INFO, "check_and_set_import_cache", "pagesize: %ld, pages: %ld, procpages: %ld\n", pagesize, pages, procpages); @@ -1732,11 +1732,10 @@ check_and_set_import_cache(struct ldbminfo *li) /* sanity check */ if (li->li_import_cache_autosize >= 100) { - LDAPDebug0Args(LDAP_DEBUG_NOTICE, - "check_and_set_import_cache -" - "import cache autosizing value " - "(nsslapd-import-cache-autosize) should not be " - "greater than or equal to 100(%). Reset to 50(%).\n"); + slapi_log_err(SLAPI_LOG_NOTICE, + "check_and_set_import_cache", + "Import cache autosizing value (nsslapd-import-cache-autosize) should not be " + "greater than or equal to 100%%. Reset to 50%%.\n"); li->li_import_cache_autosize = 50; } @@ -1757,8 +1756,8 @@ check_and_set_import_cache(struct ldbminfo *li) page_delta = pages - import_pages; if (page_delta < hard_limit) { - LDAPDebug(LDAP_DEBUG_ERR, - "check_and_set_import_cache - After allocating import cache %ldKB, " + slapi_log_err(SLAPI_LOG_ERR, + "check_and_set_import_cache", "After allocating import cache %ldKB, " "the available memory is %ldKB, " "which is less than the hard limit %ldKB. " "Please decrease the import cache size and rerun import.\n", @@ -1767,8 +1766,8 @@ check_and_set_import_cache(struct ldbminfo *li) return ENOMEM; } if (page_delta < soft_limit) { - LDAPDebug(LDAP_DEBUG_WARNING, - "check_and_set_import_cache - After allocating import cache %ldKB, " + slapi_log_err(SLAPI_LOG_WARNING, + "check_and_set_import_cache", "After allocating import cache %ldKB, " "the available memory is %ldKB, " "which is less than the soft limit %ldKB. " "You may want to decrease the import cache size and " @@ -1777,7 +1776,7 @@ check_and_set_import_cache(struct ldbminfo *li) soft_limit*(pagesize/1024)); } - LDAPDebug1Arg(LDAP_DEBUG_INFO, "check_and_set_import_cache - Import allocates %ldKB import cache.\n", + slapi_log_err(SLAPI_LOG_INFO, "check_and_set_import_cache", "Import allocates %ldKB import cache.\n", import_pages*(pagesize/1024)); if (li->li_import_cache_autosize > 0) { /* import cache autosizing */ /* set the calculated import cache size to the config */ @@ -1833,23 +1832,23 @@ int dblayer_instance_start(backend *be, int mode) priv = (dblayer_private*)li->li_dblayer_private; pEnv = priv->dblayer_env; if (CATASTROPHIC == pEnv || NULL == pEnv) { - LDAPDebug(LDAP_DEBUG_ERR, - "dblayer_instance_start - instance %s: dbenv is not available (0x%x).\n", - inst?inst->inst_name:"unknown", pEnv, 0); + slapi_log_err(SLAPI_LOG_ERR, + "dblayer_instance_start", "DB Instance %s: dbenv is not available (0x%p).\n", + inst?inst->inst_name:"unknown", pEnv); return return_value; } if (NULL != inst->inst_id2entry) { - LDAPDebug(LDAP_DEBUG_WARNING, - "dblayer_instance_start - DB instance \"%s\" already started.\n", - inst->inst_name, 0, 0); + slapi_log_err(SLAPI_LOG_WARNING, + "dblayer_instance_start", "DB instance \"%s\" already started.\n", + inst->inst_name); return 0; } if (attrcrypt_init(inst)) { - LDAPDebug(LDAP_DEBUG_ERR, - "dblayer_instance_start - Unable to initialize attrcrypt system for %s\n", - inst->inst_name, 0, 0); + slapi_log_err(SLAPI_LOG_ERR, + "dblayer_instance_start", "Unable to initialize attrcrypt system for %s\n", + inst->inst_name); return return_value; } @@ -1866,17 +1865,17 @@ int dblayer_instance_start(backend *be, int mode) return_value = dblayer_grok_directory(inst_dirp, DBLAYER_DIRECTORY_READWRITE_ACCESS); } else { - LDAPDebug(LDAP_DEBUG_ERR,"dblayer_instance_start - " + slapi_log_err(SLAPI_LOG_ERR,"dblayer_instance_start", "Can't start because the database instance " - "directory is NULL\n", 0, 0, 0); + "directory is NULL\n"); goto errout; } if (0 != return_value) { - LDAPDebug(LDAP_DEBUG_ERR,"dblayer_instance_start - " + slapi_log_err(SLAPI_LOG_ERR,"dblayer_instance_start", "Can't start because the database instance " "directory \"%s\" either doesn't exist, " "or the db files are not accessible\n", - inst_dirp, 0, 0); + inst_dirp); goto errout; } @@ -1891,8 +1890,8 @@ int dblayer_instance_start(backend *be, int mode) char *dataversion = NULL; if (dbversion_read(li, inst_dirp, &ldbmversion, &dataversion) != 0) { - LDAPDebug(LDAP_DEBUG_WARNING, "dblayer_instance_start - Unable to read dbversion " - "file in %s\n", inst->inst_dir_name, 0, 0); + slapi_log_err(SLAPI_LOG_WARNING, "dblayer_instance_start", "Unable to read dbversion " + "file in %s\n", inst->inst_dir_name); } else { int rval = 0; /* check the DBVERSION and reset idl-switch if needed (DS6.2) */ @@ -1907,8 +1906,8 @@ int dblayer_instance_start(backend *be, int mode) rval = check_db_inst_version(inst); if (rval & DBVERSION_NOT_SUPPORTED) { - LDAPDebug(LDAP_DEBUG_ERR, "dblayer_instance_start - Instance %s does not have the " - "expected version\n", inst->inst_name, 0, 0); + slapi_log_err(SLAPI_LOG_ERR, "dblayer_instance_start", " DB Instance %s does not have the " + "expected version\n", inst->inst_name); PR_ASSERT(0); slapi_ch_free_string(&dataversion); return_value = -1; @@ -1916,8 +1915,8 @@ int dblayer_instance_start(backend *be, int mode) } else if (rval & DBVERSION_NEED_DN2RDN) { - LDAPDebug2Args(LDAP_DEBUG_ERR, - "dblayer_instance_start - %s is on, while the instance %s is in the DN format. " + slapi_log_err(SLAPI_LOG_ERR, + "dblayer_instance_start", "%s is on, while the instance %s is in the DN format. " "Please run dn2rdn to convert the database format.\n", CONFIG_ENTRYRDN_SWITCH, inst->inst_name); slapi_ch_free_string(&dataversion); @@ -1926,8 +1925,8 @@ int dblayer_instance_start(backend *be, int mode) } else if (rval & DBVERSION_NEED_RDN2DN) { - LDAPDebug2Args(LDAP_DEBUG_ERR, - "dblayer_instance_start - %s is off, while the instance %s is in the RDN " + slapi_log_err(SLAPI_LOG_ERR, + "dblayer_instance_start", "%s is off, while the instance %s is in the RDN " "format. Please change the value to on in dse.ldif.\n", CONFIG_ENTRYRDN_SWITCH, inst->inst_name); slapi_ch_free_string(&dataversion); @@ -1945,32 +1944,12 @@ int dblayer_instance_start(backend *be, int mode) rval = ldbm_upgrade(inst, rval); if (0 != rval) { - LDAPDebug(LDAP_DEBUG_ERR, "dblayer_instance_start - Upgrading instance %s failed\n", - inst->inst_name, 0, 0); + slapi_log_err(SLAPI_LOG_ERR, "dblayer_instance_start", "Upgrading instance %s failed\n", + inst->inst_name); PR_ASSERT(0); return_value = -1; goto errout; } - /** - if (rval & DBVERSION_NEED_IDL_OLD2NEW) - { - LDAPDebug(LDAP_DEBUG_ERR, - "Instance %s: idl-switch is new while db idl format is " - "old, modify nsslapd-idl-switch in dse.ldif to old\n", - inst->inst_name, 0, 0); - return_value = -1; - goto errout; - } - else if (rval & DBVERSION_NEED_IDL_NEW2OLD) - { - LDAPDebug(LDAP_DEBUG_ERR, - "Instance %s: idl-switch is old while db idl format is " - "new, modify nsslapd-idl-switch in dse.ldif to new\n", - inst->inst_name, 0, 0); - return_value = -1; - goto errout; - } - **/ } } else { /* The dbversion file didn't exist, so we'll create one. */ @@ -2010,11 +1989,10 @@ int dblayer_instance_start(backend *be, int mode) * but nsslapd-db-private-import-mem should work with import, * as well */ if (priv->dblayer_private_import_mem) { - LDAPDebug(LDAP_DEBUG_WARNING, - "dblayer_instance_start - Import is running with " + slapi_log_err(SLAPI_LOG_WARNING, + "dblayer_instance_start", "Import is running with " "nsslapd-db-private-import-mem on; " - "No other process is allowed to access the database\n", - 0, 0, 0); + "No other process is allowed to access the database\n"); oflags |= DB_PRIVATE; } PR_Lock(li->li_config_mutex); @@ -2040,9 +2018,9 @@ int dblayer_instance_start(backend *be, int mode) /* use our own env */ return_value = dblayer_make_env(&mypEnv, li); if (return_value != 0) { - LDAPDebug(LDAP_DEBUG_ERR, - "dblayer_instance_start - Unable to create new DB_ENV for import/export! %d\n", - return_value, 0, 0); + slapi_log_err(SLAPI_LOG_ERR, + "dblayer_instance_start", "Unable to create new DB_ENV for import/export! %d\n", + return_value); goto out; } /* do not assume import cache size is under 1G */ @@ -2061,9 +2039,9 @@ int dblayer_instance_start(backend *be, int mode) oflags, priv->dblayer_file_mode); if (return_value != 0) { - LDAPDebug(LDAP_DEBUG_ERR, - "dblayer_instance_start - Unable to open new DB_ENV for import/export! %d\n", - return_value, 0, 0); + slapi_log_err(SLAPI_LOG_ERR, + "dblayer_instance_start", "Unable to open new DB_ENV for import/export! %d\n", + return_value); goto out; } inst->import_env = mypEnv; @@ -2074,9 +2052,9 @@ int dblayer_instance_start(backend *be, int mode) inst->inst_id2entry = NULL; return_value = db_create(&inst->inst_id2entry, mypEnv->dblayer_DB_ENV, 0); if (0 != return_value) { - LDAPDebug(LDAP_DEBUG_ERR, - "dblayer_instance_start - Unable to create id2entry db file! %d\n", - return_value, 0, 0); + slapi_log_err(SLAPI_LOG_ERR, + "dblayer_instance_start", "Unable to create id2entry db file! %d\n", + return_value); goto out; } dbp = inst->inst_id2entry; @@ -2085,8 +2063,8 @@ int dblayer_instance_start(backend *be, int mode) (priv->dblayer_page_size == 0) ? DBLAYER_PAGESIZE : priv->dblayer_page_size); if (0 != return_value) { - LDAPDebug(LDAP_DEBUG_ERR, - "dblayer_instance_start - dbp->set_pagesize(%lu or %lu) failed %d\n", + slapi_log_err(SLAPI_LOG_ERR, + "dblayer_instance_start", "dbp->set_pagesize(%lu or %lu) failed %d\n", priv->dblayer_page_size, DBLAYER_PAGESIZE, return_value); goto out; @@ -2095,7 +2073,7 @@ int dblayer_instance_start(backend *be, int mode) #if 1000*DB_VERSION_MAJOR + 100*DB_VERSION_MINOR < 3300 return_value = dbp->set_malloc(dbp, (void *)slapi_ch_malloc); if (0 != return_value) { - LDAPDebug1Arg(LDAP_DEBUG_ERR, "dblayer_instance_start - dbp->set_malloc failed %d\n", + slapi_log_err(SLAPI_LOG_ERR, "dblayer_instance_start", "dbp->set_malloc failed %d\n", return_value); goto out; @@ -2123,8 +2101,8 @@ int dblayer_instance_start(backend *be, int mode) (priv->dblayer_page_size == 0) ? DBLAYER_PAGESIZE : priv->dblayer_page_size); if (0 != return_value) { - LDAPDebug(LDAP_DEBUG_ERR, - "dblayer_instance_start - dbp->set_pagesize(%lu or %lu) failed %d\n", + slapi_log_err(SLAPI_LOG_ERR, + "dblayer_instance_start", "dbp->set_pagesize(%lu or %lu) failed %d\n", priv->dblayer_page_size, DBLAYER_PAGESIZE, return_value); goto out; @@ -2133,7 +2111,7 @@ int dblayer_instance_start(backend *be, int mode) #if 1000*DB_VERSION_MAJOR + 100*DB_VERSION_MINOR < 3300 return_value = dbp->set_malloc(dbp, (void *)slapi_ch_malloc); if (0 != return_value) { - LDAPDebug1Arg(LDAP_DEBUG_ERR, "dblayer_instance_start - dbp->set_malloc failed %d\n", + slapi_log_err(SLAPI_LOG_ERR, "dblayer_instance_start", "dbp->set_malloc failed %d\n", return_value); goto out; @@ -2145,8 +2123,8 @@ int dblayer_instance_start(backend *be, int mode) dbp, NULL/* txnid */, id2entry_file, subname, DB_BTREE, open_flags, priv->dblayer_file_mode, return_value); if (0 != return_value) { - LDAPDebug(LDAP_DEBUG_ERR, - "dblayer_instance_start - dbp->open(\"%s\") failed: %s (%d)\n", + slapi_log_err(SLAPI_LOG_ERR, + "dblayer_instance_start", "dbp->open(\"%s\") failed: %s (%d)\n", id2entry_file, dblayer_strerror(return_value), return_value); /* if it's a newly created backend instance, @@ -2155,17 +2133,17 @@ int dblayer_instance_start(backend *be, int mode) if (strstr(dblayer_strerror(return_value), "No such file or directory")) { - LDAPDebug(LDAP_DEBUG_ERR, - "dblayer_instance_start - Instance %s is not registered as a db data directory. " + slapi_log_err(SLAPI_LOG_ERR, + "dblayer_instance_start", "Instance %s is not registered as a db data directory. " "Please restart the server to create it.\n", - inst?inst->inst_name:"unknown", pEnv, 0); + inst?inst->inst_name:"unknown"); } else if (strstr(dblayer_strerror(return_value), "Permission denied")) { - LDAPDebug(LDAP_DEBUG_ERR, - "dblayer_instance_start - Instance directory %s may not be writable\n", - inst_dirp, 0, 0); + slapi_log_err(SLAPI_LOG_ERR, + "dblayer_instance_start", "Instance directory %s may not be writable\n", + inst_dirp); } goto out; @@ -2202,15 +2180,15 @@ out: * being imported or is in normal mode */ if (inst->inst_nextid > MAXID && !(mode & DBLAYER_EXPORT_MODE)) { - LDAPDebug(LDAP_DEBUG_CRIT, "dblayer_instance_start - backend '%s' " + slapi_log_err(SLAPI_LOG_CRIT, "dblayer_instance_start", "Backend '%s' " "has no IDs left. DATABASE MUST BE REBUILT.\n", - be->be_name, 0, 0); + be->be_name); return 1; } if (return_value != 0) { - LDAPDebug(LDAP_DEBUG_ERR, "dblayer_instance_start -failure %s (%d)\n", - dblayer_strerror(return_value), return_value, 0); + slapi_log_err(SLAPI_LOG_ERR, "dblayer_instance_start", "Failure %s (%d)\n", + dblayer_strerror(return_value), return_value); } errout: if (inst_dirp != inst_dir) @@ -2294,31 +2272,31 @@ dblayer_get_aux_id2entry_ext(backend *be, DB **ppDB, DB_ENV **ppEnv, PR_ASSERT(NULL != be); if ((NULL == ppEnv) || (NULL == ppDB)) { - LDAPDebug0Args(LDAP_DEBUG_ERR, "dblayer_get_aux_id2entry_ext - No memory for DB_ENV or DB handle\n"); + slapi_log_err(SLAPI_LOG_ERR, "dblayer_get_aux_id2entry_ext", "No memory for DB_ENV or DB handle\n"); goto done; } *ppDB = NULL; inst = (ldbm_instance *) be->be_instance_info; if (NULL == inst) { - LDAPDebug(LDAP_DEBUG_ERR, - "dblayer_get_aux_id2entry_ext - No instance/env: persistent id2entry is not available\n", 0, 0, 0); + slapi_log_err(SLAPI_LOG_ERR, + "dblayer_get_aux_id2entry_ext", "No instance/env: persistent id2entry is not available\n"); goto done; } li = inst->inst_li; if (NULL == li) { - LDAPDebug(LDAP_DEBUG_ERR, - "dblayer_get_aux_id2entry_ext - No ldbm info: persistent id2entry is not available\n", 0, 0, 0); + slapi_log_err(SLAPI_LOG_ERR, + "dblayer_get_aux_id2entry_ext", "No ldbm info: persistent id2entry is not available\n"); goto done; } opriv = li->li_dblayer_private; if (NULL == opriv) { - LDAPDebug(LDAP_DEBUG_ERR, - "dblayer_get_aux_id2entry_ext - No dblayer info: persistent id2entry is not available\n", 0, 0, 0); + slapi_log_err(SLAPI_LOG_ERR, + "dblayer_get_aux_id2entry_ext", "No dblayer info: persistent id2entry is not available\n"); goto done; } priv = (dblayer_private *)slapi_ch_malloc(sizeof(dblayer_private)); @@ -2332,9 +2310,8 @@ dblayer_get_aux_id2entry_ext(backend *be, DB **ppDB, DB_ENV **ppEnv, } else { - LDAPDebug(LDAP_DEBUG_ERR, - "dblayer_get_aux_id2entry_ext - Instance dir is NULL: persistent id2entry is not available\n", - 0, 0, 0); + slapi_log_err(SLAPI_LOG_ERR, + "dblayer_get_aux_id2entry_ext", "Instance dir is NULL: persistent id2entry is not available\n"); goto done; } priv->dblayer_log_directory = slapi_ch_strdup(priv->dblayer_home_directory); @@ -2342,8 +2319,8 @@ dblayer_get_aux_id2entry_ext(backend *be, DB **ppDB, DB_ENV **ppEnv, prst = PR_GetFileInfo64(inst_dirp, &prfinfo); if (PR_FAILURE == prst || PR_FILE_DIRECTORY != prfinfo.type) { - LDAPDebug(LDAP_DEBUG_ERR, - "dblayer_get_aux_id2entry_ext - No inst dir: persistent id2entry is not available\n", 0, 0, 0); + slapi_log_err(SLAPI_LOG_ERR, + "dblayer_get_aux_id2entry_ext", "No inst dir: persistent id2entry is not available\n"); goto done; } @@ -2355,8 +2332,8 @@ dblayer_get_aux_id2entry_ext(backend *be, DB **ppDB, DB_ENV **ppEnv, rval = mkdir_p(priv->dblayer_home_directory, 0700); if (rval) { - LDAPDebug0Args(LDAP_DEBUG_ERR, - "dblayer_get_aux_id2entry_ext - Can't create env dir: persistent id2entry is not available\n"); + slapi_log_err(SLAPI_LOG_ERR, + "dblayer_get_aux_id2entry_ext", "Can't create env dir: persistent id2entry is not available\n"); goto done; } @@ -2364,8 +2341,8 @@ dblayer_get_aux_id2entry_ext(backend *be, DB **ppDB, DB_ENV **ppEnv, if (!*ppEnv) { rval = dblayer_make_env(&mypEnv, li); if (rval) { - LDAPDebug1Arg(LDAP_DEBUG_ERR, - "dblayer_get_aux_id2entry_ext - Unable to create new DB_ENV for import/export! %d\n", rval); + slapi_log_err(SLAPI_LOG_ERR, + "dblayer_get_aux_id2entry_ext", "Unable to create new DB_ENV for import/export! %d\n", rval); goto err; } } @@ -2386,24 +2363,24 @@ dblayer_get_aux_id2entry_ext(backend *be, DB **ppDB, DB_ENV **ppEnv, rval = (mypEnv->dblayer_DB_ENV->open)(mypEnv->dblayer_DB_ENV, priv->dblayer_home_directory, envflags, priv->dblayer_file_mode); if (rval) { - LDAPDebug1Arg(LDAP_DEBUG_ERR, - "dblayer_get_aux_id2entry_ext - Unable to open new DB_ENV for upgradedb/reindex %d\n", rval); + slapi_log_err(SLAPI_LOG_ERR, + "dblayer_get_aux_id2entry_ext", "Unable to open new DB_ENV for upgradedb/reindex %d\n", rval); goto err; } *ppEnv = mypEnv->dblayer_DB_ENV; } rval = db_create(&dbp, *ppEnv, 0); if (rval) { - LDAPDebug1Arg(LDAP_DEBUG_ERR, - "dblayer_get_aux_id2entry_ext - Unable to create id2entry db handler! %d\n", rval); + slapi_log_err(SLAPI_LOG_ERR, + "dblayer_get_aux_id2entry_ext", "Unable to create id2entry db handler! %d\n", rval); goto err; } rval = dbp->set_pagesize(dbp, (priv->dblayer_page_size == 0) ? DBLAYER_PAGESIZE : priv->dblayer_page_size); if (rval) { - LDAPDebug(LDAP_DEBUG_ERR, - "dblayer_get_aux_id2entry_ext - dbp->set_pagesize(%lu or %lu) failed %d\n", + slapi_log_err(SLAPI_LOG_ERR, + "dblayer_get_aux_id2entry_ext", "dbp->set_pagesize(%lu or %lu) failed %d\n", priv->dblayer_page_size, DBLAYER_PAGESIZE, rval); goto err; } @@ -2421,12 +2398,12 @@ dblayer_get_aux_id2entry_ext(backend *be, DB **ppDB, DB_ENV **ppEnv, DB_OPEN(envflags, dbp, NULL/* txnid */, id2entry_file, subname, DB_BTREE, dbflags, priv->dblayer_file_mode, rval); if (rval) { - LDAPDebug(LDAP_DEBUG_ERR, - "dblayer_get_aux_id2entry_ext - dbp->open(\"%s\") failed: %s (%d)\n", + slapi_log_err(SLAPI_LOG_ERR, + "dblayer_get_aux_id2entry_ext", "dbp->open(\"%s\") failed: %s (%d)\n", id2entry_file, dblayer_strerror(rval), rval); if (strstr(dblayer_strerror(rval), "Permission denied")) { - LDAPDebug1Arg(LDAP_DEBUG_ERR, - "dblayer_get_aux_id2entry_ext - Instance directory %s may not be writable\n", inst_dirp); + slapi_log_err(SLAPI_LOG_ERR, + "dblayer_get_aux_id2entry_ext", "Instance directory %s may not be writable\n", inst_dirp); } goto err; } @@ -2473,8 +2450,8 @@ int dblayer_release_aux_id2entry(backend *be, DB *pDB, DB_ENV *pEnv) inst = (ldbm_instance *) be->be_instance_info; if (NULL == inst) { - LDAPDebug(LDAP_DEBUG_ERR, - "dblayer_release_aux_id2entry - No instance/env: persistent id2entry is not available\n", 0, 0, 0); + slapi_log_err(SLAPI_LOG_ERR, + "dblayer_release_aux_id2entry", "No instance/env: persistent id2entry is not available\n"); goto done; } @@ -2546,18 +2523,18 @@ int dblayer_instance_close(backend *be) * when running a memory leak checking tool (e.g., valgrind), * it reduces the noise by enabling this code. */ - LDAPDebug1Arg(LDAP_DEBUG_DEBUG, "dblayer_instance_close - %s: Cleaning up entry cache\n", + slapi_log_err(SLAPI_LOG_DEBUG, "dblayer_instance_close", "%s: Cleaning up entry cache\n", inst->inst_name); cache_clear(&inst->inst_cache, CACHE_TYPE_ENTRY); - LDAPDebug1Arg(LDAP_DEBUG_DEBUG, "dblayer_instance_close - %s: Cleaning up dn cache\n", + slapi_log_err(SLAPI_LOG_DEBUG, "dblayer_instance_close", "%s: Cleaning up dn cache\n", inst->inst_name); cache_clear(&inst->inst_dncache, CACHE_TYPE_DN); } if (attrcrypt_cleanup_private(inst)) { - LDAPDebug(LDAP_DEBUG_ERR, - "dblayer_instance_close - Failed to clean up attrcrypt system for %s\n", - inst->inst_name, 0, 0); + slapi_log_err(SLAPI_LOG_ERR, + "dblayer_instance_close", "Failed to clean up attrcrypt system for %s\n", + inst->inst_name); } return_value = dblayer_close_indexes(be); @@ -2622,8 +2599,8 @@ void dblayer_pre_close(struct ldbminfo *li) PRIntervalTime cvwaittime = PR_MillisecondsToInterval(DBLAYER_SLEEP_INTERVAL * 100); int timedout = 0; /* Print handy-dandy log message */ - LDAPDebug(LDAP_DEBUG_INFO,"Waiting for %d database threads to stop\n", - threadcount, 0,0); + slapi_log_err(SLAPI_LOG_INFO, "dblayer_pre_close", "Waiting for %d database threads to stop\n", + threadcount); PR_Lock(priv->thread_count_lock); /* Tell them to stop - we wait until the last possible moment to invoke this. If we do this much sooner than this, we could find ourselves @@ -2655,14 +2632,14 @@ void dblayer_pre_close(struct ldbminfo *li) } PR_Unlock(priv->thread_count_lock); if (timedout) { - LDAPDebug(LDAP_DEBUG_ERR, - "dblayer_pre_close - Timeout after [%d] milliseconds; leave %d database thread(s)...\n", - (DBLAYER_SLEEP_INTERVAL * 100), threadcount,0); + slapi_log_err(SLAPI_LOG_ERR, + "dblayer_pre_close", "Timeout after [%d] milliseconds; leave %d database thread(s)...\n", + (DBLAYER_SLEEP_INTERVAL * 100), threadcount); priv->dblayer_bad_stuff_happened = 1; goto timeout_escape; } } - LDAPDebug(LDAP_DEBUG_INFO,"All database threads now stopped\n",0,0,0); + slapi_log_err(SLAPI_LOG_INFO,"dblayer_pre_close", "All database threads now stopped\n"); timeout_escape: return; } @@ -2780,12 +2757,12 @@ dblayer_remove_env(struct ldbminfo *li) char *home_dir = NULL; int rc = db_env_create(&env, 0); if (rc) { - LDAPDebug1Arg(LDAP_DEBUG_ERR, - "dblayer_remove_env - Failed to create DB_ENV (returned: %d)\n", rc); + slapi_log_err(SLAPI_LOG_ERR, + "dblayer_remove_env", "Failed to create DB_ENV (returned: %d)\n", rc); return rc; } if (NULL == li) { - LDAPDebug0Args(LDAP_DEBUG_ERR, "dblayer_remove_env - No ldbm info is given\n"); + slapi_log_err(SLAPI_LOG_ERR, "dblayer_remove_env", "No ldbm info is given\n"); return -1; } @@ -2793,8 +2770,8 @@ dblayer_remove_env(struct ldbminfo *li) if (home_dir) { rc = env->remove(env, home_dir, 0); if (rc) { - LDAPDebug1Arg(LDAP_DEBUG_ERR, - "dblayer_remove_env - Failed to remove DB environment files. " + slapi_log_err(SLAPI_LOG_ERR, + "dblayer_remove_env", "Failed to remove DB environment files. " "Please remove %s/__db.00# (# is 1 through 6)\n", home_dir); } @@ -2934,10 +2911,10 @@ dblayer_open_file(backend *be, char* indexname, int open_flag, !is_fullpath(inst->inst_dir_name)) { - LDAPDebug(LDAP_DEBUG_ERR, - "dblayer_open_file - The instance path %s is not registered for db_data_dir, " + slapi_log_err(SLAPI_LOG_ERR, + "dblayer_open_file", "The instance path %s is not registered for db_data_dir, " "although %s is a relative path.\n", - inst->inst_parent_dir_name, inst->inst_dir_name, 0); + inst->inst_parent_dir_name, inst->inst_dir_name); return -1; } } @@ -3190,8 +3167,8 @@ dblayer_db_remove_ex(dblayer_private_env *env, char const path[], char const dbN rc = db_create(&db, db_env, 0); /* must use new handle to database */ if (0 != rc) { - LDAPDebug(LDAP_DEBUG_ERR, "dblayer_db_remove_ex - Failed to create db (%d) %s\n", - rc, dblayer_strerror(rc), 0); + slapi_log_err(SLAPI_LOG_ERR, "dblayer_db_remove_ex", "Failed to create db (%d) %s\n", + rc, dblayer_strerror(rc)); goto done; } rc = db->remove(db, path, dbName, 0); /* kiss the db goodbye! */ @@ -3417,7 +3394,7 @@ dblayer_txn_begin_ext(struct ldbminfo *li, back_txnid parent_txn, back_txn *txn, int txn_id = new_txn.back_txn_txn->id(new_txn.back_txn_txn); PR_Lock(sync_txn_log_flush); txn_in_progress_count++; - LDAPDebug(LDAP_DEBUG_BACKLDBM, "dblayer_txn_begin_ext - " + slapi_log_err(SLAPI_LOG_BACKLDBM, "dblayer_txn_begin_ext", "Batchcount: %d, txn_in_progress: %d, curr_txn: %x\n", trans_batch_count, txn_in_progress_count, txn_id); PR_Unlock(sync_txn_log_flush); @@ -3433,9 +3410,9 @@ dblayer_txn_begin_ext(struct ldbminfo *li, back_txnid parent_txn, back_txn *txn, } if (0 != return_value) { - LDAPDebug(LDAP_DEBUG_CRIT, - "dblayer_txn_begin_ext - Serious Error---Failed in dblayer_txn_begin, err=%d (%s)\n", - return_value, dblayer_strerror(return_value), 0); + slapi_log_err(SLAPI_LOG_CRIT, + "dblayer_txn_begin_ext", "Serious Error---Failed in dblayer_txn_begin, err=%d (%s)\n", + return_value, dblayer_strerror(return_value)); } return return_value; } @@ -3519,7 +3496,7 @@ int dblayer_txn_commit_ext(struct ldbminfo *li, back_txn *txn, PRBool use_lock) PR_Lock(sync_txn_log_flush); txn_batch_slot = trans_batch_count++; txn_log_flush_pending[txn_batch_slot] = txn_id; - LDAPDebug(LDAP_DEBUG_BACKLDBM, "dblayer_txn_commit_ext - (before notify): batchcount: %d, " + slapi_log_err(SLAPI_LOG_BACKLDBM, "dblayer_txn_commit_ext", "(before notify): batchcount: %d, " "txn_in_progress: %d, curr_txn: %x\n", trans_batch_count, txn_in_progress_count, txn_id); /* @@ -3542,7 +3519,7 @@ int dblayer_txn_commit_ext(struct ldbminfo *li, back_txn *txn, PRBool use_lock) PR_WaitCondVar(sync_txn_log_flush_done, PR_INTERVAL_NO_TIMEOUT); } txn_in_progress_count--; - LDAPDebug(LDAP_DEBUG_BACKLDBM, "dblayer_txn_commit_ext - (before unlock): batchcount: %d, " + slapi_log_err(SLAPI_LOG_BACKLDBM, "dblayer_txn_commit_ext", "(before unlock): batchcount: %d, " "txn_in_progress: %d, curr_txn %x\n", trans_batch_count, txn_in_progress_count, txn_id); PR_Unlock(sync_txn_log_flush); @@ -3558,9 +3535,9 @@ int dblayer_txn_commit_ext(struct ldbminfo *li, back_txn *txn, PRBool use_lock) if (0 != return_value) { - LDAPDebug(LDAP_DEBUG_CRIT, - "dblayer_txn_commit_ext - Serious Error---Failed in dblayer_txn_commit, err=%d (%s)\n", - return_value, dblayer_strerror(return_value), 0); + slapi_log_err(SLAPI_LOG_CRIT, + "dblayer_txn_commit_ext", "Serious Error---Failed in dblayer_txn_commit, err=%d (%s)\n", + return_value, dblayer_strerror(return_value)); if (LDBM_OS_ERR_IS_DISKFULL(return_value)) { operation_out_of_disk_space(); } @@ -3626,7 +3603,9 @@ int dblayer_txn_abort_ext(struct ldbminfo *li, back_txn *txn, PRBool use_lock) PR_Lock(sync_txn_log_flush); txn_in_progress_count--; PR_Unlock(sync_txn_log_flush); - LDAPDebug(LDAP_DEBUG_BACKLDBM, "dblayer_txn_abort_ext - Batchcount: %d, txn_in_progress: %d, curr_txn: %x\n", trans_batch_count, txn_in_progress_count, txn_id); + slapi_log_err(SLAPI_LOG_BACKLDBM, "dblayer_txn_abort_ext", + "Batchcount: %d, txn_in_progress: %d, curr_txn: %x\n", + trans_batch_count, txn_in_progress_count, txn_id); } return_value = TXN_ABORT(db_txn); /* if we were given a transaction, and it is the same as the @@ -3648,9 +3627,9 @@ int dblayer_txn_abort_ext(struct ldbminfo *li, back_txn *txn, PRBool use_lock) if (0 != return_value) { - LDAPDebug(LDAP_DEBUG_CRIT, - "dblayer_txn_abort_ext - Serious Error---Failed in dblayer_txn_abort, err=%d (%s)\n", - return_value, dblayer_strerror(return_value), 0); + slapi_log_err(SLAPI_LOG_CRIT, + "dblayer_txn_abort_ext", "Serious Error---Failed in dblayer_txn_abort, err=%d (%s)\n", + return_value, dblayer_strerror(return_value)); if (LDBM_OS_ERR_IS_DISKFULL(return_value)) { operation_out_of_disk_space(); } @@ -3778,10 +3757,10 @@ dblayer_start_perf_thread(struct ldbminfo *li) SLAPD_DEFAULT_THREAD_STACKSIZE) ) { PRErrorCode prerr = PR_GetError(); - LDAPDebug(LDAP_DEBUG_ERR, "dblayer_start_perf_thread - " + slapi_log_err(SLAPI_LOG_ERR, "dblayer_start_perf_thread", "Failed to create database perf thread, " SLAPI_COMPONENT_NAME_NSPR " error %d (%s)\n", - prerr, slapd_pr_strerror(prerr), 0); + prerr, slapd_pr_strerror(prerr)); return_value = -1; } return return_value; @@ -3807,7 +3786,7 @@ static int perf_threadmain(void *param) } DECR_THREAD_COUNT(priv); - LDAPDebug(LDAP_DEBUG_TRACE, "perf_threadmain - Leaving perf_threadmain\n", 0, 0, 0); + slapi_log_err(SLAPI_LOG_TRACE, "perf_threadmain", "Leaving perf_threadmain\n"); return 0; } @@ -3825,10 +3804,10 @@ dblayer_start_deadlock_thread(struct ldbminfo *li) SLAPD_DEFAULT_THREAD_STACKSIZE) ) { PRErrorCode prerr = PR_GetError(); - LDAPDebug(LDAP_DEBUG_ERR, "dblayer_start_deadlock_thread - " + slapi_log_err(SLAPI_LOG_ERR, "dblayer_start_deadlock_thread", "Failed to create database deadlock thread, " SLAPI_COMPONENT_NAME_NSPR " error %d (%s)\n", - prerr, slapd_pr_strerror(prerr), 0); + prerr, slapd_pr_strerror(prerr)); return_value = -1; } return return_value; @@ -3936,8 +3915,8 @@ print_ttilist(txn_test_iter **ttilist, size_t tticnt) { while (tticnt > 0) { tticnt--; - LDAPDebug2Args(LDAP_DEBUG_ERR, - "txn_test_threadmain: attr [%s] cnt [%lu]\n", + slapi_log_err(SLAPI_LOG_ERR, + "txn_test_threadmain", "attr [%s] cnt [%lu]\n", ttilist[tticnt]->attr, ttilist[tticnt]->cnt); } } @@ -3963,7 +3942,7 @@ txn_test_init_cfg(txn_test_cfg *cfg) slapi_ch_free_string(&indexlist_copy); cfg->verbose = getenv(TXN_TEST_VERBOSE) ? 1 : 0; - slapi_log_error(SLAPI_LOG_ERR, "txn_test_init_cfg", + slapi_log_err(SLAPI_LOG_ERR, "txn_test_init_cfg", "Config hold_msec [%d] loop_msec [%d] rmw [%d] txn [%d] indexes [%s]\n", cfg->hold_msec, cfg->loop_msec, cfg->flags, cfg->use_txn, getenv(TXN_TEST_INDEXES) ? getenv(TXN_TEST_INDEXES) : indexlist); @@ -4013,8 +3992,8 @@ wait_for_init: backend *be = inst->inst_be; if (be->be_state != BE_STATE_STARTED) { - LDAPDebug0Args(LDAP_DEBUG_ERR, - "txn_test_threadmain - Backend not started, retrying\n"); + slapi_log_err(SLAPI_LOG_ERR, + "txn_test_threadmain", "Backend not started, retrying\n"); object_release(inst_obj); goto wait_for_init; } @@ -4022,8 +4001,8 @@ wait_for_init: for (idx = cfg.indexes; idx && *idx; ++idx) { DB *db = NULL; if (be->be_state != BE_STATE_STARTED) { - LDAPDebug0Args(LDAP_DEBUG_ERR, - "txn_test_threadmain - Backend not started, retrying\n"); + slapi_log_err(SLAPI_LOG_ERR, + "txn_test_threadmain", "Backend not started, retrying\n"); object_release(inst_obj); goto wait_for_init; } @@ -4031,8 +4010,8 @@ wait_for_init: if (!strcmp(*idx, "id2entry")) { dblayer_get_id2entry(be, &db); if (db == NULL) { - LDAPDebug0Args(LDAP_DEBUG_ERR, - "txn_test_threadmain - id2entry database not found or not ready yet, retrying\n"); + slapi_log_err(SLAPI_LOG_ERR, + "txn_test_threadmain", "id2entry database not found or not ready yet, retrying\n"); object_release(inst_obj); goto wait_for_init; } @@ -4041,13 +4020,13 @@ wait_for_init: ainfo_get(be, *idx, &ai); if (NULL == ai) { if (dbattempts >= dbmaxretries) { - LDAPDebug1Arg(LDAP_DEBUG_ERR, - "txn_test_threadmain - index [%s] not found or not ready yet, skipping\n", + slapi_log_err(SLAPI_LOG_ERR, + "txn_test_threadmain", "Index [%s] not found or not ready yet, skipping\n", *idx); continue; } else { - LDAPDebug1Arg(LDAP_DEBUG_ERR, - "txn_test_threadmain - index [%s] not found or not ready yet, retrying\n", + slapi_log_err(SLAPI_LOG_ERR, + "txn_test_threadmain", "Index [%s] not found or not ready yet, retrying\n", *idx); object_release(inst_obj); goto wait_for_init; @@ -4056,13 +4035,13 @@ wait_for_init: if (dblayer_get_index_file(be, ai, &db, 0) || (NULL == db)) { if ((NULL == db) && strcasecmp(*idx, TXN_TEST_IDX_OK_IF_NULL)) { if (dbattempts >= dbmaxretries) { - LDAPDebug1Arg(LDAP_DEBUG_ERR, - "txn_test_threadmain - Database file for index [%s] not found or not ready yet, skipping\n", + slapi_log_err(SLAPI_LOG_ERR, + "txn_test_threadmain", "Database file for index [%s] not found or not ready yet, skipping\n", *idx); continue; } else { - LDAPDebug1Arg(LDAP_DEBUG_ERR, - "txn_test_threadmain - Database file for index [%s] not found or not ready yet, retrying\n", + slapi_log_err(SLAPI_LOG_ERR, + "txn_test_threadmain", "Database file for index [%s] not found or not ready yet, retrying\n", *idx); object_release(inst_obj); goto wait_for_init; @@ -4077,7 +4056,7 @@ wait_for_init: } } - LDAPDebug0Args(LDAP_DEBUG_ERR, "txn_test_threadmain - starting main txn stress loop\n"); + slapi_log_err(SLAPI_LOG_ERR, "txn_test_threadmain", "Starting main txn stress loop\n"); print_ttilist(ttilist, tticnt); while (!priv->dblayer_stop_threads) { @@ -4090,8 +4069,8 @@ retry_txn: if (cfg.use_txn) { rc = TXN_BEGIN(priv->dblayer_env->dblayer_DB_ENV, NULL, &txn, 0); if (rc || !txn) { - LDAPDebug2Args(LDAP_DEBUG_ERR, - "txn_test_threadmain - Failed to create a new transaction, err=%d (%s)\n", + slapi_log_err(SLAPI_LOG_ERR, + "txn_test_threadmain", "Failed to create a new transaction, err=%d (%s)\n", rc, dblayer_strerror(rc)); } } else { @@ -4106,8 +4085,8 @@ retry_txn: /* phase 1 - open a cursor to each db */ if (cfg.verbose) { - LDAPDebug1Arg(LDAP_DEBUG_ERR, - "txn_test_threadmain - Starting [%lu] indexes\n", tticnt); + slapi_log_err(SLAPI_LOG_ERR, + "txn_test_threadmain", "Starting [%lu] indexes\n", tticnt); } for (ii = 0; ii < tticnt; ++ii) { txn_test_iter *tti = ttilist[ii]; @@ -4133,8 +4112,8 @@ retry_cursor: rc = tti->db->cursor(tti->db, txn, &tti->cur, 0); if (DB_LOCK_DEADLOCK == rc) { if (cfg.verbose) { - LDAPDebug0Args(LDAP_DEBUG_ERR, - "txn_test_threadmain - Cursor create deadlock - retry\n"); + slapi_log_err(SLAPI_LOG_ERR, + "txn_test_threadmain", "Cursor create deadlock - retry\n"); } if (cfg.use_txn) { goto retry_txn; @@ -4142,8 +4121,8 @@ retry_cursor: goto retry_cursor; } } else if (rc) { - LDAPDebug2Args(LDAP_DEBUG_ERR, - "txn_test_threadmain - Failed to create a new cursor, err=%d (%s)\n", + slapi_log_err(SLAPI_LOG_ERR, + "txn_test_threadmain", "Failed to create a new cursor, err=%d (%s)\n", rc, dblayer_strerror(rc)); } } @@ -4186,8 +4165,8 @@ retry_get: rc = tti->cur->c_get(tti->cur, &key, &data, tti->flags); if (DB_LOCK_DEADLOCK == rc) { if (cfg.verbose) { - LDAPDebug0Args(LDAP_DEBUG_ERR, - "txn_test_threadmain - Cursor get deadlock - retry\n"); + slapi_log_err(SLAPI_LOG_ERR, + "txn_test_threadmain", "Cursor get deadlock - retry\n"); } if (cfg.use_txn) { goto retry_txn; @@ -4199,8 +4178,8 @@ retry_get: tti->flags = DB_FIRST|cfg.flags; /* start over until all indexes are done */ } else if (rc) { if ((DB_BUFFER_SMALL != rc) || cfg.verbose) { - LDAPDebug2Args(LDAP_DEBUG_ERR, - "txn_test_threadmain - Failed to read a cursor, err=%d (%s)\n", + slapi_log_err(SLAPI_LOG_ERR, + "txn_test_threadmain", "Failed to read a cursor, err=%d (%s)\n", rc, dblayer_strerror(rc)); } tti->cur->c_close(tti->cur); @@ -4218,8 +4197,8 @@ retry_get: /*print_ttilist(ttilist, tticnt);*/ init_ttilist(ttilist, tticnt); if (cfg.verbose) { - LDAPDebug2Args(LDAP_DEBUG_ERR, - "txn_test_threadmain - Finished [%lu] indexes [%lu] records\n", tticnt, cnt); + slapi_log_err(SLAPI_LOG_ERR, + "txn_test_threadmain", "Finished [%lu] indexes [%lu] records\n", tticnt, cnt); } TXN_TEST_LOOP_WAIT(cfg.loop_msec); } else { @@ -4257,10 +4236,10 @@ dblayer_start_txn_test_thread(struct ldbminfo *li) SLAPD_DEFAULT_THREAD_STACKSIZE) ) { PRErrorCode prerr = PR_GetError(); - LDAPDebug(LDAP_DEBUG_ERR, "dblayer_start_txn_test_thread - " + slapi_log_err(SLAPI_LOG_ERR, "dblayer_start_txn_test_thread", "Failed to create txn test thread, " SLAPI_COMPONENT_NAME_NSPR " error %d (%s)\n", - prerr, slapd_pr_strerror(prerr), 0); + prerr, slapd_pr_strerror(prerr)); return_value = -1; } return return_value; @@ -4296,11 +4275,11 @@ static int deadlock_threadmain(void *param) int rejected = 0; if ((rval = LOCK_DETECT(db_env, flags, deadlock_policy, &rejected)) != 0) { - LDAPDebug(LDAP_DEBUG_CRIT, - "deadlock_threadmain - Serious Error---Failed in deadlock detect (aborted at 0x%x), err=%d (%s)\n", + slapi_log_err(SLAPI_LOG_CRIT, + "deadlock_threadmain", "Serious Error---Failed in deadlock detect (aborted at 0x%x), err=%d (%s)\n", rejected, rval, dblayer_strerror(rval)); } else if (rejected) { - LDAPDebug1Arg(LDAP_DEBUG_TRACE, "deadlock_threadmain - Found and rejected %d lock requests\n", rejected); + slapi_log_err(SLAPI_LOG_TRACE, "deadlock_threadmain", "Found and rejected %d lock requests\n", rejected); } } @@ -4309,12 +4288,12 @@ static int deadlock_threadmain(void *param) } DECR_THREAD_COUNT(priv); - LDAPDebug(LDAP_DEBUG_TRACE, "deadlock_threadmain - Leaving deadlock_threadmain\n", 0, 0, 0); + slapi_log_err(SLAPI_LOG_TRACE, "deadlock_threadmain", "Leaving deadlock_threadmain\n"); return 0; } -#define checkpoint_debug_message(debug, fmt, a1, a2, a3) \ - if (debug) { LDAPDebug(LDAP_DEBUG_DEBUG,fmt,a1,a2,a3); } +#define checkpoint_debug_message(debug, ...) \ + if (debug) { slapi_log_err(SLAPI_LOG_DEBUG, "CHECKPOINT", __VA_ARGS__); } /* this thread tries to do two things: 1. catch a group of transactions that are pending allowing a worker thread @@ -4343,10 +4322,10 @@ dblayer_start_log_flush_thread(dblayer_private *priv) PR_UNJOINABLE_THREAD, SLAPD_DEFAULT_THREAD_STACKSIZE) ) { PRErrorCode prerr = PR_GetError(); - LDAPDebug(LDAP_DEBUG_ERR, - "dblayer_start_log_flush_thread - Failed to create database log flush thread, " + slapi_log_err(SLAPI_LOG_ERR, + "dblayer_start_log_flush_thread", "Failed to create database log flush thread, " SLAPI_COMPONENT_NAME_NSPR " error %d (%s)\n", - prerr, slapd_pr_strerror(prerr), 0); + prerr, slapd_pr_strerror(prerr)); return_value = -1; } } @@ -4388,8 +4367,8 @@ static int log_flush_threadmain(void *param) PR_Unlock(sync_txn_log_flush); break; } - LDAPDebug(LDAP_DEBUG_BACKLDBM, "log_flush_threadmain - (in loop): batchcount: %d, " - "txn_in_progress: %d\n", trans_batch_count, txn_in_progress_count, 0); + slapi_log_err(SLAPI_LOG_BACKLDBM, "log_flush_threadmain", "(in loop): batchcount: %d, " + "txn_in_progress: %d\n", trans_batch_count, txn_in_progress_count); /* * if here, do flush the txn logs if any of the following conditions are met * - batch limit exceeded @@ -4397,8 +4376,8 @@ static int log_flush_threadmain(void *param) * - do_flush indicate that the max waiting interval is exceeded */ if(trans_batch_count >= trans_batch_limit || trans_batch_count >= txn_in_progress_count || do_flush) { - LDAPDebug(LDAP_DEBUG_BACKLDBM, "log_flush_threadmain - (working): batchcount: %d, " - "txn_in_progress: %d\n", trans_batch_count, txn_in_progress_count, 0); + slapi_log_err(SLAPI_LOG_BACKLDBM, "log_flush_threadmain", "(working): batchcount: %d, " + "txn_in_progress: %d\n", trans_batch_count, txn_in_progress_count); LOG_FLUSH(priv->dblayer_env->dblayer_DB_ENV,0); for (i=0;idblayer_env, PR_TRUE, PR_TRUE, PR_FALSE); #if 1000*DB_VERSION_MAJOR + 100*DB_VERSION_MINOR < 4100 if (DB_INCOMPLETE == rval) { checkpoint_debug_message(debug_checkpointing, - "checkpoint_threadmain - Retrying checkpoint\n", 0, 0, 0); + "checkpoint_threadmain - Retrying checkpoint\n"); } else #endif { checkpoint_debug_message(debug_checkpointing, - "checkpoint_threadmain - Checkpoint Done\n", 0, 0, 0); + "checkpoint_threadmain - Checkpoint Done\n"); if (rval != 0) { /* bad error */ - LDAPDebug(LDAP_DEBUG_CRIT, - "checkpoint_threadmain - Serious Error---Failed to checkpoint database, " - "err=%d (%s)\n", rval, dblayer_strerror(rval), 0); + slapi_log_err(SLAPI_LOG_CRIT, + "checkpoint_threadmain", "Serious Error---Failed to checkpoint database, " + "err=%d (%s)\n", rval, dblayer_strerror(rval)); if (LDBM_OS_ERR_IS_DISKFULL(rval)) { operation_out_of_disk_space(); goto error_return; @@ -4561,24 +4539,24 @@ static int checkpoint_threadmain(void *param) } checkpoint_debug_message(debug_checkpointing, - "checkpoint_threadmain - Starting checkpoint\n", 0, 0, 0); + "checkpoint_threadmain - Starting checkpoint\n"); rval = dblayer_txn_checkpoint(li, priv->dblayer_env, PR_TRUE, PR_TRUE, PR_FALSE); #if 1000*DB_VERSION_MAJOR + 100*DB_VERSION_MINOR < 4100 if (DB_INCOMPLETE == rval) { checkpoint_debug_message(debug_checkpointing, - "checkpoint_threadmain - Retrying checkpoint\n", 0, 0, 0); + "checkpoint_threadmain - Retrying checkpoint\n"); } else #endif { checkpoint_debug_message(debug_checkpointing, - "checkpoint_threadmain - Checkpoint Done\n", 0, 0, 0); + "checkpoint_threadmain - Checkpoint Done\n"); if (rval != 0) { /* bad error */ - LDAPDebug(LDAP_DEBUG_CRIT, - "checkpoint_threadmain - Serious Error---Failed to checkpoint database, " - "err=%d (%s)\n", rval, dblayer_strerror(rval), 0); + slapi_log_err(SLAPI_LOG_CRIT, + "checkpoint_threadmain", "Serious Error---Failed to checkpoint database, " + "err=%d (%s)\n", rval, dblayer_strerror(rval)); if (LDBM_OS_ERR_IS_DISKFULL(rval)) { operation_out_of_disk_space(); goto error_return; @@ -4609,30 +4587,30 @@ static int checkpoint_threadmain(void *param) if (!db || rc ) { continue; } - LDAPDebug1Arg(LDAP_DEBUG_BACKLDBM, "checkpoint_threadmain - Compacting DB start: %s\n", + slapi_log_err(SLAPI_LOG_BACKLDBM, "checkpoint_threadmain", "Compacting DB start: %s\n", inst->inst_name); rc = dblayer_txn_begin(inst->inst_be, NULL, &txn); if (rc) { - LDAPDebug1Arg(LDAP_DEBUG_ERR, "checkpoint_threadmain - compactdb: transaction begin failed: %d\n", rc); + slapi_log_err(SLAPI_LOG_ERR, "checkpoint_threadmain", "compactdb: transaction begin failed: %d\n", rc); break; } rc = db->compact(db, txn.back_txn_txn, NULL/*start*/, NULL/*stop*/, &c_data, DB_FREE_SPACE, NULL/*end*/); if (rc) { - LDAPDebug(LDAP_DEBUG_ERR, + slapi_log_err(SLAPI_LOG_ERR, "compactdb: failed to compact %s; db error - %d %s\n", inst->inst_name, rc, db_strerror(rc)); if((rc = dblayer_txn_abort(inst->inst_be, &txn))){ - LDAPDebug(LDAP_DEBUG_ERR, "checkpoint_threadmain - compactdb: failed to abort txn (%s) db error - %d %s\n", + slapi_log_err(SLAPI_LOG_ERR, "checkpoint_threadmain", "compactdb: failed to abort txn (%s) db error - %d %s\n", inst->inst_name, rc, db_strerror(rc)); break; } } else { - LDAPDebug2Args(LDAP_DEBUG_BACKLDBM, + slapi_log_err(SLAPI_LOG_BACKLDBM, "compactdb: compact %s - %d pages freed\n", inst->inst_name, c_data.compact_pages_free); if((rc = dblayer_txn_commit(inst->inst_be, &txn))){ - LDAPDebug(LDAP_DEBUG_ERR, "checkpoint_threadmain - compactdb: failed to commit txn (%s) db error - %d %s\n", + slapi_log_err(SLAPI_LOG_ERR, "checkpoint_threadmain", "compactdb: failed to commit txn (%s) db error - %d %s\n", inst->inst_name, rc, db_strerror(rc)); break; } @@ -4647,24 +4625,24 @@ static int checkpoint_threadmain(void *param) DB_ARCH_ABS, (void *)slapi_ch_malloc); DB_CHECKPOINT_UNLOCK(PR_TRUE, penv->dblayer_env_lock); if (rval) { - LDAPDebug2Args(LDAP_DEBUG_ERR, "checkpoint_threadmain - " + slapi_log_err(SLAPI_LOG_ERR, "checkpoint_threadmain", "log archive failed - %s (%d)\n", dblayer_strerror(rval), rval); } else { for (listp = list; listp && *listp != NULL; ++listp) { if (priv->dblayer_circular_logging) { checkpoint_debug_message(debug_checkpointing, - "Deleting %s\n", *listp, 0, 0); + "Deleting %s\n", *listp); unlink(*listp); } else { char new_filename[MAXPATHLEN]; PR_snprintf(new_filename, sizeof(new_filename), "%s.old", *listp); checkpoint_debug_message(debug_checkpointing, - "Renaming %s -> %s\n",*listp, new_filename, 0); + "Renaming %s -> %s\n",*listp, new_filename); if(rename(*listp, new_filename) != 0){ - LDAPDebug(LDAP_DEBUG_ERR, "checkpoint_threadmain - Failed to rename log (%s) to (%s)\n", - *listp, new_filename, 0); + slapi_log_err(SLAPI_LOG_ERR, "checkpoint_threadmain", "Failed to rename log (%s) to (%s)\n", + *listp, new_filename); rval = -1; goto error_return; } @@ -4675,12 +4653,12 @@ static int checkpoint_threadmain(void *param) * individually freed. */ } } - LDAPDebug0Args(LDAP_DEBUG_TRACE, "checkpoint_threadmain - Check point before leaving\n"); + slapi_log_err(SLAPI_LOG_TRACE, "checkpoint_threadmain", "Check point before leaving\n"); rval = dblayer_force_checkpoint(li); error_return: DECR_THREAD_COUNT(priv); - LDAPDebug0Args(LDAP_DEBUG_TRACE, "checkpoint_threadmain - Leaving checkpoint_threadmain\n"); + slapi_log_err(SLAPI_LOG_TRACE, "checkpoint_threadmain", "Leaving checkpoint_threadmain\n"); return rval; } @@ -4703,10 +4681,10 @@ dblayer_start_trickle_thread(struct ldbminfo *li) SLAPD_DEFAULT_THREAD_STACKSIZE) ) { PRErrorCode prerr = PR_GetError(); - LDAPDebug(LDAP_DEBUG_ERR, "dblayer_start_trickle_thread - " + slapi_log_err(SLAPI_LOG_ERR, "dblayer_start_trickle_thread", "Failed to create database trickle thread, " SLAPI_COMPONENT_NAME_NSPR " error %d (%s)\n", - prerr, slapd_pr_strerror(prerr), 0); + prerr, slapd_pr_strerror(prerr)); return_value = -1; } return return_value; @@ -4743,18 +4721,20 @@ static int trickle_threadmain(void *param) priv->dblayer_trickle_percentage, &pages_written)) != 0) { - LDAPDebug(LDAP_DEBUG_ERR,"trickle_threadmain - Serious Error---Failed to trickle, err=%d (%s)\n",rval,dblayer_strerror(rval), 0); + slapi_log_err(SLAPI_LOG_ERR,"trickle_threadmain", "Serious Error---Failed to trickle, err=%d (%s)\n", + rval,dblayer_strerror(rval)); } if (pages_written > 0) { - checkpoint_debug_message(debug_checkpointing,"trickle_threadmain - Trickle thread wrote %d pages\n",pages_written,0, 0); + checkpoint_debug_message(debug_checkpointing,"trickle_threadmain - Trickle thread wrote %d pages\n", + pages_written); } } } } DECR_THREAD_COUNT(priv); - LDAPDebug(LDAP_DEBUG_TRACE, "trickle_threadmain - Leaving trickle_threadmain priv\n", 0, 0, 0); + slapi_log_err(SLAPI_LOG_TRACE, "trickle_threadmain", "Leaving trickle_threadmain priv\n"); return 0; } @@ -4994,7 +4974,7 @@ static int commit_good_database(dblayer_private *priv) priv->dblayer_file_mode ); if (NULL == prfd) { - LDAPDebug(LDAP_DEBUG_CRIT,"commit_good_database - Failed to write guardian file %s, database corruption possible" SLAPI_COMPONENT_NAME_NSPR " %d (%s)\n", + slapi_log_err(SLAPI_LOG_CRIT,"commit_good_database", "Failed to write guardian file %s, database corruption possible" SLAPI_COMPONENT_NAME_NSPR " %d (%s)\n", filename, PR_GetError(), slapd_pr_strerror(PR_GetError()) ); return -1; } @@ -5012,8 +4992,8 @@ static int commit_good_database(dblayer_private *priv) return 0; } else { - LDAPDebug(LDAP_DEBUG_CRIT,"commit_good_database - " - "Failed to write guardian file, database corruption possible\n", 0,0, 0 ); + slapi_log_err(SLAPI_LOG_CRIT,"commit_good_database", + "Failed to write guardian file, database corruption possible\n"); (void)PR_Delete(filename); return -1; } @@ -5078,8 +5058,9 @@ static int read_metadata(struct ldbminfo *li) so we should check for condition 3. */ if (!dbversion_exists(li, home_dir)) { - LDAPDebug(LDAP_DEBUG_EMERG,"read_metadata - " - "Database is corrupt. Server can't start. Most likely cause is a previously aborted import. Either re-import or delete the database and re-start the server.\n", 0,0, 0 ); + slapi_log_err(SLAPI_LOG_EMERG,"read_metadata", + "Database is corrupt. Server can't start. Most likely cause is a previously aborted import. " + "Either re-import or delete the database and re-start the server.\n"); return -1; } else { priv->dblayer_recovery_required = 1; @@ -5132,9 +5113,9 @@ static int read_metadata(struct ldbminfo *li) (void)PR_Close(prfd); return_value = PR_Delete(filename); /* very important that this happen ! */ if (PR_SUCCESS != return_value) { - LDAPDebug(LDAP_DEBUG_CRIT, - "read_metadata - Failed to delete guardian file, " - "database corruption possible\n", 0, 0, 0 ); + slapi_log_err(SLAPI_LOG_CRIT, + "read_metadata", "Failed to delete guardian file, " + "database corruption possible\n"); } return return_value; } @@ -5155,7 +5136,7 @@ static int dblayer_force_checkpoint(struct ldbminfo *li) if (priv->dblayer_enable_transactions) { - LDAPDebug(LDAP_DEBUG_TRACE, "dblayer_force_checkpoint - Checkpointing database ...\n", 0, 0, 0); + slapi_log_err(SLAPI_LOG_TRACE, "dblayer_force_checkpoint", "Checkpointing database ...\n"); /* * DB workaround. Newly created environments do not know what the @@ -5171,22 +5152,22 @@ static int dblayer_force_checkpoint(struct ldbminfo *li) if (ret != DB_INCOMPLETE) #endif { - LDAPDebug(LDAP_DEBUG_ERR, "dblayer_force_checkpoint - Checkpoint FAILED, error %s (%d)\n", - dblayer_strerror(ret), ret, 0); + slapi_log_err(SLAPI_LOG_ERR, "dblayer_force_checkpoint", "Checkpoint FAILED, error %s (%d)\n", + dblayer_strerror(ret), ret); break; } #if 1000*DB_VERSION_MAJOR + 100*DB_VERSION_MINOR < 4100 - LDAPDebug(LDAP_DEBUG_NOTICE, "dblayer_force_checkpoint - Busy: retrying checkpoint\n", 0, 0, 0); + slapi_log_err(SLAPI_LOG_NOTICE, "dblayer_force_checkpoint", "Busy: retrying checkpoint\n"); /* teletubbies: "again! again!" */ ret = dblayer_txn_checkpoint(li, pEnv, PR_TRUE, PR_FALSE, PR_TRUE); if (ret == DB_INCOMPLETE) { - LDAPDebug(LDAP_DEBUG_NOTICE, "dblayer_force_checkpoint - Busy: giving up on checkpoint\n", 0, 0, 0); + slapi_log_err(SLAPI_LOG_NOTICE, "dblayer_force_checkpoint", "Busy: giving up on checkpoint\n"); break; } else if (ret != 0) { - LDAPDebug(LDAP_DEBUG_ERR, "Cdblayer_force_checkpoint - heckpoint FAILED, error %s (%d)\n", - dblayer_strerror(ret), ret, 0); + slapi_log_err(SLAPI_LOG_ERR, "Cdblayer_force_checkpoint", "Checkpoint FAILED, error %s (%d)\n", + dblayer_strerror(ret), ret); break; } #endif @@ -5207,9 +5188,9 @@ _dblayer_delete_aux_dir(struct ldbminfo *li, char *path) int rc = -1; if (NULL == li || NULL == path) { - LDAPDebug2Args(LDAP_DEBUG_ERR, - "_dblayer_delete_aux_dir - Invalid LDBM info (0x%x) " - "or path (0x%x)\n", li, path); + slapi_log_err(SLAPI_LOG_ERR, + "_dblayer_delete_aux_dir", "Invalid LDBM info (0x%p) " + "or path (0x%p)\n", li, path); return rc; } priv = (dblayer_private*)li->li_dblayer_private; @@ -5258,8 +5239,8 @@ static int _dblayer_delete_instance_dir(ldbm_instance *inst, int startdb) if (NULL == li) { - LDAPDebug0Args(LDAP_DEBUG_ERR, - "_dblayer_delete_instance_dir - NULL LDBM info\n"); + slapi_log_err(SLAPI_LOG_ERR, + "_dblayer_delete_instance_dir", "NULL LDBM info\n"); rval = -1; goto done; } @@ -5270,8 +5251,8 @@ static int _dblayer_delete_instance_dir(ldbm_instance *inst, int startdb) rval = dblayer_start(li, DBLAYER_NORMAL_MODE|DBLAYER_NO_DBTHREADS_MODE); if (rval) { - LDAPDebug(LDAP_DEBUG_ERR, "_dblayer_delete_instance_dir - dblayer_start failed! %s (%d)\n", - dblayer_strerror(rval), rval, 0); + slapi_log_err(SLAPI_LOG_ERR, "_dblayer_delete_instance_dir", "dblayer_start failed! %s (%d)\n", + dblayer_strerror(rval), rval); goto done; } } @@ -5296,11 +5277,11 @@ static int _dblayer_delete_instance_dir(ldbm_instance *inst, int startdb) goto done; } if (inst_dirp && *inst_dirp) { - LDAPDebug(LDAP_DEBUG_ERR, - "_dblayer_delete_instance_dir - inst_dir is NULL\n", 0, 0, 0); + slapi_log_err(SLAPI_LOG_ERR, + "_dblayer_delete_instance_dir", "inst_dir is NULL\n"); } else { - LDAPDebug(LDAP_DEBUG_ERR, - "_dblayer_delete_instance_dir - PR_OpenDir(%s) failed (%d): %s\n", + slapi_log_err(SLAPI_LOG_ERR, + "_dblayer_delete_instance_dir", "PR_OpenDir(%s) failed (%d): %s\n", inst_dirp, PR_GetError(),slapd_pr_strerror(PR_GetError())); } rval = -1; @@ -5344,8 +5325,8 @@ static int _dblayer_delete_instance_dir(ldbm_instance *inst, int startdb) rval = dblayer_close(li, DBLAYER_NORMAL_MODE); if (rval) { - LDAPDebug(LDAP_DEBUG_ERR, "_dblayer_delete_instance_dir - dblayer_close failed! %s (%d)\n", - dblayer_strerror(rval), rval, 0); + slapi_log_err(SLAPI_LOG_ERR, "_dblayer_delete_instance_dir", "dblayer_close failed! %s (%d)\n", + dblayer_strerror(rval), rval); } } done: @@ -5404,8 +5385,8 @@ dblayer_delete_database_ex(struct ldbminfo *li, char *instance, char *cldir) if (inst->inst_be->be_instance_info != NULL) { if ((NULL != instance) && (strcasecmp(inst->inst_name,instance) != 0)) { - LDAPDebug(LDAP_DEBUG_NOTICE, - "dblayer_delete_database_ex - skipping instance %s\n",inst->inst_name , 0, 0); + slapi_log_err(SLAPI_LOG_NOTICE, + "dblayer_delete_database_ex", "Skipping instance %s\n",inst->inst_name ); } else { if (NULL == instance) @@ -5416,8 +5397,8 @@ dblayer_delete_database_ex(struct ldbminfo *li, char *instance, char *cldir) } if (ret != 0) { - LDAPDebug(LDAP_DEBUG_ERR, - "dblayer_delete_database_ex - Failed (%d)\n", ret, 0, 0); + slapi_log_err(SLAPI_LOG_ERR, + "dblayer_delete_database_ex", "Failed (%d)\n", ret); return ret; } } @@ -5428,9 +5409,9 @@ dblayer_delete_database_ex(struct ldbminfo *li, char *instance, char *cldir) if (cldir) { ret = _dblayer_delete_aux_dir(li, cldir); if (ret) { - LDAPDebug1Arg(LDAP_DEBUG_ERR, - "dblayer_delete_database_ex - Failed to delete \"%s\"\n", - chdir); + slapi_log_err(SLAPI_LOG_ERR, + "dblayer_delete_database_ex", "Failed to delete \"%s\"\n", + cldir); return ret; } } @@ -5439,7 +5420,7 @@ dblayer_delete_database_ex(struct ldbminfo *li, char *instance, char *cldir) dirhandle = PR_OpenDir(priv->dblayer_home_directory); if (! dirhandle) { - LDAPDebug(LDAP_DEBUG_ERR, "dblayer_delete_database_ex - PR_OpenDir (%s) failed (%d): %s\n", + slapi_log_err(SLAPI_LOG_ERR, "dblayer_delete_database_ex", "PR_OpenDir (%s) failed (%d): %s\n", priv->dblayer_home_directory, PR_GetError(),slapd_pr_strerror(PR_GetError())); return -1; @@ -5483,9 +5464,8 @@ dblayer_delete_database_ex(struct ldbminfo *li, char *instance, char *cldir) { ret = dblayer_delete_transaction_logs(log_dir); if(ret) { - LDAPDebug(LDAP_DEBUG_ERR, - "dblayer_delete_database_ex - dblayer_delete_transaction_logs failed (%d)\n", - ret, 0, 0); + slapi_log_err(SLAPI_LOG_ERR, + "dblayer_delete_database_ex", "dblayer_delete_transaction_logs failed (%d)\n",ret); return -1; } } @@ -5658,7 +5638,7 @@ dblayer_copyfile(char *source, char *destination, int overwrite, int mode) source_fd = OPEN_FUNCTION(source,O_RDONLY,0); if (-1 == source_fd) { - LDAPDebug2Args(LDAP_DEBUG_ERR, "dblayer_copyfile - Failed to open source file %s by \"%s\"\n", + slapi_log_err(SLAPI_LOG_ERR, "dblayer_copyfile", "Failed to open source file %s by \"%s\"\n", source, strerror(errno)); goto error; } @@ -5666,12 +5646,12 @@ dblayer_copyfile(char *source, char *destination, int overwrite, int mode) dest_fd = OPEN_FUNCTION(destination,O_CREAT | O_WRONLY, mode); if (-1 == dest_fd) { - LDAPDebug2Args(LDAP_DEBUG_ERR, "dblayer_copyfile - Failed to open dest file %s by \"%s\"\n", + slapi_log_err(SLAPI_LOG_ERR, "dblayer_copyfile", "Failed to open dest file %s by \"%s\"\n", destination, strerror(errno)); goto error; } - LDAPDebug2Args(LDAP_DEBUG_BACKLDBM, - "dblayer_copyfile - Copying %s to %s\n", source, destination); + slapi_log_err(SLAPI_LOG_BACKLDBM, + "dblayer_copyfile", "Copying %s to %s\n", source, destination); /* Loop round reading data and writing it */ while (1) { @@ -5681,7 +5661,7 @@ dblayer_copyfile(char *source, char *destination, int overwrite, int mode) if (return_value <= 0) { /* means error or EOF */ if (return_value < 0) { - LDAPDebug2Args(LDAP_DEBUG_ERR, "dblayer_copyfile - Failed to read by \"%s\": rval = %d\n", + slapi_log_err(SLAPI_LOG_ERR, "dblayer_copyfile", "Failed to read by \"%s\": rval = %d\n", strerror(errno), return_value); } break; @@ -5695,12 +5675,12 @@ dblayer_copyfile(char *source, char *destination, int overwrite, int mode) break; } else { /* means error */ - LDAPDebug(LDAP_DEBUG_ERR, "dblayer_copyfile - Failed to write by \"%s\"; real: %d bytes, exp: %d bytes\n", + slapi_log_err(SLAPI_LOG_ERR, "dblayer_copyfile", "Failed to write by \"%s\"; real: %d bytes, exp: %d bytes\n", strerror(errno), return_value, bytes_to_write); if (return_value > 0) { bytes_to_write -= return_value; ptr += return_value; - LDAPDebug1Arg(LDAP_DEBUG_NOTICE, "dblayer_copyfile - Retrying to write %d bytes\n", bytes_to_write); + slapi_log_err(SLAPI_LOG_NOTICE, "dblayer_copyfile", "Retrying to write %d bytes\n", bytes_to_write); } else { break; } @@ -5770,14 +5750,14 @@ dblayer_copy_directory(struct ldbminfo *li, if (!src_dir || '\0' == *src_dir) { - LDAPDebug0Args(LDAP_DEBUG_ERR, - "dblayer_copy_directory - src_dir is empty\n"); + slapi_log_err(SLAPI_LOG_ERR, + "dblayer_copy_directory", "src_dir is empty\n"); return return_value; } if (!dest_dir || '\0' == *dest_dir) { - LDAPDebug0Args(LDAP_DEBUG_ERR, - "dblayer_copy_directory - dest_dir is empty\n"); + slapi_log_err(SLAPI_LOG_ERR, + "dblayer_copy_directory", "dest_dir is empty\n"); return return_value; } @@ -5795,16 +5775,16 @@ dblayer_copy_directory(struct ldbminfo *li, } if (is_changelog) { if (!src_is_fullpath) { - LDAPDebug1Arg(LDAP_DEBUG_ERR, "dblayer_copy_directory - Changelogdir \"%s\" is not full path; " + slapi_log_err(SLAPI_LOG_ERR, "dblayer_copy_directory", "Changelogdir \"%s\" is not full path; " "Skipping it.\n", src_dir); return 0; } } else { inst = ldbm_instance_find_by_name(li, relative_instance_name); if (NULL == inst) { - LDAPDebug(LDAP_DEBUG_ERR, "dblayer_copy_directory - Backend instance \"%s\" does not exist; " + slapi_log_err(SLAPI_LOG_ERR, "dblayer_copy_directory", "Backend instance \"%s\" does not exist; " "Instance path %s could be invalid.\n", - relative_instance_name, src_dir, 0); + relative_instance_name, src_dir); return return_value; } } @@ -5818,7 +5798,7 @@ dblayer_copy_directory(struct ldbminfo *li, inst_dir, MAXPATHLEN); if (!inst_dirp || !*inst_dirp) { - LDAPDebug(LDAP_DEBUG_ERR, "dblayer_copy_directory - Instance dir is NULL.\n", 0, 0, 0); + slapi_log_err(SLAPI_LOG_ERR, "dblayer_copy_directory", "Instance dir is NULL.\n"); return return_value; } len = strlen(inst_dirp); @@ -5831,8 +5811,8 @@ dblayer_copy_directory(struct ldbminfo *li, dirhandle = PR_OpenDir(new_src_dir); if (NULL == dirhandle) { - LDAPDebug1Arg(LDAP_DEBUG_ERR, - "dblayer_copy_directory - Failed to open dir %s\n", + slapi_log_err(SLAPI_LOG_ERR, + "dblayer_copy_directory", "Failed to open dir %s\n", new_src_dir); return return_value; @@ -5891,7 +5871,7 @@ dblayer_copy_directory(struct ldbminfo *li, } if (mkdir_p(new_dest_dir, 0700) != PR_SUCCESS) { - LDAPDebug(LDAP_DEBUG_ERR, "dblayer_copy_directory - Can't create new directory %s, " + slapi_log_err(SLAPI_LOG_ERR, "dblayer_copy_directory", "Can't create new directory %s, " SLAPI_COMPONENT_NAME_NSPR " error %d (%s)\n", new_dest_dir, PR_GetError(), slapd_pr_strerror(PR_GetError())); @@ -5903,8 +5883,8 @@ dblayer_copy_directory(struct ldbminfo *li, filename2 = slapi_ch_smprintf("%s/%s", new_dest_dir, direntry->name); if (restore) { - LDAPDebug(LDAP_DEBUG_INFO, "dblayer_copy_directory - Restoring file %d (%s)\n", - *cnt, filename2, 0); + slapi_log_err(SLAPI_LOG_INFO, "dblayer_copy_directory", "Restoring file %d (%s)\n", + *cnt, filename2); if (task) { slapi_task_log_notice(task, "Restoring file %d (%s)", *cnt, filename2); @@ -5912,8 +5892,8 @@ dblayer_copy_directory(struct ldbminfo *li, "Restoring file %d (%s)", *cnt, filename2); } } else { - LDAPDebug(LDAP_DEBUG_INFO, "dblayer_copy_directory - Backing up file %d (%s)\n", - *cnt, filename2, 0); + slapi_log_err(SLAPI_LOG_INFO, "dblayer_copy_directory", "Backing up file %d (%s)\n", + *cnt, filename2); if (task) { slapi_task_log_notice(task, "Backing up file %d (%s)", *cnt, filename2); @@ -5934,7 +5914,7 @@ dblayer_copy_directory(struct ldbminfo *li, 0, priv->dblayer_file_mode); } if (return_value < 0) { - LDAPDebug2Args(LDAP_DEBUG_ERR, "dblayer_copy_directory - Failed to copy file %s to %s\n", + slapi_log_err(SLAPI_LOG_ERR, "dblayer_copy_directory", "Failed to copy file %s to %s\n", filename1, filename2); slapi_ch_free((void**)&filename1); slapi_ch_free((void**)&filename2); @@ -5973,9 +5953,9 @@ _dblayer_get_changelogdir(struct ldbminfo *li, char **changelogdir) int rc = -1; if (NULL == li || NULL == changelogdir) { - LDAPDebug2Args(LDAP_DEBUG_ERR, - "_dblayer_get_changelogdir - Invalid arg: " - "li: 0x%x, changelogdir: 0x%x\n", li, changelogdir); + slapi_log_err(SLAPI_LOG_ERR, + "_dblayer_get_changelogdir", "Invalid arg: " + "li: 0x%p, changelogdir: 0x%p\n", li, changelogdir); return rc; } *changelogdir = NULL; @@ -5995,8 +5975,8 @@ _dblayer_get_changelogdir(struct ldbminfo *li, char **changelogdir) goto bail; } if (LDAP_SUCCESS != rc) { - LDAPDebug1Arg(LDAP_DEBUG_ERR, - "_dblayer_get_changelogdir - Failed to search \"%s\"\n", CHANGELOGENTRY); + slapi_log_err(SLAPI_LOG_ERR, + "_dblayer_get_changelogdir", "Failed to search \"%s\"\n", CHANGELOGENTRY); goto bail; } /* rc == LDAP_SUCCESS */ @@ -6056,8 +6036,8 @@ dblayer_backup(struct ldbminfo *li, char *dest_dir, Slapi_Task *task) home_dir = dblayer_get_home_dir(li, NULL); if (NULL == home_dir || '\0' == *home_dir) { - LDAPDebug0Args(LDAP_DEBUG_ERR, - "dblayer_backup - Missing db home directory info\n"); + slapi_log_err(SLAPI_LOG_ERR, + "dblayer_backup", "Missing db home directory info\n"); return return_value; } @@ -6094,13 +6074,13 @@ dblayer_backup(struct ldbminfo *li, char *dest_dir, Slapi_Task *task) dblayer_txn_init(li,&txn); return_value = dblayer_txn_begin_all(li, NULL, &txn); if (return_value) { - LDAPDebug0Args(LDAP_DEBUG_ERR, - "dblayer_backup - Transaction error\n"); + slapi_log_err(SLAPI_LOG_ERR, + "dblayer_backup", "Transaction error\n"); return return_value; } if ( g_get_shutdown() || c_get_shutdown() ) { - LDAPDebug0Args(LDAP_DEBUG_WARNING, "dblayer_backup - Server shutting down, backup aborted\n"); + slapi_log_err(SLAPI_LOG_WARNING, "dblayer_backup", "Server shutting down, backup aborted\n"); return_value = -1; goto bail; } @@ -6112,8 +6092,8 @@ dblayer_backup(struct ldbminfo *li, char *dest_dir, Slapi_Task *task) return_value = LOG_ARCHIVE(priv->dblayer_env->dblayer_DB_ENV, &listA, DB_ARCH_LOG, (void *)slapi_ch_malloc); if (return_value || (listA == NULL)) { - LDAPDebug0Args(LDAP_DEBUG_ERR, - "dblayer_backup - Log archive error\n"); + slapi_log_err(SLAPI_LOG_ERR, + "dblayer_backup", "Log archive error\n"); if (task) { slapi_task_log_notice(task, "Backup: log archive error\n"); } @@ -6124,7 +6104,7 @@ dblayer_backup(struct ldbminfo *li, char *dest_dir, Slapi_Task *task) ok=1; } if ( g_get_shutdown() || c_get_shutdown() ) { - LDAPDebug0Args(LDAP_DEBUG_ERR, "dblayer_backup - Server shutting down, backup aborted\n"); + slapi_log_err(SLAPI_LOG_ERR, "dblayer_backup", "Server shutting down, backup aborted\n"); return_value = -1; goto bail; } @@ -6136,8 +6116,8 @@ dblayer_backup(struct ldbminfo *li, char *dest_dir, Slapi_Task *task) inst_dirp = dblayer_get_full_inst_dir(inst->inst_li, inst, inst_dir, MAXPATHLEN); if ((NULL == inst_dirp) || ('\0' == *inst_dirp)) { - LDAPDebug0Args(LDAP_DEBUG_ERR, - "dblayer_backup - Instance dir is empty\n"); + slapi_log_err(SLAPI_LOG_ERR, + "dblayer_backup", "Instance dir is empty\n"); if (task) { slapi_task_log_notice(task, "Backup: Instance dir is empty\n"); @@ -6149,8 +6129,8 @@ dblayer_backup(struct ldbminfo *li, char *dest_dir, Slapi_Task *task) dest_dir, 0 /* backup */, &cnt, 0, 0, 0); if (return_value) { - LDAPDebug(LDAP_DEBUG_ERR, - "dblayer_backup - Error in copying directory " + slapi_log_err(SLAPI_LOG_ERR, + "dblayer_backup", "Error in copying directory " "(%s -> %s): err=%d\n", inst_dirp, dest_dir, return_value); if (task) { @@ -6175,10 +6155,10 @@ dblayer_backup(struct ldbminfo *li, char *dest_dir, Slapi_Task *task) return_value = dblayer_copy_directory(li, task, changelogdir, changelog_destdir, 0 /* backup */, - &cnt, 0, 0, 1); + &cnt, 1, 0, 0); if (return_value) { - LDAPDebug(LDAP_DEBUG_ERR, - "dblayer_backup - Error in copying directory " + slapi_log_err(SLAPI_LOG_ERR, + "dblayer_backup", "Error in copying directory " "(%s -> %s): err=%d\n", changelogdir, changelog_destdir, return_value); if (task) { @@ -6200,7 +6180,7 @@ dblayer_backup(struct ldbminfo *li, char *dest_dir, Slapi_Task *task) slapi_ch_free_string(&pathname2); slapi_ch_free_string(&changelog_destdir); if (0 > return_value) { - LDAPDebug1Arg(LDAP_DEBUG_ERR, "dblayer_backup - Failed to copy file %s\n", pathname1); + slapi_log_err(SLAPI_LOG_ERR, "dblayer_backup", "Failed to copy file %s\n", pathname1); slapi_ch_free_string(&pathname1); goto bail; } @@ -6211,8 +6191,8 @@ dblayer_backup(struct ldbminfo *li, char *dest_dir, Slapi_Task *task) return_value = LOG_ARCHIVE(priv->dblayer_env->dblayer_DB_ENV, &listB, DB_ARCH_LOG, (void *)slapi_ch_malloc); if (return_value || (listB == NULL)) { - LDAPDebug0Args(LDAP_DEBUG_ERR, - "dblayer_backup - Can't get list of logs\n"); + slapi_log_err(SLAPI_LOG_ERR, + "dblayer_backup", "Can't get list of logs\n"); goto bail; } @@ -6228,8 +6208,8 @@ dblayer_backup(struct ldbminfo *li, char *dest_dir, Slapi_Task *task) } if (! found) { ok = 0; /* missing log: start over */ - LDAPDebug1Arg(LDAP_DEBUG_WARNING, - "dblayer_backup - Log %s has been swiped " + slapi_log_err(SLAPI_LOG_WARNING, + "dblayer_backup", "Log %s has been swiped " "out from under me! (retrying)\n", *listi); if (task) { slapi_task_log_notice(task, @@ -6240,7 +6220,7 @@ dblayer_backup(struct ldbminfo *li, char *dest_dir, Slapi_Task *task) } if ( g_get_shutdown() || c_get_shutdown() ) { - LDAPDebug0Args(LDAP_DEBUG_ERR, "dblayer_backup - Server shutting down, backup aborted\n"); + slapi_log_err(SLAPI_LOG_ERR, "dblayer_backup", "Server shutting down, backup aborted\n"); return_value = -1; goto bail; } @@ -6265,7 +6245,7 @@ dblayer_backup(struct ldbminfo *li, char *dest_dir, Slapi_Task *task) for (listptr = listB; listptr && *listptr && ok; ++listptr) { PR_snprintf(pathname1, p1len, "%s/%s", prefix, *listptr); PR_snprintf(pathname2, p2len, "%s/%s", dest_dir, *listptr); - LDAPDebug2Args(LDAP_DEBUG_INFO, "dblayer_backup - Backing up file %d (%s)\n", + slapi_log_err(SLAPI_LOG_INFO, "dblayer_backup", "Backing up file %d (%s)\n", cnt, pathname2); if (task) { @@ -6277,7 +6257,7 @@ dblayer_backup(struct ldbminfo *li, char *dest_dir, Slapi_Task *task) return_value = dblayer_copyfile(pathname1, pathname2, 0, priv->dblayer_file_mode); if (0 > return_value) { - LDAPDebug2Args(LDAP_DEBUG_ERR, "dblayer_backup - Error in copying file '%s' (err=%d)\n", + slapi_log_err(SLAPI_LOG_ERR, "dblayer_backup", "Error in copying file '%s' (err=%d)\n", pathname1, return_value); if (task) { slapi_task_log_notice(task, "Error copying file '%s' (err=%d)", @@ -6288,7 +6268,7 @@ dblayer_backup(struct ldbminfo *li, char *dest_dir, Slapi_Task *task) goto bail; } if ( g_get_shutdown() || c_get_shutdown() ) { - LDAPDebug0Args(LDAP_DEBUG_ERR, "dblayer_backup - Server shutting down, backup aborted\n"); + slapi_log_err(SLAPI_LOG_ERR, "dblayer_backup", "Server shutting down, backup aborted\n"); return_value = -1; slapi_ch_free((void **)&pathname1); slapi_ch_free((void **)&pathname2); @@ -6308,15 +6288,15 @@ dblayer_backup(struct ldbminfo *li, char *dest_dir, Slapi_Task *task) /* now copy the version file */ pathname1 = slapi_ch_smprintf("%s/%s", home_dir, DBVERSION_FILENAME); pathname2 = slapi_ch_smprintf("%s/%s", dest_dir, DBVERSION_FILENAME); - LDAPDebug2Args(LDAP_DEBUG_INFO, "dblayer_backup - Backing up file %d (%s)\n", cnt, pathname2); + slapi_log_err(SLAPI_LOG_INFO, "dblayer_backup", "Backing up file %d (%s)\n", cnt, pathname2); if (task) { slapi_task_log_notice(task, "Backing up file %d (%s)", cnt, pathname2); slapi_task_log_status(task, "Backing up file %d (%s)", cnt, pathname2); } return_value = dblayer_copyfile(pathname1, pathname2, 0, priv->dblayer_file_mode); if (0 > return_value) { - LDAPDebug(LDAP_DEBUG_ERR, - "dblayer_backup - Error in copying version file " + slapi_log_err(SLAPI_LOG_ERR, + "dblayer_backup", "Error in copying version file " "(%s -> %s): err=%d\n", pathname1, pathname2, return_value); if (task) { @@ -6395,8 +6375,8 @@ int dblayer_delete_transaction_logs(const char * log_dir) { if (NULL == direntry->name) { /* NSPR doesn't behave like the docs say it should */ - LDAPDebug(LDAP_DEBUG_ERR, "dblayer_delete_transaction_logs - PR_ReadDir failed (%d): %s\n", - PR_GetError(),slapd_pr_strerror(PR_GetError()), 0); + slapi_log_err(SLAPI_LOG_ERR, "dblayer_delete_transaction_logs", "PR_ReadDir failed (%d): %s\n", + PR_GetError(),slapd_pr_strerror(PR_GetError())); break; } PR_snprintf(filename1, MAXPATHLEN, "%s/%s", log_dir, direntry->name); @@ -6407,8 +6387,8 @@ int dblayer_delete_transaction_logs(const char * log_dir) is_a_logfile = dblayer_is_logfilename(direntry->name); if (is_a_logfile && (NULL != log_dir) && (0 != strlen(log_dir)) ) { - LDAPDebug(LDAP_DEBUG_INFO, "dblayer_delete_transaction_logs - Deleting log file: (%s)\n", - filename1, 0, 0); + slapi_log_err(SLAPI_LOG_INFO, "dblayer_delete_transaction_logs", "Deleting log file: (%s)\n", + filename1); unlink(filename1); } } @@ -6416,8 +6396,8 @@ int dblayer_delete_transaction_logs(const char * log_dir) } else if (PR_FILE_NOT_FOUND_ERROR != PR_GetError()) { - LDAPDebug(LDAP_DEBUG_ERR, - "dblayer_delete_transaction_logs - PR_OpenDir(%s) failed (%d): %s\n", + slapi_log_err(SLAPI_LOG_ERR, + "dblayer_delete_transaction_logs", "PR_OpenDir(%s) failed (%d): %s\n", log_dir, PR_GetError(),slapd_pr_strerror(PR_GetError())); rc=1; } @@ -6468,8 +6448,8 @@ static int dblayer_copy_dirand_contents(char* src_dir, char* dst_dir, int mode, PR_snprintf(filename1, MAXPATHLEN, "%s/%s", src_dir, direntry->name); PR_snprintf(filename2, MAXPATHLEN, "%s/%s", dst_dir, direntry->name); - LDAPDebug(LDAP_DEBUG_ERR, "Moving file %s\n", - filename2, 0, 0); + slapi_log_err(SLAPI_LOG_ERR, "dblayer_copy_dirand_contents", "Moving file %s\n", + filename2); /* Is this entry a directory? */ tmp_rval = PR_GetFileInfo64(filename1, &info); if (tmp_rval == PR_SUCCESS && PR_FILE_DIRECTORY == info.type) @@ -6497,7 +6477,7 @@ static int dblayer_copy_dirand_contents(char* src_dir, char* dst_dir, int mode, return_value = dblayer_copyfile(filename1, filename2, 0, mode); } if (0 > return_value) { - LDAPDebug1Arg(LDAP_DEBUG_ERR, "dblayer_copy_dirand_contents - Failed to copy file %s\n", filename1); + slapi_log_err(SLAPI_LOG_ERR, "dblayer_copy_dirand_contents", "Failed to copy file %s\n", filename1); break; } } @@ -6534,8 +6514,8 @@ static int dblayer_fri_trim(char *fri_dir_path, char* bename) { if(strcasecmp(direntry->name,bename)!=0) { - LDAPDebug(LDAP_DEBUG_INFO, "dblayer_fri_trim - Removing file %s from staging area\n", - filename, 0, 0); + slapi_log_err(SLAPI_LOG_INFO, "dblayer_fri_trim", "Removing file %s from staging area\n", + filename); ldbm_delete_dirs(filename); } continue; @@ -6544,8 +6524,8 @@ static int dblayer_fri_trim(char *fri_dir_path, char* bename) if ((strcmp(direntry->name,"DBVERSION") == 0)|| (strncmp(direntry->name,"__",2) == 0)|| (strncmp(direntry->name,"log",3) == 0)){ - LDAPDebug(LDAP_DEBUG_INFO, "dblayer_fri_trim - Removing file %s from staging area\n", - filename, 0, 0); + slapi_log_err(SLAPI_LOG_INFO, "dblayer_fri_trim", "Removing file %s from staging area\n", + filename); PR_Delete(filename); } @@ -6589,18 +6569,18 @@ static int dblayer_fri_restore(char *home_dir, char *src_dir, dblayer_private *p fribak_dir_path = slapi_ch_smprintf("%s/../%s",home_dir,fribak_dir_name); if((-1 == PR_MkDir(fribak_dir_path,NEWDIR_MODE))) { - LDAPDebug(LDAP_DEBUG_INFO, "dblayer_fri_restore - %s exists\n",fribak_dir_path, 0, 0); - LDAPDebug(LDAP_DEBUG_INFO, "dblayer_fri_restore - Removing %s.\n",fribak_dir_path, 0, 0); + slapi_log_err(SLAPI_LOG_INFO, "dblayer_fri_restore", "%s exists\n",fribak_dir_path); + slapi_log_err(SLAPI_LOG_INFO, "dblayer_fri_restore", "Removing %s.\n",fribak_dir_path); retval = ldbm_delete_dirs(fribak_dir_path); if (retval) { - LDAPDebug(LDAP_DEBUG_ERR, "dblayer_fri_restore - Removal of %s failed!\n", fribak_dir_path, 0, 0); + slapi_log_err(SLAPI_LOG_ERR, "dblayer_fri_restore", "Removal of %s failed!\n", fribak_dir_path); goto error; } PR_MkDir(fribak_dir_path,NEWDIR_MODE); if (retval != PR_SUCCESS) { - LDAPDebug(LDAP_DEBUG_ERR, "dblayer_fri_restore - Creation of %s failed!\n", fribak_dir_path, 0, 0); + slapi_log_err(SLAPI_LOG_ERR, "dblayer_fri_restore", "Creation of %s failed!\n", fribak_dir_path); goto error; } } @@ -6609,21 +6589,21 @@ static int dblayer_fri_restore(char *home_dir, char *src_dir, dblayer_private *p retval = dblayer_copy_dirand_contents(src_dir, fribak_dir_path, mode, task); if (retval) { - LDAPDebug(LDAP_DEBUG_ERR, "dblayer_fri_restore - Copy contents to %s failed!\n", fribak_dir_path, 0, 0); + slapi_log_err(SLAPI_LOG_ERR, "dblayer_fri_restore", "Copy contents to %s failed!\n", fribak_dir_path); goto error; } /* Next, run recovery on the files */ retval = dblayer_recover_environment_path(fribak_dir_path, priv); if (retval) { - LDAPDebug(LDAP_DEBUG_ERR, "dblayer_fri_restore - Recovery failed!\n", 0, 0, 0); + slapi_log_err(SLAPI_LOG_ERR, "dblayer_fri_restore", "Recovery failed!\n"); goto error; } /* Files nicely recovered, next we stip out what we don't need from the backup set */ retval = dblayer_fri_trim(fribak_dir_path,bename); if (retval) { - LDAPDebug(LDAP_DEBUG_ERR, "dblayer_fri_restore - Trim failed!\n", 0, 0, 0); + slapi_log_err(SLAPI_LOG_ERR, "dblayer_fri_restore", "Trim failed!\n"); goto error; } *new_src_dir = fribak_dir_path; @@ -6677,8 +6657,8 @@ int dblayer_restore(struct ldbminfo *li, char *src_dir, Slapi_Task *task, char * if (NULL == home_dir || '\0' == *home_dir) { - LDAPDebug0Args(LDAP_DEBUG_ERR, - "Restore: missing db home directory info\n"); + slapi_log_err(SLAPI_LOG_ERR, "dblayer_restore", + "Missing db home directory info\n"); return -1; } @@ -6687,7 +6667,7 @@ int dblayer_restore(struct ldbminfo *li, char *src_dir, Slapi_Task *task, char * /* We check on the source staging area, no point in going further if it * isn't there */ if (stat(src_dir, &sbuf) < 0) { - LDAPDebug1Arg(LDAP_DEBUG_ERR, "dblayer_restore - Backup directory %s does not " + slapi_log_err(SLAPI_LOG_ERR, "dblayer_restore", "Backup directory %s does not " "exist.\n", src_dir); if (task) { slapi_task_log_notice(task, "Restore: backup directory %s does not " @@ -6695,7 +6675,7 @@ int dblayer_restore(struct ldbminfo *li, char *src_dir, Slapi_Task *task, char * } return LDAP_UNWILLING_TO_PERFORM; } else if (!S_ISDIR(sbuf.st_mode)) { - LDAPDebug1Arg(LDAP_DEBUG_ERR, "dblayer_restore - Backup directory %s is not " + slapi_log_err(SLAPI_LOG_ERR, "dblayer_restore", "Backup directory %s is not " "a directory.\n", src_dir); if (task) { slapi_task_log_notice(task, "Restore: backup directory %s is not " @@ -6704,7 +6684,7 @@ int dblayer_restore(struct ldbminfo *li, char *src_dir, Slapi_Task *task, char * return LDAP_UNWILLING_TO_PERFORM; } if (!dbversion_exists(li, src_dir)) { - LDAPDebug1Arg(LDAP_DEBUG_ERR, "dblayer_restore - Backup directory %s does not " + slapi_log_err(SLAPI_LOG_ERR, "dblayer_restore", "Backup directory %s does not " "contain a complete backup\n", src_dir); if (task) { slapi_task_log_notice(task, "Restore: backup directory %s does not " @@ -6744,8 +6724,8 @@ int dblayer_restore(struct ldbminfo *li, char *src_dir, Slapi_Task *task, char * inst = ldbm_instance_find_by_name(li, (char *)direntry->name); if ( inst == NULL) { - LDAPDebug1Arg(LDAP_DEBUG_ERR, - "dblayer_restore - Target server has no %s configured\n", + slapi_log_err(SLAPI_LOG_ERR, + "dblayer_restore", "Target server has no %s configured\n", direntry->name); if (task) { slapi_task_log_notice(task, @@ -6759,8 +6739,8 @@ int dblayer_restore(struct ldbminfo *li, char *src_dir, Slapi_Task *task, char * if (slapd_comp_path(src_dir, inst->inst_parent_dir_name) == 0) { - LDAPDebug2Args(LDAP_DEBUG_ERR, - "dblayer_restore - Backup dir %s and target dir %s " + slapi_log_err(SLAPI_LOG_ERR, + "dblayer_restore", "Backup dir %s and target dir %s " "are identical\n", src_dir, inst->inst_parent_dir_name); if (task) { @@ -6807,8 +6787,8 @@ int dblayer_restore(struct ldbminfo *li, char *src_dir, Slapi_Task *task, char * * rather than to the db dirctory */ dirhandle = PR_OpenDir(real_src_dir); if (NULL == dirhandle) { - LDAPDebug1Arg(LDAP_DEBUG_ERR, - "dblayer_restore- Failed to open the directory \"%s\"\n", real_src_dir); + slapi_log_err(SLAPI_LOG_ERR, + "dblayer_restore", "Failed to open the directory \"%s\"\n", real_src_dir); if (task) { slapi_task_log_notice(task, "Restore: failed to open the directory \"%s\"\n", real_src_dir); @@ -6839,8 +6819,8 @@ int dblayer_restore(struct ldbminfo *li, char *src_dir, Slapi_Task *task, char * char *cldirname = PL_strrchr(changelogdir, '/'); char *p = filename1 + strlen(filename1); if (NULL == cldirname) { - LDAPDebug1Arg(LDAP_DEBUG_ERR, - "dblayer_restore - Broken changelog dir path %s\n", + slapi_log_err(SLAPI_LOG_ERR, + "dblayer_restore", "Broken changelog dir path %s\n", changelogdir); if (task) { slapi_task_log_notice(task, @@ -6855,11 +6835,11 @@ int dblayer_restore(struct ldbminfo *li, char *src_dir, Slapi_Task *task, char * *cldirname = '\0'; return_value = dblayer_copy_directory(li, task, filename1, changelogdir, 1 /* restore */, - &cnt, 0, 0, 1); + &cnt, 1, 0 ,0); *cldirname = '/'; if (return_value) { - LDAPDebug1Arg(LDAP_DEBUG_ERR, - "dblayer_restore - Failed to copy directory %s\n", + slapi_log_err(SLAPI_LOG_ERR, + "dblayer_restore", "Failed to copy directory %s\n", filename1); if (task) { slapi_task_log_notice(task, @@ -6877,7 +6857,7 @@ int dblayer_restore(struct ldbminfo *li, char *src_dir, Slapi_Task *task, char * return_value = dblayer_copyfile(filename1, filename2, 0, priv->dblayer_file_mode); if (0 > return_value) { - LDAPDebug1Arg(LDAP_DEBUG_ERR, "dblayer_restore - Failed to copy file %s\n", filename1); + slapi_log_err(SLAPI_LOG_ERR, "dblayer_restore", "Failed to copy file %s\n", filename1); goto error_out; } } @@ -6895,8 +6875,8 @@ int dblayer_restore(struct ldbminfo *li, char *src_dir, Slapi_Task *task, char * continue; else { - LDAPDebug1Arg(LDAP_DEBUG_ERR, - "dblayer_restore - Failed to copy directory %s\n", + slapi_log_err(SLAPI_LOG_ERR, + "dblayer_restore", "Failed to copy directory %s\n", filename1); if (task) { slapi_task_log_notice(task, @@ -6928,7 +6908,7 @@ int dblayer_restore(struct ldbminfo *li, char *src_dir, Slapi_Task *task, char * real_src_dir, direntry->name); PR_snprintf(filename2, sizeof(filename2), "%s/%s", prefix, direntry->name); - LDAPDebug2Args(LDAP_DEBUG_INFO, "dblayer_restore - Restoring file %d (%s)\n", + slapi_log_err(SLAPI_LOG_INFO, "dblayer_restore", "Restoring file %d (%s)\n", cnt, filename2); if (task) { slapi_task_log_notice(task, "Restoring file %d (%s)", @@ -6939,7 +6919,7 @@ int dblayer_restore(struct ldbminfo *li, char *src_dir, Slapi_Task *task, char * return_value = dblayer_copyfile(filename1, filename2, 0, priv->dblayer_file_mode); if (0 > return_value) { - LDAPDebug1Arg(LDAP_DEBUG_ERR, "dblayer_restore - Failed to copy file %s\n", filename1); + slapi_log_err(SLAPI_LOG_ERR, "dblayer_restore", "Failed to copy file %s\n", filename1); goto error_out; } cnt++; @@ -6956,7 +6936,7 @@ int dblayer_restore(struct ldbminfo *li, char *src_dir, Slapi_Task *task, char * if (dbversion_read(li, home_dir, &ldbmversion, &dataversion) != 0) { - LDAPDebug1Arg(LDAP_DEBUG_WARNING, "dblayer_restore - Unable to read dbversion " + slapi_log_err(SLAPI_LOG_WARNING, "dblayer_restore", "Unable to read dbversion " "file in %s\n", home_dir); } else @@ -6979,8 +6959,8 @@ int dblayer_restore(struct ldbminfo *li, char *src_dir, Slapi_Task *task, char * } else if (action & DBVERSION_NEED_DN2RDN) { - LDAPDebug2Args(LDAP_DEBUG_ERR, - "dblayer_restore - %s is on, while the instance %s is in the DN format. " + slapi_log_err(SLAPI_LOG_ERR, + "dblayer_restore", "%s is on, while the instance %s is in the DN format. " "Please run dn2rdn to convert the database format.\n", CONFIG_ENTRYRDN_SWITCH, inst->inst_name); return_value = -1; @@ -6988,8 +6968,8 @@ int dblayer_restore(struct ldbminfo *li, char *src_dir, Slapi_Task *task, char * } else if (action & DBVERSION_NEED_RDN2DN) { - LDAPDebug2Args(LDAP_DEBUG_ERR, - "dblayer_restore - %s is off, while the instance %s is in the RDN format. " + slapi_log_err(SLAPI_LOG_ERR, + "dblayer_restore", "%s is off, while the instance %s is in the RDN format. " "Please change the value to on in dse.ldif.\n", CONFIG_ENTRYRDN_SWITCH, inst->inst_name); return_value = -1; @@ -7017,8 +6997,8 @@ int dblayer_restore(struct ldbminfo *li, char *src_dir, Slapi_Task *task, char * tmp_rval = dblayer_start(li, dbmode); if (0 != tmp_rval) { - LDAPDebug0Args(LDAP_DEBUG_ERR, - "dblayer_restore - Failed to init database\n"); + slapi_log_err(SLAPI_LOG_ERR, + "dblayer_restore", "Failed to init database\n"); if (task) { slapi_task_log_notice(task, "dblayer_restore - Failed to init database"); } @@ -7030,16 +7010,16 @@ int dblayer_restore(struct ldbminfo *li, char *src_dir, Slapi_Task *task, char * /* check the DSE_* files, if any */ tmp_rval = dse_conf_verify(li, real_src_dir, bename); if (0 != tmp_rval) - LDAPDebug0Args(LDAP_DEBUG_WARNING, - "dblayer_restore - Unable to verify the index configuration\n"); + slapi_log_err(SLAPI_LOG_WARNING, + "dblayer_restore", "Unable to verify the index configuration\n"); } if (li->li_flags & SLAPI_TASK_RUNNING_FROM_COMMANDLINE) { /* command line: close the database down again */ tmp_rval = dblayer_close(li, dbmode); if (0 != tmp_rval) { - LDAPDebug0Args(LDAP_DEBUG_ERR, - "dblayer_restore - Failed to close database\n"); + slapi_log_err(SLAPI_LOG_ERR, + "dblayer_restore", "Failed to close database\n"); } } else { allinstance_set_busy(li); /* on-line mode */ @@ -7054,13 +7034,13 @@ error_out: if (frirestore && PR_Access(real_src_dir, PR_ACCESS_EXISTS) == PR_SUCCESS) { int ret1 = 0; - LDAPDebug1Arg(LDAP_DEBUG_INFO, - "dblayer_restore - Removing staging area %s.\n", real_src_dir); + slapi_log_err(SLAPI_LOG_INFO, + "dblayer_restore", " Removing staging area %s.\n", real_src_dir); ret1 = ldbm_delete_dirs(real_src_dir); if (ret1) { - LDAPDebug1Arg(LDAP_DEBUG_ERR, - "dblayer_restore - Removal of staging area %s failed!\n", + slapi_log_err(SLAPI_LOG_ERR, + "dblayer_restore", "Removal of staging area %s failed!\n", real_src_dir); } } @@ -7095,8 +7075,8 @@ dblayer_file_open(char *fname, int flags, int mode, PRFileDesc **prfd) if (NULL == *prfd) rc = PR_GetError(); if (rc && rc != PR_FILE_NOT_FOUND_ERROR ) { - LDAPDebug(LDAP_DEBUG_ERR, - "dblayer_file_open - Failed to open file: %s, error: (%d) %s\n", + slapi_log_err(SLAPI_LOG_ERR, + "dblayer_file_open", "Failed to open file: %s, error: (%d) %s\n", fname, rc, slapd_pr_strerror(rc)); } return rc; @@ -7164,8 +7144,8 @@ dblayer_file_check(char *fname, int mode) err = PR_GetOpenFileInfo64(prfd, &prfinfo); if (err == PR_SUCCESS && 0 == prfinfo.size) { /* it is empty restore or import has failed */ - LDAPDebug1Arg(LDAP_DEBUG_ERR, - "dblayer_file_check - Previous import or restore failed, file: %s is empty\n", fname); + slapi_log_err(SLAPI_LOG_ERR, + "dblayer_file_check", "Previous import or restore failed, file: %s is empty\n", fname); } PR_Close(prfd); PR_Delete(fname); @@ -7334,16 +7314,16 @@ int dblayer_update_db_ext(ldbm_instance *inst, char *oldext, char *newext) if (NULL == inst) { - LDAPDebug(LDAP_DEBUG_ERR, - "dblayer_update_db_ext - Null instance is passed\n", 0, 0, 0); + slapi_log_err(SLAPI_LOG_ERR, + "dblayer_update_db_ext", "Null instance is passed\n"); return -1; /* non zero */ } li = inst->inst_li; priv = (dblayer_private*)li->li_dblayer_private; inst_dirp = dblayer_get_full_inst_dir(li, inst, inst_dir, MAXPATHLEN); if (NULL == inst_dirp || '\0' == *inst_dirp) { - LDAPDebug(LDAP_DEBUG_ERR, - "dblayer_update_db_ext - Instance dir is NULL\n", 0, 0, 0); + slapi_log_err(SLAPI_LOG_ERR, + "dblayer_update_db_ext", "Instance dir is NULL\n"); return -1; /* non zero */ } for (a = (struct attrinfo *)avl_getfirst(inst->inst_attrs); @@ -7363,22 +7343,22 @@ int dblayer_update_db_ext(ldbm_instance *inst, char *oldext, char *newext) rval = db_create(&thisdb, priv->dblayer_env->dblayer_DB_ENV, 0); if (0 != rval) { - LDAPDebug(LDAP_DEBUG_ERR, "dblayer_update_db_ext - db_create returned %d (%s)\n", - rval, dblayer_strerror(rval), 0); + slapi_log_err(SLAPI_LOG_ERR, "dblayer_update_db_ext", "db_create returned %d (%s)\n", + rval, dblayer_strerror(rval)); goto done; } nfile = slapi_ch_smprintf("%s/%s%s", inst_dirp, a->ai_type, newext); - LDAPDebug(LDAP_DEBUG_TRACE, "dblayer_update_db_ext - Rename %s -> %s\n", - ofile, nfile, 0); + slapi_log_err(SLAPI_LOG_TRACE, "dblayer_update_db_ext", "Rename %s -> %s\n", + ofile, nfile); rval = thisdb->rename(thisdb, (const char *)ofile, NULL /* subdb */, (const char *)nfile, 0); if (0 != rval) { - LDAPDebug(LDAP_DEBUG_ERR, "dblayer_update_db_ext - rename returned %d (%s)\n", - rval, dblayer_strerror(rval), 0); - LDAPDebug(LDAP_DEBUG_ERR, - "dblayer_update_db_ext - index (%s) Failed to update index %s -> %s\n", + slapi_log_err(SLAPI_LOG_ERR, "dblayer_update_db_ext", "Rename returned %d (%s)\n", + rval, dblayer_strerror(rval)); + slapi_log_err(SLAPI_LOG_ERR, + "dblayer_update_db_ext", "Index (%s) Failed to update index %s -> %s\n", inst->inst_name, ofile, nfile); goto done; } @@ -7389,22 +7369,22 @@ int dblayer_update_db_ext(ldbm_instance *inst, char *oldext, char *newext) rval = db_create(&thisdb, priv->dblayer_env->dblayer_DB_ENV, 0); if (0 != rval) { - LDAPDebug(LDAP_DEBUG_ERR, "dblayer_update_db_ext - db_create returned %d (%s)\n", - rval, dblayer_strerror(rval), 0); + slapi_log_err(SLAPI_LOG_ERR, "dblayer_update_db_ext", "db_create returned %d (%s)\n", + rval, dblayer_strerror(rval)); goto done; } ofile = slapi_ch_smprintf("%s/%s%s", inst_dirp, ID2ENTRY, oldext); nfile = slapi_ch_smprintf("%s/%s%s", inst_dirp, ID2ENTRY, newext); - LDAPDebug(LDAP_DEBUG_TRACE, "dblayer_update_db_ext - rename %s -> %s\n", - ofile, nfile, 0); + slapi_log_err(SLAPI_LOG_TRACE, "dblayer_update_db_ext", "Rename %s -> %s\n", + ofile, nfile); rval = thisdb->rename(thisdb, (const char *)ofile, NULL /* subdb */, (const char *)nfile, 0); if (0 != rval) { - LDAPDebug(LDAP_DEBUG_ERR, "dblayer_update_db_ext - rename returned %d (%s)\n", - rval, dblayer_strerror(rval), 0); - LDAPDebug(LDAP_DEBUG_ERR, - "dblayer_update_db_ext - index (%s) Failed to update index %s -> %s\n", + slapi_log_err(SLAPI_LOG_ERR, "dblayer_update_db_ext", "Rename returned %d (%s)\n", + rval, dblayer_strerror(rval)); + slapi_log_err(SLAPI_LOG_ERR, + "dblayer_update_db_ext", "Index (%s) Failed to update index %s -> %s\n", inst->inst_name, ofile, nfile); } done: @@ -7427,8 +7407,8 @@ int dblayer_delete_indices(ldbm_instance *inst) if (NULL == inst) { - LDAPDebug(LDAP_DEBUG_ERR, - "dblayer_delete_indices - Null instance is passed\n", 0, 0, 0); + slapi_log_err(SLAPI_LOG_ERR, + "dblayer_delete_indices", "NULL instance is passed\n"); return rval; } rval = 0; @@ -7445,8 +7425,7 @@ void dblayer_set_recovery_required(struct ldbminfo *li) { if (NULL == li || NULL == li->li_dblayer_private) { - LDAPDebug(LDAP_DEBUG_ERR,"dblayer_set_recovery_required - No dblayer info\n", - 0, 0, 0); + slapi_log_err(SLAPI_LOG_ERR, "dblayer_set_recovery_required", "No dblayer info\n"); return; } li->li_dblayer_private->dblayer_recovery_required = 1; diff --git a/ldap/servers/slapd/back-ldbm/dbverify.c b/ldap/servers/slapd/back-ldbm/dbverify.c index c63f1ce..cb175bd 100644 --- a/ldap/servers/slapd/back-ldbm/dbverify.c +++ b/ldap/servers/slapd/back-ldbm/dbverify.c @@ -36,7 +36,7 @@ dbverify_ext( ldbm_instance *inst, int verbose ) inst->inst_dir_name); if ('\0' != dbdir[sizeof(dbdir)-1]) /* overflown */ { - slapi_log_error(SLAPI_LOG_ERR, "dbverify_ext", + slapi_log_err(SLAPI_LOG_ERR, "dbverify_ext", "db path too long: %s/%s\n", inst->inst_parent_dir_name, inst->inst_dir_name); return 1; @@ -49,7 +49,7 @@ dbverify_ext( ldbm_instance *inst, int verbose ) dirhandle = PR_OpenDir(dbdir); if (! dirhandle) { - slapi_log_error(SLAPI_LOG_ERR, "dbverify_ext", + slapi_log_err(SLAPI_LOG_ERR, "dbverify_ext", "PR_OpenDir (%s) failed (%d): %s\n", dbdir, PR_GetError(),slapd_pr_strerror(PR_GetError())); return 1; @@ -70,7 +70,7 @@ dbverify_ext( ldbm_instance *inst, int verbose ) } if (sizeof(direntry->name) + 2 > filelen) { - slapi_log_error(SLAPI_LOG_ERR, "dbverify_ext", + slapi_log_err(SLAPI_LOG_ERR, "dbverify_ext", "db path too long: %s/%s\n", dbdir, direntry->name); continue; @@ -79,7 +79,7 @@ dbverify_ext( ldbm_instance *inst, int verbose ) rval = db_create(&dbp, pEnv->dblayer_DB_ENV, 0); if (0 != rval) { - slapi_log_error(SLAPI_LOG_ERR, "dbverify_ext", + slapi_log_err(SLAPI_LOG_ERR, "dbverify_ext", "Unable to create id2entry db file %d\n", rval); return rval; } @@ -114,7 +114,7 @@ dbverify_ext( ldbm_instance *inst, int verbose ) } if (0 != rval) { - slapi_log_error(SLAPI_LOG_ERR, "DB verify", + slapi_log_err(SLAPI_LOG_ERR, "DB verify", "Unable to set pagesize flags to db (%d)\n", rval); return rval; } @@ -123,7 +123,7 @@ dbverify_ext( ldbm_instance *inst, int verbose ) rval = dbp->set_flags(dbp, DB_RECNUM); if (0 != rval) { - slapi_log_error(SLAPI_LOG_ERR, "dbverify_ext", + slapi_log_err(SLAPI_LOG_ERR, "dbverify_ext", "Unable to set RECNUM flag to vlv index (%d)\n", rval); return rval; } @@ -133,7 +133,7 @@ dbverify_ext( ldbm_instance *inst, int verbose ) rval = dbp->set_flags(dbp, DB_DUP | DB_DUPSORT); if (0 != rval) { - slapi_log_error(SLAPI_LOG_ERR, "dbverify_ext", + slapi_log_err(SLAPI_LOG_ERR, "dbverify_ext", "Unable to set DUP flags to db (%d)\n", rval); return rval; } @@ -147,7 +147,7 @@ dbverify_ext( ldbm_instance *inst, int verbose ) if (0 != rval) { - slapi_log_error(SLAPI_LOG_ERR, "dbverify_ext", + slapi_log_err(SLAPI_LOG_ERR, "dbverify_ext", "Unable to set dup_compare to db (%d)\n", rval); return rval; } @@ -159,13 +159,13 @@ dbverify_ext( ldbm_instance *inst, int verbose ) { if (verbose) { - slapi_log_error(SLAPI_LOG_ERR, "dbverify_ext", + slapi_log_err(SLAPI_LOG_ERR, "dbverify_ext", "%s: ok\n", dbdir); } } else { - slapi_log_error(SLAPI_LOG_ERR, "dbverify_ext", + slapi_log_err(SLAPI_LOG_ERR, "dbverify_ext", "verify failed(%d): %s\n", rval, dbdir); } rval_main |= rval; @@ -188,7 +188,7 @@ ldbm_back_dbverify( Slapi_PBlock *pb ) char **instance_names = NULL; char *dbdir = NULL; - slapi_log_error(SLAPI_LOG_TRACE, "ldbm_back_dbverify", "Verifying db files...\n"); + slapi_log_err(SLAPI_LOG_TRACE, "ldbm_back_dbverify", "Verifying db files...\n"); slapi_pblock_get(pb, SLAPI_BACKEND_INSTANCE_NAME, &instance_names); slapi_pblock_get(pb, SLAPI_SEQ_TYPE, &verbose); slapi_pblock_get(pb, SLAPI_PLUGIN_PRIVATE, &li); @@ -199,13 +199,13 @@ ldbm_back_dbverify( Slapi_PBlock *pb ) /* no write needed; choose EXPORT MODE */ if (0 != dblayer_start(li, DBLAYER_EXPORT_MODE)) { - slapi_log_error(SLAPI_LOG_ERR, "ldbm_back_dbverify", + slapi_log_err(SLAPI_LOG_ERR, "ldbm_back_dbverify", "dbverify: Failed to init database\n"); return rval; } /* server is up */ - slapi_log_error(SLAPI_LOG_TRACE, "ldbm_back_dbverify", "server is up\n"); + slapi_log_err(SLAPI_LOG_TRACE, "ldbm_back_dbverify", "server is up\n"); if (instance_names) /* instance is specified */ { char **inp = NULL; @@ -237,7 +237,7 @@ ldbm_back_dbverify( Slapi_PBlock *pb ) if (instance_set_busy(inst) != 0) { /* standalone, only. never happens */ - slapi_log_error(SLAPI_LOG_WARNING, "ldbm_back_dbverify", + slapi_log_err(SLAPI_LOG_WARNING, "ldbm_back_dbverify", "Backend '%s' is already in the middle of " "another task and cannot be disturbed.\n", inst->inst_name); @@ -256,7 +256,7 @@ ldbm_back_dbverify( Slapi_PBlock *pb ) rval = dblayer_post_close(li, DBLAYER_EXPORT_MODE); if (0 != rval) { - slapi_log_error(SLAPI_LOG_ERR, + slapi_log_err(SLAPI_LOG_ERR, "ldbm_back_dbverify", "Failed to close database\n"); } diff --git a/ldap/servers/slapd/back-ldbm/dbversion.c b/ldap/servers/slapd/back-ldbm/dbversion.c index 49fc509..a29fd4e 100644 --- a/ldap/servers/slapd/back-ldbm/dbversion.c +++ b/ldap/servers/slapd/back-ldbm/dbversion.c @@ -62,7 +62,7 @@ dbversion_write(struct ldbminfo *li, const char *directory, if (( prfd = PR_Open( filename, PR_RDWR | PR_CREATE_FILE | PR_TRUNCATE, SLAPD_DEFAULT_FILE_MODE )) == NULL ) { - LDAPDebug(LDAP_DEBUG_ERR, "dbversion_write - " + slapi_log_err(SLAPI_LOG_ERR, "dbversion_write - " "Could not open file \"%s\" for writing " SLAPI_COMPONENT_NAME_NSPR " %d (%s)\n", filename, PR_GetError(), slapd_pr_strerror(PR_GetError()) ); @@ -101,7 +101,7 @@ dbversion_write(struct ldbminfo *li, const char *directory, len = strlen(buf); if ( slapi_write_buffer( prfd, buf, len ) != (PRInt32)len ) { - LDAPDebug(LDAP_DEBUG_ERR, "dbversion_write - " + slapi_log_err(SLAPI_LOG_ERR, "dbversion_write - " "Could not write to file \"%s\"\n", filename, 0, 0 ); rc= -1; } @@ -111,7 +111,7 @@ dbversion_write(struct ldbminfo *li, const char *directory, len = strlen( buf ); if ( slapi_write_buffer( prfd, buf, len ) != (PRInt32)len ) { - LDAPDebug(LDAP_DEBUG_ERR, "dbversion_write - " + slapi_log_err(SLAPI_LOG_ERR, "dbversion_write - " "Could not write to file \"%s\"\n", filename, 0, 0 ); rc= -1; } diff --git a/ldap/servers/slapd/back-ldbm/dn2entry.c b/ldap/servers/slapd/back-ldbm/dn2entry.c index 9f91dc2..f75e43e 100644 --- a/ldap/servers/slapd/back-ldbm/dn2entry.c +++ b/ldap/servers/slapd/back-ldbm/dn2entry.c @@ -45,7 +45,7 @@ dn2entry_ext( struct backentry *e = NULL; char *indexname = ""; - LDAPDebug(LDAP_DEBUG_TRACE, "=> dn2entry_ext \"%s\"\n", slapi_sdn_get_dn(sdn), 0, 0 ); + slapi_log_err(SLAPI_LOG_TRACE, "dn2entry_ext", "=> \"%s\"\n", slapi_sdn_get_dn(sdn)); inst = (ldbm_instance *) be->be_instance_info; @@ -66,8 +66,8 @@ dn2entry_ext( { if (DB_NOTFOUND != *err) { - LDAPDebug2Args(LDAP_DEBUG_ANY, - "dn2entry_ext - Failed to get id for %s " + slapi_log_err(SLAPI_LOG_ERR, + "dn2entry_ext", "Failed to get id for %s " "from entryrdn index (%d)\n", slapi_sdn_get_dn(sdn), *err); } @@ -118,15 +118,15 @@ dn2entry_ext( * entrydn index, but we could not read the entry * from the id2entry index. what should we do? */ - LDAPDebug(LDAP_DEBUG_ERR, - "dn2entry_ext - The dn \"%s\" was in the %s index, " + slapi_log_err(SLAPI_LOG_ERR, + "dn2entry_ext", "The dn \"%s\" was in the %s index, " "but it did not exist in id2entry of instance %s.\n", slapi_sdn_get_dn(sdn), indexname, inst->inst_name); } } } bail: - LDAPDebug(LDAP_DEBUG_TRACE, "<= dn2entry_ext %p\n", e, 0, 0 ); + slapi_log_err(SLAPI_LOG_TRACE, "dn2entry_ext", "<= %p\n", e); return( e ); } @@ -159,7 +159,7 @@ dn2ancestor( { struct backentry *e = NULL; - LDAPDebug(LDAP_DEBUG_TRACE, "=> dn2ancestor \"%s\"\n", slapi_sdn_get_dn(sdn), 0, 0 ); + slapi_log_err(SLAPI_LOG_TRACE, "dn2ancestor", "=> \"%s\"\n", slapi_sdn_get_dn(sdn)); /* first, check to see if the given sdn is empty or a root suffix of the given backend - if so, it has no parent */ @@ -221,7 +221,7 @@ dn2ancestor( e is the entry of the ancestor of sdn OR e is the suffix entry OR e is NULL ancestordn contains the unnormalized DN of e or is empty */ - LDAPDebug(LDAP_DEBUG_TRACE, "<= dn2ancestor %p\n", e, 0, 0 ); + slapi_log_err(SLAPI_LOG_TRACE, "dn2ancestor", "=> %p\n", e); return( e ); } @@ -255,8 +255,8 @@ get_copy_of_entry(Slapi_PBlock *pb, const entry_address *addr, back_txn *txn, in { if(must_exist) { - LDAPDebug(LDAP_DEBUG_ERR, - "get_copy_of_entry - Operation error fetching %s (%s), error %d.\n", + slapi_log_err(SLAPI_LOG_ERR, + "get_copy_of_entry", "Operation error fetching %s (%s), error %d.\n", addr->sdn?slapi_sdn_get_dn(addr->sdn):"Null DN", (addr->uniqueid==NULL?"null":addr->uniqueid), err ); } diff --git a/ldap/servers/slapd/back-ldbm/filterindex.c b/ldap/servers/slapd/back-ldbm/filterindex.c index 755917b..8771b66 100644 --- a/ldap/servers/slapd/back-ldbm/filterindex.c +++ b/ldap/servers/slapd/back-ldbm/filterindex.c @@ -65,7 +65,7 @@ filter_candidates_ext( IDList *result; int ftype; - LDAPDebug(LDAP_DEBUG_TRACE, "=> filter_candidates\n", 0, 0, 0 ); + slapi_log_err(SLAPI_LOG_TRACE, "filter_candidates_ext", "=> \n"); if (!allidslimit) { allidslimit = compute_allids_limit(pb, li); @@ -74,8 +74,8 @@ filter_candidates_ext( /* check if this is to be serviced by a virtual index */ if(INDEX_FILTER_EVALUTED == index_subsys_evaluate_filter(f, (Slapi_DN*)slapi_be_getsuffix(be, 0), (IndexEntryList**)&result)) { - LDAPDebug(LDAP_DEBUG_TRACE, "<= filter_candidates %lu (vattr)\n", - (u_long)IDL_NIDS(result), 0, 0 ); + slapi_log_err(SLAPI_LOG_TRACE, "filter_candidates_ext", "<= %lu (vattr)\n", + (u_long)IDL_NIDS(result)); return result; } @@ -88,8 +88,8 @@ filter_candidates_ext( slapi_pblock_get(pb, SLAPI_TXN, &txn.back_txn_txn); result = vlv_find_index_by_filter_txn(be, base, f, &txn); if (result) { - LDAPDebug(LDAP_DEBUG_TRACE, "<= filter_candidates %lu (vlv)\n", - (u_long)IDL_NIDS(result), 0, 0 ); + slapi_log_err(SLAPI_LOG_TRACE, "filter_candidates_ext", "<= %lu (vlv)\n", + (u_long)IDL_NIDS(result)); return result; } } @@ -97,67 +97,67 @@ filter_candidates_ext( result = NULL; switch ( (ftype = slapi_filter_get_choice( f )) ) { case LDAP_FILTER_EQUALITY: - LDAPDebug(LDAP_DEBUG_FILTER, "\tEQUALITY\n", 0, 0, 0 ); + slapi_log_err(SLAPI_LOG_FILTER, "filter_candidates_ext", "\tEQUALITY\n"); result = ava_candidates( pb, be, f, LDAP_FILTER_EQUALITY, nextf, range, err, allidslimit ); break; case LDAP_FILTER_SUBSTRINGS: - LDAPDebug(LDAP_DEBUG_FILTER, "\tSUBSTRINGS\n", 0, 0, 0 ); + slapi_log_err(SLAPI_LOG_FILTER, "filter_candidates_ext", "\tSUBSTRINGS\n"); result = substring_candidates( pb, be, f, err, allidslimit ); break; case LDAP_FILTER_GE: - LDAPDebug(LDAP_DEBUG_FILTER, "\tGE\n", 0, 0, 0 ); + slapi_log_err(SLAPI_LOG_FILTER, "filter_candidates_ext", "\tGE\n"); result = ava_candidates( pb, be, f, LDAP_FILTER_GE, nextf, range, err, allidslimit ); break; case LDAP_FILTER_LE: - LDAPDebug(LDAP_DEBUG_FILTER, "\tLE\n", 0, 0, 0 ); + slapi_log_err(SLAPI_LOG_FILTER, "filter_candidates_ext", "\tLE\n"); result = ava_candidates( pb, be, f, LDAP_FILTER_LE, nextf, range, err, allidslimit ); break; case LDAP_FILTER_PRESENT: - LDAPDebug(LDAP_DEBUG_FILTER, "\tPRESENT\n", 0, 0, 0 ); + slapi_log_err(SLAPI_LOG_FILTER, "filter_candidates_ext", "\tPRESENT\n"); result = presence_candidates( pb, be, f, err, allidslimit ); break; case LDAP_FILTER_APPROX: - LDAPDebug(LDAP_DEBUG_FILTER, "\tAPPROX\n", 0, 0, 0 ); + slapi_log_err(SLAPI_LOG_FILTER, "filter_candidates_ext", "\tAPPROX\n"); result = ava_candidates( pb, be, f, LDAP_FILTER_APPROX, nextf, range, err, allidslimit ); break; case LDAP_FILTER_EXTENDED: - LDAPDebug(LDAP_DEBUG_FILTER, "\tEXTENSIBLE\n", 0, 0, 0 ); + slapi_log_err(SLAPI_LOG_FILTER, "filter_candidates_ext", "\tEXTENSIBLE\n"); result = extensible_candidates( pb, be, f, err, allidslimit ); break; case LDAP_FILTER_AND: - LDAPDebug(LDAP_DEBUG_FILTER, "\tAND\n", 0, 0, 0 ); + slapi_log_err(SLAPI_LOG_FILTER, "filter_candidates_ext", "\tAND\n"); result = list_candidates( pb, be, base, f, LDAP_FILTER_AND, err, allidslimit ); break; case LDAP_FILTER_OR: - LDAPDebug(LDAP_DEBUG_FILTER, "\tOR\n", 0, 0, 0 ); + slapi_log_err(SLAPI_LOG_FILTER, "filter_candidates_ext", "\tOR\n"); result = list_candidates( pb, be, base, f, LDAP_FILTER_OR, err, allidslimit ); break; case LDAP_FILTER_NOT: - LDAPDebug(LDAP_DEBUG_FILTER, "\tNOT\n", 0, 0, 0 ); + slapi_log_err(SLAPI_LOG_FILTER, "filter_candidates_ext", "\tNOT\n"); result = idl_allids( be ); break; default: - LDAPDebug(LDAP_DEBUG_FILTER, - "filter_candidates: unknown type 0x%X\n", - ftype, 0, 0 ); + slapi_log_err(SLAPI_LOG_FILTER, + "filter_candidates_ext", "unknown type 0x%X\n", + ftype); break; } - LDAPDebug(LDAP_DEBUG_TRACE, "<= filter_candidates %lu\n", - (u_long)IDL_NIDS(result), 0, 0 ); + slapi_log_err(SLAPI_LOG_TRACE, "filter_candidates_ext", "<= %lu\n", + (u_long)IDL_NIDS(result)); return( result ); } @@ -197,11 +197,10 @@ ava_candidates( back_txn txn = {NULL}; int pr_idx = -1; - LDAPDebug(LDAP_DEBUG_TRACE, "=> ava_candidates\n", 0, 0, 0 ); + slapi_log_err(SLAPI_LOG_TRACE, "ava_candidates", "=>\n"); if ( slapi_filter_get_ava( f, &type, &bval ) != 0 ) { - LDAPDebug(LDAP_DEBUG_TRACE, " slapi_filter_get_ava failed\n", - 0, 0, 0 ); + slapi_log_err(SLAPI_LOG_TRACE, "ava_candidates", "slapi_filter_get_ava failed\n"); return( NULL ); } @@ -209,7 +208,7 @@ ava_candidates( slapi_attr_init(&sattr, type); #ifdef LDAP_DEBUG - if ( LDAPDebugLevelIsSet( LDAP_DEBUG_TRACE )) { + if ( loglevel_is_set( LDAP_DEBUG_TRACE )) { char *op = NULL; char buf[BUFSIZ]; @@ -227,7 +226,7 @@ ava_candidates( op = "~="; break; } - LDAPDebug(LDAP_DEBUG_TRACE, " %s%s%s\n", type, op, + slapi_log_err(SLAPI_LOG_TRACE, "ava_candidates", " %s%s%s\n", type, op, encode( bval, buf ) ); } #endif @@ -235,14 +234,14 @@ ava_candidates( switch ( ftype ) { case LDAP_FILTER_GE: idl = range_candidates(pb, be, type, bval, NULL, err, &sattr, allidslimit); - LDAPDebug(LDAP_DEBUG_TRACE, "<= ava_candidates %lu\n", - (u_long)IDL_NIDS(idl), 0, 0 ); + slapi_log_err(SLAPI_LOG_TRACE, "ava_candidates", "<= %lu\n", + (u_long)IDL_NIDS(idl)); goto done; break; case LDAP_FILTER_LE: idl = range_candidates(pb, be, type, NULL, bval, err, &sattr, allidslimit); - LDAPDebug(LDAP_DEBUG_TRACE, "<= ava_candidates %lu\n", - (u_long)IDL_NIDS(idl), 0, 0 ); + slapi_log_err(SLAPI_LOG_TRACE, "ava_candidates", "<= %lu\n", + (u_long)IDL_NIDS(idl)); goto done; break; case LDAP_FILTER_EQUALITY: @@ -252,7 +251,7 @@ ava_candidates( indextype = (char*)indextype_APPROX; break; default: - LDAPDebug(LDAP_DEBUG_TRACE, "<= ava_candidates invalid filter\n", 0, 0, 0 ); + slapi_log_err(SLAPI_LOG_TRACE, "ava_candidates", "<= invalid filter\n"); goto done; break; } @@ -312,8 +311,8 @@ ava_candidates( slapi_attr_assertion2keys_ava_sv( &sattr, &sv, &ivals, ftype ); value_done(&sv); if ( ivals == NULL || *ivals == NULL ) { - LDAPDebug(LDAP_DEBUG_TRACE, - "<= ava_candidates ALLIDS (no keys)\n", 0, 0, 0 ); + slapi_log_err(SLAPI_LOG_TRACE, "ava_candidates", + "<= ALLIDS (no keys)\n"); idl = idl_allids( be ); goto done; } @@ -324,8 +323,8 @@ ava_candidates( pagedresults_set_unindexed( pb->pb_conn, pb->pb_op, pr_idx ); } valuearray_free( &ivals ); - LDAPDebug(LDAP_DEBUG_TRACE, "<= ava_candidates %lu\n", - (u_long)IDL_NIDS(idl), 0, 0 ); + slapi_log_err(SLAPI_LOG_TRACE, "ava_candidates", "<= %lu\n", + (u_long)IDL_NIDS(idl)); } done: attr_done(&sattr); @@ -346,11 +345,10 @@ presence_candidates( int unindexed = 0; back_txn txn = {NULL}; - LDAPDebug(LDAP_DEBUG_TRACE, "=> presence_candidates\n", 0, 0, 0 ); + slapi_log_err(SLAPI_LOG_TRACE, "presence_candidates", "=> n"); if ( slapi_filter_get_type( f, &type ) != 0 ) { - LDAPDebug(LDAP_DEBUG_ERR, "presence_candidates - slapi_filter_get_type failed\n", - 0, 0, 0 ); + slapi_log_err(SLAPI_LOG_ERR, "presence_candidates", "slapi_filter_get_type failed\n"); return( NULL ); } slapi_pblock_get(pb, SLAPI_TXN, &txn.back_txn_txn); @@ -367,17 +365,16 @@ presence_candidates( if (idl != NULL && ALLIDS(idl) && strcasecmp(type, "nscpentrydn") == 0) { /* try the equality index instead */ - LDAPDebug(LDAP_DEBUG_TRACE, - "presence_candidates - fallback to eq index as pres index gave allids\n", - 0, 0, 0); + slapi_log_err(SLAPI_LOG_TRACE, + "presence_candidates", "Fallback to eq index as pres index gave allids\n"); idl_free(&idl); idl = index_range_read_ext(pb, be, type, indextype_EQUALITY, SLAPI_OP_GREATER_OR_EQUAL, NULL, NULL, 0, &txn, err, allidslimit); } - LDAPDebug(LDAP_DEBUG_TRACE, "<= presence_candidates %lu\n", - (u_long)IDL_NIDS(idl), 0, 0 ); + slapi_log_err(SLAPI_LOG_TRACE, "presence_candidates", "<= %lu\n", + (u_long)IDL_NIDS(idl)); return( idl ); } @@ -395,7 +392,7 @@ extensible_candidates( int mrOP = 0; Slapi_Operation *op = NULL; back_txn txn = {NULL}; - LDAPDebug(LDAP_DEBUG_TRACE, "=> extensible_candidates\n", 0, 0, 0); + slapi_log_err(SLAPI_LOG_TRACE, "extensible_candidates", "=> \n"); slapi_pblock_get(glob_pb, SLAPI_TXN, &txn.back_txn_txn); if ( ! slapi_mr_filter_index (f, pb) && !slapi_pblock_get (pb, SLAPI_PLUGIN_MR_QUERY_OPERATOR, &mrOP)) { @@ -525,8 +522,8 @@ return_idl: op = NULL; slapi_pblock_set (pb, SLAPI_OPERATION, op); slapi_pblock_destroy (pb); - LDAPDebug(LDAP_DEBUG_TRACE, "<= extensible_candidates %lu\n", - (u_long)IDL_NIDS(idl), 0, 0); + slapi_log_err(SLAPI_LOG_TRACE, "extensible_candidates", "<= %lu\n", + (u_long)IDL_NIDS(idl)); return idl; } @@ -555,15 +552,15 @@ range_candidates( int operator = 0; Operation *op = NULL; - LDAPDebug(LDAP_DEBUG_TRACE, "=> range_candidates attr=%s\n", type, 0, 0); + slapi_log_err(SLAPI_LOG_TRACE, "range_candidates", "=> attr=%s\n", type); slapi_pblock_get(pb, SLAPI_TXN, &txn.back_txn_txn); if (low_val != NULL) { slapi_attr_assertion2keys_ava(sattr, low_val, &lows, LDAP_FILTER_EQUALITY); if (lows == NULL || *lows == NULL) { - LDAPDebug(LDAP_DEBUG_TRACE, - "<= range_candidates ALLIDS (no keys)\n", 0, 0, 0 ); + slapi_log_err(SLAPI_LOG_TRACE, + "range_candidates", "<= ALLIDS (no keys)\n"); idl = idl_allids( be ); goto done; } @@ -573,8 +570,8 @@ range_candidates( if (high_val != NULL) { slapi_attr_assertion2keys_ava(sattr, high_val, &highs, LDAP_FILTER_EQUALITY); if (highs == NULL || *highs == NULL) { - LDAPDebug(LDAP_DEBUG_TRACE, - "<= range_candidates ALLIDS (no keys)\n", 0, 0, 0 ); + slapi_log_err(SLAPI_LOG_TRACE, + "range_candidates", "<= ALLIDS (no keys)\n"); idl = idl_allids( be ); goto done; } @@ -606,8 +603,8 @@ done: if (lows) ber_bvecfree(lows); if (highs) ber_bvecfree(highs); - LDAPDebug(LDAP_DEBUG_TRACE, "<= range_candidates %lu\n", - (u_long)IDL_NIDS(idl), 0, 0 ); + slapi_log_err(SLAPI_LOG_TRACE, "range_candidates", "<= %lu\n", + (u_long)IDL_NIDS(idl)); return idl; } @@ -656,7 +653,7 @@ list_candidates( struct berval *vpairs[2] = {NULL, NULL}; int is_and = 0; - LDAPDebug(LDAP_DEBUG_TRACE, "=> list_candidates 0x%x\n", ftype, 0, 0 ); + slapi_log_err(SLAPI_LOG_TRACE, "list_candidates", "=> 0x%x\n", ftype); /* * Optimize bounded range queries such as (&(cn>=A)(cn<=B)). @@ -753,8 +750,8 @@ list_candidates( slapi_attr_init(&sattr, tpairs[0]); idl = range_candidates(pb, be, tpairs[0], vpairs[0], vpairs[1], err, &sattr, allidslimit); attr_done(&sattr); - LDAPDebug(LDAP_DEBUG_TRACE, "<= list_candidates %lu\n", - (u_long)IDL_NIDS(idl), 0, 0 ); + slapi_log_err(SLAPI_LOG_TRACE, "list_candidates", "<= %lu\n", + (u_long)IDL_NIDS(idl)); goto out; } @@ -779,7 +776,7 @@ list_candidates( /* Fetch the IDL for foo */ /* Later we'll remember to call idl_notin() */ - LDAPDebug(LDAP_DEBUG_TRACE,"NOT filter\n", 0, 0, 0 ); + slapi_log_err(SLAPI_LOG_TRACE, "list_candidates" ,"NOT filter\n"); if (filter_is_subtype(slapi_filter_list_first(f))) { /* * If subtype is included in the filter (e.g., !(cn;fr=)), @@ -806,8 +803,8 @@ list_candidates( attr_done(&sattr); if (tmp == NULL && ftype == LDAP_FILTER_AND) { - LDAPDebug(LDAP_DEBUG_TRACE, - "<= list_candidates NULL\n", 0, 0, 0 ); + slapi_log_err(SLAPI_LOG_TRACE, "list_candidates", + "<= NULL\n"); idl_free( &idl ); idl = NULL; goto out; @@ -816,8 +813,8 @@ list_candidates( /* Proceed as normal */ else if ( (tmp = filter_candidates_ext( pb, be, base, f, nextf, range, err, allidslimit )) == NULL && ftype == LDAP_FILTER_AND ) { - LDAPDebug(LDAP_DEBUG_TRACE, - "<= list_candidates NULL\n", 0, 0, 0 ); + slapi_log_err(SLAPI_LOG_TRACE, "list_candidates", + "<= NULL 2\n"); idl_free( &idl ); idl = NULL; goto out; @@ -879,8 +876,8 @@ list_candidates( } } - LDAPDebug(LDAP_DEBUG_TRACE, "<= list_candidates %lu\n", - (u_long)IDL_NIDS(idl), 0, 0 ); + slapi_log_err(SLAPI_LOG_TRACE, "list_candidates", "<= %lu\n", + (u_long)IDL_NIDS(idl)); out: if (is_and) { /* @@ -918,11 +915,10 @@ substring_candidates( int pr_idx = -1; struct attrinfo *ai = NULL; - LDAPDebug(LDAP_DEBUG_TRACE, "=> sub_candidates\n", 0, 0, 0 ); + slapi_log_err(SLAPI_LOG_TRACE, "substring_candidates", "=>\n"); if (slapi_filter_get_subfilt( f, &type, &initial, &any, &final ) != 0) { - LDAPDebug(LDAP_DEBUG_ERR, "substring_candidates - slapi_filter_get_subfilt fails\n", - 0, 0, 0 ); + slapi_log_err(SLAPI_LOG_ERR, "substring_candidates", "slapi_filter_get_subfilt fails\n"); return( NULL ); } @@ -939,8 +935,8 @@ substring_candidates( if ( ivals == NULL || *ivals == NULL ) { slapi_pblock_set( pb, SLAPI_OPERATION_NOTES, &opnote ); pagedresults_set_unindexed( pb->pb_conn, pb->pb_op, pr_idx ); - LDAPDebug(LDAP_DEBUG_TRACE, - "<= sub_candidates ALLIDS (no keys)\n", 0, 0, 0 ); + slapi_log_err(SLAPI_LOG_TRACE, "substring_candidates", + "<= ALLIDS (no keys)\n"); return( idl_allids( be ) ); } @@ -956,8 +952,8 @@ substring_candidates( } valuearray_free( &ivals ); - LDAPDebug(LDAP_DEBUG_TRACE, "<= sub_candidates %lu\n", - (u_long)IDL_NIDS(idl), 0, 0 ); + slapi_log_err(SLAPI_LOG_TRACE, "substring_candidates", "<= %lu\n", + (u_long)IDL_NIDS(idl)); return( idl ); } @@ -977,8 +973,8 @@ keys2idl( IDList *idl; int i; - LDAPDebug(LDAP_DEBUG_TRACE, "=> keys2idl type %s indextype %s\n", - type, indextype, 0 ); + slapi_log_err(SLAPI_LOG_TRACE, "keys2idl", "=> type %s indextype %s\n", + type, indextype); idl = NULL; for ( i = 0; ivals[i] != NULL; i++ ) { IDList *idl2; @@ -990,7 +986,7 @@ keys2idl( { char buf[BUFSIZ]; - LDAPDebug(LDAP_DEBUG_TRACE, + slapi_log_err(SLAPI_LOG_TRACE, "keys2idl", " ival[%d] = \"%s\" => %lu IDs\n", i, encode( slapi_value_get_berval(ivals[i]), buf ), (u_long)IDL_NIDS(idl2) ); } diff --git a/ldap/servers/slapd/back-ldbm/findentry.c b/ldap/servers/slapd/back-ldbm/findentry.c index e6e0ab4..458679b 100644 --- a/ldap/servers/slapd/back-ldbm/findentry.c +++ b/ldap/servers/slapd/back-ldbm/findentry.c @@ -46,9 +46,8 @@ check_entry_for_referral(Slapi_PBlock *pb, Slapi_Entry *entry, char *matched, co url=(struct berval **) slapi_ch_malloc((numValues + 1) * sizeof(struct berval*)); if (!url) { - LDAPDebug(LDAP_DEBUG_ERR, - "check_entry_for_referral - Out of memory\n", - 0, 0, 0); + slapi_log_err(SLAPI_LOG_ERR, + "check_entry_for_referral", "Out of memory\n"); goto out; } @@ -62,7 +61,7 @@ check_entry_for_referral(Slapi_PBlock *pb, Slapi_Entry *entry, char *matched, co slapi_send_ldap_result( pb, LDAP_REFERRAL, matched, NULL, 0, refscopy ); rc= 1; - LDAPDebug(LDAP_DEBUG_TRACE, + slapi_log_err(SLAPI_LOG_TRACE, "check_entry_for_referral", "<= %s sent referral to (%s) for (%s)\n", callingfn, refscopy ? refscopy[0]->bv_val : "", @@ -133,21 +132,21 @@ find_entry_internal_dn( /* wait for entry modify lock */ if ( !lock || cache_lock_entry( &inst->inst_cache, e ) == 0 ) { - LDAPDebug(LDAP_DEBUG_TRACE, - "<= find_entry_internal_dn - found (%s)\n", slapi_sdn_get_dn(sdn), 0, 0 ); + slapi_log_err(SLAPI_LOG_TRACE, "find_entry_internal_dn", + "<= found (%s)\n", slapi_sdn_get_dn(sdn)); return( e ); } /* * this entry has been deleted - see if it was actually * replaced with a new copy, and try the whole thing again. */ - LDAPDebug(LDAP_DEBUG_ARGS, - " find_entry_internal_dn - Retrying (%s)\n", slapi_sdn_get_dn(sdn), 0, 0 ); + slapi_log_err(SLAPI_LOG_ARGS, "find_entry_internal_dn", + " Retrying (%s)\n", slapi_sdn_get_dn(sdn)); CACHE_RETURN( &inst->inst_cache, &e ); tries++; } if (tries >= LDBM_CACHE_RETRY_COUNT) { - LDAPDebug(LDAP_DEBUG_ERR, "find_entry_internal_dn - Retry count exceeded (%s)\n", slapi_sdn_get_dn(sdn), 0, 0 ); + slapi_log_err(SLAPI_LOG_ERR, "find_entry_internal_dn", "Retry count exceeded (%s)\n", slapi_sdn_get_dn(sdn)); } /* * there is no such entry in this server. see how far we @@ -243,8 +242,8 @@ find_entry_internal_dn( } slapi_ch_free_string(&errbuf); - LDAPDebug(LDAP_DEBUG_TRACE, "<= find_entry_internal_dn - Not found (%s)\n", - slapi_sdn_get_dn(sdn), 0, 0 ); + slapi_log_err(SLAPI_LOG_TRACE, "find_entry_internal_dn", "<= Not found (%s)\n", + slapi_sdn_get_dn(sdn)); return( NULL ); } @@ -277,34 +276,32 @@ find_entry_internal_uniqueid( /* wait for entry modify lock */ if ( !lock || cache_lock_entry( &inst->inst_cache, e ) == 0 ) { - LDAPDebug(LDAP_DEBUG_TRACE, - "<= find_entry_internal_uniqueid found; uniqueid = (%s)\n", - uniqueid, 0, 0 ); + slapi_log_err(SLAPI_LOG_TRACE, + "find_entry_internal_uniqueid", "<= Found uniqueid = (%s)\n", uniqueid); return( e ); } /* * this entry has been deleted - see if it was actually * replaced with a new copy, and try the whole thing again. */ - LDAPDebug(LDAP_DEBUG_ARGS, - " find_entry_internal_uniqueid retrying; uniqueid = (%s)\n", - uniqueid, 0, 0 ); + slapi_log_err(SLAPI_LOG_ARGS, + " find_entry_internal_uniqueid", "Retrying; uniqueid = (%s)\n", uniqueid); CACHE_RETURN( &inst->inst_cache, &e ); tries++; } if (tries >= LDBM_CACHE_RETRY_COUNT) { - LDAPDebug(LDAP_DEBUG_ERR, - "find_entry_internal_uniqueid - Retry count exceeded; uniqueid = (%s)\n", - uniqueid , 0, 0 ); + slapi_log_err(SLAPI_LOG_ERR, + "find_entry_internal_uniqueid", "Retry count exceeded; uniqueid = (%s)\n", + uniqueid); } /* entry not found */ slapi_send_ldap_result( pb, ( 0 == err || DB_NOTFOUND == err ) ? LDAP_NO_SUCH_OBJECT : LDAP_OPERATIONS_ERROR, NULL /* matched */, NULL, 0, NULL ); - LDAPDebug(LDAP_DEBUG_TRACE, - "<= find_entry_internal_uniqueid not found; uniqueid = (%s)\n", - uniqueid, 0, 0 ); + slapi_log_err(SLAPI_LOG_TRACE, + "find_entry_internal_uniqueid", "<= not found; uniqueid = (%s)\n", + uniqueid); return( NULL ); } @@ -322,23 +319,23 @@ find_entry_internal( /* check if we should search based on uniqueid or dn */ if (addr->uniqueid!=NULL) { - LDAPDebug(LDAP_DEBUG_TRACE, "=> find_entry_internal (uniqueid=%s) lock %d\n", - addr->uniqueid, lock, 0 ); + slapi_log_err(SLAPI_LOG_TRACE, "find_entry_internal", "=> (uniqueid=%s) lock %d\n", + addr->uniqueid, lock); return (find_entry_internal_uniqueid (pb, be, addr->uniqueid, lock, txn)); } else { struct backentry *entry = NULL; - LDAPDebug(LDAP_DEBUG_TRACE, "=> find_entry_internal - (dn=%s) lock %d\n", - slapi_sdn_get_dn(addr->sdn), lock, 0 ); + slapi_log_err(SLAPI_LOG_TRACE, "find_entry_internal", "(dn=%s) lock %d\n", + slapi_sdn_get_dn(addr->sdn), lock); if (addr->sdn) { entry = find_entry_internal_dn (pb, be, addr->sdn, lock, txn, flags, rc); } else { - LDAPDebug0Args(LDAP_DEBUG_ANY, "find_entry_internal: Null target dn\n" ); + slapi_log_err(SLAPI_LOG_ERR, "find_entry_internal", "NULL target dn\n" ); } - LDAPDebug0Args(LDAP_DEBUG_TRACE, "<= find_entry_internal\n" ); + slapi_log_err(SLAPI_LOG_TRACE, "find_entry_internal", "<=\n" ); return entry; } } diff --git a/ldap/servers/slapd/back-ldbm/id2entry.c b/ldap/servers/slapd/back-ldbm/id2entry.c index 38d8101..824938c 100644 --- a/ldap/servers/slapd/back-ldbm/id2entry.c +++ b/ldap/servers/slapd/back-ldbm/id2entry.c @@ -36,13 +36,12 @@ id2entry_add_ext(backend *be, struct backentry *e, back_txn *txn, struct backentry *encrypted_entry = NULL; char *entrydn = NULL; - LDAPDebug(LDAP_DEBUG_TRACE, "=> id2entry_add( %lu, \"%s\" )\n", - (u_long)e->ep_id, backentry_get_ndn(e), 0 ); + slapi_log_err(SLAPI_LOG_TRACE, "id2entry_add_ext", "=> ( %lu, \"%s\" )\n", + (u_long)e->ep_id, backentry_get_ndn(e)); if ( (rc = dblayer_get_id2entry( be, &db )) != 0 ) { - LDAPDebug(LDAP_DEBUG_ERR, "id2entry_add_ext - " - "Could not open/create id2entry\n", - 0, 0, 0 ); + slapi_log_err(SLAPI_LOG_ERR, "id2entry_add_ext", + "Could not open/create id2entry\n"); rc = -1; goto done; } @@ -57,8 +56,8 @@ id2entry_add_ext(backend *be, struct backentry *e, back_txn *txn, if (encrypt) { rc = attrcrypt_encrypt_entry(be, e, &encrypted_entry); if (rc) { - LDAPDebug(LDAP_DEBUG_ERR, "id2entry_add_ext - " - "attrcrypt_encrypt_entry failed\n", 0, 0, 0 ); + slapi_log_err(SLAPI_LOG_ERR, "id2entry_add_ext", + "attrcrypt_encrypt_entry failed\n"); rc = -1; goto done; } @@ -83,16 +82,16 @@ id2entry_add_ext(backend *be, struct backentry *e, back_txn *txn, if (cache_replace( &inst->inst_dncache, oldbdn, bdn ) != 0) { /* The entry was not in the cache for some reason (this * should not happen since CACHE_ADD said it existed above). */ - LDAPDebug(LDAP_DEBUG_WARNING, "id2entry_add_ext - Entry disappeared " - "from cache (%s)\n", oldbdn->dn_sdn, 0, 0 ); + slapi_log_err(SLAPI_LOG_WARNING, "id2entry_add_ext", "Entry disappeared " + "from cache (%s)\n", slapi_sdn_get_dn(oldbdn->dn_sdn)); } } CACHE_RETURN(&inst->inst_dncache, &oldbdn); /* to free oldbdn */ } CACHE_RETURN(&inst->inst_dncache, &bdn); - LDAPDebug2Args(LDAP_DEBUG_TRACE, - "=> id2entry_add (dncache) ( %lu, \"%s\" )\n", + slapi_log_err(SLAPI_LOG_TRACE, + "id2entry_add_ext", "(dncache) ( %lu, \"%s\" )\n", (u_long)e->ep_id, slapi_entry_get_dn_const(entry_to_use) ); } data.dptr = slapi_entry2str_with_options(entry_to_use, &len, options); @@ -190,7 +189,7 @@ done: backentry_free(&encrypted_entry); } - LDAPDebug(LDAP_DEBUG_TRACE, "<= id2entry_add %d\n", rc, 0, 0 ); + slapi_log_err(SLAPI_LOG_TRACE, "id2entry_add_ext","<= %d\n", rc); return( rc ); } @@ -212,12 +211,12 @@ id2entry_delete( backend *be, struct backentry *e, back_txn *txn ) int rc; char temp_id[sizeof(ID)]; - LDAPDebug(LDAP_DEBUG_TRACE, "=> id2entry_delete( %lu, \"%s\" )\n", - (u_long)e->ep_id, backentry_get_ndn(e), 0 ); + slapi_log_err(SLAPI_LOG_TRACE, "id2entry_delete", "=>( %lu, \"%s\" )\n", + (u_long)e->ep_id, backentry_get_ndn(e)); if ( (rc = dblayer_get_id2entry( be, &db )) != 0 ) { - LDAPDebug(LDAP_DEBUG_ERR, "id2entry_delete - " - "Could not open/create id2entry\n", 0, 0, 0 ); + slapi_log_err(SLAPI_LOG_ERR, "id2entry_delete", + "Could not open/create id2entry\n"); return( -1 ); } @@ -235,7 +234,7 @@ id2entry_delete( backend *be, struct backentry *e, back_txn *txn ) ldbm_instance *inst = (ldbm_instance *)be->be_instance_info; struct backdn *bdn = dncache_find_id(&inst->inst_dncache, e->ep_id); if (bdn) { - slapi_log_error(SLAPI_LOG_CACHE, ID2ENTRY, + slapi_log_err(SLAPI_LOG_CACHE, ID2ENTRY, "dncache_find_id returned: %s\n", slapi_sdn_get_dn(bdn->dn_sdn)); CACHE_REMOVE(&inst->inst_dncache, bdn); @@ -246,7 +245,7 @@ id2entry_delete( backend *be, struct backentry *e, back_txn *txn ) rc = db->del( db,db_txn,&key,0 ); dblayer_release_id2entry( be, db ); - LDAPDebug(LDAP_DEBUG_TRACE, "<= id2entry_delete %d\n", rc, 0, 0 ); + slapi_log_err(SLAPI_LOG_TRACE, "id2entry_delete", "<= %d\n", rc); return( rc ); } @@ -262,11 +261,11 @@ id2entry( backend *be, ID id, back_txn *txn, int *err ) Slapi_Entry *ee; char temp_id[sizeof(ID)]; - slapi_log_error(SLAPI_LOG_TRACE, ID2ENTRY, + slapi_log_err(SLAPI_LOG_TRACE, ID2ENTRY, "=> id2entry(%lu)\n", (u_long)id); if ( (e = cache_find_id( &inst->inst_cache, id )) != NULL ) { - slapi_log_error(SLAPI_LOG_TRACE, ID2ENTRY, + slapi_log_err(SLAPI_LOG_TRACE, ID2ENTRY, "<= id2entry %p, dn \"%s\" (cache)\n", e, backentry_get_ndn(e)); goto bail; @@ -274,7 +273,7 @@ id2entry( backend *be, ID id, back_txn *txn, int *err ) *err = dblayer_get_id2entry( be, &db ); if ( (*err != 0) || (NULL == db) ) { - slapi_log_error(SLAPI_LOG_ERR, ID2ENTRY, + slapi_log_err(SLAPI_LOG_ERR, ID2ENTRY, "Could not open id2entry err %d\n", *err); return( NULL ); } @@ -296,7 +295,7 @@ id2entry( backend *be, ID id, back_txn *txn, int *err ) if ( (0 != *err) && (DB_NOTFOUND != *err) && (DB_LOCK_DEADLOCK != *err) ) { - slapi_log_error(SLAPI_LOG_ERR, ID2ENTRY, "db error %d (%s)\n", + slapi_log_err(SLAPI_LOG_ERR, ID2ENTRY, "db error %d (%s)\n", *err, dblayer_strerror( *err )); } } @@ -311,7 +310,7 @@ id2entry( backend *be, ID id, back_txn *txn, int *err ) * by ENV->set_alloc in dblayer.c. As long as the functions are * used by libdb, it won't reach here. */ - slapi_log_error(SLAPI_LOG_CRIT, ID2ENTRY, + slapi_log_err(SLAPI_LOG_CRIT, ID2ENTRY, "Malloc failed in libdb; " "terminating the server; OS error %d (%s)\n", *err, slapd_system_strerror( *err )); @@ -322,7 +321,7 @@ id2entry( backend *be, ID id, back_txn *txn, int *err ) } if ( data.dptr == NULL ) { - slapi_log_error(SLAPI_LOG_TRACE, ID2ENTRY, + slapi_log_err(SLAPI_LOG_TRACE, ID2ENTRY, "<= id2entry( %lu ) not found\n", (u_long)id); goto bail; } @@ -345,20 +344,20 @@ id2entry( backend *be, ID id, back_txn *txn, int *err ) struct backdn *bdn = dncache_find_id(&inst->inst_dncache, id); if (bdn) { normdn = slapi_ch_strdup(slapi_sdn_get_dn(bdn->dn_sdn)); - slapi_log_error(SLAPI_LOG_CACHE, ID2ENTRY, + slapi_log_err(SLAPI_LOG_CACHE, ID2ENTRY, "dncache_find_id returned: %s\n", normdn); CACHE_RETURN(&inst->inst_dncache, &bdn); } else { Slapi_DN *sdn = NULL; rc = entryrdn_lookup_dn(be, rdn, id, &normdn, &srdn, txn); if (rc) { - slapi_log_error(SLAPI_LOG_TRACE, ID2ENTRY, + slapi_log_err(SLAPI_LOG_TRACE, ID2ENTRY, "id2entry: entryrdn look up failed " "(rdn=%s, ID=%d)\n", rdn, id); /* Try rdn as dn. Could be RUV. */ normdn = slapi_ch_strdup(rdn); } else if (NULL == normdn) { - slapi_log_error(SLAPI_LOG_ERR, ID2ENTRY, + slapi_log_err(SLAPI_LOG_ERR, ID2ENTRY, "id2entry( %lu ) entryrdn_lookup_dn returned NULL. " "Index file may be deleted or corrupted.\n", (u_long)id); @@ -368,11 +367,11 @@ id2entry( backend *be, ID id, back_txn *txn, int *err ) bdn = backdn_init(sdn, id, 0); if (CACHE_ADD( &inst->inst_dncache, bdn, NULL )) { backdn_free(&bdn); - slapi_log_error(SLAPI_LOG_CACHE, ID2ENTRY, + slapi_log_err(SLAPI_LOG_CACHE, ID2ENTRY, "%s is already in the dn cache\n", normdn); } else { CACHE_RETURN(&inst->inst_dncache, &bdn); - slapi_log_error(SLAPI_LOG_CACHE, ID2ENTRY, + slapi_log_err(SLAPI_LOG_CACHE, ID2ENTRY, "entryrdn_lookup_dn returned: %s, " "and set to dn cache (id %d)\n", normdn, id); } @@ -396,7 +395,7 @@ id2entry( backend *be, ID id, back_txn *txn, int *err ) /* ownership of the entry is passed into the backentry */ e = backentry_init( ee ); e->ep_id = id; - slapi_log_error(SLAPI_LOG_TRACE, ID2ENTRY, + slapi_log_err(SLAPI_LOG_TRACE, ID2ENTRY, "id2entry id: %d, dn \"%s\" -- adding it to cache\n", id, backentry_get_ndn(e)); @@ -404,7 +403,7 @@ id2entry( backend *be, ID id, back_txn *txn, int *err ) * before adding it to the cache */ retval = attrcrypt_decrypt_entry(be, e); if (retval) { - slapi_log_error(SLAPI_LOG_ERR, ID2ENTRY, + slapi_log_err(SLAPI_LOG_ERR, ID2ENTRY, "attrcrypt_decrypt_entry failed in id2entry\n"); } @@ -445,13 +444,13 @@ id2entry( backend *be, ID id, back_txn *txn, int *err ) } else if (-1 == retval) { /* the entry is in idtable but not in dntable, i.e., the entry * could have been renamed */ - slapi_log_error(SLAPI_LOG_TRACE, ID2ENTRY, + slapi_log_err(SLAPI_LOG_TRACE, ID2ENTRY, "Failed to put entry (id %lu, dn %s) " "into entry cache\n", (u_long)id, backentry_get_ndn(e)); } } else { - slapi_log_error(SLAPI_LOG_ERR, ID2ENTRY, + slapi_log_err(SLAPI_LOG_ERR, ID2ENTRY, "str2entry returned NULL for id %lu, string=\"%s\"\n", (u_long)id, (char*)data.data); e = NULL; @@ -462,7 +461,7 @@ bail: dblayer_release_id2entry( be, db ); - slapi_log_error(SLAPI_LOG_TRACE, ID2ENTRY, + slapi_log_err(SLAPI_LOG_TRACE, ID2ENTRY, "<= id2entry( %lu ) %p (disk)\n", (u_long)id, e); return( e ); } diff --git a/ldap/servers/slapd/back-ldbm/idl.c b/ldap/servers/slapd/back-ldbm/idl.c index 9c80e0a..46f4242 100644 --- a/ldap/servers/slapd/back-ldbm/idl.c +++ b/ldap/servers/slapd/back-ldbm/idl.c @@ -72,8 +72,8 @@ static void idl_init_maxids(struct ldbminfo *li,idl_private *priv) } priv->idl_maxindirect = (li->li_allidsthreshold / priv->idl_maxids) + 1; priv->idl_allidslimit = (priv->idl_maxids * priv->idl_maxindirect); - LDAPDebug(LDAP_DEBUG_ARGS, - "idl_init_private: blksize %lu, maxids %i, maxindirect %i\n", + slapi_log_err(SLAPI_LOG_ARGS, + "idl_init_maxids", "blksize %lu, maxids %i, maxindirect %i\n", (unsigned long)blksize, priv->idl_maxids, priv->idl_maxindirect); } @@ -194,9 +194,6 @@ idl_fetch_one( { DBT data = {0}; IDList *idl = NULL; - - /* LDAPDebug(LDAP_DEBUG_TRACE, "=> idl_fetch_one\n", 0, 0, 0 ); */ - data.flags = DB_DBT_MALLOC; do { @@ -205,16 +202,16 @@ idl_fetch_one( { char *msg; if ( EPERM == *err && *err != errno ) { - LDAPDebug(LDAP_DEBUG_ERR, - "idl_fetch_one - (%s) Database failed to run, " + slapi_log_err(SLAPI_LOG_ERR, + "idl_fetch_one", "(%s) Database failed to run, " "There is either insufficient disk space or " "insufficient memory available for database.\n", ((char*)key->dptr)[ key->dsize - 1 ] ? - "" : (char*)key->dptr, 0, 0 ); + "" : (char*)key->dptr); } else { - LDAPDebug(LDAP_DEBUG_ERR, - "idl_fetch_one: Error %d %s\n", - *err, (msg = dblayer_strerror( *err )) ? msg : "", 0 ); + slapi_log_err(SLAPI_LOG_ERR, + "idl_fetch_one", "Error %d %s\n", + *err, (msg = dblayer_strerror( *err )) ? msg : ""); } } } @@ -246,7 +243,7 @@ idl_old_fetch( int i; unsigned long nids; - /* LDAPDebug(LDAP_DEBUG_TRACE, "=> idl_fetch\n", 0, 0, 0 ); */ + /* slapi_log_err(SLAPI_LOG_TRACE, "=> idl_fetch\n", 0, 0, 0 ); */ if ( (idl = idl_fetch_one( li, db, key, txn, err )) == NULL ) { return( NULL ); } @@ -324,19 +321,19 @@ idl_old_fetch( /* Check for inconsistencies: */ if ( tmp[i]->b_ids[0] != thisID ) { - LDAPDebug(LDAP_DEBUG_WARNING, "idl_old_fetch - (%s)->b_ids[0] == %lu\n", - k2.dptr, (u_long)tmp[i]->b_ids[0], 0); + slapi_log_err(SLAPI_LOG_WARNING, "idl_old_fetch", "(%s)->b_ids[0] == %lu\n", + (char *)k2.dptr, (u_long)tmp[i]->b_ids[0]); } if ( nextID != NOID ) { if ( nextID <= thisID ) { - LDAPDebug(LDAP_DEBUG_WARNING, "idl_old_fetch - " + slapi_log_err(SLAPI_LOG_WARNING, "idl_old_fetch", "Indirect block (%s) contains %lu, %lu\n", - key->dptr, (u_long)thisID, (u_long)nextID); + (char *)key->dptr, (u_long)thisID, (u_long)nextID); } if ( nextID <= tmp[i]->b_ids[(tmp[i]->b_nids)-1] ) { - LDAPDebug(LDAP_DEBUG_WARNING, "idl_old_fetch - (%s)->b_ids[last] == %lu" + slapi_log_err(SLAPI_LOG_WARNING, "idl_old_fetch", "(%s)->b_ids[last] == %lu" " >= %lu (next indirect ID)\n", - k2.dptr, (u_long)tmp[i]->b_ids[(tmp[i]->b_nids)-1], (u_long)nextID); + (char *)k2.dptr, (u_long)tmp[i]->b_ids[(tmp[i]->b_nids)-1], (u_long)nextID); } } } @@ -364,8 +361,8 @@ idl_old_fetch( } slapi_ch_free((void**)&tmp ); - LDAPDebug(LDAP_DEBUG_TRACE, "<= idl_old_fetch %lu ids (%lu max)\n", (u_long)idl->b_nids, - (u_long)idl->b_nmax, 0 ); + slapi_log_err(SLAPI_LOG_TRACE, "idl_old_fetch", "<= %lu ids (%lu max)\n", (u_long)idl->b_nids, + (u_long)idl->b_nmax); return( idl ); } @@ -381,7 +378,7 @@ idl_store( int rc; DBT data = {0}; - /* LDAPDebug(LDAP_DEBUG_TRACE, "=> idl_store\n", 0, 0, 0 ); */ + /* slapi_log_err(SLAPI_LOG_TRACE, "=> idl_store\n", 0, 0, 0 ); */ data.dptr = (char *) idl; data.dsize = (2 + idl->b_nmax) * sizeof(ID); @@ -390,27 +387,27 @@ idl_store( if ( 0 != rc ) { char *msg; if ( EPERM == rc && rc != errno ) { - LDAPDebug(LDAP_DEBUG_ERR, - "idl_store - (%s) Database failed to run, " + slapi_log_err(SLAPI_LOG_ERR, + "idl_store", "(%s) Database failed to run, " "There is insufficient memory available for database.\n", - ((char*)key->dptr)[ key->dsize - 1 ] ? "" : (char*)key->dptr, 0, 0 ); + ((char*)key->dptr)[ key->dsize - 1 ] ? "" : (char*)key->dptr); } else { if (LDBM_OS_ERR_IS_DISKFULL(rc)) { operation_out_of_disk_space(); } - LDAPDebug( ((DB_LOCK_DEADLOCK == rc) ? LDAP_DEBUG_TRACE : LDAP_DEBUG_ERR), + slapi_log_err( ((DB_LOCK_DEADLOCK == rc) ? SLAPI_LOG_TRACE : SLAPI_LOG_ERR), "idl_store - (%s) Returns %d %s\n", ((char*)key->dptr)[ key->dsize - 1 ] ? "" : (char*)key->dptr, rc, (msg = dblayer_strerror( rc )) ? msg : "" ); if (rc == DB_RUNRECOVERY) { - LDAPDebug(LDAP_DEBUG_WARNING, "%s\n" "idl_store - ", - "Failures can be an indication of insufficient disk space.", 0, 0); - ldbm_nasty("idl_store", 71, rc); + slapi_log_err(SLAPI_LOG_WARNING, "idl_store", + "Failures can be an indication of insufficient disk space.\n"); + ldbm_nasty("idl_store","db->put", 71, rc); } } } - /* LDAPDebug(LDAP_DEBUG_TRACE, "<= idl_store %d\n", rc, 0, 0 ); */ + /* slapi_log_err(SLAPI_LOG_TRACE, "<= idl_store %d\n", rc, 0, 0 ); */ return( rc ); } @@ -473,16 +470,14 @@ idl_change_first( int rc; char *msg; - /* LDAPDebug(LDAP_DEBUG_TRACE, "=> idl_change_first\n", 0, 0, 0 ); */ - /* delete old key block */ rc = db->del( db, txn, bkey, 0 ); if ( (rc != 0) && (DB_LOCK_DEADLOCK != rc) ) { - LDAPDebug(LDAP_DEBUG_ERR, "idl_change_first - del (%s) err %d %s\n", - bkey->dptr, rc, (msg = dblayer_strerror( rc )) ? msg : "" ); + slapi_log_err(SLAPI_LOG_ERR, "idl_change_first", "del (%s) err %d %s\n", + (char *)bkey->dptr, rc, (msg = dblayer_strerror( rc )) ? msg : "" ); if (rc == DB_RUNRECOVERY) { - ldbm_nasty("idl_store",72,rc); + ldbm_nasty("idl_change_first","db->del", 72,rc); } return( rc ); } @@ -509,7 +504,7 @@ do { \ char* fmt = slapi_ch_malloc (strlen(func) + strlen(note) + strlen(FORMAT) + 30); \ if (fmt != NULL) { \ sprintf (fmt, "IDL_CHECK_FAILED - %s(%%s,%lu) %s: %s\n", func, (u_long)id, note, FORMAT); \ - LDAPDebug(LDAP_DEBUG_ERR, fmt, key->dptr, ARG1, ARG2); \ + slapi_log_err(SLAPI_LOG_ERR, fmt, key->dptr, ARG1, ARG2); \ slapi_ch_free((void**)&fmt); \ } \ } while(0) @@ -518,7 +513,7 @@ do { \ static void idl_check_indirect (IDList* idl, int i, IDList* tmp, IDList* tmp2, char* func, char* note, DBT* key, ID id) - /* Check for inconsistencies; report any via LDAPDebug(LDAP_DEBUG_ANY). + /* Check for inconsistencies The caller alleges that *idl is a header block, in which the i'th item points to the indirect block *tmp, and either tmp2 == NULL or *tmp2 is the indirect block to which the i+1'th item in *idl points. @@ -592,8 +587,8 @@ idl_old_insert_key( if ( rc != 0 && rc != DB_NOTFOUND ) { if ( rc != DB_LOCK_DEADLOCK ) { - LDAPDebug(LDAP_DEBUG_ERR, "idl_old_insert_key - 0 BAD %d %s\n", - rc, (msg = dblayer_strerror( rc )) ? msg : "", 0 ); + slapi_log_err(SLAPI_LOG_ERR, "idl_old_insert_key", "0 BAD %d %s\n", + rc, (msg = dblayer_strerror( rc )) ? msg : ""); } return( rc ); } @@ -602,8 +597,8 @@ idl_old_insert_key( rc = idl_store( be, db, key, idl, txn ); if ( rc != 0 && rc != DB_LOCK_DEADLOCK ) { - LDAPDebug(LDAP_DEBUG_ERR, "idl_old_insert_key - 1 BAD %d %s\n", - rc, (msg = dblayer_strerror( rc )) ? msg : "", 0 ); + slapi_log_err(SLAPI_LOG_ERR, "idl_old_insert_key", "1 BAD %d %s\n", + rc, (msg = dblayer_strerror( rc )) ? msg : ""); } idl_free( &idl ); @@ -640,8 +635,8 @@ idl_old_insert_key( idl_unlock_list(a->ai_idl,key); if ( rc != 0 && rc != DB_LOCK_DEADLOCK) { - LDAPDebug(LDAP_DEBUG_ERR, "idl_old_insert_key - 2 BAD %d %s\n", - rc, (msg = dblayer_strerror( rc )) ? msg : "", 0 ); + slapi_log_err(SLAPI_LOG_ERR, "idl_old_insert_key", "2 BAD %d %s\n", + rc, (msg = dblayer_strerror( rc )) ? msg : ""); } if (NULL != disposition) { *disposition = IDL_INSERT_NOW_ALLIDS; @@ -668,8 +663,8 @@ idl_old_insert_key( idl_free( &tmp2 ); if ( rc != DB_LOCK_DEADLOCK ) { - LDAPDebug(LDAP_DEBUG_ERR, "idl_old_insert_key - 3 BAD %d %s\n", - rc, (msg = dblayer_strerror( rc )) ? msg : "", 0 ); + slapi_log_err(SLAPI_LOG_ERR, "idl_old_insert_key", "3 BAD %d %s\n", + rc, (msg = dblayer_strerror( rc )) ? msg : ""); } return( rc ); } @@ -694,8 +689,8 @@ idl_old_insert_key( idl_free( &tmp2 ); if ( rc != DB_LOCK_DEADLOCK ) { - LDAPDebug(LDAP_DEBUG_ERR, "idl_old_insert_key - 4 BAD %d %s\n", - rc, (msg = dblayer_strerror( rc )) ? msg : "", 0 ); + slapi_log_err(SLAPI_LOG_ERR, "idl_old_insert_key", "4 BAD %d %s\n", + rc, (msg = dblayer_strerror( rc )) ? msg : ""); } return( rc ); } @@ -712,8 +707,8 @@ idl_old_insert_key( idl_unlock_list(a->ai_idl,key); if ( rc != 0 && rc != DB_LOCK_DEADLOCK ) { - LDAPDebug(LDAP_DEBUG_ERR, "idl_old_insert_key - 5 BAD %d %s\n", - rc, (msg = dblayer_strerror( rc )) ? msg : "", 0 ); + slapi_log_err(SLAPI_LOG_ERR, "idl_old_insert_key", "5 BAD %d %s\n", + rc, (msg = dblayer_strerror( rc )) ? msg : ""); } return( rc ); } @@ -731,8 +726,8 @@ idl_old_insert_key( ; /* NULL */ if ( id == idl->b_ids[i] ) { /* already in a block */ #ifdef _DEBUG_LARGE_BLOCKS - LDAPDebug(LDAP_DEBUG_DEBUG, - "idl_old_insert_key - id %lu for key (%s) is already in block %d\n", + slapi_log_err(SLAPI_LOG_DEBUG, + "idl_old_insert_key", "id %lu for key (%s) is already in block %d\n", (u_long)id, key.dptr, i); #endif idl_unlock_list(a->ai_idl,key); @@ -752,13 +747,13 @@ idl_old_insert_key( if ( rc != 0 ) { if ( rc != DB_LOCK_DEADLOCK ) { - LDAPDebug(LDAP_DEBUG_ERR, "idl_old_insert_key - 6 BAD %d %s\n", - rc, (msg = dblayer_strerror( rc )) ? msg : "", 0 ); + slapi_log_err(SLAPI_LOG_ERR, "idl_old_insert_key", "6 BAD %d %s\n", + rc, (msg = dblayer_strerror( rc )) ? msg : ""); } return( rc ); } - LDAPDebug(LDAP_DEBUG_ERR, - "idl_old_insert_key - nonexistent continuation block (%s)\n", k2.dptr, 0, 0 ); + slapi_log_err(SLAPI_LOG_ERR, + "idl_old_insert_key", "nonexistent continuation block (%s)\n", (char *)k2.dptr); idl_unlock_list(a->ai_idl,key); idl_free( &idl ); slapi_ch_free((void**)&kstr ); @@ -817,9 +812,8 @@ idl_old_insert_key( == NULL ) { if ( rc != DB_LOCK_DEADLOCK ) { - LDAPDebug(LDAP_DEBUG_ERR, - "idl_old_insert_key - (%s) returns NULL\n", - k3.dptr, 0, 0 ); + slapi_log_err(SLAPI_LOG_ERR, + "idl_old_insert_key", "(%s) returns NULL\n", (char *)k3.dptr); } if (0 != rc) { idl_check_indirect (idl, i, tmp, NULL, @@ -870,10 +864,10 @@ idl_old_insert_key( break; case 2: /* already there - how? */ case 3: /* split block - how? */ - LDAPDebug(LDAP_DEBUG_ERR, - "idl_old_insert_key - Not expecting (%d) from idl_insert_maxids " + slapi_log_err(SLAPI_LOG_ERR, + "idl_old_insert_key", "Not expecting (%d) from idl_insert_maxids " "of %lu in (%s). Likely database corruption\n", - rc, (u_long)id, k2.dptr ); + rc, (u_long)id, (char *)k2.dptr ); rc = 0; break; } @@ -900,10 +894,10 @@ idl_old_insert_key( * we started this insert. what can we do * aside from log a warning? */ - LDAPDebug(LDAP_DEBUG_ERR, - "idl_old_insert_key - Not expecting return %d from idl_insert_maxids " + slapi_log_err(SLAPI_LOG_ERR, + "idl_old_insert_key", "Not expecting return %d from idl_insert_maxids " "of id %lu in block with key (%s). Likely database corruption\n", - rc, (u_long)tmp->b_ids[tmp->b_nids-1], k3.dptr ); + rc, (u_long)tmp->b_ids[tmp->b_nids-1], (char *)k3.dptr ); /* FALL */ case 3: /* block is full */ /* @@ -952,7 +946,7 @@ idl_old_insert_key( rc = db->del( db, txn, &k2, 0 ); if ( rc != 0 ) { if (rc == DB_RUNRECOVERY) { - ldbm_nasty("",73,rc); + ldbm_nasty("idl_old_insert_key","db->del",73,rc); } break; } @@ -1133,8 +1127,8 @@ int idl_old_store_block( slapi_ch_free(&(cont_key.data)); if ( ret != 0 && ret != DB_LOCK_DEADLOCK ) { - LDAPDebug(LDAP_DEBUG_ERR, "idl_old_store_block - (%s) BAD %d %s\n", - key->data, ret, dblayer_strerror( ret )); + slapi_log_err(SLAPI_LOG_ERR, "idl_old_store_block", "(%s) BAD %d %s\n", + (char *)key->data, ret, dblayer_strerror( ret )); goto done; } /* Put the lead ID number in the header block */ @@ -1358,8 +1352,8 @@ idl_old_delete_key( IDList *idl, *didl; DBT contkey = {0}; - LDAPDebug(LDAP_DEBUG_TRACE, "=> idl_old_delete_key(%s,%lu)\n", - key->dptr, (u_long)id, 0 ); + slapi_log_err(SLAPI_LOG_TRACE, "idl_old_delete_key", "=> (%s,%lu)\n", + (char *)key->dptr, (u_long)id); idl_Wlock_list(a->ai_idl,key); @@ -1367,12 +1361,12 @@ idl_old_delete_key( idl_unlock_list(a->ai_idl,key); if ( rc != 0 && rc != DB_NOTFOUND && rc != DB_LOCK_DEADLOCK ) { - LDAPDebug(LDAP_DEBUG_ERR, "idl_old_delete_key - (%s) 0 BAD %d %s\n", - key->dptr, rc, (msg = dblayer_strerror( rc )) ? msg : "" ); + slapi_log_err(SLAPI_LOG_ERR, "idl_old_delete_key - (%s) 0 BAD %d %s\n", + (char *)key->dptr, rc, (msg = dblayer_strerror( rc )) ? msg : "" ); } if ( 0 == rc || DB_NOTFOUND == rc ) rc = -666; - LDAPDebug(LDAP_DEBUG_TRACE, "<= idl_old_delete_key(%s,%lu) %d !idl_fetch_one\n", - key->dptr, (u_long)id, rc ); + slapi_log_err(SLAPI_LOG_TRACE, "idl_old_delete_key", "<= (%s,%lu) %d !idl_fetch_one\n", + (char *)key->dptr, (u_long)id, rc ); return rc; } @@ -1384,8 +1378,8 @@ idl_old_delete_key( rc = idl_store( be, db, key, idl, txn ); if ( rc != 0 && rc != DB_LOCK_DEADLOCK ) { - LDAPDebug(LDAP_DEBUG_ERR, "idl_old_delete_key - (%s) 1 BAD %d %s\n", - key->dptr, rc, (msg = dblayer_strerror( rc )) ? msg : "" ); + slapi_log_err(SLAPI_LOG_ERR, "idl_old_delete_key", "(%s) 1 BAD %d %s\n", + (char *)key->dptr, rc, (msg = dblayer_strerror( rc )) ? msg : "" ); } break; @@ -1393,10 +1387,10 @@ idl_old_delete_key( rc = db->del( db, txn, key, 0 ); if ( rc != 0 && rc != DB_LOCK_DEADLOCK ) { - LDAPDebug(LDAP_DEBUG_ERR, "idl_old_delete_key - (%s) 2 BAD %d %s\n", - key->dptr, rc, (msg = dblayer_strerror( rc )) ? msg : "" ); + slapi_log_err(SLAPI_LOG_ERR, "idl_old_delete_key", "(%s) 2 BAD %d %s\n", + (char *)key->dptr, rc, (msg = dblayer_strerror( rc )) ? msg : "" ); if (rc == DB_RUNRECOVERY) { - ldbm_nasty("",74,rc); + ldbm_nasty("idl_old_delete_key", "db->del",74,rc); } } @@ -1408,15 +1402,15 @@ idl_old_delete_key( break; default: - LDAPDebug(LDAP_DEBUG_ERR, "idl_old_delete_key - (%s) 3 BAD idl_delete\n", - key->dptr, 0, 0 ); + slapi_log_err(SLAPI_LOG_ERR, "idl_old_delete_key", "(%s) 3 BAD idl_delete\n", + (char *)key->dptr); break; } idl_free( &idl ); idl_unlock_list(a->ai_idl,key); - LDAPDebug(LDAP_DEBUG_TRACE, "<= idl_old_delete_key(%s,%lu) %d (not indirect)\n", - key->dptr, (u_long)id, rc ); + slapi_log_err(SLAPI_LOG_TRACE, "idl_old_delete_key", "<= (%s,%lu) %d (not indirect)\n", + (char *)key->dptr, (u_long)id, rc ); return( rc ); } @@ -1436,8 +1430,8 @@ idl_old_delete_key( if ( i == 0 && id < idl->b_ids[i] ) { idl_free( &idl ); idl_unlock_list(a->ai_idl,key); - LDAPDebug(LDAP_DEBUG_TRACE, "<= idl_old_delete_key(%s,%lu) -666 (id not found)\n", - key->dptr, (u_long)id, 0 ); + slapi_log_err(SLAPI_LOG_TRACE, "idl_old_delete_key", "<= (%s,%lu) -666 (id not found)\n", + (char *)key->dptr, (u_long)id); return( -666 ); } if ( id != idl->b_ids[i] ) { @@ -1451,11 +1445,11 @@ idl_old_delete_key( idl_unlock_list(a->ai_idl,key); if ( rc != DB_LOCK_DEADLOCK ) { - LDAPDebug(LDAP_DEBUG_ERR, "idl_old_delete_key - (%s) 5 BAD %d %s\n", - contkey.dptr, rc, (msg = dblayer_strerror( rc )) ? msg : "" ); + slapi_log_err(SLAPI_LOG_ERR, "idl_old_delete_key", "(%s) 5 BAD %d %s\n", + (char *)contkey.dptr, rc, (msg = dblayer_strerror( rc )) ? msg : "" ); } - LDAPDebug(LDAP_DEBUG_TRACE, "<= idl_old_delete_key(%s,%lu) %d idl_fetch_one(contkey)\n", - contkey.dptr, (u_long)id, rc ); + slapi_log_err(SLAPI_LOG_TRACE, "idl_old_delete_key", "<= (%s,%lu) %d idl_fetch_one(contkey)\n", + (char *)contkey.dptr, (u_long)id, rc ); slapi_ch_free( (void **)&(contkey.dptr) ); return( rc ); } @@ -1466,8 +1460,8 @@ idl_old_delete_key( if ( (rc = idl_store( be, db, &contkey, didl, txn )) != 0 ) { if ( rc != DB_LOCK_DEADLOCK ) { - LDAPDebug(LDAP_DEBUG_ERR, "idl_old_delete_key - (%s) BAD %d %s\n", - contkey.dptr, rc, (msg = dblayer_strerror( rc )) ? msg : "" ); + slapi_log_err(SLAPI_LOG_ERR, "idl_old_delete_key", "(%s) BAD %d %s\n", + (char *)contkey.dptr, rc, (msg = dblayer_strerror( rc )) ? msg : "" ); } } if (0 != rc) { @@ -1479,8 +1473,8 @@ idl_old_delete_key( rc = idl_change_first( be, db, key, idl, i, &contkey, didl, txn ); if ( rc != 0 && rc != DB_LOCK_DEADLOCK ) { - LDAPDebug(LDAP_DEBUG_ERR, "idl_old_delete_key - (%s) 7 BAD %d %s\n", - contkey.dptr, rc, (msg = dblayer_strerror( rc )) ? msg : "" ); + slapi_log_err(SLAPI_LOG_ERR, "idl_old_delete_key", "(%s) 7 BAD %d %s\n", + (char *)contkey.dptr, rc, (msg = dblayer_strerror( rc )) ? msg : "" ); } if (0 != rc) { idl_check_indirect( idl, i, didl, NULL, "idl_old_delete_key", "1", key, id ); @@ -1495,17 +1489,17 @@ idl_old_delete_key( rc = idl_store( be, db, key, idl, txn ); if ( rc != 0 && rc != DB_LOCK_DEADLOCK ) { - LDAPDebug(LDAP_DEBUG_ERR, "idl_old_delete_key - idl_store(%s) BAD %d %s\n", - key->dptr, rc, (msg = dblayer_strerror( rc )) ? msg : "" ); + slapi_log_err(SLAPI_LOG_ERR, "idl_old_delete_key", "idl_store(%s) BAD %d %s\n", + (char *)key->dptr, rc, (msg = dblayer_strerror( rc )) ? msg : "" ); } } else { /* This index is entirely empty. Delete the header: */ rc = db->del( db, txn, key, 0 ); if ( rc != 0 && rc != DB_LOCK_DEADLOCK ) { - LDAPDebug(LDAP_DEBUG_ERR, "idl_old_delete_key - db->del(%s) 0 BAD %d %s\n", - key->dptr, rc, (msg = dblayer_strerror( rc )) ? msg : "" ); + slapi_log_err(SLAPI_LOG_ERR, "idl_old_delete_key", "db->del(%s) 0 BAD %d %s\n", + (char *)key->dptr, rc, (msg = dblayer_strerror( rc )) ? msg : "" ); if (rc == DB_RUNRECOVERY) { - ldbm_nasty("",75,rc); + ldbm_nasty("idl_old_delete_key", "db->del",75,rc); } } @@ -1514,10 +1508,10 @@ idl_old_delete_key( rc = db->del( db, txn, &contkey, 0 ); if ( rc != 0 && rc != DB_LOCK_DEADLOCK ) { - LDAPDebug(LDAP_DEBUG_ERR, "idl_old_delete_key - db->del(%s) 1 BAD %d %s\n", - contkey.dptr, rc, (msg = dblayer_strerror( rc )) ? msg : "" ); + slapi_log_err(SLAPI_LOG_ERR, "idl_old_delete_key", "db->del(%s) 1 BAD %d %s\n", + (char *)contkey.dptr, rc, (msg = dblayer_strerror( rc )) ? msg : "" ); if (rc == DB_RUNRECOVERY) { - ldbm_nasty("",76,rc); + ldbm_nasty("idl_old_delete_key", "db->del",76,rc); } } } @@ -1528,8 +1522,8 @@ idl_old_delete_key( idl_check_indirect( idl, i, didl, NULL, "idl_old_delete_key", "3", key, id ); break; case 4: /* all ids block - should not happen */ - LDAPDebug(LDAP_DEBUG_ERR, "idl_old_delete_key - cont block (%s) is allids\n", - contkey.dptr, 0, 0 ); + slapi_log_err(SLAPI_LOG_ERR, "idl_old_delete_key", "cont block (%s) is allids\n", + (char *)contkey.dptr); rc = 0; break; } @@ -1539,11 +1533,11 @@ idl_old_delete_key( idl_unlock_list(a->ai_idl,key); if ( rc != 0 && rc != DB_LOCK_DEADLOCK ) { - LDAPDebug(LDAP_DEBUG_ERR, "idl_old_delete_key - (%s) 9 BAD %d %s\n", - key->dptr, rc, (msg = dblayer_strerror( rc )) ? msg : "" ); + slapi_log_err(SLAPI_LOG_ERR, "idl_old_delete_key", "(%s) 9 BAD %d %s\n", + (char *)key->dptr, rc, (msg = dblayer_strerror( rc )) ? msg : "" ); } - LDAPDebug(LDAP_DEBUG_TRACE, "<= idl_old_delete_key(%s,%lu) %d (indirect)\n", - key->dptr, (u_long)id, rc ); + slapi_log_err(SLAPI_LOG_TRACE, "idl_old_delete_key", "<= (%s,%lu) %d (indirect)\n", + (char *)key->dptr, (u_long)id, rc ); return( rc ); } diff --git a/ldap/servers/slapd/back-ldbm/idl_new.c b/ldap/servers/slapd/back-ldbm/idl_new.c index 1d37831..4145a1b 100644 --- a/ldap/servers/slapd/back-ldbm/idl_new.c +++ b/ldap/servers/slapd/back-ldbm/idl_new.c @@ -168,7 +168,7 @@ idl_new_fetch( /* Make a cursor */ ret = db->cursor(db,txn,&cursor,0); if (0 != ret) { - ldbm_nasty(filename,1,ret); + ldbm_nasty("idl_new_fetch",filename,1,ret); cursor = NULL; goto error; } @@ -207,13 +207,13 @@ idl_new_fetch( if (DB_NOTFOUND != ret) { #ifdef DB_USE_BULK_FETCH if (ret == DB_BUFFER_SMALL) { - LDAPDebug(LDAP_DEBUG_ERR, "idl_new_fetch - Database index is corrupt; " + slapi_log_err(SLAPI_LOG_ERR, "idl_new_fetch", "Database index is corrupt; " "data item for key %s is too large for our buffer " "(need=%d actual=%d)\n", - key.data, data.size, data.ulen); + (char *)key.data, data.size, data.ulen); } #endif - ldbm_nasty(filename,2,ret); + ldbm_nasty("idl_new_fetch",filename,2,ret); } goto error; /* Not found is OK, return NULL IDL */ } @@ -231,23 +231,22 @@ idl_new_fetch( if (ptr == NULL) break; if (*(int32_t *)ptr < -1) { - LDAPDebug1Arg(LDAP_DEBUG_TRACE, "idl_new_fetch - " + slapi_log_err(SLAPI_LOG_TRACE, "idl_new_fetch", "DB_MULTIPLE buffer is corrupt; next offset [%d] is less than zero\n", *(int32_t *)ptr); /* retry the read */ break; } if (dataret.size != sizeof(ID)) { - LDAPDebug(LDAP_DEBUG_ERR, "idl_new_fetch - Database index is corrupt; " + slapi_log_err(SLAPI_LOG_ERR, "idl_new_fetch", "Database index is corrupt; " "key %s has a data item with the wrong size (%d)\n", - key.data, dataret.size, 0); + (char *)key.data, dataret.size); goto error; } memcpy(&id, dataret.data, sizeof(ID)); if (id == lastid) { /* dup */ - LDAPDebug1Arg(LDAP_DEBUG_TRACE, "idl_new_fetch - Detected duplicate id " - "%d due to DB_MULTIPLE error - skipping\n", - id); + slapi_log_err(SLAPI_LOG_TRACE, "idl_new_fetch", "Detected duplicate id " + "%d due to DB_MULTIPLE error - skipping\n", id); continue; /* get next one */ } /* note the last id read to check for dups */ @@ -255,8 +254,8 @@ idl_new_fetch( /* we got another ID, add it to our IDL */ idl_rc = idl_append_extend(&idl, id); if (idl_rc) { - LDAPDebug(LDAP_DEBUG_ERR, "idl_new_fetch - Unable to extend id list (err=%d)\n", - idl_rc, 0, 0); + slapi_log_err(SLAPI_LOG_ERR, "idl_new_fetch", "Unable to extend id list (err=%d)\n", + idl_rc); idl_free(&idl); goto error; } @@ -264,7 +263,7 @@ idl_new_fetch( count++; } - LDAPDebug(LDAP_DEBUG_TRACE, "bulk fetch buffer nids=%d\n", count, 0, 0); + slapi_log_err(SLAPI_LOG_TRACE, "idl_new_fetch", "bulk fetch buffer nids=%lu\n", count); #if defined(DB_ALLIDS_ON_READ) /* enforce the allids read limit */ if ((NEW_IDL_NO_ALLID != *flag_err) && (NULL != a) && @@ -272,8 +271,8 @@ idl_new_fetch( idl->b_nids = 1; idl->b_ids[0] = ALLID; ret = DB_NOTFOUND; /* fool the code below into thinking that we finished the dups */ - LDAPDebug(LDAP_DEBUG_BACKLDBM, "idl_new_fetch - search for key for attribute index %s " - "exceeded allidslimit %d - count is %d\n", + slapi_log_err(SLAPI_LOG_BACKLDBM, "idl_new_fetch", "Search for key for attribute index %s " + "exceeded allidslimit %d - count is %lu\n", a->ai_type, allidslimit, count); break; } @@ -293,8 +292,8 @@ idl_new_fetch( /* we got another ID, add it to our IDL */ idl_rc = idl_append_extend(&idl, id); if (idl_rc) { - LDAPDebug1Arg(LDAP_DEBUG_ERR, - "idl_new_fetch - Unable to extend id list (err=%d)\n", idl_rc); + slapi_log_err(SLAPI_LOG_ERR, + "idl_new_fetch", "Unable to extend id list (err=%d)\n", idl_rc); idl_free(&idl); goto error; } @@ -312,7 +311,7 @@ idl_new_fetch( if (ret != DB_NOTFOUND) { idl_free(&idl); - ldbm_nasty(filename,59,ret); + ldbm_nasty("idl_new_fetch",filename,59,ret); goto error; } @@ -322,11 +321,11 @@ idl_new_fetch( if (idl != NULL && idl->b_nids == 1 && idl->b_ids[0] == ALLID) { idl_free(&idl); idl = idl_allids(be); - LDAPDebug(LDAP_DEBUG_TRACE, "idl_new_fetch - %s returns allids\n", - key.data, 0, 0); + slapi_log_err(SLAPI_LOG_TRACE, "idl_new_fetch", "%s returns allids\n", + (char *)key.data); } else { - LDAPDebug(LDAP_DEBUG_TRACE, "idl_new_fetch - %s returns nids=%lu\n", - key.data, (u_long)IDL_NIDS(idl), 0); + slapi_log_err(SLAPI_LOG_TRACE, "idl_new_fetch", "%s returns nids=%lu\n", + (char *)key.data, (u_long)IDL_NIDS(idl)); } error: @@ -334,7 +333,7 @@ error: if (NULL != cursor) { int ret2 = cursor->c_close(cursor); if (ret2) { - ldbm_nasty(filename,3,ret2); + ldbm_nasty("idl_new_fetch",filename,3,ret2); if (!ret) { /* if cursor close returns DEADLOCK, we must bubble that up to the higher layers for retries */ @@ -426,7 +425,7 @@ idl_new_range_fetch( /* Make a cursor */ ret = db->cursor(db, txn, &cursor, 0); if (0 != ret) { - ldbm_nasty(filename,1,ret); + ldbm_nasty("idl_new_range_fetch",filename,1,ret); cursor = NULL; goto error; } @@ -466,12 +465,12 @@ idl_new_range_fetch( if (DB_NOTFOUND != ret) { #ifdef DB_USE_BULK_FETCH if (ret == DB_BUFFER_SMALL) { - LDAPDebug(LDAP_DEBUG_ERR, "idl_new_range_fetch - Database index is corrupt; " + slapi_log_err(SLAPI_LOG_ERR, "idl_new_range_fetch", "Database index is corrupt; " "data item for key %s is too large for our buffer (need=%d actual=%d)\n", - cur_key.data, data.size, data.ulen); + (char *)cur_key.data, data.size, data.ulen); } #endif - ldbm_nasty(filename,2,ret); + ldbm_nasty("idl_new_range_fetch",filename,2,ret); } goto error; /* Not found is OK, return NULL IDL */ } @@ -494,14 +493,14 @@ idl_new_range_fetch( (idl->b_nids > (ID)lookthrough_limit)) { idl_free(&idl); idl = idl_allids( be ); - LDAPDebug0Args(LDAP_DEBUG_TRACE, - "idl_new_range_fetch - lookthrough_limit exceeded\n"); + slapi_log_err(SLAPI_LOG_TRACE, + "idl_new_range_fetch", "lookthrough_limit exceeded\n"); *flag_err = LDAP_ADMINLIMIT_EXCEEDED; goto error; } if ((sizelimit > 0) && (idl->b_nids > (ID)sizelimit)) { - LDAPDebug0Args(LDAP_DEBUG_TRACE, - "idl_new_range_fetch - sizelimit exceeded\n"); + slapi_log_err(SLAPI_LOG_TRACE, + "idl_new_range_fetch", "sizelimit exceeded\n"); *flag_err = LDAP_SIZELIMIT_EXCEEDED; goto error; } @@ -510,8 +509,8 @@ idl_new_range_fetch( if (stoptime > 0) { /* timelimit is set */ curtime = current_time(); if (curtime >= stoptime) { - LDAPDebug0Args(LDAP_DEBUG_TRACE, - "idl_new_range_fetch - timelimit exceeded\n"); + slapi_log_err(SLAPI_LOG_TRACE, + "idl_new_range_fetch", "timelimit exceeded\n"); *flag_err = LDAP_TIMELIMIT_EXCEEDED; goto error; } @@ -525,22 +524,21 @@ idl_new_range_fetch( if (ptr == NULL) break; if (*(int32_t *)ptr < -1) { - LDAPDebug1Arg(LDAP_DEBUG_TRACE, "DB_MULTIPLE buffer is corrupt; " - "next offset [%d] is less than zero\n", - *(int32_t *)ptr); + slapi_log_err(SLAPI_LOG_TRACE, "idl_new_range_fetch", "DB_MULTIPLE buffer is corrupt; " + "next offset [%d] is less than zero\n", *(int32_t *)ptr); /* retry the read */ break; } if (dataret.size != sizeof(ID)) { - LDAPDebug(LDAP_DEBUG_ERR, "idl_new_range_fetch - Database index is corrupt; " + slapi_log_err(SLAPI_LOG_ERR, "idl_new_range_fetch", "Database index is corrupt; " "key %s has a data item with the wrong size (%d)\n", - cur_key.data, dataret.size, 0); + (char *)cur_key.data, dataret.size); goto error; } memcpy(&id, dataret.data, sizeof(ID)); if (id == lastid) { /* dup */ - LDAPDebug1Arg(LDAP_DEBUG_TRACE, "idl_new_range_fetch - " - "Detected duplicate id %d due to DB_MULTIPLE error - skipping\n", id); + slapi_log_err(SLAPI_LOG_TRACE, "idl_new_range_fetch", + "Detected duplicate id %d due to DB_MULTIPLE error - skipping\n", id); continue; /* get next one */ } /* note the last id read to check for dups */ @@ -570,8 +568,8 @@ idl_new_range_fetch( idl_rc = idl_append_extend(&idl, id); } if (idl_rc) { - LDAPDebug1Arg(LDAP_DEBUG_ERR, - "idl_new_range_fetch - Unable to extend id list (err=%d)\n", idl_rc); + slapi_log_err(SLAPI_LOG_ERR, "idl_new_range_fetch", + "Unable to extend id list (err=%d)\n", idl_rc); idl_free(&idl); goto error; } @@ -579,7 +577,8 @@ idl_new_range_fetch( count++; } - LDAPDebug(LDAP_DEBUG_TRACE, "idl_new_range_fetch - Bulk fetch buffer nids=%d\n", count, 0, 0); + slapi_log_err(SLAPI_LOG_TRACE, "idl_new_range_fetch", + "Bulk fetch buffer nids=%lu\n", count); #if defined(DB_ALLIDS_ON_READ) /* enforce the allids read limit */ if ((NEW_IDL_NO_ALLID != *flag_err) && ai && (idl != NULL) && @@ -635,14 +634,14 @@ idl_new_range_fetch( (idl->b_nids > (ID)lookthrough_limit)) { idl_free(&idl); idl = idl_allids( be ); - LDAPDebug0Args(LDAP_DEBUG_TRACE, - "idl_new_range_fetch - lookthrough_limit exceeded\n"); + slapi_log_err(SLAPI_LOG_TRACE, + "idl_new_range_fetch", "lookthrough_limit exceeded\n"); *flag_err = LDAP_ADMINLIMIT_EXCEEDED; goto error; } if ((sizelimit > 0) && (idl->b_nids > (ID)sizelimit)) { - LDAPDebug0Args(LDAP_DEBUG_TRACE, - "idl_new_range_fetch - sizelimit exceeded\n"); + slapi_log_err(SLAPI_LOG_TRACE, + "idl_new_range_fetch", "sizelimit exceeded\n"); *flag_err = LDAP_SIZELIMIT_EXCEEDED; goto error; } @@ -651,8 +650,8 @@ idl_new_range_fetch( if (stoptime > 0) { /* timelimit is set */ curtime = current_time(); if (curtime >= stoptime) { - LDAPDebug0Args(LDAP_DEBUG_TRACE, - "idl_new_range_fetch - timelimit exceeded\n"); + slapi_log_err(SLAPI_LOG_TRACE, + "idl_new_range_fetch", "timelimit exceeded\n"); *flag_err = LDAP_TIMELIMIT_EXCEEDED; goto error; } @@ -682,8 +681,8 @@ idl_new_range_fetch( /* we got another ID, add it to our IDL */ idl_rc = idl_append_extend(&idl, id); if (idl_rc) { - LDAPDebug1Arg(LDAP_DEBUG_ERR, - "idl_new_range_fetch - Unable to extend id list (err=%d)\n", idl_rc); + slapi_log_err(SLAPI_LOG_ERR, "idl_new_range_fetch", + "Unable to extend id list (err=%d)\n", idl_rc); idl_free(&idl); goto error; } @@ -704,7 +703,7 @@ idl_new_range_fetch( ret = 0; /* normal case */ } else { idl_free(&idl); - ldbm_nasty(filename,59,ret); + ldbm_nasty("idl_new_range_fetch",filename,59,ret); goto error; } } @@ -713,11 +712,11 @@ idl_new_range_fetch( if (idl && (idl->b_nids == 1) && (idl->b_ids[0] == ALLID)) { idl_free(&idl); idl = idl_allids(be); - LDAPDebug1Arg(LDAP_DEBUG_TRACE, "idl_new_range_fetch - %s returns allids\n", - cur_key.data); + slapi_log_err(SLAPI_LOG_TRACE, "idl_new_range_fetch", "%s returns allids\n", + (char *)cur_key.data); } else { - LDAPDebug2Args(LDAP_DEBUG_TRACE, "idl_new_range_fetch - %s returns nids=%lu\n", - cur_key.data, (u_long)IDL_NIDS(idl)); + slapi_log_err(SLAPI_LOG_TRACE, "idl_new_range_fetch", "%s returns nids=%lu\n", + (char *)cur_key.data, (u_long)IDL_NIDS(idl)); } error: @@ -726,7 +725,7 @@ error: if (NULL != cursor) { int ret2 = cursor->c_close(cursor); if (ret2) { - ldbm_nasty(filename,3,ret2); + ldbm_nasty("idl_new_range_fetch",filename,3,ret2); if (!ret) { /* if cursor close returns DEADLOCK, we must bubble that up to the higher layers for retries */ @@ -753,7 +752,7 @@ error: if (leftover[i].key && idl_id_is_in_idlist(idl, leftover[i].key)) { idl_rc = idl_append_extend(&idl, leftover[i].id); if (idl_rc) { - LDAPDebug1Arg(LDAP_DEBUG_ERR, "idl_new_range_fetch - " + slapi_log_err(SLAPI_LOG_ERR, "idl_new_range_fetch", "Unable to extend id list (err=%d)\n", idl_rc); idl_free(&idl); return NULL; @@ -788,7 +787,7 @@ int idl_new_insert_key( /* Make a cursor */ ret = db->cursor(db,txn,&cursor,0); if (0 != ret) { - ldbm_nasty(filename,58,ret); + ldbm_nasty("idl_new_insert_key",filename,58,ret); cursor = NULL; goto error; } @@ -806,7 +805,7 @@ int idl_new_insert_key( goto error; /* allid: don't bother inserting any more */ } } else if (DB_NOTFOUND != ret) { - ldbm_nasty(filename,12,ret); + ldbm_nasty("idl_new_insert_key",filename,12,ret); goto error; } if (NULL != disposition) { @@ -822,18 +821,18 @@ int idl_new_insert_key( /* this is okay */ ret = 0; } else { - ldbm_nasty(filename,50,ret); + ldbm_nasty("idl_new_insert_key",filename,50,ret); } } else { /* check for allidslimit exceeded in database */ if (cursor->c_count(cursor, &count, 0) != 0) { - LDAPDebug(LDAP_DEBUG_ERR, "idl_new_insert_key - Could not obtain count for key %s\n", - key->data, 0, 0); + slapi_log_err(SLAPI_LOG_ERR, "idl_new_insert_key", "Could not obtain count for key %s\n", + (char *)key->data); goto error; } if ((size_t)count > idl_new_get_allidslimit(a, 0)) { - LDAPDebug(LDAP_DEBUG_TRACE, "idl_new_insert_key - allidslimit exceeded for key %s\n", - key->data, 0, 0); + slapi_log_err(SLAPI_LOG_TRACE, "idl_new_insert_key", "allidslimit exceeded for key %s\n", + (char *)key->data); cursor->c_close(cursor); cursor = NULL; if ((ret = idl_new_store_allids(be, db, key, txn)) == 0) { @@ -847,7 +846,7 @@ error: if (NULL != cursor) { int ret2 = cursor->c_close(cursor); if (ret2) { - ldbm_nasty(filename,56,ret2); + ldbm_nasty("idl_new_insert_key",filename,56,ret2); } } #else @@ -867,7 +866,7 @@ error: /* this is okay */ ret = 0; } else { - ldbm_nasty(filename,60,ret); + ldbm_nasty("idl_new_insert_key",filename,60,ret); } } #endif @@ -891,7 +890,7 @@ int idl_new_delete_key( /* Make a cursor */ ret = db->cursor(db,txn,&cursor,0); if (0 != ret) { - ldbm_nasty(filename,21,ret); + ldbm_nasty("idl_new_delete_key",filename,21,ret); cursor = NULL; goto error; } @@ -909,7 +908,7 @@ int idl_new_delete_key( if (DB_NOTFOUND == ret) { ret = 0; /* Not Found is OK, return immediately */ } else { - ldbm_nasty(filename,22,ret); + ldbm_nasty("idl_new_delete_key",filename,22,ret); } goto error; } @@ -920,7 +919,7 @@ error: if (NULL != cursor) { int ret2 = cursor->c_close(cursor); if (ret2) { - ldbm_nasty(filename,24,ret2); + ldbm_nasty("idl_new_delete_key",filename,24,ret2); if (!ret) { /* if cursor close returns DEADLOCK, we must bubble that up to the higher layers for retries */ @@ -964,7 +963,7 @@ static int idl_new_store_allids(backend *be, DB *db, DBT *key, DB_TXN *txn) ret = cursor->c_del(cursor,0); } if (0 != ret && DB_NOTFOUND != ret) { - ldbm_nasty(filename,54,ret); + ldbm_nasty("idl_new_store_allids",filename,54,ret); goto error; } else { ret = 0; @@ -973,7 +972,7 @@ static int idl_new_store_allids(backend *be, DB *db, DBT *key, DB_TXN *txn) if (DB_NOTFOUND == ret) { ret = 0; /* Not Found is OK */ } else { - ldbm_nasty(filename,32,ret); + ldbm_nasty("idl_new_store_allids",filename,32,ret); goto error; } } @@ -982,19 +981,19 @@ static int idl_new_store_allids(backend *be, DB *db, DBT *key, DB_TXN *txn) id = ALLID; ret = cursor->c_put(cursor, key, &data, DB_NODUPDATA); if (0 != ret) { - ldbm_nasty(filename,53,ret); + ldbm_nasty("idl_new_store_allids",filename,53,ret); goto error; } - LDAPDebug(LDAP_DEBUG_TRACE, "idl_new_store_allids - key %s has been set to allids\n", - key->data, 0, 0); + slapi_log_err(SLAPI_LOG_TRACE, "idl_new_store_allids", "Key %s has been set to allids\n", + (char *)key->data); error: /* Close the cursor */ if (NULL != cursor) { int ret2 = cursor->c_close(cursor); if (ret2) { - ldbm_nasty(filename,33,ret2); + ldbm_nasty("idl_new_store_allids",filename,33,ret2); } } return ret; @@ -1044,7 +1043,7 @@ int idl_new_store_block( /* Make a cursor */ ret = db->cursor(db,txn,&cursor,0); if (0 != ret) { - ldbm_nasty(filename,41,ret); + ldbm_nasty("idl_new_store_block",filename,41,ret); cursor = NULL; goto error; } @@ -1060,7 +1059,7 @@ int idl_new_store_block( if (ret == DB_NOTFOUND) { ret = 0; } else if (ret != 0) { - ldbm_nasty(filename,47,ret); + ldbm_nasty("idl_new_store_block",filename,47,ret); goto error; } @@ -1073,7 +1072,7 @@ int idl_new_store_block( if (DB_KEYEXIST == ret) { ret = 0; /* exist is okay */ } else { - ldbm_nasty(filename,48,ret); + ldbm_nasty("idl_new_store_block",filename,48,ret); goto error; } } @@ -1081,14 +1080,13 @@ int idl_new_store_block( #if defined(DB_ALLIDS_ON_WRITE) /* check for allidslimit exceeded in database */ if (cursor->c_count(cursor, &count, 0) != 0) { - LDAPDebug(LDAP_DEBUG_ERR, "idl_new_store_block - " - "could not obtain count for key %s\n", key->data, 0, 0); + slapi_log_err(SLAPI_LOG_ERR, "idl_new_store_block", + "could not obtain count for key %s\n", (char *)key->data); goto error; } if ((size_t)count > idl_new_get_allidslimit(a, 0)) { - LDAPDebug(LDAP_DEBUG_TRACE, "idl_new_store_block - " - "allidslimit exceeded for key %s\n", - key->data, 0, 0); + slapi_log_err(SLAPI_LOG_TRACE, "idl_new_store_block", + "allidslimit exceeded for key %s\n", (char *)key->data); cursor->c_close(cursor); cursor = NULL; ret = idl_new_store_allids(be, db, key, txn); @@ -1100,7 +1098,7 @@ error: if (NULL != cursor) { int ret2 = cursor->c_close(cursor); if (ret2) { - ldbm_nasty(filename,49,ret2); + ldbm_nasty("idl_new_store_block",filename,49,ret2); if (!ret) { /* if cursor close returns DEADLOCK, we must bubble that up to the higher layers for retries */ diff --git a/ldap/servers/slapd/back-ldbm/import-threads.c b/ldap/servers/slapd/back-ldbm/import-threads.c index f08f0b3..1cc7b42 100644 --- a/ldap/servers/slapd/back-ldbm/import-threads.c +++ b/ldap/servers/slapd/back-ldbm/import-threads.c @@ -68,9 +68,9 @@ static int import_generate_uniqueid(ImportJob *job, Slapi_Entry *e) if (rc == UID_SUCCESS) { slapi_entry_set_uniqueid (e, newuniqueid); } else { - LDAPDebug(LDAP_DEBUG_ERR, "import_generate_uniqueid - " + slapi_log_err(SLAPI_LOG_ERR, "import_generate_uniqueid", "Failed to generate uniqueid for %s; error=%d.\n", - slapi_entry_get_dn_const(e), rc, 0 ); + slapi_entry_get_dn_const(e), rc); } } @@ -915,7 +915,7 @@ index_producer(void *param) /* open id2entry with dedicated db env and db handler */ if ( dblayer_get_aux_id2entry( be, &db, &env, &id2entry ) != 0 || db == NULL || env == NULL) { - LDAPDebug0Args(LDAP_DEBUG_ERR, "index_producer - Could not open id2entry\n" ); + slapi_log_err(SLAPI_LOG_ERR, "index_producer", "Could not open id2entry\n" ); goto error; } if (job->flags & FLAG_DN2RDN) { @@ -923,7 +923,7 @@ index_producer(void *param) if ( dblayer_get_aux_id2entry_ext( be, &tmp_db, &env, &tmpid2entry, DBLAYER_AUX_ID2ENTRY_TMP ) != 0 || tmp_db == NULL || env == NULL) { - LDAPDebug0Args(LDAP_DEBUG_ERR, "index_producer - Could not open new id2entry\n"); + slapi_log_err(SLAPI_LOG_ERR, "index_producer", "Could not open new id2entry\n"); goto error; } } @@ -931,8 +931,8 @@ index_producer(void *param) /* get a cursor to we can walk over the table */ db_rval = db->cursor(db, NULL, &dbc, 0); if ( db_rval || !dbc ) { - LDAPDebug(LDAP_DEBUG_ERR, - "index_producer - Failed to get cursor for reindexing\n", 0, 0, 0 ); + slapi_log_err(SLAPI_LOG_ERR, + "index_producer", "Failed to get cursor for reindexing\n"); dblayer_release_id2entry(be, db); goto error; } @@ -967,7 +967,7 @@ index_producer(void *param) if (0 != db_rval) { if (DB_NOTFOUND != db_rval) { - LDAPDebug(LDAP_DEBUG_ERR, "index_producer - %s: Failed to read database, " + slapi_log_err(SLAPI_LOG_ERR, "index_producer", "%s: Failed to read database, " "errno=%d (%s)\n", inst->inst_name, db_rval, dblayer_strerror(db_rval)); if (job->task) { @@ -1003,8 +1003,8 @@ index_producer(void *param) /* store it in the new id2entry db file */ rc = tmp_db->put( tmp_db, NULL, &key, &data, 0); if (rc) { - LDAPDebug2Args(LDAP_DEBUG_TRACE, - "index_producer - Converting an entry " + slapi_log_err(SLAPI_LOG_TRACE, + "index_producer", "Converting an entry " "from dn format to rdn format failed " "(dn: %s, ID: %d)\n", slapi_entry_get_dn_const(e), temp_id); @@ -1014,8 +1014,7 @@ index_producer(void *param) } } else { char *normdn = NULL; - struct backdn *bdn = - dncache_find_id(&inst->inst_dncache, temp_id); + struct backdn *bdn = dncache_find_id(&inst->inst_dncache, temp_id); if (bdn) { /* don't free dn */ normdn = (char *)slapi_sdn_get_dn(bdn->dn_sdn); @@ -1030,8 +1029,8 @@ index_producer(void *param) char *pid_str = NULL; char *pdn = NULL; - LDAPDebug2Args(LDAP_DEBUG_TRACE, - "index_producer - entryrdn is not available; " + slapi_log_err(SLAPI_LOG_TRACE, + "index_producer", "entryrdn is not available; " "composing dn (rdn: %s, ID: %d)\n", rdn, temp_id); rc = get_value_from_string((const char *)data.dptr, @@ -1046,8 +1045,8 @@ index_producer(void *param) rc = import_get_and_add_parent_rdns(info, inst, db, pid, &id, &psrdn, &curr_entry); if (rc) { - LDAPDebug2Args(LDAP_DEBUG_ANY, "index_producer - " - "Failed to compose dn for (rdn: %s, ID: %d)\n",\ + slapi_log_err(SLAPI_LOG_ERR, "index_producer", + "Failed to compose dn for (rdn: %s, ID: %d)\n", rdn, temp_id); slapi_ch_free_string(&rdn); slapi_rdn_done(&psrdn); @@ -1057,7 +1056,7 @@ index_producer(void *param) rc = slapi_rdn_get_dn(&psrdn, &pdn); slapi_rdn_done(&psrdn); if (rc) { - LDAPDebug2Args(LDAP_DEBUG_ANY, "index_producer - " + slapi_log_err(SLAPI_LOG_ERR, "index_producer", "Failed to compose dn for (rdn: %s, ID: %d) from Slapi_RDN\n", rdn, temp_id); slapi_ch_free_string(&rdn); @@ -1074,7 +1073,7 @@ index_producer(void *param) bdn = backdn_init(sdn, temp_id, 0); CACHE_ADD( &inst->inst_dncache, bdn, NULL ); CACHE_RETURN(&inst->inst_dncache, &bdn); - slapi_log_error(SLAPI_LOG_CACHE, "index_producer - ", + slapi_log_err(SLAPI_LOG_CACHE, "index_producer - ", "entryrdn_lookup_dn returned: %s, " "and set to dn cache\n", normdn); } @@ -1090,9 +1089,9 @@ index_producer(void *param) "%s: WARNING: skipping badly formatted entry (id %lu)", inst->inst_name, (u_long)temp_id); } - LDAPDebug(LDAP_DEBUG_WARNING, - "index_producer - %s: Skipping badly formatted entry (id %lu)\n", - inst->inst_name, (u_long)temp_id, 0); + slapi_log_err(SLAPI_LOG_WARNING, + "index_producer", "%s: Skipping badly formatted entry (id %lu)\n", + inst->inst_name, (u_long)temp_id); continue; } } @@ -1118,26 +1117,26 @@ index_producer(void *param) tmp_db->close(tmp_db, 0); rc = db_create(&db, env, 0); if (rc) { - LDAPDebug1Arg(LDAP_DEBUG_ERR, "index_producer - " + slapi_log_err(SLAPI_LOG_ERR, "index_producer", "Creating db handle to remove %s failed.\n", id2entry); goto bail; } rc = db->remove(db, id2entry, NULL, 0); if (rc) { - LDAPDebug1Arg(LDAP_DEBUG_ERR, "index_producer - " + slapi_log_err(SLAPI_LOG_ERR, "index_producer", "Removing %s failed.\n", id2entry); goto bail; } rc = db_create(&db, env, 0); if (rc) { - LDAPDebug2Args(LDAP_DEBUG_ERR, "index_producer - " + slapi_log_err(SLAPI_LOG_ERR, "index_producer", "Creating db handle to rename %s to %s failed.\n", tmpid2entry, id2entry); goto bail; } rc = db->rename(db, tmpid2entry, NULL, id2entry, 0); if (rc) { - LDAPDebug2Args(LDAP_DEBUG_ERR, "index_producer - " + slapi_log_err(SLAPI_LOG_ERR, "index_producer", "Renaming %s to %s failed.\n", tmpid2entry, id2entry); goto bail; @@ -1158,7 +1157,7 @@ error: tmp_db->close(tmp_db, 0); rc = db_create(&tmp_db, env, 0); if (rc) { - LDAPDebug1Arg(LDAP_DEBUG_ERR, "index_producer - " + slapi_log_err(SLAPI_LOG_ERR, "index_producer", "Creating db handle to remove %s s failed.\n", tmpid2entry); goto bail; @@ -1166,7 +1165,7 @@ error: /* remove tmp */ rc = tmp_db->remove(tmp_db, tmpid2entry, NULL, 0); if (rc) { - LDAPDebug1Arg(LDAP_DEBUG_ERR, "index_producer - " + slapi_log_err(SLAPI_LOG_ERR, "index_producer", "Removing %s failed.\n", tmpid2entry); goto bail; } @@ -1262,14 +1261,14 @@ add_IDs_to_IDarray(ID ***dn_norm_sp_conflict, int *max, int i, char *strids) } p = PL_strchr(strids, ':'); if (NULL == p) { - LDAPDebug1Arg(LDAP_DEBUG_ERR, "add_IDs_to_IDarray - " + slapi_log_err(SLAPI_LOG_ERR, "add_IDs_to_IDarray", "Format error: no ':' in %s\n", strids); return 1; } *p = '\0'; my_id = (ID)strtol(strids, (char **)NULL, 10); if (!my_id) { - LDAPDebug1Arg(LDAP_DEBUG_ERR, "add_IDs_to_IDarray - " + slapi_log_err(SLAPI_LOG_ERR, "add_IDs_to_IDarray", "Invalid ID in %s\n", strids); return 1; } @@ -1466,7 +1465,7 @@ upgradedn_producer(void *param) if (!chk_dn_norm && !chk_dn_norm_sp) { /* Nothing to do... */ - LDAPDebug0Args(LDAP_DEBUG_ERR, "upgradedn_producer - " + slapi_log_err(SLAPI_LOG_ERR, "upgradedn_producer", "UpgradeDnFormat is not required.\n"); info->state = FINISHED; goto done; @@ -1484,7 +1483,7 @@ upgradedn_producer(void *param) /* open id2entry with dedicated db env and db handler */ if ( dblayer_get_aux_id2entry( be, &db, &env, NULL ) != 0 || db == NULL || env == NULL) { - LDAPDebug0Args(LDAP_DEBUG_ERR, "upgradedn_producer - " + slapi_log_err(SLAPI_LOG_ERR, "upgradedn_producer", "Could not open id2entry\n"); goto error; } @@ -1492,7 +1491,7 @@ upgradedn_producer(void *param) /* get a cursor to we can walk over the table */ db_rval = db->cursor(db, NULL, &dbc, 0); if ( db_rval || !dbc ) { - LDAPDebug0Args(LDAP_DEBUG_ERR, "upgradedn_producer - " + slapi_log_err(SLAPI_LOG_ERR, "upgradedn_producer", "Failed to get cursor for reindexing\n"); dblayer_release_id2entry(be, db); goto error; @@ -1527,14 +1526,14 @@ upgradedn_producer(void *param) if (0 != db_rval) { if (DB_NOTFOUND == db_rval) { - LDAPDebug1Arg(LDAP_DEBUG_ERR, "upgradedn_producer - " + slapi_log_err(SLAPI_LOG_ERR, "upgradedn_producer", "%s: Finished reading database\n", inst->inst_name); if (job->task) { slapi_task_log_notice(job->task, "%s: Finished reading database", inst->inst_name); } } else { - LDAPDebug(LDAP_DEBUG_ERR, "%s: Failed to read database, " + slapi_log_err(SLAPI_LOG_ERR, "upgradedn_producer", "%s: Failed to read database, " "errno=%d (%s)\n", inst->inst_name, db_rval, dblayer_strerror(db_rval)); if (job->task) { @@ -1589,7 +1588,7 @@ upgradedn_producer(void *param) char *pid_str = NULL; char *pdn = NULL; - LDAPDebug2Args(LDAP_DEBUG_TRACE, "upgradedn_producer - " + slapi_log_err(SLAPI_LOG_TRACE, "upgradedn_producer", "entryrdn is not available; composing dn (rdn: %s, ID: %d)\n", rdn, temp_id); rc = get_value_from_string((const char *)data.dptr, @@ -1604,7 +1603,7 @@ upgradedn_producer(void *param) rc = import_get_and_add_parent_rdns(info, inst, db, pid, &id, &psrdn, &curr_entry); if (rc) { - LDAPDebug2Args(LDAP_DEBUG_ANY, + slapi_log_err(SLAPI_LOG_ERR, "uptradedn: Failed to compose dn for " "(rdn: %s, ID: %d)\n", rdn, temp_id); slapi_ch_free_string(&rdn); @@ -1615,7 +1614,7 @@ upgradedn_producer(void *param) rc = slapi_rdn_get_dn(&psrdn, &pdn); slapi_rdn_done(&psrdn); if (rc) { - LDAPDebug2Args(LDAP_DEBUG_ANY, "upgradedn_producer - " + slapi_log_err(SLAPI_LOG_ERR, "upgradedn_producer", "Failed to compose dn for (rdn: %s, ID: %d) from Slapi_RDN\n", rdn, temp_id); slapi_ch_free_string(&rdn); @@ -1640,7 +1639,7 @@ upgradedn_producer(void *param) CACHE_RETURN(&inst->inst_dncache, &bdn); /* don't free this normdn */ normdn = (char *)slapi_sdn_get_dn(sdn); - slapi_log_error(SLAPI_LOG_CACHE, "upgradedn_producer", + slapi_log_err(SLAPI_LOG_CACHE, "upgradedn_producer", "entryrdn_lookup_dn returned: %s, " "and set to dn cache\n", normdn); dn_in_cache = 1; @@ -1666,9 +1665,9 @@ upgradedn_producer(void *param) "%s: WARNING: skipping badly formatted entry (id %lu)", inst->inst_name, (u_long)temp_id); } - LDAPDebug(LDAP_DEBUG_WARNING, "upgradedn_producer - " + slapi_log_err(SLAPI_LOG_WARNING, "upgradedn_producer", "%s: Skipping badly formatted entry (id %lu)\n", - inst->inst_name, (u_long)temp_id, 0); + inst->inst_name, (u_long)temp_id); continue; } @@ -1711,7 +1710,7 @@ upgradedn_producer(void *param) slapi_task_log_notice(job->task, "%s: No DNs to fix.\n", inst->inst_name); } - LDAPDebug1Arg(LDAP_DEBUG_ERR, + slapi_log_err(SLAPI_LOG_ERR, "upgradedn_producer", "%s: No DNs to fix.\n", inst->inst_name); slapi_ch_free_string(&path); goto bail; @@ -1724,7 +1723,7 @@ upgradedn_producer(void *param) "%s: Error: failed to open a file \"%s\"", inst->inst_name, path); } - LDAPDebug2Args(LDAP_DEBUG_ERR, "upgradedn_producer - " + slapi_log_err(SLAPI_LOG_ERR, "upgradedn_producer", "%s: Error: failed to open a file \"%s\"\n", inst->inst_name, path); slapi_ch_free_string(&path); @@ -1744,7 +1743,7 @@ upgradedn_producer(void *param) "%s: Error: failed to write a line \"%s\"", inst->inst_name, dn_id); } - LDAPDebug2Args(LDAP_DEBUG_ERR, "upgradedn_producer - " + slapi_log_err(SLAPI_LOG_ERR, "upgradedn_producer", "%s: Error: failed to write a line \"%s\"", inst->inst_name, dn_id); slapi_ch_free_string(&dn_id); @@ -1772,9 +1771,8 @@ upgradedn_producer(void *param) } if (add_IDs_to_IDarray(&dn_norm_sp_conflicts, &my_max, my_idx, buf)) { - LDAPDebug1Arg(LDAP_DEBUG_ERR, "upgradedn_producer - " - "Failed to set IDs %s to conflict list\n", - buf); + slapi_log_err(SLAPI_LOG_ERR, "upgradedn_producer", + "Failed to set IDs %s to conflict list\n", buf); goto error; } my_idx++; @@ -1786,10 +1784,10 @@ upgradedn_producer(void *param) char *newrdn = slapi_create_dn_string("%s %u", rdn, temp_id); char *parentdn = slapi_dn_parent(normdn); /* This entry is a conflict of alt_id */ - LDAPDebug(LDAP_DEBUG_NOTICE, "upgradedn_producer - " - "Entry %s (%lu) is a conflict of (%lu)\n", + slapi_log_err(SLAPI_LOG_NOTICE, "upgradedn_producer", + "Entry %s (%u) is a conflict of (%u)\n", normdn, temp_id, alt_id); - LDAPDebug2Args(LDAP_DEBUG_NOTICE, "upgradedn_producer - " + slapi_log_err(SLAPI_LOG_NOTICE, "upgradedn_producer", "Renaming \"%s\" to \"%s\"\n", rdn, newrdn); if (!dn_in_cache) { /* If not in dn cache, normdn needs to be freed. */ @@ -1808,7 +1806,7 @@ upgradedn_producer(void *param) slapi_ch_strdup(rdn), 0); rc = slapi_entry_add_rdn_values(e); if (rc) { - LDAPDebug(LDAP_DEBUG_ERR, "upgradedn_producer - " + slapi_log_err(SLAPI_LOG_ERR, "upgradedn_producer", "%s: Failed to add rdn values to an entry: %s (id %lu)\n", inst->inst_name, normdn, (u_long)temp_id); goto error; @@ -1826,7 +1824,7 @@ upgradedn_producer(void *param) bdn = backdn_init(sdn, temp_id, 0); CACHE_ADD(&inst->inst_dncache, bdn, NULL); CACHE_RETURN(&inst->inst_dncache, &bdn); - slapi_log_error(SLAPI_LOG_CACHE, "upgradedn_producer", + slapi_log_err(SLAPI_LOG_CACHE, "upgradedn_producer", "set dn %s to dn cache\n", normdn); } /* Check DN syntax attr values if it contains '\\' or not */ @@ -1838,7 +1836,7 @@ upgradedn_producer(void *param) rdnp = PL_strchr(rdn, '='); if (NULL == rdnp) { - LDAPDebug(LDAP_DEBUG_WARNING, "upgradedn_producer - " + slapi_log_err(SLAPI_LOG_WARNING, "upgradedn_producer", "%s: Skipping an entry with corrupted RDN \"%s\" (id %lu)\n", inst->inst_name, rdn, (u_long)temp_id); slapi_entry_free(e); e = NULL; @@ -1859,7 +1857,7 @@ upgradedn_producer(void *param) upgradedn_add_to_list(&ud_list, slapi_ch_strdup(LDBM_ENTRYRDN_STR), slapi_ch_strdup(rdn), 0); - LDAPDebug2Args(LDAP_DEBUG_TRACE, "upgradedn_producer - " + slapi_log_err(SLAPI_LOG_TRACE, "upgradedn_producer", "%s: Found upgradedn candidate: (id %lu)\n", inst->inst_name, (u_long)temp_id); /* @@ -1868,7 +1866,7 @@ upgradedn_producer(void *param) */ rc = slapi_entry_add_rdn_values(e); if (rc) { - LDAPDebug(LDAP_DEBUG_ERR, "upgradedn_producer - " + slapi_log_err(SLAPI_LOG_ERR, "upgradedn_producer", "%s: Failed to add rdn values to an entry: %s (id %lu)\n", inst->inst_name, normdn, (u_long)temp_id); slapi_entry_free(e); e = NULL; @@ -1931,7 +1929,7 @@ upgradedn_producer(void *param) slapi_ch_strdup(a->a_type), slapi_ch_strdup(*ud_valp), isentrydn?0:OLD_DN_NORMALIZE); - LDAPDebug(LDAP_DEBUG_TRACE, "upgradedn_producer - " + slapi_log_err(SLAPI_LOG_TRACE, "upgradedn_producer", "%s: Found upgradedn candidate: %s (id %lu)\n", inst->inst_name, valueptr, (u_long)temp_id); if (!entryrdn_get_switch() && isentrydn) { @@ -1943,7 +1941,7 @@ upgradedn_producer(void *param) */ rc = slapi_entry_add_rdn_values(e); if (rc) { - LDAPDebug(LDAP_DEBUG_ERR, "upgradedn_producer - " + slapi_log_err(SLAPI_LOG_ERR, "upgradedn_producer", "%s: Failed to add rdn values to an entry: %s (id %lu)\n", inst->inst_name, normdn, (u_long)temp_id); slapi_entry_free(e); e = NULL; @@ -1971,7 +1969,7 @@ upgradedn_producer(void *param) charray_free(ud_vals); ud_vals = NULL; if (skipit) { - LDAPDebug(LDAP_DEBUG_WARNING, "upgradedn_producer - " + slapi_log_err(SLAPI_LOG_WARNING, "upgradedn_producer", "%s: Skipping an entry with a corrupted dn (syntax value): %s (id %lu)\n", inst->inst_name, workdn?workdn:"unknown", (u_long)temp_id); slapi_ch_free_string(&workdn); @@ -3036,8 +3034,8 @@ import_worker(void *param) error: if (ret == DB_RUNRECOVERY) { - LDAPDebug(LDAP_DEBUG_CRIT, "import_worker - " - "Cannot import; database recovery needed\n", 0,0,0); + slapi_log_err(SLAPI_LOG_CRIT, "import_worker", + "Cannot import; database recovery needed\n"); } else if (ret == DB_LOCK_DEADLOCK) { /* can this occur? */ } @@ -3072,7 +3070,7 @@ static int bulk_import_start(Slapi_PBlock *pb) slapi_pblock_get(pb, SLAPI_BACKEND, &be); if (be == NULL) { - LDAPDebug0Args(LDAP_DEBUG_ERR, "bulk_import_start - Backend is not set\n"); + slapi_log_err(SLAPI_LOG_ERR, "bulk_import_start", "Backend is not set\n"); return -1; } job = CALLOC(ImportJob); @@ -3084,9 +3082,9 @@ static int bulk_import_start(Slapi_PBlock *pb) PR_Lock(job->inst->inst_config_mutex); if (job->inst->inst_flags & INST_FLAG_BUSY) { PR_Unlock(job->inst->inst_config_mutex); - LDAPDebug(LDAP_DEBUG_WARNING, "bulk_import_start - " + slapi_log_err(SLAPI_LOG_WARNING, "bulk_import_start", "'%s' is already in the middle of another task and cannot be disturbed.\n", - job->inst->inst_name, 0, 0); + job->inst->inst_name); FREE(job); return SLAPI_BI_ERR_BUSY; } @@ -3154,9 +3152,9 @@ static int bulk_import_start(Slapi_PBlock *pb) SLAPD_DEFAULT_THREAD_STACKSIZE); if (thread == NULL) { PRErrorCode prerr = PR_GetError(); - LDAPDebug(LDAP_DEBUG_ERR, "bulk_import_start - " + slapi_log_err(SLAPI_LOG_ERR, "bulk_import_start", "Unable to spawn import thread, " SLAPI_COMPONENT_NAME_NSPR " error %d (%s)\n", - prerr, slapd_pr_strerror(prerr), 0); + prerr, slapd_pr_strerror(prerr)); PR_Unlock(job->wire_lock); ret = -2; goto fail; @@ -3303,7 +3301,7 @@ static int bulk_import_queue(ImportJob *job, Slapi_Entry *entry) if (sepp) { Slapi_RDN mysrdn = {0}; if (slapi_rdn_init_all_dn(&mysrdn, sepp + 1)) { - slapi_log_error(SLAPI_LOG_ERR, "bulk_import_queue", + slapi_log_err(SLAPI_LOG_ERR, "bulk_import_queue", "Failed to convert DN %s to RDN\n", sepp + 1); slapi_ch_free_string(&tombstone_rdn); /* entry is released in the frontend on failure*/ @@ -3383,8 +3381,8 @@ void factory_destructor(void *extension, void *object, void *parent) * aborted! */ thread = job->main_thread; - LDAPDebug(LDAP_DEBUG_ERR, "factory_destructor - " - "ERROR bulk import abandoned\n", 0, 0, 0); + slapi_log_err(SLAPI_LOG_ERR, "factory_destructor", + "ERROR bulk import abandoned\n"); import_abort_all(job, 1); /* wait for import_main to finish... */ PR_JoinThread(thread); @@ -3409,7 +3407,7 @@ int ldbm_back_wire_import(Slapi_PBlock *pb) slapi_pblock_get(pb, SLAPI_BACKEND, &be); if (be == NULL) { - LDAPDebug0Args(LDAP_DEBUG_ERR, "ldbm_back_wire_import - " + slapi_log_err(SLAPI_LOG_ERR, "ldbm_back_wire_import", "Backend is not set\n"); return -1; } @@ -3471,8 +3469,8 @@ int ldbm_back_wire_import(Slapi_PBlock *pb) } /* ??? unknown state */ - LDAPDebug(LDAP_DEBUG_ERR, "ldbm_back_wire_import - " - "ERROR: unknown state %d\n", state, 0, 0); + slapi_log_err(SLAPI_LOG_ERR, "ldbm_back_wire_import", + "ERROR: unknown state %d\n", state); return -1; } @@ -3510,14 +3508,14 @@ dse_conf_backup_core(struct ldbminfo *li, char *dest_dir, char *file_name, char { filename = slapi_ch_smprintf("%s/%s", dest_dir, file_name); } - LDAPDebug(LDAP_DEBUG_TRACE, "dse_conf_backup_core - " - "(%s): backup file %s\n", filter, filename, 0); + slapi_log_err(SLAPI_LOG_TRACE, "dse_conf_backup_core", + "(%s): backup file %s\n", filter, filename); /* Open the file to write */ if ((prfd = PR_Open(filename, PR_RDWR | PR_CREATE_FILE | PR_TRUNCATE, SLAPD_DEFAULT_FILE_MODE)) == NULL) { - LDAPDebug(LDAP_DEBUG_ERR, "dse_conf_backup_core - " + slapi_log_err(SLAPI_LOG_ERR, "dse_conf_backup_core", "(%s): open %s failed: (%s)\n", filter, filename, slapd_pr_strerror(PR_GetError())); rval = -1; @@ -3526,8 +3524,8 @@ dse_conf_backup_core(struct ldbminfo *li, char *dest_dir, char *file_name, char srch_pb = slapi_pblock_new(); if (!srch_pb) { - LDAPDebug(LDAP_DEBUG_ERR, "dse_conf_backup_core - " - "(%s): out of memory\n", filter, 0, 0); + slapi_log_err(SLAPI_LOG_ERR, "dse_conf_backup_core", + "(%s): out of memory\n", filter); rval = -1; goto out; } @@ -3539,8 +3537,8 @@ dse_conf_backup_core(struct ldbminfo *li, char *dest_dir, char *file_name, char for (ep = entries; ep != NULL && *ep != NULL; ep++) { size_t l = strlen(slapi_entry_get_dn_const(*ep)) + 5 /* "dn: \n" */; - LDAPDebug(LDAP_DEBUG_TRACE, "dse_conf_backup_core - " - "dn: %s\n", slapi_entry_get_dn_const(*ep), 0, 0); + slapi_log_err(SLAPI_LOG_TRACE, "dse_conf_backup_core", + "dn: %s\n", slapi_entry_get_dn_const(*ep)); if (l <= sizeof(tmpbuf)) tp = tmpbuf; @@ -3550,9 +3548,9 @@ dse_conf_backup_core(struct ldbminfo *li, char *dest_dir, char *file_name, char prrval = PR_Write(prfd, tp, l); if ((size_t)prrval != l) { - LDAPDebug(LDAP_DEBUG_ERR, "dse_conf_backup_core - " - "(%s): write %s failed: %d (%s)\n", - filter, PR_GetError(), slapd_pr_strerror(PR_GetError())); + slapi_log_err(SLAPI_LOG_ERR, "dse_conf_backup_core", + "(%s): write %lu failed: %d (%s)\n", + filter, l, PR_GetError(), slapd_pr_strerror(PR_GetError())); rval = -1; if (l > sizeof(tmpbuf)) slapi_ch_free_string(&tp); @@ -3579,8 +3577,8 @@ dse_conf_backup_core(struct ldbminfo *li, char *dest_dir, char *file_name, char { attr_val = slapi_value_get_berval(sval); l = strlen(attr_val->bv_val) + attr_name_len + 3; /* : \n" */ - LDAPDebug(LDAP_DEBUG_TRACE, "dse_conf_backup_core - " - "%s: %s\n", attr_name, attr_val->bv_val, 0); + slapi_log_err(SLAPI_LOG_TRACE, "dse_conf_backup_core", + "%s: %s\n", attr_name, attr_val->bv_val); if (l <= sizeof(tmpbuf)) tp = tmpbuf; else @@ -3589,9 +3587,9 @@ dse_conf_backup_core(struct ldbminfo *li, char *dest_dir, char *file_name, char prrval = PR_Write(prfd, tp, l); if ((size_t)prrval != l) { - LDAPDebug(LDAP_DEBUG_ERR, "dse_conf_backup_core - " - "%s): write %s failed: %d (%s)\n", - filter, PR_GetError(), slapd_pr_strerror(PR_GetError())); + slapi_log_err(SLAPI_LOG_ERR, "dse_conf_backup_core", + "(%s): write %lu failed: %d (%s)\n", + filter, l, PR_GetError(), slapd_pr_strerror(PR_GetError())); rval = -1; if (l > sizeof(tmpbuf)) slapi_ch_free_string(&tp); @@ -3606,9 +3604,9 @@ dse_conf_backup_core(struct ldbminfo *li, char *dest_dir, char *file_name, char prrval = PR_Write(prfd, "\n", 1); if ((int)prrval != 1) { - LDAPDebug(LDAP_DEBUG_ERR, "dse_conf_backup_core - " - "(%s): write %s failed: %d (%s)\n", - filter, PR_GetError(), slapd_pr_strerror(PR_GetError())); + slapi_log_err(SLAPI_LOG_ERR, "dse_conf_backup_core", + "(%s): write %lu failed: %d (%s)\n", + filter, l, PR_GetError(), slapd_pr_strerror(PR_GetError())); rval = -1; goto out; } @@ -3632,9 +3630,9 @@ out: prrval = PR_Close(prfd); if (PR_SUCCESS != prrval) { - LDAPDebug(LDAP_DEBUG_CRIT, "dse_conf_backup_core - " + slapi_log_err(SLAPI_LOG_CRIT, "dse_conf_backup_core", "Failed to back up dse indexes %d (%s)\n", - PR_GetError(), slapd_pr_strerror(PR_GetError()), 0); + PR_GetError(), slapd_pr_strerror(PR_GetError())); rval = -1; } } @@ -3678,9 +3676,9 @@ dse_conf_verify_core(struct ldbminfo *li, char *src_dir, char *file_name, char * if (PR_SUCCESS != PR_Access(filename, PR_ACCESS_READ_OK)) { - LDAPDebug(LDAP_DEBUG_WARNING, "dse_conf_verify_core - " + slapi_log_err(SLAPI_LOG_WARNING, "dse_conf_verify_core", "Config backup file %s not found in backup\n", - file_name, 0, 0); + file_name); rval = 0; goto out; } @@ -3688,8 +3686,8 @@ dse_conf_verify_core(struct ldbminfo *li, char *src_dir, char *file_name, char * fd = dblayer_open_huge_file(filename, O_RDONLY, 0); if (fd < 0) { - LDAPDebug(LDAP_DEBUG_ERR, "dse_conf_verify_core - " - "Can't open config backup file: %s\n", filename, 0, 0); + slapi_log_err(SLAPI_LOG_ERR, "dse_conf_verify_core", + "Can't open config backup file: %s\n", filename); rval = -1; goto out; } @@ -3718,9 +3716,9 @@ dse_conf_verify_core(struct ldbminfo *li, char *src_dir, char *file_name, char * e = slapi_str2entry(estr, 0); slapi_ch_free_string(&estr); if (!e) { - LDAPDebug(LDAP_DEBUG_WARNING, "dse_conf_verify_core - " + slapi_log_err(SLAPI_LOG_WARNING, "dse_conf_verify_core", "Skipping bad LDIF entry ending line %d of file \"%s\"", - curr_lineno, filename, 0); + curr_lineno, filename); continue; } if (bep - backup_entries >= backup_entry_len) @@ -3755,9 +3753,9 @@ dse_conf_verify_core(struct ldbminfo *li, char *src_dir, char *file_name, char * if (0 != slapi_entries_diff(backup_entries, curr_entries, 1 /* test_all */, log_str, 1 /* force_update */, li->li_identity)) { - LDAPDebug(LDAP_DEBUG_WARNING, "dse_conf_verify_core - " + slapi_log_err(SLAPI_LOG_WARNING, "dse_conf_verify_core", "Current %s is different from backed up configuration; " - "The backup is restored.\n", log_str, 0, 0); + "The backup is restored.\n", log_str); } slapi_free_search_results_internal(&srch_pb); @@ -3826,7 +3824,7 @@ import_get_and_add_parent_rdns(ImportWorkerInfo *info, return rc; } if (NULL == inst || NULL == srdn) { - slapi_log_error(SLAPI_LOG_ERR, "import_get_and_add_parent_rdns", + slapi_log_err(SLAPI_LOG_ERR, "import_get_and_add_parent_rdns", "Empty %s\n", NULL==inst?"inst":"srdn"); return rc; } @@ -3839,7 +3837,7 @@ import_get_and_add_parent_rdns(ImportWorkerInfo *info, if (slapi_rdn_get_rdn(srdn)) { /* srdn is already in use */ rc = slapi_rdn_init_all_dn(&mysrdn, slapi_sdn_get_dn(bdn->dn_sdn)); if (rc) { - slapi_log_error(SLAPI_LOG_ERR, "import_get_and_add_parent_rdns", + slapi_log_err(SLAPI_LOG_ERR, "import_get_and_add_parent_rdns", "Failed to convert DN %s to RDN\n", slapi_sdn_get_dn(bdn->dn_sdn)); slapi_rdn_done(&mysrdn); @@ -3848,7 +3846,7 @@ import_get_and_add_parent_rdns(ImportWorkerInfo *info, } rc = slapi_rdn_add_srdn_to_all_rdns(srdn, &mysrdn); if (rc) { - slapi_log_error(SLAPI_LOG_ERR, "import_get_and_add_parent_rdns", + slapi_log_err(SLAPI_LOG_ERR, "import_get_and_add_parent_rdns", "Failed to merge Slapi_RDN %s to RDN\n", slapi_sdn_get_dn(bdn->dn_sdn)); } @@ -3856,7 +3854,7 @@ import_get_and_add_parent_rdns(ImportWorkerInfo *info, } else { /* srdn is empty */ rc = slapi_rdn_init_all_dn(srdn, slapi_sdn_get_dn(bdn->dn_sdn)); if (rc) { - slapi_log_error(SLAPI_LOG_ERR, "import_get_and_add_parent_rdns", + slapi_log_err(SLAPI_LOG_ERR, "import_get_and_add_parent_rdns", "Failed to convert DN %s to RDN\n", slapi_sdn_get_dn(bdn->dn_sdn)); CACHE_RETURN(&inst->inst_dncache, &bdn); @@ -3874,7 +3872,7 @@ import_get_and_add_parent_rdns(ImportWorkerInfo *info, /* not in the dn cache; read id2entry */ if (NULL == db) { - slapi_log_error(SLAPI_LOG_ERR, "import_get_and_add_parent_rdns", + slapi_log_err(SLAPI_LOG_ERR, "import_get_and_add_parent_rdns", "Empty db\n"); return rc; } @@ -3887,21 +3885,21 @@ import_get_and_add_parent_rdns(ImportWorkerInfo *info, data.flags = DB_DBT_MALLOC; rc = db->get(db, NULL, &key, &data, 0); if (rc) { - slapi_log_error(SLAPI_LOG_ERR, "import_get_and_add_parent_rdns", + slapi_log_err(SLAPI_LOG_ERR, "import_get_and_add_parent_rdns", "Failed to position at ID " ID_FMT "\n", id); return rc; } /* rdn is allocated in get_value_from_string */ rc = get_value_from_string((const char *)data.dptr, "rdn", &rdn); if (rc) { - slapi_log_error(SLAPI_LOG_ERR, "import_get_and_add_parent_rdns", + slapi_log_err(SLAPI_LOG_ERR, "import_get_and_add_parent_rdns", "Failed to get rdn of entry " ID_FMT "\n", id); goto bail; } /* rdn is set to srdn */ rc = slapi_rdn_init_all_dn(&mysrdn, rdn); if (rc < 0) { /* expect rc == 1 since we are setting "rdn" not "dn" */ - slapi_log_error(SLAPI_LOG_ERR, "import_get_and_add_parent_rdns", + slapi_log_err(SLAPI_LOG_ERR, "import_get_and_add_parent_rdns", "Failed to add rdn %s of entry " ID_FMT "\n", rdn, id); goto bail; } @@ -3923,7 +3921,7 @@ import_get_and_add_parent_rdns(ImportWorkerInfo *info, normdn = NULL; rc = slapi_rdn_get_dn(&mysrdn, &normdn); if (rc) { - slapi_log_error(SLAPI_LOG_ERR, "import_get_and_add_parent_rdns", + slapi_log_err(SLAPI_LOG_ERR, "import_get_and_add_parent_rdns", "Failed to compose dn for (rdn: %s, ID: %d) " "from Slapi_RDN\n", rdn, id); goto bail; @@ -3936,7 +3934,7 @@ import_get_and_add_parent_rdns(ImportWorkerInfo *info, } rc = slapi_rdn_add_srdn_to_all_rdns(srdn, &mysrdn); if (rc) { - slapi_log_error(SLAPI_LOG_ERR, "import_get_and_add_parent_rdns", + slapi_log_err(SLAPI_LOG_ERR, "import_get_and_add_parent_rdns", "Failed to merge Slapi_RDN %s to RDN\n", slapi_sdn_get_dn(bdn->dn_sdn)); } diff --git a/ldap/servers/slapd/back-ldbm/import.c b/ldap/servers/slapd/back-ldbm/import.c index 24988e4..0512194 100644 --- a/ldap/servers/slapd/back-ldbm/import.c +++ b/ldap/servers/slapd/back-ldbm/import.c @@ -213,13 +213,13 @@ void import_log_notice(ImportJob *job, int log_level, char *subsystem, char *for } /* also save it in the logs for posterity */ if (job->flags & (FLAG_UPGRADEDNFORMAT|FLAG_UPGRADEDNFORMAT_V1)) { - slapi_log_error(log_level, subsystem, "upgradedn %s: %s\n", + slapi_log_err(log_level, subsystem, "upgradedn %s: %s\n", job->inst->inst_name, buffer); } else if (job->flags & FLAG_REINDEXING) { - slapi_log_error(log_level, subsystem, "reindex %s: %s\n", + slapi_log_err(log_level, subsystem, "reindex %s: %s\n", job->inst->inst_name, buffer); } else { - slapi_log_error(log_level, subsystem, "import %s: %s\n", + slapi_log_err(log_level, subsystem, "import %s: %s\n", job->inst->inst_name, buffer); } } @@ -483,10 +483,10 @@ static int import_start_threads(ImportJob *job) PR_PRIORITY_NORMAL, PR_GLOBAL_BOUND_THREAD, PR_UNJOINABLE_THREAD, SLAPD_DEFAULT_THREAD_STACKSIZE)) { PRErrorCode prerr = PR_GetError(); - LDAPDebug(LDAP_DEBUG_ERR, "import_start_threads - " + slapi_log_err(SLAPI_LOG_ERR, "import_start_threads", "Unable to spawn import foreman thread, " SLAPI_COMPONENT_NAME_NSPR " error %d (%s)\n", - prerr, slapd_pr_strerror(prerr), 0); + prerr, slapd_pr_strerror(prerr)); FREE(foreman); goto error; } @@ -514,10 +514,10 @@ static int import_start_threads(ImportJob *job) PR_UNJOINABLE_THREAD, SLAPD_DEFAULT_THREAD_STACKSIZE)) { PRErrorCode prerr = PR_GetError(); - LDAPDebug(LDAP_DEBUG_ERR, "import_start_threads - " + slapi_log_err(SLAPI_LOG_ERR, "import_start_threads", "Unable to spawn import worker thread, " SLAPI_COMPONENT_NAME_NSPR " error %d (%s)\n", - prerr, slapd_pr_strerror(prerr), 0); + prerr, slapd_pr_strerror(prerr)); FREE(worker); goto error; } @@ -1258,10 +1258,10 @@ int import_main_offline(void *arg) producer, PR_PRIORITY_NORMAL, PR_GLOBAL_BOUND_THREAD, PR_UNJOINABLE_THREAD, SLAPD_DEFAULT_THREAD_STACKSIZE)) { PRErrorCode prerr = PR_GetError(); - LDAPDebug(LDAP_DEBUG_ERR, "import_main_offline - " + slapi_log_err(SLAPI_LOG_ERR, "import_main_offline", "Unable to spawn upgrade dn producer thread, " SLAPI_COMPONENT_NAME_NSPR " error %d (%s)\n", - prerr, slapd_pr_strerror(prerr), 0); + prerr, slapd_pr_strerror(prerr)); goto error; } } @@ -1272,10 +1272,10 @@ int import_main_offline(void *arg) PR_UNJOINABLE_THREAD, SLAPD_DEFAULT_THREAD_STACKSIZE)) { PRErrorCode prerr = PR_GetError(); - LDAPDebug(LDAP_DEBUG_ERR, "import_main_offline - " + slapi_log_err(SLAPI_LOG_ERR, "import_main_offline", "Unable to spawn index producer thread, " SLAPI_COMPONENT_NAME_NSPR " error %d (%s)\n", - prerr, slapd_pr_strerror(prerr), 0); + prerr, slapd_pr_strerror(prerr)); goto error; } } @@ -1287,10 +1287,10 @@ int import_main_offline(void *arg) PR_UNJOINABLE_THREAD, SLAPD_DEFAULT_THREAD_STACKSIZE)) { PRErrorCode prerr = PR_GetError(); - LDAPDebug(LDAP_DEBUG_ERR,"import_main_offline - " + slapi_log_err(SLAPI_LOG_ERR,"import_main_offline", "Unable to spawn import producer thread, " SLAPI_COMPONENT_NAME_NSPR " error %d (%s)\n", - prerr, slapd_pr_strerror(prerr), 0); + prerr, slapd_pr_strerror(prerr)); goto error; } } @@ -1473,14 +1473,14 @@ error: /* initialize the entry cache */ if (! cache_init(&(inst->inst_cache), DEFAULT_CACHE_SIZE, DEFAULT_CACHE_ENTRIES, CACHE_TYPE_ENTRY)) { - LDAPDebug0Args(LDAP_DEBUG_ERR, "import_main_offline - " + slapi_log_err(SLAPI_LOG_ERR, "import_main_offline", "cache_init failed. Server should be restarted.\n"); } /* initialize the dn cache */ if (! cache_init(&(inst->inst_dncache), DEFAULT_DNCACHE_SIZE, DEFAULT_DNCACHE_MAXCOUNT, CACHE_TYPE_DN)) { - LDAPDebug0Args(LDAP_DEBUG_ERR, "import_main_offline - " + slapi_log_err(SLAPI_LOG_ERR, "import_main_offline", "dn cache_init failed. Server should be restarted.\n"); } } @@ -1636,7 +1636,7 @@ int ldbm_back_ldif2ldbm_deluxe(Slapi_PBlock *pb) slapi_pblock_get(pb, SLAPI_BACKEND, &be); if (be == NULL) { - LDAPDebug0Args(LDAP_DEBUG_ERR, "ldbm_back_ldif2ldbm_deluxe - Backend is not set\n"); + slapi_log_err(SLAPI_LOG_ERR, "ldbm_back_ldif2ldbm_deluxe", "Backend is not set\n"); return -1; } job = CALLOC(ImportJob); @@ -1688,7 +1688,7 @@ int ldbm_back_ldif2ldbm_deluxe(Slapi_PBlock *pb) if (entryrdn_get_switch()) { job->flags |= FLAG_DN2RDN; /* migrate to the rdn format */ } else { - LDAPDebug1Arg(LDAP_DEBUG_ERR, "ldbm_back_ldif2ldbm_deluxe - " + slapi_log_err(SLAPI_LOG_ERR, "ldbm_back_ldif2ldbm_deluxe", "DN to RDN option is specified, " "but %s is not enabled\n", CONFIG_ENTRYRDN_SWITCH); @@ -1749,9 +1749,10 @@ int ldbm_back_ldif2ldbm_deluxe(Slapi_PBlock *pb) SLAPD_DEFAULT_THREAD_STACKSIZE); if (thread == NULL) { PRErrorCode prerr = PR_GetError(); - LDAPDebug(LDAP_DEBUG_ERR, "ldbm_back_ldif2ldbm_deluxe - unable to spawn import thread, " - SLAPI_COMPONENT_NAME_NSPR " error %d (%s)\n", - prerr, slapd_pr_strerror(prerr), 0); + slapi_log_err(SLAPI_LOG_ERR, "ldbm_back_ldif2ldbm_deluxe", + "Unable to spawn import thread, " + SLAPI_COMPONENT_NAME_NSPR " error %d (%s)\n", + prerr, slapd_pr_strerror(prerr)); import_free_job(job); FREE(job); return -2; diff --git a/ldap/servers/slapd/back-ldbm/index.c b/ldap/servers/slapd/back-ldbm/index.c index 962db07..155589f 100644 --- a/ldap/servers/slapd/back-ldbm/index.c +++ b/ldap/servers/slapd/back-ldbm/index.c @@ -353,7 +353,7 @@ index_addordel_entry( int rc, result; Slapi_Attr *attr; - LDAPDebug(LDAP_DEBUG_TRACE, "=> index_%s_entry( \"%s\", %lu )\n", + slapi_log_err(SLAPI_LOG_TRACE, "index_addordel_entry", "=> %s ( \"%s\", %lu )\n", (flags & BE_INDEX_ADD) ? "add" : "del", backentry_get_ndn(e), (u_long)e->ep_id ); @@ -374,17 +374,17 @@ index_addordel_entry( */ result = index_addordel_string(be, SLAPI_ATTR_OBJECTCLASS, SLAPI_ATTR_VALUE_TOMBSTONE, e->ep_id, flags, txn); if ( result != 0 ) { - ldbm_nasty(errmsg, 1010, result); + ldbm_nasty("index_addordel_entry",errmsg, 1010, result); return( result ); } result = index_addordel_string(be, SLAPI_ATTR_UNIQUEID, slapi_entry_get_uniqueid(e->ep_entry), e->ep_id, flags, txn); if ( result != 0 ) { - ldbm_nasty(errmsg, 1020, result); + ldbm_nasty("index_addordel_entry",errmsg, 1020, result); return( result ); } result = index_addordel_string(be, SLAPI_ATTR_NSCP_ENTRYDN, slapi_sdn_get_ndn(&parent), e->ep_id, flags, txn); if ( result != 0 ) { - ldbm_nasty(errmsg, 1021, result); + ldbm_nasty("index_addordel_entry",errmsg, 1021, result); return( result ); } @@ -392,7 +392,7 @@ index_addordel_entry( csn_as_string(tombstone_csn, PR_FALSE, deletion_csn_str); result = index_addordel_string(be, SLAPI_ATTR_TOMBSTONE_CSN, deletion_csn_str, e->ep_id, flags, txn); if ( result != 0 ) { - ldbm_nasty(errmsg, 1021, result); + ldbm_nasty("index_addordel_entry",errmsg, 1021, result); return( result ); } } @@ -405,7 +405,7 @@ index_addordel_entry( */ result = entryrdn_index_entry(be, e, flags, txn); if ( result != 0 ) { - ldbm_nasty(errmsg, 1023, result); + ldbm_nasty("index_addordel_entry",errmsg, 1023, result); return( result ); } /* To maintain tombstonenumsubordinates, @@ -416,7 +416,7 @@ index_addordel_entry( result = index_addordel_values_sv(be, LDBM_PARENTID_STR, svals, NULL, e->ep_id, flags, txn); if ( result != 0 ) { - ldbm_nasty(errmsg, 1022, result); + ldbm_nasty("index_addordel_entry",errmsg, 1022, result); return( result ); } } @@ -445,7 +445,7 @@ index_addordel_entry( result = index_addordel_values_sv( be, type, svals, NULL, e->ep_id, flags, txn ); if ( result != 0 ) { - ldbm_nasty(errmsg, 1030, result); + ldbm_nasty("index_addordel_entry",errmsg, 1030, result); return( result ); } } @@ -466,13 +466,13 @@ index_addordel_entry( if (entryrdn_get_switch()) { /* subtree-rename: on */ result = entryrdn_index_entry(be, e, flags, txn); if ( result != 0 ) { - ldbm_nasty(errmsg, 1031, result); + ldbm_nasty("index_addordel_entry",errmsg, 1031, result); return( result ); } } } - LDAPDebug(LDAP_DEBUG_TRACE, "<= index_%s_entry%s %d\n", + slapi_log_err(SLAPI_LOG_TRACE, "<= index_addordel_entry", "%s %s %d\n", (flags & BE_INDEX_ADD) ? "add" : "del", (flags & BE_INDEX_TOMBSTONE) ? " (tombstone)" : "", result ); return( result ); @@ -604,7 +604,7 @@ index_add_mods( deleted_valueArray, evals, id, flags, txn ); if (rc) { - ldbm_nasty(errmsg, 1041, rc); + ldbm_nasty("index_add_mods", errmsg, 1041, rc); goto error; } } @@ -645,7 +645,7 @@ index_add_mods( rc = 0; } if (rc) { - ldbm_nasty(errmsg, 1042, rc); + ldbm_nasty("index_add_mods", errmsg, 1042, rc); goto error; } } @@ -706,7 +706,7 @@ index_add_mods( deleted_valueArray, evals, id, flags, txn ); if (rc) { - ldbm_nasty(errmsg, 1043, rc); + ldbm_nasty("index_add_mods",errmsg, 1043, rc); goto error; } } @@ -752,7 +752,7 @@ index_add_mods( mods_valueArray, evals, id, flags, txn ); if (rc) { - ldbm_nasty(errmsg, 1044, rc); + ldbm_nasty("index_add_mods",errmsg, 1044, rc); goto error; } } @@ -772,7 +772,7 @@ error: mod_vals = NULL; if ( rc != 0 ) { - ldbm_nasty(errmsg, 1040, rc); + ldbm_nasty("index_add_mods",errmsg, 1040, rc); return( rc ); } } /* for ( i = 0; mods[i] != NULL; i++ ) */ @@ -900,10 +900,10 @@ index_read_ext_allids( if (unindexed != NULL) *unindexed = 0; prefix = index_index2prefix( indextype ); if (prefix == NULL) { - LDAPDebug0Args(LDAP_DEBUG_ANY, "index_read_ext: NULL prefix\n" ); + slapi_log_err(SLAPI_LOG_ERR, "index_read_ext_allids", "NULL prefix\n"); return NULL; } - LDAPDebug(LDAP_DEBUG_TRACE, "=> index_read( \"%s\" %s \"%s\" )\n", + slapi_log_err(SLAPI_LOG_TRACE, "index_read_ext_allids", "=> ( \"%s\" %s \"%s\" )\n", type, prefix, encode (val, buf)); basetype = typebuf; @@ -919,8 +919,8 @@ index_read_ext_allids( return NULL; } - LDAPDebug(LDAP_DEBUG_ARGS, " indextype: \"%s\" indexmask: 0x%x\n", - indextype, ai->ai_indexmask, 0 ); + slapi_log_err(SLAPI_LOG_ARGS, "index_read_ext_allids", "indextype: \"%s\" indexmask: 0x%x\n", + indextype, ai->ai_indexmask); /* If entryrdn switch is on AND the type is entrydn AND the prefix is '=', * use the entryrdn index directly */ @@ -954,8 +954,8 @@ index_read_ext_allids( if ( !is_indexed( indextype, ai->ai_indexmask, ai->ai_index_rules ) ) { idl = idl_allids( be ); if (unindexed != NULL) *unindexed = 1; - LDAPDebug(LDAP_DEBUG_TRACE, "<= index_read %lu candidates " - "(allids - not indexed)\n", (u_long)IDL_NIDS(idl), 0, 0 ); + slapi_log_err(SLAPI_LOG_TRACE, "index_read_ext_allids", "<= %lu candidates " + "(allids - not indexed)\n", (u_long)IDL_NIDS(idl)); index_free_prefix( prefix ); slapi_ch_free_string( &basetmp ); return( idl ); @@ -971,9 +971,9 @@ index_read_ext_allids( (allidslimit == 0)) { idl = idl_allids( be ); if (unindexed != NULL) *unindexed = 1; - LDAPDebug1Arg(LDAP_DEBUG_BACKLDBM, "<= index_read %lu candidates " + slapi_log_err(SLAPI_LOG_BACKLDBM, "index_read_ext_allids", "<= %lu candidates " "(do not use index)\n", (u_long)IDL_NIDS(idl) ); - LDAPDebug(LDAP_DEBUG_BACKLDBM, "<= index_read index attr %s type %s " + slapi_log_err(SLAPI_LOG_BACKLDBM, "index_read_ext_allids", "<= index attr %s type %s " "for value %s does not use index\n", basetype, indextype, (val && val->bv_val) ? val->bv_val : "ALL" ); index_free_prefix( prefix ); @@ -981,9 +981,9 @@ index_read_ext_allids( return( idl ); } if ( (*err = dblayer_get_index_file( be, ai, &db, DBOPEN_CREATE )) != 0 ) { - LDAPDebug(LDAP_DEBUG_TRACE, - "<= index_read NULL (index file open for attr %s)\n", - basetype, 0, 0 ); + slapi_log_err(SLAPI_LOG_TRACE, "index_read_ext_allids", + "<= NULL (index file open for attr %s)\n", + basetype); index_free_prefix (prefix); slapi_ch_free_string( &basetmp ); return( NULL ); @@ -997,9 +997,8 @@ index_read_ext_allids( /* If necessary, encrypt this index key */ ret = attrcrypt_encrypt_index_key(be, ai, val, &encrypted_val); if (ret) { - LDAPDebug(LDAP_DEBUG_ERR, - "index_read_ext_allids - Failed to encrypt index key for %s\n", - basetype, 0, 0 ); + slapi_log_err(SLAPI_LOG_ERR, "index_read_ext_allids", + "Failed to encrypt index key for %s\n", basetype); } if (encrypted_val) { val = encrypted_val; @@ -1027,7 +1026,7 @@ index_read_ext_allids( PRIntervalTime interval; idl = idl_fetch_ext( be, db, &key, db_txn, ai, err, allidslimit ); if(*err == DB_LOCK_DEADLOCK) { - ldbm_nasty("index read retrying transaction", 1045, *err); + ldbm_nasty("index_read_ext_allids", "index read retrying transaction", 1045, *err); #ifdef FIX_TXN_DEADLOCKS #error can only retry here if txn == NULL - otherwise, have to abort and retry txn #endif @@ -1039,9 +1038,9 @@ index_read_ext_allids( } } if(retry_count == IDL_FETCH_RETRY_COUNT) { - ldbm_nasty("index_read retry count exceeded",1046,*err); + ldbm_nasty("index_read_ext_allids", "index_read retry count exceeded",1046,*err); } else if ( *err != 0 && *err != DB_NOTFOUND ) { - ldbm_nasty(errmsg, 1050, *err); + ldbm_nasty("index_read_ext_allids", errmsg, 1050, *err); } slapi_ch_free_string( &basetmp ); slapi_ch_free_string(&tmpbuf); @@ -1054,8 +1053,8 @@ index_read_ext_allids( ber_bvfree(encrypted_val); } - LDAPDebug(LDAP_DEBUG_TRACE, "<= index_read %lu candidates\n", - (u_long)IDL_NIDS(idl), 0, 0 ); + slapi_log_err(SLAPI_LOG_TRACE, "index_read_ext_allids", "<= %lu candidates\n", + (u_long)IDL_NIDS(idl)); return( idl ); } @@ -1235,8 +1234,7 @@ index_range_read_ext( int coreop = operator & SLAPI_OP_RANGE; if (!pb) { - LDAPDebug(LDAP_DEBUG_ERR, "index_range_read_ext - NULL pblock\n", - 0, 0, 0); + slapi_log_err(SLAPI_LOG_ERR, "index_range_read_ext", "NULL pblock\n"); return NULL; } @@ -1244,7 +1242,7 @@ index_range_read_ext( prefix = index_index2prefix( indextype ); if (prefix == NULL) { - LDAPDebug0Args(LDAP_DEBUG_ANY, "index_range_read_ext - NULL prefix\n" ); + slapi_log_err(SLAPI_LOG_ERR, "index_range_read_ext", "NULL prefix\n" ); return( NULL ); } @@ -1276,7 +1274,7 @@ index_range_read_ext( } } - LDAPDebug1Arg(LDAP_DEBUG_TRACE, "index_range_read_ext - lookthrough_limit=%d\n", + slapi_log_err(SLAPI_LOG_TRACE, "index_range_read_ext", "lookthrough_limit=%d\n", lookthrough_limit); switch( coreop ) { @@ -1286,8 +1284,8 @@ index_range_read_ext( case SLAPI_OP_GREATER: break; default: - LDAPDebug(LDAP_DEBUG_ERR, - "index_range_read_ext - (%s,%s) NULL (operator %i)\n", + slapi_log_err(SLAPI_LOG_ERR, + "index_range_read_ext", "(%s,%s) NULL (operator %i)\n", type, prefix, coreop ); index_free_prefix(prefix); return( NULL ); @@ -1297,20 +1295,20 @@ index_range_read_ext( index_free_prefix(prefix); return NULL; } - LDAPDebug(LDAP_DEBUG_ARGS, "index_range_read_ext - indextype: \"%s\" indexmask: 0x%x\n", - indextype, ai->ai_indexmask, 0 ); + slapi_log_err(SLAPI_LOG_ARGS, "index_range_read_ext", "indextype: \"%s\" indexmask: 0x%x\n", + indextype, ai->ai_indexmask); if ( !is_indexed( indextype, ai->ai_indexmask, ai->ai_index_rules )) { idl = idl_allids( be ); - LDAPDebug(LDAP_DEBUG_TRACE, - "index_range_read_ext - (%s,%s) %lu candidates (allids)\n", + slapi_log_err(SLAPI_LOG_TRACE, + "index_range_read_ext", "(%s,%s) %lu candidates (allids)\n", type, prefix, (u_long)IDL_NIDS(idl) ); index_free_prefix(prefix); return( idl ); } if ( (*err = dblayer_get_index_file( be, ai, &db, DBOPEN_CREATE )) != 0 ) { - LDAPDebug(LDAP_DEBUG_ERR, - "index_range_read_ext - (%s,%s) NULL (could not open index file)\n", - type, prefix, 0 ); + slapi_log_err(SLAPI_LOG_ERR, + "index_range_read_ext", "(%s,%s) NULL (could not open index file)\n", + type, prefix); index_free_prefix(prefix); return( NULL ); /* why not allids? */ } @@ -1320,9 +1318,9 @@ index_range_read_ext( /* get a cursor so we can walk over the table */ *err = db->cursor(db,db_txn,&dbc,0); if (0 != *err ) { - ldbm_nasty(errmsg, 1060, *err); - LDAPDebug(LDAP_DEBUG_ERR, - "index_range_read_ext - (%s,%s) NULL: db->cursor() == %i\n", + ldbm_nasty("index_range_read_ext", errmsg, 1060, *err); + slapi_log_err(SLAPI_LOG_ERR, + "index_range_read_ext", "(%s,%s) NULL: db->cursor() == %i\n", type, prefix, *err ); dblayer_release_index_file( be, ai, db ); index_free_prefix(prefix); @@ -1378,9 +1376,9 @@ index_range_read_ext( dbc->c_close(dbc); goto error; } else { - ldbm_nasty(errmsg, 1070, *err); - LDAPDebug(LDAP_DEBUG_ERR, - "index_range_read_ext - (%s,%s) seek to end of index file err %i\n", + ldbm_nasty("index_range_read_ext", errmsg, 1070, *err); + slapi_log_err(SLAPI_LOG_ERR, + "index_range_read_ext", "(%s,%s) seek to end of index file err %i\n", type, prefix, *err ); } } else if (DBTcmp (&upperkey, &cur_key, ai->ai_key_cmp_fn) > 0) { @@ -1411,9 +1409,9 @@ index_range_read_ext( } /* if (LDAP_DEBUG_FILTER) { char encbuf [BUFSIZ]; - LDAPDebug(LDAP_DEBUG_FILTER, " lowerkey=%s(%li bytes)\n", + slapi_log_err(SLAPI_LOG_FILTER, " lowerkey=%s(%li bytes)\n", encoded (&lowerkey, encbuf), (long)lowerkey.dsize, 0 ); - LDAPDebug(LDAP_DEBUG_FILTER, " upperkey=%s(%li bytes)\n", + slapi_log_err(SLAPI_LOG_FILTER, " upperkey=%s(%li bytes)\n", encoded (&upperkey, encbuf), (long)upperkey.dsize, 0 ); } */ data.flags = DB_DBT_MALLOC; @@ -1436,9 +1434,9 @@ index_range_read_ext( idl = NULL; } else { idl = idl_allids( be ); - ldbm_nasty(errmsg, 1080, *err); - LDAPDebug(LDAP_DEBUG_ERR, - "index_range_read_ext - (%s,%s) allids (seek to lower key in index file err %i)\n", + ldbm_nasty("index_range_read_ext", errmsg, 1080, *err); + slapi_log_err(SLAPI_LOG_ERR, + "index_range_read_ext", "(%s,%s) allids (seek to lower key in index file err %i)\n", type, prefix, *err ); } dbc->c_close(dbc); @@ -1456,7 +1454,8 @@ index_range_read_ext( if (coreop == SLAPI_OP_GREATER) { *err = index_range_next_key(db, &cur_key, db_txn); if (*err) { - LDAPDebug(LDAP_DEBUG_ERR, "index_range_read_ext - (%s,%s) op==GREATER, no next key: %i)\n", + slapi_log_err(SLAPI_LOG_ERR, "index_range_read_ext", + "(%s,%s) op==GREATER, no next key: %i)\n", type, prefix, *err ); goto error; } @@ -1481,7 +1480,7 @@ index_range_read_ext( IDList *tmp; /* char encbuf [BUFSIZ]; - LDAPDebug(LDAP_DEBUG_FILTER, " cur_key=%s(%li bytes)\n", + slapi_log_err(SLAPI_LOG_FILTER, " cur_key=%s(%li bytes)\n", encoded (&cur_key, encbuf), (long)cur_key.dsize, 0 ); */ /* lookthrough limit and size limit check */ @@ -1490,14 +1489,14 @@ index_range_read_ext( (idl->b_nids > (ID)lookthrough_limit)) { idl_free(&idl); idl = idl_allids( be ); - LDAPDebug0Args(LDAP_DEBUG_TRACE, - "index_range_read_ext - lookthrough_limit exceeded\n"); + slapi_log_err(SLAPI_LOG_TRACE, + "index_range_read_ext", "lookthrough_limit exceeded\n"); *err = LDAP_ADMINLIMIT_EXCEEDED; break; } if ((sizelimit > 0) && (idl->b_nids > (ID)sizelimit)) { - LDAPDebug0Args(LDAP_DEBUG_TRACE, - "index_range_read_ext - sizelimit exceeded\n"); + slapi_log_err(SLAPI_LOG_TRACE, + "index_range_read_ext", "sizelimit exceeded\n"); *err = LDAP_SIZELIMIT_EXCEEDED; break; } @@ -1506,8 +1505,8 @@ index_range_read_ext( if (timelimit != -1) { curtime = current_time(); if (curtime >= stoptime) { - LDAPDebug0Args(LDAP_DEBUG_TRACE, - "index_range_read_ext - timelimit exceeded\n"); + slapi_log_err(SLAPI_LOG_TRACE, + "index_range_read_ext", "timelimit exceeded\n"); *err = LDAP_TIMELIMIT_EXCEEDED; break; } @@ -1520,8 +1519,8 @@ index_range_read_ext( idl_free(&idl); idl = NULL; } - LDAPDebug0Args(LDAP_DEBUG_TRACE, - "index_range_read_ext - Operation abandoned\n"); + slapi_log_err(SLAPI_LOG_TRACE, + "index_range_read_ext", "Operation abandoned\n"); break; /* clean up happens outside the while() loop */ } @@ -1534,7 +1533,7 @@ index_range_read_ext( *err = NEW_IDL_DEFAULT; tmp = idl_fetch_ext(be, db, &cur_key, NULL, ai, err, allidslimit); if(*err == DB_LOCK_DEADLOCK) { - ldbm_nasty("index_range_read_ext - retrying transaction", 1090, *err); + ldbm_nasty("index_range_read_ext", "Retrying transaction", 1090, *err); #ifdef FIX_TXN_DEADLOCKS #error if txn != NULL, have to abort and retry the transaction, not just the fetch #endif @@ -1544,13 +1543,13 @@ index_range_read_ext( } } if(retry_count == IDL_FETCH_RETRY_COUNT) { - ldbm_nasty("index_range_read_ext - retry count exceeded",1095,*err); + ldbm_nasty("index_range_read_ext", "Retry count exceeded",1095,*err); } if (!tmp) { if (slapi_is_loglevel_set(LDAP_DEBUG_TRACE)) { char encbuf[BUFSIZ]; - LDAPDebug2Args(LDAP_DEBUG_TRACE, - "index_range_read_ext - cur_key=%s(%li bytes) was deleted - skipping\n", + slapi_log_err(SLAPI_LOG_TRACE, + "index_range_read_ext", "cur_key=%s(%li bytes) was deleted - skipping\n", encoded(&cur_key, encbuf), (long)cur_key.dsize); } } else { @@ -1565,15 +1564,15 @@ index_range_read_ext( id != NOID; id = idl_nextid(tmp, id)) { *err = idl_append_extend(&idl, id); if (*err) { - ldbm_nasty("index_range_read_ext - Failed to generate idlist", + ldbm_nasty("index_range_read_ext","Failed to generate idlist", 1097, *err); } } idl_free(&tmp); } if (ALLIDS(idl)) { - LDAPDebug0Args(LDAP_DEBUG_TRACE, - "index_range_read_ext - Hit an allids value\n"); + slapi_log_err(SLAPI_LOG_TRACE, + "index_range_read_ext", "Hit an allids value\n"); break; } } @@ -1597,23 +1596,23 @@ index_range_read_ext( } } if (*err) { - LDAPDebug1Arg(LDAP_DEBUG_FILTER, - "index_range_read_ext - dbc->c_get(...DB_NEXT) == %i\n", *err); + slapi_log_err(SLAPI_LOG_FILTER, + "index_range_read_ext", "dbc->c_get(...DB_NEXT) == %i\n", *err); } #ifdef LDAP_DEBUG /* this is for debugging only */ if (idl != NULL) { if (ALLIDS(idl)) { - LDAPDebug0Args(LDAP_DEBUG_FILTER, "index_range_read_ext - idl=ALLIDS\n"); + slapi_log_err(SLAPI_LOG_FILTER, "index_range_read_ext", "idl=ALLIDS\n"); } else { - LDAPDebug1Arg(LDAP_DEBUG_FILTER, - "index_range_read_ext - idl->b_nids=%d\n", idl->b_nids); - LDAPDebug1Arg(LDAP_DEBUG_FILTER, - "index_range_read_ext - idl->b_nmax=%d\n", idl->b_nmax); + slapi_log_err(SLAPI_LOG_FILTER, + "index_range_read_ext", "idl->b_nids=%d\n", idl->b_nids); + slapi_log_err(SLAPI_LOG_FILTER, + "index_range_read_ext", "idl->b_nmax=%d\n", idl->b_nmax); for (i = 0; i < idl->b_nids; i++) { - LDAPDebug2Args(LDAP_DEBUG_FILTER, - "index_range_read_ext - idl->b_ids[%d]=%d\n", i, idl->b_ids[i]); + slapi_log_err(SLAPI_LOG_FILTER, + "index_range_read_ext", "idl->b_ids[%d]=%d\n", i, idl->b_ids[i]); } } } @@ -1624,7 +1623,7 @@ error: DBT_FREE_PAYLOAD(upperkey); dblayer_release_index_file( be, ai, db ); - LDAPDebug(LDAP_DEBUG_TRACE, "index_range_read_ext - (%s,%s) %lu candidates\n", + slapi_log_err(SLAPI_LOG_TRACE, "index_range_read_ext", "(%s,%s) %lu candidates\n", type, prefix, (u_long)IDL_NIDS(idl) ); return( idl ); } @@ -1673,14 +1672,14 @@ addordel_values( char *realbuf; char *prefix; - LDAPDebug(LDAP_DEBUG_TRACE, "addordel_values - %s_values\n", - (flags & BE_INDEX_ADD) ? "add" : "del", 0, 0); + slapi_log_err(SLAPI_LOG_TRACE, "addordel_values", "%s_values\n", + (flags & BE_INDEX_ADD) ? "add" : "del"); prefix = index_index2prefix( indextype ); if (prefix == NULL) { - LDAPDebug(LDAP_DEBUG_ERR, "addordel_values - %s_values: NULL prefix\n", - (flags & BE_INDEX_ADD) ? "add" : "del", 0, 0 ); + slapi_log_err(SLAPI_LOG_ERR, "addordel_values", "%s_values: NULL prefix\n", + (flags & BE_INDEX_ADD) ? "add" : "del"); return( -1 ); } @@ -1704,13 +1703,13 @@ addordel_values( if ( rc != 0) { - ldbm_nasty(errmsg, 1096, rc); + ldbm_nasty("addordel_values", errmsg, 1096, rc); } index_free_prefix (prefix); if (NULL != key.dptr && prefix != key.dptr) slapi_ch_free( (void**)&key.dptr ); - LDAPDebug(LDAP_DEBUG_TRACE, "addordel_values - %s_values %d\n", - (flags & BE_INDEX_ADD) ? "add" : "del", rc, 0 ); + slapi_log_err(SLAPI_LOG_TRACE, "addordel_values", "%s_values %d\n", + (flags & BE_INDEX_ADD) ? "add" : "del", rc); return( rc ); } @@ -1743,9 +1742,9 @@ addordel_values( { char encbuf[BUFSIZ]; - LDAPDebug(LDAP_DEBUG_TRACE, "addordel_values - %s_value(\"%s\")\n", + slapi_log_err(SLAPI_LOG_TRACE, "addordel_values", "%s_value(\"%s\")\n", (flags & BE_INDEX_ADD) ? "add" : "del", - encoded (&key, encbuf), 0); + encoded (&key, encbuf)); } #endif @@ -1770,7 +1769,7 @@ addordel_values( } } if ( rc != 0 ) { - ldbm_nasty(errmsg, 1100, rc); + ldbm_nasty("addordel_values", errmsg, 1100, rc); break; } if ( NULL != key.dptr && realbuf != key.dptr) { /* realloc'ed */ @@ -1785,10 +1784,10 @@ addordel_values( if ( rc != 0 ) { - ldbm_nasty(errmsg, 1110, rc); + ldbm_nasty("addordel_values", errmsg, 1110, rc); } - LDAPDebug(LDAP_DEBUG_TRACE, "addordel_values - %s_values %d\n", - (flags & BE_INDEX_ADD) ? "add" : "del", rc, 0 ); + slapi_log_err(SLAPI_LOG_TRACE, "addordel_values", "%s_values %d\n", + (flags & BE_INDEX_ADD) ? "add" : "del", rc); return( rc ); } #endif @@ -1820,12 +1819,12 @@ addordel_values_sv( const struct berval *bvp; struct berval *encrypted_bvp = NULL; - LDAPDebug(LDAP_DEBUG_TRACE, "addordel_values_sv - %s_values\n", - (flags & BE_INDEX_ADD) ? "add" : "del", 0, 0); + slapi_log_err(SLAPI_LOG_TRACE, "addordel_values_sv", "%s_values\n", + (flags & BE_INDEX_ADD) ? "add" : "del"); prefix = index_index2prefix( indextype ); if (prefix == NULL) { - LDAPDebug0Args(LDAP_DEBUG_ANY, "addordel_values_sv - NULL prefix\n" ); + slapi_log_err(SLAPI_LOG_ERR, "addordel_values_sv", "NULL prefix\n" ); return( -1 ); } @@ -1850,14 +1849,14 @@ addordel_values_sv( } if ( rc != 0 ) { - ldbm_nasty(errmsg, 1120, rc); + ldbm_nasty("addordel_values_sv", errmsg, 1120, rc); } if (NULL != key.dptr && prefix != key.dptr) { slapi_ch_free( (void**)&key.dptr ); } index_free_prefix (prefix); - LDAPDebug(LDAP_DEBUG_TRACE, "addordel_values_sv - %s_values %d\n", - (flags & BE_INDEX_ADD) ? "add" : "del", rc, 0 ); + slapi_log_err(SLAPI_LOG_TRACE, "addordel_values_sv", "%s_values %d\n", + (flags & BE_INDEX_ADD) ? "add" : "del", rc); return( rc ); } @@ -1872,8 +1871,8 @@ addordel_values_sv( rc = attrcrypt_encrypt_index_key(be,a,bvp,&encrypted_bvp); if (rc) { - LDAPDebug(LDAP_DEBUG_ERR, "addordel_values_sv - Failed to encrypt index key for %s\n", - a->ai_type ,0,0); + slapi_log_err(SLAPI_LOG_ERR, "addordel_values_sv", + "Failed to encrypt index key for %s\n", a->ai_type); } else { bvp = encrypted_bvp; } @@ -1913,9 +1912,9 @@ addordel_values_sv( { char encbuf[BUFSIZ]; - LDAPDebug(LDAP_DEBUG_TRACE, "addordel_values_sv - %s_value(\"%s\")\n", + slapi_log_err(SLAPI_LOG_TRACE, "addordel_values_sv", "%s_value(\"%s\")\n", (flags & BE_INDEX_ADD) ? "add" : "del", - encoded (&key, encbuf), 0); + encoded (&key, encbuf)); } #endif @@ -1940,7 +1939,7 @@ addordel_values_sv( } } if ( rc != 0 ) { - ldbm_nasty(errmsg, 1130, rc); + ldbm_nasty("addordel_values_sv", errmsg, 1130, rc); break; } if ( NULL != key.dptr && realbuf != key.dptr) { /* realloc'ed */ @@ -1955,10 +1954,10 @@ addordel_values_sv( if ( rc != 0 ) { - ldbm_nasty(errmsg, 1140, rc); + ldbm_nasty("addordel_values_sv", errmsg, 1140, rc); } - LDAPDebug(LDAP_DEBUG_TRACE, "addordel_values_sv - %s_values %d\n", - (flags & BE_INDEX_ADD) ? "add" : "del", rc, 0 ); + slapi_log_err(SLAPI_LOG_TRACE, "addordel_values_sv", "%s_values %d\n", + (flags & BE_INDEX_ADD) ? "add" : "del", rc); return( rc ); } @@ -2013,8 +2012,8 @@ index_addordel_values_ext_sv( char buf[SLAPD_TYPICAL_ATTRIBUTE_NAME_MAX_LENGTH]; char *basetmp, *basetype; - LDAPDebug(LDAP_DEBUG_TRACE, - "index_addordel_values_ext_sv - ( \"%s\", %lu )\n", type, (u_long)id, 0 ); + slapi_log_err(SLAPI_LOG_TRACE, + "index_addordel_values_ext_sv", "( \"%s\", %lu )\n", type, (u_long)id); basetype = buf; if ( (basetmp = slapi_attr_basetype( type, buf, sizeof(buf) )) @@ -2028,15 +2027,15 @@ index_addordel_values_ext_sv( slapi_ch_free_string( &basetmp ); return( 0 ); } - LDAPDebug(LDAP_DEBUG_ARGS, "index_addordel_values_ext_sv - indexmask 0x%x\n", - ai->ai_indexmask, 0, 0 ); + slapi_log_err(SLAPI_LOG_ARGS, "index_addordel_values_ext_sv", "indexmask 0x%x\n", + ai->ai_indexmask); if ( (err = dblayer_get_index_file( be, ai, &db, DBOPEN_CREATE )) != 0 ) { - LDAPDebug(LDAP_DEBUG_ERR, - "index_addordel_values_ext_sv - index_read NULL (could not open index attr %s)\n", - basetype, 0, 0 ); + slapi_log_err(SLAPI_LOG_ERR, + "index_addordel_values_ext_sv", "index_read NULL (could not open index attr %s)\n", + basetype); slapi_ch_free_string( &basetmp ); if ( err != 0 ) { - ldbm_nasty(errmsg, 1210, err); + ldbm_nasty("index_addordel_values_ext_sv", errmsg, 1210, err); } goto bad; } @@ -2052,7 +2051,7 @@ index_addordel_values_ext_sv( err = addordel_values_sv( be, db, basetype, indextype_PRESENCE, NULL, id, flags, txn, ai, idl_disposition, NULL ); if ( err != 0 ) { - ldbm_nasty(errmsg, 1220, err); + ldbm_nasty("index_addordel_values_ext_sv", errmsg, 1220, err); goto bad; } } @@ -2073,7 +2072,7 @@ index_addordel_values_ext_sv( valuearray_free( &ivals ); } if ( err != 0 ) { - ldbm_nasty(errmsg, 1230, err); + ldbm_nasty("index_addordel_values_ext_sv", errmsg, 1230, err); goto bad; } } @@ -2089,7 +2088,7 @@ index_addordel_values_ext_sv( indextype_APPROX, ivals, id, flags, txn, ai, idl_disposition, NULL ); valuearray_free( &ivals ); if ( err != 0 ) { - ldbm_nasty(errmsg, 1240, err); + ldbm_nasty("index_addordel_values_ext_sv", errmsg, 1240, err); goto bad; } } @@ -2130,7 +2129,7 @@ index_addordel_values_ext_sv( valuearray_free( &origvals ); valuearray_free( &ivals ); if ( err != 0 ) { - ldbm_nasty(errmsg, 1250, err); + ldbm_nasty("index_addordel_values_ext_sv", errmsg, 1250, err); goto bad; } @@ -2161,7 +2160,7 @@ index_addordel_values_ext_sv( err = addordel_values_sv (be, db, basetype, officialOID, keys, id, flags, txn, ai, idl_disposition, NULL); if ( err != 0 ) { - ldbm_nasty(errmsg, 1260, err); + ldbm_nasty("index_addordel_values_ext_sv", errmsg, 1260, err); } } /* @@ -2184,7 +2183,7 @@ index_addordel_values_ext_sv( slapi_ch_free( (void**)&basetmp ); } - LDAPDebug(LDAP_DEBUG_TRACE, "<= index_addordel_values_ext_sv\n", 0, 0, 0 ); + slapi_log_err(SLAPI_LOG_TRACE, "index_addordel_values_ext_sv", "<=\n"); return( 0 ); bad: @@ -2212,16 +2211,16 @@ is_indexed (const char* indextype, int indexmask, char** index_rules) else if (indextype == indextype_APPROX) indexed = INDEX_APPROX & indexmask; else if (indextype == indextype_SUB) indexed = INDEX_SUB & indexmask; else { /* matching rule */ - indexed = 0; - if (INDEX_RULES & indexmask) { - char** rule; - for (rule = index_rules; *rule; ++rule) { - if ( ! strcmp( *rule, indextype )) { - indexed = INDEX_RULES; - break; - } - } - } + indexed = 0; + if (INDEX_RULES & indexmask) { + char** rule; + for (rule = index_rules; *rule; ++rule) { + if ( ! strcmp( *rule, indextype )) { + indexed = INDEX_RULES; + break; + } + } + } } /* if index is currently being generated, pretend it doesn't exist */ @@ -2241,13 +2240,13 @@ index_index2prefix (const char* indextype) else if ( indextype == indextype_APPROX ) prefix = prefix_APPROX; else if ( indextype == indextype_SUB ) prefix = prefix_SUB; else { /* indextype is a matching rule name */ - const size_t len = strlen (indextype); - char* p = slapi_ch_malloc (len + 3); - p[0] = RULE_PREFIX; - memcpy( p+1, indextype, len ); - p[len+1] = ':'; - p[len+2] = '\0'; - prefix = p; + const size_t len = strlen (indextype); + char* p = slapi_ch_malloc (len + 3); + p[0] = RULE_PREFIX; + memcpy( p+1, indextype, len ); + p[len+1] = ':'; + p[len+2] = '\0'; + prefix = p; } return( prefix ); } @@ -2256,13 +2255,13 @@ void index_free_prefix (char* prefix) { if (prefix == NULL || - prefix == prefix_PRESENCE || - prefix == prefix_EQUALITY || - prefix == prefix_APPROX || - prefix == prefix_SUB) { - /* do nothing */ + prefix == prefix_PRESENCE || + prefix == prefix_EQUALITY || + prefix == prefix_APPROX || + prefix == prefix_SUB) { + /* do nothing */ } else { - slapi_ch_free( (void**)&prefix); + slapi_ch_free( (void**)&prefix); } } diff --git a/ldap/servers/slapd/back-ldbm/init.c b/ldap/servers/slapd/back-ldbm/init.c index c40e108..f1b4a61 100644 --- a/ldap/servers/slapd/back-ldbm/init.c +++ b/ldap/servers/slapd/back-ldbm/init.c @@ -54,7 +54,7 @@ ldbm_back_init( Slapi_PBlock *pb ) struct slapdplugin *p; static int interface_published = 0; - LDAPDebug(LDAP_DEBUG_TRACE, "=> ldbm_back_init\n", 0, 0, 0 ); + slapi_log_err(SLAPI_LOG_TRACE, "ldbm_back_init", "=>\n"); slapi_pblock_get(pb, SLAPI_PLUGIN, &p); @@ -76,7 +76,7 @@ ldbm_back_init( Slapi_PBlock *pb ) /* initialize dblayer */ if (dblayer_init(li)) { - LDAPDebug(LDAP_DEBUG_CRIT, "ldbm_back_init - dblayer_init failed\n",0, 0, 0 ); + slapi_log_err(SLAPI_LOG_CRIT, "ldbm_back_init", "dblayer_init failed\n"); goto fail; } @@ -90,8 +90,8 @@ ldbm_back_init( Slapi_PBlock *pb ) if (slapi_register_object_extension(p->plg_name, SLAPI_EXT_CONNECTION, factory_constructor, factory_destructor, &li->li_bulk_import_object, &li->li_bulk_import_handle) != 0) { - LDAPDebug(LDAP_DEBUG_CRIT, "ldbm_back_init - " - "slapi_register_object_extension failed.\n", 0, 0, 0); + slapi_log_err(SLAPI_LOG_CRIT, "ldbm_back_init", + "slapi_register_object_extension failed.\n"); goto fail; } @@ -102,25 +102,22 @@ ldbm_back_init( Slapi_PBlock *pb ) rc = slapi_pblock_set( pb, SLAPI_PLUGIN_PRIVATE, (void *) li ); if ((li->li_dbcache_mutex = PR_NewLock()) == NULL ) { - LDAPDebug(LDAP_DEBUG_CRIT, "ldbm_back_init - PR_NewLock failed\n", - 0, 0, 0 ); + slapi_log_err(SLAPI_LOG_CRIT, "ldbm_back_init", "PR_NewLock failed\n"); goto fail; } if ((li->li_shutdown_mutex = PR_NewLock()) == NULL ) { - LDAPDebug(LDAP_DEBUG_CRIT, "ldbm_back_init - PR_NewLock failed\n", - 0, 0, 0 ); + slapi_log_err(SLAPI_LOG_CRIT, "ldbm_back_init", "PR_NewLock failed\n"); goto fail; } if ((li->li_config_mutex = PR_NewLock()) == NULL ) { - LDAPDebug(LDAP_DEBUG_CRIT, "ldbm_back_init PR_NewLock failed\n", - 0, 0, 0 ); + slapi_log_err(SLAPI_LOG_CRIT, "ldbm_back_init", "PR_NewLock failed\n"); goto fail; } if ((li->li_dbcache_cv = PR_NewCondVar( li->li_dbcache_mutex )) == NULL ) { - LDAPDebug(LDAP_DEBUG_CRIT, "ldbm_back_init - PR_NewCondVar failed\n", 0, 0, 0 ); + slapi_log_err(SLAPI_LOG_CRIT, "ldbm_back_init", "PR_NewCondVar failed\n"); goto fail; } @@ -208,7 +205,7 @@ ldbm_back_init( Slapi_PBlock *pb ) (void *) ldbm_back_ctrl_info ); if ( rc != 0 ) { - LDAPDebug(LDAP_DEBUG_CRIT, "ldbm_back_init - Failed %d\n", rc, 0, 0 ); + slapi_log_err(SLAPI_LOG_CRIT, "ldbm_back_init", "Failed %d\n", rc); goto fail; } @@ -221,14 +218,14 @@ ldbm_back_init( Slapi_PBlock *pb ) if( slapi_apib_register(IDL_v1_0_GUID, IDL_api) ) { - LDAPDebug(LDAP_DEBUG_CRIT, "ldbm_back_init - Failed to publish IDL interface\n", 0, 0, 0); + slapi_log_err(SLAPI_LOG_CRIT, "ldbm_back_init", "Failed to publish IDL interface\n"); goto fail; } interface_published = 1; } - LDAPDebug(LDAP_DEBUG_TRACE, "<= ldbm_back_init\n", 0, 0, 0 ); + slapi_log_err(SLAPI_LOG_TRACE, "ldbm_back_init", "<=\n"); return( 0 ); diff --git a/ldap/servers/slapd/back-ldbm/instance.c b/ldap/servers/slapd/back-ldbm/instance.c index 1504641..315f5b6 100644 --- a/ldap/servers/slapd/back-ldbm/instance.c +++ b/ldap/servers/slapd/back-ldbm/instance.c @@ -37,8 +37,7 @@ int ldbm_instance_create(backend *be, char *name) /* initialize the entry cache */ if (! cache_init(&(inst->inst_cache), DEFAULT_CACHE_SIZE, DEFAULT_CACHE_ENTRIES, CACHE_TYPE_ENTRY)) { - LDAPDebug(LDAP_DEBUG_ERR, "ldbm_instance_create - cache_init failed\n", - 0, 0, 0); + slapi_log_err(SLAPI_LOG_ERR, "ldbm_instance_create", "cache_init failed\n"); rc = -1; goto error; } @@ -50,8 +49,8 @@ int ldbm_instance_create(backend *be, char *name) */ if (! cache_init(&(inst->inst_dncache), DEFAULT_DNCACHE_SIZE, DEFAULT_DNCACHE_MAXCOUNT, CACHE_TYPE_DN)) { - LDAPDebug0Args(LDAP_DEBUG_ERR, - "ldbm_instance_create - dn cache_init failed\n"); + slapi_log_err(SLAPI_LOG_ERR, + "ldbm_instance_create", "dn cache_init failed\n"); rc = -1; goto error; } @@ -59,8 +58,7 @@ int ldbm_instance_create(backend *be, char *name) /* Lock for the list of open db handles */ inst->inst_handle_list_mutex = PR_NewLock(); if (NULL == inst->inst_handle_list_mutex) { - LDAPDebug(LDAP_DEBUG_ERR, "ldbm_instance_create - PR_NewLock failed\n", - 0, 0, 0); + slapi_log_err(SLAPI_LOG_ERR, "ldbm_instance_create", "PR_NewLock failed\n"); rc = -1; goto error; } @@ -68,28 +66,25 @@ int ldbm_instance_create(backend *be, char *name) /* Lock used to synchronize modify operations. */ inst->inst_db_mutex = PR_NewMonitor(); if (NULL == inst->inst_db_mutex) { - LDAPDebug(LDAP_DEBUG_ERR, "ldbm_instance_create - PR_NewMonitor failed\n", - 0, 0, 0); + slapi_log_err(SLAPI_LOG_ERR, "ldbm_instance_create", "PR_NewMonitor failed\n"); rc = -1; goto error; } if ((inst->inst_config_mutex = PR_NewLock()) == NULL) { - LDAPDebug(LDAP_DEBUG_ERR, "ldbm_instance_create - PR_NewLock failed\n", - 0, 0, 0); + slapi_log_err(SLAPI_LOG_ERR, "ldbm_instance_create", "PR_NewLock failed\n"); rc = -1; goto error; } if ((inst->inst_nextid_mutex = PR_NewLock()) == NULL) { - LDAPDebug(LDAP_DEBUG_ERR, "ldbm_instance_create - PR_NewLock failed\n", - 0, 0, 0); + slapi_log_err(SLAPI_LOG_ERR, "ldbm_instance_create", "PR_NewLock failed\n"); rc = -1; goto error; } if ((inst->inst_indexer_cv = PR_NewCondVar(inst->inst_nextid_mutex)) == NULL) { - LDAPDebug(LDAP_DEBUG_ERR, "ldbm_instance_create - PR_NewCondVar failed\n", 0, 0, 0 ); + slapi_log_err(SLAPI_LOG_ERR, "ldbm_instance_create", "PR_NewCondVar failed\n"); rc = -1; goto error; } @@ -254,9 +249,9 @@ ldbm_instance_start(backend *be) if (be->be_state != BE_STATE_STOPPED && be->be_state != BE_STATE_DELETED) { - LDAPDebug(LDAP_DEBUG_TRACE, - "ldbm_instance_start: warning - backend is in a wrong state - %d\n", - be->be_state, 0, 0 ); + slapi_log_err(SLAPI_LOG_TRACE, + "ldbm_instance_start", "Warning - backend is in a wrong state - %d\n", + be->be_state); PR_Unlock (be->be_state_lock); return 0; } @@ -280,9 +275,9 @@ ldbm_instance_stop(backend *be) PR_Lock (be->be_state_lock); if (be->be_state != BE_STATE_STARTED) { - LDAPDebug(LDAP_DEBUG_WARNING, - "ldbm_instance_stop - Backend %s is in the wrong state - %d\n", - inst ? inst->inst_name : "", be->be_state, 0 ); + slapi_log_err(SLAPI_LOG_WARNING, + "ldbm_instance_stop", "Backend %s is in the wrong state - %d\n", + inst ? inst->inst_name : "", be->be_state); PR_Unlock (be->be_state_lock); return 0; } @@ -392,8 +387,8 @@ ldbm_instance_destructor(void **arg) { ldbm_instance *inst = (ldbm_instance *) *arg; - LDAPDebug(LDAP_DEBUG_ERR, "ldbm_instance_destructor - Destructor for instance %s called\n", - inst->inst_name, 0, 0); + slapi_log_err(SLAPI_LOG_ERR, "ldbm_instance_destructor", "Destructor for instance %s called\n", + inst->inst_name); slapi_counter_destroy(&(inst->inst_ref_count)); slapi_ch_free_string(&inst->inst_name); diff --git a/ldap/servers/slapd/back-ldbm/ldbm_add.c b/ldap/servers/slapd/back-ldbm/ldbm_add.c index 6013f54..20f3df9 100644 --- a/ldap/servers/slapd/back-ldbm/ldbm_add.c +++ b/ldap/servers/slapd/back-ldbm/ldbm_add.c @@ -117,7 +117,7 @@ ldbm_back_add( Slapi_PBlock *pb ) if (inst && inst->inst_ref_count) { slapi_counter_increment(inst->inst_ref_count); } else { - LDAPDebug1Arg(LDAP_DEBUG_ERR, "ldbm_back_add - " + slapi_log_err(SLAPI_LOG_ERR, "ldbm_back_add", "Instance \"%s\" does not exist.\n", inst ? inst->inst_name : "null instance"); goto error_return; @@ -205,7 +205,7 @@ ldbm_back_add( Slapi_PBlock *pb ) /* addingentry is in cache. Remove it once. */ retval = CACHE_REMOVE(&inst->inst_cache, addingentry); if (retval) { - LDAPDebug1Arg(LDAP_DEBUG_CACHE, "ldbm_add: cache_remove %s failed.\n", + slapi_log_err(SLAPI_LOG_CACHE, "ldbm_back_add", "cache_remove %s failed.\n", slapi_entry_get_dn_const(addingentry->ep_entry)); } } @@ -216,7 +216,7 @@ ldbm_back_add( Slapi_PBlock *pb ) tmpentry = NULL; /* Adding the resetted addingentry to the cache. */ if (cache_add_tentative(&inst->inst_cache, addingentry, NULL) < 0) { - LDAPDebug1Arg(LDAP_DEBUG_CACHE, "cache_add_tentative concurrency detected: %s\n", + slapi_log_err(SLAPI_LOG_CACHE, "ldbm_back_add", "cache_add_tentative concurrency detected: %s\n", slapi_entry_get_dn_const(addingentry->ep_entry)); ldap_result_code = LDAP_ALREADY_EXISTS; goto error_return; @@ -228,7 +228,7 @@ ldbm_back_add( Slapi_PBlock *pb ) } /* We're re-trying */ - LDAPDebug0Args(LDAP_DEBUG_BACKLDBM, "Add Retrying Transaction\n"); + slapi_log_err(SLAPI_LOG_BACKLDBM, "ldbm_back_add", "Add Retrying Transaction\n"); #ifndef LDBM_NO_BACKOFF_DELAY { PRIntervalTime interval; @@ -272,7 +272,7 @@ ldbm_back_add( Slapi_PBlock *pb ) slapi_pblock_get( pb, SLAPI_ADD_TARGET_SDN, &sdn ); if (NULL == sdn) { - LDAPDebug0Args(LDAP_DEBUG_ERR, "ldbm_back_add - " + slapi_log_err(SLAPI_LOG_ERR, "ldbm_back_add", "Null target dn\n"); goto error_return; } @@ -333,7 +333,7 @@ ldbm_back_add( Slapi_PBlock *pb ) slapi_pblock_get(pb, SLAPI_RESULT_CODE, &ldap_result_code); } if (!ldap_result_code) { - LDAPDebug0Args(LDAP_DEBUG_ERR, "ldbm_back_add - " + slapi_log_err(SLAPI_LOG_ERR, "ldbm_back_add", "SLAPI_PLUGIN_BE_PRE_ADD_FN returned error but did not set SLAPI_RESULT_CODE\n"); ldap_result_code = LDAP_OPERATIONS_ERROR; } @@ -393,8 +393,9 @@ ldbm_back_add( Slapi_PBlock *pb ) slapi_sdn_set_dn_byval(&parentsdn, slapi_entry_get_dn_const(parententry->ep_entry)); } } else { - LDAPDebug(LDAP_DEBUG_BACKLDBM, "find_entry2modify_only returned NULL parententry pdn: %s, uniqueid: %s\n", - slapi_sdn_get_dn(&parentsdn), slapi_sdn_get_dn(&parentsdn), addr.uniqueid?addr.uniqueid:"none"); + slapi_log_err(SLAPI_LOG_BACKLDBM, "ldbm_back_add", + "find_entry2modify_only returned NULL parententry pdn: %s, uniqueid: %s\n", + slapi_sdn_get_dn(&parentsdn), addr.uniqueid?addr.uniqueid:"none"); } modify_init(&parent_modify_c,parententry); } @@ -477,7 +478,7 @@ ldbm_back_add( Slapi_PBlock *pb ) if ((operation_is_flag_set(operation,OP_FLAG_ACTION_SCHEMA_CHECK)) && (slapi_entry_schema_check(pb, e) != 0)) { - LDAPDebug(LDAP_DEBUG_TRACE, "entry failed schema check\n", 0, 0, 0); + slapi_log_err(SLAPI_LOG_TRACE, "ldbm_back_add", "Entry failed schema check\n"); ldap_result_code = LDAP_OBJECT_CLASS_VIOLATION; slapi_pblock_get(pb, SLAPI_PB_RESULT_TEXT, &ldap_result_message); goto error_return; @@ -486,7 +487,7 @@ ldbm_back_add( Slapi_PBlock *pb ) /* Check attribute syntax */ if (slapi_entry_syntax_check(pb, e, 0) != 0) { - LDAPDebug(LDAP_DEBUG_TRACE, "entry failed syntax check\n", 0, 0, 0); + slapi_log_err(SLAPI_LOG_TRACE, "ldbm_back_add", "Entry failed syntax check\n"); ldap_result_code = LDAP_INVALID_SYNTAX; slapi_pblock_get(pb, SLAPI_PB_RESULT_TEXT, &ldap_result_message); goto error_return; @@ -525,7 +526,7 @@ ldbm_back_add( Slapi_PBlock *pb ) * magic objectclass. */ if (NULL == sdn) { - LDAPDebug0Args(LDAP_DEBUG_ERR, "ldbm_back_add - " + slapi_log_err(SLAPI_LOG_ERR, "ldbm_back_add", "Null target dn\n"); ldap_result_code = LDAP_OPERATIONS_ERROR; goto error_return; @@ -542,7 +543,8 @@ ldbm_back_add( Slapi_PBlock *pb ) slapi_entry_attr_delete(addingentry->ep_entry, SLAPI_ATTR_TOMBSTONE_CSN); /* Now also remove the nscpEntryDN */ if (slapi_entry_attr_delete(addingentry->ep_entry, SLAPI_ATTR_NSCP_ENTRYDN) != 0){ - LDAPDebug(LDAP_DEBUG_REPL, "Resurrection of %s - Couldn't remove %s\n", dn, SLAPI_ATTR_NSCP_ENTRYDN, 0); + slapi_log_err(SLAPI_LOG_REPL, "ldbm_back_add", "Resurrection of %s - Couldn't remove %s\n", + dn, SLAPI_ATTR_NSCP_ENTRYDN); } /* And copy the reason from e */ @@ -550,7 +552,8 @@ ldbm_back_add( Slapi_PBlock *pb ) if (reason) { if (!slapi_entry_attr_hasvalue(addingentry->ep_entry, "nsds5ReplConflict", reason)) { slapi_entry_add_string(addingentry->ep_entry, "nsds5ReplConflict", reason); - LDAPDebug(LDAP_DEBUG_REPL, "Resurrection of %s - Added Conflict reason %s\n", dn, reason, 0); + slapi_log_err(SLAPI_LOG_REPL, "ldbm_back_add", "Resurrection of %s - Added Conflict reason %s\n", + dn, reason); } slapi_ch_free((void **)&reason); } @@ -603,9 +606,9 @@ ldbm_back_add( Slapi_PBlock *pb ) */ addingentry = backentry_init( e ); if ( ( addingentry->ep_id = next_id( be ) ) >= MAXID ) { - LDAPDebug(LDAP_DEBUG_ERR, "ldbm_back_add - " + slapi_log_err(SLAPI_LOG_ERR, "ldbm_back_add ", "Maximum ID reached, cannot add entry to " - "backend '%s'", be->be_name, 0, 0 ); + "backend '%s'", be->be_name); ldap_result_code = LDAP_OPERATIONS_ERROR; goto error_return; } @@ -657,8 +660,8 @@ ldbm_back_add( Slapi_PBlock *pb ) Slapi_RDN srdn = {0}; rc = slapi_rdn_init_all_dn(&srdn, tombstoned_dn); if (rc) { - LDAPDebug1Arg(LDAP_DEBUG_TRACE, - "ldbm_back_add (tombstone_operation): failed to " + slapi_log_err(SLAPI_LOG_TRACE, + "ldbm_back_add", "(tombstone_operation): failed to " "decompose %s to Slapi_RDN\n", tombstoned_dn); } else { slapi_entry_set_srdn(e, &srdn); @@ -719,7 +722,7 @@ ldbm_back_add( Slapi_PBlock *pb ) Slapi_DN ancestorsdn; struct backentry *ancestorentry; - LDAPDebug1Arg(LDAP_DEBUG_BACKLDBM, "ldbm_add: Parent \"%s\" does not exist. " + slapi_log_err(SLAPI_LOG_BACKLDBM, "ldbm_back_add", "Parent \"%s\" does not exist. " "It might be a conflict entry.\n", slapi_sdn_get_dn(&parentsdn)); slapi_sdn_init(&ancestorsdn); ancestorentry = dn2ancestor(be, &parentsdn, &ancestorsdn, &txn, &err, 1); @@ -735,7 +738,7 @@ ldbm_back_add( Slapi_PBlock *pb ) ACLPLUGIN_ACCESS_DEFAULT, &errbuf); if ( ldap_result_code != LDAP_SUCCESS ) { - LDAPDebug1Arg(LDAP_DEBUG_TRACE, "no access to parent, pdn = %s\n", + slapi_log_err(SLAPI_LOG_TRACE, "ldbm_back_add", "no access to parent, pdn = %s\n", slapi_sdn_get_dn(&parentsdn)); ldap_result_message= errbuf; goto error_return; @@ -749,7 +752,7 @@ ldbm_back_add( Slapi_PBlock *pb ) char *adjusteddn = slapi_ch_smprintf("%s,%s", slapi_entry_get_rdn_const(addingentry->ep_entry), slapi_entry_get_dn_const(parententry->ep_entry)); - LDAPDebug2Args(LDAP_DEBUG_BACKLDBM, "ldbm_add: adjusting dn: %s --> %s\n", + slapi_log_err(SLAPI_LOG_BACKLDBM, "ldbm_back_add", "Adjusting dn: %s --> %s\n", slapi_entry_get_dn(addingentry->ep_entry), adjusteddn); slapi_sdn_set_normdn_passin(&adjustedsdn, adjusteddn); slapi_entry_set_sdn(addingentry->ep_entry, &adjustedsdn); @@ -761,7 +764,7 @@ ldbm_back_add( Slapi_PBlock *pb ) else { /* no parent */ if (!isroot && !is_replicated_operation) { - LDAPDebug0Args(LDAP_DEBUG_TRACE, "no parent & not root\n"); + slapi_log_err(SLAPI_LOG_TRACE, "ldbm_back_add", "No parent & not root\n"); ldap_result_code= LDAP_INSUFFICIENT_ACCESS; goto error_return; } @@ -790,7 +793,7 @@ ldbm_back_add( Slapi_PBlock *pb ) * operational attributes to ensure that the cache is sized correctly. */ if ( cache_add_tentative( &inst->inst_cache, addingentry, NULL ) < 0 ) { - LDAPDebug1Arg(LDAP_DEBUG_CACHE, "cache_add_tentative concurrency detected: %s\n", + slapi_log_err(SLAPI_LOG_CACHE, "ldbm_back_add", "cache_add_tentative concurrency detected: %s\n", slapi_entry_get_dn_const(addingentry->ep_entry)); ldap_result_code= LDAP_ALREADY_EXISTS; goto error_return; @@ -802,7 +805,7 @@ ldbm_back_add( Slapi_PBlock *pb ) * the entry if the syntax is incorrect. */ if ( plugin_call_acl_verify_syntax (pb, addingentry->ep_entry, &errbuf) != 0 ) { - LDAPDebug1Arg(LDAP_DEBUG_TRACE, "ACL syntax error: %s\n", + slapi_log_err(SLAPI_LOG_TRACE, "ldbm_back_add", "ACL syntax error: %s\n", slapi_entry_get_dn_const(addingentry->ep_entry)); ldap_result_code= LDAP_INVALID_SYNTAX; ldap_result_message= errbuf; @@ -816,12 +819,12 @@ ldbm_back_add( Slapi_PBlock *pb ) retval = parent_update_on_childchange(&parent_modify_c, is_resurect_operation?PARENTUPDATE_RESURECT:PARENTUPDATE_ADD, NULL); - slapi_log_error(SLAPI_LOG_BACKLDBM, "ldbm_back_add", + slapi_log_err(SLAPI_LOG_BACKLDBM, "ldbm_back_add", "conn=%lu op=%d parent_update_on_childchange: old_entry=0x%p, new_entry=0x%p, rc=%d\n", conn_id, op_id, parent_modify_c.old_entry, parent_modify_c.new_entry, retval); /* The modify context now contains info needed later */ if (retval) { - LDAPDebug2Args(LDAP_DEBUG_BACKLDBM, "parent_update_on_childchange: %s, rc=%d\n", + slapi_log_err(SLAPI_LOG_BACKLDBM, "ldbm_back_add", "parent_update_on_childchange: %s, rc=%d\n", slapi_entry_get_dn_const(addingentry->ep_entry), retval); ldap_result_code= LDAP_OPERATIONS_ERROR; goto error_return; @@ -844,7 +847,7 @@ ldbm_back_add( Slapi_PBlock *pb ) not_an_error = 1; rc = retval = LDAP_SUCCESS; } - LDAPDebug1Arg(LDAP_DEBUG_TRACE, "SLAPI_PLUGIN_BE_TXN_PRE_ADD_FN plugin " + slapi_log_err(SLAPI_LOG_TRACE, "ldbm_back_add", "SLAPI_PLUGIN_BE_TXN_PRE_ADD_FN plugin " "returned error code %d\n", retval ); if (!ldap_result_code) { slapi_pblock_get(pb, SLAPI_RESULT_CODE, &ldap_result_code); @@ -858,7 +861,7 @@ ldbm_back_add( Slapi_PBlock *pb ) slapi_pblock_set(pb, SLAPI_PLUGIN_OPRETURN, ldap_result_code ? &ldap_result_code : &retval); } slapi_pblock_get(pb, SLAPI_PB_RESULT_TEXT, &ldap_result_message); - LDAPDebug1Arg(LDAP_DEBUG_DEBUG, "SLAPI_PLUGIN_BE_TXN_PRE_ADD_FN plugin failed: %d\n", + slapi_log_err(SLAPI_LOG_DEBUG, "ldbm_back_add", "SLAPI_PLUGIN_BE_TXN_PRE_ADD_FN plugin failed: %d\n", ldap_result_code ? ldap_result_code : retval); goto error_return; } @@ -866,12 +869,12 @@ ldbm_back_add( Slapi_PBlock *pb ) retval = id2entry_add_ext(be, addingentry, &txn, 1, &myrc); if (DB_LOCK_DEADLOCK == retval) { - LDAPDebug(LDAP_DEBUG_ARGS, "add 1 DEADLOCK\n", 0, 0, 0 ); + slapi_log_err(SLAPI_LOG_ARGS, "ldbm_back_add", "add 1 DEADLOCK\n"); /* Retry txn */ continue; } if (retval) { - LDAPDebug(LDAP_DEBUG_TRACE, "id2entry_add(%s) failed, err=%d %s\n", + slapi_log_err(SLAPI_LOG_TRACE, "ldbm_back_add", "id2entry_add(%s) failed, err=%d %s\n", slapi_entry_get_dn_const(addingentry->ep_entry), retval, (msg = dblayer_strerror( retval )) ? msg : ""); ADD_SET_ERROR(ldap_result_code, LDAP_OPERATIONS_ERROR, retry_count); @@ -888,12 +891,12 @@ ldbm_back_add( Slapi_PBlock *pb ) retval = index_addordel_string(be,SLAPI_ATTR_OBJECTCLASS, SLAPI_ATTR_VALUE_TOMBSTONE, addingentry->ep_id, BE_INDEX_DEL|BE_INDEX_EQUALITY, &txn); if (DB_LOCK_DEADLOCK == retval) { - LDAPDebug(LDAP_DEBUG_ARGS, "add 2 DB_LOCK_DEADLOCK\n", 0, 0, 0 ); + slapi_log_err(SLAPI_LOG_ARGS, "ldbm_back_add", "add 2 DB_LOCK_DEADLOCK\n"); /* Retry txn */ continue; } if (retval) { - LDAPDebug(LDAP_DEBUG_TRACE, "index_addordel_string TOMBSTONE (%s), err=%d %s\n", + slapi_log_err(SLAPI_LOG_TRACE, "ldbm_back_add", "index_addordel_string TOMBSTONE (%s), err=%d %s\n", slapi_entry_get_dn_const(addingentry->ep_entry), retval, (msg = dblayer_strerror( retval )) ? msg : ""); ADD_SET_ERROR(ldap_result_code, LDAP_OPERATIONS_ERROR, retry_count); @@ -910,12 +913,12 @@ ldbm_back_add( Slapi_PBlock *pb ) retval = index_addordel_string(be, SLAPI_ATTR_TOMBSTONE_CSN, deletion_csn_str, tombstoneentry->ep_id, BE_INDEX_DEL|BE_INDEX_EQUALITY, &txn); if (DB_LOCK_DEADLOCK == retval) { - LDAPDebug(LDAP_DEBUG_ARGS, "add 3 DB_LOCK_DEADLOCK\n", 0, 0, 0 ); + slapi_log_err(SLAPI_LOG_ARGS, "ldbm_back_add", "add 3 DB_LOCK_DEADLOCK\n"); /* Retry txn */ continue; } if (0 != retval) { - LDAPDebug(LDAP_DEBUG_TRACE, "index_addordel_string TOMBSTONE csn(%s), err=%d %s\n", + slapi_log_err(SLAPI_LOG_TRACE, "ldbm_back_add", "index_addordel_string TOMBSTONE csn(%s), err=%d %s\n", slapi_entry_get_dn_const(tombstoneentry->ep_entry), retval, (msg = dblayer_strerror( retval )) ? msg : ""); ADD_SET_ERROR(ldap_result_code, LDAP_OPERATIONS_ERROR, retry_count); @@ -929,12 +932,12 @@ ldbm_back_add( Slapi_PBlock *pb ) retval = index_addordel_string(be,SLAPI_ATTR_UNIQUEID,slapi_entry_get_uniqueid(addingentry->ep_entry),addingentry->ep_id,BE_INDEX_DEL|BE_INDEX_EQUALITY,&txn); if (DB_LOCK_DEADLOCK == retval) { - LDAPDebug(LDAP_DEBUG_ARGS, "add 4 DB_LOCK_DEADLOCK\n", 0, 0, 0 ); + slapi_log_err(SLAPI_LOG_ARGS, "ldbm_back_add", "add 4 DB_LOCK_DEADLOCK\n"); /* Retry txn */ continue; } if (0 != retval) { - LDAPDebug(LDAP_DEBUG_TRACE, "index_addordel_string UNIQUEID (%s), err=%d %s\n", + slapi_log_err(SLAPI_LOG_TRACE, "ldbm_back_add", "index_addordel_string UNIQUEID (%s), err=%d %s\n", slapi_entry_get_dn_const(addingentry->ep_entry), retval, (msg = dblayer_strerror( retval )) ? msg : ""); ADD_SET_ERROR(ldap_result_code, LDAP_OPERATIONS_ERROR, retry_count); @@ -950,12 +953,12 @@ ldbm_back_add( Slapi_PBlock *pb ) addingentry->ep_id, BE_INDEX_DEL|BE_INDEX_EQUALITY, &txn); if (DB_LOCK_DEADLOCK == retval) { - LDAPDebug(LDAP_DEBUG_ARGS, "add 5 DB_LOCK_DEADLOCK\n", 0, 0, 0 ); + slapi_log_err(SLAPI_LOG_ARGS, "ldbm_back_add", "add 5 DB_LOCK_DEADLOCK\n"); /* Retry txn */ continue; } if (0 != retval) { - LDAPDebug(LDAP_DEBUG_TRACE, "index_addordel_string ENTRYDN (%s), err=%d %s\n", + slapi_log_err(SLAPI_LOG_TRACE, "ldbm_back_add", "index_addordel_string ENTRYDN (%s), err=%d %s\n", slapi_entry_get_dn_const(addingentry->ep_entry), retval, (msg = dblayer_strerror( retval )) ? msg : ""); ADD_SET_ERROR(ldap_result_code, LDAP_OPERATIONS_ERROR, retry_count); @@ -970,7 +973,7 @@ ldbm_back_add( Slapi_PBlock *pb ) if (tombstoneentry) { retval = entryrdn_index_entry(be, tombstoneentry, BE_INDEX_DEL, &txn); if (retval) { - LDAPDebug(LDAP_DEBUG_ERR, "ldbm_back_add - " + slapi_log_err(SLAPI_LOG_ERR, "ldbm_back_add", "Resurrecting %s: failed to remove entryrdn index, err=%d %s\n", slapi_entry_get_dn_const(tombstoneentry->ep_entry), retval, (msg = dblayer_strerror( retval )) ? msg : ""); @@ -989,13 +992,12 @@ ldbm_back_add( Slapi_PBlock *pb ) } if (DB_LOCK_DEADLOCK == retval) { - LDAPDebug(LDAP_DEBUG_ARGS, "ldbm_back_add - " - "add 5 DEADLOCK\n", 0, 0, 0 ); + slapi_log_err(SLAPI_LOG_ARGS, "ldbm_back_add", "add 5 DEADLOCK\n"); /* retry txn */ continue; } if (retval) { - LDAPDebug2Args(LDAP_DEBUG_DEBUG, "ldbm_back_add - " + slapi_log_err(SLAPI_LOG_DEBUG, "ldbm_back_add", "Attempt to index %lu failed; rc=%d\n", (u_long)addingentry->ep_id, retval); ADD_SET_ERROR(ldap_result_code, LDAP_OPERATIONS_ERROR, retry_count); @@ -1008,17 +1010,17 @@ ldbm_back_add( Slapi_PBlock *pb ) if (parent_found) { /* Push out the db modifications from the parent entry */ retval = modify_update_all(be,pb,&parent_modify_c,&txn); - slapi_log_error(SLAPI_LOG_BACKLDBM, "ldbm_back_add", + slapi_log_err(SLAPI_LOG_BACKLDBM, "ldbm_back_add", "conn=%lu op=%d modify_update_all: old_entry=0x%p, new_entry=0x%p, rc=%d\n", conn_id, op_id, parent_modify_c.old_entry, parent_modify_c.new_entry, retval); if (DB_LOCK_DEADLOCK == retval) { - LDAPDebug(LDAP_DEBUG_ARGS, "add 6 DEADLOCK\n", 0, 0, 0 ); + slapi_log_err(SLAPI_LOG_ARGS, "ldbm_back_add", "add 6 DEADLOCK\n"); /* Retry txn */ continue; } if (retval) { - LDAPDebug(LDAP_DEBUG_BACKLDBM, "ldbm_back_add - " + slapi_log_err(SLAPI_LOG_BACKLDBM, "ldbm_back_add", "modify_update_all: %s (%lu) failed; rc=%d\n", slapi_entry_get_dn(addingentry->ep_entry), (u_long)addingentry->ep_id, retval); ADD_SET_ERROR(ldap_result_code, LDAP_OPERATIONS_ERROR, retry_count); @@ -1036,13 +1038,13 @@ ldbm_back_add( Slapi_PBlock *pb ) { retval= vlv_update_all_indexes(&txn, be, pb, NULL, addingentry); if (DB_LOCK_DEADLOCK == retval) { - LDAPDebug(LDAP_DEBUG_ARGS, - "add DEADLOCK vlv_update_index\n", 0, 0, 0 ); + slapi_log_err(SLAPI_LOG_ARGS, "ldbm_back_add", + "add DEADLOCK vlv_update_index\n"); /* Retry txn */ continue; } if (retval) { - LDAPDebug2Args(LDAP_DEBUG_TRACE, "ldbm_back_add - " + slapi_log_err(SLAPI_LOG_TRACE, "ldbm_back_add", "vlv_update_index failed, err=%d %s\n", retval, (msg = dblayer_strerror( retval )) ? msg : ""); ADD_SET_ERROR(ldap_result_code, LDAP_OPERATIONS_ERROR, retry_count); @@ -1057,10 +1059,9 @@ ldbm_back_add( Slapi_PBlock *pb ) if (!is_ruv && !is_fixup_operation && !NO_RUV_UPDATE(li)) { ruv_c_init = ldbm_txn_ruv_modify_context( pb, &ruv_c ); if (-1 == ruv_c_init) { - LDAPDebug(LDAP_DEBUG_ERR, "ldbm_back_add - " - "ldbm_txn_ruv_modify_context " - "failed to construct RUV modify context\n", - 0, 0, 0); + slapi_log_err(SLAPI_LOG_ERR, "ldbm_back_add", + "ldbm_txn_ruv_modify_context - " + "failed to construct RUV modify context\n"); ldap_result_code= LDAP_OPERATIONS_ERROR; retval = 0; goto error_return; @@ -1074,9 +1075,9 @@ ldbm_back_add( Slapi_PBlock *pb ) continue; } if (0 != retval) { - LDAPDebug(LDAP_DEBUG_ERR, "ldbm_back_add - " + slapi_log_err(SLAPI_LOG_ERR, "ldbm_back_add", "modify_update_all failed, err=%d %s\n", retval, - (msg = dblayer_strerror( retval )) ? msg : "", 0 ); + (msg = dblayer_strerror( retval )) ? msg : ""); if (LDBM_OS_ERR_IS_DISKFULL(retval)) disk_full = 1; ldap_result_code= LDAP_OPERATIONS_ERROR; @@ -1090,8 +1091,8 @@ ldbm_back_add( Slapi_PBlock *pb ) } if (retry_count == RETRY_TIMES) { /* Failed */ - LDAPDebug(LDAP_DEBUG_ERR, "ldbm_back_add - " - "Retry count exceeded in add\n", 0, 0, 0 ); + slapi_log_err(SLAPI_LOG_ERR, "ldbm_back_add", + "Retry count exceeded in add\n"); ldap_result_code= LDAP_BUSY; goto error_return; } @@ -1111,7 +1112,7 @@ ldbm_back_add( Slapi_PBlock *pb ) if (retval) { /* This happens if the dn of addingentry already exists */ ADD_SET_ERROR(ldap_result_code, LDAP_ALREADY_EXISTS, retry_count); - LDAPDebug2Args(LDAP_DEBUG_CACHE, "ldbm_back_add - " + slapi_log_err(SLAPI_LOG_CACHE, "ldbm_back_add", "cache_replace concurrency detected: %s (rc: %d)\n", slapi_entry_get_dn_const(addingentry->ep_entry), retval); retval = -1; @@ -1136,7 +1137,7 @@ ldbm_back_add( Slapi_PBlock *pb ) { /* switch the parent entry copy into play */ myrc = modify_switch_entries(&parent_modify_c,be); - slapi_log_error(SLAPI_LOG_BACKLDBM, "ldbm_back_add", + slapi_log_err(SLAPI_LOG_BACKLDBM, "ldbm_back_add", "conn=%lu op=%d modify_switch_entries: old_entry=0x%p, new_entry=0x%p, rc=%d\n", conn_id, op_id, parent_modify_c.old_entry, parent_modify_c.new_entry, myrc); if (0 == myrc) { @@ -1147,7 +1148,7 @@ ldbm_back_add( Slapi_PBlock *pb ) if (ruv_c_init) { if (modify_switch_entries(&ruv_c, be) != 0 ) { ldap_result_code= LDAP_OPERATIONS_ERROR; - LDAPDebug0Args(LDAP_DEBUG_ERR, "ldbm_back_add - " + slapi_log_err(SLAPI_LOG_ERR, "ldbm_back_add", "modify_switch_entries failed\n"); goto error_return; } @@ -1156,7 +1157,7 @@ ldbm_back_add( Slapi_PBlock *pb ) /* call the transaction post add plugins just before the commit */ if ((retval = plugin_call_plugins(pb, SLAPI_PLUGIN_BE_TXN_POST_ADD_FN))) { int opreturn = 0; - LDAPDebug1Arg(LDAP_DEBUG_TRACE, "ldbm_back_add - " + slapi_log_err(SLAPI_LOG_TRACE, "ldbm_back_add", "SLAPI_PLUGIN_BE_TXN_POST_ADD_FN plugin " "returned error code %d\n", retval ); if (!ldap_result_code) { @@ -1199,7 +1200,7 @@ error_return: } if (rc == DB_RUNRECOVERY) { dblayer_remember_disk_filled(li); - ldbm_nasty("Add",80,rc); + ldbm_nasty("ldbm_back_add","Add",80,rc); disk_full = 1; } else if (0 == rc) { rc = SLAPI_FAIL_GENERAL; @@ -1211,7 +1212,7 @@ error_return: * be written to disk. */ myrc = modify_unswitch_entries(&parent_modify_c, be); - slapi_log_error(SLAPI_LOG_BACKLDBM, "ldbm_back_add", + slapi_log_err(SLAPI_LOG_BACKLDBM, "ldbm_back_add", "conn=%lu op=%d modify_unswitch_entries: old_entry=0x%p, new_entry=0x%p, rc=%d\n", conn_id, op_id, parent_modify_c.old_entry, parent_modify_c.new_entry, myrc); } @@ -1252,7 +1253,7 @@ diskfull_return: /* call the transaction post add plugins just before the abort */ if ((retval = plugin_call_plugins(pb, SLAPI_PLUGIN_BE_TXN_POST_ADD_FN))) { int opreturn = 0; - LDAPDebug1Arg(LDAP_DEBUG_TRACE, "ldbm_back_add - " + slapi_log_err(SLAPI_LOG_TRACE, "ldbm_back_add", "SLAPI_PLUGIN_BE_TXN_POST_ADD_FN plugin " "returned error code %d\n", retval ); if (!ldap_result_code) { @@ -1328,7 +1329,7 @@ common_return: if (bdn) { CACHE_ADD( &inst->inst_dncache, bdn, NULL ); CACHE_RETURN(&inst->inst_dncache, &bdn); - slapi_log_error(SLAPI_LOG_CACHE, "ldbm_back_add", + slapi_log_err(SLAPI_LOG_CACHE, "ldbm_back_add", "set %s to dn cache\n", dn); } } @@ -1350,7 +1351,7 @@ common_return: if (ruv_c_init) { modify_term(&ruv_c, be); } - slapi_log_error(SLAPI_LOG_BACKLDBM, "ldbm_back_add", + slapi_log_err(SLAPI_LOG_BACKLDBM, "ldbm_back_add", "conn=%lu op=%d modify_term: old_entry=0x%p, new_entry=0x%p\n", conn_id, op_id, parent_modify_c.old_entry, parent_modify_c.new_entry); myrc = modify_term(&parent_modify_c,be); diff --git a/ldap/servers/slapd/back-ldbm/ldbm_attr.c b/ldap/servers/slapd/back-ldbm/ldbm_attr.c index c748604..30b0f2a 100644 --- a/ldap/servers/slapd/back-ldbm/ldbm_attr.c +++ b/ldap/servers/slapd/back-ldbm/ldbm_attr.c @@ -664,7 +664,7 @@ attr_index_config( slapi_attr_first_value(attr, &sval); attrValue = slapi_value_get_berval(sval); } else { - LDAPDebug(LDAP_DEBUG_ERR, "attr_index_config - Missing indexing arguments\n", 0, 0, 0); + slapi_log_err(SLAPI_LOG_ERR, "attr_index_config", "Missing indexing arguments\n"); return -1; } @@ -701,13 +701,13 @@ attr_index_config( a->ai_indexmask |= INDEX_SUB; } else if ( strcasecmp( attrValue->bv_val, "none" ) == 0 ) { if ( a->ai_indexmask != 0 ) { - LDAPDebug(LDAP_DEBUG_WARNING, - "attr_index_config - %s: line %d: index type \"none\" cannot be combined with other types\n", - fname, lineno, 0); + slapi_log_err(SLAPI_LOG_WARNING, + "attr_index_config", "%s: line %d: index type \"none\" cannot be combined with other types\n", + fname, lineno); } a->ai_indexmask = INDEX_OFFLINE; /* note that the index isn't available */ } else { - slapi_log_error(SLAPI_LOG_ERR, "attr_index_config - ", + slapi_log_err(SLAPI_LOG_ERR, "attr_index_config", "%s: line %d: unknown index type \"%s\" (ignored) in entry (%s), " "valid index types are \"pres\", \"eq\", \"approx\", or \"sub\"\n", fname, lineno, attrValue->bv_val, slapi_entry_get_dn(e)); @@ -717,7 +717,7 @@ attr_index_config( } if(hasIndexType == 0){ /* indexType missing, error out */ - LDAPDebug(LDAP_DEBUG_ERR, "attr_index_config - Missing index type\n", 0, 0, 0); + slapi_log_err(SLAPI_LOG_ERR, "attr_index_config", "Missing index type\n"); attrinfo_delete(&a); return -1; } @@ -841,13 +841,13 @@ attr_index_config( official_rules[k++] = slapi_ch_strdup (officialOID); } else { char* preamble = slapi_ch_smprintf("%s: line %d", fname, lineno); - LDAPDebug(LDAP_DEBUG_WARNING, "attr_index_config - " + slapi_log_err(SLAPI_LOG_WARNING, "attr_index_config", "%s: use \"%s\" instead of \"%s\" (ignored)\n", preamble, officialOID, attrValue->bv_val); slapi_ch_free((void**)&preamble); } } else { /* we don't know what this is */ - LDAPDebug(LDAP_DEBUG_WARNING, "attr_index_config - %s: line %d: " + slapi_log_err(SLAPI_LOG_WARNING, "attr_index_config", "%s: line %d: " "unknown or invalid matching rule \"%s\" in index configuration (ignored)\n", fname, lineno, attrValue->bv_val); } @@ -877,7 +877,7 @@ attr_index_config( } if ((return_value = attr_index_idlistsize_config(e, a, myreturntext))) { - LDAPDebug(LDAP_DEBUG_ERR,"attr_index_config - %s: Failed to parse idscanlimit info: %d:%s\n", + slapi_log_err(SLAPI_LOG_ERR,"attr_index_config", "%s: Failed to parse idscanlimit info: %d:%s\n", fname, return_value, myreturntext); } @@ -885,9 +885,9 @@ attr_index_config( return_value = idl_init_private(be, a); if (0 != return_value) { /* fatal error, exit */ - LDAPDebug(LDAP_DEBUG_CRIT,"attr_index_config - " + slapi_log_err(SLAPI_LOG_CRIT,"attr_index_config", "%s: line %d:Fatal Error: Failed to initialize attribute structure\n", - fname, lineno, 0); + fname, lineno); exit( 1 ); } @@ -900,8 +900,8 @@ attr_index_config( if (need_compare_fn) { int rc = attr_get_value_cmp_fn( &a->ai_sattr, &a->ai_key_cmp_fn ); if (rc != LDAP_SUCCESS) { - LDAPDebug(LDAP_DEBUG_ERR, - "attr_index_config - The attribute [%s] does not have a valid ORDERING matching rule - error %d:s\n", + slapi_log_err(SLAPI_LOG_ERR, + "attr_index_config", "The attribute [%s] does not have a valid ORDERING matching rule - error %d:%s\n", a->ai_type, rc, ldap_err2string(rc)); a->ai_key_cmp_fn = NULL; } diff --git a/ldap/servers/slapd/back-ldbm/ldbm_attrcrypt.c b/ldap/servers/slapd/back-ldbm/ldbm_attrcrypt.c index 393053f..b558df0 100644 --- a/ldap/servers/slapd/back-ldbm/ldbm_attrcrypt.c +++ b/ldap/servers/slapd/back-ldbm/ldbm_attrcrypt.c @@ -153,12 +153,12 @@ attrcrypt_keymgmt_get_key(ldbm_instance *li, attrcrypt_cipher_state *acs, SECKEY char *instance_name = li->inst_name; char *dn_string = NULL; - LDAPDebug(LDAP_DEBUG_TRACE,"-> attrcrypt_keymgmt_get_key\n", 0, 0, 0); + slapi_log_err(SLAPI_LOG_TRACE, "attrcrypt_keymgmt_get_key", "->\n"); dn_string = slapi_create_dn_string(dn_template, acs->ace->cipher_display_name, instance_name, li->inst_li->li_plugin->plg_name); if (NULL == dn_string) { - LDAPDebug(LDAP_DEBUG_ERR, "attrcrypt_keymgmt_get_key - " + slapi_log_err(SLAPI_LOG_ERR, "attrcrypt_keymgmt_get_key", "Failed create attrcrypt key dn for plugin %s, " "instance %s, cypher %s\n", li->inst_li->li_plugin->plg_name, @@ -170,7 +170,7 @@ attrcrypt_keymgmt_get_key(ldbm_instance *li, attrcrypt_cipher_state *acs, SECKEY (const char *)dn_string); bail: slapi_ch_free_string(&dn_string); - LDAPDebug(LDAP_DEBUG_TRACE,"<- attrcrypt_keymgmt_get_key\n", 0, 0, 0); + slapi_log_err(SLAPI_LOG_TRACE, "attrcrypt_keymgmt_get_key", "<-\n"); return ret; } @@ -180,7 +180,7 @@ attrcrypt_keymgmt_store_key(ldbm_instance *li, attrcrypt_cipher_state *acs, SECK { int ret = 0; SECItem wrapped_symmetric_key = {0}; - LDAPDebug(LDAP_DEBUG_TRACE,"-> attrcrypt_keymgmt_store_key\n", 0, 0, 0); + slapi_log_err(SLAPI_LOG_TRACE,"attrcrypt_keymgmt_store_key", "->\n"); /* Wrap the key and then store it in the right place in dse.ldif */ ret = attrcrypt_wrap_key(acs, key_to_store, public_key, &wrapped_symmetric_key); if (!ret) { @@ -213,7 +213,7 @@ attrcrypt_keymgmt_store_key(ldbm_instance *li, attrcrypt_cipher_state *acs, SECK if (rc != LDAP_SUCCESS) { char *resulttext = NULL; slapi_pblock_get(pb, SLAPI_PB_RESULT_TEXT, &resulttext); - LDAPDebug(LDAP_DEBUG_ERR, "attrcrypt_keymgmt_store_key - " + slapi_log_err(SLAPI_LOG_ERR, "attrcrypt_keymgmt_store_key", "Failed to add config key entries to the DSE: %d: %s: %s\n", rc, ldap_err2string(rc), resulttext ? resulttext : "unknown"); ret = -1; @@ -221,7 +221,7 @@ attrcrypt_keymgmt_store_key(ldbm_instance *li, attrcrypt_cipher_state *acs, SECK slapi_ch_free((void**)&entry_string); slapi_pblock_destroy(pb); } - LDAPDebug(LDAP_DEBUG_TRACE,"<- attrcrypt_keymgmt_store_key\n", 0, 0, 0); + slapi_log_err(SLAPI_LOG_TRACE,"attrcrypt_keymgmt_store_key", "<-\n"); return ret; } @@ -239,15 +239,15 @@ attrcrypt_wrap_key(attrcrypt_cipher_state *acs, PK11SymKey *symmetric_key, SECKE SECKEYPublicKey *wrapping_key = public_key; wrapped_symmetric_key->len = slapd_SECKEY_PublicKeyStrength(public_key); wrapped_symmetric_key->data = (unsigned char *)slapi_ch_malloc(wrapped_symmetric_key->len); - LDAPDebug(LDAP_DEBUG_TRACE,"-> attrcrypt_wrap_key\n", 0, 0, 0); + slapi_log_err(SLAPI_LOG_TRACE,"attrcrypt_wrap_key", "->\n"); s = slapd_pk11_PubWrapSymKey(wrap_mechanism, wrapping_key, symmetric_key, wrapped_symmetric_key); if (SECSuccess != s) { ret = -1; - LDAPDebug(LDAP_DEBUG_ERR,"attrcrypt_wrap_key - " + slapi_log_err(SLAPI_LOG_ERR,"attrcrypt_wrap_key", "Failed to wrap key for cipher %s\n", - acs->ace->cipher_display_name, 0, 0); + acs->ace->cipher_display_name); } - LDAPDebug(LDAP_DEBUG_TRACE,"<- attrcrypt_wrap_key\n", 0, 0, 0); + slapi_log_err(SLAPI_LOG_TRACE,"attrcrypt_wrap_key", "<-\n"); return ret; } @@ -259,7 +259,7 @@ attrcrypt_unwrap_key(attrcrypt_cipher_state *acs, SECKEYPrivateKey *private_key, CK_MECHANISM_TYPE wrap_mechanism = acs->ace->wrap_mechanism; SECKEYPrivateKey *unwrapping_key = private_key; - slapi_log_error(SLAPI_LOG_TRACE, "attrcrypt_unwrap_key", "-> attrcrypt_unwrap_key\n"); + slapi_log_err(SLAPI_LOG_TRACE, "attrcrypt_unwrap_key", "->\n"); /* * NOTE: we are unwrapping one symmetric key with attribute both ENCRYPT * and DECRYPT set. Some hardware token might have a problem with @@ -277,11 +277,11 @@ attrcrypt_unwrap_key(attrcrypt_cipher_state *acs, SECKEYPrivateKey *private_key, PR_FALSE); if (NULL == *unwrapped_symmetric_key) { ret = -1; - slapi_log_error(SLAPI_LOG_ERR, "attrcrypt_unwrap_key", + slapi_log_err(SLAPI_LOG_ERR, "attrcrypt_unwrap_key", "Failed to unwrap key for cipher %s\n", acs->ace->cipher_display_name); } - slapi_log_error(SLAPI_LOG_TRACE, "attrcrypt_unwrap_key", "<- attrcrypt_unwrap_key\n"); + slapi_log_err(SLAPI_LOG_TRACE, "attrcrypt_unwrap_key", "<-\n"); return ret; } @@ -291,15 +291,15 @@ attrcrypt_generate_key(attrcrypt_cipher_state *acs,PK11SymKey **symmetric_key) { int ret = 1; PK11SymKey *new_symmetric_key = NULL; - slapi_log_error(SLAPI_LOG_TRACE, ATTRCRYPT, "-> attrcrypt_generate_key\n"); + slapi_log_err(SLAPI_LOG_TRACE, "attrcrypt_generate_key", "->\n"); if (NULL == symmetric_key) { - LDAPDebug0Args(LDAP_DEBUG_ERR, "attrcrypt_generate_key - NULL symmetric_key\n"); + slapi_log_err(SLAPI_LOG_ERR, "attrcrypt_generate_key", "NULL symmetric_key\n"); goto bail; } *symmetric_key = NULL; if (!slapd_pk11_DoesMechanism(acs->slot, acs->ace->cipher_mechanism)) { - slapi_log_error(SLAPI_LOG_ERR, "attrcrypt_generate_key", "%s is not supported.\n", + slapi_log_err(SLAPI_LOG_ERR, "attrcrypt_generate_key", "%s is not supported.\n", acs->ace->cipher_display_name); ret = -1; goto bail; @@ -325,8 +325,7 @@ attrcrypt_generate_key(attrcrypt_cipher_state *acs,PK11SymKey **symmetric_key) ret = 0; } bail: - slapi_log_error(SLAPI_LOG_TRACE, ATTRCRYPT, - "<- attrcrypt_generate_key (%d)\n", ret); + slapi_log_err(SLAPI_LOG_TRACE, "attrcrypt_generate_key", "<- (%d)\n", ret); return ret; } @@ -339,7 +338,7 @@ attrcrypt_fetch_public_key(SECKEYPublicKey **public_key) PRErrorCode errorCode = 0; char *default_cert_name = "server-cert"; char *cert_name = NULL; - LDAPDebug(LDAP_DEBUG_TRACE,"-> attrcrypt_fetch_public_key\n", 0, 0, 0); + slapi_log_err(SLAPI_LOG_TRACE,"attrcrypt_fetch_public_key", "->\n"); *public_key = NULL; /* Try to grok the server cert name from the SSL config */ ret = attrcrypt_get_ssl_cert_name(&cert_name); @@ -350,7 +349,7 @@ attrcrypt_fetch_public_key(SECKEYPublicKey **public_key) cert = slapd_pk11_findCertFromNickname(cert_name, NULL); if (cert == NULL) { errorCode = PR_GetError(); - LDAPDebug(LDAP_DEBUG_ERR,"attrcrypt_fetch_public_key - Can't find certificate %s: %d - %s\n", + slapi_log_err(SLAPI_LOG_ERR,"attrcrypt_fetch_public_key", "Can't find certificate %s: %d - %s\n", cert_name, errorCode, slapd_pr_strerror(errorCode)); } if( cert != NULL ) { @@ -358,7 +357,8 @@ attrcrypt_fetch_public_key(SECKEYPublicKey **public_key) } if (key == NULL) { errorCode = PR_GetError(); - LDAPDebug(LDAP_DEBUG_ERR,"attrcrypt_fetch_public_key - Can't get private key from cert %s: %d - %s\n", cert_name, errorCode, slapd_pr_strerror(errorCode)); + slapi_log_err(SLAPI_LOG_ERR,"attrcrypt_fetch_public_key", "Can't get private key from cert %s: %d - %s\n", + cert_name, errorCode, slapd_pr_strerror(errorCode)); ret = -1; } if (cert) { @@ -372,7 +372,7 @@ attrcrypt_fetch_public_key(SECKEYPublicKey **public_key) if (cert_name != default_cert_name) { slapi_ch_free_string(&cert_name); } - LDAPDebug(LDAP_DEBUG_TRACE,"<- attrcrypt_fetch_public_key\n", 0, 0, 0); + slapi_log_err(SLAPI_LOG_TRACE,"attrcrypt_fetch_public_key", "<-\n"); return ret; } @@ -385,7 +385,7 @@ attrcrypt_fetch_private_key(SECKEYPrivateKey **private_key) PRErrorCode errorCode = 0; char *default_cert_name = "server-cert"; char *cert_name = NULL; - LDAPDebug(LDAP_DEBUG_TRACE,"-> attrcrypt_fetch_private_key\n", 0, 0, 0); + slapi_log_err(SLAPI_LOG_TRACE,"attrcrypt_fetch_private_key", "->\n"); *private_key = NULL; /* Try to grok the server cert name from the SSL config */ ret = attrcrypt_get_ssl_cert_name(&cert_name); @@ -396,15 +396,17 @@ attrcrypt_fetch_private_key(SECKEYPrivateKey **private_key) cert = slapd_pk11_findCertFromNickname(cert_name, NULL); if (cert == NULL) { errorCode = PR_GetError(); - LDAPDebug(LDAP_DEBUG_ERR,"attrcrypt_fetch_private_key - Can't find certificate %s: %d - %s\n", cert_name, errorCode, slapd_pr_strerror(errorCode)); + slapi_log_err(SLAPI_LOG_ERR,"attrcrypt_fetch_private_key", "Can't find certificate %s: %d - %s\n", + cert_name, errorCode, slapd_pr_strerror(errorCode)); } if( cert != NULL ) { key = slapd_get_unlocked_key_for_cert(cert, NULL); } if (key == NULL) { - errorCode = PR_GetError(); - LDAPDebug(LDAP_DEBUG_ERR,"attrcrypt_fetch_private_key - Can't get private key from cert %s: %d - %s\n", cert_name, errorCode, slapd_pr_strerror(errorCode)); - ret = -1; + errorCode = PR_GetError(); + slapi_log_err(SLAPI_LOG_ERR,"attrcrypt_fetch_private_key", "Can't get private key from cert %s: %d - %s\n", + cert_name, errorCode, slapd_pr_strerror(errorCode)); + ret = -1; } if (cert) { slapd_pk11_CERT_DestroyCertificate(cert); @@ -417,7 +419,7 @@ attrcrypt_fetch_private_key(SECKEYPrivateKey **private_key) if (cert_name != default_cert_name) { slapi_ch_free_string(&cert_name); } - LDAPDebug(LDAP_DEBUG_TRACE,"<- attrcrypt_fetch_private_key\n", 0, 0, 0); + slapi_log_err(SLAPI_LOG_TRACE,"attrcrypt_fetch_private_key", "-> (%d)\n", ret); return ret; } @@ -432,18 +434,18 @@ attrcrypt_cipher_init(ldbm_instance *li, attrcrypt_cipher_entry *ace, SECKEYPriv { int ret = 0; PK11SymKey *symmetric_key = NULL; - slapi_log_error(SLAPI_LOG_TRACE, ATTRCRYPT, "-> attrcrypt_cipher_init\n"); + slapi_log_err(SLAPI_LOG_TRACE, "attrcrypt_cipher_init", "->\n"); acs->cipher_lock = PR_NewLock(); /* Fill in some basic stuff */ acs->ace = ace; acs->cipher_display_name = ace->cipher_display_name; if (NULL == acs->cipher_lock) { - slapi_log_error(SLAPI_LOG_ERR, "attrcrypt_cipher_init", + slapi_log_err(SLAPI_LOG_ERR, "attrcrypt_cipher_init", "Failed to create cipher lock\n"); } acs->slot = slapd_pk11_GetInternalKeySlot(); if (NULL == acs->slot) { - slapi_log_error(SLAPI_LOG_ERR, "attrcrypt_cipher_init", + slapi_log_err(SLAPI_LOG_ERR, "attrcrypt_cipher_init", "Failed to create a slot for cipher %s\n", acs->cipher_display_name); goto error; @@ -451,17 +453,17 @@ attrcrypt_cipher_init(ldbm_instance *li, attrcrypt_cipher_entry *ace, SECKEYPriv /* Try to get the symmetric key for this cipher */ ret = attrcrypt_keymgmt_get_key(li,acs,private_key,&symmetric_key); if (KEYMGMT_ERR_NO_ENTRY == ret) { - slapi_log_error(SLAPI_LOG_ERR, "attrcrypt_cipher_init", + slapi_log_err(SLAPI_LOG_ERR, "attrcrypt_cipher_init", "No symmetric key found for cipher %s in backend %s, " "attempting to create one...\n", acs->cipher_display_name, li->inst_name); ret = attrcrypt_generate_key(acs, &symmetric_key); if (ret) { - slapi_log_error(SLAPI_LOG_WARNING, "attrcrypt_cipher_init", + slapi_log_err(SLAPI_LOG_WARNING, "attrcrypt_cipher_init", "Failed to generate key for %s in attrcrypt_cipher_init\n", acs->cipher_display_name); if ((ret < 0) && li->attrcrypt_configured) { - slapi_log_error(SLAPI_LOG_ERR, "attrcrypt_cipher_init", + slapi_log_err(SLAPI_LOG_ERR, "attrcrypt_cipher_init", "Cipher %s is not supported on the security device. " "Do not configure attrcrypt with the cipher.\n", ace->cipher_display_name); @@ -470,22 +472,22 @@ attrcrypt_cipher_init(ldbm_instance *li, attrcrypt_cipher_entry *ace, SECKEYPriv if (symmetric_key) { ret = attrcrypt_keymgmt_store_key(li,acs,public_key,symmetric_key); if (ret) { - slapi_log_error(SLAPI_LOG_ERR, "attrcrypt_cipher_init", + slapi_log_err(SLAPI_LOG_ERR, "attrcrypt_cipher_init", "Failed to store key for cipher %s\n", acs->cipher_display_name); } else { - slapi_log_error(SLAPI_LOG_INFO, "attrcrypt_cipher_init", + slapi_log_err(SLAPI_LOG_INFO, "attrcrypt_cipher_init", "Key for cipher %s successfully generated and stored\n", acs->cipher_display_name); } } } else if (KEYMGMT_ERR_CANT_UNWRAP == ret) { - slapi_log_error(SLAPI_LOG_ERR, "attrcrypt_cipher_init", + slapi_log_err(SLAPI_LOG_ERR, "attrcrypt_cipher_init", "Symmetric key failed to unwrap " "with the private key; Cert might have been renewed since " "the key is wrapped. To recover the encrypted contents, " "keep the wrapped symmetric key value.\n"); } else if (ret) { - slapi_log_error(SLAPI_LOG_ERR, "attrcrypt_cipher_init", + slapi_log_err(SLAPI_LOG_ERR, "attrcrypt_cipher_init", "Failed to retrieve key for cipher %s (%d)\n", acs->cipher_display_name, ret); } @@ -494,7 +496,7 @@ attrcrypt_cipher_init(ldbm_instance *li, attrcrypt_cipher_entry *ace, SECKEYPriv acs->key = symmetric_key; } error: - slapi_log_error(SLAPI_LOG_TRACE, ATTRCRYPT, "<- attrcrypt_cipher_init\n"); + slapi_log_err(SLAPI_LOG_TRACE, "attrcrypt_cipher_init", "<- %d\n", ret); return ret; } @@ -512,7 +514,8 @@ attrcrypt_init(ldbm_instance *li) attrcrypt_cipher_entry *ace = NULL; SECKEYPrivateKey *private_key = NULL; SECKEYPublicKey *public_key = NULL; - LDAPDebug(LDAP_DEBUG_TRACE,"-> attrcrypt_init\n", 0, 0, 0); + + slapi_log_err(SLAPI_LOG_TRACE, "attrcrypt_init", "->\n"); if (slapd_security_library_is_initialized()) { /* In case the backend instance is restarted, * inst_attrcrypt_state_private in li could have memory containing @@ -544,14 +547,14 @@ attrcrypt_init(ldbm_instance *li) } else { /* Since we succeeded, add the acs to the backend instance list */ attrcrypt_acs_list_add(li,acs); - slapi_log_error(SLAPI_LOG_TRACE, "attrcrypt_init", + slapi_log_err(SLAPI_LOG_TRACE, "attrcrypt_init", "Initialized cipher %s in attrcrypt_init\n", ace->cipher_display_name); cipher_is_available = 1; /* at least one is available */ } } if (!cipher_is_available) { - slapi_log_error(SLAPI_LOG_ERR, "attrcrypt_init", + slapi_log_err(SLAPI_LOG_ERR, "attrcrypt_init", "All prepared ciphers are not available. " "Please disable attribute encryption.\n"); } @@ -563,11 +566,12 @@ attrcrypt_init(ldbm_instance *li) private_key = NULL; } else { if (li->attrcrypt_configured) { - LDAPDebug(LDAP_DEBUG_WARNING, "attrcrypt_init - " - "Encryption is configured in backend %s, but because SSL is not enabled, database encryption is not available and the configuration will be overridden.\n", li->inst_name, 0, 0); + slapi_log_err(SLAPI_LOG_WARNING, "attrcrypt_init", + "Encryption is configured in backend %s, but because SSL is not enabled, " + "database encryption is not available and the configuration will be overridden.\n", li->inst_name); } } - LDAPDebug(LDAP_DEBUG_TRACE,"<- attrcrypt_init : %d\n", ret, 0, 0); + slapi_log_err(SLAPI_LOG_TRACE,"attrcrypt_init", "<- %d\n", ret); return ret; } @@ -581,22 +585,22 @@ attrcrypt_init(ldbm_instance *li) int attrcrypt_check_enable_cipher(attrcrypt_cipher_entry *ace) { int ret = 0; - LDAPDebug(LDAP_DEBUG_TRACE,"-> attrcrypt_check_enable_cipher\n", 0, 0, 0); - LDAPDebug(LDAP_DEBUG_TRACE,"<- attrcrypt_check_enable_cipher\n", 0, 0, 0); + slapi_log_err(SLAPI_LOG_TRACE,"attrcrypt_check_enable_cipher", "->\n"); + slapi_log_err(SLAPI_LOG_TRACE,"attrcrypt_check_enable_cipher", "<-\n"); return ret; } int attrcrypt_cleanup(attrcrypt_cipher_state *acs) { - LDAPDebug(LDAP_DEBUG_TRACE,"-> attrcrypt_cleanup\n", 0, 0, 0); + slapi_log_err(SLAPI_LOG_TRACE,"attrcrypt_cleanup", "->\n"); if (acs->key) { slapd_pk11_FreeSymKey(acs->key); } if (acs->slot) { slapd_pk11_FreeSlot(acs->slot); } - LDAPDebug(LDAP_DEBUG_TRACE,"<- attrcrypt_cleanup\n", 0, 0, 0); + slapi_log_err(SLAPI_LOG_TRACE,"attrcrypt_cleanup", "<-\n"); return 0; } @@ -607,11 +611,11 @@ attrcrypt_cleanup(attrcrypt_cipher_state *acs) int attrcrypt_cleanup_private(ldbm_instance *li) { - LDAPDebug(LDAP_DEBUG_TRACE, "-> attrcrypt_cleanup_private\n", 0, 0, 0); + slapi_log_err(SLAPI_LOG_TRACE, "attrcrypt_cleanup_private", "->\n"); if (li && li->inst_attrcrypt_state_private) { _back_crypt_cleanup_private(&(li->inst_attrcrypt_state_private)); } - LDAPDebug(LDAP_DEBUG_TRACE, "<- attrcrypt_cleanup_private\n", 0, 0, 0); + slapi_log_err(SLAPI_LOG_TRACE, "attrcrypt_cleanup_private", "<-\n"); return 0; } @@ -650,7 +654,7 @@ static void log_bytes(char* format_string, unsigned char *bytes, size_t length) print_ptr += sprintf(print_ptr, "%02x ", bytes[x]); } - LDAPDebug(LDAP_DEBUG_DEBUG, format_string, print_buffer, length, 0); + slapi_log_err(SLAPI_LOG_DEBUG, "log_bytes", format_string, print_buffer, length); slapi_ch_free((void**)&print_buffer); } @@ -663,7 +667,7 @@ attrcrypt_crypto_op(attrcrypt_private *priv, backend *be, struct attrinfo *ai, c int ret = -1; attrcrypt_cipher_state *acs = NULL; - LDAPDebug(LDAP_DEBUG_TRACE,"-> attrcrypt_crypto_op\n", 0, 0, 0); + slapi_log_err(SLAPI_LOG_TRACE,"attrcrypt_crypto_op", "->\n"); acs = attrcrypt_get_acs(be,ai->ai_attrcrypt); if (NULL == acs) { /* This happens if SSL/NSS has not been enabled */ @@ -671,14 +675,14 @@ attrcrypt_crypto_op(attrcrypt_private *priv, backend *be, struct attrinfo *ai, c } #if defined(DEBUG_ATTRCRYPT) if (encrypt) { - LDAPDebug(LDAP_DEBUG_DEBUG,"attrcrypt_crypto_op - encrypt '%s' (%d)\n", in_data, in_size, 0); + slapi_log_err(SLAPI_LOG_DEBUG,"attrcrypt_crypto_op", "encrypt '%s' (%d)\n", in_data, in_size); } else { log_bytes("attrcrypt_crypto_op decrypt '%s' (%d)\n", (unsigned char *)in_data, in_size); } #endif ret = _back_crypt_crypto_op(priv, acs, in_data, in_size, out_data, out_size, encrypt, be, ai); - LDAPDebug(LDAP_DEBUG_TRACE,"<- attrcrypt_crypto_op\n", 0, 0, 0); + slapi_log_err(SLAPI_LOG_TRACE,"attrcrypt_crypto_op", "<- %d\n", ret); return ret; } @@ -692,7 +696,7 @@ attrcrypt_crypto_op_value(attrcrypt_private *priv, backend *be, struct attrinfo size_t out_size = 0; struct berval *bval = NULL; - LDAPDebug(LDAP_DEBUG_TRACE,"-> attrcrypt_crypto_op_value\n", 0, 0, 0); + slapi_log_err(SLAPI_LOG_TRACE,"attrcrypt_crypto_op_value", "->\n"); bval = (struct berval *) slapi_value_get_berval(invalue); in_data = bval->bv_val; @@ -709,7 +713,7 @@ attrcrypt_crypto_op_value(attrcrypt_private *priv, backend *be, struct attrinfo slapi_ch_free((void**)&out_data); } - LDAPDebug(LDAP_DEBUG_TRACE,"<- attrcrypt_crypto_op_value: %d\n", ret, 0, 0); + slapi_log_err(SLAPI_LOG_TRACE,"attrcrypt_crypto_op_value", "<- %d\n", ret); return ret; } @@ -723,7 +727,7 @@ attrcrypt_crypto_op_value_replace(attrcrypt_private *priv, backend *be, struct a size_t out_size = 0; struct berval *bval = NULL; - LDAPDebug(LDAP_DEBUG_TRACE,"-> attrcrypt_crypto_op_value_replace\n", 0, 0, 0); + slapi_log_err(SLAPI_LOG_TRACE,"attrcrypt_crypto_op_value_replace", "->\n"); bval = (struct berval *) slapi_value_get_berval(inoutvalue); in_data = bval->bv_val; @@ -740,18 +744,19 @@ attrcrypt_crypto_op_value_replace(attrcrypt_private *priv, backend *be, struct a slapi_ch_free((void**)&out_data); } - LDAPDebug(LDAP_DEBUG_TRACE,"<- attrcrypt_crypto_op_value_replace: %d\n", ret, 0, 0); + slapi_log_err(SLAPI_LOG_TRACE,"attrcrypt_crypto_op_value_replace", "<- %d\n", ret); return ret; } static int -attrcrypt_crypto_op_values(attrcrypt_private *priv, backend *be, struct attrinfo *ai, Slapi_Value **invalues, Slapi_Value ***outvalues, int encrypt) +attrcrypt_crypto_op_values(attrcrypt_private *priv, backend *be, struct attrinfo *ai, Slapi_Value **invalues, + Slapi_Value ***outvalues, int encrypt) { int ret = 0; int i = 0; Slapi_Value **encrypted_values = NULL; - LDAPDebug(LDAP_DEBUG_TRACE,"-> attrcrypt_crypto_op_values\n", 0, 0, 0); + slapi_log_err(SLAPI_LOG_TRACE,"attrcrypt_crypto_op_values", "->\n"); encrypted_values = (Slapi_Value **) slapi_ch_calloc(sizeof(Slapi_Value *),local_valuearray_count(invalues) + 1); for ( i = 0; (invalues[i] != NULL) && (ret == 0); i++ ) { Slapi_Value *encrypted_value = NULL; @@ -765,7 +770,7 @@ attrcrypt_crypto_op_values(attrcrypt_private *priv, backend *be, struct attrinf } } *outvalues = encrypted_values; - LDAPDebug(LDAP_DEBUG_TRACE,"<- attrcrypt_crypto_op_values: %d\n", ret, 0, 0); + slapi_log_err(SLAPI_LOG_TRACE,"attrcrypt_crypto_op_values", "<- %d\n", ret); return ret; } @@ -775,7 +780,7 @@ attrcrypt_crypto_op_values_replace(attrcrypt_private *priv, backend *be, struct int ret = 0; int i = 0; - LDAPDebug(LDAP_DEBUG_TRACE,"-> attrcrypt_crypto_op_values_replace\n", 0, 0, 0); + slapi_log_err(SLAPI_LOG_TRACE,"attrcrypt_crypto_op_values_replace", "->\n"); for ( i = 0; (invalues[i] != NULL) && (ret == 0); i++ ) { ret = attrcrypt_crypto_op_value_replace(priv,be,ai,invalues[i],encrypt); @@ -783,7 +788,7 @@ attrcrypt_crypto_op_values_replace(attrcrypt_private *priv, backend *be, struct break; } } - LDAPDebug(LDAP_DEBUG_TRACE,"<- attrcrypt_crypto_op_values_replace\n", 0, 0, 0); + slapi_log_err(SLAPI_LOG_TRACE,"attrcrypt_crypto_op_values_replace", "<-\n"); return ret; } @@ -805,7 +810,7 @@ attrcrypt_decrypt_entry(backend *be, struct backentry *e) return ret; } - LDAPDebug(LDAP_DEBUG_TRACE,"-> attrcrypt_decrypt_entry\n", 0, 0, 0); + slapi_log_err(SLAPI_LOG_TRACE,"attrcrypt_decrypt_entry", "<-\n"); /* Scan through the entry's attributes, looking to see if any are configured for crypto */ for ( rc = slapi_entry_first_attr( e->ep_entry, &attr ); rc == 0 && attr ; rc = slapi_entry_next_attr( e->ep_entry, attr, &attr )) { @@ -823,7 +828,7 @@ attrcrypt_decrypt_entry(backend *be, struct backentry *e) /* Now decrypt the attribute values in place on the original entry */ ret = attrcrypt_crypto_op_value_replace(ai->ai_attrcrypt,be,ai,value,0); if (ret) { - LDAPDebug(LDAP_DEBUG_ERR,"attrcrypt_decrypt_entry - Decryption operation failed\n", 0, 0, 0); + slapi_log_err(SLAPI_LOG_ERR,"attrcrypt_decrypt_entry", "Decryption operation failed: %d\n", ret); return ret; } i = slapi_attr_next_value(attr,i,&value); @@ -835,14 +840,14 @@ attrcrypt_decrypt_entry(backend *be, struct backentry *e) /* Now decrypt the attribute values in place on the original entry */ ret = attrcrypt_crypto_op_value_replace(ai->ai_attrcrypt,be,ai,value,0); if (ret) { - LDAPDebug(LDAP_DEBUG_ERR,"attrcrypt_decrypt_entry - Decryption operation 2 failed\n", 0, 0, 0); + slapi_log_err(SLAPI_LOG_ERR,"attrcrypt_decrypt_entry", "Decryption operation 2 failed: %d\n", ret); return ret; } i = attr_next_deleted_value(attr,i,&value); } } } - LDAPDebug(LDAP_DEBUG_TRACE,"<- attrcrypt_decrypt_entry\n", 0, 0, 0); + slapi_log_err(SLAPI_LOG_TRACE,"attrcrypt_decrypt_entry", "<- %d\n",ret); return ret; } @@ -866,7 +871,7 @@ attrcrypt_encrypt_entry_inplace(backend *be, const struct backentry *inout) return ret; } - LDAPDebug(LDAP_DEBUG_TRACE,"-> attrcrypt_encrypt_entry_inplace\n", 0, 0, 0); + slapi_log_err(SLAPI_LOG_TRACE,"attrcrypt_encrypt_entry_inplace", "->\n"); /* Scan the entry's attributes looking for any that are configured for encryption */ for ( rc = slapi_entry_first_attr( inout->ep_entry, &attr ); rc == 0; rc = slapi_entry_next_attr( inout->ep_entry, attr, &attr ) ) { @@ -885,7 +890,7 @@ attrcrypt_encrypt_entry_inplace(backend *be, const struct backentry *inout) } } } - LDAPDebug(LDAP_DEBUG_TRACE,"<- attrcrypt_encrypt_entry_inplace\n", 0, 0, 0); + slapi_log_err(SLAPI_LOG_TRACE,"attrcrypt_encrypt_entry_inplace", "<- %d\n", ret); return ret; } @@ -911,7 +916,7 @@ attrcrypt_encrypt_entry(backend *be, const struct backentry *in, struct backentr return ret; } - LDAPDebug(LDAP_DEBUG_TRACE,"-> attrcrypt_encrypt_entry\n", 0, 0, 0); + slapi_log_err(SLAPI_LOG_TRACE,"attrcrypt_encrypt_entry", "->\n"); *out = NULL; /* Scan the entry's attributes looking for any that are configured for encryption */ for ( rc = slapi_entry_first_attr( in->ep_entry, &attr ); rc == 0; @@ -935,8 +940,8 @@ attrcrypt_encrypt_entry(backend *be, const struct backentry *in, struct backentr /* Now encrypt the attribute values in place on the new entry */ ret = attrcrypt_crypto_op_values(ai->ai_attrcrypt,be,ai,svals,&new_vals,1); if (ret) { - LDAPDebug(LDAP_DEBUG_ERR,"attrcrypt_encrypt_entry - Failed to encrypt value, error %d\n", - ret, 0, 0); + slapi_log_err(SLAPI_LOG_ERR,"attrcrypt_encrypt_entry", "Failed to encrypt value, error %d\n", + ret); break; } /* DBDB does this call free the old value memory ? */ @@ -947,7 +952,7 @@ attrcrypt_encrypt_entry(backend *be, const struct backentry *in, struct backentr } } *out = new_entry; - LDAPDebug(LDAP_DEBUG_TRACE,"<- attrcrypt_encrypt_entry\n", 0, 0, 0); + slapi_log_err(SLAPI_LOG_TRACE,"attrcrypt_encrypt_entry", "<- %d\n", ret); return ret; } @@ -972,7 +977,7 @@ attrcrypt_encrypt_index_key(backend *be, struct attrinfo *ai, const struct berva } if (ai->ai_attrcrypt) { - LDAPDebug(LDAP_DEBUG_TRACE,"-> attrcrypt_encrypt_index_key\n", 0, 0, 0); + slapi_log_err(SLAPI_LOG_TRACE,"attrcrypt_encrypt_index_key", "->\n"); ret = attrcrypt_crypto_op(ai->ai_attrcrypt,be,ai, in_data,in_size,&out_data,&out_size, 1); if (0 == ret) { out_berval = (struct berval *)ber_alloc(); @@ -985,7 +990,7 @@ attrcrypt_encrypt_index_key(backend *be, struct attrinfo *ai, const struct berva out_berval->bv_val = out_data; *out = out_berval; } - LDAPDebug(LDAP_DEBUG_TRACE,"<- attrcrypt_encrypt_index_key\n", 0, 0, 0); + slapi_log_err(SLAPI_LOG_TRACE,"attrcrypt_encrypt_index_key", "<- %d\n", ret); } return ret; } @@ -1012,13 +1017,13 @@ attrcrypt_decrypt_index_key(backend *be, Slapi_Value *value = NULL; rc = -1; if (NULL == in || NULL == out) { - LDAPDebug1Arg(LDAP_DEBUG_ERR, - "attrcrypt_decrypt_index_key - Empty %s\n", + slapi_log_err(SLAPI_LOG_ERR, + "attrcrypt_decrypt_index_key", "Empty %s\n", NULL==in?"in":NULL==out?"out":"unknown"); return rc; } value = slapi_value_new_berval(in); - LDAPDebug0Args(LDAP_DEBUG_TRACE, "-> attrcrypt_decrypt_index_key\n"); + slapi_log_err(SLAPI_LOG_TRACE, "attrcrypt_decrypt_index_key", "->\n"); /* Decrypt the input values in place on the original entry */ rc = attrcrypt_crypto_op_value_replace(ai->ai_attrcrypt, be, ai, value, 0 /* decrypt */); @@ -1035,7 +1040,7 @@ attrcrypt_decrypt_index_key(backend *be, } } bail: - LDAPDebug0Args(LDAP_DEBUG_TRACE, "<- attrcrypt_decrypt_index_key\n"); + slapi_log_err(SLAPI_LOG_TRACE, "attrcrypt_decrypt_index_key" ,"<-\n"); slapi_value_free(&value); } @@ -1057,7 +1062,7 @@ back_crypt_init(Slapi_Backend *be, const char *dn, SECKEYPublicKey *public_key = NULL; attrcrypt_state_private **state_priv = (attrcrypt_state_private **)handle; - slapi_log_error(SLAPI_LOG_TRACE, ATTRCRYPT, "-> back_crypt_init\n"); + slapi_log_err(SLAPI_LOG_TRACE, "back_crypt_init", "->\n"); /* Encryption is not specified */ if (!encAlgorithm || !handle) { goto bail; @@ -1088,7 +1093,7 @@ back_crypt_init(Slapi_Backend *be, const char *dn, ret = _back_crypt_cipher_init(be, state_priv, ace, private_key, public_key, acs, dn); if (ret) { - slapi_log_error(SLAPI_LOG_ERR, "back_crypt_init", + slapi_log_err(SLAPI_LOG_ERR, "back_crypt_init", "Failed to initialize cipher %s." "Please choose other cipher or disable changelog " "encryption.\n", @@ -1097,7 +1102,7 @@ back_crypt_init(Slapi_Backend *be, const char *dn, } else { /* Since we succeeded, set acs to state_priv */ _back_crypt_acs_list_add(state_priv, acs); - slapi_log_error(SLAPI_LOG_BACKLDBM, "back_crypt_init", + slapi_log_err(SLAPI_LOG_BACKLDBM, "back_crypt_init", "Initialized cipher %s\n", ace->cipher_display_name); } @@ -1108,8 +1113,7 @@ back_crypt_init(Slapi_Backend *be, const char *dn, SECKEY_DestroyPrivateKey(private_key); private_key = NULL; bail: - slapi_log_error(SLAPI_LOG_TRACE, ATTRCRYPT, - "<- back_crypt_init : %d\n", ret); + slapi_log_err(SLAPI_LOG_TRACE, "back_crypt_init", "<- %d\n", ret); return ret; } @@ -1128,8 +1132,7 @@ back_crypt_encrypt_value(void *handle, struct berval *in, struct berval **out) Slapi_Value *outvalue = NULL; attrcrypt_state_private *state_priv = (attrcrypt_state_private *)handle; - slapi_log_error(SLAPI_LOG_TRACE, ATTRCRYPT, - "-> back_crypt_encrypt_value\n"); + slapi_log_err(SLAPI_LOG_TRACE, "back_crypt_encrypt_value", "->\n"); if (NULL == out) { goto bail; } @@ -1146,8 +1149,8 @@ back_crypt_encrypt_value(void *handle, struct berval *in, struct berval **out) bail: slapi_value_free(&invalue); slapi_value_free(&outvalue); - slapi_log_error(SLAPI_LOG_TRACE, ATTRCRYPT, - "<- back_crypt_encrypt_entry (returning %d)\n", ret); + slapi_log_err(SLAPI_LOG_TRACE, "back_crypt_encrypt_entry", + "<- (returning %d)\n", ret); return ret; } @@ -1159,8 +1162,7 @@ back_crypt_decrypt_value(void *handle, struct berval *in, struct berval **out) Slapi_Value *outvalue = NULL; attrcrypt_state_private *state_priv = (attrcrypt_state_private *)handle; - slapi_log_error(SLAPI_LOG_TRACE, ATTRCRYPT, - "-> back_crypt_decrypt_value\n"); + slapi_log_err(SLAPI_LOG_TRACE, "back_crypt_decrypt_value", "->\n"); if (NULL == out) { goto bail; } @@ -1177,8 +1179,7 @@ back_crypt_decrypt_value(void *handle, struct berval *in, struct berval **out) bail: slapi_value_free(&invalue); slapi_value_free(&outvalue); - slapi_log_error(SLAPI_LOG_TRACE, ATTRCRYPT, - "<- _back_crypt_decrypt_entry (returning %d)\n", ret); + slapi_log_err(SLAPI_LOG_TRACE, "back_crypt_decrypt_entry", "<- (returning %d)\n", ret); return ret; } @@ -1195,8 +1196,7 @@ _back_crypt_crypto_op_value(attrcrypt_state_private *state_priv, struct berval *bval = NULL; attrcrypt_cipher_state *acs = NULL; - slapi_log_error(SLAPI_LOG_TRACE, ATTRCRYPT, - "-> _back_crypt_crypto_op_value\n"); + slapi_log_err(SLAPI_LOG_TRACE,"_back_crypt_crypto_op_value", "->\n"); if (NULL == invalue || NULL == outvalue) { goto bail; } @@ -1226,8 +1226,7 @@ _back_crypt_crypto_op_value(attrcrypt_state_private *state_priv, } bail: - slapi_log_error(SLAPI_LOG_TRACE, ATTRCRYPT, - "<- _back_crypt_crypto_op_value (returning %d)\n", ret); + slapi_log_err(SLAPI_LOG_TRACE, "back_crypt_crypto_op_value", "<-(returning %d)\n", ret); return ret; } @@ -1245,18 +1244,18 @@ _back_crypt_cipher_init(Slapi_Backend *be, int ret = 1; /* fail by default */ PK11SymKey *symmetric_key = NULL; - slapi_log_error(SLAPI_LOG_TRACE, ATTRCRYPT, "-> _back_crypt_cipher_init\n"); + slapi_log_err(SLAPI_LOG_TRACE, "_back_crypt_cipher_init", "->\n"); acs->cipher_lock = PR_NewLock(); /* Fill in some basic stuff */ acs->ace = ace; acs->cipher_display_name = ace->cipher_display_name; if (NULL == acs->cipher_lock) { - slapi_log_error(SLAPI_LOG_ERR, "_back_crypt_cipher_init", + slapi_log_err(SLAPI_LOG_ERR, "_back_crypt_cipher_init", "Cipher lock not found.\n"); } acs->slot = slapd_pk11_getInternalKeySlot(); if (NULL == acs->slot) { - slapi_log_error(SLAPI_LOG_ERR, "_back_crypt_cipher_init", + slapi_log_err(SLAPI_LOG_ERR, "_back_crypt_cipher_init", "Failed to create a slot for cipher %s\n", acs->cipher_display_name); goto error; @@ -1265,28 +1264,28 @@ _back_crypt_cipher_init(Slapi_Backend *be, ret = _back_crypt_keymgmt_get_key(acs, private_key, &symmetric_key, dn_string); if (KEYMGMT_ERR_NO_ENTRY == ret) { - slapi_log_error(SLAPI_LOG_ERR, "_back_crypt_cipher_init", + slapi_log_err(SLAPI_LOG_ERR, "_back_crypt_cipher_init", "Entry storing key does not exist.\n"); } else if (KEYMGMT_ERR_OTHER == ret) { - slapi_log_error(SLAPI_LOG_ERR, "_back_crypt_cipher_init", + slapi_log_err(SLAPI_LOG_ERR, "_back_crypt_cipher_init", "Coding error.\n"); } else if (KEYMGMT_ERR_CANT_UNWRAP == ret) { - slapi_log_error(SLAPI_LOG_ERR, "_back_crypt_cipher_init", + slapi_log_err(SLAPI_LOG_ERR, "_back_crypt_cipher_init", "Symmetric key failed to unwrap " "with the private key; Cert might have been renewed since " "the key is wrapped. To recover the encrypted contents, " "keep the wrapped symmetric key value.\n"); } else if (ret) { - slapi_log_error(SLAPI_LOG_ERR, "_back_crypt_cipher_init", + slapi_log_err(SLAPI_LOG_ERR, "_back_crypt_cipher_init", "No symmetric key found for cipher " "%s, attempting to create one...\n", acs->cipher_display_name); ret = attrcrypt_generate_key(acs, &symmetric_key); if (ret) { - slapi_log_error(SLAPI_LOG_ERR, "_back_crypt_cipher_init", + slapi_log_err(SLAPI_LOG_ERR, "_back_crypt_cipher_init", "Failed to generate key for %s\n", acs->cipher_display_name); if (ret < 0) { - slapi_log_error(SLAPI_LOG_ERR, "_back_crypt_cipher_init", + slapi_log_err(SLAPI_LOG_ERR, "_back_crypt_cipher_init", "Cipher %s is not supported on the security device. " "Do not configure changelog encryption with the cipher.\n", ace->cipher_display_name); @@ -1296,10 +1295,10 @@ _back_crypt_cipher_init(Slapi_Backend *be, ret = _back_crypt_keymgmt_store_key(be, acs, public_key, symmetric_key, dn_string); if (ret) { - slapi_log_error(SLAPI_LOG_ERR, "_back_crypt_cipher_init", + slapi_log_err(SLAPI_LOG_ERR, "_back_crypt_cipher_init", "Failed to store key for cipher %s\n", acs->cipher_display_name); } else { - slapi_log_error(SLAPI_LOG_BACKLDBM, "_back_crypt_cipher_init", + slapi_log_err(SLAPI_LOG_BACKLDBM, "_back_crypt_cipher_init", "Key for cipher %s successfully generated and stored\n", acs->cipher_display_name); } @@ -1310,8 +1309,7 @@ _back_crypt_cipher_init(Slapi_Backend *be, acs->key = symmetric_key; } error: - slapi_log_error(SLAPI_LOG_TRACE, ATTRCRYPT, - "<- _back_crypt_cipher_init (returning %d\n", ret); + slapi_log_err(SLAPI_LOG_TRACE, "_back_crypt_cipher_init", "<- (returning %d\n", ret); return ret; } @@ -1323,8 +1321,7 @@ _back_crypt_cleanup_private(attrcrypt_state_private **state_priv) { attrcrypt_cipher_state **current = NULL; - slapi_log_error(SLAPI_LOG_TRACE, ATTRCRYPT, - "-> _back_crypt_cleanup_private\n"); + slapi_log_err(SLAPI_LOG_TRACE, "_back_crypt_cleanup_private", "->\n"); if (state_priv && *state_priv) { for (current = &((*state_priv)->acs_array[0]); *current; current++) { attrcrypt_cleanup(*current); @@ -1332,8 +1329,7 @@ _back_crypt_cleanup_private(attrcrypt_state_private **state_priv) } slapi_ch_free((void **)state_priv); } - slapi_log_error(SLAPI_LOG_TRACE, ATTRCRYPT, - "<- _back_crypt_cleanup_private\n"); + slapi_log_err(SLAPI_LOG_TRACE, "_back_crypt_cleanup_private", "<-\n"); return 0; } @@ -1359,8 +1355,7 @@ _back_crypt_keymgmt_get_key(attrcrypt_cipher_state *acs, if (NULL == key_from_store) { return ret; } - slapi_log_error(SLAPI_LOG_TRACE, ATTRCRYPT, - "-> _back_crypt_keymgmt_get_key\n"); + slapi_log_err(SLAPI_LOG_TRACE, "_back_crypt_keymgmt_get_key", "->\n"); *key_from_store = NULL; /* Fetch the entry */ getConfigEntry(dn_string, &entry); @@ -1394,8 +1389,7 @@ _back_crypt_keymgmt_get_key(attrcrypt_cipher_state *acs, } bail: freeConfigEntry(&entry); - slapi_log_error(SLAPI_LOG_TRACE, ATTRCRYPT, - "<- _back_crypt_keymgmt_get_key (returning %d)\n", ret); + slapi_log_err(SLAPI_LOG_TRACE, "_back_crypt_keymgmt_get_key", "<- (returning %d)\n", ret); return ret; } @@ -1411,8 +1405,7 @@ _back_crypt_keymgmt_store_key(Slapi_Backend *be, SECItem wrapped_symmetric_key = {0}; ldbm_instance *li = NULL; - slapi_log_error(SLAPI_LOG_TRACE, ATTRCRYPT, - "-> _back_crypt_keymgmt_store_key\n"); + slapi_log_err(SLAPI_LOG_TRACE, "_back_crypt_keymgmt_store_key", "->\n"); if (!be || !be->be_instance_info) { goto bail; } @@ -1450,7 +1443,7 @@ _back_crypt_keymgmt_store_key(Slapi_Backend *be, if (rc) { char *resulttext = NULL; slapi_pblock_get(pb, SLAPI_PB_RESULT_TEXT, &resulttext); - slapi_log_error(SLAPI_LOG_ERR, "_back_crypt_keymgmt_store_key", + slapi_log_err(SLAPI_LOG_ERR, "_back_crypt_keymgmt_store_key", "Failed to add config key to the DSE: %d: %s: %s\n", rc, ldap_err2string(rc), resulttext ? resulttext : "unknown"); ret = -1; @@ -1459,8 +1452,7 @@ _back_crypt_keymgmt_store_key(Slapi_Backend *be, slapi_pblock_destroy(pb); } bail: - slapi_log_error(SLAPI_LOG_TRACE, ATTRCRYPT, - "<- _back_crypt_keymgmt_store_key (returning %d)\n", ret); + slapi_log_err(SLAPI_LOG_TRACE, "_back_crypt_keymgmt_store_key", "<- (returning %d)\n", ret); return ret; } @@ -1475,8 +1467,7 @@ _back_crypt_acs_list_add(attrcrypt_state_private **state_priv, if (NULL == state_priv) { return; } - slapi_log_error(SLAPI_LOG_TRACE, ATTRCRYPT, - "-> _back_crypt_acs_list_add\n"); + slapi_log_err(SLAPI_LOG_TRACE, "_back_crypt_acs_list_add", "->\n"); /* Is the list already there ? */ if (NULL == *state_priv) { @@ -1496,8 +1487,7 @@ _back_crypt_acs_list_add(attrcrypt_state_private **state_priv, (*state_priv)->acs_array[list_size + 1] = NULL; } (*state_priv)->acs_array[list_size] = acs; - slapi_log_error(SLAPI_LOG_TRACE, ATTRCRYPT, - "<- _back_crypt_acs_list_add\n"); + slapi_log_err(SLAPI_LOG_TRACE, "_back_crypt_acs_list_add", "<-\n"); return; } @@ -1519,16 +1509,16 @@ _back_crypt_crypto_op(attrcrypt_private *priv, unsigned int output_buffer_size2 = 0; unsigned char *output_buffer = NULL; - slapi_log_error(SLAPI_LOG_TRACE, ATTRCRYPT, "-> _back_crypt_crypto_op\n"); + slapi_log_err(SLAPI_LOG_TRACE, "_back_crypt_crypto_op", "->\n"); if (NULL == acs) { goto bail; } if (encrypt) { - slapi_log_error(SLAPI_LOG_BACKLDBM, "_back_crypt_crypto_op", + slapi_log_err(SLAPI_LOG_BACKLDBM, "_back_crypt_crypto_op", "Encrypt '%s' (%lu)\n", in_data, (long unsigned int)in_size); } else { - slapi_log_error(SLAPI_LOG_BACKLDBM, "_back_crypt_crypto_op", + slapi_log_err(SLAPI_LOG_BACKLDBM, "_back_crypt_crypto_op", "Decrypt (%lu)\n", (long unsigned int)in_size); } /* Allocate the output buffer */ @@ -1542,7 +1532,7 @@ _back_crypt_crypto_op(attrcrypt_private *priv, &iv_item); if (NULL == security_parameter) { int errorCode = PR_GetError(); - slapi_log_error(SLAPI_LOG_ERR, "_back_crypt_crypto_op", + slapi_log_err(SLAPI_LOG_ERR, "_back_crypt_crypto_op", "Failed to make IV for cipher %s : %d - %s\n", acs->ace->cipher_display_name, errorCode, slapd_pr_strerror(errorCode)); @@ -1553,7 +1543,7 @@ _back_crypt_crypto_op(attrcrypt_private *priv, acs->key, security_parameter); if (NULL == sec_context) { int errorCode = PR_GetError(); - slapi_log_error(SLAPI_LOG_ERR, "_back_crypt_crypto_op", + slapi_log_err(SLAPI_LOG_ERR, "_back_crypt_crypto_op", "Failed on cipher %s : %d - %s\n", acs->ace->cipher_display_name, errorCode, slapd_pr_strerror(errorCode)); @@ -1564,7 +1554,7 @@ _back_crypt_crypto_op(attrcrypt_private *priv, (unsigned char *)in_data, in_size); if (SECSuccess != secret) { int errorCode = PR_GetError(); - slapi_log_error(SLAPI_LOG_ERR, "_back_crypt_crypto_op", + slapi_log_err(SLAPI_LOG_ERR, "_back_crypt_crypto_op", "Failed on cipher %s : %d - %s\n", acs->ace->cipher_display_name, errorCode, slapd_pr_strerror(errorCode)); @@ -1576,7 +1566,7 @@ _back_crypt_crypto_op(attrcrypt_private *priv, output_buffer_length - output_buffer_size1); if (SECSuccess != secret) { int errorCode = PR_GetError(); - slapi_log_error(SLAPI_LOG_ERR, "_back_crypt_crypto_op", + slapi_log_err(SLAPI_LOG_ERR, "_back_crypt_crypto_op", "Digest final failed on cipher %s : %d - %s\n", acs->ace->cipher_display_name, errorCode, slapd_pr_strerror(errorCode)); @@ -1588,7 +1578,7 @@ _back_crypt_crypto_op(attrcrypt_private *priv, log_bytes("slapd_pk11_DigestFinal '%s' (%d)\n", output_buffer, output_buffer_size1 + output_buffer_size2); } else { - slapi_log_error(SLAPI_LOG_DEBUG, "DEBUG_ATTRCRYPT", + slapi_log_err(SLAPI_LOG_DEBUG, "DEBUG_ATTRCRYPT", "slapd_pk11_DigestFinal '%s', %u\n", output_buffer, output_buffer_size1 + output_buffer_size2); } @@ -1605,14 +1595,14 @@ _back_crypt_crypto_op(attrcrypt_private *priv, size_t redo_size = -1; int redo_ret; - slapi_log_error(SLAPI_LOG_DEBUG, ATTRCRYPT, + slapi_log_err(SLAPI_LOG_DEBUG, "_back_crypt_crypto_op", "------> check result of crypto op\n"); if (priv && be && ai) { redo_ret = attrcrypt_crypto_op(priv, be, ai, *out_data, *out_size, &redo_data, &redo_size, !encrypt); - slapi_log_error(SLAPI_LOG_DEBUG, "DEBUG_ATTRCRYPT", + slapi_log_err(SLAPI_LOG_DEBUG, "_back_crypt_crypto_op", "attrcrypt_crypto_op returned (%d) " "orig length %u redone length %u\n", redo_ret, in_size, redo_size); @@ -1621,7 +1611,7 @@ _back_crypt_crypto_op(attrcrypt_private *priv, *out_data, *out_size, &redo_data, &redo_size, !encrypt, NULL, NULL); - slapi_log_error(SLAPI_LOG_DEBUG, "DEBUG_ATTRCRYPT", + slapi_log_err(SLAPI_LOG_DEBUG, "_back_crypt_crypto_op", "_back_crypt_crypto_op returned (%d) " "orig length %u redone length %u\n", redo_ret, in_size, redo_size); @@ -1631,7 +1621,7 @@ _back_crypt_crypto_op(attrcrypt_private *priv, log_bytes("DEBUG_ATTRCRYPT redo bytes '%s' (%d)\n", (unsigned char *)redo_data, redo_size); - slapi_log_error(SLAPI_LOG_DEBUG, ATTRCRYPT, + slapi_log_err(SLAPI_LOG_DEBUG, "_back_crypt_crypto_op", "<------ check result of crypto op\n"); } #endif @@ -1647,7 +1637,7 @@ error: slapi_ch_free_string((char **)&output_buffer); } bail: - slapi_log_error(SLAPI_LOG_TRACE, ATTRCRYPT, - "<- _back_crypt_crypto_op (returning %d)\n", rc); + slapi_log_err(SLAPI_LOG_TRACE, "_back_crypt_crypto_op", + "<- (returning %d)\n", rc); return rc; } diff --git a/ldap/servers/slapd/back-ldbm/ldbm_attrcrypt_config.c b/ldap/servers/slapd/back-ldbm/ldbm_attrcrypt_config.c index 1c60b5b..0aa6b7e 100644 --- a/ldap/servers/slapd/back-ldbm/ldbm_attrcrypt_config.c +++ b/ldap/servers/slapd/back-ldbm/ldbm_attrcrypt_config.c @@ -66,7 +66,7 @@ ldbm_attrcrypt_parse_entry(ldbm_instance *inst, Slapi_Entry *e, /* Get the name of the attribute to index which will be the value * of the cn attribute. */ if (slapi_entry_attr_find(e, "cn", &attr) != 0) { - LDAPDebug(LDAP_DEBUG_ERR, "ldbm_attrcrypt_parse_entry - Malformed attribute encryption entry %s\n", + slapi_log_err(SLAPI_LOG_ERR, "ldbm_attrcrypt_parse_entry - Malformed attribute encryption entry %s\n", slapi_entry_get_dn(e), 0, 0); return LDAP_OPERATIONS_ERROR; } @@ -82,7 +82,7 @@ ldbm_attrcrypt_parse_entry(ldbm_instance *inst, Slapi_Entry *e, attrValue = slapi_value_get_berval(sval); *cipher = ldbm_attrcrypt_parse_cipher(attrValue->bv_val); if (0 == *cipher) - LDAPDebug(LDAP_DEBUG_WARNING, "ldbm_attrcrypt_parse_entry - " + slapi_log_err(SLAPI_LOG_WARNING, "ldbm_attrcrypt_parse_entry - " "Attempt to configure unrecognized cipher %s in encrypted attribute config entry %s\n", attrValue->bv_val, slapi_entry_get_dn(e), 0); } @@ -162,7 +162,7 @@ ldbm_instance_attrcrypt_config_add_callback(Slapi_PBlock *pb, Slapi_Entry* e, Sl /* Remember that we have some encryption enabled, so we can be intelligent about warning when SSL is not enabled */ inst->attrcrypt_configured = 1; } else { - LDAPDebug(LDAP_DEBUG_ERR, "ldbm_instance_attrcrypt_config_add_callback - " + slapi_log_err(SLAPI_LOG_ERR, "ldbm_instance_attrcrypt_config_add_callback - " "Attempt to encryption on a non-existent attribute: %s\n", attribute_name, 0, 0); returntext = "attribute does not exist"; @@ -217,7 +217,7 @@ ldbm_instance_attrcrypt_config_delete_callback(Slapi_PBlock *pb, Slapi_Entry* e, ainfo_get(inst->inst_be, attribute_name, &ai); if (ai == NULL || (0 == strcmp(LDBM_PSEUDO_ATTR_DEFAULT, ai->ai_type)) ) { - LDAPDebug(LDAP_DEBUG_WARNING, "ldbm_instance_attrcrypt_config_delete_callback - " + slapi_log_err(SLAPI_LOG_WARNING, "ldbm_instance_attrcrypt_config_delete_callback - " "Attempt to delete encryption for non-existant attribute: %s\n", attribute_name, 0, 0); } else { diff --git a/ldap/servers/slapd/back-ldbm/ldbm_bind.c b/ldap/servers/slapd/back-ldbm/ldbm_bind.c index cfc187c..859fd68 100644 --- a/ldap/servers/slapd/back-ldbm/ldbm_bind.c +++ b/ldap/servers/slapd/back-ldbm/ldbm_bind.c @@ -48,7 +48,7 @@ ldbm_back_bind( Slapi_PBlock *pb ) if (inst->inst_ref_count) { slapi_counter_increment(inst->inst_ref_count); } else { - LDAPDebug1Arg(LDAP_DEBUG_ERR, + slapi_log_err(SLAPI_LOG_ERR, "ldbm_back_bind - instance %s does not exist.\n", inst->inst_name); return( SLAPI_BIND_FAIL ); diff --git a/ldap/servers/slapd/back-ldbm/ldbm_compare.c b/ldap/servers/slapd/back-ldbm/ldbm_compare.c index c6b2029..5a2468e 100644 --- a/ldap/servers/slapd/back-ldbm/ldbm_compare.c +++ b/ldap/servers/slapd/back-ldbm/ldbm_compare.c @@ -48,7 +48,7 @@ ldbm_back_compare( Slapi_PBlock *pb ) if (inst && inst->inst_ref_count) { slapi_counter_increment(inst->inst_ref_count); } else { - LDAPDebug1Arg(LDAP_DEBUG_ERR, "ldbm_back_compare - " + slapi_log_err(SLAPI_LOG_ERR, "ldbm_back_compare - " "Instance \"%s\" does not exist.\n", inst ? inst->inst_name : "null instance"); return -1; diff --git a/ldap/servers/slapd/back-ldbm/ldbm_config.c b/ldap/servers/slapd/back-ldbm/ldbm_config.c index f8add00..0aac833 100644 --- a/ldap/servers/slapd/back-ldbm/ldbm_config.c +++ b/ldap/servers/slapd/back-ldbm/ldbm_config.c @@ -73,11 +73,11 @@ int ldbm_config_add_dse_entries(struct ldbminfo *li, char **entries, char *strin rc = slapi_add_internal_pb(util_pb); slapi_pblock_get(util_pb, SLAPI_PLUGIN_INTOP_RESULT, &result); if (!rc && (result == LDAP_SUCCESS)) { - LDAPDebug1Arg(LDAP_DEBUG_CONFIG, "ldbm_config_add_dse_entries - Added database config entry [%s]\n", ebuf); + slapi_log_err(SLAPI_LOG_CONFIG, "ldbm_config_add_dse_entries", "Added database config entry [%s]\n", ebuf); } else if (result == LDAP_ALREADY_EXISTS) { - LDAPDebug1Arg(LDAP_DEBUG_TRACE, "ldbm_config_add_dse_entries - Database config entry [%s] already exists - skipping\n", ebuf); + slapi_log_err(SLAPI_LOG_TRACE, "ldbm_config_add_dse_entries", "Database config entry [%s] already exists - skipping\n", ebuf); } else { - LDAPDebug(LDAP_DEBUG_ERR, "ldbm_config_add_dse_entries - " + slapi_log_err(SLAPI_LOG_ERR, "ldbm_config_add_dse_entries", "Unable to add config entry [%s] to the DSE: %d %d\n", ebuf, result, rc); } @@ -306,15 +306,15 @@ static int ldbm_config_directory_set(void *arg, void *value, char *errorbuf, int slapi_ch_free((void **) &(li->li_new_directory)); li->li_new_directory = rel2abspath(val); /* normalize the path; strdup'ed in rel2abspath */ - LDAPDebug(LDAP_DEBUG_ERR, "ldbm_config_directory_set - " - "New db directory location will not take affect until the server is restarted\n", 0, 0, 0); + slapi_log_err(SLAPI_LOG_ERR, "ldbm_config_directory_set", + "New db directory location will not take affect until the server is restarted\n"); } else { slapi_ch_free((void **) &(li->li_new_directory)); slapi_ch_free((void **) &(li->li_directory)); if (NULL == val || '\0' == *val) { - LDAPDebug(LDAP_DEBUG_ERR, - "ldbm_config_directory_set - db directory is not set; check %s in the db config: %s\n", - CONFIG_DIRECTORY, CONFIG_LDBM_DN, 0); + slapi_log_err(SLAPI_LOG_ERR, + "ldbm_config_directory_set", "db directory is not set; check %s in the db config: %s\n", + CONFIG_DIRECTORY, CONFIG_LDBM_DN); retval = LDAP_PARAM_ERROR; } else { if (0 == strcmp(val, "get default")) { @@ -337,27 +337,27 @@ static int ldbm_config_directory_set(void *arg, void *value, char *errorbuf, int slapi_pblock_get(search_pb, SLAPI_PLUGIN_INTOP_RESULT, &res); if (res != LDAP_SUCCESS) { - LDAPDebug(LDAP_DEBUG_ERR, - "ldbm_config_directory_set - ldbm plugin unable to read %s\n", - CONFIG_LDBM_DN, 0, 0); + slapi_log_err(SLAPI_LOG_ERR, + "ldbm_config_directory_set", "ldbm plugin unable to read %s\n", + CONFIG_LDBM_DN); retval = res; goto done; } slapi_pblock_get(search_pb, SLAPI_PLUGIN_INTOP_SEARCH_ENTRIES, &entries); if (NULL == entries) { - LDAPDebug(LDAP_DEBUG_ERR, - "ldbm_config_directory_set - ldbm plugin unable to read %s\n", - CONFIG_LDBM_DN, 0, 0); + slapi_log_err(SLAPI_LOG_ERR, + "ldbm_config_directory_set", "ldbm plugin unable to read %s\n", + CONFIG_LDBM_DN); retval = LDAP_OPERATIONS_ERROR; goto done; } res = slapi_entry_attr_find(entries[0], "nsslapd-directory", &attr); if (res != 0 || attr == NULL) { - LDAPDebug(LDAP_DEBUG_ERR, - "ldbm_config_directory_set - ldbm plugin unable to read attribute nsslapd-directory from %s\n", - CONFIG_LDBM_DN, 0, 0); + slapi_log_err(SLAPI_LOG_ERR, + "ldbm_config_directory_set", "ldbm plugin unable to read attribute nsslapd-directory from %s\n", + CONFIG_LDBM_DN); retval = LDAP_OPERATIONS_ERROR; goto done; } @@ -365,17 +365,17 @@ static int ldbm_config_directory_set(void *arg, void *value, char *errorbuf, int if ( slapi_attr_first_value(attr,&v) != 0 || ( NULL == v ) || ( NULL == ( s = slapi_value_get_string( v )))) { - LDAPDebug(LDAP_DEBUG_ERR, - "ldbm_config_directory_set - ldbm plugin unable to read attribute nsslapd-directory from %s\n", - CONFIG_LDBM_DN, 0, 0); + slapi_log_err(SLAPI_LOG_ERR, + "ldbm_config_directory_set", "ldbm plugin unable to read attribute nsslapd-directory from %s\n", + CONFIG_LDBM_DN); retval = LDAP_OPERATIONS_ERROR; goto done; } slapi_pblock_destroy(search_pb); if (NULL == s || '\0' == s || 0 == PL_strcmp(s, "(null)")) { - LDAPDebug(LDAP_DEBUG_ERR, - "ldbm_config_directory_set - db directory is not set; check %s in the db config: %s\n", - CONFIG_DIRECTORY, CONFIG_LDBM_DN, 0); + slapi_log_err(SLAPI_LOG_ERR, + "ldbm_config_directory_set", "db directory is not set; check %s in the db config: %s\n", + CONFIG_DIRECTORY, CONFIG_LDBM_DN); retval = LDAP_PARAM_ERROR; goto done; } @@ -421,22 +421,22 @@ static int ldbm_config_dbcachesize_set(void *arg, void *value, char *errorbuf, i /* min: 8KB (page size) * def thrd cnts (threadnumber==20). */ #define DBDEFMINSIZ 500000 if (val < DBDEFMINSIZ) { - LDAPDebug(LDAP_DEBUG_NOTICE,"ldbm_config_dbcachesize_set: cache too small, increasing to %dK bytes\n", - DBDEFMINSIZ/1000, 0, 0); + slapi_log_err(SLAPI_LOG_NOTICE,"ldbm_config_dbcachesize_set", "cache too small, increasing to %dK bytes\n", + DBDEFMINSIZ/1000); val = DBDEFMINSIZ; } else if (val > li->li_dbcachesize) { delta = val - li->li_dbcachesize; if (!util_is_cachesize_sane(&delta)){ slapi_create_errormsg(errorbuf, SLAPI_DSE_RETURNTEXT_SIZE, "Error: nsslapd-dbcachesize value is too large."); - LDAPDebug0Args(LDAP_DEBUG_ERR, "ldbm_config_dbcachesize_set - " + slapi_log_err(SLAPI_LOG_ERR, "ldbm_config_dbcachesize_set", "nsslapd-dbcachesize value is too large.\n"); return LDAP_UNWILLING_TO_PERFORM; } } if (CONFIG_PHASE_RUNNING == phase) { li->li_new_dbcachesize = val; - LDAPDebug(LDAP_DEBUG_NOTICE, "New db cache size will not take affect until the server is restarted\n", - 0, 0, 0); + slapi_log_err(SLAPI_LOG_NOTICE, "ldbm_config_dbcachesize_set", + "New db cache size will not take affect until the server is restarted\n"); } else { li->li_new_dbcachesize = val; li->li_dbcachesize = val; @@ -461,8 +461,8 @@ static int ldbm_config_maxpassbeforemerge_set(void *arg, void *value, char *erro if (apply) { if (val < 0) { - LDAPDebug(LDAP_DEBUG_NOTICE,"ldbm_config_maxpassbeforemerge_set- " - "maxpassbeforemerge will not take negative value - setting to 100\n", 0, 0, 0); + slapi_log_err(SLAPI_LOG_NOTICE,"ldbm_config_maxpassbeforemerge_set", + "maxpassbeforemerge will not take negative value - setting to 100\n"); val = 100; } @@ -490,8 +490,8 @@ static int ldbm_config_dbncache_set(void *arg, void *value, char *errorbuf, int if (CONFIG_PHASE_RUNNING == phase) { li->li_new_dbncache = val; - LDAPDebug(LDAP_DEBUG_NOTICE, "ldbm_config_dbncache_set - " - "New nsslapd-dbncache will not take affect until the server is restarted\n", 0, 0, 0); + slapi_log_err(SLAPI_LOG_NOTICE, "ldbm_config_dbncache_set", + "New nsslapd-dbncache will not take affect until the server is restarted\n"); } else { li->li_new_dbncache = val; li->li_dbncache = val; @@ -832,7 +832,7 @@ static int ldbm_config_db_trickle_percentage_set(void *arg, void *value, char *e if (val < 0 || val > 100) { slapi_create_errormsg(errorbuf, SLAPI_DSE_RETURNTEXT_SIZE, "Error: Invalid value for %s (%d). Must be between 0 and 100\n", CONFIG_DB_TRICKLE_PERCENTAGE, val); - LDAPDebug2Args(LDAP_DEBUG_ERR, "ldbm_config_db_trickle_percentage_set - " + slapi_log_err(SLAPI_LOG_ERR, "ldbm_config_db_trickle_percentage_set", "Invalid value for %s (%d). Must be between 0 and 100\n", CONFIG_DB_TRICKLE_PERCENTAGE, val); return LDAP_UNWILLING_TO_PERFORM; @@ -1028,14 +1028,15 @@ static int ldbm_config_db_lock_set(void *arg, void *value, char *errorbuf, int p if (val < BDB_LOCK_NB_MIN) { slapi_create_errormsg(errorbuf, SLAPI_DSE_RETURNTEXT_SIZE, "Error: Invalid value for %s (%d). Must be greater than %d\n", CONFIG_DB_LOCK, val, BDB_LOCK_NB_MIN); - LDAPDebug2Args(LDAP_DEBUG_ERR, "ldbm_config_db_lock_set - Invalid value for %s (%d)\n", + slapi_log_err(SLAPI_LOG_ERR, "ldbm_config_db_lock_set", "Invalid value for %s (%lu)\n", CONFIG_DB_LOCK, val); return LDAP_UNWILLING_TO_PERFORM; } if (apply) { if (CONFIG_PHASE_RUNNING == phase) { li->li_new_dblock = val; - LDAPDebug(LDAP_DEBUG_NOTICE, "ldbm_config_db_lock_set - New db max lock count will not take affect until the server is restarted\n", 0, 0, 0); + slapi_log_err(SLAPI_LOG_NOTICE, "ldbm_config_db_lock_set", + "New db max lock count will not take affect until the server is restarted\n"); } else { li->li_new_dblock = val; li->li_dblock = val; @@ -1074,7 +1075,7 @@ static int ldbm_config_db_cache_set(void *arg, void *value, char *errorbuf, int delta = val - li->li_dblayer_private->dblayer_cache_config; if (!util_is_cachesize_sane(&delta)){ slapi_create_errormsg(errorbuf, SLAPI_DSE_RETURNTEXT_SIZE, "Error: db cachesize value is too large"); - LDAPDebug0Args(LDAP_DEBUG_ERR,"ldbm_config_db_cache_set - db cachesize value is too large.\n"); + slapi_log_err(SLAPI_LOG_ERR,"ldbm_config_db_cache_set", "db cachesize value is too large.\n"); return LDAP_UNWILLING_TO_PERFORM; } } @@ -1205,7 +1206,7 @@ static int ldbm_config_import_cachesize_set(void *arg, void *value, char *errorb delta = val - li->li_import_cachesize; if (!util_is_cachesize_sane(&delta)){ slapi_create_errormsg(errorbuf, SLAPI_DSE_RETURNTEXT_SIZE, "Error: import cachesize value is too large."); - LDAPDebug0Args(LDAP_DEBUG_ERR,"ldbm_config_import_cachesize_set - " + slapi_log_err(SLAPI_LOG_ERR,"ldbm_config_import_cachesize_set", "Import cachesize value is too large.\n"); return LDAP_UNWILLING_TO_PERFORM; } @@ -1470,7 +1471,7 @@ static int ldbm_config_db_deadlock_policy_set(void *arg, void *value, char *erro slapi_create_errormsg(errorbuf, SLAPI_DSE_RETURNTEXT_SIZE, "Error: Invalid value for %s (%d). Must be between %d and %d inclusive", CONFIG_DB_DEADLOCK_POLICY, val, DB_LOCK_DEFAULT, DB_LOCK_YOUNGEST); - LDAPDebug(LDAP_DEBUG_ERR, "ldbm_config_db_deadlock_policy_set - " + slapi_log_err(SLAPI_LOG_ERR, "ldbm_config_db_deadlock_policy_set", "Invalid value for deadlock policy (%d). Must be between %d and %d inclusive", val, DB_LOCK_DEFAULT, DB_LOCK_YOUNGEST); return LDAP_UNWILLING_TO_PERFORM; @@ -1479,8 +1480,9 @@ static int ldbm_config_db_deadlock_policy_set(void *arg, void *value, char *erro slapi_create_errormsg(errorbuf, SLAPI_DSE_RETURNTEXT_SIZE, "Warning: Setting value for %s to (%d) will disable deadlock detection", CONFIG_DB_DEADLOCK_POLICY, val); - LDAPDebug2Args(LDAP_DEBUG_WARNING, "ldbm_config_db_deadlock_policy_set - Setting value for %s to (%d) will disable deadlock detection", - CONFIG_DB_DEADLOCK_POLICY, val); + slapi_log_err(SLAPI_LOG_WARNING, "ldbm_config_db_deadlock_policy_set", + "Setting value for %s to (%d) will disable deadlock detection", + CONFIG_DB_DEADLOCK_POLICY, val); } if (apply) { @@ -1580,8 +1582,8 @@ ldbm_config_read_instance_entries(struct ldbminfo *li, const char *backend_type) /* Construct the base dn of the subtree that holds the instance entries. */ basedn = slapi_create_dn_string("cn=%s,cn=plugins,cn=config", backend_type); if (NULL == basedn) { - LDAPDebug1Arg(LDAP_DEBUG_ERR, - "ldbm_config_read_instance_entries -" + slapi_log_err(SLAPI_LOG_ERR, + "ldbm_config_read_instance_entries", "failed to create backend dn for %s\n", backend_type); return 1; } @@ -1597,9 +1599,9 @@ ldbm_config_read_instance_entries(struct ldbminfo *li, const char *backend_type) rc = ldbm_instance_add_instance_entry_callback(NULL, entries[i], NULL, NULL, NULL, li); if (SLAPI_DSE_CALLBACK_ERROR == rc) { - LDAPDebug1Arg(LDAP_DEBUG_ERR, - "ldbm_config_read_instance_entries - " - "failed to add instance entry %s\n", + slapi_log_err(SLAPI_LOG_ERR, + "ldbm_config_read_instance_entries", + "Failed to add instance entry %s\n", slapi_entry_get_dn_const(entries[i])); break; } @@ -1633,8 +1635,8 @@ int ldbm_config_load_dse_info(struct ldbminfo *li) dn = slapi_create_dn_string("cn=config,cn=%s,cn=plugins,cn=config", li->li_plugin->plg_name); if (NULL == dn) { - LDAPDebug1Arg(LDAP_DEBUG_ERR, - "ldbm_config_load_dse_info - " + slapi_log_err(SLAPI_LOG_ERR, + "ldbm_config_load_dse_info", "failed create config dn for %s\n", li->li_plugin->plg_name); rval = 1; @@ -1643,9 +1645,7 @@ int ldbm_config_load_dse_info(struct ldbminfo *li) search_pb = slapi_pblock_new(); if (!search_pb) { - LDAPDebug(LDAP_DEBUG_ERR, - "ldbm_config_load_dse_info - Out of memory\n", - 0, 0, 0); + slapi_log_err(SLAPI_LOG_ERR, "ldbm_config_load_dse_info", "Out of memory\n"); rval = 1; goto bail; } @@ -1660,8 +1660,8 @@ int ldbm_config_load_dse_info(struct ldbminfo *li) ldbm_config_add_dse_entries(li, ldbm_skeleton_entries, li->li_plugin->plg_name, NULL, NULL, 0); } else if (rval != LDAP_SUCCESS) { - LDAPDebug(LDAP_DEBUG_ERR, "ldbm_config_load_dse_info - Error accessing the ldbm config DSE 1\n", - 0, 0, 0); + slapi_log_err(SLAPI_LOG_ERR, "ldbm_config_load_dse_info", + "Error accessing the ldbm config DSE 1\n"); rval = 1; goto bail; } else { @@ -1670,14 +1670,12 @@ int ldbm_config_load_dse_info(struct ldbminfo *li) slapi_pblock_get(search_pb, SLAPI_PLUGIN_INTOP_SEARCH_ENTRIES, &entries); if (NULL == entries || entries[0] == NULL) { - LDAPDebug(LDAP_DEBUG_ERR, "ldbm_config_load_dse_info - Error accessing the ldbm config DSE 2\n", - 0, 0, 0); + slapi_log_err(SLAPI_LOG_ERR, "ldbm_config_load_dse_info", "Error accessing the ldbm config DSE 2\n"); rval = 1; goto bail; } if (0 != parse_ldbm_config_entry(li, entries[0], ldbm_config)) { - LDAPDebug(LDAP_DEBUG_ERR, "ldbm_config_load_dse_info - Error parsing the ldbm config DSE\n", - 0, 0, 0); + slapi_log_err(SLAPI_LOG_ERR, "ldbm_config_load_dse_info", "Error parsing the ldbm config DSE\n"); rval = 1; goto bail; } @@ -1692,8 +1690,8 @@ int ldbm_config_load_dse_info(struct ldbminfo *li) * ldbm_instance for each */ rval = ldbm_config_read_instance_entries(li, li->li_plugin->plg_name); if (rval) { - LDAPDebug0Args(LDAP_DEBUG_ERR, - "ldbm_config_load_dse_info - " + slapi_log_err(SLAPI_LOG_ERR, + "ldbm_config_load_dse_info", "failed to read instance entries\n"); goto bail; } @@ -1714,8 +1712,8 @@ int ldbm_config_load_dse_info(struct ldbminfo *li) dn = slapi_create_dn_string("cn=monitor,cn=%s,cn=plugins,cn=config", li->li_plugin->plg_name); if (NULL == dn) { - LDAPDebug1Arg(LDAP_DEBUG_ERR, - "ldbm_config_load_dse_info - " + slapi_log_err(SLAPI_LOG_ERR, + "ldbm_config_load_dse_info", "failed to create monitor dn for %s\n", li->li_plugin->plg_name); rval = 1; @@ -1730,8 +1728,8 @@ int ldbm_config_load_dse_info(struct ldbminfo *li) dn = slapi_create_dn_string("cn=database,cn=monitor,cn=%s,cn=plugins,cn=config", li->li_plugin->plg_name); if (NULL == dn) { - LDAPDebug1Arg(LDAP_DEBUG_ERR, - "ldbm_config_load_dse_info - " + slapi_log_err(SLAPI_LOG_ERR, + "ldbm_config_load_dse_info", "failed create monitor database dn for %s\n", li->li_plugin->plg_name); rval = 1; @@ -1747,8 +1745,8 @@ int ldbm_config_load_dse_info(struct ldbminfo *li) dn = slapi_create_dn_string("cn=%s,cn=plugins,cn=config", li->li_plugin->plg_name); if (NULL == dn) { - LDAPDebug1Arg(LDAP_DEBUG_ERR, - "ldbm_config_load_dse_info - " + slapi_log_err(SLAPI_LOG_ERR, + "ldbm_config_load_dse_info", "failed create plugin dn for %s\n", li->li_plugin->plg_name); rval = 1; @@ -1898,7 +1896,7 @@ int ldbm_config_set(void *arg, char *attr_name, config_info *config_array, struc config = get_config_info(config_array, attr_name); if (NULL == config) { - LDAPDebug(LDAP_DEBUG_CONFIG, "ldbm_config_set - Unknown config attribute %s\n", attr_name, 0, 0); + slapi_log_err(SLAPI_LOG_CONFIG, "ldbm_config_set", "Unknown config attribute %s\n", attr_name); slapi_create_errormsg(err_buf, SLAPI_DSE_RETURNTEXT_SIZE, "Unknown config attribute %s\n", attr_name); return LDAP_SUCCESS; /* Ignore unknown attributes */ } @@ -1906,7 +1904,7 @@ int ldbm_config_set(void *arg, char *attr_name, config_info *config_array, struc /* Some config attrs can't be changed while the server is running. */ if (phase == CONFIG_PHASE_RUNNING && !(config->config_flags & CONFIG_FLAG_ALLOW_RUNNING_CHANGE)) { - LDAPDebug1Arg(LDAP_DEBUG_ERR, "ldbm_config_set - %s can't be modified while the server is running.\n", attr_name); + slapi_log_err(SLAPI_LOG_ERR, "ldbm_config_set", "%s can't be modified while the server is running.\n", attr_name); slapi_create_errormsg(err_buf, SLAPI_DSE_RETURNTEXT_SIZE, "%s can't be modified while the server is running.\n", attr_name); return LDAP_UNWILLING_TO_PERFORM; } @@ -1954,20 +1952,20 @@ int ldbm_config_set(void *arg, char *attr_name, config_info *config_array, struc /* check for parsing error (e.g. not a number) */ if (err) { slapi_create_errormsg(err_buf, SLAPI_DSE_RETURNTEXT_SIZE, "Error: value %s for attr %s is not a number\n", str_val, attr_name); - LDAPDebug2Args(LDAP_DEBUG_ERR, "ldbm_config_set - Value %s for attr %s is not a number\n", str_val, attr_name); + slapi_log_err(SLAPI_LOG_ERR, "ldbm_config_set", "Value %s for attr %s is not a number\n", str_val, attr_name); return LDAP_UNWILLING_TO_PERFORM; /* check for overflow */ } else if (LL_CMP(llval, >, llmaxint)) { slapi_create_errormsg(err_buf, SLAPI_DSE_RETURNTEXT_SIZE, "Error: value %s for attr %s is greater than the maximum %d\n", str_val, attr_name, maxint); - LDAPDebug(LDAP_DEBUG_ERR, "ldbm_config_set - Value %s for attr %s is greater than the maximum %d\n", + slapi_log_err(SLAPI_LOG_ERR, "ldbm_config_set", "Value %s for attr %s is greater than the maximum %d\n", str_val, attr_name, maxint); return LDAP_UNWILLING_TO_PERFORM; /* check for underflow */ } else if (LL_CMP(llval, <, llminint)) { slapi_create_errormsg(err_buf, SLAPI_DSE_RETURNTEXT_SIZE, "Error: value %s for attr %s is less than the minimum %d\n", str_val, attr_name, minint); - LDAPDebug(LDAP_DEBUG_ERR, "ldbm_config_set - Value %s for attr %s is less than the minimum %d\n", + slapi_log_err(SLAPI_LOG_ERR, "ldbm_config_set", "Value %s for attr %s is less than the minimum %d\n", str_val, attr_name, minint); return LDAP_UNWILLING_TO_PERFORM; } @@ -1995,21 +1993,21 @@ int ldbm_config_set(void *arg, char *attr_name, config_info *config_array, struc if (err) { slapi_create_errormsg(err_buf, SLAPI_DSE_RETURNTEXT_SIZE, "Error: value %s for attr %s is not a number\n", str_val, attr_name); - LDAPDebug2Args(LDAP_DEBUG_ERR, "ldbm_config_set - Value %s for attr %s is not a number\n", + slapi_log_err(SLAPI_LOG_ERR, "ldbm_config_set", "Value %s for attr %s is not a number\n", str_val, attr_name); return LDAP_UNWILLING_TO_PERFORM; /* check for overflow */ } else if (LL_CMP(llval, >, llmaxint)) { slapi_create_errormsg(err_buf, SLAPI_DSE_RETURNTEXT_SIZE, "Error: value %s for attr %s is greater than the maximum %d\n", str_val, attr_name, maxint); - LDAPDebug(LDAP_DEBUG_ERR, "ldbm_config_set - Value %s for attr %s is greater than the maximum %d\n", + slapi_log_err(SLAPI_LOG_ERR, "ldbm_config_set", "Value %s for attr %s is greater than the maximum %d\n", str_val, attr_name, maxint); return LDAP_UNWILLING_TO_PERFORM; /* check for underflow */ } else if (LL_CMP(llval, <, llminint)) { slapi_create_errormsg(err_buf, SLAPI_DSE_RETURNTEXT_SIZE, "Error: value %s for attr %s is less than the minimum %d\n", str_val, attr_name, minint); - LDAPDebug(LDAP_DEBUG_ERR, "ldbm_config_set - Value %s for attr %s is less than the minimum %d\n", + slapi_log_err(SLAPI_LOG_ERR, "ldbm_config_set", "Value %s for attr %s is less than the minimum %d\n", str_val, attr_name, minint); return LDAP_UNWILLING_TO_PERFORM; } @@ -2031,14 +2029,14 @@ int ldbm_config_set(void *arg, char *attr_name, config_info *config_array, struc if (err == EINVAL) { slapi_create_errormsg(err_buf, SLAPI_DSE_RETURNTEXT_SIZE, "Error: value %s for attr %s is not a number\n", str_val, attr_name); - LDAPDebug2Args(LDAP_DEBUG_ERR, "ldbm_config_set - Value %s for attr %s is not a number\n", + slapi_log_err(SLAPI_LOG_ERR, "ldbm_config_set", "Value %s for attr %s is not a number\n", str_val, attr_name); return LDAP_UNWILLING_TO_PERFORM; /* check for overflow */ } else if (err == ERANGE) { slapi_create_errormsg(err_buf, SLAPI_DSE_RETURNTEXT_SIZE, "Error: value %s for attr %s is outside the range of representable values\n", str_val, attr_name); - LDAPDebug2Args(LDAP_DEBUG_ERR, "ldbm_config_set - Value %s for attr %s is outside the range of representable values\n", + slapi_log_err(SLAPI_LOG_ERR, "ldbm_config_set", "Value %s for attr %s is outside the range of representable values\n", str_val, attr_name); return LDAP_UNWILLING_TO_PERFORM; } @@ -2099,7 +2097,7 @@ static int parse_ldbm_config_entry(struct ldbminfo *li, Slapi_Entry *e, config_i bval = (struct berval *) slapi_value_get_berval(sval); if (ldbm_config_set(li, attr_name, config_array, bval, err_buf, CONFIG_PHASE_STARTUP, 1 /* apply */, LDAP_MOD_REPLACE) != LDAP_SUCCESS) { - LDAPDebug(LDAP_DEBUG_ERR, "parse_ldbm_config_entry - Error with config attribute %s : %s\n", attr_name, err_buf, 0); + slapi_log_err(SLAPI_LOG_ERR, "parse_ldbm_config_entry", "Error with config attribute %s : %s\n", attr_name, err_buf); return 1; } } @@ -2219,8 +2217,8 @@ void ldbm_config_internal_set(struct ldbminfo *li, char *attrname, char *value) if (ldbm_config_set((void *) li, attrname, ldbm_config, &bval, err_buf, CONFIG_PHASE_INTERNAL, 1 /* apply */, LDAP_MOD_REPLACE) != LDAP_SUCCESS) { - LDAPDebug(LDAP_DEBUG_ERR, - "ldbm_config_internal_set - Error setting instance config attr %s to %s: %s\n", + slapi_log_err(SLAPI_LOG_ERR, + "ldbm_config_internal_set", "Error setting instance config attr %s to %s: %s\n", attrname, value, err_buf); exit(1); } diff --git a/ldap/servers/slapd/back-ldbm/ldbm_delete.c b/ldap/servers/slapd/back-ldbm/ldbm_delete.c index 326d67d..33509a5 100644 --- a/ldap/servers/slapd/back-ldbm/ldbm_delete.c +++ b/ldap/servers/slapd/back-ldbm/ldbm_delete.c @@ -107,14 +107,14 @@ ldbm_back_delete( Slapi_PBlock *pb ) if (pb->pb_conn) { - slapi_log_error(SLAPI_LOG_TRACE, "ldbm_back_delete", "Enter conn=%" NSPRIu64 " op=%d\n", + slapi_log_err(SLAPI_LOG_TRACE, "ldbm_back_delete", "Enter conn=%" NSPRIu64 " op=%d\n", pb->pb_conn->c_connid, operation->o_opid); } if ((NULL == addr) || (NULL == sdnp)) { /* retval is -1 */ - slapi_log_error(SLAPI_LOG_ERR, "ldbm_back_delete", + slapi_log_err(SLAPI_LOG_ERR, "ldbm_back_delete", "Either of DELETE_TARGET_SDN or TARGET_ADDRESS is NULL.\n"); goto error_return; } @@ -136,8 +136,8 @@ ldbm_back_delete( Slapi_PBlock *pb ) if (inst && inst->inst_ref_count) { slapi_counter_increment(inst->inst_ref_count); } else { - LDAPDebug1Arg(LDAP_DEBUG_ERR, - "ldbm_back_delete - Instance \"%s\" does not exist.\n", + slapi_log_err(SLAPI_LOG_ERR, + "ldbm_back_delete", "Instance \"%s\" does not exist.\n", inst ? inst->inst_name : "null instance"); goto error_return; } @@ -211,7 +211,7 @@ ldbm_back_delete( Slapi_PBlock *pb ) } CACHE_RETURN(&inst->inst_cache, &tombstone); if (tombstone) { - slapi_log_error(SLAPI_LOG_ERR, "ldbm_back_delete", + slapi_log_err(SLAPI_LOG_ERR, "ldbm_back_delete", "conn=%lu op=%d [retry: %d] tombstone %s is not freed!!! refcnt %d, state %d\n", conn_id, op_id, retry_count, slapi_entry_get_dn(tombstone->ep_entry), tombstone->ep_refcnt, tombstone->ep_state); @@ -220,7 +220,7 @@ ldbm_back_delete( Slapi_PBlock *pb ) original_tombstone = tmptombstone; tmptombstone = NULL; } else { - slapi_log_error(SLAPI_LOG_ERR, "ldbm_back_delete", + slapi_log_err(SLAPI_LOG_ERR, "ldbm_back_delete", "conn=%lu op=%d [retry: %d] No original_tombstone for %s!!\n", conn_id, op_id, retry_count, slapi_entry_get_dn(e->ep_entry)); } @@ -232,7 +232,7 @@ ldbm_back_delete( Slapi_PBlock *pb ) } /* We're re-trying */ - LDAPDebug0Args(LDAP_DEBUG_BACKLDBM, "ldbm_back_delete - " + slapi_log_err(SLAPI_LOG_BACKLDBM, "ldbm_back_delete", "Delete Retrying Transaction\n"); #ifndef LDBM_NO_BACKOFF_DELAY { @@ -272,14 +272,14 @@ ldbm_back_delete( Slapi_PBlock *pb ) { ldap_result_code= LDAP_NO_SUCH_OBJECT; retval = -1; - LDAPDebug0Args(LDAP_DEBUG_BACKLDBM, "ldbm_back_delete - Deleting entry is already deleted.\n"); + slapi_log_err(SLAPI_LOG_BACKLDBM, "ldbm_back_delete", "Deleting entry is already deleted.\n"); goto error_return; /* error result sent by find_entry2modify() */ } ep_id = e->ep_id; retval = slapi_entry_has_children(e->ep_entry); if (retval) { ldap_result_code= LDAP_NOT_ALLOWED_ON_NONLEAF; - slapi_log_error(SLAPI_LOG_BACKLDBM, "ldbm_back_delete", + slapi_log_err(SLAPI_LOG_BACKLDBM, "ldbm_back_delete", "conn=%lu op=%d Deleting entry %s has %d children.\n", conn_id, op_id, slapi_entry_get_dn(e->ep_entry), retval); retval = -1; @@ -351,8 +351,8 @@ ldbm_back_delete( Slapi_PBlock *pb ) if (!delete_tombstone_entry) { retval = plugin_call_plugins(pb, SLAPI_PLUGIN_BE_TXN_PRE_DELETE_FN); if (retval) { - LDAPDebug1Arg(LDAP_DEBUG_TRACE, - "ldbm_back_delete - SLAPI_PLUGIN_BE_TXN_PRE_DELETE_FN plugin " + slapi_log_err(SLAPI_LOG_TRACE, + "ldbm_back_delete", "SLAPI_PLUGIN_BE_TXN_PRE_DELETE_FN plugin " "returned error code %d\n", retval ); if (!ldap_result_code) { slapi_pblock_get(pb, SLAPI_RESULT_CODE, &ldap_result_code); @@ -377,13 +377,13 @@ ldbm_back_delete( Slapi_PBlock *pb ) is_tombstone_entry = slapi_entry_flag_is_set(e->ep_entry, SLAPI_ENTRY_FLAG_TOMBSTONE); if (delete_tombstone_entry) { if (!is_tombstone_entry) { - slapi_log_error(SLAPI_LOG_WARNING, "ldbm_back_delete", + slapi_log_err(SLAPI_LOG_WARNING, "ldbm_back_delete", "Attempt to delete a non-tombstone entry %s\n", dn); delete_tombstone_entry = 0; } } else { if (is_tombstone_entry) { - slapi_log_error(SLAPI_LOG_WARNING, "ldbm_back_delete", + slapi_log_err(SLAPI_LOG_WARNING, "ldbm_back_delete", "Attempt to Tombstone again a tombstone entry %s\n", dn); delete_tombstone_entry = 1; } @@ -423,7 +423,7 @@ ldbm_back_delete( Slapi_PBlock *pb ) } } if (create_tombstone_entry && is_tombstone_entry) { - slapi_log_error(SLAPI_LOG_ERR, "ldbm_back_delete", + slapi_log_err(SLAPI_LOG_ERR, "ldbm_back_delete", "Attempt to convert a tombstone entry %s to tombstone\n", dn); retval = -1; ldap_result_code = LDAP_UNWILLING_TO_PERFORM; @@ -431,7 +431,7 @@ ldbm_back_delete( Slapi_PBlock *pb ) } #ifdef DEBUG - slapi_log_error(SLAPI_LOG_REPL, "ldbm_back_delete", + slapi_log_err(SLAPI_LOG_REPL, "ldbm_back_delete", "entry: %s - flags: delete %d is_tombstone_entry %d create %d \n", dn, delete_tombstone_entry, is_tombstone_entry, create_tombstone_entry); #endif @@ -531,7 +531,7 @@ ldbm_back_delete( Slapi_PBlock *pb ) retval = parent_update_on_childchange(&parent_modify_c, op, &haschildren); /* The modify context now contains info needed later */ if (0 != retval) { - slapi_log_error(SLAPI_LOG_ERR, "ldbm_back_delete", + slapi_log_err(SLAPI_LOG_ERR, "ldbm_back_delete", "conn=%lu op=%d parent_update_on_childchange: old_entry=0x%p, new_entry=0x%p, rc=%d\n", conn_id, op_id, parent_modify_c.old_entry, parent_modify_c.new_entry, retval); ldap_result_code= LDAP_OPERATIONS_ERROR; @@ -571,7 +571,7 @@ ldbm_back_delete( Slapi_PBlock *pb ) if (slapi_entry_attr_hasvalue(e->ep_entry, SLAPI_ATTR_OBJECTCLASS, SLAPI_ATTR_VALUE_TOMBSTONE) && slapi_is_special_rdn(edn, RDN_IS_TOMBSTONE)) { - slapi_log_error(SLAPI_LOG_ERR, "ldbm_back_delete", + slapi_log_err(SLAPI_LOG_ERR, "ldbm_back_delete", "conn=%lu op=%d Turning a tombstone into a tombstone! \"%s\"; e: 0x%p, cache_state: 0x%x, refcnt: %d\n", conn_id, op_id, edn, e, e->ep_state, e->ep_refcnt); ldap_result_code= LDAP_OPERATIONS_ERROR; @@ -579,7 +579,7 @@ ldbm_back_delete( Slapi_PBlock *pb ) goto error_return; } if (!childuniqueid) { - slapi_log_error(SLAPI_LOG_ERR, "ldbm_back_delete", + slapi_log_err(SLAPI_LOG_ERR, "ldbm_back_delete", "conn=%lu op=%d No nsUniqueId in the entry \"%s\"; e: 0x%p, cache_state: 0x%x, refcnt: %d\n", conn_id, op_id, edn, e, e->ep_state, e->ep_refcnt); ldap_result_code= LDAP_OPERATIONS_ERROR; @@ -657,8 +657,8 @@ ldbm_back_delete( Slapi_PBlock *pb ) not_an_error = 1; rc = LDAP_SUCCESS; } - LDAPDebug1Arg(LDAP_DEBUG_TRACE, - "ldbm_back_delete - SLAPI_PLUGIN_BE_TXN_PRE_DELETE_FN plugin " + slapi_log_err(SLAPI_LOG_TRACE, + "ldbm_back_delete", "SLAPI_PLUGIN_BE_TXN_PRE_DELETE_FN plugin " "returned error code %d\n", retval ); if (!ldap_result_code) { slapi_pblock_get(pb, SLAPI_RESULT_CODE, &ldap_result_code); @@ -720,7 +720,7 @@ ldbm_back_delete( Slapi_PBlock *pb ) */ retval = cache_add_tentative(&inst->inst_cache, tombstone, NULL); if (0 > retval) { - slapi_log_error(SLAPI_LOG_CACHE, "ldbm_back_delete", + slapi_log_err(SLAPI_LOG_CACHE, "ldbm_back_delete", "conn=%lu op=%d tombstone entry %s failed to add to the cache: %d\n", conn_id, op_id, slapi_entry_get_dn(tombstone->ep_entry), retval); if (LDBM_OS_ERR_IS_DISKFULL(retval)) disk_full = 1; @@ -730,14 +730,13 @@ ldbm_back_delete( Slapi_PBlock *pb ) } retval = id2entry_add( be, tombstone, &txn ); if (DB_LOCK_DEADLOCK == retval) { - LDAPDebug(LDAP_DEBUG_BACKLDBM, "ldbm_back_delete - delete 1 DB_LOCK_DEADLOCK\n", - 0, 0, 0 ); + slapi_log_err(SLAPI_LOG_BACKLDBM, "ldbm_back_delete", "delete 1 DB_LOCK_DEADLOCK\n"); /* Abort and re-try */ continue; } if (retval) { - LDAPDebug(LDAP_DEBUG_ERR, "ldbm_back_delete - id2entry_add failed, err=%d %s\n", - retval, (msg = dblayer_strerror( retval )) ? msg : "", 0 ); + slapi_log_err(SLAPI_LOG_ERR, "ldbm_back_delete", "id2entry_add failed, err=%d %s\n", + retval, (msg = dblayer_strerror( retval )) ? msg : ""); if (LDBM_OS_ERR_IS_DISKFULL(retval)) disk_full = 1; DEL_SET_ERROR(ldap_result_code, LDAP_OPERATIONS_ERROR, retry_count); goto error_return; @@ -749,7 +748,7 @@ ldbm_back_delete( Slapi_PBlock *pb ) retval = id2entry_delete( be, e, &txn ); if (DB_LOCK_DEADLOCK == retval) { - LDAPDebug0Args(LDAP_DEBUG_BACKLDBM, "ldbm_back_delete - delete 2 DEADLOCK\n"); + slapi_log_err(SLAPI_LOG_BACKLDBM, "ldbm_back_delete", "delete 2 DEADLOCK\n"); /* Retry txn */ continue; } @@ -771,12 +770,12 @@ ldbm_back_delete( Slapi_PBlock *pb ) retval = index_addordel_entry( be, e, addordel_flags, &txn ); if (DB_LOCK_DEADLOCK == retval) { - LDAPDebug0Args(LDAP_DEBUG_BACKLDBM, "ldbm_back_delete - delete 1 DEADLOCK\n"); + slapi_log_err(SLAPI_LOG_BACKLDBM, "ldbm_back_delete", "delete 1 DEADLOCK\n"); /* Retry txn */ continue; } if (retval) { - LDAPDebug(LDAP_DEBUG_ERR, "ldbm_back_delete - index_addordel_entry(%s, 0x%x) failed (%d)\n", + slapi_log_err(SLAPI_LOG_ERR, "ldbm_back_delete", "index_addordel_entry(%s, 0x%x) failed (%d)\n", slapi_entry_get_dn(e->ep_entry), addordel_flags, retval); DEL_SET_ERROR(ldap_result_code, LDAP_OPERATIONS_ERROR, retry_count); goto error_return; @@ -794,15 +793,15 @@ ldbm_back_delete( Slapi_PBlock *pb ) SLAPI_ATTR_VALUE_TOMBSTONE, tombstone->ep_id,BE_INDEX_ADD, &txn); if (DB_LOCK_DEADLOCK == retval) { - LDAPDebug(LDAP_DEBUG_BACKLDBM, - "ldbm_back_delete - (adding %s) DB_LOCK_DEADLOCK\n", - SLAPI_ATTR_VALUE_TOMBSTONE, 0, 0 ); + slapi_log_err(SLAPI_LOG_BACKLDBM, + "ldbm_back_delete", "(adding %s) DB_LOCK_DEADLOCK\n", + SLAPI_ATTR_VALUE_TOMBSTONE); /* Retry txn */ continue; } if (retval) { - LDAPDebug(LDAP_DEBUG_ERR, - "ldbm_back_delete - (adding %s) failed, err=%d %s\n", + slapi_log_err(SLAPI_LOG_ERR, + "ldbm_back_delete", "(adding %s) failed, err=%d %s\n", SLAPI_ATTR_VALUE_TOMBSTONE, retval, (msg = dblayer_strerror( retval )) ? msg : "" ); if (LDBM_OS_ERR_IS_DISKFULL(retval)) disk_full = 1; @@ -818,15 +817,15 @@ ldbm_back_delete( Slapi_PBlock *pb ) deletion_csn_str, tombstone->ep_id, BE_INDEX_ADD, &txn); if (DB_LOCK_DEADLOCK == retval) { - LDAPDebug(LDAP_DEBUG_BACKLDBM, - "ldbm_back_delete - delete tombstone csn(adding %s) DB_LOCK_DEADLOCK\n", - deletion_csn_str, 0, 0 ); + slapi_log_err(SLAPI_LOG_BACKLDBM, + "ldbm_back_delete", "Delete tombstone csn(adding %s) DB_LOCK_DEADLOCK\n", + deletion_csn_str); /* Retry txn */ continue; } if (0 != retval) { - LDAPDebug(LDAP_DEBUG_ERR, - "ldbm_back_delete - delete tombsone csn(adding %s) failed, err=%d %s\n", + slapi_log_err(SLAPI_LOG_ERR, + "ldbm_back_delete", "delete tombsone csn(adding %s) failed, err=%d %s\n", deletion_csn_str, retval, (msg = dblayer_strerror( retval )) ? msg : "" ); @@ -842,15 +841,15 @@ ldbm_back_delete( Slapi_PBlock *pb ) slapi_entry_get_uniqueid(tombstone->ep_entry), tombstone->ep_id,BE_INDEX_ADD,&txn); if (DB_LOCK_DEADLOCK == retval) { - LDAPDebug(LDAP_DEBUG_BACKLDBM, - "ldbm_back_delete - (adding %s) DB_LOCK_DEADLOCK\n", - SLAPI_ATTR_UNIQUEID, 0, 0 ); + slapi_log_err(SLAPI_LOG_BACKLDBM, + "ldbm_back_delete", "(adding %s) DB_LOCK_DEADLOCK\n", + SLAPI_ATTR_UNIQUEID); /* Retry txn */ continue; } if (retval) { - LDAPDebug(LDAP_DEBUG_ERR, - "ldbm_back_delete - (adding %s) failed, err=%d %s\n", + slapi_log_err(SLAPI_LOG_ERR, + "ldbm_back_delete", "adding %s) failed, err=%d %s\n", SLAPI_ATTR_UNIQUEID, retval, (msg = dblayer_strerror( retval )) ? msg : "" ); if (LDBM_OS_ERR_IS_DISKFULL(retval)) disk_full = 1; @@ -861,15 +860,15 @@ ldbm_back_delete( Slapi_PBlock *pb ) slapi_sdn_get_ndn(&nscpEntrySDN), tombstone->ep_id, BE_INDEX_ADD, &txn); if (DB_LOCK_DEADLOCK == retval) { - LDAPDebug(LDAP_DEBUG_BACKLDBM, - "ldbm_back_delete - (adding %s) DB_LOCK_DEADLOCK\n", - SLAPI_ATTR_NSCP_ENTRYDN, 0, 0 ); + slapi_log_err(SLAPI_LOG_BACKLDBM, + "ldbm_back_delete", "(adding %s) DB_LOCK_DEADLOCK\n", + SLAPI_ATTR_NSCP_ENTRYDN); /* Retry txn */ continue; } if (retval) { - LDAPDebug(LDAP_DEBUG_ERR, - "ldbm_back_delete - (adding %s) failed, err=%d %s\n", + slapi_log_err(SLAPI_LOG_ERR, + "ldbm_back_delete", "adding %s) failed, err=%d %s\n", SLAPI_ATTR_NSCP_ENTRYDN, retval, (msg = dblayer_strerror( retval )) ? msg : "" ); if (LDBM_OS_ERR_IS_DISKFULL(retval)) disk_full = 1; @@ -884,15 +883,15 @@ ldbm_back_delete( Slapi_PBlock *pb ) entryusn_str, tombstone->ep_id, BE_INDEX_ADD, &txn); slapi_ch_free_string(&entryusn_str); if (DB_LOCK_DEADLOCK == retval) { - LDAPDebug(LDAP_DEBUG_BACKLDBM, - "ldbm_back_delete - (adding %s) DB_LOCK_DEADLOCK\n", - SLAPI_ATTR_ENTRYUSN, 0, 0 ); + slapi_log_err(SLAPI_LOG_BACKLDBM, + "ldbm_back_delete", "(adding %s) DB_LOCK_DEADLOCK\n", + SLAPI_ATTR_ENTRYUSN); /* Retry txn */ continue; } if (0 != retval) { - LDAPDebug(LDAP_DEBUG_ERR, - "ldbm_back_delete - (adding %s) failed, err=%d %s\n", + slapi_log_err(SLAPI_LOG_ERR, + "ldbm_back_delete", "(adding %s) failed, err=%d %s\n", SLAPI_ATTR_ENTRYUSN, retval, (msg = dblayer_strerror( retval )) ? msg : "" ); if (LDBM_OS_ERR_IS_DISKFULL(retval)) disk_full = 1; @@ -915,14 +914,14 @@ ldbm_back_delete( Slapi_PBlock *pb ) svals, NULL, e->ep_id, BE_INDEX_ADD, &txn); if (DB_LOCK_DEADLOCK == retval) { - LDAPDebug0Args(LDAP_DEBUG_BACKLDBM, - "ldbm_back_delete - delete (updating " LDBM_PARENTID_STR ") DB_LOCK_DEADLOCK\n"); + slapi_log_err(SLAPI_LOG_BACKLDBM, + "ldbm_back_delete", "delete (updating " LDBM_PARENTID_STR ") DB_LOCK_DEADLOCK\n"); /* Retry txn */ continue; } if ( retval ) { - LDAPDebug(LDAP_DEBUG_ERR, - "ldbm_back_delete - (deleting %s) failed, err=%d %s\n", + slapi_log_err(SLAPI_LOG_ERR, + "ldbm_back_delete", "(deleting %s) failed, err=%d %s\n", LDBM_PARENTID_STR, retval, (msg = dblayer_strerror( retval )) ? msg : "" ); if (LDBM_OS_ERR_IS_DISKFULL(retval)) disk_full = 1; @@ -934,14 +933,14 @@ ldbm_back_delete( Slapi_PBlock *pb ) #if 0 /* The entryrdn element is already deleted in the index_addordel_entry */ retval = entryrdn_index_entry(be, e, BE_INDEX_DEL, &txn); if (DB_LOCK_DEADLOCK == retval) { - LDAPDebug0Args(LDAP_DEBUG_BACKLDBM, - "ldbm_back_delete - (deleting entryrdn) DB_LOCK_DEADLOCK\n"); + slapi_log_err(SLAPI_LOG_BACKLDBM, + "ldbm_back_delete", "(deleting entryrdn) DB_LOCK_DEADLOCK\n"); /* Retry txn */ continue; } if (0 != retval) { - LDAPDebug2Args(LDAP_DEBUG_ANY, - "ldbm_back_delete - (deleting entryrdn) failed, err=%d %s\n", + slapi_log_err(SLAPI_LOG_ERR, + "ldbm_back_delete", "(deleting entryrdn) failed, err=%d %s\n", retval, (msg = dblayer_strerror( retval )) ? msg : "" ); if (LDBM_OS_ERR_IS_DISKFULL(retval)) disk_full = 1; @@ -952,14 +951,14 @@ ldbm_back_delete( Slapi_PBlock *pb ) #endif retval = entryrdn_index_entry(be, tombstone, BE_INDEX_ADD, &txn); if (DB_LOCK_DEADLOCK == retval) { - LDAPDebug0Args(LDAP_DEBUG_BACKLDBM, - "ldbm_back_delete - (adding tombstone entryrdn) DB_LOCK_DEADLOCK\n"); + slapi_log_err(SLAPI_LOG_BACKLDBM, + "ldbm_back_delete", "(adding tombstone entryrdn) DB_LOCK_DEADLOCK\n"); /* Retry txn */ continue; } if (retval) { - LDAPDebug(LDAP_DEBUG_ERR, - "ldbm_back_delete - (adding tombstone entryrdn %s) failed, err=%d %s\n", + slapi_log_err(SLAPI_LOG_ERR, + "ldbm_back_delete", "(adding tombstone entryrdn %s) failed, err=%d %s\n", slapi_entry_get_dn(tombstone->ep_entry), retval, (msg = dblayer_strerror( retval )) ? msg : "" ); if (LDBM_OS_ERR_IS_DISKFULL(retval)) disk_full = 1; @@ -980,15 +979,15 @@ ldbm_back_delete( Slapi_PBlock *pb ) SLAPI_ATTR_VALUE_TOMBSTONE, e->ep_id, BE_INDEX_DEL|BE_INDEX_EQUALITY, &txn); if (DB_LOCK_DEADLOCK == retval) { - LDAPDebug(LDAP_DEBUG_BACKLDBM, - "ldbm_back_delete - (deleting %s) 0 DB_LOCK_DEADLOCK\n", - SLAPI_ATTR_VALUE_TOMBSTONE, 0, 0 ); + slapi_log_err(SLAPI_LOG_BACKLDBM, + "ldbm_back_delete", "(deleting %s) 0 DB_LOCK_DEADLOCK\n", + SLAPI_ATTR_VALUE_TOMBSTONE); /* Retry txn */ continue; } if (0 != retval) { - LDAPDebug(LDAP_DEBUG_ERR, - "ldbm_back_delete - (deleting %s) failed, err=%d %s\n", + slapi_log_err(SLAPI_LOG_ERR, + "ldbm_back_delete", "(deleting %s) failed, err=%d %s\n", SLAPI_ATTR_VALUE_TOMBSTONE, retval, (msg = dblayer_strerror( retval )) ? msg : "" ); if (LDBM_OS_ERR_IS_DISKFULL(retval)) disk_full = 1; @@ -1004,15 +1003,15 @@ ldbm_back_delete( Slapi_PBlock *pb ) deletion_csn_str, e->ep_id, BE_INDEX_DEL|BE_INDEX_EQUALITY, &txn); if (DB_LOCK_DEADLOCK == retval) { - LDAPDebug(LDAP_DEBUG_BACKLDBM, - "ldbm_back_delete - delete tombstone csn(deleting %s) DB_LOCK_DEADLOCK\n", - deletion_csn_str, 0, 0 ); + slapi_log_err(SLAPI_LOG_BACKLDBM, + "ldbm_back_delete", "delete tombstone csn(deleting %s) DB_LOCK_DEADLOCK\n", + deletion_csn_str); /* Retry txn */ continue; } if (0 != retval) { - LDAPDebug(LDAP_DEBUG_ERR, - "ldbm_back_delete - delete tombsone csn(deleting %s) failed, err=%d %s\n", + slapi_log_err(SLAPI_LOG_ERR, + "ldbm_back_delete", "delete tombsone csn(deleting %s) failed, err=%d %s\n", deletion_csn_str, retval, (msg = dblayer_strerror( retval )) ? msg : "" ); @@ -1028,15 +1027,15 @@ ldbm_back_delete( Slapi_PBlock *pb ) slapi_entry_get_uniqueid(e->ep_entry), e->ep_id, BE_INDEX_DEL|BE_INDEX_EQUALITY, &txn); if (DB_LOCK_DEADLOCK == retval) { - LDAPDebug(LDAP_DEBUG_BACKLDBM, - "ldbm_back_delete - (deleting %s) 1 DB_LOCK_DEADLOCK\n", - SLAPI_ATTR_UNIQUEID, 0, 0 ); + slapi_log_err(SLAPI_LOG_BACKLDBM, + "ldbm_back_delete", "(deleting %s) 1 DB_LOCK_DEADLOCK\n", + SLAPI_ATTR_UNIQUEID); /* Retry txn */ continue; } if (0 != retval) { - LDAPDebug(LDAP_DEBUG_ERR, - "ldbm_back_delete - (deleting %s) failed 1, err=%d %s\n", + slapi_log_err(SLAPI_LOG_ERR, + "ldbm_back_delete", "(deleting %s) failed 1, err=%d %s\n", SLAPI_ATTR_UNIQUEID, retval, (msg = dblayer_strerror( retval )) ? msg : "" ); if (LDBM_OS_ERR_IS_DISKFULL(retval)) disk_full = 1; @@ -1052,15 +1051,15 @@ ldbm_back_delete( Slapi_PBlock *pb ) nscpedn, e->ep_id, BE_INDEX_DEL|BE_INDEX_EQUALITY, &txn); slapi_ch_free((void **)&nscpedn); if (DB_LOCK_DEADLOCK == retval) { - LDAPDebug(LDAP_DEBUG_BACKLDBM, - "ldbm_back_delete - (deleting %s) 2 DB_LOCK_DEADLOCK\n", - SLAPI_ATTR_NSCP_ENTRYDN, 0, 0 ); + slapi_log_err(SLAPI_LOG_BACKLDBM, + "ldbm_back_delete", "(deleting %s) 2 DB_LOCK_DEADLOCK\n", + SLAPI_ATTR_NSCP_ENTRYDN); /* Retry txn */ continue; } if (0 != retval) { - LDAPDebug(LDAP_DEBUG_ERR, - "ldbm_back_delete - (deleting %s) failed 2, err=%d %s\n", + slapi_log_err(SLAPI_LOG_ERR, + "ldbm_back_delete", "(deleting %s) failed 2, err=%d %s\n", SLAPI_ATTR_NSCP_ENTRYDN, retval, (msg = dblayer_strerror( retval )) ? msg : "" ); if (LDBM_OS_ERR_IS_DISKFULL(retval)) disk_full = 1; @@ -1078,15 +1077,15 @@ ldbm_back_delete( Slapi_PBlock *pb ) BE_INDEX_DEL|BE_INDEX_EQUALITY, &txn); slapi_ch_free_string(&entryusn_str); if (DB_LOCK_DEADLOCK == retval) { - LDAPDebug(LDAP_DEBUG_BACKLDBM, - "ldbm_back_delete - (deleting %s) 3 DB_LOCK_DEADLOCK\n", - SLAPI_ATTR_ENTRYUSN, 0, 0 ); + slapi_log_err(SLAPI_LOG_BACKLDBM, + "ldbm_back_delete", "(deleting %s) 3 DB_LOCK_DEADLOCK\n", + SLAPI_ATTR_ENTRYUSN); /* Retry txn */ continue; } if (0 != retval) { - LDAPDebug(LDAP_DEBUG_ERR, - "ldbm_back_delete - (deleting %s) failed 3, err=%d %s\n", + slapi_log_err(SLAPI_LOG_ERR, + "ldbm_back_delete", "(deleting %s) failed 3, err=%d %s\n", SLAPI_ATTR_ENTRYUSN, retval, (msg = dblayer_strerror( retval )) ? msg : "" ); if (LDBM_OS_ERR_IS_DISKFULL(retval)) disk_full = 1; @@ -1099,14 +1098,14 @@ ldbm_back_delete( Slapi_PBlock *pb ) { retval = entryrdn_index_entry(be, e, BE_INDEX_DEL, &txn); if (DB_LOCK_DEADLOCK == retval) { - LDAPDebug0Args(LDAP_DEBUG_BACKLDBM, - "ldbm_back_delete - (deleting entryrdn) DB_LOCK_DEADLOCK\n"); + slapi_log_err(SLAPI_LOG_BACKLDBM, + "ldbm_back_delete", "(deleting entryrdn) DB_LOCK_DEADLOCK\n"); /* Retry txn */ continue; } if (0 != retval) { - LDAPDebug2Args(LDAP_DEBUG_ANY, - "ldbm_back_delete - (deleting entryrdn) failed, err=%d %s\n", + slapi_log_err(SLAPI_LOG_ERR, + "ldbm_back_delete", "(deleting entryrdn) failed, err=%d %s\n", retval, (msg = dblayer_strerror( retval )) ? msg : "" ); if (LDBM_OS_ERR_IS_DISKFULL(retval)) disk_full = 1; @@ -1120,18 +1119,18 @@ ldbm_back_delete( Slapi_PBlock *pb ) if (parent_found) { /* Push out the db modifications from the parent entry */ retval = modify_update_all(be,pb,&parent_modify_c,&txn); - slapi_log_error(SLAPI_LOG_BACKLDBM, "ldbm_back_delete", + slapi_log_err(SLAPI_LOG_BACKLDBM, "ldbm_back_delete", "conn=%lu op=%d modify_update_all: old_entry=0x%p, new_entry=0x%p, rc=%d\n", conn_id, op_id, parent_modify_c.old_entry, parent_modify_c.new_entry, retval); if (DB_LOCK_DEADLOCK == retval) { - LDAPDebug(LDAP_DEBUG_BACKLDBM, "ldbm_back_delete - 4 DEADLOCK\n", 0, 0, 0 ); + slapi_log_err(SLAPI_LOG_BACKLDBM, "ldbm_back_delete", "4 DEADLOCK\n"); /* Retry txn */ continue; } if (0 != retval) { - LDAPDebug(LDAP_DEBUG_ERR, "ldbm_back_delete - 3 BAD, err=%d %s\n", - retval, (msg = dblayer_strerror( retval )) ? msg : "", 0 ); + slapi_log_err(SLAPI_LOG_ERR, "ldbm_back_delete", "3 BAD, err=%d %s\n", + retval, (msg = dblayer_strerror( retval )) ? msg : ""); if (LDBM_OS_ERR_IS_DISKFULL(retval)) disk_full = 1; DEL_SET_ERROR(ldap_result_code, LDAP_OPERATIONS_ERROR, retry_count); @@ -1148,8 +1147,7 @@ ldbm_back_delete( Slapi_PBlock *pb ) if (DB_LOCK_DEADLOCK == retval) { - LDAPDebug(LDAP_DEBUG_BACKLDBM, "ldbm_back_delete - DEADLOCK vlv_update_all_indexes\n", - 0, 0, 0 ); + slapi_log_err(SLAPI_LOG_BACKLDBM, "ldbm_back_delete", "DEADLOCK vlv_update_all_indexes\n"); /* Retry txn */ continue; } @@ -1164,10 +1162,9 @@ ldbm_back_delete( Slapi_PBlock *pb ) if (!is_ruv && !is_fixup_operation && !delete_tombstone_entry && !NO_RUV_UPDATE(li)) { ruv_c_init = ldbm_txn_ruv_modify_context( pb, &ruv_c ); if (-1 == ruv_c_init) { - LDAPDebug(LDAP_DEBUG_ERR, - "ldbm_back_delete - ldbm_txn_ruv_modify_context " - "failed to construct RUV modify context\n", - 0, 0, 0); + slapi_log_err(SLAPI_LOG_ERR, + "ldbm_back_delete", "ldbm_txn_ruv_modify_context " + "failed to construct RUV modify context\n"); ldap_result_code= LDAP_OPERATIONS_ERROR; retval = 0; goto error_return; @@ -1181,9 +1178,9 @@ ldbm_back_delete( Slapi_PBlock *pb ) continue; } if (0 != retval) { - LDAPDebug(LDAP_DEBUG_ERR, - "ldbm_back_delete - modify_update_all failed, err=%d %s\n", retval, - (msg = dblayer_strerror( retval )) ? msg : "", 0 ); + slapi_log_err(SLAPI_LOG_ERR, + "ldbm_back_delete", "modify_update_all failed, err=%d %s\n", retval, + (msg = dblayer_strerror( retval )) ? msg : ""); if (LDBM_OS_ERR_IS_DISKFULL(retval)) disk_full = 1; ldap_result_code= LDAP_OPERATIONS_ERROR; @@ -1197,7 +1194,7 @@ ldbm_back_delete( Slapi_PBlock *pb ) } if (retry_count == RETRY_TIMES) { /* Failed */ - LDAPDebug(LDAP_DEBUG_ERR, "ldbm_back_delete - Retry count exceeded in delete\n", 0, 0, 0 ); + slapi_log_err(SLAPI_LOG_ERR, "ldbm_back_delete", "Retry count exceeded in delete\n"); ldap_result_code= LDAP_BUSY; retval = -1; goto error_return; @@ -1205,7 +1202,7 @@ ldbm_back_delete( Slapi_PBlock *pb ) if (create_tombstone_entry) { retval = cache_replace(&inst->inst_cache, e, tombstone); if (retval) { - LDAPDebug(LDAP_DEBUG_CACHE, "ldbm_back_delete - cache_replace failed (%d): %s --> %s\n", + slapi_log_err(SLAPI_LOG_CACHE, "ldbm_back_delete", "cache_replace failed (%d): %s --> %s\n", retval, slapi_entry_get_dn(e->ep_entry), slapi_entry_get_dn(tombstone->ep_entry)); retval= -1; goto error_return; @@ -1215,13 +1212,13 @@ ldbm_back_delete( Slapi_PBlock *pb ) /* call the transaction post delete plugins just before the commit */ if (!delete_tombstone_entry && plugin_call_plugins(pb, SLAPI_PLUGIN_BE_TXN_POST_DELETE_FN)) { - LDAPDebug0Args(LDAP_DEBUG_TRACE, "ldbm_back_delete - SLAPI_PLUGIN_BE_TXN_POST_DELETE_FN plugin " + slapi_log_err(SLAPI_LOG_TRACE, "ldbm_back_delete", "SLAPI_PLUGIN_BE_TXN_POST_DELETE_FN plugin " "returned error code\n" ); if (!ldap_result_code) { slapi_pblock_get(pb, SLAPI_RESULT_CODE, &ldap_result_code); } if (!ldap_result_code) { - LDAPDebug0Args(LDAP_DEBUG_ANY, "ldbm_back_delete - SLAPI_PLUGIN_BE_TXN_POST_DELETE_FN plugin " + slapi_log_err(SLAPI_LOG_ERR, "ldbm_back_delete", "SLAPI_PLUGIN_BE_TXN_POST_DELETE_FN plugin " "returned error code but did not set SLAPI_RESULT_CODE\n" ); ldap_result_code = LDAP_OPERATIONS_ERROR; slapi_pblock_set(pb, SLAPI_RESULT_CODE, &ldap_result_code); @@ -1294,8 +1291,8 @@ ldbm_back_delete( Slapi_PBlock *pb ) if (ruv_c_init) { if (modify_switch_entries(&ruv_c, be) != 0 ) { ldap_result_code= LDAP_OPERATIONS_ERROR; - LDAPDebug(LDAP_DEBUG_ERR, - "ldbm_back_delete: modify_switch_entries failed\n", 0, 0, 0); + slapi_log_err(SLAPI_LOG_ERR, + "ldbm_back_delete", "modify_switch_entries failed\n"); retval = -1; goto error_return; } @@ -1305,7 +1302,7 @@ ldbm_back_delete( Slapi_PBlock *pb ) { /* Replace the old parent entry with the newly modified one */ myrc = modify_switch_entries( &parent_modify_c,be); - slapi_log_error(SLAPI_LOG_BACKLDBM, "ldbm_back_delete", + slapi_log_err(SLAPI_LOG_BACKLDBM, "ldbm_back_delete", "conn=%lu op=%d modify_switch_entries: old_entry=0x%p, new_entry=0x%p, rc=%d\n", conn_id, op_id, parent_modify_c.old_entry, parent_modify_c.new_entry, myrc); if (myrc == 0) { @@ -1337,7 +1334,7 @@ error_return: } if (retval == DB_RUNRECOVERY) { dblayer_remember_disk_filled(li); - ldbm_nasty("Delete",79,retval); + ldbm_nasty("ldbm_back_delete","Delete",79,retval); disk_full = 1; } @@ -1368,7 +1365,7 @@ error_return: /* call the transaction post delete plugins just before the abort */ if (!delete_tombstone_entry && plugin_call_plugins(pb, SLAPI_PLUGIN_BE_TXN_POST_DELETE_FN)) { - LDAPDebug1Arg(LDAP_DEBUG_TRACE, "ldbm_back_delete - SLAPI_PLUGIN_BE_TXN_POST_DELETE_FN plugin " + slapi_log_err(SLAPI_LOG_TRACE, "ldbm_back_delete", "SLAPI_PLUGIN_BE_TXN_POST_DELETE_FN plugin " "returned error code %d\n", retval ); if (!ldap_result_code) { slapi_pblock_get(pb, SLAPI_RESULT_CODE, &ldap_result_code); @@ -1394,7 +1391,7 @@ error_return: * be written to disk. */ myrc = modify_unswitch_entries(&parent_modify_c, be); - slapi_log_error(SLAPI_LOG_BACKLDBM, "ldbm_back_delete", + slapi_log_err(SLAPI_LOG_BACKLDBM, "ldbm_back_delete", "conn=%lu op=%d modify_unswitch_entries: old_entry=0x%p, new_entry=0x%p, rc=%d\n", conn_id, op_id, parent_modify_c.old_entry, parent_modify_c.new_entry, myrc); } @@ -1418,7 +1415,7 @@ common_return: bdn = backdn_init(tombstonesdn, tombstone->ep_id, 0); if (bdn) { CACHE_ADD( &inst->inst_dncache, bdn, NULL ); - slapi_log_error(SLAPI_LOG_CACHE, "ldbm_back_delete", + slapi_log_err(SLAPI_LOG_CACHE, "ldbm_back_delete", "set %s to dn cache\n", slapi_sdn_get_dn(tombstonesdn)); CACHE_RETURN(&inst->inst_dncache, &bdn); } @@ -1472,7 +1469,7 @@ diskfull_return: slapi_send_ldap_result( pb, ldap_result_code, NULL, ldap_result_message, 0, NULL ); } } - slapi_log_error(SLAPI_LOG_BACKLDBM, "ldbm_back_delete", + slapi_log_err(SLAPI_LOG_BACKLDBM, "ldbm_back_delete", "conn=%lu op=%d modify_term: old_entry=0x%p, new_entry=0x%p, in_cache=%d\n", conn_id, op_id, parent_modify_c.old_entry, parent_modify_c.new_entry, cache_is_in_cache(&inst->inst_cache, parent_modify_c.new_entry)); @@ -1500,7 +1497,7 @@ diskfull_return: slapi_sdn_done(&parentsdn); if (pb->pb_conn) { - slapi_log_error(SLAPI_LOG_TRACE, "ldbm_back_delete", "leave conn=%" NSPRIu64 " op=%d\n", + slapi_log_err(SLAPI_LOG_TRACE, "ldbm_back_delete", "leave conn=%" NSPRIu64 " op=%d\n", pb->pb_conn->c_connid, operation->o_opid); } diff --git a/ldap/servers/slapd/back-ldbm/ldbm_entryrdn.c b/ldap/servers/slapd/back-ldbm/ldbm_entryrdn.c index 35b2849..ad33efa 100644 --- a/ldap/servers/slapd/back-ldbm/ldbm_entryrdn.c +++ b/ldap/servers/slapd/back-ldbm/ldbm_entryrdn.c @@ -25,7 +25,7 @@ static int entryrdn_noancestorid = 0; #ifdef ENTRYRDN_DEBUG #define ASSERT(_x) do { \ if (!(_x)) { \ - LDAPDebug(LDAP_DEBUG_DEBUG, "ldbm_entryrdn ASSERT - BAD ASSERTION at %s/%d: %s\n", \ + slapi_log_err(SLAPI_LOG_DEBUG, "ldbm_entryrdn ASSERT - BAD ASSERTION at %s/%d: %s\n", \ __FILE__, __LINE__, #_x); \ *(char *)0L = 23; \ } \ @@ -203,17 +203,17 @@ entryrdn_index_entry(backend *be, Slapi_RDN *srdn = NULL; int db_retry = 0; - slapi_log_error(SLAPI_LOG_TRACE, "entryrdn_index_entry", + slapi_log_err(SLAPI_LOG_TRACE, "entryrdn_index_entry", "--> entryrdn_index_entry\n"); if (NULL == be || NULL == e) { - slapi_log_error(SLAPI_LOG_ERR, "entryrdn_index_entry", + slapi_log_err(SLAPI_LOG_ERR, "entryrdn_index_entry", "Param error: Empty %s\n", NULL==be?"backend":NULL==e?"entry":"unknown"); return rc; } /* Open the entryrdn index */ rc = _entryrdn_open_index(be, &ai, &db); if (rc || (NULL == db)) { - slapi_log_error(SLAPI_LOG_ERR, "entryrdn_index_entry", + slapi_log_err(SLAPI_LOG_ERR, "entryrdn_index_entry", "Opening the index failed: %s(%d)\n", rc<0?dblayer_strerror(rc):"Invalid parameter", rc); return rc; @@ -223,18 +223,18 @@ entryrdn_index_entry(backend *be, if (NULL == slapi_rdn_get_rdn(srdn)) { sdn = slapi_entry_get_sdn_const(e->ep_entry); if (NULL == sdn) { - slapi_log_error(SLAPI_LOG_ERR, "entryrdn_index_entry", + slapi_log_err(SLAPI_LOG_ERR, "entryrdn_index_entry", "Empty dn\n"); goto bail; } rc = slapi_rdn_init_all_sdn(srdn, sdn); if (rc < 0) { - slapi_log_error(SLAPI_LOG_ERR, "entryrdn_index_entry", + slapi_log_err(SLAPI_LOG_ERR, "entryrdn_index_entry", "Failed to convert %s to Slapi_RDN\n", slapi_sdn_get_dn(sdn)); rc = LDAP_INVALID_DN_SYNTAX; goto bail; } else if (rc > 0) { - slapi_log_error(SLAPI_LOG_TRACE, "entryrdn_index_entry", + slapi_log_err(SLAPI_LOG_TRACE, "entryrdn_index_entry", "%s does not belong to the db\n", slapi_sdn_get_dn(sdn)); rc = DB_NOTFOUND; goto bail; @@ -245,7 +245,7 @@ entryrdn_index_entry(backend *be, for (db_retry = 0; db_retry < RETRY_TIMES; db_retry++) { rc = db->cursor(db, db_txn, &cursor, 0); if (rc) { - slapi_log_error(ENTRYRDN_LOGLEVEL(rc), "entryrdn_index_entry", + slapi_log_err(ENTRYRDN_LOGLEVEL(rc), "entryrdn_index_entry", "Failed to make a cursor: %s(%d)\n", dblayer_strerror(rc), rc); if ((DB_LOCK_DEADLOCK == rc) && !db_txn) { ENTRYRDN_DELAY; @@ -258,7 +258,7 @@ entryrdn_index_entry(backend *be, } } if (RETRY_TIMES == db_retry) { - slapi_log_error(SLAPI_LOG_ERR, "entryrdn_index_entry", + slapi_log_err(SLAPI_LOG_ERR, "entryrdn_index_entry", "Cursor open failed after [%d] retries\n", db_retry); rc = DB_LOCK_DEADLOCK; goto bail; @@ -279,7 +279,7 @@ bail: for (db_retry = 0; db_retry < RETRY_TIMES; db_retry++) { int myrc = cursor->c_close(cursor); if (0 != myrc) { - slapi_log_error(ENTRYRDN_LOGLEVEL(myrc), "entryrdn_index_entry", + slapi_log_err(ENTRYRDN_LOGLEVEL(myrc), "entryrdn_index_entry", "Failed to close cursor: %s(%d)\n", dblayer_strerror(myrc), myrc); if ((DB_LOCK_DEADLOCK == myrc) && !db_txn) { @@ -297,7 +297,7 @@ bail: } } if (RETRY_TIMES == db_retry) { - slapi_log_error(SLAPI_LOG_ERR, "entryrdn_index_entry", + slapi_log_err(SLAPI_LOG_ERR, "entryrdn_index_entry", "Cursor close failed after [%d] retries\n", db_retry); rc = DB_LOCK_DEADLOCK; } @@ -306,7 +306,7 @@ bail: dblayer_release_index_file(be, ai, db); } - slapi_log_error(SLAPI_LOG_TRACE, "entryrdn_index_entry", + slapi_log_err(SLAPI_LOG_TRACE, "entryrdn_index_entry", "<-- entryrdn_index_entry\n"); return rc; } @@ -345,11 +345,11 @@ entryrdn_index_read_ext(backend *be, rdn_elem *elem = NULL; int db_retry = 0; - slapi_log_error(SLAPI_LOG_TRACE, "entryrdn_index_read", + slapi_log_err(SLAPI_LOG_TRACE, "entryrdn_index_read", "--> entryrdn_index_read\n"); if (NULL == be || NULL == sdn || NULL == id) { - slapi_log_error(SLAPI_LOG_ERR, "entryrdn_index_read_ext", + slapi_log_err(SLAPI_LOG_ERR, "entryrdn_index_read_ext", "Param error: Empty %s\n", NULL==be?"backend":NULL==sdn?"DN": NULL==id?"id container":"unknown"); @@ -360,13 +360,13 @@ entryrdn_index_read_ext(backend *be, rc = slapi_rdn_init_all_sdn(&srdn, sdn); if (rc < 0) { - slapi_log_error(SLAPI_LOG_BACKLDBM, "entryrdn_index_read_ext", + slapi_log_err(SLAPI_LOG_BACKLDBM, "entryrdn_index_read_ext", "Param error: Failed to convert %s to Slapi_RDN\n", slapi_sdn_get_dn(sdn)); rc = LDAP_INVALID_DN_SYNTAX; goto bail; } else if (rc > 0) { - slapi_log_error(SLAPI_LOG_TRACE, "entryrdn_index_read_ext", + slapi_log_err(SLAPI_LOG_TRACE, "entryrdn_index_read_ext", "%s does not belong to the db\n", slapi_sdn_get_dn(sdn)); rc = DB_NOTFOUND; goto bail; @@ -375,7 +375,7 @@ entryrdn_index_read_ext(backend *be, /* Open the entryrdn index */ rc = _entryrdn_open_index(be, &ai, &db); if (rc || (NULL == db)) { - slapi_log_error(SLAPI_LOG_ERR, "entryrdn_index_read_ext", + slapi_log_err(SLAPI_LOG_ERR, "entryrdn_index_read_ext", "Opening the index failed: %s(%d)\n", rc<0?dblayer_strerror(rc):"Invalid parameter", rc); db = NULL; @@ -386,7 +386,7 @@ entryrdn_index_read_ext(backend *be, for (db_retry = 0; db_retry < RETRY_TIMES; db_retry++) { rc = db->cursor(db, db_txn, &cursor, 0); if (rc) { - slapi_log_error(ENTRYRDN_LOGLEVEL(rc), "entryrdn_index_read_ext", + slapi_log_err(ENTRYRDN_LOGLEVEL(rc), "entryrdn_index_read_ext", "Failed to make a cursor: %s(%d)\n", dblayer_strerror(rc), rc); if ((DB_LOCK_DEADLOCK == rc) && !db_txn) { ENTRYRDN_DELAY; @@ -399,7 +399,7 @@ entryrdn_index_read_ext(backend *be, } } if (RETRY_TIMES == db_retry) { - slapi_log_error(SLAPI_LOG_ERR, "entryrdn_index_read_ext", + slapi_log_err(SLAPI_LOG_ERR, "entryrdn_index_read_ext", "Failed to make a cursor after [%d] retries\n", db_retry); rc = DB_LOCK_DEADLOCK; goto bail; @@ -418,7 +418,7 @@ bail: for (db_retry = 0; db_retry < RETRY_TIMES; db_retry++) { int myrc = cursor->c_close(cursor); if (0 != myrc) { - slapi_log_error(ENTRYRDN_LOGLEVEL(myrc), "entryrdn_index_read_ext", + slapi_log_err(ENTRYRDN_LOGLEVEL(myrc), "entryrdn_index_read_ext", "Failed to close cursor: %s(%d)\n", dblayer_strerror(myrc), myrc); if ((DB_LOCK_DEADLOCK == myrc) && !db_txn) { ENTRYRDN_DELAY; @@ -435,7 +435,7 @@ bail: } } if (RETRY_TIMES == db_retry) { - slapi_log_error(SLAPI_LOG_ERR, "entryrdn_index_read_ext", + slapi_log_err(SLAPI_LOG_ERR, "entryrdn_index_read_ext", "Failed to close cursor after [%d] retries\n", db_retry); rc = rc ? rc : DB_LOCK_DEADLOCK; } @@ -445,7 +445,7 @@ bail: } slapi_rdn_done(&srdn); slapi_ch_free((void **)&elem); - slapi_log_error(SLAPI_LOG_TRACE, "entryrdn_index_read", + slapi_log_err(SLAPI_LOG_TRACE, "entryrdn_index_read", "<-- entryrdn_index_read\n"); return rc; } @@ -499,11 +499,11 @@ entryrdn_rename_subtree(backend *be, ID targetid = 0; int db_retry = 0; - slapi_log_error(SLAPI_LOG_TRACE, "entryrdn_rename_subtree", + slapi_log_err(SLAPI_LOG_TRACE, "entryrdn_rename_subtree", "--> entryrdn_rename_subtree\n"); if (NULL == be || NULL == oldsdn || 0 == id) { - slapi_log_error(SLAPI_LOG_ERR, "entryrdn_rename_subtree", + slapi_log_err(SLAPI_LOG_ERR, "entryrdn_rename_subtree", "Param error: Empty %s\n", NULL==be?"backend":NULL==oldsdn?"old dn": (NULL==newsrdn&&NULL==newsupsdn)?"new dn and new superior": @@ -513,13 +513,13 @@ entryrdn_rename_subtree(backend *be, rc = slapi_rdn_init_all_sdn_ext(&oldsrdn, oldsdn, flags); if (rc < 0) { - slapi_log_error(SLAPI_LOG_ERR, "entryrdn_rename_subtree", + slapi_log_err(SLAPI_LOG_ERR, "entryrdn_rename_subtree", "Failed to convert olddn \"%s\" to Slapi_RDN\n", slapi_sdn_get_dn(oldsdn)); rc = LDAP_INVALID_DN_SYNTAX; goto bail; } else if (rc > 0) { - slapi_log_error(SLAPI_LOG_TRACE, "entryrdn_rename_subtree", + slapi_log_err(SLAPI_LOG_TRACE, "entryrdn_rename_subtree", "%s does not belong to the db\n", slapi_sdn_get_dn(oldsdn)); rc = DB_NOTFOUND; goto bail; @@ -541,7 +541,7 @@ entryrdn_rename_subtree(backend *be, } if (NULL == mynewsrdn && NULL == mynewsupsdn) { /* E.g., rename dn: cn=ABC DEF,... --> cn=ABC DEF,... */ - slapi_log_error(SLAPI_LOG_BACKLDBM, "entryrdn_rename_subtree", + slapi_log_err(SLAPI_LOG_BACKLDBM, "entryrdn_rename_subtree", "No new superior is given " "and new rdn %s is identical to the original\n", slapi_rdn_get_rdn(&oldsrdn)); @@ -551,17 +551,17 @@ entryrdn_rename_subtree(backend *be, /* Checking the contents of oldsrdn */ rdnidx = slapi_rdn_get_last_ext(&oldsrdn, &nrdn, FLAG_ALL_NRDNS); if (rdnidx < 0 || NULL == nrdn) { - slapi_log_error(SLAPI_LOG_ERR, "entryrdn_rename_subtree", + slapi_log_err(SLAPI_LOG_ERR, "entryrdn_rename_subtree", "Empty RDN\n"); goto bail; } else if (0 == rdnidx) { if (mynewsupsdn) { - slapi_log_error(SLAPI_LOG_ERR, "entryrdn_rename_subtree", + slapi_log_err(SLAPI_LOG_ERR, "entryrdn_rename_subtree", "Moving suffix \"%s\" is not alloweds\n", nrdn); goto bail; } else { /* newsupsdn == NULL, so newsrdn is not */ - slapi_log_error(SLAPI_LOG_BACKLDBM, "entryrdn_rename_subtree", + slapi_log_err(SLAPI_LOG_BACKLDBM, "entryrdn_rename_subtree", "Renaming suffix %s to %s\n", nrdn, slapi_rdn_get_nrdn((Slapi_RDN *)mynewsrdn)); } @@ -570,7 +570,7 @@ entryrdn_rename_subtree(backend *be, /* Open the entryrdn index */ rc = _entryrdn_open_index(be, &ai, &db); if (rc || (NULL == db)) { - slapi_log_error(SLAPI_LOG_ERR, "entryrdn_rename_subtree", + slapi_log_err(SLAPI_LOG_ERR, "entryrdn_rename_subtree", "Opening the index failed: %s(%d)\n", rc<0?dblayer_strerror(rc):"Invalid parameter", rc); db = NULL; @@ -581,7 +581,7 @@ entryrdn_rename_subtree(backend *be, for (db_retry = 0; db_retry < RETRY_TIMES; db_retry++) { rc = db->cursor(db, db_txn, &cursor, 0); if (rc) { - slapi_log_error(ENTRYRDN_LOGLEVEL(rc), "entryrdn_rename_subtree", + slapi_log_err(ENTRYRDN_LOGLEVEL(rc), "entryrdn_rename_subtree", "Failed to make a cursor: %s(%d)\n", dblayer_strerror(rc), rc); if ((DB_LOCK_DEADLOCK == rc) && !db_txn) { ENTRYRDN_DELAY; @@ -594,7 +594,7 @@ entryrdn_rename_subtree(backend *be, } } if (RETRY_TIMES == db_retry) { - slapi_log_error(SLAPI_LOG_ERR, "entryrdn_rename_subtree", + slapi_log_err(SLAPI_LOG_ERR, "entryrdn_rename_subtree", "Create cursor failed after [%d] retries\n", db_retry); rc = DB_LOCK_DEADLOCK; @@ -605,7 +605,7 @@ entryrdn_rename_subtree(backend *be, if (mynewsrdn) { newelem = _entryrdn_new_rdn_elem(be, id, mynewsrdn, &newelemlen); if (NULL == newelem) { - slapi_log_error(SLAPI_LOG_ERR, "entryrdn_rename_subtree", + slapi_log_err(SLAPI_LOG_ERR, "entryrdn_rename_subtree", "Failed to generate a new elem: id: %d, rdn: %s\n", id, slapi_rdn_get_rdn(mynewsrdn)); goto bail; @@ -616,13 +616,13 @@ entryrdn_rename_subtree(backend *be, if (mynewsupsdn) { rc = slapi_rdn_init_all_sdn(&newsupsrdn, mynewsupsdn); if (rc < 0) { - slapi_log_error(SLAPI_LOG_ERR, "entryrdn_rename_subtree", + slapi_log_err(SLAPI_LOG_ERR, "entryrdn_rename_subtree", "Failed to convert new superior \"%s\" to Slapi_RDN\n", slapi_sdn_get_dn(mynewsupsdn)); rc = LDAP_INVALID_DN_SYNTAX; goto bail; } else if (rc > 0) { - slapi_log_error(SLAPI_LOG_BACKLDBM, "entryrdn_rename_subtree", + slapi_log_err(SLAPI_LOG_BACKLDBM, "entryrdn_rename_subtree", "%s does not belong to the db\n", slapi_sdn_get_dn(mynewsupsdn)); rc = DB_NOTFOUND; goto bail; @@ -631,7 +631,7 @@ entryrdn_rename_subtree(backend *be, rc = _entryrdn_index_read(be, cursor, &newsupsrdn, &newsupelem, NULL, NULL, 0/*flags*/, db_txn); if (rc) { - slapi_log_error(SLAPI_LOG_ERR, "entryrdn_rename_subtree", + slapi_log_err(SLAPI_LOG_ERR, "entryrdn_rename_subtree", "Failed to read the element of new superior \"%s\" (%d)\n", slapi_sdn_get_dn(mynewsupsdn), rc); goto bail; @@ -647,7 +647,7 @@ entryrdn_rename_subtree(backend *be, &oldsupelem, NULL, 0/*flags*/, db_txn); } if (rc || NULL == targetelem) { - slapi_log_error(SLAPI_LOG_ERR, "entryrdn_rename_subtree", + slapi_log_err(SLAPI_LOG_ERR, "entryrdn_rename_subtree", "Failed to read the target element \"%s\" (%d)\n", slapi_sdn_get_dn(oldsdn), rc); goto bail; @@ -708,7 +708,7 @@ entryrdn_rename_subtree(backend *be, renamedata.flags = DB_DBT_USERMEM; rc = _entryrdn_put_data(cursor, &key, &renamedata, RDN_INDEX_SELF, db_txn); if (rc && (DB_KEYEXIST != rc)) { /* failed && ignore already exists */ - slapi_log_error(ENTRYRDN_LOGLEVEL(rc), "entryrdn_rename_subtree", + slapi_log_err(ENTRYRDN_LOGLEVEL(rc), "entryrdn_rename_subtree", "Adding %s failed; %s(%d)\n", keybuf, dblayer_strerror(rc), rc); goto bail; } @@ -773,7 +773,7 @@ entryrdn_rename_subtree(backend *be, } rc = _entryrdn_put_data(cursor, &key, &renamedata, RDN_INDEX_PARENT, db_txn); if (rc && (DB_KEYEXIST != rc)) { /* failed && ignore already exists */ - slapi_log_error(ENTRYRDN_LOGLEVEL(rc), "entryrdn_rename_subtree", + slapi_log_err(ENTRYRDN_LOGLEVEL(rc), "entryrdn_rename_subtree", "Adding %s failed; %s(%d)\n", keybuf, dblayer_strerror(rc), rc); goto bail; } @@ -806,7 +806,7 @@ entryrdn_rename_subtree(backend *be, renamedata.flags = DB_DBT_USERMEM; rc = _entryrdn_put_data(cursor, &key, &renamedata, RDN_INDEX_SELF, db_txn); if (rc && (DB_KEYEXIST != rc)) { /* failed && ignore already exists */ - slapi_log_error(ENTRYRDN_LOGLEVEL(rc), "entryrdn_rename_subtree", + slapi_log_err(ENTRYRDN_LOGLEVEL(rc), "entryrdn_rename_subtree", "Adding %s failed; %s(%d)\n", keybuf, dblayer_strerror(rc), rc); goto bail; } @@ -883,7 +883,7 @@ bail: for (db_retry = 0; db_retry < RETRY_TIMES; db_retry++) { int myrc = cursor->c_close(cursor); if (0 != myrc) { - slapi_log_error(ENTRYRDN_LOGLEVEL(myrc), "entryrdn_rename_subtree", + slapi_log_err(ENTRYRDN_LOGLEVEL(myrc), "entryrdn_rename_subtree", "Failed to close cursor: %s(%d)\n", dblayer_strerror(myrc), myrc); if ((DB_LOCK_DEADLOCK == myrc) && !db_txn) { ENTRYRDN_DELAY; @@ -900,7 +900,7 @@ bail: } } if (RETRY_TIMES == db_retry) { - slapi_log_error(SLAPI_LOG_ERR, "entryrdn_rename_subtree", + slapi_log_err(SLAPI_LOG_ERR, "entryrdn_rename_subtree", "Failed to close cursor after [%d] retries.\n", db_retry); rc = rc ? rc : DB_LOCK_DEADLOCK; } @@ -908,7 +908,7 @@ bail: if (db) { dblayer_release_index_file(be, ai, db); } - slapi_log_error(SLAPI_LOG_TRACE, "entryrdn_rename_subtree", + slapi_log_err(SLAPI_LOG_TRACE, "entryrdn_rename_subtree", "<-- entryrdn_rename_subtree\n"); return rc; } @@ -939,11 +939,11 @@ entryrdn_get_subordinates(backend *be, rdn_elem **cep = NULL; int db_retry = 0; - slapi_log_error(SLAPI_LOG_TRACE, "entryrdn_get_subordinates", + slapi_log_err(SLAPI_LOG_TRACE, "entryrdn_get_subordinates", "--> entryrdn_get_subordinates\n"); if (NULL == be || NULL == sdn || 0 == id) { - slapi_log_error(SLAPI_LOG_ERR, "entryrdn_get_subordinates", + slapi_log_err(SLAPI_LOG_ERR, "entryrdn_get_subordinates", "Param error: Empty %s\n", NULL==be?"backend":NULL==sdn?"dn":0==id?"id":"unknown"); goto bail; @@ -958,11 +958,11 @@ entryrdn_get_subordinates(backend *be, rc = slapi_rdn_init_all_sdn_ext(&srdn, sdn, flags); if (rc) { if (rc < 0) { - slapi_log_error(SLAPI_LOG_ERR, "entryrdn_get_subordinates", + slapi_log_err(SLAPI_LOG_ERR, "entryrdn_get_subordinates", "Failed to convert \"%s\" to Slapi_RDN\n", slapi_sdn_get_dn(sdn)); rc = LDAP_INVALID_DN_SYNTAX; } else if (rc > 0) { - slapi_log_error(SLAPI_LOG_TRACE, "entryrdn_get_subordinates", + slapi_log_err(SLAPI_LOG_TRACE, "entryrdn_get_subordinates", "%s does not belong to the db\n", slapi_sdn_get_dn(sdn)); rc = DB_NOTFOUND; } @@ -972,7 +972,7 @@ entryrdn_get_subordinates(backend *be, /* check the given dn/srdn */ rdnidx = slapi_rdn_get_last_ext(&srdn, &nrdn, FLAG_ALL_NRDNS); if (rdnidx < 0 || NULL == nrdn) { - slapi_log_error(SLAPI_LOG_ERR, "entryrdn_get_subordinates", + slapi_log_err(SLAPI_LOG_ERR, "entryrdn_get_subordinates", "Empty RDN\n"); goto bail; } @@ -980,7 +980,7 @@ entryrdn_get_subordinates(backend *be, /* Open the entryrdn index */ rc = _entryrdn_open_index(be, &ai, &db); if (rc || (NULL == db)) { - slapi_log_error(SLAPI_LOG_ERR, "entryrdn_get_subordinates", + slapi_log_err(SLAPI_LOG_ERR, "entryrdn_get_subordinates", "Opening the index failed: %s(%d)\n", rc<0?dblayer_strerror(rc):"Invalid parameter", rc); db = NULL; @@ -991,7 +991,7 @@ entryrdn_get_subordinates(backend *be, for (db_retry = 0; db_retry < RETRY_TIMES; db_retry++) { rc = db->cursor(db, db_txn, &cursor, 0); if (rc) { - slapi_log_error(ENTRYRDN_LOGLEVEL(rc), "entryrdn_get_subordinates", + slapi_log_err(ENTRYRDN_LOGLEVEL(rc), "entryrdn_get_subordinates", "Failed to make a cursor: %s(%d)\n", dblayer_strerror(rc), rc); if ((DB_LOCK_DEADLOCK == rc) && !db_txn) { ENTRYRDN_DELAY; @@ -1004,7 +1004,7 @@ entryrdn_get_subordinates(backend *be, } } if (RETRY_TIMES == db_retry) { - slapi_log_error(SLAPI_LOG_ERR, "entryrdn_get_subordinates", + slapi_log_err(SLAPI_LOG_ERR, "entryrdn_get_subordinates", "Failed to make a cursor after [%d] retries\n", db_retry); rc = DB_LOCK_DEADLOCK; goto bail; @@ -1021,7 +1021,7 @@ entryrdn_get_subordinates(backend *be, /* set direct children to the idlist */ rc = idl_append_extend(subordinates, childid); if (rc) { - slapi_log_error(SLAPI_LOG_ERR, "entryrdn_get_subordinates", + slapi_log_err(SLAPI_LOG_ERR, "entryrdn_get_subordinates", "Appending %d to idl for direct children failed (%d)\n", childid, rc); goto bail; @@ -1031,7 +1031,7 @@ entryrdn_get_subordinates(backend *be, rc = _entryrdn_append_childidl(cursor, (*cep)->rdn_elem_nrdn_rdn, childid, subordinates, db_txn); if (rc) { - slapi_log_error(SLAPI_LOG_ERR, "entryrdn_get_subordinates", + slapi_log_err(SLAPI_LOG_ERR, "entryrdn_get_subordinates", "Appending %d to idl for indirect children failed (%d)\n", childid, rc); goto bail; @@ -1057,7 +1057,7 @@ bail: for (db_retry = 0; db_retry < RETRY_TIMES; db_retry++) { int myrc = cursor->c_close(cursor); if (0 != myrc) { - slapi_log_error(ENTRYRDN_LOGLEVEL(myrc), "entryrdn_get_subordinates", + slapi_log_err(ENTRYRDN_LOGLEVEL(myrc), "entryrdn_get_subordinates", "Failed to close cursor: %s(%d)\n", dblayer_strerror(myrc), myrc); if ((DB_LOCK_DEADLOCK == myrc) && !db_txn) { ENTRYRDN_DELAY; @@ -1074,7 +1074,7 @@ bail: } } if (RETRY_TIMES == db_retry) { - slapi_log_error(SLAPI_LOG_ERR, "entryrdn_get_subordinates", + slapi_log_err(SLAPI_LOG_ERR, "entryrdn_get_subordinates", "Failed to close cursor after [%d] retries\n", db_retry); rc = rc ? rc : DB_LOCK_DEADLOCK; goto bail; @@ -1084,7 +1084,7 @@ bail: if (db) { dblayer_release_index_file(be, ai, db); } - slapi_log_error(SLAPI_LOG_TRACE, "entryrdn_get_subordinates", + slapi_log_err(SLAPI_LOG_TRACE, "entryrdn_get_subordinates", "<-- entryrdn_get_subordinates\n"); return rc; } @@ -1119,11 +1119,11 @@ entryrdn_lookup_dn(backend *be, int maybesuffix = 0; int db_retry = 0; - slapi_log_error(SLAPI_LOG_TRACE, "entryrdn_lookup_dn", + slapi_log_err(SLAPI_LOG_TRACE, "entryrdn_lookup_dn", "--> entryrdn_lookup_dn\n"); if (NULL == be || NULL == rdn || 0 == id || NULL == dn) { - slapi_log_error(SLAPI_LOG_ERR, "entryrdn_lookup_dn", + slapi_log_err(SLAPI_LOG_ERR, "entryrdn_lookup_dn", "Param error: Empty %s\n", NULL==be?"backend":NULL==rdn?"rdn":0==id?"id": NULL==dn?"dn container":"unknown"); @@ -1135,7 +1135,7 @@ entryrdn_lookup_dn(backend *be, /* Open the entryrdn index */ rc = _entryrdn_open_index(be, &ai, &db); if (rc || (NULL == db)) { - slapi_log_error(SLAPI_LOG_ERR, "entryrdn_lookup_dn", + slapi_log_err(SLAPI_LOG_ERR, "entryrdn_lookup_dn", "Opening the index failed: %s(%d)\n", rc<0?dblayer_strerror(rc):"Invalid parameter", rc); return rc; @@ -1146,7 +1146,7 @@ entryrdn_lookup_dn(backend *be, for (db_retry = 0; db_retry < RETRY_TIMES; db_retry++) { rc = db->cursor(db, db_txn, &cursor, 0); if (rc) { - slapi_log_error(ENTRYRDN_LOGLEVEL(rc), "entryrdn_lookup_dn", + slapi_log_err(ENTRYRDN_LOGLEVEL(rc), "entryrdn_lookup_dn", "Failed to make a cursor: %s(%d)\n", dblayer_strerror(rc), rc); if (DB_LOCK_DEADLOCK == rc) { #ifdef FIX_TXN_DEADLOCKS @@ -1165,7 +1165,7 @@ entryrdn_lookup_dn(backend *be, orignrdn = slapi_ch_strdup(rdn); rc = slapi_dn_normalize_case_ext(orignrdn, 0, &nrdn, &nrdn_len); if (rc < 0) { - slapi_log_error(SLAPI_LOG_ERR, "entryrdn_lookup_dn", + slapi_log_err(SLAPI_LOG_ERR, "entryrdn_lookup_dn", "Failed to normalize %s\n", rdn); goto bail; } @@ -1192,12 +1192,12 @@ retry_get0: if (rc) { if (DB_LOCK_DEADLOCK == rc) { if (db_txn) { - slapi_log_error(ENTRYRDN_LOGLEVEL(rc), "entryrdn_lookup_dn", + slapi_log_err(ENTRYRDN_LOGLEVEL(rc), "entryrdn_lookup_dn", "Cursor got deadlock while under txn -> failure\n"); goto bail; } else { /* try again */ - slapi_log_error(ENTRYRDN_LOGLEVEL(rc), "entryrdn_lookup_dn", + slapi_log_err(ENTRYRDN_LOGLEVEL(rc), "entryrdn_lookup_dn", "Cursor deadlocked, trying again.\n"); goto retry_get0; } @@ -1213,11 +1213,11 @@ retry_get1: if (rc) { if (DB_LOCK_DEADLOCK == rc) { if (db_txn) { - slapi_log_error(ENTRYRDN_LOGLEVEL(rc), "entryrdn_lookup_dn", + slapi_log_err(ENTRYRDN_LOGLEVEL(rc), "entryrdn_lookup_dn", "Cursor get deadlock while under txn -> failure\n"); } else { /* try again */ - slapi_log_error(ENTRYRDN_LOGLEVEL(rc), "entryrdn_lookup_dn", + slapi_log_err(ENTRYRDN_LOGLEVEL(rc), "entryrdn_lookup_dn", "Cursor deadlockrf, trying again.\n"); goto retry_get1; } @@ -1268,7 +1268,7 @@ bail: for (db_retry = 0; db_retry < RETRY_TIMES; db_retry++) { int myrc = cursor->c_close(cursor); if (0 != myrc) { - slapi_log_error(ENTRYRDN_LOGLEVEL(myrc), "entryrdn_lookup_dn", + slapi_log_err(ENTRYRDN_LOGLEVEL(myrc), "entryrdn_lookup_dn", "Failed to close cursor: %s(%d)\n", dblayer_strerror(myrc), myrc); if (DB_LOCK_DEADLOCK == myrc) { #ifdef FIX_TXN_DEADLOCKS @@ -1297,7 +1297,7 @@ bail: } slapi_ch_free_string(&nrdn); slapi_ch_free_string(&keybuf); - slapi_log_error(SLAPI_LOG_TRACE, "entryrdn_lookup_dn", + slapi_log_err(SLAPI_LOG_TRACE, "entryrdn_lookup_dn", "<-- entryrdn_lookup_dn\n"); return rc; } @@ -1331,14 +1331,14 @@ entryrdn_get_parent(backend *be, rdn_elem *elem = NULL; int db_retry = 0; - slapi_log_error(SLAPI_LOG_TRACE, "entryrdn_get_parent", + slapi_log_err(SLAPI_LOG_TRACE, "entryrdn_get_parent", "--> entryrdn_get_parent\n"); /* Initialize data */ memset(&data, 0, sizeof(data)); if (NULL == be || NULL == rdn || 0 == id || NULL == prdn || NULL == pid) { - slapi_log_error(SLAPI_LOG_ERR, "entryrdn_get_parent", + slapi_log_err(SLAPI_LOG_ERR, "entryrdn_get_parent", "Param error: Empty %s\n", NULL==be?"backend":NULL==rdn?"rdn":0==id?"id": NULL==rdn?"rdn container": @@ -1351,7 +1351,7 @@ entryrdn_get_parent(backend *be, /* Open the entryrdn index */ rc = _entryrdn_open_index(be, &ai, &db); if (rc || (NULL == db)) { - slapi_log_error(SLAPI_LOG_ERR, "entryrdn_get_parent", + slapi_log_err(SLAPI_LOG_ERR, "entryrdn_get_parent", "Opening the index failed: %s(%d)\n", rc<0?dblayer_strerror(rc):"Invalid parameter", rc); return rc; @@ -1361,7 +1361,7 @@ entryrdn_get_parent(backend *be, for (db_retry = 0; db_retry < RETRY_TIMES; db_retry++) { rc = db->cursor(db, db_txn, &cursor, 0); if (rc) { - slapi_log_error(ENTRYRDN_LOGLEVEL(rc), "entryrdn_get_parent", + slapi_log_err(ENTRYRDN_LOGLEVEL(rc), "entryrdn_get_parent", "Failed to make a cursor: %s(%d)\n", dblayer_strerror(rc), rc); if (DB_LOCK_DEADLOCK == rc) { #ifdef FIX_TXN_DEADLOCKS @@ -1379,7 +1379,7 @@ entryrdn_get_parent(backend *be, orignrdn = slapi_ch_strdup(rdn); rc = slapi_dn_normalize_case_ext(orignrdn, 0, &nrdn, &nrdn_len); if (rc < 0) { - slapi_log_error(SLAPI_LOG_ERR, "entryrdn_get_parent", + slapi_log_err(SLAPI_LOG_ERR, "entryrdn_get_parent", "Failed to normalize %s\n", rdn); goto bail; } @@ -1404,10 +1404,10 @@ retry_get0: if (rc) { if (DB_LOCK_DEADLOCK == rc) { if (db_txn) { - slapi_log_error(ENTRYRDN_LOGLEVEL(rc), "entryrdn_get_parent", + slapi_log_err(ENTRYRDN_LOGLEVEL(rc), "entryrdn_get_parent", "Cursor get deadlock while under txn -> failure\n"); } else { - slapi_log_error(ENTRYRDN_LOGLEVEL(rc), "entryrdn_get_parent", + slapi_log_err(ENTRYRDN_LOGLEVEL(rc), "entryrdn_get_parent", "Cursor deadlocked, trying again.\n"); /* try again */ goto retry_get0; @@ -1424,11 +1424,11 @@ retry_get1: if (rc) { if (DB_LOCK_DEADLOCK == rc) { if (db_txn) { - slapi_log_error(ENTRYRDN_LOGLEVEL(rc), "entryrdn_get_parent", + slapi_log_err(ENTRYRDN_LOGLEVEL(rc), "entryrdn_get_parent", "Cursor get deadlock while under txn -> failure\n"); } else { /* try again */ - slapi_log_error(ENTRYRDN_LOGLEVEL(rc), "entryrdn_get_parent", + slapi_log_err(ENTRYRDN_LOGLEVEL(rc), "entryrdn_get_parent", "Cursor deadlocked, trying again.\n"); goto retry_get1; } @@ -1459,7 +1459,7 @@ bail: for (db_retry = 0; db_retry < RETRY_TIMES; db_retry++) { int myrc = cursor->c_close(cursor); if (0 != myrc) { - slapi_log_error(ENTRYRDN_LOGLEVEL(myrc), "entryrdn_get_parent", + slapi_log_err(ENTRYRDN_LOGLEVEL(myrc), "entryrdn_get_parent", "Failed to close cursor: %s(%d)\n", dblayer_strerror(myrc), myrc); if (DB_LOCK_DEADLOCK == myrc) { #ifdef FIX_TXN_DEADLOCKS @@ -1481,7 +1481,7 @@ bail: } /* it is guaranteed that db is not NULL. */ dblayer_release_index_file(be, ai, db); - slapi_log_error(SLAPI_LOG_TRACE, "entryrdn_get_parent", + slapi_log_err(SLAPI_LOG_TRACE, "entryrdn_get_parent", "<-- entryrdn_get_parent\n"); return rc; } @@ -1507,10 +1507,10 @@ _entryrdn_new_rdn_elem(backend *be, size_t nrdn_len = 0; rdn_elem *re = NULL; - slapi_log_error(SLAPI_LOG_TRACE, "_entryrdn_new_rdn_elem", + slapi_log_err(SLAPI_LOG_TRACE, "_entryrdn_new_rdn_elem", "--> _entryrdn_new_rdn_elem\n"); if (NULL == srdn || NULL == be) { - slapi_log_error(SLAPI_LOG_ERR, "_entryrdn_new_rdn_elem", + slapi_log_err(SLAPI_LOG_ERR, "_entryrdn_new_rdn_elem", "Empty %s\n", NULL==srdn?"RDN":NULL==be?"backend":"unknown"); *length = 0; return NULL; @@ -1520,7 +1520,7 @@ _entryrdn_new_rdn_elem(backend *be, nrdn = slapi_rdn_get_nrdn(srdn); if (NULL == rdn || NULL == nrdn) { - slapi_log_error(SLAPI_LOG_ERR, "_entryrdn_new_rdn_elem", + slapi_log_err(SLAPI_LOG_ERR, "_entryrdn_new_rdn_elem", "Empty rdn (%s) or normalized rdn (%s)\n", rdn?rdn:"", nrdn?nrdn:""); *length = 0; @@ -1537,7 +1537,7 @@ _entryrdn_new_rdn_elem(backend *be, PL_strncpyz(re->rdn_elem_nrdn_rdn, nrdn, nrdn_len); PL_strncpyz(RDN_ADDR(re), rdn, rdn_len); - slapi_log_error(SLAPI_LOG_TRACE, "_entryrdn_new_rdn_elem", + slapi_log_err(SLAPI_LOG_TRACE, "_entryrdn_new_rdn_elem", "<-- _entryrdn_new_rdn_elem\n"); return re; } @@ -1565,19 +1565,19 @@ static void _entryrdn_dump_rdn_elem(rdn_elem *elem) { if (NULL == elem) { - slapi_log_error(SLAPI_LOG_DEBUG, "_entryrdn_dump_rdn_elem", "RDN ELEMENT: empty\n"); + slapi_log_err(SLAPI_LOG_DEBUG, "_entryrdn_dump_rdn_elem", "RDN ELEMENT: empty\n"); return; } - slapi_log_error(SLAPI_LOG_DEBUG, "_entryrdn_dump_rdn_elem", "RDN ELEMENT:\n"); - slapi_log_error(SLAPI_LOG_DEBUG, "_entryrdn_dump_rdn_elem", " ID: %u\n", + slapi_log_err(SLAPI_LOG_DEBUG, "_entryrdn_dump_rdn_elem", "RDN ELEMENT:\n"); + slapi_log_err(SLAPI_LOG_DEBUG, "_entryrdn_dump_rdn_elem", " ID: %u\n", id_stored_to_internal(elem->rdn_elem_id)); - slapi_log_error(SLAPI_LOG_DEBUG, "_entryrdn_dump_rdn_elem", " RDN: \"%s\"\n", + slapi_log_err(SLAPI_LOG_DEBUG, "_entryrdn_dump_rdn_elem", " RDN: \"%s\"\n", RDN_ADDR(elem)); - slapi_log_error(SLAPI_LOG_DEBUG, "_entryrdn_dump_rdn_elem", " RDN length: %u\n", + slapi_log_err(SLAPI_LOG_DEBUG, "_entryrdn_dump_rdn_elem", " RDN length: %u\n", sizeushort_stored_to_internal(elem->rdn_elem_rdn_len)); - slapi_log_error(SLAPI_LOG_DEBUG, "_entryrdn_dump_rdn_elem", " Normalized RDN: \"%s\"\n", + slapi_log_err(SLAPI_LOG_DEBUG, "_entryrdn_dump_rdn_elem", " Normalized RDN: \"%s\"\n", elem->rdn_elem_nrdn_rdn); - slapi_log_error(SLAPI_LOG_DEBUG, "_entryrdn_dump_rdn_elem", " Normalized RDN length: %u\n", + slapi_log_err(SLAPI_LOG_DEBUG, "_entryrdn_dump_rdn_elem", " Normalized RDN length: %u\n", sizeushort_stored_to_internal(elem->rdn_elem_nrdn_len)); return; } @@ -1590,7 +1590,7 @@ _entryrdn_open_index(backend *be, struct attrinfo **ai, DB **dbp) ldbm_instance *inst = NULL; if (NULL == be || NULL == ai || NULL == dbp) { - slapi_log_error(SLAPI_LOG_ERR, "_entryrdn_open_index", + slapi_log_err(SLAPI_LOG_ERR, "_entryrdn_open_index", "Param error: Empty %s\n", NULL==be?"be":NULL==ai?"attrinfo container": NULL==dbp?"db container":"unknown"); @@ -1606,7 +1606,7 @@ _entryrdn_open_index(backend *be, struct attrinfo **ai, DB **dbp) } inst = (ldbm_instance *)be->be_instance_info; if ((*ai)->ai_attrcrypt && entryrdn_warning_on_encryption) { - slapi_log_error(SLAPI_LOG_ERR, "_entryrdn_open_index", + slapi_log_err(SLAPI_LOG_ERR, "_entryrdn_open_index", "Encrypting entryrdn is not supported. " "Ignoring the configuration entry \"dn: " "cn=entryrdn, cn=encrypted attributes, cn=, " @@ -1634,15 +1634,15 @@ _entryrdn_encrypt_key(backend *be, const char *key, struct attrinfo *ai) struct berval *encrypted_val = NULL; char *encrypted = NULL; - slapi_log_error(SLAPI_LOG_TRACE, "_entryrdn_encrypt_key", + slapi_log_err(SLAPI_LOG_TRACE, "_entryrdn_encrypt_key", "--> _entryrdn_encrypt_key\n"); if (NULL == key) { - slapi_log_error(SLAPI_LOG_ERR, "_entryrdn_encrypt_key", "Empty key\n"); + slapi_log_err(SLAPI_LOG_ERR, "_entryrdn_encrypt_key", "Empty key\n"); goto bail; } if (NULL == be || NULL == key || NULL == ai) { - slapi_log_error(SLAPI_LOG_ERR, "_entryrdn_encrypt_key", + slapi_log_err(SLAPI_LOG_ERR, "_entryrdn_encrypt_key", "Param error: Empty %s\n", NULL==be?"be":NULL==key?"key": NULL==ai?"attrinfo":"unknown"); @@ -1652,11 +1652,11 @@ _entryrdn_encrypt_key(backend *be, const char *key, struct attrinfo *ai) val.bv_len = strlen(key); rc = attrcrypt_encrypt_index_key(be, ai, &val, &encrypted_val); if (NULL == encrypted_val) { - slapi_log_error(SLAPI_LOG_ERR, "_entryrdn_encrypt_key", + slapi_log_err(SLAPI_LOG_ERR, "_entryrdn_encrypt_key", "Failed to encrypt index key for %s\n", key); } bail: - slapi_log_error(SLAPI_LOG_TRACE, "_entryrdn_encrypt_key", + slapi_log_err(SLAPI_LOG_TRACE, "_entryrdn_encrypt_key", "<-- _entryrdn_encrypt_key\n"); return encrypted_val; } @@ -1669,15 +1669,15 @@ _entryrdn_decrypt_key(backend *be, const char *key, struct attrinfo *ai) struct berval *decrypted_val = NULL; char *decrypted = NULL; - slapi_log_error(SLAPI_LOG_TRACE, "_entryrdn_decrypt_key", + slapi_log_err(SLAPI_LOG_TRACE, "_entryrdn_decrypt_key", "--> _entryrdn_decrypt_key\n"); if (NULL == key) { - slapi_log_error(SLAPI_LOG_ERR, "_entryrdn_decrypt_key", "Empty key\n"); + slapi_log_err(SLAPI_LOG_ERR, "_entryrdn_decrypt_key", "Empty key\n"); goto bail; } if (NULL == be || NULL == key || NULL == ai) { - slapi_log_error(SLAPI_LOG_ERR, "_entryrdn_decrypt_key", + slapi_log_err(SLAPI_LOG_ERR, "_entryrdn_decrypt_key", "Param error: Empty %s\n", NULL==be?"be":NULL==key?"key": NULL==ai?"attrinfo":"unknown"); @@ -1692,11 +1692,11 @@ _entryrdn_decrypt_key(backend *be, const char *key, struct attrinfo *ai) ber_bvfree(decrypted_val); goto bail; } - slapi_log_error(SLAPI_LOG_ERR, "_entryrdn_decrypt_key", + slapi_log_err(SLAPI_LOG_ERR, "_entryrdn_decrypt_key", "Failed to decrypt index key for %s\n", key); bail: - slapi_log_error(SLAPI_LOG_TRACE, "_entryrdn_decrypt_key", + slapi_log_err(SLAPI_LOG_TRACE, "_entryrdn_decrypt_key", "<-- _detryrdn_encrypt_key\n"); return decrypted; } @@ -1718,10 +1718,10 @@ _entryrdn_get_elem(DBC *cursor, int rc = 0; void *ptr = NULL; - slapi_log_error(SLAPI_LOG_TRACE, "_entryrdn_get_elem", "--> _entryrdn_get_elem\n"); + slapi_log_err(SLAPI_LOG_TRACE, "_entryrdn_get_elem", "--> _entryrdn_get_elem\n"); if (NULL == cursor || NULL == key || NULL == data || NULL == elem || NULL == comp_key) { - slapi_log_error(SLAPI_LOG_ERR, "_entryrdn_get_elem", + slapi_log_err(SLAPI_LOG_ERR, "_entryrdn_get_elem", "Param error: Empty %s\n", NULL==cursor?"cursor":NULL==key?"key": NULL==data?"data":NULL==elem?"elem container": @@ -1736,10 +1736,10 @@ retry_get: if (rc) { if (DB_LOCK_DEADLOCK == rc) { if (db_txn) { - slapi_log_error(ENTRYRDN_LOGLEVEL(rc), "_entryrdn_get_elem", + slapi_log_err(ENTRYRDN_LOGLEVEL(rc), "_entryrdn_get_elem", "Cursor get deadlock while under txn -> failure\n"); } else { - slapi_log_error(ENTRYRDN_LOGLEVEL(rc), "_entryrdn_get_elem", + slapi_log_err(ENTRYRDN_LOGLEVEL(rc), "_entryrdn_get_elem", "Cursor deadlocked, trying again.\n"); /* try again */ goto retry_get; @@ -1770,7 +1770,7 @@ retry_get: slapi_ch_free(&ptr); } bail: - slapi_log_error(SLAPI_LOG_TRACE, "_entryrdn_get_elem", "<-- _entryrdn_get_elem\n"); + slapi_log_err(SLAPI_LOG_TRACE, "_entryrdn_get_elem", "<-- _entryrdn_get_elem\n"); return rc; } @@ -1787,11 +1787,11 @@ _entryrdn_get_tombstone_elem(DBC *cursor, rdn_elem *childelem = NULL; char buffer[RDN_BULK_FETCH_BUFFER_SIZE]; - slapi_log_error(SLAPI_LOG_TRACE, "_entryrdn_get_tombstone_elem", + slapi_log_err(SLAPI_LOG_TRACE, "_entryrdn_get_tombstone_elem", "--> _entryrdn_get_tombstone_elem\n"); if (NULL == cursor || NULL == srdn || NULL == key || NULL == elem || NULL == comp_key) { - slapi_log_error(SLAPI_LOG_ERR, "_entryrdn_get_tombstone_elem", + slapi_log_err(SLAPI_LOG_ERR, "_entryrdn_get_tombstone_elem", "Param error: Empty %s\n", NULL==cursor?"cursor":NULL==key?"key": NULL==srdn?"srdn":NULL==elem?"elem container": @@ -1812,12 +1812,12 @@ retry_get0: rc = cursor->c_get(cursor, key, &data, DB_SET|DB_MULTIPLE); if (DB_LOCK_DEADLOCK == rc) { if (db_txn) { - slapi_log_error(ENTRYRDN_LOGLEVEL(rc), "_entryrdn_get_tombstone_elem", + slapi_log_err(ENTRYRDN_LOGLEVEL(rc), "_entryrdn_get_tombstone_elem", "Cursor get deadlock while under txn -> failure\n"); goto bail; } else { /* try again */ - slapi_log_error(ENTRYRDN_LOGLEVEL(rc), "_entryrdn_get_tombstone_elem", + slapi_log_err(ENTRYRDN_LOGLEVEL(rc), "_entryrdn_get_tombstone_elem", "Cursor deadlocked, trying again.\n"); goto retry_get0; } @@ -1871,12 +1871,12 @@ retry_get1: rc = cursor->c_get(cursor, key, &data, DB_NEXT_DUP|DB_MULTIPLE); if (DB_LOCK_DEADLOCK == rc) { if (db_txn) { - slapi_log_error(ENTRYRDN_LOGLEVEL(rc), "_entryrdn_get_tombstone_elem", + slapi_log_err(ENTRYRDN_LOGLEVEL(rc), "_entryrdn_get_tombstone_elem", "Cursor get deadlock while under txn -> failure\n"); goto bail; } else { /* try again */ - slapi_log_error(ENTRYRDN_LOGLEVEL(rc), "_entryrdn_get_tombstone_elem", + slapi_log_err(ENTRYRDN_LOGLEVEL(rc), "_entryrdn_get_tombstone_elem", "Cursor deadlocked, trying again.\n"); goto retry_get1; } @@ -1891,7 +1891,7 @@ retry_get1: } while (0 == rc); bail: - slapi_log_error(SLAPI_LOG_TRACE, "_entryrdn_get_tombstone_elem", + slapi_log_err(SLAPI_LOG_TRACE, "_entryrdn_get_tombstone_elem", "<-- _entryrdn_get_tombstone_elem\n"); return rc; } @@ -1902,10 +1902,10 @@ _entryrdn_put_data(DBC *cursor, DBT *key, DBT *data, char type, DB_TXN *db_txn) int rc = -1; int db_retry = 0; - slapi_log_error(SLAPI_LOG_TRACE, "_entryrdn_put_data", + slapi_log_err(SLAPI_LOG_TRACE, "_entryrdn_put_data", "--> _entryrdn_put_data\n"); if (NULL == cursor || NULL == key || NULL == data) { - slapi_log_error(SLAPI_LOG_ERR, "_entryrdn_put_data", + slapi_log_err(SLAPI_LOG_ERR, "_entryrdn_put_data", "Param error: Empty %s\n", NULL==cursor?"cursor":NULL==key?"key": NULL==data?"data":"unknown"); @@ -1917,7 +1917,7 @@ _entryrdn_put_data(DBC *cursor, DBT *key, DBT *data, char type, DB_TXN *db_txn) if (rc) { if (DB_KEYEXIST == rc) { /* this is okay, but need to return DB_KEYEXIST to caller */ - slapi_log_error(SLAPI_LOG_BACKLDBM, "_entryrdn_put_data", + slapi_log_err(SLAPI_LOG_BACKLDBM, "_entryrdn_put_data", "The same key (%s) and the data exists in index\n", (char *)key->data); break; @@ -1930,7 +1930,7 @@ _entryrdn_put_data(DBC *cursor, DBT *key, DBT *data, char type, DB_TXN *db_txn) } else { keyword = "self"; } - slapi_log_error(ENTRYRDN_LOGLEVEL(rc), "_entryrdn_put_data", + slapi_log_err(ENTRYRDN_LOGLEVEL(rc), "_entryrdn_put_data", "Adding the %s link (%s) failed: %s (%d)\n", keyword, (char *)key->data, dblayer_strerror(rc), rc); if ((DB_LOCK_DEADLOCK == rc) && !db_txn) { @@ -1944,13 +1944,13 @@ _entryrdn_put_data(DBC *cursor, DBT *key, DBT *data, char type, DB_TXN *db_txn) } } if (RETRY_TIMES == db_retry) { - slapi_log_error(SLAPI_LOG_ERR, "_entryrdn_put_data", + slapi_log_err(SLAPI_LOG_ERR, "_entryrdn_put_data", "Cursor put operation failed after [%d] retries\n", db_retry); rc = DB_LOCK_DEADLOCK; } bail: - slapi_log_error(SLAPI_LOG_TRACE, "_entryrdn_put_data", "<-- _entryrdn_put_data\n"); + slapi_log_err(SLAPI_LOG_TRACE, "_entryrdn_put_data", "<-- _entryrdn_put_data\n"); return rc; } @@ -1960,10 +1960,10 @@ _entryrdn_del_data(DBC *cursor, DBT *key, DBT *data, DB_TXN *db_txn) int rc = -1; int db_retry = 0; - slapi_log_error(SLAPI_LOG_TRACE, "_entryrdn_del_data", + slapi_log_err(SLAPI_LOG_TRACE, "_entryrdn_del_data", "--> _entryrdn_del_data\n"); if (NULL == cursor || NULL == key || NULL == data) { - slapi_log_error(SLAPI_LOG_ERR, "_entryrdn_del_data", + slapi_log_err(SLAPI_LOG_ERR, "_entryrdn_del_data", "Param error: Empty %s\n", NULL==cursor?"cursor":NULL==key?"key": NULL==data?"data":"unknown"); @@ -1974,7 +1974,7 @@ _entryrdn_del_data(DBC *cursor, DBT *key, DBT *data, DB_TXN *db_txn) rc = cursor->c_get(cursor, key, data, DB_GET_BOTH); if (rc) { if ((DB_LOCK_DEADLOCK == rc) && !db_txn) { - slapi_log_error(ENTRYRDN_LOGLEVEL(rc), "_entryrdn_del_data", + slapi_log_err(ENTRYRDN_LOGLEVEL(rc), "_entryrdn_del_data", "Cursor deadlocked, trying again.\n"); /* try again */ } else if (DB_NOTFOUND == rc) { @@ -1990,7 +1990,7 @@ _entryrdn_del_data(DBC *cursor, DBT *key, DBT *data, DB_TXN *db_txn) } } if (RETRY_TIMES == db_retry) { - slapi_log_error(SLAPI_LOG_ERR, "_entryrdn_del_data", + slapi_log_err(SLAPI_LOG_ERR, "_entryrdn_del_data", "Cursor get failed after [%d] retries\n", db_retry); rc = DB_LOCK_DEADLOCK; @@ -2001,7 +2001,7 @@ _entryrdn_del_data(DBC *cursor, DBT *key, DBT *data, DB_TXN *db_txn) for (db_retry = 0; db_retry < RETRY_TIMES; db_retry++) { rc = cursor->c_del(cursor, 0); if (rc) { - slapi_log_error(ENTRYRDN_LOGLEVEL(rc), "_entryrdn_del_data", + slapi_log_err(ENTRYRDN_LOGLEVEL(rc), "_entryrdn_del_data", "Deleting %s failed; %s(%d)\n", (char *)key->data, dblayer_strerror(rc), rc); if ((DB_LOCK_DEADLOCK == rc) && !db_txn) { @@ -2014,13 +2014,13 @@ _entryrdn_del_data(DBC *cursor, DBT *key, DBT *data, DB_TXN *db_txn) } } if (RETRY_TIMES == db_retry) { - slapi_log_error(SLAPI_LOG_ERR, "_entryrdn_del_data", + slapi_log_err(SLAPI_LOG_ERR, "_entryrdn_del_data", "Cursor del failed after [%d] retries\n", db_retry); rc = DB_LOCK_DEADLOCK; } bail: - slapi_log_error(SLAPI_LOG_TRACE, "_entryrdn_del_data", + slapi_log_err(SLAPI_LOG_TRACE, "_entryrdn_del_data", "<-- _entryrdn_del_data\n"); return rc; } @@ -2043,12 +2043,12 @@ _entryrdn_insert_key_elems(backend *be, int rc = 0; ID myid = 0; - slapi_log_error(SLAPI_LOG_TRACE, "_entryrdn_insert_key_elems", + slapi_log_err(SLAPI_LOG_TRACE, "_entryrdn_insert_key_elems", "--> _entryrdn_insert_key_elems\n"); if (NULL == be || NULL == cursor || NULL == srdn || NULL == key || NULL == parentelem || NULL == elem) { - slapi_log_error(SLAPI_LOG_ERR, "_entryrdn_insert_key_elems", + slapi_log_err(SLAPI_LOG_ERR, "_entryrdn_insert_key_elems", "Param error: Empty %s\n", NULL==be?"backend":NULL==cursor?"cursor":NULL==srdn?"RDN": NULL==key?"key":NULL==parentelem?"parent element": @@ -2108,7 +2108,7 @@ _entryrdn_insert_key_elems(backend *be, /* Succeeded or failed, it's done. */ bail: slapi_ch_free_string(&keybuf); - slapi_log_error(SLAPI_LOG_TRACE, "_entryrdn_insert_key_elems", + slapi_log_err(SLAPI_LOG_TRACE, "_entryrdn_insert_key_elems", "<-- _entryrdn_insert_key_elems\n"); return rc; } @@ -2141,7 +2141,7 @@ _entryrdn_replace_suffix_id(DBC *cursor, DBT *key, DBT *adddata, for (db_retry = 0; db_retry < RETRY_TIMES; db_retry++) { rc = cursor->c_put(cursor, key, adddata, DB_CURRENT); if (rc) { - slapi_log_error(ENTRYRDN_LOGLEVEL(rc), + slapi_log_err(ENTRYRDN_LOGLEVEL(rc), "_entryrdn_replace_suffix_id", "Adding suffix %s failed: %s (%d)\n", normsuffix, dblayer_strerror(rc), rc); @@ -2155,7 +2155,7 @@ _entryrdn_replace_suffix_id(DBC *cursor, DBT *key, DBT *adddata, } } if (RETRY_TIMES == db_retry) { - slapi_log_error(SLAPI_LOG_ERR, "_entryrdn_replace_suffix_id", + slapi_log_err(SLAPI_LOG_ERR, "_entryrdn_replace_suffix_id", "Cursor put failed after [%d] retries\n", db_retry); rc = DB_LOCK_DEADLOCK; @@ -2188,7 +2188,7 @@ _entryrdn_replace_suffix_id(DBC *cursor, DBT *key, DBT *adddata, for (db_retry = 0; db_retry < RETRY_TIMES; db_retry++) { rc = cursor->c_get(cursor, key, &data, DB_SET|DB_MULTIPLE); if ((DB_LOCK_DEADLOCK == rc) && !db_txn) { - slapi_log_error(ENTRYRDN_LOGLEVEL(rc), "_entryrdn_replace_suffix_id", + slapi_log_err(ENTRYRDN_LOGLEVEL(rc), "_entryrdn_replace_suffix_id", "Cursor get deadlocked, trying again.\n"); /* try again */ ENTRYRDN_DELAY; @@ -2201,7 +2201,7 @@ _entryrdn_replace_suffix_id(DBC *cursor, DBT *key, DBT *adddata, } } if (RETRY_TIMES == db_retry) { - slapi_log_error(SLAPI_LOG_ERR, "_entryrdn_replace_suffix_id", + slapi_log_err(SLAPI_LOG_ERR, "_entryrdn_replace_suffix_id", "Cursor get1 failed after [%d] retries\n", db_retry); rc = DB_LOCK_DEADLOCK; @@ -2247,7 +2247,7 @@ _entryrdn_replace_suffix_id(DBC *cursor, DBT *key, DBT *adddata, for (db_retry = 0; db_retry < RETRY_TIMES; db_retry++) { rc = cursor->c_get(cursor, key, &data, DB_NEXT_DUP|DB_MULTIPLE); if ((DB_LOCK_DEADLOCK == rc) && !db_txn) { - slapi_log_error(ENTRYRDN_LOGLEVEL(rc), "_entryrdn_replace_suffix_id", + slapi_log_err(ENTRYRDN_LOGLEVEL(rc), "_entryrdn_replace_suffix_id", "Retry cursor get deadlock\n"); /* try again */ ENTRYRDN_DELAY; @@ -2260,7 +2260,7 @@ _entryrdn_replace_suffix_id(DBC *cursor, DBT *key, DBT *adddata, } } if (RETRY_TIMES == db_retry) { - slapi_log_error(SLAPI_LOG_ERR, "_entryrdn_replace_suffix_id", + slapi_log_err(SLAPI_LOG_ERR, "_entryrdn_replace_suffix_id", "Cursor get2 failed after [%d] retries\n", db_retry); rc = DB_LOCK_DEADLOCK; @@ -2295,7 +2295,7 @@ _entryrdn_replace_suffix_id(DBC *cursor, DBT *key, DBT *adddata, rc = cursor->c_get(cursor, key, &moddata, DB_SET); if (rc) { if ((DB_LOCK_DEADLOCK == rc) && !db_txn) { - slapi_log_error(ENTRYRDN_LOGLEVEL(rc), "_entryrdn_replace_suffix_id", + slapi_log_err(ENTRYRDN_LOGLEVEL(rc), "_entryrdn_replace_suffix_id", "Retry2 cursor get deadlock\n"); ENTRYRDN_DELAY; } else { @@ -2308,7 +2308,7 @@ _entryrdn_replace_suffix_id(DBC *cursor, DBT *key, DBT *adddata, } } if (RETRY_TIMES == db_retry) { - slapi_log_error(SLAPI_LOG_ERR, "_entryrdn_replace_suffix_id", + slapi_log_err(SLAPI_LOG_ERR, "_entryrdn_replace_suffix_id", "Cursor get3 failed after [%d] retries\n", db_retry); rc = DB_LOCK_DEADLOCK; @@ -2322,7 +2322,7 @@ _entryrdn_replace_suffix_id(DBC *cursor, DBT *key, DBT *adddata, for (db_retry = 0; db_retry < RETRY_TIMES; db_retry++) { rc = cursor->c_put(cursor, key, &moddata, DB_CURRENT); if (rc) { - slapi_log_error(ENTRYRDN_LOGLEVEL(rc), "_entryrdn_replace_suffix_id", + slapi_log_err(ENTRYRDN_LOGLEVEL(rc), "_entryrdn_replace_suffix_id", "Fixing the parent link (%s) failed: %s (%d)\n", keybuf, dblayer_strerror(rc), rc); if ((DB_LOCK_DEADLOCK == rc) && !db_txn) { @@ -2335,7 +2335,7 @@ _entryrdn_replace_suffix_id(DBC *cursor, DBT *key, DBT *adddata, } } if (RETRY_TIMES == db_retry) { - slapi_log_error(SLAPI_LOG_ERR, "_entryrdn_replace_suffix_id", + slapi_log_err(SLAPI_LOG_ERR, "_entryrdn_replace_suffix_id", "Cursor put failed after [%d] retries\n", db_retry); rc = DB_LOCK_DEADLOCK; goto bail0; @@ -2384,11 +2384,11 @@ _entryrdn_insert_key(backend *be, Slapi_RDN *tmpsrdn = NULL; int db_retry = 0; - slapi_log_error(SLAPI_LOG_TRACE, "_entryrdn_insert_key", + slapi_log_err(SLAPI_LOG_TRACE, "_entryrdn_insert_key", "--> _entryrdn_insert_key\n"); if (NULL == be || NULL == cursor || NULL == srdn || 0 == id) { - slapi_log_error(SLAPI_LOG_ERR, "_entryrdn_insert_key", + slapi_log_err(SLAPI_LOG_ERR, "_entryrdn_insert_key", "Param error: Empty %s\n", NULL==be?"backend":NULL==cursor?"cursor":NULL==srdn?"RDN": 0==id?"id":"unknown"); @@ -2398,7 +2398,7 @@ _entryrdn_insert_key(backend *be, /* get the top normalized rdn */ rdnidx = slapi_rdn_get_last_ext(srdn, &nrdn, FLAG_ALL_NRDNS); if (rdnidx < 0 || NULL == nrdn) { - slapi_log_error(SLAPI_LOG_ERR, "_entryrdn_insert_key", + slapi_log_err(SLAPI_LOG_ERR, "_entryrdn_insert_key", "Empty RDN\n"); goto bail; } @@ -2413,7 +2413,7 @@ _entryrdn_insert_key(backend *be, DBT adddata; elem = _entryrdn_new_rdn_elem(be, id, srdn, &len); if (NULL == elem) { - slapi_log_error(SLAPI_LOG_ERR, "_entryrdn_insert_key", + slapi_log_err(SLAPI_LOG_ERR, "_entryrdn_insert_key", "Failed to generate an elem: " "id: %d, rdn: %s\n", id, slapi_rdn_get_rdn(srdn)); @@ -2438,7 +2438,7 @@ _entryrdn_insert_key(backend *be, for (db_retry = 0; db_retry < RETRY_TIMES; db_retry++) { rc = cursor->c_get(cursor, &key, &existdata, DB_SET); if (rc) { - slapi_log_error(ENTRYRDN_LOGLEVEL(rc), "_entryrdn_insert_key", + slapi_log_err(ENTRYRDN_LOGLEVEL(rc), "_entryrdn_insert_key", "Get existing suffix %s failed: %s (%d)\n", nrdn, dblayer_strerror(rc), rc); if ((DB_LOCK_DEADLOCK == rc) && !db_txn) { @@ -2451,7 +2451,7 @@ _entryrdn_insert_key(backend *be, } } if (RETRY_TIMES == db_retry) { - slapi_log_error(ENTRYRDN_LOGLEVEL(rc), "_entryrdn_insert_key", + slapi_log_err(ENTRYRDN_LOGLEVEL(rc), "_entryrdn_insert_key", "Cursor get failed after [%d] retries\n", db_retry); rc = DB_LOCK_DEADLOCK; goto bail; @@ -2468,7 +2468,7 @@ _entryrdn_insert_key(backend *be, } /* if (TMPID == tmpid) */ rc = 0; } /* if (DB_KEYEXIST == rc) */ - slapi_log_error(SLAPI_LOG_TRACE, "_entryrdn_insert_key", + slapi_log_err(SLAPI_LOG_TRACE, "_entryrdn_insert_key", "Suffix %s added: %d\n", nrdn, rc); goto bail; /* succeeded or failed, it's done */ @@ -2482,7 +2482,7 @@ _entryrdn_insert_key(backend *be, if (rc) { char *dn = NULL; slapi_rdn_get_dn(srdn, &dn); - slapi_log_error(SLAPI_LOG_ERR, "_entryrdn_insert_key", + slapi_log_err(SLAPI_LOG_ERR, "_entryrdn_insert_key", "Partial dup of %s (idx %d) failed (%d)\n", dn, rdnidx, rc); slapi_ch_free_string(&dn); goto bail; @@ -2491,7 +2491,7 @@ _entryrdn_insert_key(backend *be, if (NULL == elem) { char *dn = NULL; slapi_rdn_get_dn(tmpsrdn, &dn); - slapi_log_error(SLAPI_LOG_ERR, "_entryrdn_insert_key", + slapi_log_err(SLAPI_LOG_ERR, "_entryrdn_insert_key", "Failed to generate a new elem: dn: %s\n", dn); slapi_ch_free_string(&dn); goto bail; @@ -2510,7 +2510,7 @@ _entryrdn_insert_key(backend *be, int isexception = 0; if ((rc == DB_LOCK_DEADLOCK) && db_txn) { - slapi_log_error(ENTRYRDN_LOGLEVEL(rc), "_entryrdn_insert_key", + slapi_log_err(ENTRYRDN_LOGLEVEL(rc), "_entryrdn_insert_key", "Suffix \"%s\" cursor get fails: %s(%d)\n", nrdn, dblayer_strerror(rc), rc); goto bail; } @@ -2531,7 +2531,7 @@ _entryrdn_insert_key(backend *be, slapi_ch_free((void **)&elem); elem = _entryrdn_new_rdn_elem(be, suffixid, tmpsrdn, &len); if (NULL == elem) { - slapi_log_error(SLAPI_LOG_ERR, "_entryrdn_insert_key", + slapi_log_err(SLAPI_LOG_ERR, "_entryrdn_insert_key", "Failed to generate an elem: id: %d, rdn: %s\n", suffixid, slapi_rdn_get_rdn(tmpsrdn)); goto bail; @@ -2545,13 +2545,13 @@ _entryrdn_insert_key(backend *be, adddata.flags = DB_DBT_USERMEM; rc = _entryrdn_put_data(cursor, &key, &adddata, RDN_INDEX_SELF, db_txn); - slapi_log_error(SLAPI_LOG_TRACE, "_entryrdn_insert_key", + slapi_log_err(SLAPI_LOG_TRACE, "_entryrdn_insert_key", "Suffix %s added: %d\n", slapi_rdn_get_rdn(tmpsrdn), rc); #ifdef FIX_TXN_DEADLOCKS #error no checking for rc here? - what if rc is deadlock? should bail? #endif } else { - slapi_log_error(ENTRYRDN_LOGLEVEL(rc), "_entryrdn_insert_key", + slapi_log_err(ENTRYRDN_LOGLEVEL(rc), "_entryrdn_insert_key", "Suffix \"%s\" not found: %s(%d)\n", nrdn, dblayer_strerror(rc), rc); goto bail; } @@ -2570,7 +2570,7 @@ _entryrdn_insert_key(backend *be, rdnidx = slapi_rdn_get_prev_ext(srdn, rdnidx, &childnrdn, FLAG_ALL_NRDNS); if ((rdnidx < 0) || (NULL == childnrdn)) { - slapi_log_error(SLAPI_LOG_ERR, "_entryrdn_insert_key", + slapi_log_err(SLAPI_LOG_ERR, "_entryrdn_insert_key", "RDN list \"%s\" is broken: idx(%d)\n", slapi_rdn_get_rdn(srdn), rdnidx); goto bail; @@ -2588,7 +2588,7 @@ _entryrdn_insert_key(backend *be, if (rc) { char *dn = NULL; slapi_rdn_get_dn(srdn, &dn); - slapi_log_error(SLAPI_LOG_ERR, "_entryrdn_insert_key", + slapi_log_err(SLAPI_LOG_ERR, "_entryrdn_insert_key", "Partial dup of %s (idx %d) failed (%d)\n", dn, rdnidx, rc); slapi_ch_free_string(&dn); goto bail; @@ -2598,7 +2598,7 @@ _entryrdn_insert_key(backend *be, if (NULL == elem) { char *dn = NULL; slapi_rdn_get_dn(tmpsrdn, &dn); - slapi_log_error(SLAPI_LOG_ERR, "_entryrdn_insert_key", + slapi_log_err(SLAPI_LOG_ERR, "_entryrdn_insert_key", "Failed to generate a new elem: dn: %s\n", dn); slapi_ch_free_string(&dn); goto bail; @@ -2615,7 +2615,7 @@ _entryrdn_insert_key(backend *be, if (rc) { slapi_ch_free((void **)&tmpelem); if ((rc == DB_LOCK_DEADLOCK) && db_txn) { - slapi_log_error(ENTRYRDN_LOGLEVEL(rc), + slapi_log_err(ENTRYRDN_LOGLEVEL(rc), "_entryrdn_insert_key", "Suffix \"%s\" cursor get fails: %s(%d)\n", childnrdn, dblayer_strerror(rc), rc); @@ -2650,10 +2650,10 @@ _entryrdn_insert_key(backend *be, char *dn = NULL; slapi_rdn_get_dn(tmpsrdn, &dn); if (DB_NOTFOUND == rc) { - slapi_log_error(SLAPI_LOG_ERR, "_entryrdn_insert_key", + slapi_log_err(SLAPI_LOG_ERR, "_entryrdn_insert_key", "Node \"%s\" not found: %s(%d)\n", dn, dblayer_strerror(rc), rc); } else { - slapi_log_error(ENTRYRDN_LOGLEVEL(rc), "_entryrdn_insert_key", + slapi_log_err(ENTRYRDN_LOGLEVEL(rc), "_entryrdn_insert_key", "Getting \"%s\" failed: %s(%d)\n", dn, dblayer_strerror(rc), rc); } slapi_ch_free_string(&dn); @@ -2672,7 +2672,7 @@ _entryrdn_insert_key(backend *be, } else { char *dn = NULL; slapi_rdn_get_dn(tmpsrdn, &dn); - slapi_log_error(ENTRYRDN_LOGLEVEL(rc), "_entryrdn_insert_key", + slapi_log_err(ENTRYRDN_LOGLEVEL(rc), "_entryrdn_insert_key", "Suffix \"%s\" not found: %s(%d)\n", nrdn, dblayer_strerror(rc), rc); slapi_ch_free_string(&dn); goto bail; @@ -2687,12 +2687,12 @@ _entryrdn_insert_key(backend *be, /* already in the file */ /* do nothing and return. */ rc = 0; - slapi_log_error(SLAPI_LOG_BACKLDBM, "_entryrdn_insert_key", + slapi_log_err(SLAPI_LOG_BACKLDBM, "_entryrdn_insert_key", "ID %d is already in the index. NOOP.\n", currid); } else { /* different id, error return */ char *dn = NULL; int tmprc = slapi_rdn_get_dn(srdn, &dn); - slapi_log_error(SLAPI_LOG_ERR, + slapi_log_err(SLAPI_LOG_ERR, "_entryrdn_insert_key", "Same DN (%s: %s) is already in the %s file with different ID " "%d. Expected ID is %d.\n", @@ -2723,7 +2723,7 @@ bail: slapi_ch_free((void **)&elem); slapi_ch_free((void **)&parentelem); slapi_ch_free((void **)&childelem); - slapi_log_error(SLAPI_LOG_TRACE, "_entryrdn_insert_key", + slapi_log_err(SLAPI_LOG_TRACE, "_entryrdn_insert_key", "<-- _entryrdn_insert_key\n"); return rc; } @@ -2758,11 +2758,11 @@ _entryrdn_delete_key(backend *be, int done = 0; char buffer[RDN_BULK_FETCH_BUFFER_SIZE]; - slapi_log_error(SLAPI_LOG_TRACE, "_entryrdn_delete_key", + slapi_log_err(SLAPI_LOG_TRACE, "_entryrdn_delete_key", "--> _entryrdn_delete_key\n"); if (NULL == be || NULL == cursor || NULL == srdn || 0 == id) { - slapi_log_error(SLAPI_LOG_ERR, "_entryrdn_delete_key", + slapi_log_err(SLAPI_LOG_ERR, "_entryrdn_delete_key", "Param error: Empty %s\n", NULL==be?"backend":NULL==cursor?"cursor":NULL==srdn?"RDN": 0==id?"ID":"unknown"); @@ -2773,7 +2773,7 @@ _entryrdn_delete_key(backend *be, rdnidx = slapi_rdn_get_first_ext(srdn, &nrdn, FLAG_ALL_NRDNS); /* rdnidx is supposed to be 0 */ if (rdnidx < 0 || NULL == nrdn) { - slapi_log_error(SLAPI_LOG_ERR, "_entryrdn_delete_key", + slapi_log_err(SLAPI_LOG_ERR, "_entryrdn_delete_key", "Empty RDN\n"); goto bail; } @@ -2782,7 +2782,7 @@ _entryrdn_delete_key(backend *be, issuffix = 1; selfnrdn = suffix; } else if (lastidx < 0 || NULL == suffix) { - slapi_log_error(SLAPI_LOG_ERR, "_entryrdn_delete_key", + slapi_log_err(SLAPI_LOG_ERR, "_entryrdn_delete_key", "Empty suffix\n"); goto bail; } @@ -2805,11 +2805,11 @@ _entryrdn_delete_key(backend *be, rc = cursor->c_get(cursor, &key, &data, DB_SET|DB_MULTIPLE); if (DB_LOCK_DEADLOCK == rc) { if (db_txn) { - slapi_log_error(ENTRYRDN_LOGLEVEL(rc), "_entryrdn_delete_key", + slapi_log_err(ENTRYRDN_LOGLEVEL(rc), "_entryrdn_delete_key", "Cursor get deadlock while under txn -> failure\n"); goto bail; } else { - slapi_log_error(ENTRYRDN_LOGLEVEL(rc), "_entryrdn_delete_key", + slapi_log_err(ENTRYRDN_LOGLEVEL(rc), "_entryrdn_delete_key", "Cursor get deadlock, trying again.\n"); /* try again */ continue; @@ -2838,7 +2838,7 @@ _entryrdn_delete_key(backend *be, childelem = (rdn_elem *)dataret.data; if (!slapi_is_special_rdn(childelem->rdn_elem_nrdn_rdn, RDN_IS_TOMBSTONE)) { /* there's at least one live child */ - slapi_log_error(SLAPI_LOG_ERR, "_entryrdn_delete_key", + slapi_log_err(SLAPI_LOG_ERR, "_entryrdn_delete_key", "Failed to remove %s; has a child %s\n", nrdn, (char *)childelem->rdn_elem_nrdn_rdn); rc = -1; @@ -2849,11 +2849,11 @@ retry_get: rc = cursor->c_get(cursor, &key, &data, DB_NEXT_DUP|DB_MULTIPLE); if (DB_LOCK_DEADLOCK == rc) { if (db_txn) { - slapi_log_error(ENTRYRDN_LOGLEVEL(rc), "_entryrdn_delete_key", + slapi_log_err(ENTRYRDN_LOGLEVEL(rc), "_entryrdn_delete_key", "Cursor get deadlock while under txn -> failure\n"); goto bail; } else { - slapi_log_error(ENTRYRDN_LOGLEVEL(rc), "_entryrdn_delete_key", + slapi_log_err(ENTRYRDN_LOGLEVEL(rc), "_entryrdn_delete_key", "Cursor get deadlocked, trying again\n"); /* try again */ goto retry_get; @@ -2884,7 +2884,7 @@ retry_get: if (rc) { char *dn = NULL; slapi_rdn_get_dn(srdn, &dn); - slapi_log_error(SLAPI_LOG_ERR, "_entryrdn_delete_key", + slapi_log_err(SLAPI_LOG_ERR, "_entryrdn_delete_key", "Partial dup of %s (idx %d) failed (%d)\n", dn, 1, rc); slapi_ch_free_string(&dn); goto bail; @@ -2893,7 +2893,7 @@ retry_get: if (NULL == elem) { char *dn = NULL; slapi_rdn_get_dn(tmpsrdn, &dn); - slapi_log_error(SLAPI_LOG_ERR, "_entryrdn_delete_key", + slapi_log_err(SLAPI_LOG_ERR, "_entryrdn_delete_key", "Failed to generate a parent elem: dn: %s\n", dn); slapi_ch_free_string(&dn); slapi_rdn_free(&tmpsrdn); @@ -2906,7 +2906,7 @@ retry_get: if (NULL == elem) { char *dn = NULL; slapi_rdn_get_dn(srdn, &dn); - slapi_log_error(SLAPI_LOG_ERR, "_entryrdn_delete_key", + slapi_log_err(SLAPI_LOG_ERR, "_entryrdn_delete_key", "Failed to generate a parent's child elem: dn: %s\n", dn); slapi_ch_free_string(&dn); goto bail; @@ -2922,7 +2922,7 @@ retry_get: if (NULL == elem) { char *dn = NULL; slapi_rdn_get_dn(srdn, &dn); - slapi_log_error(SLAPI_LOG_ERR, "_entryrdn_delete_key", + slapi_log_err(SLAPI_LOG_ERR, "_entryrdn_delete_key", "Failed to generate a target elem: dn: %s\n", dn); slapi_ch_free_string(&dn); goto bail; @@ -2945,7 +2945,7 @@ retry_get: } if (rc) { if (DB_NOTFOUND == rc) { - slapi_log_error(SLAPI_LOG_BACKLDBM, "_entryrdn_delete_key", + slapi_log_err(SLAPI_LOG_BACKLDBM, "_entryrdn_delete_key", "No parent link %s\n", keybuf); goto bail; } else { @@ -2969,7 +2969,7 @@ retry_get: for (db_retry = 0; db_retry < RETRY_TIMES; db_retry++) { rc = cursor->c_del(cursor, 0); if (rc && (DB_NOTFOUND != rc)) { - slapi_log_error(ENTRYRDN_LOGLEVEL(rc), "_entryrdn_delete_key", + slapi_log_err(ENTRYRDN_LOGLEVEL(rc), "_entryrdn_delete_key", "Deleting %s failed; %s(%d)\n", (char *)key.data, dblayer_strerror(rc), rc); if ((DB_LOCK_DEADLOCK == rc) && !db_txn) { @@ -2982,7 +2982,7 @@ retry_get: } } if (RETRY_TIMES == db_retry) { - slapi_log_error(SLAPI_LOG_ERR, "_entryrdn_delete_key", + slapi_log_err(SLAPI_LOG_ERR, "_entryrdn_delete_key", "Delete parent link failed after [%d] retries\n", db_retry); rc = DB_LOCK_DEADLOCK; @@ -2998,7 +2998,7 @@ retry_get: for (db_retry = 0; db_retry < RETRY_TIMES; db_retry++) { rc = cursor->c_del(cursor, 0); if (rc && (DB_NOTFOUND != rc)) { - slapi_log_error(ENTRYRDN_LOGLEVEL(rc), "_entryrdn_delete_key", + slapi_log_err(ENTRYRDN_LOGLEVEL(rc), "_entryrdn_delete_key", "Deleting %s failed; %s(%d)\n", (char *)key.data, dblayer_strerror(rc), rc); if ((DB_LOCK_DEADLOCK == rc) && !db_txn) { @@ -3011,7 +3011,7 @@ retry_get: } } if (RETRY_TIMES == db_retry) { - slapi_log_error(SLAPI_LOG_ERR, "_entryrdn_delete_key", + slapi_log_err(SLAPI_LOG_ERR, "_entryrdn_delete_key", "Delete parent's child link failed after [%d] retries\n", db_retry); rc = DB_LOCK_DEADLOCK; @@ -3028,7 +3028,7 @@ retry_get: for (db_retry = 0; db_retry < RETRY_TIMES; db_retry++) { rc = cursor->c_del(cursor, 0); if (rc && (DB_NOTFOUND != rc)) { - slapi_log_error(ENTRYRDN_LOGLEVEL(rc), "_entryrdn_delete_key", + slapi_log_err(ENTRYRDN_LOGLEVEL(rc), "_entryrdn_delete_key", "Deleting %s failed: %s(%d)\n", (char *)key.data, dblayer_strerror(rc), rc); if ((DB_LOCK_DEADLOCK == rc) && !db_txn) { @@ -3041,7 +3041,7 @@ retry_get: } } if (RETRY_TIMES == db_retry) { - slapi_log_error(SLAPI_LOG_ERR, "_entryrdn_delete_key", + slapi_log_err(SLAPI_LOG_ERR, "_entryrdn_delete_key", "Delete self link failed after [%d] retries\n", db_retry); rc = DB_LOCK_DEADLOCK; @@ -3054,7 +3054,7 @@ bail: slapi_ch_free_string(&parentnrdn); slapi_ch_free_string(&keybuf); slapi_ch_free((void **)&elem); - slapi_log_error(SLAPI_LOG_TRACE, "_entryrdn_delete_key", + slapi_log_err(SLAPI_LOG_TRACE, "_entryrdn_delete_key", "<-- _entryrdn_delete_key\n"); return rc; } @@ -3082,11 +3082,11 @@ _entryrdn_index_read(backend *be, Slapi_RDN *tmpsrdn = NULL; rdn_elem *tmpelem = NULL; - slapi_log_error(SLAPI_LOG_TRACE, "_entryrdn_index_read", + slapi_log_err(SLAPI_LOG_TRACE, "_entryrdn_index_read", "--> _entryrdn_index_read\n"); if (NULL == be || NULL == cursor || NULL == srdn || NULL == elem) { - slapi_log_error(SLAPI_LOG_ERR, "_entryrdn_index_read", + slapi_log_err(SLAPI_LOG_ERR, "_entryrdn_index_read", "Param error: Empty %s\n", NULL==be?"backend":NULL==cursor?"cursor":NULL==srdn?"RDN": NULL==elem?"elem container":"unknown"); @@ -3103,7 +3103,7 @@ _entryrdn_index_read(backend *be, /* get the top normalized rdn (normalized suffix) */ rdnidx = slapi_rdn_get_last_ext(srdn, &nrdn, FLAG_ALL_NRDNS); if (rdnidx < 0 || NULL == nrdn) { - slapi_log_error(SLAPI_LOG_ERR, "_entryrdn_index_read", + slapi_log_err(SLAPI_LOG_ERR, "_entryrdn_index_read", "Empty RDN (Suffix)\n"); goto bail; } @@ -3120,7 +3120,7 @@ _entryrdn_index_read(backend *be, if (rc) { char *dn = NULL; slapi_rdn_get_dn(srdn, &dn); - slapi_log_error(SLAPI_LOG_ERR, "_entryrdn_index_read", + slapi_log_err(SLAPI_LOG_ERR, "_entryrdn_index_read", "Partial dup of %s (idx %d) failed (%d)\n", dn, rdnidx, rc); slapi_ch_free_string(&dn); @@ -3130,7 +3130,7 @@ _entryrdn_index_read(backend *be, if (NULL == *elem) { char *dn = NULL; slapi_rdn_get_dn(tmpsrdn, &dn); - slapi_log_error(SLAPI_LOG_ERR, "_entryrdn_index_read", + slapi_log_err(SLAPI_LOG_ERR, "_entryrdn_index_read", "Failed to generate a new elem: dn: %s\n", dn); slapi_ch_free_string(&dn); slapi_rdn_free(&tmpsrdn); @@ -3147,7 +3147,7 @@ _entryrdn_index_read(backend *be, if (rc || NULL == *elem) { slapi_ch_free((void **)elem); if ((rc == DB_LOCK_DEADLOCK) && db_txn) { - slapi_log_error(SLAPI_LOG_BACKLDBM, "_entryrdn_index_read", + slapi_log_err(SLAPI_LOG_BACKLDBM, "_entryrdn_index_read", "Suffix \"%s\" cursor get fails: %s(%d)\n", nrdn, dblayer_strerror(rc), rc); slapi_rdn_free(&tmpsrdn); @@ -3160,7 +3160,7 @@ _entryrdn_index_read(backend *be, rdnidx--; /* consider nsuniqueid=.., one RDN */ } if (rc || NULL == *elem) { - slapi_log_error(SLAPI_LOG_BACKLDBM, "_entryrdn_index_read", + slapi_log_err(SLAPI_LOG_BACKLDBM, "_entryrdn_index_read", "Suffix \"%s\" not found: %s(%d)\n", nrdn, dblayer_strerror(rc), rc); rc = DB_NOTFOUND; @@ -3188,7 +3188,7 @@ _entryrdn_index_read(backend *be, #ifdef LDAP_DEBUG_ENTRYRDN char *dn = NULL; slapi_rdn_get_dn(srdn, &dn); - slapi_log_error(SLAPI_LOG_DEBUG, "_entryrdn_index_read", + slapi_log_err(SLAPI_LOG_DEBUG, "_entryrdn_index_read", "Done; DN %s => ID %d\n", dn, id); slapi_ch_free_string(&dn); @@ -3203,7 +3203,7 @@ _entryrdn_index_read(backend *be, if (rc) { char *dn = NULL; slapi_rdn_get_dn(srdn, &dn); - slapi_log_error(SLAPI_LOG_ERR, "_entryrdn_index_read", + slapi_log_err(SLAPI_LOG_ERR, "_entryrdn_index_read", "Partial dup of %s (idx %d) failed (%d)\n", dn, rdnidx, rc); slapi_ch_free_string(&dn); @@ -3214,7 +3214,7 @@ _entryrdn_index_read(backend *be, if (NULL == tmpelem) { char *dn = NULL; slapi_rdn_get_dn(tmpsrdn, &dn); - slapi_log_error(SLAPI_LOG_ERR, "_entryrdn_index_read", + slapi_log_err(SLAPI_LOG_ERR, "_entryrdn_index_read", "Failed to generate a new elem: dn: %s\n", dn); slapi_ch_free_string(&dn); if (tmpsrdn != srdn) { @@ -3240,7 +3240,7 @@ _entryrdn_index_read(backend *be, if (rc) { slapi_ch_free((void **)&tmpelem); if ((rc == DB_LOCK_DEADLOCK) && db_txn) { - slapi_log_error(SLAPI_LOG_BACKLDBM, "_entryrdn_index_read", + slapi_log_err(SLAPI_LOG_BACKLDBM, "_entryrdn_index_read", "Suffix \"%s\" cursor get fails: " "%s(%d)\n", nrdn, dblayer_strerror(rc), rc); if (tmpsrdn != srdn) { @@ -3261,7 +3261,7 @@ _entryrdn_index_read(backend *be, if (rc || (NULL == tmpelem)) { slapi_ch_free((void **)&tmpelem); if (DB_NOTFOUND != rc) { - slapi_log_error(SLAPI_LOG_BACKLDBM, "_entryrdn_index_read", + slapi_log_err(SLAPI_LOG_BACKLDBM, "_entryrdn_index_read", "Child link \"%s\" of " "key \"%s\" not found: %s(%d)\n", childnrdn, keybuf, dblayer_strerror(rc), rc); @@ -3276,7 +3276,7 @@ _entryrdn_index_read(backend *be, } else { slapi_ch_free((void **)&tmpelem); if (DB_NOTFOUND != rc) { - slapi_log_error(SLAPI_LOG_BACKLDBM, "_entryrdn_index_read", + slapi_log_err(SLAPI_LOG_BACKLDBM, "_entryrdn_index_read", "Child link \"%s\" of key \"%s\" not found: %s(%d)\n", childnrdn, keybuf, dblayer_strerror(rc), rc); rc = DB_NOTFOUND; @@ -3301,7 +3301,7 @@ _entryrdn_index_read(backend *be, } *elem = tmpelem; #ifdef LDAP_DEBUG_ENTRYRDN - slapi_log_error(SLAPI_LOG_DEBUG, "_entryrdn_index_read", + slapi_log_err(SLAPI_LOG_DEBUG, "_entryrdn_index_read", "%s matched normalized child rdn %s\n", (*elem)->rdn_elem_nrdn_rdn, childnrdn); #endif @@ -3309,7 +3309,7 @@ _entryrdn_index_read(backend *be, nrdn = childnrdn; if (0 == id) { - slapi_log_error(SLAPI_LOG_ERR, "_entryrdn_index_read", + slapi_log_err(SLAPI_LOG_ERR, "_entryrdn_index_read", "Child %s of %s not found\n", childnrdn, nrdn); break; } @@ -3335,7 +3335,7 @@ _entryrdn_index_read(backend *be, retry_get0: rc = cursor->c_get(cursor, &key, &data, DB_SET|DB_MULTIPLE); if (DB_LOCK_DEADLOCK == rc) { - slapi_log_error(ENTRYRDN_LOGLEVEL(rc), "_entryrdn_index_read", + slapi_log_err(ENTRYRDN_LOGLEVEL(rc), "_entryrdn_index_read", "Cursor get deadlock\n"); if (db_txn) { goto bail; @@ -3380,7 +3380,7 @@ retry_get0: retry_get1: rc = cursor->c_get(cursor, &key, &data, DB_NEXT_DUP|DB_MULTIPLE); if (DB_LOCK_DEADLOCK == rc) { - slapi_log_error(ENTRYRDN_LOGLEVEL(rc), "_entryrdn_index_read", + slapi_log_err(ENTRYRDN_LOGLEVEL(rc), "_entryrdn_index_read", "Retry cursor get deadlock\n"); if (db_txn) { @@ -3405,7 +3405,7 @@ bail: slapi_ch_free((void **)childelems); } slapi_ch_free_string(&keybuf); - slapi_log_error(SLAPI_LOG_TRACE, "_entryrdn_index_read", + slapi_log_err(SLAPI_LOG_TRACE, "_entryrdn_index_read", "<-- _entryrdn_index_read\n"); return rc; } @@ -3439,7 +3439,7 @@ retry_get0: rc = cursor->c_get(cursor, &key, &data, DB_SET|DB_MULTIPLE); if (rc) { if (DB_LOCK_DEADLOCK == rc) { - slapi_log_error(ENTRYRDN_LOGLEVEL(rc), "_entryrdn_append_childidl", + slapi_log_err(ENTRYRDN_LOGLEVEL(rc), "_entryrdn_append_childidl", "Cursor get deadlock\n"); if (db_txn) { goto bail; @@ -3474,7 +3474,7 @@ retry_get0: myid = id_stored_to_internal(myelem->rdn_elem_id); rc = idl_append_extend(affectedidl, myid); if (rc) { - slapi_log_error(SLAPI_LOG_ERR, "_entryrdn_append_childidl", + slapi_log_err(SLAPI_LOG_ERR, "_entryrdn_append_childidl", "Appending %d to affected idl failed (%d)\n", myid, rc); goto bail; } @@ -3489,7 +3489,7 @@ retry_get1: rc = cursor->c_get(cursor, &key, &data, DB_NEXT_DUP|DB_MULTIPLE); if (rc) { if (DB_LOCK_DEADLOCK == rc) { - slapi_log_error(ENTRYRDN_LOGLEVEL(rc), "_entryrdn_append_childidl", + slapi_log_err(ENTRYRDN_LOGLEVEL(rc), "_entryrdn_append_childidl", "Retry cursor get deadlock\n"); if (db_txn) { goto bail; @@ -3517,12 +3517,12 @@ _entryrdn_cursor_print_error(char *fn, void *key, size_t need, size_t actual, int rc) { if (DB_BUFFER_SMALL == rc) { - slapi_log_error(SLAPI_LOG_ERR, NULL, + slapi_log_err(SLAPI_LOG_ERR, NULL, "%s - Entryrdn index is corrupt; data item for key %s " "is too large for the buffer need=%lu actual=%lu)\n", fn, (char *)key, (long unsigned int)need, (long unsigned int)actual); } else { - slapi_log_error(SLAPI_LOG_ERR, NULL, + slapi_log_err(SLAPI_LOG_ERR, NULL, "%s - Failed to position cursor at " "the key: %s: %s(%d)\n", fn, (char *)key, dblayer_strerror(rc), rc); diff --git a/ldap/servers/slapd/back-ldbm/ldbm_index_config.c b/ldap/servers/slapd/back-ldbm/ldbm_index_config.c index 73eff33..de77e33 100644 --- a/ldap/servers/slapd/back-ldbm/ldbm_index_config.c +++ b/ldap/servers/slapd/back-ldbm/ldbm_index_config.c @@ -34,17 +34,17 @@ static int ldbm_index_parse_entry(ldbm_instance *inst, Slapi_Entry *e, /* Get the name of the attribute to index which will be the value * of the cn attribute. */ if (slapi_entry_attr_find(e, "cn", &attr) != 0) { - LDAPDebug(LDAP_DEBUG_ERR, "ldbm_index_parse_entry - Malformed index entry %s\n", - slapi_entry_get_dn(e), 0, 0); + slapi_log_err(SLAPI_LOG_ERR, "ldbm_index_parse_entry", "Malformed index entry %s\n", + slapi_entry_get_dn(e)); return LDAP_OPERATIONS_ERROR; } slapi_attr_first_value(attr, &sval); attrValue = slapi_value_get_berval(sval); if (NULL == attrValue->bv_val || 0 == attrValue->bv_len) { - LDAPDebug(LDAP_DEBUG_ERR, - "ldbm_index_parse_entry - Malformed index entry %s -- empty index name\n", - slapi_entry_get_dn(e), 0, 0); + slapi_log_err(SLAPI_LOG_ERR, + "ldbm_index_parse_entry", "Malformed index entry %s -- empty index name\n", + slapi_entry_get_dn(e)); return LDAP_OPERATIONS_ERROR; } @@ -58,9 +58,9 @@ static int ldbm_index_parse_entry(ldbm_instance *inst, Slapi_Entry *e, attrValue = slapi_value_get_berval(sval); if (NULL == attrValue->bv_val || attrValue->bv_len == 0) { /* missing the index type, error out */ - LDAPDebug(LDAP_DEBUG_ERR, - "ldbm_index_parse_entry - Malformed index entry %s -- empty nsIndexType\n", - slapi_entry_get_dn(e), 0, 0); + slapi_log_err(SLAPI_LOG_ERR, + "ldbm_index_parse_entry", "Malformed index entry %s -- empty nsIndexType\n", + slapi_entry_get_dn(e)); slapi_ch_free_string(index_name); return LDAP_OPERATIONS_ERROR; } @@ -198,9 +198,9 @@ ldbm_instance_index_config_modify_callback(Slapi_PBlock *pb, Slapi_Entry *e, *returncode = LDAP_SUCCESS; if(slapi_entry_attr_find(entryAfter, "cn", &attr) != 0){ - LDAPDebug(LDAP_DEBUG_ERR, - "ldbm_instance_index_config_modify_callback - Malformed index entry %s - missing cn attribute\n", - slapi_entry_get_dn(entryAfter), 0, 0); + slapi_log_err(SLAPI_LOG_ERR, + "ldbm_instance_index_config_modify_callback", "Malformed index entry %s - missing cn attribute\n", + slapi_entry_get_dn(entryAfter)); *returncode = LDAP_OBJECT_CLASS_VIOLATION; return SLAPI_DSE_CALLBACK_ERROR; } @@ -208,26 +208,26 @@ ldbm_instance_index_config_modify_callback(Slapi_PBlock *pb, Slapi_Entry *e, attrValue = slapi_value_get_berval(sval); if (NULL == attrValue->bv_val || 0 == attrValue->bv_len) { - LDAPDebug(LDAP_DEBUG_ERR, - "ldbm_instance_index_config_modify_callback - Malformed index entry %s, missing index name\n", - slapi_entry_get_dn(e), 0, 0); + slapi_log_err(SLAPI_LOG_ERR, + "ldbm_instance_index_config_modify_callback", "Malformed index entry %s, missing index name\n", + slapi_entry_get_dn(e)); *returncode = LDAP_UNWILLING_TO_PERFORM; return SLAPI_DSE_CALLBACK_ERROR; } ainfo_get(inst->inst_be, attrValue->bv_val, &ainfo); if (NULL == ainfo) { - LDAPDebug(LDAP_DEBUG_ERR, - "ldbm_instance_index_config_modify_callback - Malformed index entry %s - missing cn attribute info\n", - slapi_entry_get_dn(e), 0, 0); + slapi_log_err(SLAPI_LOG_ERR, + "ldbm_instance_index_config_modify_callback", "Malformed index entry %s - missing cn attribute info\n", + slapi_entry_get_dn(e)); *returncode = LDAP_UNWILLING_TO_PERFORM; return SLAPI_DSE_CALLBACK_ERROR; } if(slapi_entry_attr_find(entryAfter, "nsIndexType", &attr) != 0){ - LDAPDebug(LDAP_DEBUG_ERR, - "ldbm_instance_index_config_modify_callback - Malformed index entry %s - missing nsIndexType attribute\n", - slapi_entry_get_dn(entryAfter), 0, 0); + slapi_log_err(SLAPI_LOG_ERR, + "ldbm_instance_index_config_modify_callback", "Malformed index entry %s - missing nsIndexType attribute\n", + slapi_entry_get_dn(entryAfter)); *returncode = LDAP_OBJECT_CLASS_VIOLATION; return SLAPI_DSE_CALLBACK_ERROR; } @@ -259,17 +259,17 @@ int ldbm_instance_config_add_index_entry( /* get the cn value */ if (slapi_entry_attr_find(e, "cn", &attr) != 0) { - LDAPDebug(LDAP_DEBUG_ERR, "ldbm_instance_config_add_index_entry - Malformed index entry %s, missing cn attrbiute\n", - slapi_entry_get_dn(e), 0, 0); + slapi_log_err(SLAPI_LOG_ERR, "ldbm_instance_config_add_index_entry", "Malformed index entry %s, missing cn attrbiute\n", + slapi_entry_get_dn(e)); return -1; } slapi_attr_first_value(attr, &sval); attrValue = slapi_value_get_berval(sval); if (NULL == attrValue->bv_val || 0 == attrValue->bv_len) { - LDAPDebug(LDAP_DEBUG_ERR, - "ldbm_instance_config_add_index_entry - Malformed index entry %s, missing index name\n", - slapi_entry_get_dn(e), 0, 0); + slapi_log_err(SLAPI_LOG_ERR, + "ldbm_instance_config_add_index_entry", "Malformed index entry %s, missing index name\n", + slapi_entry_get_dn(e)); return -1; } @@ -277,8 +277,8 @@ int ldbm_instance_config_add_index_entry( dn = slapi_create_dn_string("cn=%s,cn=index,cn=%s,cn=%s,cn=plugins,cn=config", basetype, inst->inst_name, li->li_plugin->plg_name); if (NULL == dn) { - LDAPDebug(LDAP_DEBUG_ERR, - "ldbm_instance_config_add_index_entry - " + slapi_log_err(SLAPI_LOG_ERR, + "ldbm_instance_config_add_index_entry", "Failed create index dn with type %s for plugin %s, " "instance %s\n", basetype, inst->inst_li->li_plugin->plg_name, @@ -304,8 +304,8 @@ int ldbm_instance_config_add_index_entry( eBuf = PR_sprintf_append(eBuf, "nsIndexType: %s\n", attrValue->bv_val); } } else { - LDAPDebug(LDAP_DEBUG_ERR, - "ldbm_instance_config_add_index_entry - " + slapi_log_err(SLAPI_LOG_ERR, + "ldbm_instance_config_add_index_entry", "Failed create index dn with type %s for plugin %s, " "instance %s. Missing nsIndexType\n", basetype, inst->inst_li->li_plugin->plg_name, @@ -377,9 +377,9 @@ int ldbm_instance_create_default_user_indexes(ldbm_instance *inst) int flags = LDBM_INSTANCE_CONFIG_DONT_WRITE; if (NULL == inst) { - LDAPDebug(LDAP_DEBUG_ERR, - "ldbm_instance_create_default_user_indexes - " - "Can't initialize default user indexes (invalid instance).\n", 0,0,0); + slapi_log_err(SLAPI_LOG_ERR, + "ldbm_instance_create_default_user_indexes", + "Can't initialize default user indexes (invalid instance).\n"); return -1; } @@ -389,8 +389,8 @@ int ldbm_instance_create_default_user_indexes(ldbm_instance *inst) basedn = slapi_create_dn_string("cn=default indexes,cn=config,cn=%s,cn=plugins,cn=config", li->li_plugin->plg_name); if (NULL == basedn) { - LDAPDebug1Arg(LDAP_DEBUG_ERR, - "ldbm_instance_create_default_user_indexes - " + slapi_log_err(SLAPI_LOG_ERR, + "ldbm_instance_create_default_user_indexes", "Failed create default index dn for plugin %s\n", inst->inst_li->li_plugin->plg_name); return -1; @@ -410,9 +410,9 @@ int ldbm_instance_create_default_user_indexes(ldbm_instance *inst) * of the cn attribute. */ if (slapi_entry_attr_find(entries[i], "cn", &attr) != 0) { - LDAPDebug(LDAP_DEBUG_ERR,"ldbm_instance_create_default_user_indexes - " + slapi_log_err(SLAPI_LOG_ERR,"ldbm_instance_create_default_user_indexes", "Malformed index entry %s. Index ignored.\n", - slapi_entry_get_dn(entries[i]), 0, 0); + slapi_entry_get_dn(entries[i])); continue; } diff --git a/ldap/servers/slapd/back-ldbm/ldbm_instance_config.c b/ldap/servers/slapd/back-ldbm/ldbm_instance_config.c index ebbdce8..2d23ea5 100644 --- a/ldap/servers/slapd/back-ldbm/ldbm_instance_config.c +++ b/ldap/servers/slapd/back-ldbm/ldbm_instance_config.c @@ -110,7 +110,7 @@ ldbm_instance_config_cachememsize_set(void *arg, void *value, char *errorbuf, in delta = val - inst->inst_cache.c_maxsize; if (!util_is_cachesize_sane(&delta)){ slapi_create_errormsg(errorbuf, SLAPI_DSE_RETURNTEXT_SIZE, "Error: cachememsize value is too large."); - LDAPDebug0Args(LDAP_DEBUG_ERR, "ldbm_instance_config_cachememsize_set - cachememsize value is too large.\n"); + slapi_log_err(SLAPI_LOG_ERR, "ldbm_instance_config_cachememsize_set", "cachememsize value is too large.\n"); return LDAP_UNWILLING_TO_PERFORM; } } @@ -153,7 +153,7 @@ ldbm_instance_config_dncachememsize_set(void *arg, void *value, char *errorbuf, if (!util_is_cachesize_sane(&delta)){ slapi_create_errormsg(errorbuf, SLAPI_DSE_RETURNTEXT_SIZE, "Error: dncachememsize value is too large."); - LDAPDebug0Args(LDAP_DEBUG_ERR,"ldbm_instance_config_dncachememsize_set - " + slapi_log_err(SLAPI_LOG_ERR,"ldbm_instance_config_dncachememsize_set", "dncachememsize value is too large.\n"); return LDAP_UNWILLING_TO_PERFORM; } @@ -352,8 +352,8 @@ read_instance_index_entries(ldbm_instance *inst) basedn = slapi_create_dn_string("cn=index,cn=%s,cn=%s,cn=plugins,cn=config", inst->inst_name, inst->inst_li->li_plugin->plg_name); if (NULL == basedn) { - LDAPDebug2Args(LDAP_DEBUG_ERR, - "read_instance_index_entries - " + slapi_log_err(SLAPI_LOG_ERR, + "read_instance_index_entries", "Failed create index dn for plugin %s, instance %s\n", inst->inst_li->li_plugin->plg_name, inst->inst_name); return 1; @@ -396,8 +396,8 @@ read_instance_attrcrypt_entries(ldbm_instance *inst) basedn = slapi_create_dn_string("cn=encrypted attributes,cn=%s,cn=%s,cn=plugins,cn=config", inst->inst_name, inst->inst_li->li_plugin->plg_name); if (NULL == basedn) { - LDAPDebug2Args(LDAP_DEBUG_ERR, - "read_instance_attrcrypt_entries - " + slapi_log_err(SLAPI_LOG_ERR, + "read_instance_attrcrypt_entries", "Failed create encrypted attributes dn for plugin %s, " "instance %s\n", inst->inst_li->li_plugin->plg_name, inst->inst_name); @@ -471,9 +471,9 @@ parse_ldbm_instance_config_entry(ldbm_instance *inst, Slapi_Entry *e, config_inf if (ldbm_config_set((void *) inst, attr_name, config_array, bval, err_buf, CONFIG_PHASE_STARTUP, 1 /* apply */, LDAP_MOD_REPLACE) != LDAP_SUCCESS) { - LDAPDebug(LDAP_DEBUG_ERR, "parse_ldbm_instance_config_entry - " + slapi_log_err(SLAPI_LOG_ERR, "parse_ldbm_instance_config_entry", "Error with config attribute %s : %s\n", - attr_name, err_buf, 0); + attr_name, err_buf); return 1; } } @@ -514,8 +514,8 @@ ldbm_instance_config_load_dse_info(ldbm_instance *inst) dn = slapi_create_dn_string("cn=%s,cn=%s,cn=plugins,cn=config", inst->inst_name, li->li_plugin->plg_name); if (NULL == dn) { - LDAPDebug2Args(LDAP_DEBUG_ERR, - "ldbm_instance_config_load_dse_info - " + slapi_log_err(SLAPI_LOG_ERR, + "ldbm_instance_config_load_dse_info", "Failed create instance dn %s for plugin %s\n", inst->inst_name, inst->inst_li->li_plugin->plg_name); rval = 1; @@ -524,9 +524,7 @@ ldbm_instance_config_load_dse_info(ldbm_instance *inst) search_pb = slapi_pblock_new(); if (!search_pb) { - LDAPDebug(LDAP_DEBUG_ERR, - "ldbm_instance_config_load_dse_info - Out of memory\n", - 0, 0, 0); + slapi_log_err(SLAPI_LOG_ERR, "ldbm_instance_config_load_dse_info", "Out of memory\n"); rval = 1; goto bail; } @@ -538,8 +536,8 @@ ldbm_instance_config_load_dse_info(ldbm_instance *inst) slapi_pblock_get(search_pb, SLAPI_PLUGIN_INTOP_RESULT, &rval); if (rval != LDAP_SUCCESS) { - LDAPDebug(LDAP_DEBUG_ERR, "ldbm_instance_config_load_dse_info - " - "Error accessing the config DSE entry (%s), error %d\n", dn, rval, 0); + slapi_log_err(SLAPI_LOG_ERR, "ldbm_instance_config_load_dse_info", + "Error accessing the config DSE entry (%s), error %d\n", dn, rval); rval = 1; goto bail; } else { @@ -548,15 +546,15 @@ ldbm_instance_config_load_dse_info(ldbm_instance *inst) slapi_pblock_get(search_pb, SLAPI_PLUGIN_INTOP_SEARCH_ENTRIES, &entries); if ((!entries) || (!entries[0])) { - LDAPDebug(LDAP_DEBUG_ERR, "ldbm_instance_config_load_dse_info - " - "No entries found in config DSE entry (%s)\n", dn, 0, 0); + slapi_log_err(SLAPI_LOG_ERR, "ldbm_instance_config_load_dse_info", + "No entries found in config DSE entry (%s)\n", dn); rval = 1; goto bail; } if (0 != parse_ldbm_instance_config_entry(inst, entries[0], ldbm_instance_config)) { - LDAPDebug(LDAP_DEBUG_ERR, "ldbm_instance_config_load_dse_info - " - "Error parsing the config DSE\n", 0, 0, 0); + slapi_log_err(SLAPI_LOG_ERR, "ldbm_instance_config_load_dse_info", + "Error parsing the config DSE\n"); rval = 1; goto bail; } @@ -595,8 +593,8 @@ ldbm_instance_config_load_dse_info(ldbm_instance *inst) dn = slapi_create_dn_string("cn=monitor,cn=%s,cn=%s,cn=plugins,cn=config", inst->inst_name, li->li_plugin->plg_name); if (NULL == dn) { - LDAPDebug2Args(LDAP_DEBUG_ERR, - "ldbm_instance_config_load_dse_info - " + slapi_log_err(SLAPI_LOG_ERR, + "ldbm_instance_config_load_dse_info", "failed create monitor instance dn for plugin %s, " "instance %s\n", inst->inst_li->li_plugin->plg_name, inst->inst_name); @@ -620,8 +618,8 @@ ldbm_instance_config_load_dse_info(ldbm_instance *inst) dn = slapi_create_dn_string("cn=index,cn=%s,cn=%s,cn=plugins,cn=config", inst->inst_name, li->li_plugin->plg_name); if (NULL == dn) { - LDAPDebug2Args(LDAP_DEBUG_ERR, - "ldbm_instance_config_load_dse_info - " + slapi_log_err(SLAPI_LOG_ERR, + "ldbm_instance_config_load_dse_info", "failed create index instance dn for plugin %s, " "instance %s\n", inst->inst_li->li_plugin->plg_name, inst->inst_name); @@ -643,8 +641,8 @@ ldbm_instance_config_load_dse_info(ldbm_instance *inst) dn = slapi_create_dn_string("cn=encrypted attributes,cn=%s,cn=%s,cn=plugins,cn=config", inst->inst_name, li->li_plugin->plg_name); if (NULL == dn) { - LDAPDebug2Args(LDAP_DEBUG_ERR, - "ldbm_instance_config_load_dse_info - " + slapi_log_err(SLAPI_LOG_ERR, + "ldbm_instance_config_load_dse_info", "failed create encrypted attribute instance dn " "for plugin %s, instance %s\n", inst->inst_li->li_plugin->plg_name, inst->inst_name); @@ -763,9 +761,9 @@ ldbm_instance_modify_config_entry_callback(Slapi_PBlock *pb, Slapi_Entry* entryB if (!returntext) { rc = LDAP_OPERATIONS_ERROR; - LDAPDebug(LDAP_DEBUG_ERR, - "ldbm_instance_modify_config_entry_callback - " - "NULL return text\n", 0, 0, 0); + slapi_log_err(SLAPI_LOG_ERR, + "ldbm_instance_modify_config_entry_callback", + "NULL return text\n"); goto out; } @@ -784,10 +782,8 @@ ldbm_instance_modify_config_entry_callback(Slapi_PBlock *pb, Slapi_Entry* entryB rc = LDAP_UNWILLING_TO_PERFORM; PR_snprintf(returntext, SLAPI_DSE_RETURNTEXT_SIZE, "Can't change the root suffix of a backend"); - LDAPDebug(LDAP_DEBUG_ERR, - "ldbm_instance_modify_config_entry_callback - Modify attempted to " - "change the root suffix of a backend (which is not allowed)\n", - 0, 0, 0); + slapi_log_err(SLAPI_LOG_ERR, "ldbm_instance_modify_config_entry_callback", + "Modify attempted to change the root suffix of a backend (which is not allowed)\n"); continue; } @@ -839,8 +835,8 @@ ldbm_instance_config_internal_set(ldbm_instance *inst, char *attrname, char *val if (ldbm_config_set((void *) inst, attrname, ldbm_instance_config, &bval, err_buf, CONFIG_PHASE_INTERNAL, 1 /* apply */, LDAP_MOD_REPLACE) != LDAP_SUCCESS) { - LDAPDebug(LDAP_DEBUG_CRIT, - "ldbm_instance_config_internal_set - " + slapi_log_err(SLAPI_LOG_CRIT, + "ldbm_instance_config_internal_set", "Internal error setting instance config attr %s to %s: %s\n", attrname, value, err_buf); exit(1); @@ -906,10 +902,10 @@ ldbm_instance_postadd_instance_entry_callback(Slapi_PBlock *pb, Slapi_Entry* ent parse_ldbm_instance_entry(entryBefore, &instance_name); rval = ldbm_instance_generate(li, instance_name, &be); if (rval) { - LDAPDebug(LDAP_DEBUG_ERR, - "ldbm_instance_postadd_instance_entry_callback - " + slapi_log_err(SLAPI_LOG_ERR, + "ldbm_instance_postadd_instance_entry_callback", "ldbm_instance_generate (%s) failed (%d)\n", - instance_name, rval, 0); + instance_name, rval); } inst = ldbm_instance_find_by_name(li, instance_name); @@ -926,10 +922,10 @@ ldbm_instance_postadd_instance_entry_callback(Slapi_PBlock *pb, Slapi_Entry* ent rval = ldbm_instance_start(be); if (0 != rval) { - LDAPDebug(LDAP_DEBUG_ERR, - "ldbm_instance_postadd_instance_entry_callback - " + slapi_log_err(SLAPI_LOG_ERR, + "ldbm_instance_postadd_instance_entry_callback", "ldbm_instnace_start (%s) failed (%d)\n", - instance_name, rval, 0); + instance_name, rval); } slapi_ch_free((void **)&instance_name); @@ -953,8 +949,8 @@ ldbm_instance_add_instance_entry_callback(Slapi_PBlock *pb, Slapi_Entry* entryBe /* Make sure we don't create two instances with the same name. */ inst = ldbm_instance_find_by_name(li, instance_name); if (inst != NULL) { - LDAPDebug(LDAP_DEBUG_WARNING, "ldbm_instance_add_instance_entry_callback: " - " ldbm instance %s already exists\n", instance_name, 0, 0); + slapi_log_err(SLAPI_LOG_WARNING, "ldbm_instance_add_instance_entry_callback", + "ldbm instance %s already exists\n", instance_name); if (returntext != NULL) PR_snprintf(returntext, SLAPI_DSE_RETURNTEXT_SIZE, "An ldbm instance with the name %s already exists\n", instance_name); @@ -996,8 +992,8 @@ static void ldbm_instance_unregister_callbacks(ldbm_instance *inst) dn = slapi_create_dn_string("cn=%s,cn=%s,cn=plugins,cn=config", inst->inst_name, li->li_plugin->plg_name); if (NULL == dn) { - LDAPDebug2Args(LDAP_DEBUG_ERR, - "ldbm_instance_unregister_callbacks - " + slapi_log_err(SLAPI_LOG_ERR, + "ldbm_instance_unregister_callbacks", "Failed create instance dn for plugin %s, " "instance %s\n", inst->inst_li->li_plugin->plg_name, inst->inst_name); @@ -1021,8 +1017,8 @@ static void ldbm_instance_unregister_callbacks(ldbm_instance *inst) dn = slapi_create_dn_string("cn=monitor,cn=%s,cn=%s,cn=plugins,cn=config", inst->inst_name, li->li_plugin->plg_name); if (NULL == dn) { - LDAPDebug2Args(LDAP_DEBUG_ERR, - "ldbm_instance_unregister_callbacks - " + slapi_log_err(SLAPI_LOG_ERR, + "ldbm_instance_unregister_callbacks", "Failed create monitor instance dn for plugin %s, " "instance %s\n", inst->inst_li->li_plugin->plg_name, inst->inst_name); @@ -1040,8 +1036,8 @@ static void ldbm_instance_unregister_callbacks(ldbm_instance *inst) dn = slapi_create_dn_string("cn=index,cn=%s,cn=%s,cn=plugins,cn=config", inst->inst_name, li->li_plugin->plg_name); if (NULL == dn) { - LDAPDebug2Args(LDAP_DEBUG_ERR, - "ldbm_instance_unregister_callbacks - " + slapi_log_err(SLAPI_LOG_ERR, + "ldbm_instance_unregister_callbacks", "Failed create index dn for plugin %s, " "instance %s\n", inst->inst_li->li_plugin->plg_name, inst->inst_name); @@ -1062,8 +1058,8 @@ static void ldbm_instance_unregister_callbacks(ldbm_instance *inst) dn = slapi_create_dn_string("cn=encrypted attributes,cn=%s,cn=%s,cn=plugins,cn=config", inst->inst_name, li->li_plugin->plg_name); if (NULL == dn) { - LDAPDebug2Args(LDAP_DEBUG_ERR, - "ldbm_instance_unregister_callbacks - " + slapi_log_err(SLAPI_LOG_ERR, + "ldbm_instance_unregister_callbacks", "failed create encrypted attributes dn for plugin %s, " "instance %s\n", inst->inst_li->li_plugin->plg_name, inst->inst_name); @@ -1096,8 +1092,8 @@ ldbm_instance_post_delete_instance_entry_callback(Slapi_PBlock *pb, Slapi_Entry* inst = ldbm_instance_find_by_name(li, instance_name); if (inst == NULL) { - LDAPDebug(LDAP_DEBUG_ERR, "ldbm_instance_post_delete_instance_entry_callback - " - "Instance '%s' does not exist!\n", instance_name, 0, 0); + slapi_log_err(SLAPI_LOG_ERR, "ldbm_instance_post_delete_instance_entry_callback", + "Instance '%s' does not exist!\n", instance_name); if (returntext) { PR_snprintf(returntext, SLAPI_DSE_RETURNTEXT_SIZE, "No ldbm instance exists with the name '%s'\n", instance_name); @@ -1109,8 +1105,8 @@ ldbm_instance_post_delete_instance_entry_callback(Slapi_PBlock *pb, Slapi_Entry* return SLAPI_DSE_CALLBACK_ERROR; } - LDAPDebug(LDAP_DEBUG_ERR, "ldbm_instance_post_delete_instance_entry_callback - " - "Removing '%s'.\n", instance_name, 0, 0); + slapi_log_err(SLAPI_LOG_ERR, "ldbm_instance_post_delete_instance_entry_callback", + "Removing '%s'.\n", instance_name); cache_destroy_please(&inst->inst_cache, CACHE_TYPE_ENTRY); if (entryrdn_get_switch()) { /* subtree-rename: on */ @@ -1145,10 +1141,10 @@ ldbm_instance_post_delete_instance_entry_callback(Slapi_PBlock *pb, Slapi_Entry* dbp = PR_smprintf("%s/%s", inst_dirp, direntry->name); if (NULL == dbp) { - LDAPDebug(LDAP_DEBUG_ERR, - "ldbm_instance_post_delete_instance_entry_callback - " + slapi_log_err(SLAPI_LOG_ERR, + "ldbm_instance_post_delete_instance_entry_callback", "Failed to generate db path: %s/%s\n", - inst_dirp, direntry->name, 0); + inst_dirp, direntry->name); break; } @@ -1161,8 +1157,8 @@ ldbm_instance_post_delete_instance_entry_callback(Slapi_PBlock *pb, Slapi_Entry* } PR_ASSERT(rc == 0); if (rc != 0) { - LDAPDebug2Args(LDAP_DEBUG_ERR, - "ldbm_instance_post_delete_instance_entry_callback - " + slapi_log_err(SLAPI_LOG_ERR, + "ldbm_instance_post_delete_instance_entry_callback", "Failed to delete %s, error %d\n", dbp, rc); } PR_smprintf_free(dbp); @@ -1206,8 +1202,8 @@ ldbm_instance_delete_instance_entry_callback(Slapi_PBlock *pb, Slapi_Entry* entr parse_ldbm_instance_entry(entryBefore, &instance_name); inst = ldbm_instance_find_by_name(li, instance_name); if (inst == NULL) { - LDAPDebug(LDAP_DEBUG_ERR, "ldbm_instance_delete_instance_entry_callback - " - "Instance '%s' does not exist!\n", instance_name, 0, 0); + slapi_log_err(SLAPI_LOG_ERR, "ldbm_instance_delete_instance_entry_callback", + "Instance '%s' does not exist!\n", instance_name); if (returntext) { PR_snprintf(returntext, SLAPI_DSE_RETURNTEXT_SIZE, "No ldbm instance exists with the name '%s'\n", instance_name); @@ -1222,9 +1218,9 @@ ldbm_instance_delete_instance_entry_callback(Slapi_PBlock *pb, Slapi_Entry* entr /* check if some online task is happening */ if ((instance_set_busy(inst) != 0) || (slapi_counter_get_value(inst->inst_ref_count) > 0)) { - LDAPDebug(LDAP_DEBUG_WARNING, "ldbm_instance_delete_instance_entry_callback - " + slapi_log_err(SLAPI_LOG_WARNING, "ldbm_instance_delete_instance_entry_callback", "'%s' is in the middle of a task. Cancel the task or wait for it to finish, " - "then try again.\n", instance_name, 0, 0); + "then try again.\n", instance_name); if (returntext) { PR_snprintf(returntext, SLAPI_DSE_RETURNTEXT_SIZE, "ldbm instance '%s' is in the middle of a " "task. Cancel the task or wait for it to finish, " @@ -1238,8 +1234,8 @@ ldbm_instance_delete_instance_entry_callback(Slapi_PBlock *pb, Slapi_Entry* entr } /* okay, we're gonna delete this database instance. take it offline. */ - LDAPDebug(LDAP_DEBUG_INFO, "ldbm_instance_delete_instance_entry_callback - " - "Bringing %s offline...\n", instance_name, 0, 0); + slapi_log_err(SLAPI_LOG_INFO, "ldbm_instance_delete_instance_entry_callback", + "Bringing %s offline...\n", instance_name); slapi_mtn_be_stopping(inst->inst_be); dblayer_instance_close(inst->inst_be); slapi_ch_free((void **)&instance_name); diff --git a/ldap/servers/slapd/back-ldbm/ldbm_modify.c b/ldap/servers/slapd/back-ldbm/ldbm_modify.c index 30b83b8..307f7c2 100644 --- a/ldap/servers/slapd/back-ldbm/ldbm_modify.c +++ b/ldap/servers/slapd/back-ldbm/ldbm_modify.c @@ -88,7 +88,7 @@ int modify_switch_entries(modify_context *mc,backend *be) if (mc->old_entry && mc->new_entry) { ret = cache_replace(&(inst->inst_cache), mc->old_entry, mc->new_entry); if (ret) { - LDAPDebug(LDAP_DEBUG_CACHE, "modify_switch_entries: replacing %s with %s failed (%d)\n", + slapi_log_err(SLAPI_LOG_CACHE, "modify_switch_entries", "Replacing %s with %s failed (%d)\n", slapi_entry_get_dn(mc->old_entry->ep_entry), slapi_entry_get_dn(mc->new_entry->ep_entry), ret); } @@ -133,7 +133,7 @@ modify_unswitch_entries(modify_context *mc,backend *be) cache_unlock_entry(&inst->inst_cache, mc->new_entry); cache_lock_entry(&inst->inst_cache, mc->old_entry); } else { - LDAPDebug(LDAP_DEBUG_CACHE, "modify_unswitch_entries: replacing %s with %s failed (%d)\n", + slapi_log_err(SLAPI_LOG_CACHE, "modify_unswitch_entries", "Replacing %s with %s failed (%d)\n", slapi_entry_get_dn(mc->old_entry->ep_entry), slapi_entry_get_dn(mc->new_entry->ep_entry), ret); } @@ -180,7 +180,7 @@ int modify_update_all(backend *be, Slapi_PBlock *pb, if ( 0 != retval ) { if (DB_LOCK_DEADLOCK != retval) { - ldbm_nasty(function_name,66,retval); + ldbm_nasty(function_name,"",66,retval); } goto error; } @@ -188,7 +188,7 @@ int modify_update_all(backend *be, Slapi_PBlock *pb, if ( 0 != retval ) { if (DB_LOCK_DEADLOCK != retval) { - ldbm_nasty(function_name,65,retval); + ldbm_nasty(function_name,"",65,retval); } goto error; } @@ -203,7 +203,7 @@ int modify_update_all(backend *be, Slapi_PBlock *pb, if ( 0 != retval ) { if (DB_LOCK_DEADLOCK != retval) { - ldbm_nasty(function_name,64,retval); + ldbm_nasty(function_name,"",64,retval); } goto error; } @@ -431,7 +431,7 @@ ldbm_back_modify( Slapi_PBlock *pb ) if (inst && inst->inst_ref_count) { slapi_counter_increment(inst->inst_ref_count); } else { - LDAPDebug1Arg(LDAP_DEBUG_ERR, "ldbm_back_modify - " + slapi_log_err(SLAPI_LOG_ERR, "ldbm_back_modify", "Instance \"%s\" does not exist.\n", inst ? inst->inst_name : "null instance"); goto error_return; @@ -519,7 +519,7 @@ ldbm_back_modify( Slapi_PBlock *pb ) ruv_c_init = 0; } - LDAPDebug0Args(LDAP_DEBUG_BACKLDBM, + slapi_log_err(SLAPI_LOG_BACKLDBM, "ldbm_back_modify", "Modify Retrying Transaction\n"); #ifndef LDBM_NO_BACKOFF_DELAY { @@ -568,7 +568,7 @@ ldbm_back_modify( Slapi_PBlock *pb ) { ldap_result_code = LDAP_UNWILLING_TO_PERFORM; ldap_result_message = "Operation not allowed on tombstone entry."; - slapi_log_error(SLAPI_LOG_ERR, "ldbm_back_modify", + slapi_log_err(SLAPI_LOG_ERR, "ldbm_back_modify", "Attempt to modify a tombstone entry %s\n", slapi_sdn_get_dn(slapi_entry_get_sdn_const( e->ep_entry ))); goto error_return; @@ -617,7 +617,7 @@ ldbm_back_modify( Slapi_PBlock *pb ) slapi_pblock_get(pb, SLAPI_RESULT_CODE, &ldap_result_code); slapi_pblock_get(pb, SLAPI_PLUGIN_OPRETURN, &opreturn); if (!ldap_result_code) { - LDAPDebug0Args(LDAP_DEBUG_ERR, "ldbm_back_modify - " + slapi_log_err(SLAPI_LOG_ERR, "ldbm_back_modify", "SLAPI_PLUGIN_BE_PRE_MODIFY_FN " "returned error but did not set SLAPI_RESULT_CODE\n"); ldap_result_code = LDAP_OPERATIONS_ERROR; @@ -660,7 +660,7 @@ ldbm_back_modify( Slapi_PBlock *pb ) /* call the transaction pre modify plugins just after creating the transaction */ retval = plugin_call_plugins(pb, SLAPI_PLUGIN_BE_TXN_PRE_MODIFY_FN); if (retval) { - LDAPDebug1Arg(LDAP_DEBUG_TRACE, "SLAPI_PLUGIN_BE_TXN_PRE_MODIFY_FN plugin " + slapi_log_err(SLAPI_LOG_TRACE, "ldbm_back_modify", "SLAPI_PLUGIN_BE_TXN_PRE_MODIFY_FN plugin " "returned error code %d\n", retval ); slapi_pblock_get(pb, SLAPI_RESULT_CODE, &ldap_result_code); slapi_pblock_get(pb, SLAPI_PLUGIN_OPRETURN, &opreturn); @@ -684,7 +684,7 @@ ldbm_back_modify( Slapi_PBlock *pb ) slapi_mods_init_byref(&smods,mods); new_mod_count = slapi_mods_get_num_mods(&smods); if (new_mod_count < mod_count) { - LDAPDebug2Args(LDAP_DEBUG_ANY, "ldbm_back_modify - " + slapi_log_err(SLAPI_LOG_ERR, "ldbm_back_modify", "Error: BE_TXN_PRE_MODIFY plugin has removed " "mods from the original list - mod count was [%d] now [%d] " "mods will not be applied - mods list changes must be done " @@ -710,9 +710,9 @@ ldbm_back_modify( Slapi_PBlock *pb ) continue; } if (0 != retval) { - LDAPDebug(LDAP_DEBUG_ERR, "ldbm_back_modify - " + slapi_log_err(SLAPI_LOG_ERR, "ldbm_back_modify", "id2entry_add failed, err=%d %s\n", - retval, (msg = dblayer_strerror( retval )) ? msg : "", 0 ); + retval, (msg = dblayer_strerror( retval )) ? msg : ""); if (LDBM_OS_ERR_IS_DISKFULL(retval)) disk_full = 1; MOD_SET_ERROR(ldap_result_code, LDAP_OPERATIONS_ERROR, retry_count); goto error_return; @@ -724,9 +724,9 @@ ldbm_back_modify( Slapi_PBlock *pb ) continue; } if (0 != retval) { - LDAPDebug(LDAP_DEBUG_ERR, "ldbm_back_modify - " + slapi_log_err(SLAPI_LOG_ERR, "ldbm_back_modify", "index_add_mods failed, err=%d %s\n", - retval, (msg = dblayer_strerror( retval )) ? msg : "", 0 ); + retval, (msg = dblayer_strerror( retval )) ? msg : ""); if (LDBM_OS_ERR_IS_DISKFULL(retval)) disk_full = 1; MOD_SET_ERROR(ldap_result_code, LDAP_OPERATIONS_ERROR, retry_count); goto error_return; @@ -744,9 +744,9 @@ ldbm_back_modify( Slapi_PBlock *pb ) continue; } if (0 != retval) { - LDAPDebug(LDAP_DEBUG_ERR, "ldbm_back_modify - " + slapi_log_err(SLAPI_LOG_ERR, "ldbm_back_modify", "vlv_update_index failed, err=%d %s\n", - retval, (msg = dblayer_strerror( retval )) ? msg : "", 0 ); + retval, (msg = dblayer_strerror( retval )) ? msg : ""); if (LDBM_OS_ERR_IS_DISKFULL(retval)) disk_full = 1; MOD_SET_ERROR(ldap_result_code, LDAP_OPERATIONS_ERROR, retry_count); @@ -758,9 +758,8 @@ ldbm_back_modify( Slapi_PBlock *pb ) if (!is_ruv && !is_fixup_operation && !NO_RUV_UPDATE(li)) { ruv_c_init = ldbm_txn_ruv_modify_context( pb, &ruv_c ); if (-1 == ruv_c_init) { - LDAPDebug(LDAP_DEBUG_ERR, "ldbm_back_modify - " - "ldbm_txn_ruv_modify_context failed to construct RUV modify context\n", - 0, 0, 0); + slapi_log_err(SLAPI_LOG_ERR, "ldbm_back_modify", + "ldbm_txn_ruv_modify_context failed to construct RUV modify context\n"); ldap_result_code= LDAP_OPERATIONS_ERROR; retval = 0; goto error_return; @@ -774,9 +773,9 @@ ldbm_back_modify( Slapi_PBlock *pb ) continue; } if (0 != retval) { - LDAPDebug(LDAP_DEBUG_ERR, "ldbm_back_modify - " + slapi_log_err(SLAPI_LOG_ERR, "ldbm_back_modify", "modify_update_all failed, err=%d %s\n", retval, - (msg = dblayer_strerror( retval )) ? msg : "", 0 ); + (msg = dblayer_strerror( retval )) ? msg : ""); if (LDBM_OS_ERR_IS_DISKFULL(retval)) disk_full = 1; ldap_result_code= LDAP_OPERATIONS_ERROR; @@ -789,8 +788,8 @@ ldbm_back_modify( Slapi_PBlock *pb ) } } if (retry_count == RETRY_TIMES) { - LDAPDebug(LDAP_DEBUG_ERR, "ldbm_back_modify - " - "Retry count exceeded in modify\n", 0, 0, 0 ); + slapi_log_err(SLAPI_LOG_ERR, "ldbm_back_modify", + "Retry count exceeded in modify\n"); ldap_result_code= LDAP_BUSY; goto error_return; } @@ -798,8 +797,8 @@ ldbm_back_modify( Slapi_PBlock *pb ) if (ruv_c_init) { if (modify_switch_entries(&ruv_c, be) != 0 ) { ldap_result_code= LDAP_OPERATIONS_ERROR; - LDAPDebug(LDAP_DEBUG_ERR, "ldbm_back_modify - " - "modify_switch_entries failed\n", 0, 0, 0); + slapi_log_err(SLAPI_LOG_ERR, "ldbm_back_modify", + "modify_switch_entries failed\n"); goto error_return; } } @@ -834,7 +833,7 @@ ldbm_back_modify( Slapi_PBlock *pb ) /* call the transaction post modify plugins just before the commit */ if ((retval = plugin_call_plugins(pb, SLAPI_PLUGIN_BE_TXN_POST_MODIFY_FN))) { - LDAPDebug1Arg(LDAP_DEBUG_TRACE, "ldbm_back_modify - " + slapi_log_err(SLAPI_LOG_TRACE, "ldbm_back_modify", "SLAPI_PLUGIN_BE_TXN_POST_MODIFY_FN plugin " "returned error code %d\n", retval ); if (!ldap_result_code) { @@ -872,7 +871,7 @@ error_return: } if (retval == DB_RUNRECOVERY) { dblayer_remember_disk_filled(li); - ldbm_nasty("Modify",81,retval); + ldbm_nasty("ldbm_back_modify","Modify",81,retval); disk_full = 1; } @@ -900,8 +899,8 @@ error_return: keep track of a counter (usn, dna) may want to "rollback" the counter in this case */ if ((retval = plugin_call_plugins(pb, SLAPI_PLUGIN_BE_TXN_POST_MODIFY_FN))) { - LDAPDebug1Arg(LDAP_DEBUG_TRACE, "SLAPI_PLUGIN_BE_TXN_POST_MODIFY_FN plugin " - "returned error code %d\n", retval ); + slapi_log_err(SLAPI_LOG_TRACE, "ldbm_back_modify", + "SLAPI_PLUGIN_BE_TXN_POST_MODIFY_FN plugin returned error code %d\n", retval ); slapi_pblock_get(pb, SLAPI_RESULT_CODE, &ldap_result_code); slapi_pblock_get(pb, SLAPI_PB_RESULT_TEXT, &ldap_result_message); slapi_pblock_get(pb, SLAPI_PLUGIN_OPRETURN, &opreturn); @@ -927,7 +926,7 @@ error_return: /* if ec was in cache, e was not - add back e */ if (e) { if (CACHE_ADD( &inst->inst_cache, e, NULL ) < 0) { - LDAPDebug1Arg(LDAP_DEBUG_CACHE, "ldbm_modify: CACHE_ADD %s failed\n", + slapi_log_err(SLAPI_LOG_CACHE, "ldbm_back_modify", "CACHE_ADD %s failed\n", slapi_entry_get_dn(e->ep_entry)); } } diff --git a/ldap/servers/slapd/back-ldbm/ldbm_modrdn.c b/ldap/servers/slapd/back-ldbm/ldbm_modrdn.c index 7165531..c2d0eca 100644 --- a/ldap/servers/slapd/back-ldbm/ldbm_modrdn.c +++ b/ldap/servers/slapd/back-ldbm/ldbm_modrdn.c @@ -142,7 +142,7 @@ ldbm_back_modrdn( Slapi_PBlock *pb ) if (pb->pb_conn) { - slapi_log_error(SLAPI_LOG_TRACE, "ldbm_back_modrdn", "enter conn=%" NSPRIu64 " op=%d\n", + slapi_log_err(SLAPI_LOG_TRACE, "ldbm_back_modrdn", "enter conn=%" NSPRIu64 " op=%d\n", pb->pb_conn->c_connid, operation->o_opid); } @@ -188,7 +188,7 @@ ldbm_back_modrdn( Slapi_PBlock *pb ) if (inst && inst->inst_ref_count) { slapi_counter_increment(inst->inst_ref_count); } else { - LDAPDebug1Arg(LDAP_DEBUG_ERR, "ldbm_back_modrdn - " + slapi_log_err(SLAPI_LOG_ERR, "ldbm_back_modrdn", "Instance \"%s\" does not exist.\n", inst ? inst->inst_name : "null instance"); return( -1 ); @@ -267,8 +267,8 @@ ldbm_back_modrdn( Slapi_PBlock *pb ) CACHE_RETURN(&inst->inst_cache, &ec); if (!cache_is_in_cache(&inst->inst_cache, e)) { if (CACHE_ADD(&inst->inst_cache, e, NULL) < 0) { - LDAPDebug1Arg(LDAP_DEBUG_CACHE, - "ldbm_back_modrdn: CACHE_ADD %s to cache failed\n", + slapi_log_err(SLAPI_LOG_CACHE, + "ldbm_back_modrdn", "CACHE_ADD %s to cache failed\n", slapi_entry_get_dn_const(e->ep_entry)); } } @@ -287,7 +287,7 @@ ldbm_back_modrdn( Slapi_PBlock *pb ) /* allow modrdn even if the src dn and dest dn are identical */ if ( 0 != slapi_sdn_compare((const Slapi_DN *)&dn_newdn, (const Slapi_DN *)sdn) ) { - LDAPDebug1Arg(LDAP_DEBUG_ERR, "ldbm_back_modrdn - " + slapi_log_err(SLAPI_LOG_ERR, "ldbm_back_modrdn", "Adding %s to cache failed\n", slapi_entry_get_dn_const(ec->ep_entry)); ldap_result_code = LDAP_OPERATIONS_ERROR; @@ -312,7 +312,7 @@ ldbm_back_modrdn( Slapi_PBlock *pb ) ruv_c_init = 0; } /* We're re-trying */ - LDAPDebug0Args(LDAP_DEBUG_BACKLDBM, + slapi_log_err(SLAPI_LOG_BACKLDBM, "ldbm_back_modrdn", "Modrdn Retrying Transaction\n"); #ifndef LDBM_NO_BACKOFF_DELAY { @@ -485,7 +485,7 @@ ldbm_back_modrdn( Slapi_PBlock *pb ) !is_resurect_operation) { ldap_result_code = LDAP_UNWILLING_TO_PERFORM; ldap_result_message = "Operation not allowed on tombstone entry."; - slapi_log_error(SLAPI_LOG_ERR, "ldbm_back_modrdn", + slapi_log_err(SLAPI_LOG_ERR, "ldbm_back_modrdn", "Attempt to rename a tombstone entry %s\n", slapi_sdn_get_dn(slapi_entry_get_sdn_const( e->ep_entry ))); goto error_return; @@ -586,11 +586,11 @@ ldbm_back_modrdn( Slapi_PBlock *pb ) CACHE_RETURN( &inst->inst_cache, &ancestorentry ); ldap_result_matcheddn= slapi_ch_strdup((char *) slapi_sdn_get_dn(&ancestorsdn)); ldap_result_code= LDAP_NO_SUCH_OBJECT; - LDAPDebug(LDAP_DEBUG_TRACE, "ldbm_back_modrdn: New superior " + slapi_log_err(SLAPI_LOG_TRACE, "ldbm_back_modrdn", "New superior " "does not exist matched %s, newsuperior = %s\n", ldap_result_matcheddn == NULL ? "NULL" : ldap_result_matcheddn, - slapi_sdn_get_ndn(dn_newsuperiordn), 0 ); + slapi_sdn_get_ndn(dn_newsuperiordn)); slapi_sdn_done(&ancestorsdn); goto error_return; } @@ -603,7 +603,7 @@ ldbm_back_modrdn( Slapi_PBlock *pb ) ldap_result_code = plugin_call_acl_plugin(pb, newparententry->ep_entry, NULL, NULL, SLAPI_ACL_MODDN, ACLPLUGIN_ACCESS_DEFAULT, &errbuf); if (ldap_result_code != LDAP_SUCCESS) { ldap_result_message = errbuf; - LDAPDebug(LDAP_DEBUG_TRACE, "No 'moddn' access to new superior.\n", 0, 0, 0); + slapi_log_err(SLAPI_LOG_TRACE, "ldbm_back_modrdn", "No 'moddn' access to new superior.\n"); goto error_return; } } else { @@ -611,7 +611,7 @@ ldbm_back_modrdn( Slapi_PBlock *pb ) ldap_result_code = plugin_call_acl_plugin (pb, newparententry->ep_entry, NULL, NULL, SLAPI_ACL_ADD, ACLPLUGIN_ACCESS_DEFAULT, &errbuf ); if (ldap_result_code != LDAP_SUCCESS) { ldap_result_message = errbuf; - LDAPDebug(LDAP_DEBUG_TRACE, "No 'add' access to new superior.\n", 0, 0, 0); + slapi_log_err(SLAPI_LOG_TRACE, "ldbm_back_modrdn", "No 'add' access to new superior.\n"); goto error_return; } } @@ -626,8 +626,9 @@ ldbm_back_modrdn( Slapi_PBlock *pb ) /* Here means that we didn't find the parent */ ldap_result_matcheddn = "NULL"; ldap_result_code= LDAP_NO_SUCH_OBJECT; - LDAPDebug(LDAP_DEBUG_TRACE, "Parent does not exist matched %s, parentdn = %s\n", - ldap_result_matcheddn, slapi_sdn_get_ndn(&dn_parentdn), 0 ); + slapi_log_err(SLAPI_LOG_TRACE, "ldbm_back_modrdn", + "Parent does not exist matched %s, parentdn = %s\n", + ldap_result_matcheddn, slapi_sdn_get_ndn(&dn_parentdn)); goto error_return; } } @@ -680,15 +681,15 @@ ldbm_back_modrdn( Slapi_PBlock *pb ) } if(is_resurect_operation) { - slapi_log_error(SLAPI_LOG_REPL, "ldbm_back_modrdn", + slapi_log_err(SLAPI_LOG_REPL, "ldbm_back_modrdn", "Resurrecting an entry %s\n", slapi_entry_get_dn(ec->ep_entry)); slapi_entry_attr_delete(ec->ep_entry, SLAPI_ATTR_VALUE_PARENT_UNIQUEID); slapi_entry_attr_delete(ec->ep_entry, SLAPI_ATTR_TOMBSTONE_CSN); slapi_entry_delete_string(ec->ep_entry, SLAPI_ATTR_OBJECTCLASS, SLAPI_ATTR_VALUE_TOMBSTONE); /* Now also remove the nscpEntryDN */ if (slapi_entry_attr_delete(ec->ep_entry, SLAPI_ATTR_NSCP_ENTRYDN) != 0){ - LDAPDebug(LDAP_DEBUG_REPL, "Resurrection of %s - Couldn't remove %s\n", - slapi_entry_get_dn(ec->ep_entry), SLAPI_ATTR_NSCP_ENTRYDN, 0); + slapi_log_err(SLAPI_LOG_REPL, "ldbm_back_modrdn", "Resurrection of %s - Couldn't remove %s\n", + slapi_entry_get_dn(ec->ep_entry), SLAPI_ATTR_NSCP_ENTRYDN); } /* Set the reason (this is only a reason why modrdn is needed for resurrection) */ @@ -740,7 +741,7 @@ ldbm_back_modrdn( Slapi_PBlock *pb ) /* JCMREPL - Hmm... we can't permit this to happen...? */ ldap_result_code= LDAP_ALREADY_EXISTS; if (is_resurect_operation) { - slapi_log_error(SLAPI_LOG_CACHE, "ldbm_back_modrdn", + slapi_log_err(SLAPI_LOG_CACHE, "ldbm_back_modrdn", "conn=%lu op=%d cache_add_tentative failed: %s\n", conn_id, op_id, slapi_entry_get_dn(ec->ep_entry)); } @@ -808,8 +809,8 @@ ldbm_back_modrdn( Slapi_PBlock *pb ) if ( entry_apply_mods( ec->ep_entry, slapi_mods_get_ldapmods_byref(&smods_generated) ) != 0 ) { ldap_result_code= LDAP_OPERATIONS_ERROR; - LDAPDebug(LDAP_DEBUG_TRACE, "ldbm_modrdn: entry_apply_mods failed for entry %s\n", - slapi_entry_get_dn_const(ec->ep_entry), 0, 0); + slapi_log_err(SLAPI_LOG_TRACE, "ldbm_back_modrdn", "entry_apply_mods failed for entry %s\n", + slapi_entry_get_dn_const(ec->ep_entry)); goto error_return; } @@ -821,8 +822,8 @@ ldbm_back_modrdn( Slapi_PBlock *pb ) if (entry_apply_mods_wsi(ec->ep_entry, &smods_generated_wsi, operation_get_csn(operation), is_replicated_operation)!=0) { ldap_result_code= LDAP_OPERATIONS_ERROR; - LDAPDebug(LDAP_DEBUG_TRACE, "ldbm_modrdn: entry_apply_mods_wsi failed for entry %s\n", - slapi_entry_get_dn_const(ec->ep_entry), 0, 0); + slapi_log_err(SLAPI_LOG_TRACE, "ldbm_back_modrdn", "entry_apply_mods_wsi failed for entry %s\n", + slapi_entry_get_dn_const(ec->ep_entry)); goto error_return; } } @@ -839,8 +840,8 @@ ldbm_back_modrdn( Slapi_PBlock *pb ) if (entry_apply_mods_wsi(ec->ep_entry, &smods_operation_wsi, operation_get_csn(operation), is_replicated_operation)!=0) { ldap_result_code= LDAP_OPERATIONS_ERROR; - LDAPDebug(LDAP_DEBUG_TRACE, "ldbm_modrdn: entry_apply_mods_wsi (operational attributes) failed for entry %s\n", - slapi_entry_get_dn_const(ec->ep_entry), 0, 0); + slapi_log_err(SLAPI_LOG_TRACE, "ldbm_back_modrdn", "entry_apply_mods_wsi (operational attributes) failed for entry %s\n", + slapi_entry_get_dn_const(ec->ep_entry)); goto error_return; } } @@ -880,7 +881,7 @@ ldbm_back_modrdn( Slapi_PBlock *pb ) if (parententry) { retval = parent_update_on_childchange(&parent_modify_context, PARENTUPDATE_DEL, NULL); - slapi_log_error(SLAPI_LOG_BACKLDBM, "ldbm_back_modrdn", + slapi_log_err(SLAPI_LOG_BACKLDBM, "ldbm_back_modrdn", "conn=%lu op=%d parent_update_on_childchange: old_entry=0x%p, new_entry=0x%p, rc=%d\n", conn_id, op_id, parent_modify_context.old_entry, parent_modify_context.new_entry, retval); @@ -892,7 +893,7 @@ ldbm_back_modrdn( Slapi_PBlock *pb ) if (newparententry) { retval = parent_update_on_childchange(&newparent_modify_context, PARENTUPDATE_ADD, NULL); - slapi_log_error(SLAPI_LOG_BACKLDBM, "ldbm_back_modrdn", + slapi_log_err(SLAPI_LOG_BACKLDBM, "ldbm_back_modrdn", "conn=%lu op=%d parent_update_on_childchange: old_entry=0x%p, new_entry=0x%p, rc=%d\n", conn_id, op_id, parent_modify_context.old_entry, parent_modify_context.new_entry, retval); /* The newparent modify context now contains info needed later */ @@ -905,7 +906,7 @@ ldbm_back_modrdn( Slapi_PBlock *pb ) if (is_resurect_operation && parententry) { retval = parent_update_on_childchange(&parent_modify_context, PARENTUPDATE_RESURECT, NULL); if (retval) { - slapi_log_error(SLAPI_LOG_BACKLDBM, "ldbm_back_modrdn", + slapi_log_err(SLAPI_LOG_BACKLDBM, "ldbm_back_modrdn", "conn=%lu op=%d parent_update_on_childchange parent %s of %s failed, rc=%d\n", conn_id, op_id, slapi_entry_get_dn_const(parent_modify_context.old_entry->ep_entry), @@ -939,12 +940,12 @@ ldbm_back_modrdn( Slapi_PBlock *pb ) } } } - LDAPDebug(LDAP_DEBUG_ERR, "ldbm_back_modrdn - " + slapi_log_err(SLAPI_LOG_ERR, "ldbm_back_modrdn", "parent_update_on_childchange parent %s of %s numsub=%d\n", slapi_entry_get_dn_const(parent_modify_context.old_entry->ep_entry), slapi_entry_get_dn_const(e->ep_entry), sub_count); #endif - slapi_log_error(SLAPI_LOG_BACKLDBM, "ldbm_back_modrdn", + slapi_log_err(SLAPI_LOG_BACKLDBM, "ldbm_back_modrdn", "%s has children\n", slapi_entry_get_dn(e->ep_entry)); } children = moddn_get_children(&txn, pb, be, e, sdn, @@ -960,7 +961,7 @@ ldbm_back_modrdn( Slapi_PBlock *pb ) /* JCMREPL - But, the replication client has total rights over its subtree, so no access check needed. */ /* JCM - A subtree move could break ACIs, static groups, and dynamic groups. */ } else if (is_resurect_operation) { - slapi_log_error(SLAPI_LOG_ERR, "ldbm_back_modrdn", + slapi_log_err(SLAPI_LOG_ERR, "ldbm_back_modrdn", "%s has NO children\n", slapi_entry_get_dn(e->ep_entry)); } @@ -987,7 +988,7 @@ ldbm_back_modrdn( Slapi_PBlock *pb ) /* call the transaction pre modrdn plugins just after creating the transaction */ retval = plugin_call_plugins(pb, SLAPI_PLUGIN_BE_TXN_PRE_MODRDN_FN); if (retval) { - LDAPDebug1Arg(LDAP_DEBUG_TRACE, "SLAPI_PLUGIN_BE_TXN_PRE_MODRDN_FN plugin " + slapi_log_err(SLAPI_LOG_TRACE, "ldbm_back_modrdn", "SLAPI_PLUGIN_BE_TXN_PRE_MODRDN_FN plugin " "returned error code %d\n", retval ); if (SLAPI_PLUGIN_NOOP == retval) { not_an_error = 1; @@ -1017,7 +1018,7 @@ ldbm_back_modrdn( Slapi_PBlock *pb ) } if (retval) { - LDAPDebug(LDAP_DEBUG_ERR, "ldbm_back_modrdn - " + slapi_log_err(SLAPI_LOG_ERR, "ldbm_back_modrdn", "modrdn_rename_entry_update_indexes %s --> %s failed, err=%d\n", slapi_entry_get_dn(e->ep_entry), slapi_entry_get_dn(ec->ep_entry), retval); if (LDBM_OS_ERR_IS_DISKFULL(retval)) disk_full = 1; @@ -1041,8 +1042,8 @@ ldbm_back_modrdn( Slapi_PBlock *pb ) memset(&sv,0,sizeof(Slapi_Value)); if ( slapi_rdn2typeval( rdns[i], &type, &sv.bv ) != 0 ) { - LDAPDebug(LDAP_DEBUG_ERR, "ldbm_back_modrdn - " - "rdn2typeval (%s) failed\n", rdns[i], 0, 0 ); + slapi_log_err(SLAPI_LOG_ERR, "ldbm_back_modrdn", + "rdn2typeval (%s) failed\n", rdns[i]); if (LDBM_OS_ERR_IS_DISKFULL(retval)) disk_full = 1; MOD_SET_ERROR(ldap_result_code, LDAP_OPERATIONS_ERROR, retry_count); @@ -1058,9 +1059,9 @@ ldbm_back_modrdn( Slapi_PBlock *pb ) } else if (retval != 0 ) { - LDAPDebug(LDAP_DEBUG_ERR, "ldbm_back_modrdn - " + slapi_log_err(SLAPI_LOG_ERR, "ldbm_back_modrdn", "Could not add new value to index, err=%d %s\n", - retval, (msg = dblayer_strerror( retval )) ? msg : "", 0 ); + retval, (msg = dblayer_strerror( retval )) ? msg : ""); if (LDBM_OS_ERR_IS_DISKFULL(retval)) disk_full = 1; MOD_SET_ERROR(ldap_result_code, LDAP_OPERATIONS_ERROR, retry_count); @@ -1086,9 +1087,9 @@ ldbm_back_modrdn( Slapi_PBlock *pb ) } else if (0 != retval) { - LDAPDebug(LDAP_DEBUG_ERR, "ldbm_back_modrdn - " + slapi_log_err(SLAPI_LOG_ERR, "ldbm_back_modrdn", "Could not update parent, err=%d %s\n", retval, - (msg = dblayer_strerror( retval )) ? msg : "", 0 ); + (msg = dblayer_strerror( retval )) ? msg : ""); if (LDBM_OS_ERR_IS_DISKFULL(retval)) disk_full = 1; MOD_SET_ERROR(ldap_result_code, LDAP_OPERATIONS_ERROR, retry_count); @@ -1098,7 +1099,7 @@ ldbm_back_modrdn( Slapi_PBlock *pb ) else /* retval == 0 */ { retval = modify_update_all(be, pb, &newparent_modify_context, &txn); - slapi_log_error(SLAPI_LOG_BACKLDBM, "ldbm_back_modrdn", + slapi_log_err(SLAPI_LOG_BACKLDBM, "ldbm_back_modrdn", "conn=%lu op=%d modify_update_all: old_entry=0x%p, new_entry=0x%p, rc=%d\n", conn_id, op_id, parent_modify_context.old_entry, parent_modify_context.new_entry, retval); if (DB_LOCK_DEADLOCK == retval) @@ -1108,10 +1109,9 @@ ldbm_back_modrdn( Slapi_PBlock *pb ) } if (0 != retval) { - LDAPDebug(LDAP_DEBUG_ERR, "ldbm_back_modrdn - " + slapi_log_err(SLAPI_LOG_ERR, "ldbm_back_modrdn", "could not update parent, err=%d %s\n", retval, - (msg = dblayer_strerror( retval )) ? msg : "", - 0 ); + (msg = dblayer_strerror( retval )) ? msg : ""); if (LDBM_OS_ERR_IS_DISKFULL(retval)) disk_full = 1; MOD_SET_ERROR(ldap_result_code, LDAP_OPERATIONS_ERROR, retry_count); @@ -1150,7 +1150,7 @@ ldbm_back_modrdn( Slapi_PBlock *pb ) if (retval == DB_RUNRECOVERY || LDBM_OS_ERR_IS_DISKFULL(retval)) disk_full = 1; MOD_SET_ERROR(ldap_result_code, LDAP_OPERATIONS_ERROR, retry_count); - slapi_log_error(SLAPI_LOG_ERR, "ldbm_back_modrdn", + slapi_log_err(SLAPI_LOG_ERR, "ldbm_back_modrdn", "entryrdn_rename_subtree failed (%d); dn: %s, newsrdn: %s, dn_newsuperiordn: %s\n", retval, slapi_sdn_get_dn(sdn), slapi_rdn_get_rdn(&newsrdn), slapi_sdn_get_dn(dn_newsuperiordn)); @@ -1182,9 +1182,8 @@ ldbm_back_modrdn( Slapi_PBlock *pb ) if (!is_ruv && !is_fixup_operation && !NO_RUV_UPDATE(li)) { ruv_c_init = ldbm_txn_ruv_modify_context( pb, &ruv_c ); if (-1 == ruv_c_init) { - LDAPDebug(LDAP_DEBUG_ERR, "ldbm_back_modrdn - " - "ldbm_txn_ruv_modify_context failed to construct RUV modify context\n", - 0, 0, 0); + slapi_log_err(SLAPI_LOG_ERR, "ldbm_back_modrdn", + "ldbm_txn_ruv_modify_context failed to construct RUV modify context\n"); ldap_result_code = LDAP_OPERATIONS_ERROR; retval = 0; goto error_return; @@ -1198,9 +1197,9 @@ ldbm_back_modrdn( Slapi_PBlock *pb ) continue; } if (0 != retval) { - LDAPDebug(LDAP_DEBUG_ERR, "ldbm_back_modrdn - " + slapi_log_err(SLAPI_LOG_ERR, "ldbm_back_modrdn", "modify_update_all failed, err=%d %s\n", retval, - (msg = dblayer_strerror( retval )) ? msg : "", 0 ); + (msg = dblayer_strerror( retval )) ? msg : ""); if (LDBM_OS_ERR_IS_DISKFULL(retval)) { disk_full = 1; } @@ -1214,8 +1213,8 @@ ldbm_back_modrdn( Slapi_PBlock *pb ) if (retry_count == RETRY_TIMES) { /* Failed */ - LDAPDebug(LDAP_DEBUG_ERR, "ldbm_back_modrdn - " - "Retry count exceeded in modrdn\n", 0, 0, 0 ); + slapi_log_err(SLAPI_LOG_ERR, "ldbm_back_modrdn", + "Retry count exceeded in modrdn\n"); ldap_result_code= LDAP_BUSY; goto error_return; } @@ -1229,7 +1228,7 @@ ldbm_back_modrdn( Slapi_PBlock *pb ) if(newparententry!=NULL) { myrc = modify_switch_entries( &newparent_modify_context,be); - slapi_log_error(SLAPI_LOG_BACKLDBM, "ldbm_back_modrdn", + slapi_log_err(SLAPI_LOG_BACKLDBM, "ldbm_back_modrdn", "conn=%lu op=%d modify_switch_entries: old_entry=0x%p, new_entry=0x%p, rc=%d\n", conn_id, op_id, parent_modify_context.old_entry, parent_modify_context.new_entry, myrc); } @@ -1237,13 +1236,13 @@ ldbm_back_modrdn( Slapi_PBlock *pb ) slapi_pblock_set( pb, SLAPI_ENTRY_POST_OP, postentry ); /* call the transaction post modrdn plugins just before the commit */ if ((retval = plugin_call_plugins(pb, SLAPI_PLUGIN_BE_TXN_POST_MODRDN_FN))) { - LDAPDebug1Arg(LDAP_DEBUG_TRACE, "ldbm_back_modrdn - " + slapi_log_err(SLAPI_LOG_TRACE, "ldbm_back_modrdn", "SLAPI_PLUGIN_BE_TXN_POST_MODRDN_FN plugin returned error code %d\n", retval ); if (!ldap_result_code) { slapi_pblock_get(pb, SLAPI_RESULT_CODE, &ldap_result_code); } if (!ldap_result_code) { - LDAPDebug0Args(LDAP_DEBUG_ANY, "ldbm_back_modrdn - " + slapi_log_err(SLAPI_LOG_ERR, "ldbm_back_modrdn", "SLAPI_PLUGIN_BE_TXN_POST_MODRDN_FN plugin " "returned error but did not set SLAPI_RESULT_CODE\n" ); ldap_result_code = LDAP_OPERATIONS_ERROR; @@ -1284,7 +1283,7 @@ ldbm_back_modrdn( Slapi_PBlock *pb ) */ for (i = 0; child_entries[i] != NULL; i++) { if (is_resurect_operation) { - slapi_log_error(SLAPI_LOG_CACHE, "ldbm_back_modrdn", + slapi_log_err(SLAPI_LOG_CACHE, "ldbm_back_modrdn", "Calling cache remove & return %s (refcnt: %d)\n", slapi_entry_get_dn(child_entries[i]->ep_entry), child_entries[i]->ep_refcnt); @@ -1314,8 +1313,8 @@ ldbm_back_modrdn( Slapi_PBlock *pb ) if (ruv_c_init) { if (modify_switch_entries(&ruv_c, be) != 0 ) { ldap_result_code= LDAP_OPERATIONS_ERROR; - LDAPDebug(LDAP_DEBUG_ERR, "ldbm_back_modrdn - " - "modify_switch_entries failed\n", 0, 0, 0); + slapi_log_err(SLAPI_LOG_ERR, "ldbm_back_modrdn", + "modify_switch_entries failed\n"); goto error_return; } } @@ -1366,7 +1365,7 @@ error_return: if (retval == DB_RUNRECOVERY) { dblayer_remember_disk_filled(li); - ldbm_nasty("ModifyDN",82,retval); + ldbm_nasty("ldbm_back_modrdn","ModifyDN",82,retval); disk_full = 1; } @@ -1395,7 +1394,7 @@ error_return: } /* call the transaction post modrdn plugins just before the abort */ if ((retval = plugin_call_plugins(pb, SLAPI_PLUGIN_BE_TXN_POST_MODRDN_FN))) { - LDAPDebug1Arg(LDAP_DEBUG_TRACE, "ldbm_back_modrdn - " + slapi_log_err(SLAPI_LOG_TRACE, "ldbm_back_modrdn", "SLAPI_PLUGIN_BE_TXN_POST_MODRDN_FN plugin " "returned error code %d\n", retval ); if (!ldap_result_code) { @@ -1432,7 +1431,7 @@ common_return: /* Free up the resource we don't need any more */ if (ec) { if (is_resurect_operation) { - slapi_log_error(SLAPI_LOG_REPL, "ldbm_back_modrdn", + slapi_log_err(SLAPI_LOG_REPL, "ldbm_back_modrdn", "Resurrecting an entry %s: result: %d, %d\n", slapi_entry_get_dn(ec->ep_entry), ldap_result_code, retval); } @@ -1448,7 +1447,7 @@ common_return: if (bdn) { CACHE_ADD( &inst->inst_dncache, bdn, NULL ); CACHE_RETURN(&inst->inst_dncache, &bdn); - slapi_log_error(SLAPI_LOG_CACHE, "ldbm_back_modrdn", + slapi_log_err(SLAPI_LOG_CACHE, "ldbm_back_modrdn", "set %s to dn cache\n", slapi_sdn_get_dn(sdn)); } } @@ -1508,13 +1507,13 @@ common_return: slapi_sdn_done(&dn_newdn); slapi_sdn_done(&dn_newrdn); slapi_sdn_done(&dn_parentdn); - slapi_log_error(SLAPI_LOG_BACKLDBM, "ldbm_back_modrdn", + slapi_log_err(SLAPI_LOG_BACKLDBM, "ldbm_back_modrdn", "conn=%lu op=%d modify_term: old_entry=0x%p, new_entry=0x%p\n", conn_id, op_id, parent_modify_context.old_entry, parent_modify_context.new_entry); myrc = modify_term(&parent_modify_context,be); - slapi_log_error(SLAPI_LOG_BACKLDBM, "ldbm_back_modrdn", + slapi_log_err(SLAPI_LOG_BACKLDBM, "ldbm_back_modrdn", "conn=%lu op=%d modify_term: rc=%d\n", conn_id, op_id, myrc); - slapi_log_error(SLAPI_LOG_BACKLDBM, "ldbm_back_modrdn", + slapi_log_err(SLAPI_LOG_BACKLDBM, "ldbm_back_modrdn", "conn=%lu op=%d modify_term: old_entry=0x%p, new_entry=0x%p\n", conn_id, op_id, newparent_modify_context.old_entry, newparent_modify_context.new_entry); myrc = modify_term(&newparent_modify_context,be); @@ -1539,7 +1538,7 @@ common_return: } if (pb->pb_conn) { - slapi_log_error(SLAPI_LOG_TRACE, "ldbm_back_modrdn", + slapi_log_err(SLAPI_LOG_TRACE, "ldbm_back_modrdn", "leave conn=%" NSPRIu64 " op=%d\n", pb->pb_conn->c_connid, operation->o_opid); } @@ -1742,7 +1741,7 @@ moddn_newrdn_mods(Slapi_PBlock *pb, const char *olddn, struct backentry *ec, Sla if ( baddn || badrdn ) { - LDAPDebug(LDAP_DEBUG_TRACE, "moddn_newrdn_mods- Failed: olddn=%s baddn=%d badrdn=%d\n", + slapi_log_err(SLAPI_LOG_TRACE, "moddn_newrdn_mods", "Failed: olddn=%s baddn=%d badrdn=%d\n", olddn, baddn, badrdn); return LDAP_OPERATIONS_ERROR; } @@ -1772,8 +1771,8 @@ moddn_newrdn_mods(Slapi_PBlock *pb, const char *olddn, struct backentry *ec, Sla } else { - LDAPDebug(LDAP_DEBUG_TRACE, "moddn_newrdn_mods - Failed: could not parse new rdn %s\n", - newrdn, 0, 0); + slapi_log_err(SLAPI_LOG_TRACE, "moddn_newrdn_mods", "Failed: could not parse new rdn %s\n", + newrdn); return LDAP_OPERATIONS_ERROR; } @@ -1823,22 +1822,22 @@ modrdn_rename_entry_update_indexes(back_txn *ptxn, Slapi_PBlock *pb, struct ldbm */ retval = id2entry_add_ext(be, *ec, ptxn, 1, &cache_rc); if (cache_rc) { - LDAPDebug(LDAP_DEBUG_CACHE, - "modrdn_rename_entry_update_indexes - " + slapi_log_err(SLAPI_LOG_CACHE, + "modrdn_rename_entry_update_indexes", "Adding %s failed to add to the cache (rc: %d, cache_rc: %d)\n", slapi_entry_get_dn(e->ep_entry), retval, cache_rc); } if (DB_LOCK_DEADLOCK == retval) { /* Retry txn */ - LDAPDebug0Args(LDAP_DEBUG_BACKLDBM, "modrdn_rename_entry_update_indexes - id2entry_add deadlock\n" ); + slapi_log_err(SLAPI_LOG_BACKLDBM, "modrdn_rename_entry_update_indexes", "id2entry_add deadlock\n"); goto error_return; } if (retval != 0) { - LDAPDebug(LDAP_DEBUG_ERR, "modrdn_rename_entry_update_indexes - " + slapi_log_err(SLAPI_LOG_ERR, "modrdn_rename_entry_update_indexes", "id2entry_add failed, err=%d %s\n", - retval, (msg = dblayer_strerror( retval )) ? msg : "", 0 ); + retval, (msg = dblayer_strerror( retval )) ? msg : ""); goto error_return; } if(smods1!=NULL && slapi_mods_get_num_mods(smods1)>0) @@ -1850,14 +1849,14 @@ modrdn_rename_entry_update_indexes(back_txn *ptxn, Slapi_PBlock *pb, struct ldbm if (DB_LOCK_DEADLOCK == retval) { /* Retry txn */ - LDAPDebug0Args(LDAP_DEBUG_BACKLDBM, "modrdn_rename_entry_update_indexes - index_add_mods1 deadlock\n" ); + slapi_log_err(SLAPI_LOG_BACKLDBM, "modrdn_rename_entry_update_indexes", "index_add_mods1 deadlock\n"); goto error_return; } if (retval != 0) { - LDAPDebug(LDAP_DEBUG_TRACE, "modrdn_rename_entry_update_indexes - " + slapi_log_err(SLAPI_LOG_TRACE, "modrdn_rename_entry_update_indexes", "index_add_mods 1 failed, err=%d %s\n", - retval, (msg = dblayer_strerror( retval )) ? msg : "", 0 ); + retval, (msg = dblayer_strerror( retval )) ? msg : ""); goto error_return; } } @@ -1876,15 +1875,15 @@ modrdn_rename_entry_update_indexes(back_txn *ptxn, Slapi_PBlock *pb, struct ldbm if (DB_LOCK_DEADLOCK == retval) { /* Retry txn */ - LDAPDebug0Args(LDAP_DEBUG_BACKLDBM, "modrdn_rename_entry_update_indexes - " - "index_add_mods2 deadlock\n" ); + slapi_log_err(SLAPI_LOG_BACKLDBM, "modrdn_rename_entry_update_indexes", + "index_add_mods2 deadlock\n"); goto error_return; } if (retval != 0) { - LDAPDebug(LDAP_DEBUG_TRACE, "modrdn_rename_entry_update_indexes - " + slapi_log_err(SLAPI_LOG_TRACE, "modrdn_rename_entry_update_indexes", "index_add_mods 2 failed, err=%d %s\n", - retval, (msg = dblayer_strerror( retval )) ? msg : "", 0 ); + retval, (msg = dblayer_strerror( retval )) ? msg : ""); goto error_return; } } @@ -1897,15 +1896,15 @@ modrdn_rename_entry_update_indexes(back_txn *ptxn, Slapi_PBlock *pb, struct ldbm if (DB_LOCK_DEADLOCK == retval) { /* Retry txn */ - LDAPDebug0Args(LDAP_DEBUG_BACKLDBM, "modrdn_rename_entry_update_indexes - " + slapi_log_err(SLAPI_LOG_BACKLDBM, "modrdn_rename_entry_update_indexes", "index_add_mods3 deadlock\n" ); goto error_return; } if (retval != 0) { - LDAPDebug(LDAP_DEBUG_TRACE, "modrdn_rename_entry_update_indexes - " + slapi_log_err(SLAPI_LOG_TRACE, "modrdn_rename_entry_update_indexes", "index_add_mods 3 failed, err=%d %s\n", - retval, (msg = dblayer_strerror( retval )) ? msg : "", 0 ); + retval, (msg = dblayer_strerror( retval )) ? msg : ""); goto error_return; } } @@ -1920,21 +1919,21 @@ modrdn_rename_entry_update_indexes(back_txn *ptxn, Slapi_PBlock *pb, struct ldbm if (DB_LOCK_DEADLOCK == retval) { /* Abort and re-try */ - LDAPDebug0Args(LDAP_DEBUG_BACKLDBM, "modrdn_rename_entry_update_indexes -" + slapi_log_err(SLAPI_LOG_BACKLDBM, "modrdn_rename_entry_update_indexes", "vlv_update_all_indexes deadlock\n" ); goto error_return; } if (retval != 0) { - LDAPDebug(LDAP_DEBUG_TRACE, "modrdn_rename_entry_update_indexes - " + slapi_log_err(SLAPI_LOG_TRACE, "modrdn_rename_entry_update_indexes", "vlv_update_all_indexes failed, err=%d %s\n", - retval, (msg = dblayer_strerror( retval )) ? msg : "", 0 ); + retval, (msg = dblayer_strerror( retval )) ? msg : ""); goto error_return; } } if (cache_replace( &inst->inst_cache, e, *ec ) != 0 ) { - LDAPDebug2Args(LDAP_DEBUG_CACHE, - "modrdn_rename_entry_update_indexes - cache_replace %s -> %s failed\n", + slapi_log_err(SLAPI_LOG_CACHE, + "modrdn_rename_entry_update_indexes", "cache_replace %s -> %s failed\n", slapi_entry_get_dn(e->ep_entry), slapi_entry_get_dn((*ec)->ep_entry)); retval= -1; goto error_return; @@ -2175,7 +2174,7 @@ moddn_get_children(back_txn *ptxn, slapi_entry_get_sdn_const(parententry->ep_entry), parententry->ep_id, &candidates, ptxn, is_resurect_operation); if (err) { - LDAPDebug1Arg(LDAP_DEBUG_ANY, "moddn_get_children -" + slapi_log_err(SLAPI_LOG_ERR, "moddn_get_children", "entryrdn_get_subordinates returned %d\n", err); goto bail; } diff --git a/ldap/servers/slapd/back-ldbm/ldbm_search.c b/ldap/servers/slapd/back-ldbm/ldbm_search.c index 2c58114..a6c3b74 100644 --- a/ldap/servers/slapd/back-ldbm/ldbm_search.c +++ b/ldap/servers/slapd/back-ldbm/ldbm_search.c @@ -257,13 +257,13 @@ ldbm_search_compile_filter(Slapi_Filter *f, void *arg) p = bigpat ? bigpat : pat; re = slapi_re_comp(p, &re_result); if (NULL == re) { - LDAPDebug(LDAP_DEBUG_ERR, "ldbm_search_compile_filter - re_comp (%s) failed (%s): %s\n", + slapi_log_err(SLAPI_LOG_ERR, "ldbm_search_compile_filter", "re_comp (%s) failed (%s): %s\n", pat, p, re_result?re_result:"unknown" ); rc = SLAPI_FILTER_SCAN_ERROR; } else { char ebuf[BUFSIZ]; - LDAPDebug(LDAP_DEBUG_TRACE, "ldbm_search_compile_filter - re_comp (%s)\n", - escape_string(p, ebuf), 0, 0); + slapi_log_err(SLAPI_LOG_TRACE, "ldbm_search_compile_filter", "re_comp (%s)\n", + escape_string(p, ebuf)); f->f_un.f_un_sub.sf_private = (void *)re; } } else if (f->f_choice == LDAP_FILTER_EQUALITY) { @@ -365,8 +365,8 @@ ldbm_back_search( Slapi_PBlock *pb ) if (inst && inst->inst_ref_count) { slapi_counter_increment(inst->inst_ref_count); } else { - LDAPDebug1Arg(LDAP_DEBUG_ERR, - "ldbm_back_search - Instance \"%s\" does not exist.\n", + slapi_log_err(SLAPI_LOG_ERR, + "ldbm_back_search", "Instance \"%s\" does not exist.\n", inst ? inst->inst_name : "null instance"); return( -1 ); } @@ -406,9 +406,9 @@ ldbm_back_search( Slapi_PBlock *pb ) slapi_pblock_get(pb, SLAPI_CONN_ID, &conn_id); slapi_pblock_get(pb, SLAPI_OPERATION_ID, &op_id); - LDAPDebug(LDAP_DEBUG_WARNING, - "ldbm_back_search - Sort control ignored for conn=%d op=%d\n", - conn_id, op_id, 0); + slapi_log_err(SLAPI_LOG_WARNING, + "ldbm_back_search", "Sort control ignored for conn=%" NSPRIu64 " op=%d\n", + conn_id, op_id); } } else { /* set this operation includes the server side sorting */ @@ -441,9 +441,9 @@ ldbm_back_search( Slapi_PBlock *pb ) slapi_pblock_get(pb, SLAPI_CONN_ID, &conn_id); slapi_pblock_get(pb, SLAPI_OPERATION_ID, &op_id); - LDAPDebug(LDAP_DEBUG_WARNING, - "ldbm_back_search - VLV control ignored for conn=%d op=%d\n", - conn_id, op_id, 0); + slapi_log_err(SLAPI_LOG_WARNING, + "ldbm_back_search", "VLV control ignored for conn=%" NSPRIu64 " op=%d\n", + conn_id, op_id); } } else { @@ -511,11 +511,11 @@ ldbm_back_search( Slapi_PBlock *pb ) if (print_once) { - LDAPDebug(LDAP_DEBUG_WARNING, - "ldbm_back_search - %s " - "when more than one backend is involved. " + slapi_log_err(SLAPI_LOG_WARNING, + "ldbm_back_search", "%s " + "When more than one backend is involved. " "VLV indexes that will never be used should be removed.\n", - ctrlstr, 0, 0); + ctrlstr); print_once = 0; } @@ -954,8 +954,8 @@ vlv_bail: rc = slapi_filter_apply(sr->sr_norm_filter, ldbm_search_compile_filter, NULL, &filt_errs); if (rc != SLAPI_FILTER_SCAN_NOMORE) { - LDAPDebug2Args(LDAP_DEBUG_ERR, - "ldbm_back_search - Could not pre-compile the search filter - error %d %d\n", + slapi_log_err(SLAPI_LOG_ERR, + "ldbm_back_search", "Could not pre-compile the search filter - error %d %d\n", rc, filt_errs); if (rc == SLAPI_FILTER_SCAN_ERROR) { tmp_err = LDAP_OPERATIONS_ERROR; @@ -1021,7 +1021,7 @@ build_candidate_list( Slapi_PBlock *pb, backend *be, struct backentry *e, r = SLAPI_FAIL_GENERAL; } if ( 0 != err && DB_NOTFOUND != err ) { - LDAPDebug(LDAP_DEBUG_ERR, "build_candidate_list - Database error %d\n", err, 0, 0 ); + slapi_log_err(SLAPI_LOG_ERR, "build_candidate_list", "Database error %d\n", err); slapi_send_ldap_result( pb, LDAP_OPERATIONS_ERROR, NULL, NULL, 0, NULL ); if (LDBM_OS_ERR_IS_DISKFULL(err)) r = return_on_disk_full(li); @@ -1044,8 +1044,8 @@ bail: } } - LDAPDebug(LDAP_DEBUG_TRACE, "build_candidate_list - Candidate list has %lu ids\n", - *candidates ? (*candidates)->b_nids : 0L, 0, 0); + slapi_log_err(SLAPI_LOG_TRACE, "build_candidate_list", "Candidate list has %lu ids\n", + *candidates ? (*candidates)->b_nids : 0L); return r; } @@ -1632,8 +1632,8 @@ ldbm_back_next_search_entry_ext( Slapi_PBlock *pb, int use_extension ) { if ( err != 0 && err != DB_NOTFOUND ) { - LDAPDebug(LDAP_DEBUG_ERR, "ldbm_back_next_search_entry_ext - next_search_entry db err %d\n", - err, 0, 0 ); + slapi_log_err(SLAPI_LOG_ERR, "ldbm_back_next_search_entry_ext", "next_search_entry db err %d\n", + err); if (LDBM_OS_ERR_IS_DISKFULL(err)) { /* disk full in the middle of returning search results @@ -1644,8 +1644,8 @@ ldbm_back_next_search_entry_ext( Slapi_PBlock *pb, int use_extension ) goto bail; } } - LDAPDebug(LDAP_DEBUG_ARGS, "ldbm_back_next_search_entry_ext - candidate %lu not found\n", - (u_long)id, 0, 0 ); + slapi_log_err(SLAPI_LOG_ARGS, "ldbm_back_next_search_entry_ext", "candidate %lu not found\n", + (u_long)id); if ( err == DB_NOTFOUND ) { /* Since we didn't really look at this entry, we should @@ -1672,8 +1672,8 @@ ldbm_back_next_search_entry_ext( Slapi_PBlock *pb, int use_extension ) Slapi_Value **refs= attr_get_present_values(attr); if ( refs == NULL || refs[0] == NULL ) { - LDAPDebug(LDAP_DEBUG_ERR, "ldbm_back_next_search_entry_ext - null ref in (%s)\n", - backentry_get_ndn(e), 0, 0 ); + slapi_log_err(SLAPI_LOG_ERR, "ldbm_back_next_search_entry_ext", "null ref in (%s)\n", + backentry_get_ndn(e)); } else if ( slapi_sdn_scope_test( backentry_get_sdn(e), basesdn, scope )) { @@ -1724,8 +1724,8 @@ ldbm_back_next_search_entry_ext( Slapi_PBlock *pb, int use_extension ) /* it's a regular entry, check if it matches the filter, and passes the ACL check */ if ( 0 != ( sr->sr_flags & SR_FLAG_CAN_SKIP_FILTER_TEST )) { /* Since we do access control checking in the filter test (?Why?) we need to check access now */ - LDAPDebug(LDAP_DEBUG_FILTER, "ldbm_back_next_search_entry_ext - " - "Bypassing filter test\n", 0, 0, 0 ); + slapi_log_err(SLAPI_LOG_FILTER, "ldbm_back_next_search_entry_ext", + "Bypassing filter test\n"); if ( ACL_CHECK_FLAG ) { filter_test = slapi_vattr_filter_test_ext( pb, e->ep_entry, filter, ACL_CHECK_FLAG, 1 /* Only perform access checking, thank you */); } else { @@ -1734,13 +1734,13 @@ ldbm_back_next_search_entry_ext( Slapi_PBlock *pb, int use_extension ) if (li->li_filter_bypass_check) { int ft_rc; - LDAPDebug(LDAP_DEBUG_FILTER, "Checking bypass\n", 0, 0, 0 ); + slapi_log_err(SLAPI_LOG_FILTER, "ldbm_back_next_search_entry_ext", "Checking bypass\n"); ft_rc = slapi_vattr_filter_test( pb, e->ep_entry, filter, ACL_CHECK_FLAG ); if (filter_test != ft_rc) { /* Oops ! This means that we thought we could bypass the filter test, but noooo... */ - LDAPDebug(LDAP_DEBUG_ERR, "ldbm_back_next_search_entry_ext - " - "Filter bypass ERROR on entry %s\n", backentry_get_ndn(e), 0, 0 ); + slapi_log_err(SLAPI_LOG_ERR, "ldbm_back_next_search_entry_ext", + "Filter bypass ERROR on entry %s\n", backentry_get_ndn(e)); filter_test = ft_rc; /* Fix the error */ } } @@ -1858,22 +1858,22 @@ ldbm_back_prev_search_results( Slapi_PBlock *pb ) slapi_pblock_get( pb, SLAPI_BACKEND, &be ); if (!be) { - LDAPDebug0Args(LDAP_DEBUG_ERR, - "ldbm_back_prev_search_results - no backend\n"); + slapi_log_err(SLAPI_LOG_ERR, + "ldbm_back_prev_search_results", "no backend\n"); return; } inst = (ldbm_instance *) be->be_instance_info; if (!inst) { - LDAPDebug0Args(LDAP_DEBUG_ERR, - "ldbm_back_prev_search_results - no backend instance\n"); + slapi_log_err(SLAPI_LOG_ERR, + "ldbm_back_prev_search_results", "no backend instance\n"); return; } slapi_pblock_get( pb, SLAPI_SEARCH_RESULT_SET, &sr ); if (sr) { if (sr->sr_entry) { /* The last entry should be returned to cache */ - LDAPDebug1Arg(LDAP_DEBUG_BACKLDBM, - "ldbm_back_prev_search_results - returning: %s\n", + slapi_log_err(SLAPI_LOG_BACKLDBM, + "ldbm_back_prev_search_results", "returning: %s\n", slapi_entry_get_dn_const(sr->sr_entry->ep_entry)); CACHE_RETURN (&inst->inst_cache, &(sr->sr_entry)); sr->sr_entry = NULL; @@ -1918,8 +1918,8 @@ delete_search_result_set( Slapi_PBlock *pb, back_search_result_set **sr ) rc = slapi_filter_apply((*sr)->sr_norm_filter, ldbm_search_free_compiled_filter, NULL, &filt_errs); if (rc != SLAPI_FILTER_SCAN_NOMORE) { - LDAPDebug2Args(LDAP_DEBUG_ERR, - "delete_search_result_set - Could not free the pre-compiled regexes in the search filter - error %d %d\n", + slapi_log_err(SLAPI_LOG_ERR, + "delete_search_result_set", "Could not free the pre-compiled regexes in the search filter - error %d %d\n", rc, filt_errs); } slapi_filter_free((*sr)->sr_norm_filter, 1); diff --git a/ldap/servers/slapd/back-ldbm/ldbm_usn.c b/ldap/servers/slapd/back-ldbm/ldbm_usn.c index a78038e..449f207 100644 --- a/ldap/servers/slapd/back-ldbm/ldbm_usn.c +++ b/ldap/servers/slapd/back-ldbm/ldbm_usn.c @@ -53,7 +53,7 @@ ldbm_usn_init(struct ldbminfo *li) be = slapi_mapping_tree_find_backend_for_sdn(sdn); rc = usn_get_last_usn(be, &last_usn); if (0 == rc) { /* only when the last usn is available */ - slapi_log_error(SLAPI_LOG_BACKLDBM, "ldbm_usn_init", + slapi_log_err(SLAPI_LOG_BACKLDBM, "ldbm_usn_init", "backend: %s%s\n", be->be_name, isglobal?" (global mode)":""); if (isglobal) { @@ -114,7 +114,7 @@ usn_get_last_usn(Slapi_Backend *be, PRUint64 *last_usn) rc = dblayer_get_index_file(be, ai, &db, DBOPEN_CREATE); if (0 != rc) { /* entryusn.db# is missing; it would be the first time. */ - slapi_log_error(SLAPI_LOG_ERR, "usn_get_last_usn", + slapi_log_err(SLAPI_LOG_ERR, "usn_get_last_usn", "Failed to open the entryusn index: %d; Creating it...\n", rc); goto bail; } @@ -122,7 +122,7 @@ usn_get_last_usn(Slapi_Backend *be, PRUint64 *last_usn) /* Get a cursor */ rc = db->cursor(db, NULL, &dbc, 0); if (0 != rc) { - slapi_log_error(SLAPI_LOG_ERR, "usn_get_last_usn", + slapi_log_err(SLAPI_LOG_ERR, "usn_get_last_usn", "Failed to create a cursor: %d", rc); goto bail; } @@ -181,7 +181,7 @@ ldbm_set_last_usn(Slapi_Backend *be) int rc = -1; if (NULL == be) { - slapi_log_error(SLAPI_LOG_ERR, "ldbm_set_last_usn", + slapi_log_err(SLAPI_LOG_ERR, "ldbm_set_last_usn", "Empty backend\n"); return rc; } @@ -192,7 +192,7 @@ ldbm_set_last_usn(Slapi_Backend *be) slapi_counter_destroy(&(li->li_global_usn_counter)); ldbm_usn_init(li); } else { - slapi_log_error(SLAPI_LOG_BACKLDBM, "ldbm_set_last_usn", + slapi_log_err(SLAPI_LOG_BACKLDBM, "ldbm_set_last_usn", "backend: %s\n", be->be_name); rc = usn_get_last_usn(be, &last_usn); if (0 == rc) { /* only when the last usn is available */ diff --git a/ldap/servers/slapd/back-ldbm/ldif2ldbm.c b/ldap/servers/slapd/back-ldbm/ldif2ldbm.c index b68bf1e..6b8db10 100644 --- a/ldap/servers/slapd/back-ldbm/ldif2ldbm.c +++ b/ldap/servers/slapd/back-ldbm/ldif2ldbm.c @@ -250,7 +250,7 @@ add_op_attrs(Slapi_PBlock *pb, struct ldbminfo *li, struct backentry *ep, } if (err) { if (DB_NOTFOUND != err && 1 != err) { - LDAPDebug1Arg(LDAP_DEBUG_ANY, "add_op_attrs - database error %d\n", err ); + slapi_log_err(SLAPI_LOG_ERR, "add_op_attrs", "database error %d\n", err ); slapi_ch_free_string( &pdn ); return( -1 ); } @@ -270,7 +270,7 @@ add_op_attrs(Slapi_PBlock *pb, struct ldbminfo *li, struct backentry *ep, } else { /* empty idl */ if ( 0 != err && DB_NOTFOUND != err ) { - LDAPDebug1Arg(LDAP_DEBUG_ANY, "add_op_attrs - database error %d\n", err ); + slapi_log_err(SLAPI_LOG_ERR, "add_op_attrs", "database error %d\n", err ); slapi_ch_free_string( &pdn ); return( -1 ); } @@ -365,7 +365,7 @@ static int import_update_entry_subcount(backend *be, ID parentid, /* Get hold of the parent */ e = id2entry(be,parentid,NULL,&ret); if ( (NULL == e) || (0 != ret)) { - ldbm_nasty(sourcefile,5,ret); + ldbm_nasty("import_update_entry_subcount",sourcefile,5,ret); return (0 == ret) ? -1 : ret; } /* Lock it (not really required since we're single-threaded here, but @@ -443,7 +443,7 @@ static int import_subcount_trawl(backend *be, if (DB_NOTFOUND == ret) { break; } else { - ldbm_nasty(sourcefile,8,ret); + ldbm_nasty("import_subcount_trawl",sourcefile,8,ret); return ret; } } @@ -466,7 +466,7 @@ static int import_subcount_trawl(backend *be, ret = import_update_entry_subcount(be,current->id, current->sub_count,isencrypted); if (0 != ret) { - ldbm_nasty(sourcefile,10,ret); + ldbm_nasty("import_subcount_trawl",sourcefile,10,ret); break; } } @@ -498,13 +498,13 @@ int update_subordinatecounts(backend *be, ImportJob *job, DB_TXN *txn) /* Open the parentid index file */ if ( (ret = dblayer_get_index_file( be, ai, &db, DBOPEN_CREATE )) != 0 ) { - ldbm_nasty(sourcefile,67,ret); + ldbm_nasty("update_subordinatecounts",sourcefile,67,ret); return(ret); } /* Get a cursor so we can walk through the parentid */ ret = db->cursor(db,txn,&dbc,0); if (ret != 0 ) { - ldbm_nasty(sourcefile,68,ret); + ldbm_nasty("update_subordinatecounts",sourcefile,68,ret); dblayer_release_index_file( be, ai, db ); return ret; } @@ -525,7 +525,7 @@ int update_subordinatecounts(backend *be, ImportJob *job, DB_TXN *txn) } if (0 != ret) { if (ret != DB_NOTFOUND) { - ldbm_nasty(sourcefile,62,ret); + ldbm_nasty("update_subordinatecounts",sourcefile,62,ret); } if (NULL != key.data) { slapi_ch_free(&(key.data)); @@ -569,7 +569,7 @@ int update_subordinatecounts(backend *be, ImportJob *job, DB_TXN *txn) ret = NEW_IDL_NO_ALLID; idl = idl_fetch(be,db,&key,NULL,NULL,&ret); if ( (NULL == idl) || (0 != ret)) { - ldbm_nasty(sourcefile,4,ret); + ldbm_nasty("update_subordinatecounts",sourcefile,4,ret); dblayer_release_index_file( be, ai, db ); return (0 == ret) ? -1 : ret; } @@ -609,7 +609,7 @@ int update_subordinatecounts(backend *be, ImportJob *job, DB_TXN *txn) ret = dbc->c_close(dbc); if (0 != ret) { - ldbm_nasty(sourcefile,6,ret); + ldbm_nasty("update_subordinatecounts",sourcefile,6,ret); } dblayer_release_index_file( be, ai, db ); @@ -618,7 +618,7 @@ int update_subordinatecounts(backend *be, ImportJob *job, DB_TXN *txn) if (NULL != trawl_list) { ret = import_subcount_trawl(be,trawl_list,isencrypted); if (0 != ret) { - ldbm_nasty(sourcefile,7,ret); + ldbm_nasty("update_subordinatecounts",sourcefile,7,ret); } } return(ret); @@ -666,9 +666,9 @@ int ldbm_back_ldif2ldbm( Slapi_PBlock *pb ) 0 /* use single thread mode */); slapi_sdn_free (&sdn); if (rc != UID_SUCCESS) { - LDAPDebug(LDAP_DEBUG_EMERG, - "ldbm_back_ldif2ldbm - Failed to initialize uniqueid generator; error = %d. " - "Exiting now.\n", rc, 0, 0 ); + slapi_log_err(SLAPI_LOG_EMERG, + "ldbm_back_ldif2ldbm", "Failed to initialize uniqueid generator; error = %d. " + "Exiting now.\n", rc); return -1; } @@ -679,24 +679,24 @@ int ldbm_back_ldif2ldbm( Slapi_PBlock *pb ) /* Find the instance that the ldif2db will be done on. */ inst = ldbm_instance_find_by_name(li, instance_name); if (NULL == inst) { - LDAPDebug(LDAP_DEBUG_ERR, "ldbm_back_ldif2ldbm - Unknown ldbm instance %s\n", - instance_name, 0, 0); + slapi_log_err(SLAPI_LOG_ERR, "ldbm_back_ldif2ldbm", "Unknown ldbm instance %s\n", + instance_name); return -1; } /* check if an import/restore is already ongoing... */ if ((instance_set_busy(inst) != 0) || (slapi_counter_get_value(inst->inst_ref_count) > 0)) { - LDAPDebug(LDAP_DEBUG_ERR, "ldbm_back_ldif2ldbm - ldbm: '%s' is already in the middle of " + slapi_log_err(SLAPI_LOG_ERR, "ldbm_back_ldif2ldbm", "ldbm: '%s' is already in the middle of " "another task and cannot be disturbed.\n", - inst->inst_name, 0, 0); + inst->inst_name); return -1; } if ((task_flags & SLAPI_TASK_RUNNING_FROM_COMMANDLINE)) { if (dblayer_import_file_init(inst)) { - LDAPDebug0Args(LDAP_DEBUG_ERR, - "ldbm_back_ldif2ldbm - Failed to write import file\n"); + slapi_log_err(SLAPI_LOG_ERR, + "ldbm_back_ldif2ldbm", "Failed to write import file\n"); return -1; } } @@ -705,8 +705,8 @@ int ldbm_back_ldif2ldbm( Slapi_PBlock *pb ) if (! (task_flags & SLAPI_TASK_RUNNING_FROM_COMMANDLINE)) { /* shutdown this instance of the db */ - LDAPDebug(LDAP_DEBUG_INFO, "ldbm_back_ldif2ldbm - Bringing %s offline...\n", - instance_name, 0, 0); + slapi_log_err(SLAPI_LOG_INFO, "ldbm_back_ldif2ldbm", "Bringing %s offline...\n", + instance_name); slapi_mtn_be_disable(inst->inst_be); cache_clear(&inst->inst_cache, CACHE_TYPE_ENTRY); @@ -726,8 +726,8 @@ int ldbm_back_ldif2ldbm( Slapi_PBlock *pb ) ret = dblayer_start(li, DBLAYER_NORMAL_MODE|DBLAYER_NO_DBTHREADS_MODE); if (ret) { - LDAPDebug2Args(LDAP_DEBUG_ERR, - "ldbm_back_ldif2ldbm - dblayer_start failed! %s (%d)\n", + slapi_log_err(SLAPI_LOG_ERR, + "ldbm_back_ldif2ldbm", "dblayer_start failed! %s (%d)\n", dblayer_strerror(ret), ret); goto fail; } @@ -735,26 +735,25 @@ int ldbm_back_ldif2ldbm( Slapi_PBlock *pb ) ldbm_usn_init(li); ret = dblayer_close(li, DBLAYER_NORMAL_MODE); if (ret != 0) { - LDAPDebug2Args(LDAP_DEBUG_ERR, - "ldbm_back_ldif2ldbm - dblayer_close failed! %s (%d)\n", + slapi_log_err(SLAPI_LOG_ERR, + "ldbm_back_ldif2ldbm", "dblayer_close failed! %s (%d)\n", dblayer_strerror(ret), ret); } } if (0 != (ret = dblayer_start(li, DBLAYER_IMPORT_MODE)) ) { if (LDBM_OS_ERR_IS_DISKFULL(ret)) { - LDAPDebug(LDAP_DEBUG_ALERT, "ldbm_back_ldif2ldbm - Failed to init database. " + slapi_log_err(SLAPI_LOG_ALERT, "ldbm_back_ldif2ldbm", "Failed to init database. " "There is either insufficient disk space or " "insufficient memory available to initialize the " - "database.\n", 0, 0, 0); - LDAPDebug(LDAP_DEBUG_ALERT,"ldbm_back_ldif2ldbm - Please check that\n" + "database.\n"); + slapi_log_err(SLAPI_LOG_ALERT,"ldbm_back_ldif2ldbm", "Please check that\n" "1) disks are not full,\n" "2) no file exceeds the file size limit,\n" - "3) the configured dbcachesize is not too large for the available memory on this machine.\n", - 0, 0, 0); + "3) the configured dbcachesize is not too large for the available memory on this machine.\n"); } else { - LDAPDebug(LDAP_DEBUG_ERR, "ldbm_back_ldif2ldbm - Failed to init database " - "(error %d: %s)\n", ret, dblayer_strerror(ret), 0); + slapi_log_err(SLAPI_LOG_ERR, "ldbm_back_ldif2ldbm", "Failed to init database " + "(error %d: %s)\n", ret, dblayer_strerror(ret)); } goto fail; } @@ -875,14 +874,14 @@ static IDList *ldbm_fetch_subtrees(backend *be, char **include, int *err) *err = entryrdn_index_read(be, &sdn, &id, NULL); if (*err) { if (DB_NOTFOUND == *err) { - LDAPDebug2Args(LDAP_DEBUG_INFO, - "ldbm_fetch_subtrees - entryrdn not indexed on '%s'; " + slapi_log_err(SLAPI_LOG_INFO, + "ldbm_fetch_subtrees", "entryrdn not indexed on '%s'; " "entry %s may not be added to the database yet.\n", include[i], include[i]); *err = 0; /* not a problem */ } else { - LDAPDebug2Args(LDAP_DEBUG_ANY, - "ldbm_fetch_subtrees - Reading %s failed on entryrdn; %d\n", + slapi_log_err(SLAPI_LOG_ERR, + "ldbm_fetch_subtrees", "Reading %s failed on entryrdn; %d\n", include[i], *err ); } slapi_sdn_done(&sdn); @@ -894,13 +893,13 @@ static IDList *ldbm_fetch_subtrees(backend *be, char **include, int *err) idl = index_read(be, LDBM_ENTRYDN_STR, indextype_EQUALITY, &bv, txn, err); if (idl == NULL) { if (DB_NOTFOUND == *err) { - LDAPDebug2Args(LDAP_DEBUG_INFO, - "ldbm_fetch_subtrees - entrydn not indexed on '%s'; " + slapi_log_err(SLAPI_LOG_INFO, + "ldbm_fetch_subtrees", "entrydn not indexed on '%s'; " "entry %s may not be added to the database yet.\n", include[i], include[i]); *err = 0; /* not a problem */ } else { - LDAPDebug2Args(LDAP_DEBUG_ANY, + slapi_log_err(SLAPI_LOG_ERR, "ldbm_fetch_subtrees", "Reading %s failed on entrydn; %d\n", include[i], *err ); } @@ -922,16 +921,15 @@ static IDList *ldbm_fetch_subtrees(backend *be, char **include, int *err) slapi_sdn_done(&sdn); if (idl == NULL) { if (DB_NOTFOUND == *err) { - LDAPDebug2Args(LDAP_DEBUG_BACKLDBM, - "ldbm_fetch_subtrees - Entry id %lu has no descendants according to %s. " + slapi_log_err(SLAPI_LOG_BACKLDBM, + "ldbm_fetch_subtrees", "Entry id %u has no descendants according to %s. " "Index file created by this reindex will be empty.\n", id, entryrdn_get_noancestorid()?"entryrdn":"ancestorid"); *err = 0; /* not a problem */ } else { - LDAPDebug(LDAP_DEBUG_WARNING, - "ldbm_fetch_subtrees - %s not indexed on %lu\n", - entryrdn_get_noancestorid()?"entryrdn":"ancestorid", - id, 0); + slapi_log_err(SLAPI_LOG_WARNING, + "ldbm_fetch_subtrees", "%s not indexed on %u\n", + entryrdn_get_noancestorid()?"entryrdn":"ancestorid", id); } continue; } @@ -997,8 +995,8 @@ export_one_entry(struct ldbminfo *li, /* Decrypt in place */ rc = attrcrypt_decrypt_entry(be, expargs->ep); if (rc) { - LDAPDebug(LDAP_DEBUG_ERR,"export_one_entry - Failed to decrypt entry [%s] : %d\n", - slapi_sdn_get_dn(&expargs->ep->ep_entry->e_sdn), rc, 0); + slapi_log_err(SLAPI_LOG_ERR,"export_one_entry", "Failed to decrypt entry [%s] : %d\n", + slapi_sdn_get_dn(&expargs->ep->ep_entry->e_sdn), rc); } } /* @@ -1019,8 +1017,8 @@ export_one_entry(struct ldbminfo *li, rc = slapi_entry_attr_replace(expargs->ep->ep_entry, "userpassword", vals); if (rc) { - LDAPDebug2Args(LDAP_DEBUG_ERR, - "export_one_entry - %s: Failed to add clear password storage scheme: %d\n", + slapi_log_err(SLAPI_LOG_ERR, + "export_one_entry", "%s: Failed to add clear password storage scheme: %d\n", slapi_sdn_get_dn(&expargs->ep->ep_entry->e_sdn), rc); } slapi_ch_free_string(&val.bv_val); @@ -1059,7 +1057,7 @@ export_one_entry(struct ldbminfo *li, "%s: Processed %d entries (%d%%).", inst->inst_name, *expargs->cnt, percent); } - LDAPDebug(LDAP_DEBUG_INFO, "export %s: Processed %d entries (%d%%).\n", + slapi_log_err(SLAPI_LOG_INFO, "export_one_entry", "export %s: Processed %d entries (%d%%).\n", inst->inst_name, *expargs->cnt, percent); *expargs->lastcnt = *expargs->cnt; } @@ -1118,7 +1116,7 @@ ldbm_back_ldbm2ldif( Slapi_PBlock *pb ) int server_running; export_args eargs = {0}; - LDAPDebug(LDAP_DEBUG_TRACE, "=> ldbm_back_ldbm2ldif\n", 0, 0, 0 ); + slapi_log_err(SLAPI_LOG_TRACE, "ldbm_back_ldbm2ldif", "=>\n"); slapi_pblock_get( pb, SLAPI_PLUGIN_PRIVATE, &li ); slapi_pblock_get( pb, SLAPI_TASK_FLAGS, &task_flags ); @@ -1150,10 +1148,9 @@ ldbm_back_ldbm2ldif( Slapi_PBlock *pb ) if (run_from_cmdline && li->li_dblayer_private->dblayer_private_mem && server_running) { - LDAPDebug(LDAP_DEBUG_ERR, - "ldbm_back_ldbm2ldif - Cannot export the database while the server " - "is running and nsslapd-db-private-mem option is used, please use ldif2db.pl\n", - 0, 0, 0); + slapi_log_err(SLAPI_LOG_ERR, + "ldbm_back_ldbm2ldif", "Cannot export the database while the server " + "is running and nsslapd-db-private-mem option is used, please use ldif2db.pl\n"); return_value = -1; goto bye; } @@ -1165,16 +1162,16 @@ ldbm_back_ldbm2ldif( Slapi_PBlock *pb ) slapi_pblock_get(pb, SLAPI_BACKEND_INSTANCE_NAME, &instance_name); inst = ldbm_instance_find_by_name(li, instance_name); if (NULL == inst) { - LDAPDebug(LDAP_DEBUG_ERR, "ldbm_back_ldbm2ldif - Unknown backend instance %s\n", - instance_name, 0, 0); + slapi_log_err(SLAPI_LOG_ERR, "ldbm_back_ldbm2ldif", "Unknown backend instance %s\n", + instance_name); return_value = -1; goto bye; } /* [605974] command db2ldif should not be able to run when on-line * import is running */ if (dblayer_in_import(inst)) { - LDAPDebug(LDAP_DEBUG_ERR, "ldbm_back_ldbm2ldif - backend instance %s is busy\n", - instance_name, 0, 0); + slapi_log_err(SLAPI_LOG_ERR, "ldbm_back_ldbm2ldif", "Backend instance %s is busy\n", + instance_name); return_value = -1; goto bye; } @@ -1185,22 +1182,22 @@ ldbm_back_ldbm2ldif( Slapi_PBlock *pb ) } else { slapi_pblock_get(pb, SLAPI_BACKEND, &be); if (!be) { - LDAPDebug0Args(LDAP_DEBUG_ERR, "ldbm_back_ldbm2ldif - No backend\n"); + slapi_log_err(SLAPI_LOG_ERR, "ldbm_back_ldbm2ldif", "No backend\n"); return_value = -1; goto bye; } inst = (ldbm_instance *)be->be_instance_info; if (!inst) { - LDAPDebug0Args(LDAP_DEBUG_ERR, "ldbm_back_ldbm2ldif - Unknown backend instance\n"); + slapi_log_err(SLAPI_LOG_ERR, "ldbm_back_ldbm2ldif", "Unknown backend instance\n"); return_value = -1; goto bye; } /* check if an import/restore is already ongoing... */ if (instance_set_busy(inst) != 0) { - LDAPDebug(LDAP_DEBUG_ERR, "ldbm_back_ldbm2ldif - Backend instance '%s' is already in the middle" + slapi_log_err(SLAPI_LOG_ERR, "ldbm_back_ldbm2ldif", "Backend instance '%s' is already in the middle" " of another task and cannot be disturbed.\n", - inst->inst_name, 0, 0); + inst->inst_name); return_value = LDBM2LDIF_BUSY; goto bye; } @@ -1242,8 +1239,7 @@ ldbm_back_ldbm2ldif( Slapi_PBlock *pb ) options |= SLAPI_DUMP_STATEINFO; if (fname == NULL) { - LDAPDebug(LDAP_DEBUG_ERR, "ldbm_back_ldbm2ldif - db2ldif: no LDIF filename supplied\n", - 0, 0, 0); + slapi_log_err(SLAPI_LOG_ERR, "ldbm_back_ldbm2ldif", "db2ldif: no LDIF filename supplied\n"); return_value = -1; goto bye; } @@ -1263,7 +1259,7 @@ ldbm_back_ldbm2ldif( Slapi_PBlock *pb ) SLAPD_DEFAULT_FILE_MODE); } if (fd < 0) { - LDAPDebug(LDAP_DEBUG_ERR, "ldbm_back_ldbm2ldif - db2ldif: can't open %s: %d (%s)\n", + slapi_log_err(SLAPI_LOG_ERR, "ldbm_back_ldbm2ldif", "db2ldif: can't open %s: %d (%s)\n", fname, errno, dblayer_strerror(errno)); return_value = -1; goto bye; @@ -1274,15 +1270,13 @@ ldbm_back_ldbm2ldif( Slapi_PBlock *pb ) if ( we_start_the_backends ) { if (0 != dblayer_start(li,DBLAYER_EXPORT_MODE)) { - LDAPDebug(LDAP_DEBUG_ERR, "ldbm_back_ldbm2ldif - db2ldif: Failed to init database\n", - 0, 0, 0 ); + slapi_log_err(SLAPI_LOG_ERR, "ldbm_back_ldbm2ldif", "db2ldif: Failed to init database\n"); return_value = -1; goto bye; } /* dblayer_instance_start will init the id2entry index. */ if (0 != dblayer_instance_start(be, DBLAYER_EXPORT_MODE)) { - LDAPDebug(LDAP_DEBUG_ERR, "ldbm_back_ldbm2ldif - db2ldif: Failed to init instance\n", - 0, 0, 0); + slapi_log_err(SLAPI_LOG_ERR, "ldbm_back_ldbm2ldif", "db2ldif: Failed to init instance\n"); return_value = -1; goto bye; } @@ -1293,8 +1287,7 @@ ldbm_back_ldbm2ldif( Slapi_PBlock *pb ) get_ids_from_disk(be); if ((( dblayer_get_id2entry( be, &db )) != 0) || (db == NULL)) { - LDAPDebug(LDAP_DEBUG_ERR, "ldbm_back_ldbm2ldif - Could not open/create id2entry\n", - 0, 0, 0 ); + slapi_log_err(SLAPI_LOG_ERR, "ldbm_back_ldbm2ldif", "Could not open/create id2entry\n"); return_value = -1; goto bye; } @@ -1314,8 +1307,8 @@ ldbm_back_ldbm2ldif( Slapi_PBlock *pb ) /* get a cursor to we can walk over the table */ return_value = db->cursor(db,NULL,&dbc,0); if (0 != return_value || NULL == dbc) { - LDAPDebug2Args(LDAP_DEBUG_ERR, - "ldbm_back_ldbm2ldif - Failed to get cursor for db2ldif; %s (%d)\n", + slapi_log_err(SLAPI_LOG_ERR, + "ldbm_back_ldbm2ldif", "Failed to get cursor for db2ldif; %s (%d)\n", dblayer_strerror(return_value), return_value); return_value = -1; goto bye; @@ -1339,14 +1332,14 @@ ldbm_back_ldbm2ldif( Slapi_PBlock *pb ) if (NULL == idl) { if (err) { /* most likely, indexes are bad. */ - LDAPDebug2Args(LDAP_DEBUG_ERR, - "ldbm_back_ldbm2ldif - Failed to fetch subtree lists (error %d) %s\n", + slapi_log_err(SLAPI_LOG_ERR, + "ldbm_back_ldbm2ldif", "Failed to fetch subtree lists (error %d) %s\n", err, dblayer_strerror(err)); - LDAPDebug0Args(LDAP_DEBUG_ERR, - "ldbm_back_ldbm2ldif - Possibly the entrydn/entryrdn or ancestorid index is " + slapi_log_err(SLAPI_LOG_ERR, + "ldbm_back_ldbm2ldif", "Possibly the entrydn/entryrdn or ancestorid index is " "corrupted or does not exist.\n"); - LDAPDebug0Args(LDAP_DEBUG_ERR, - "ldbm_back_ldbm2ldif - Attempting direct unindexed export instead.\n"); + slapi_log_err(SLAPI_LOG_ERR, + "ldbm_back_ldbm2ldif", "Attempting direct unindexed export instead.\n"); } ok_index = 0; idl = NULL; @@ -1410,9 +1403,9 @@ ldbm_back_ldbm2ldif( Slapi_PBlock *pb ) if (return_value != DB_LOCK_DEADLOCK) break; } if (return_value) { - LDAPDebug(LDAP_DEBUG_ERR, "ldbm_back_ldbm2ldif - db2ldif: failed to read " + slapi_log_err(SLAPI_LOG_ERR, "ldbm_back_ldbm2ldif", "db2ldif: failed to read " "entry %lu, err %d\n", (u_long)idl->b_ids[idindex], - return_value, 0); + return_value); return_value = -1; break; } @@ -1511,8 +1504,8 @@ ldbm_back_ldbm2ldif( Slapi_PBlock *pb ) if (rc) { /* We cannot use the entryrdn index; * Compose dn from the entries in id2entry */ - LDAPDebug2Args(LDAP_DEBUG_TRACE, - "ldbm_back_ldbm2ldif - entryrdn is not available; " + slapi_log_err(SLAPI_LOG_TRACE, + "ldbm_back_ldbm2ldif", "entryrdn is not available; " "composing dn (rdn: %s, ID: %d)\n", rdn, temp_id); if (NOID != pid) { /* if not a suffix */ @@ -1523,8 +1516,8 @@ ldbm_back_ldbm2ldif( Slapi_PBlock *pb ) &psrdn, NULL, 0, run_from_cmdline, NULL); if (rc) { - LDAPDebug1Arg(LDAP_DEBUG_WARNING, - "ldbm_back_ldbm2ldif - Skip ID %d\n", pid); + slapi_log_err(SLAPI_LOG_WARNING, + "ldbm_back_ldbm2ldif", "Skip ID %d\n", pid); slapi_ch_free_string(&rdn); slapi_rdn_done(&psrdn); backentry_free(&ep); @@ -1534,8 +1527,8 @@ ldbm_back_ldbm2ldif( Slapi_PBlock *pb ) /* Generate DN string from Slapi_RDN */ rc = slapi_rdn_get_dn(&psrdn, &pdn); if (rc) { - LDAPDebug2Args(LDAP_DEBUG_WARNING, - "ldbm_back_ldbm2ldif - Failed to compose dn for " + slapi_log_err(SLAPI_LOG_WARNING, + "ldbm_back_ldbm2ldif", "Failed to compose dn for " "(rdn: %s, ID: %d) from Slapi_RDN\n", rdn, temp_id); slapi_ch_free_string(&rdn); @@ -1557,12 +1550,12 @@ ldbm_back_ldbm2ldif( Slapi_PBlock *pb ) myrc = CACHE_ADD( &inst->inst_dncache, bdn, NULL ); if (myrc) { backdn_free(&bdn); - slapi_log_error(SLAPI_LOG_CACHE, "ldbm_back_ldbm2ldif", + slapi_log_err(SLAPI_LOG_CACHE, "ldbm_back_ldbm2ldif", "%s is already in the dn cache (%d)\n", dn, myrc); } else { CACHE_RETURN(&inst->inst_dncache, &bdn); - slapi_log_error(SLAPI_LOG_CACHE, "ldbm_back_ldbm2ldif", + slapi_log_err(SLAPI_LOG_CACHE, "ldbm_back_ldbm2ldif", "entryrdn_lookup_dn returned: %s, " "and set to dn cache\n", dn); } @@ -1579,7 +1572,7 @@ ldbm_back_ldbm2ldif( Slapi_PBlock *pb ) if ( (ep->ep_entry) != NULL ) { ep->ep_id = temp_id; } else { - LDAPDebug1Arg(LDAP_DEBUG_WARNING, "ldbm_back_ldbm2ldif - skipping " + slapi_log_err(SLAPI_LOG_WARNING, "ldbm_back_ldbm2ldif", "Skipping " "badly formatted entry with id %lu\n", (u_long)temp_id); backentry_free( &ep ); continue; @@ -1606,7 +1599,7 @@ ldbm_back_ldbm2ldif( Slapi_PBlock *pb ) "%s: Processed %d entries (100%%).", inst->inst_name, cnt); } - LDAPDebug(LDAP_DEBUG_INFO, + slapi_log_err(SLAPI_LOG_INFO, "export %s: Processed %d entries (100%%).\n", inst->inst_name, cnt, 0); } @@ -1624,17 +1617,17 @@ bye: close(fd); } - LDAPDebug(LDAP_DEBUG_TRACE, "<= ldbm_back_ldbm2ldif\n", 0, 0, 0 ); + slapi_log_err(SLAPI_LOG_TRACE, "ldbm_back_ldbm2ldif", "<=\n"); if (we_start_the_backends && NULL != li) { if (0 != dblayer_flush(li)) { - LDAPDebug0Args(LDAP_DEBUG_ANY, - "ldbm_back_ldbm2ldif - db2ldif: Failed to flush database\n" ); + slapi_log_err(SLAPI_LOG_ERR, + "ldbm_back_ldbm2ldif", "db2ldif: Failed to flush database\n" ); } if (0 != dblayer_close(li,DBLAYER_EXPORT_MODE)) { - LDAPDebug0Args(LDAP_DEBUG_ANY, - "ldbm_back_ldbm2ldif - db2ldif: Failed to close database\n" ); + slapi_log_err(SLAPI_LOG_ERR, + "ldbm_back_ldbm2ldif", "db2ldif: Failed to close database\n" ); } } @@ -1662,10 +1655,10 @@ static void ldbm2index_bad_vlv(Slapi_Task *task, ldbm_instance *inst, slapi_task_log_notice(task, "%s: Known VLV indexes are: %s", inst->inst_name, text); } - LDAPDebug(LDAP_DEBUG_ERR, - "ldbm2index_bad_vlv: Unknown VLV Index named '%s'\n", index, 0, 0); - LDAPDebug(LDAP_DEBUG_ERR, - "ldbm2index_bad_vlv: Known VLV Indexes are: %s\n", text, 0, 0); + slapi_log_err(SLAPI_LOG_ERR, + "ldbm2index_bad_vlv", "Unknown VLV Index named '%s'\n", index); + slapi_log_err(SLAPI_LOG_ERR, + "ldbm2index_bad_vlv", "Known VLV Indexes are: %s\n", text); slapi_ch_free_string(&text); } @@ -1708,7 +1701,7 @@ ldbm_back_ldbm2index(Slapi_PBlock *pb) Slapi_Value **nstombstone_vals = NULL; int istombstone = 0; - LDAPDebug(LDAP_DEBUG_TRACE, "=> ldbm_back_ldbm2index\n", 0, 0, 0 ); + slapi_log_err(SLAPI_LOG_TRACE, "ldbm_back_ldbm2index", "=>\n"); if ( g_get_shutdown() || c_get_shutdown() ) { return return_value; } @@ -1731,8 +1724,8 @@ ldbm_back_ldbm2index(Slapi_PBlock *pb) slapi_task_log_notice(task, "Unknown ldbm instance %s", instance_name); } - LDAPDebug(LDAP_DEBUG_ERR, "ldbm_back_ldbm2index - Unknown ldbm instance %s\n", - instance_name, 0, 0); + slapi_log_err(SLAPI_LOG_ERR, "ldbm_back_ldbm2index", "Unknown ldbm instance %s\n", + instance_name); return return_value; } be = inst->inst_be; @@ -1746,15 +1739,14 @@ ldbm_back_ldbm2index(Slapi_PBlock *pb) ldbm_config_internal_set(li, CONFIG_DB_TRANSACTION_LOGGING, "off"); if (0 != dblayer_start(li,DBLAYER_INDEX_MODE)) { - LDAPDebug(LDAP_DEBUG_ERR, - "ldbm2index: Failed to init database\n", 0, 0, 0 ); + slapi_log_err(SLAPI_LOG_ERR, + "ldbm2index", "Failed to init database\n"); return return_value; } /* dblayer_instance_start will init the id2entry index. */ if (0 != dblayer_instance_start(be, DBLAYER_INDEX_MODE)) { - LDAPDebug(LDAP_DEBUG_ERR, "ldbm_back_ldbm2index - db2ldif: Failed to init instance\n", - 0, 0, 0); + slapi_log_err(SLAPI_LOG_ERR, "ldbm_back_ldbm2index", "db2ldif: Failed to init instance\n"); return return_value; } @@ -1764,23 +1756,22 @@ ldbm_back_ldbm2index(Slapi_PBlock *pb) /* make sure no other tasks are going, and set the backend readonly */ if (instance_set_busy_and_readonly(inst) != 0) { - LDAPDebug(LDAP_DEBUG_ERR, "ldbm_back_ldbm2index - ldbm: '%s' is already in the middle of " + slapi_log_err(SLAPI_LOG_ERR, "ldbm_back_ldbm2index", "ldbm: '%s' is already in the middle of " "another task and cannot be disturbed.\n", - inst->inst_name, 0, 0); + inst->inst_name); return return_value; } if ((( dblayer_get_id2entry( be, &db )) != 0 ) || (db == NULL)) { - LDAPDebug(LDAP_DEBUG_ERR, "ldbm_back_ldbm2index - Could not open/create id2entry\n", - 0, 0, 0 ); + slapi_log_err(SLAPI_LOG_ERR, "ldbm_back_ldbm2index", "Could not open/create id2entry\n"); goto err_min; } /* get a cursor to we can walk over the table */ rc = db->cursor(db, NULL, &dbc, 0); if (0 != rc) { - LDAPDebug(LDAP_DEBUG_ERR, - "ldbm_back_ldbm2index - Failed to get cursor for ldbm2index\n", 0, 0, 0 ); + slapi_log_err(SLAPI_LOG_ERR, + "ldbm_back_ldbm2index", "Failed to get cursor for ldbm2index\n"); goto err_min; } @@ -1797,9 +1788,9 @@ ldbm_back_ldbm2index(Slapi_PBlock *pb) slapi_ch_free(&(data.data)); isfirst = 1; } else { - LDAPDebug(LDAP_DEBUG_ERR, - "ldbm_back_ldbm2index - Failed to seek within id2entry (BAD %d)\n", - return_value, 0 ,0); + slapi_log_err(SLAPI_LOG_ERR, + "ldbm_back_ldbm2index", "Failed to seek within id2entry (BAD %d)\n", + return_value); goto err_out; } @@ -1829,7 +1820,7 @@ ldbm_back_ldbm2index(Slapi_PBlock *pb) slapi_task_log_notice(task, "%s: Indexing %s", inst->inst_name, LDBM_ANCESTORID_STR); } - LDAPDebug2Args(LDAP_DEBUG_INFO, "ldbm_back_ldbm2index - %s: Indexing %s\n", + slapi_log_err(SLAPI_LOG_INFO, "ldbm_back_ldbm2index", "%s: Indexing %s\n", inst->inst_name, LDBM_ANCESTORID_STR); index_ext |= DB2INDEX_ANCESTORID; } else if (strcasecmp(attrs[i]+1, LDBM_ENTRYRDN_STR) == 0) { @@ -1838,7 +1829,7 @@ ldbm_back_ldbm2index(Slapi_PBlock *pb) slapi_task_log_notice(task, "%s: Indexing %s", inst->inst_name, LDBM_ENTRYRDN_STR); } - LDAPDebug2Args(LDAP_DEBUG_INFO, "ldbm_back_ldbm2index - %s: Indexing %s\n", + slapi_log_err(SLAPI_LOG_INFO, "ldbm_back_ldbm2index", "%s: Indexing %s\n", inst->inst_name, LDBM_ENTRYRDN_STR); index_ext |= DB2INDEX_ENTRYRDN; } else { @@ -1848,8 +1839,8 @@ ldbm_back_ldbm2index(Slapi_PBlock *pb) inst->inst_name, LDBM_ENTRYRDN_STR, CONFIG_ENTRYRDN_SWITCH); } - LDAPDebug(LDAP_DEBUG_WARNING, - "ldbm_back_ldbm2index - %s: Requested to index %s, but %s is off\n", + slapi_log_err(SLAPI_LOG_WARNING, + "ldbm_back_ldbm2index", "%s: Requested to index %s, but %s is off\n", inst->inst_name, LDBM_ENTRYRDN_STR, CONFIG_ENTRYRDN_SWITCH); goto err_out; @@ -1862,8 +1853,8 @@ ldbm_back_ldbm2index(Slapi_PBlock *pb) inst->inst_name, LDBM_ENTRYDN_STR, CONFIG_ENTRYRDN_SWITCH); } - LDAPDebug(LDAP_DEBUG_WARNING, - "ldbm_back_ldbm2index - %s: Requested to index %s, but %s is on\n", + slapi_log_err(SLAPI_LOG_WARNING, + "ldbm_back_ldbm2index", "%s: Requested to index %s, but %s is on\n", inst->inst_name, LDBM_ENTRYDN_STR, CONFIG_ENTRYRDN_SWITCH); goto err_out; @@ -1875,8 +1866,8 @@ ldbm_back_ldbm2index(Slapi_PBlock *pb) "%s: Indexing attribute: %s", inst->inst_name, attrs[i]+1); } - LDAPDebug2Args(LDAP_DEBUG_INFO, - "ldbm_back_ldbm2index - %s: Indexing attribute: %s\n", + slapi_log_err(SLAPI_LOG_INFO, + "ldbm_back_ldbm2index", "%s: Indexing attribute: %s\n", inst->inst_name, attrs[i] + 1); } } else { @@ -1889,8 +1880,8 @@ ldbm_back_ldbm2index(Slapi_PBlock *pb) slapi_task_log_notice(task, "%s: Indexing attribute: %s", inst->inst_name, attrs[i]+1); } - LDAPDebug2Args(LDAP_DEBUG_INFO, - "ldbm_back_ldbm2index - %s: Indexing attribute: %s\n", + slapi_log_err(SLAPI_LOG_INFO, + "ldbm_back_ldbm2index", "%s: Indexing attribute: %s\n", inst->inst_name, attrs[i]+1); } dblayer_erase_index_file(be, ai, i/* chkpt; 1st time only */); @@ -1916,7 +1907,7 @@ ldbm_back_ldbm2index(Slapi_PBlock *pb) slapi_task_log_notice(task, "%s: Indexing VLV: %s", inst->inst_name, attrs[i]+1); } - LDAPDebug2Args(LDAP_DEBUG_INFO, "ldbm_back_ldbm2index - %s: Indexing VLV: %s\n", + slapi_log_err(SLAPI_LOG_INFO, "ldbm_back_ldbm2index", "%s: Indexing VLV: %s\n", inst->inst_name, attrs[i]+1); } break; @@ -1944,13 +1935,13 @@ ldbm_back_ldbm2index(Slapi_PBlock *pb) if (! idl) { /* most likely, indexes are bad if err is set. */ if (0 != err) { - LDAPDebug(LDAP_DEBUG_WARNING, - "ldbm_back_ldbm2index - %s: Failed to fetch subtree lists: (%d) %s\n", + slapi_log_err(SLAPI_LOG_WARNING, + "ldbm_back_ldbm2index", "%s: Failed to fetch subtree lists: (%d) %s\n", inst->inst_name, err, dblayer_strerror(err)); - LDAPDebug1Arg(LDAP_DEBUG_WARNING, - "ldbm_back_ldbm2index - %s: Possibly the entrydn/entryrdn or ancestorid index " + slapi_log_err(SLAPI_LOG_WARNING, + "ldbm_back_ldbm2index", "%s: Possibly the entrydn/entryrdn or ancestorid index " "is corrupted or does not exist.\n", inst->inst_name); - LDAPDebug1Arg(LDAP_DEBUG_WARNING, + slapi_log_err(SLAPI_LOG_WARNING,"ldbm_back_ldbm2index", "%s: Attempting brute-force method instead.\n", inst->inst_name); if (task) { @@ -1987,7 +1978,7 @@ ldbm_back_ldbm2index(Slapi_PBlock *pb) rc = db->get(db, NULL, &key, &data, 0); if (rc) { - LDAPDebug(LDAP_DEBUG_ERR, "ldbm_back_ldbm2index - %s: Failed " + slapi_log_err(SLAPI_LOG_ERR, "ldbm_back_ldbm2index", "%s: Failed " "to read database, errno=%d (%s)\n", inst->inst_name, rc, dblayer_strerror(rc)); if (task) { @@ -2012,7 +2003,7 @@ ldbm_back_ldbm2index(Slapi_PBlock *pb) if (DB_NOTFOUND == rc) { break; } else if (0 != rc) { - LDAPDebug(LDAP_DEBUG_ERR, "ldbm_back_ldbm2index - %s: Failed to read database, " + slapi_log_err(SLAPI_LOG_ERR, "ldbm_back_ldbm2index", "%s: Failed to read database, " "errno=%d (%s)\n", inst->inst_name, rc, dblayer_strerror(rc)); if (task) { @@ -2096,8 +2087,8 @@ ldbm_back_ldbm2index(Slapi_PBlock *pb) if (rc) { /* We cannot use the entryrdn index; * Compose dn from the entries in id2entry */ - LDAPDebug2Args(LDAP_DEBUG_TRACE, - "ldbm2index: entryrdn is not available; " + slapi_log_err(SLAPI_LOG_TRACE, "ldbm_back_ldbm2index", + "entryrdn is not available; " "composing dn (rdn: %s, ID: %d)\n", rdn, temp_id); if (NOID != pid) { /* if not a suffix */ @@ -2108,14 +2099,14 @@ ldbm_back_ldbm2index(Slapi_PBlock *pb) &psrdn, NULL, 0, run_from_cmdline, NULL); if (rc) { - LDAPDebug1Arg(LDAP_DEBUG_WARNING, - "ldbm_back_ldbm2index - Skip ID %d\n", pid); - LDAPDebug(LDAP_DEBUG_WARNING, - "ldbm_back_ldbm2index - Parent entry (ID %d) of entry. " + slapi_log_err(SLAPI_LOG_WARNING, + "ldbm_back_ldbm2index", "Skip ID %d\n", pid); + slapi_log_err(SLAPI_LOG_WARNING, + "ldbm_back_ldbm2index", "Parent entry (ID %d) of entry. " "(ID %d, rdn: %s) does not exist.\n", pid, temp_id, rdn); - LDAPDebug1Arg(LDAP_DEBUG_WARNING, - "ldbm_back_ldbm2index - We recommend to export the backend " + slapi_log_err(SLAPI_LOG_WARNING, + "ldbm_back_ldbm2index", "We recommend to export the backend " "instance %s and reimport it.\n", instance_name); slapi_ch_free_string(&rdn); @@ -2127,8 +2118,8 @@ ldbm_back_ldbm2index(Slapi_PBlock *pb) /* Generate DN string from Slapi_RDN */ rc = slapi_rdn_get_dn(&psrdn, &pdn); if (rc) { - LDAPDebug2Args(LDAP_DEBUG_ANY, - "ldbm_back_ldbm2index - Failed to compose dn for " + slapi_log_err(SLAPI_LOG_ERR, + "ldbm_back_ldbm2index", "Failed to compose dn for " "(rdn: %s, ID: %d) from Slapi_RDN\n", rdn, temp_id); slapi_ch_free_string(&rdn); @@ -2149,12 +2140,12 @@ ldbm_back_ldbm2index(Slapi_PBlock *pb) myrc = CACHE_ADD( &inst->inst_dncache, bdn, NULL ); if (myrc) { backdn_free(&bdn); - slapi_log_error(SLAPI_LOG_CACHE, "ldbm_back_ldbm2index", + slapi_log_err(SLAPI_LOG_CACHE, "ldbm_back_ldbm2index", "%s is already in the dn cache (%d)\n", dn, myrc); } else { CACHE_RETURN(&inst->inst_dncache, &bdn); - slapi_log_error(SLAPI_LOG_CACHE, "ldbm_back_ldbm2index", + slapi_log_err(SLAPI_LOG_CACHE, "ldbm_back_ldbm2index", "entryrdn_lookup_dn returned: %s, " "and set to dn cache\n", dn); } @@ -2177,9 +2168,9 @@ ldbm_back_ldbm2index(Slapi_PBlock *pb) "%s: WARNING: skipping badly formatted entry (id %lu)", inst->inst_name, (u_long)temp_id); } - LDAPDebug(LDAP_DEBUG_WARNING, - "ldbm_back_ldbm2index - %s: Skipping badly formatted entry (id %lu)\n", - inst->inst_name, (u_long)temp_id, 0); + slapi_log_err(SLAPI_LOG_WARNING, + "ldbm_back_ldbm2index", "%s: Skipping badly formatted entry (id %lu)\n", + inst->inst_name, (u_long)temp_id); backentry_free( &ep ); continue; } @@ -2200,7 +2191,7 @@ ldbm_back_ldbm2index(Slapi_PBlock *pb) if (!run_from_cmdline) { rc = dblayer_txn_begin(be, NULL, &txn); if (0 != rc) { - slapi_log_error(SLAPI_LOG_ERR, "ldbm_back_ldbm2index", + slapi_log_err(SLAPI_LOG_ERR, "ldbm_back_ldbm2index", "%s: Failed to begin txn for update index '%s' (err %d: %s)\n", inst->inst_name, SLAPI_ATTR_TOMBSTONE_CSN, rc, dblayer_strerror(rc)); if (task) { @@ -2218,7 +2209,7 @@ ldbm_back_ldbm2index(Slapi_PBlock *pb) rc = index_addordel_string(be, SLAPI_ATTR_TOMBSTONE_CSN, deletion_csn_str, ep->ep_id, BE_INDEX_ADD, &txn); if (rc != 0) { - slapi_log_error(SLAPI_LOG_ERR, "ldbm_back_ldbm2index", + slapi_log_err(SLAPI_LOG_ERR, "ldbm_back_ldbm2index", "%s: Failed to update index '%s' (err %d: %s)\n", inst->inst_name, SLAPI_ATTR_TOMBSTONE_CSN, rc, dblayer_strerror(rc)); if (task) { @@ -2236,7 +2227,7 @@ ldbm_back_ldbm2index(Slapi_PBlock *pb) if (!run_from_cmdline) { rc = dblayer_txn_commit(be, &txn); if (0 != rc) { - slapi_log_error(SLAPI_LOG_ERR, "ldbm_back_ldbm2index", + slapi_log_err(SLAPI_LOG_ERR, "ldbm_back_ldbm2index", "%s: Failed to commit txn for update index '%s' (err %d: %s)\n", inst->inst_name, SLAPI_ATTR_TOMBSTONE_CSN, rc, dblayer_strerror(rc)); if (task) { @@ -2288,11 +2279,11 @@ ldbm_back_ldbm2index(Slapi_PBlock *pb) if (!run_from_cmdline) { rc = dblayer_txn_begin(be, NULL, &txn); if (0 != rc) { - LDAPDebug(LDAP_DEBUG_ERR, - "ldbm_back_ldbm2index - %s: Failed to begin txn for update index '%s'\n", - inst->inst_name, indexAttrs[j], 0); - LDAPDebug(LDAP_DEBUG_ERR, - "ldbm_back_ldbm2index - %s: Error %d: %s\n", inst->inst_name, rc, + slapi_log_err(SLAPI_LOG_ERR, + "ldbm_back_ldbm2index", "%s: Failed to begin txn for update index '%s'\n", + inst->inst_name, indexAttrs[j]); + slapi_log_err(SLAPI_LOG_ERR, + "ldbm_back_ldbm2index", "%s: Error %d: %s\n", inst->inst_name, rc, dblayer_strerror(rc)); if (task) { slapi_task_log_notice(task, @@ -2311,11 +2302,11 @@ ldbm_back_ldbm2index(Slapi_PBlock *pb) rc = index_addordel_values_sv(be, indexAttrs[j], svals, NULL, ep->ep_id, BE_INDEX_ADD, &txn); } if (rc) { - LDAPDebug(LDAP_DEBUG_ERR, - "ldbm_back_ldbm2index - %s: Failed to update index '%s'\n", - inst->inst_name, indexAttrs[j], 0); - LDAPDebug(LDAP_DEBUG_ERR, - "ldbm_back_ldbm2index - %s: Error %d: %s\n", inst->inst_name, rc, + slapi_log_err(SLAPI_LOG_ERR, + "ldbm_back_ldbm2index", "%s: Failed to update index '%s'\n", + inst->inst_name, indexAttrs[j]); + slapi_log_err(SLAPI_LOG_ERR, + "ldbm_back_ldbm2index", "%s: Error %d: %s\n", inst->inst_name, rc, dblayer_strerror(rc)); if (task) { slapi_task_log_notice(task, @@ -2332,12 +2323,12 @@ ldbm_back_ldbm2index(Slapi_PBlock *pb) if (!run_from_cmdline) { rc = dblayer_txn_commit(be, &txn); if (0 != rc) { - LDAPDebug(LDAP_DEBUG_ERR, - "ldbm_back_ldbm2index - %s: Failed to commit txn for " + slapi_log_err(SLAPI_LOG_ERR, + "ldbm_back_ldbm2index", "%s: Failed to commit txn for " "update index '%s'\n", - inst->inst_name, indexAttrs[j], 0); - LDAPDebug(LDAP_DEBUG_ERR, - "ldbm_back_ldbm2index - %s: Error %d: %s\n", inst->inst_name, rc, + inst->inst_name, indexAttrs[j]); + slapi_log_err(SLAPI_LOG_ERR, + "ldbm_back_ldbm2index", "%s: Error %d: %s\n", inst->inst_name, rc, dblayer_strerror(rc)); if (task) { slapi_task_log_notice(task, @@ -2371,11 +2362,11 @@ ldbm_back_ldbm2index(Slapi_PBlock *pb) rc = dblayer_txn_begin(be, NULL, &txn); if (0 != rc) { - LDAPDebug(LDAP_DEBUG_ERR, - "ldbm_back_ldbm2index - %s: Failed to begin txn for update index '%s'\n", - inst->inst_name, ai, 0); - LDAPDebug(LDAP_DEBUG_ERR, - "ldbm_back_ldbm2index - %s: Error %d: %s\n", inst->inst_name, rc, + slapi_log_err(SLAPI_LOG_ERR, + "ldbm_back_ldbm2index", "%s: Failed to begin txn for update index '%s'\n", + inst->inst_name, ai); + slapi_log_err(SLAPI_LOG_ERR, + "ldbm_back_ldbm2index", "%s: Error %d: %s\n", inst->inst_name, rc, dblayer_strerror(rc)); if (task) { slapi_task_log_notice(task, @@ -2398,11 +2389,11 @@ ldbm_back_ldbm2index(Slapi_PBlock *pb) { rc = dblayer_txn_commit(be, &txn); if (0 != rc) { - LDAPDebug(LDAP_DEBUG_ERR, - "ldbm_back_ldbm2index - %s: Failed to commit txn for update index '%s'\n", - inst->inst_name, ai, 0); - LDAPDebug(LDAP_DEBUG_ERR, - "ldbm_back_ldbm2index - %s: Error %d: %s\n", inst->inst_name, rc, + slapi_log_err(SLAPI_LOG_ERR, + "ldbm_back_ldbm2index", "%s: Failed to commit txn for update index '%s'\n", + inst->inst_name, ai); + slapi_log_err(SLAPI_LOG_ERR, + "ldbm_back_ldbm2index", "%s: Error %d: %s\n", inst->inst_name, rc, dblayer_strerror(rc)); if (task) { slapi_task_log_notice(task, @@ -2422,11 +2413,11 @@ ldbm_back_ldbm2index(Slapi_PBlock *pb) if (!entryrdn_get_noancestorid() && (index_ext & DB2INDEX_ANCESTORID)) { rc = ldbm_ancestorid_index_entry(be, ep, BE_INDEX_ADD, NULL); if (rc != 0) { - LDAPDebug(LDAP_DEBUG_ERR, - "ldbm_back_ldbm2index - %s: Failed to update index 'ancestorid'\n", - inst->inst_name, 0, 0); - LDAPDebug(LDAP_DEBUG_ERR, - "ldbm_back_ldbm2index - %s: Error %d: %s\n", inst->inst_name, rc, + slapi_log_err(SLAPI_LOG_ERR, + "ldbm_back_ldbm2index", "%s: Failed to update index 'ancestorid'\n", + inst->inst_name); + slapi_log_err(SLAPI_LOG_ERR, + "ldbm_back_ldbm2index", "%s: Error %d: %s\n", inst->inst_name, rc, dblayer_strerror(rc)); if (task) { slapi_task_log_notice(task, @@ -2443,10 +2434,10 @@ ldbm_back_ldbm2index(Slapi_PBlock *pb) if (!run_from_cmdline) { rc = dblayer_txn_begin(be, NULL, &txn); if (0 != rc) { - LDAPDebug1Arg(LDAP_DEBUG_ERR, - "ldbm_back_ldbm2index - %s: ERROR: failed to begin txn for update index 'entryrdn'\n", + slapi_log_err(SLAPI_LOG_ERR, + "ldbm_back_ldbm2index", "%s: ERROR: failed to begin txn for update index 'entryrdn'\n", inst->inst_name); - LDAPDebug(LDAP_DEBUG_ERR, "ldbm_back_ldbm2index - %s: Error %d: %s\n", + slapi_log_err(SLAPI_LOG_ERR, "ldbm_back_ldbm2index", "%s: Error %d: %s\n", inst->inst_name, rc, dblayer_strerror(rc)); if (task) { slapi_task_log_notice(task, @@ -2460,11 +2451,11 @@ ldbm_back_ldbm2index(Slapi_PBlock *pb) } rc = entryrdn_index_entry(be, ep, BE_INDEX_ADD, &txn); if (rc) { - LDAPDebug(LDAP_DEBUG_ERR, - "ldbm_back_ldbm2index - %s: Failed to update index 'entryrdn'\n", - inst->inst_name, 0, 0); - LDAPDebug(LDAP_DEBUG_ERR, - "ldbm_back_ldbm2index - %s: Error %d: %s\n", inst->inst_name, rc, + slapi_log_err(SLAPI_LOG_ERR, + "ldbm_back_ldbm2index", "%s: Failed to update index 'entryrdn'\n", + inst->inst_name); + slapi_log_err(SLAPI_LOG_ERR, + "ldbm_back_ldbm2index", "%s: Error %d: %s\n", inst->inst_name, rc, dblayer_strerror(rc)); if (task) { slapi_task_log_notice(task, @@ -2481,11 +2472,11 @@ ldbm_back_ldbm2index(Slapi_PBlock *pb) if (!run_from_cmdline) { rc = dblayer_txn_commit(be, &txn); if (0 != rc) { - LDAPDebug1Arg(LDAP_DEBUG_ERR, - "ldbm_back_ldbm2index - %s: Failed to commit txn for " + slapi_log_err(SLAPI_LOG_ERR, + "ldbm_back_ldbm2index", "%s: Failed to commit txn for " "update index 'entryrdn'\n", inst->inst_name); - LDAPDebug(LDAP_DEBUG_ERR, "ldbm_back_ldbm2index - %s: Error %d: %s\n", + slapi_log_err(SLAPI_LOG_ERR, "ldbm_back_ldbm2index", "%s: Error %d: %s\n", inst->inst_name, rc, dblayer_strerror(rc)); if (task) { slapi_task_log_notice(task, @@ -2520,7 +2511,7 @@ ldbm_back_ldbm2index(Slapi_PBlock *pb) slapi_task_log_notice(task, "%s: Indexed %d entries (%d%%).", inst->inst_name, count, percent); } - LDAPDebug(LDAP_DEBUG_INFO, "ldbm_back_ldbm2index - %s: Indexed %d entries (%d%%).\n", + slapi_log_err(SLAPI_LOG_INFO, "ldbm_back_ldbm2index", "%s: Indexed %d entries (%d%%).\n", inst->inst_name, count, percent); } @@ -2547,8 +2538,8 @@ ldbm_back_ldbm2index(Slapi_PBlock *pb) slapi_task_log_notice(task, "%s: Finished indexing.", inst->inst_name); } - LDAPDebug(LDAP_DEBUG_INFO, "ldbm_back_ldbm2index - %s: Finished indexing.\n", - inst->inst_name, 0, 0); + slapi_log_err(SLAPI_LOG_INFO, "ldbm_back_ldbm2index", "%s: Finished indexing.\n", + inst->inst_name); return_value = 0; /* success */ err_out: backentry_free( &ep ); /* if ep or *ep is NULL, it does nothing */ @@ -2572,13 +2563,13 @@ err_min: if (run_from_cmdline) { if (0 != dblayer_flush(li)) { - LDAPDebug(LDAP_DEBUG_ERR, - "ldbm_back_ldbm2index - %s: Failed to flush database\n", inst->inst_name, 0, 0); + slapi_log_err(SLAPI_LOG_ERR, + "ldbm_back_ldbm2index", "%s: Failed to flush database\n", inst->inst_name); } dblayer_instance_close(be); if (0 != dblayer_close(li,DBLAYER_INDEX_MODE)) { - LDAPDebug(LDAP_DEBUG_ERR, - "ldbm_back_ldbm2index - %s: Failed to close database\n", inst->inst_name, 0, 0); + slapi_log_err(SLAPI_LOG_ERR, + "ldbm_back_ldbm2index", "%s: Failed to close database\n", inst->inst_name); } } @@ -2590,7 +2581,7 @@ err_min: slapi_ch_free((void **)&pvlv); } - LDAPDebug(LDAP_DEBUG_TRACE, "<= ldbm_back_ldbm2index\n", 0, 0, 0 ); + slapi_log_err(SLAPI_LOG_TRACE, "ldbm_back_ldbm2index", "<=\n"); return return_value; } @@ -2742,7 +2733,7 @@ int ldbm_back_upgradedb(Slapi_PBlock *pb) PRUint32 dbversion_flags = DBVERSION_ALL; slapi_pblock_get(pb, SLAPI_SEQ_TYPE, &up_flags); - slapi_log_error(SLAPI_LOG_TRACE, "ldbm_back_upgradedb", "Reindexing all...\n"); + slapi_log_err(SLAPI_LOG_TRACE, "ldbm_back_upgradedb", "Reindexing all...\n"); slapi_pblock_get(pb, SLAPI_TASK_FLAGS, &task_flags); slapi_pblock_get(pb, SLAPI_BACKEND_TASK, &task); slapi_pblock_get(pb, SLAPI_DB2LDIF_SERVER_RUNNING, &server_running); @@ -2766,7 +2757,7 @@ int ldbm_back_upgradedb(Slapi_PBlock *pb) ldbm_instance *inst = NULL; /* server is up -- mark all backends busy */ - slapi_log_error(SLAPI_LOG_TRACE, "ldbm_back_upgradedb", + slapi_log_err(SLAPI_LOG_TRACE, "ldbm_back_upgradedb", "server is up -- marking all LDBM backends busy\n"); for (inst_obj = objset_first_obj(li->li_instance_set); inst_obj; inst_obj = objset_next_obj(li->li_instance_set, inst_obj)) @@ -2777,7 +2768,7 @@ int ldbm_back_upgradedb(Slapi_PBlock *pb) it should not cleared in this thread [610347] */ if (instance_set_busy(inst) != 0) { - slapi_log_error(SLAPI_LOG_ERR, "ldbm_back_upgradedb", + slapi_log_err(SLAPI_LOG_ERR, "ldbm_back_upgradedb", "ldbm: '%s' is already in the middle of " "another task and cannot be disturbed.\n", inst->inst_name); @@ -2811,7 +2802,7 @@ int ldbm_back_upgradedb(Slapi_PBlock *pb) * DN2RDN option (-r) is given, but subtree-rename is off. * Print an error and back off. */ - slapi_log_error(SLAPI_LOG_ERR, "ldbm_back_upgradedb", + slapi_log_err(SLAPI_LOG_ERR, "ldbm_back_upgradedb", "DN2RDN option (-r) is given, but %s is off in " "dse.ldif. Please change the value to on.\n", CONFIG_ENTRYRDN_SWITCH); @@ -2839,7 +2830,7 @@ int ldbm_back_upgradedb(Slapi_PBlock *pb) } if (!need_upgrade) { - slapi_log_error(SLAPI_LOG_INFO, "ldbm_back_upgradedb", + slapi_log_err(SLAPI_LOG_INFO, "ldbm_back_upgradedb", "Index version is up-to-date\n"); return 0; } @@ -2847,7 +2838,7 @@ int ldbm_back_upgradedb(Slapi_PBlock *pb) } else { - slapi_log_error(SLAPI_LOG_WARNING, + slapi_log_err(SLAPI_LOG_WARNING, "ldbm_back_upgradedb", "No instance to be upgraded\n"); return -1; } @@ -2860,7 +2851,7 @@ int ldbm_back_upgradedb(Slapi_PBlock *pb) slapi_pblock_get( pb, SLAPI_SEQ_VAL, &dest_dir ); if (NULL == dest_dir) { - slapi_log_error(SLAPI_LOG_ERR, "upgrade DB", + slapi_log_err(SLAPI_LOG_ERR, "upgrade DB", "Backup directory is not specified.\n"); return -1; } @@ -2899,7 +2890,7 @@ int ldbm_back_upgradedb(Slapi_PBlock *pb) ldbm_back_ldif2ldbm_deluxe */ if (0 != dblayer_start(li, DBLAYER_IMPORT_MODE)) { - slapi_log_error(SLAPI_LOG_ERR, "ldbm_back_upgradedb", + slapi_log_err(SLAPI_LOG_ERR, "ldbm_back_upgradedb", "Failed to init database\n"); goto fail1; } @@ -2919,7 +2910,7 @@ int ldbm_back_upgradedb(Slapi_PBlock *pb) slapi_ch_free_string(&inst_dirp); if (backup_rval < 0) { - slapi_log_error(SLAPI_LOG_ERR, "ldbm_back_upgradedb", + slapi_log_err(SLAPI_LOG_ERR, "ldbm_back_upgradedb", "Failed to backup index files (instance %s).\n", inst_dirp); goto fail1; } @@ -2931,7 +2922,7 @@ int ldbm_back_upgradedb(Slapi_PBlock *pb) if (rval) { upgrade_rval += rval; - slapi_log_error(SLAPI_LOG_WARNING, "ldbm_back_upgradedb", + slapi_log_err(SLAPI_LOG_WARNING, "ldbm_back_upgradedb", "Can't clean up indices in %s\n", inst->inst_dir_name); continue; /* Need to make all backups; continue */ } @@ -2942,7 +2933,7 @@ int ldbm_back_upgradedb(Slapi_PBlock *pb) if (rval) { upgrade_rval += rval; - slapi_log_error(SLAPI_LOG_WARNING, "ldbm_back_upgradedb", + slapi_log_err(SLAPI_LOG_WARNING, "ldbm_back_upgradedb", "Can't clean up indices in %s\n", inst->inst_dir_name); continue; /* Need to make all backups; continue */ } @@ -2952,7 +2943,7 @@ int ldbm_back_upgradedb(Slapi_PBlock *pb) if (rval) { upgrade_rval += rval; - slapi_log_error(SLAPI_LOG_ERR, "ldbm_back_upgradedb", + slapi_log_err(SLAPI_LOG_ERR, "ldbm_back_upgradedb", "upgradedb: Failed to upgrade database %s\n", inst->inst_name); if (run_from_cmdline) @@ -3005,12 +2996,12 @@ int ldbm_back_upgradedb(Slapi_PBlock *pb) { if (0 != dblayer_flush(li)) { - slapi_log_error(SLAPI_LOG_ERR, "ldbm_back_upgradedb", + slapi_log_err(SLAPI_LOG_ERR, "ldbm_back_upgradedb", "Failed to flush database\n"); } if (0 != dblayer_close(li,DBLAYER_IMPORT_MODE)) { - slapi_log_error(SLAPI_LOG_ERR, "ldbm_back_upgradedb", + slapi_log_err(SLAPI_LOG_ERR, "ldbm_back_upgradedb", "Failed to close database\n"); goto fail1; } @@ -3030,14 +3021,14 @@ int ldbm_back_upgradedb(Slapi_PBlock *pb) fail1: if (0 != dblayer_flush(li)) - slapi_log_error(SLAPI_LOG_ERR, "ldbm_back_upgradedb", + slapi_log_err(SLAPI_LOG_ERR, "ldbm_back_upgradedb", "Failed to flush database\n"); /* we started dblayer with DBLAYER_IMPORT_MODE * We just want not to generate a guardian file... */ if (0 != dblayer_close(li,DBLAYER_ARCHIVE_MODE)) - slapi_log_error(SLAPI_LOG_ERR, "ldbm_back_upgradedb", + slapi_log_err(SLAPI_LOG_ERR, "ldbm_back_upgradedb", "Failed to close database\n"); /* restore from the backup, if possible */ @@ -3092,12 +3083,12 @@ int upgradedb_copy_logfiles(struct ldbminfo *li, char *destination_dir, dest = destination_dir; } if (NULL == src || '\0' == *src) { - LDAPDebug0Args(LDAP_DEBUG_ERR, "upgradedb_copy_logfiles - " + slapi_log_err(SLAPI_LOG_ERR, "upgradedb_copy_logfiles", "NULL src directory\n"); return -1; } if (NULL == dest || '\0' == *dest) { - LDAPDebug0Args(LDAP_DEBUG_ERR, "upgradedb_copy_logfiles - " + slapi_log_err(SLAPI_LOG_ERR, "upgradedb_copy_logfiles", "NULL dest directory\n"); return -1; } @@ -3173,12 +3164,12 @@ int upgradedb_delete_indices_4cmd(ldbm_instance *inst, int flags) char *inst_dirp = dblayer_get_full_inst_dir(inst->inst_li, inst, inst_dir, MAXPATHLEN); - slapi_log_error(SLAPI_LOG_TRACE, "upgradedb_delete_indices_4cmd", + slapi_log_err(SLAPI_LOG_TRACE, "upgradedb_delete_indices_4cmd", "%s\n", inst_dir); dirhandle = PR_OpenDir(inst_dirp); if (!dirhandle) { - slapi_log_error(SLAPI_LOG_ERR, "upgradedb_delete_indices_4cmd", + slapi_log_err(SLAPI_LOG_ERR, "upgradedb_delete_indices_4cmd", "PR_OpenDir failed\n"); if (inst_dirp != inst_dir) slapi_ch_free_string(&inst_dirp); @@ -3207,7 +3198,7 @@ int upgradedb_delete_indices_4cmd(ldbm_instance *inst, int flags) if (PR_SUCCESS == rval && PR_FILE_DIRECTORY != info.type) { PR_Delete(fullpathp); - slapi_log_error(SLAPI_LOG_TRACE, "upgradedb_delete_indices_4cmd", + slapi_log_err(SLAPI_LOG_TRACE, "upgradedb_delete_indices_4cmd", "%s deleted\n", fullpath); } if (fullpathp != fullpath) @@ -3233,13 +3224,13 @@ upgradedb_core(Slapi_PBlock *pb, ldbm_instance *inst) run_from_cmdline = (task_flags & SLAPI_TASK_RUNNING_FROM_COMMANDLINE); be = inst->inst_be; - slapi_log_error(SLAPI_LOG_ERR, "upgradedb_core", + slapi_log_err(SLAPI_LOG_ERR, "upgradedb_core", "%s: Start upgradedb.\n", inst->inst_name); if (!run_from_cmdline) { /* shutdown this instance of the db */ - slapi_log_error(SLAPI_LOG_TRACE, "upgradedb_core", + slapi_log_err(SLAPI_LOG_TRACE, "upgradedb_core", "Bringing %s offline...\n", inst->inst_name); slapi_mtn_be_disable(inst->inst_be); @@ -3253,7 +3244,7 @@ upgradedb_core(Slapi_PBlock *pb, ldbm_instance *inst) /* dblayer_instance_start will init the id2entry index. */ if (0 != dblayer_instance_start(be, DBLAYER_IMPORT_MODE)) { - slapi_log_error(SLAPI_LOG_ERR, "upgradedb_core", + slapi_log_err(SLAPI_LOG_ERR, "upgradedb_core", "Failed to init instance %s\n", inst->inst_name); return -1; } @@ -3297,7 +3288,7 @@ _get_and_add_parent_rdns(backend *be, } if (NULL == be || NULL == srdn) { - slapi_log_error(SLAPI_LOG_ERR, "_get_and_add_parent_rdns", + slapi_log_err(SLAPI_LOG_ERR, "_get_and_add_parent_rdns", "Empty %s\n", NULL==be?"be":"srdn"); return rc; } @@ -3313,7 +3304,7 @@ _get_and_add_parent_rdns(backend *be, if (slapi_rdn_get_rdn(srdn)) { /* srdn is already in use */ rc = slapi_rdn_init_all_dn(&mysrdn, slapi_sdn_get_dn(bdn->dn_sdn)); if (rc) { - slapi_log_error(SLAPI_LOG_ERR, "_get_and_add_parent_rdns", + slapi_log_err(SLAPI_LOG_ERR, "_get_and_add_parent_rdns", "Failed to convert DN %s to RDN\n", slapi_rdn_get_rdn(&mysrdn)); slapi_rdn_done(&mysrdn); @@ -3322,7 +3313,7 @@ _get_and_add_parent_rdns(backend *be, } rc = slapi_rdn_add_srdn_to_all_rdns(srdn, &mysrdn); if (rc) { - slapi_log_error(SLAPI_LOG_ERR, "_get_and_add_parent_rdns", + slapi_log_err(SLAPI_LOG_ERR, "_get_and_add_parent_rdns", "Failed to merge Slapi_RDN %s to RDN\n", slapi_sdn_get_dn(bdn->dn_sdn)); } @@ -3330,7 +3321,7 @@ _get_and_add_parent_rdns(backend *be, } else { /* srdn is empty */ rc = slapi_rdn_init_all_dn(srdn, slapi_sdn_get_dn(bdn->dn_sdn)); if (rc) { - slapi_log_error(SLAPI_LOG_ERR, "_get_and_add_parent_rdns", + slapi_log_err(SLAPI_LOG_ERR, "_get_and_add_parent_rdns", "Failed to convert DN %s to RDN\n", slapi_sdn_get_dn(bdn->dn_sdn)); CACHE_RETURN(&inst->inst_dncache, &bdn); @@ -3344,7 +3335,7 @@ _get_and_add_parent_rdns(backend *be, /* not in the dn cache or DB2LDIF or caller is expecting the parent ID; * read id2entry */ if (NULL == db) { - slapi_log_error(SLAPI_LOG_ERR, "_get_and_add_parent_rdns", + slapi_log_err(SLAPI_LOG_ERR, "_get_and_add_parent_rdns", "Empty db\n"); goto bail; } @@ -3357,21 +3348,21 @@ _get_and_add_parent_rdns(backend *be, data.flags = DB_DBT_MALLOC; rc = db->get(db, NULL, &key, &data, 0); if (rc) { - slapi_log_error(SLAPI_LOG_ERR, "_get_and_add_parent_rdns", + slapi_log_err(SLAPI_LOG_ERR, "_get_and_add_parent_rdns", "Failed to position cursor at ID " ID_FMT "\n", id); goto bail; } /* rdn is allocated in get_value_from_string */ rc = get_value_from_string((const char *)data.dptr, "rdn", &rdn); if (rc) { - slapi_log_error(SLAPI_LOG_ERR, "_get_and_add_parent_rdns", + slapi_log_err(SLAPI_LOG_ERR, "_get_and_add_parent_rdns", "Failed to get rdn of entry " ID_FMT "\n", id); goto bail; } /* rdn is going to be set to srdn */ rc = slapi_rdn_init_all_dn(&mysrdn, rdn); if (rc < 0) { /* expect rc == 1 since we are setting "rdn" not "dn" */ - slapi_log_error(SLAPI_LOG_ERR, "_get_and_add_parent_rdns", + slapi_log_err(SLAPI_LOG_ERR, "_get_and_add_parent_rdns", "Failed to add rdn %s of entry " ID_FMT "\n", rdn, id); goto bail; } @@ -3399,7 +3390,7 @@ _get_and_add_parent_rdns(backend *be, } rc = slapi_rdn_add_srdn_to_all_rdns(srdn, &mysrdn); if (rc) { - slapi_log_error(SLAPI_LOG_ERR, "_get_and_add_parent_rdns", + slapi_log_err(SLAPI_LOG_ERR, "_get_and_add_parent_rdns", "Failed to merge Slapi_RDN %s to RDN\n", slapi_rdn_get_rdn(&mysrdn)); goto bail; @@ -3411,7 +3402,7 @@ _get_and_add_parent_rdns(backend *be, ep = backentry_alloc(); rc = slapi_rdn_get_dn(srdn, &dn); if (rc) { - slapi_log_error(SLAPI_LOG_ERR, "_get_and_add_parent_rdns", + slapi_log_err(SLAPI_LOG_ERR, "_get_and_add_parent_rdns", "Failed to compose dn for " "(rdn: %s, ID: %d) from Slapi_RDN\n", rdn, id); goto bail; @@ -3426,11 +3417,11 @@ _get_and_add_parent_rdns(backend *be, if (txn && !run_from_cmdline) { rc = dblayer_txn_begin(be, NULL, txn); if (rc) { - slapi_log_error(SLAPI_LOG_ERR, "_get_and_add_parent_rdns", + slapi_log_err(SLAPI_LOG_ERR, "_get_and_add_parent_rdns", "%s: Failed to begin txn for update " "index 'entryrdn'\n", inst->inst_name); - slapi_log_error(SLAPI_LOG_ERR, "_get_and_add_parent_rdns", + slapi_log_err(SLAPI_LOG_ERR, "_get_and_add_parent_rdns", "%s: Error %d: %s\n", inst->inst_name, rc, dblayer_strerror(rc)); goto bail; @@ -3438,10 +3429,10 @@ _get_and_add_parent_rdns(backend *be, } rc = entryrdn_index_entry(be, ep, BE_INDEX_ADD, txn); if (rc) { - slapi_log_error(SLAPI_LOG_ERR, "_get_and_add_parent_rdns", + slapi_log_err(SLAPI_LOG_ERR, "_get_and_add_parent_rdns", "%s: Failed to update index 'entryrdn'\n", inst->inst_name); - slapi_log_error(SLAPI_LOG_ERR, "_get_and_add_parent_rdns", + slapi_log_err(SLAPI_LOG_ERR, "_get_and_add_parent_rdns", "%s: Error %d: %s\n", inst->inst_name, rc, dblayer_strerror(rc)); if (txn && !run_from_cmdline) { @@ -3452,11 +3443,11 @@ _get_and_add_parent_rdns(backend *be, if (txn && !run_from_cmdline) { rc = dblayer_txn_commit(be, txn); if (rc) { - slapi_log_error(SLAPI_LOG_ERR, "_get_and_add_parent_rdns", + slapi_log_err(SLAPI_LOG_ERR, "_get_and_add_parent_rdns", "%s: Failed to commit txn for " "update index 'entryrdn'\n", inst->inst_name); - slapi_log_error(SLAPI_LOG_ERR, "_get_and_add_parent_rdns", + slapi_log_err(SLAPI_LOG_ERR, "_get_and_add_parent_rdns", "%s: Error %d: %s\n", inst->inst_name, rc, dblayer_strerror(rc)); goto bail; @@ -3464,7 +3455,7 @@ _get_and_add_parent_rdns(backend *be, } } else if (index_ext & DB2LDIF_ENTRYRDN) { if (NULL == eargs) { - slapi_log_error(SLAPI_LOG_ERR, "_get_and_add_parent_rdns", + slapi_log_err(SLAPI_LOG_ERR, "_get_and_add_parent_rdns", "Empty export args\n"); rc = -1; goto bail; @@ -3472,14 +3463,14 @@ _get_and_add_parent_rdns(backend *be, eargs->ep = ep; rc = export_one_entry(li, inst, eargs); if (rc) { - slapi_log_error(SLAPI_LOG_ERR, "_get_and_add_parent_rdns", + slapi_log_err(SLAPI_LOG_ERR, "_get_and_add_parent_rdns", "Failed to export an entry %s\n", slapi_sdn_get_dn(slapi_entry_get_sdn(ep->ep_entry))); goto bail; } rc = idl_append_extend(&(eargs->pre_exported_idl), id); if (rc) { - slapi_log_error(SLAPI_LOG_ERR, "_get_and_add_parent_rdns", + slapi_log_err(SLAPI_LOG_ERR, "_get_and_add_parent_rdns", "Failed add %d to exported idl\n", id); } } @@ -3525,17 +3516,17 @@ _export_or_index_parents(ldbm_instance *inst, rc = _get_and_add_parent_rdns(be, db, txn, pid, psrdn, &ppid, 0, run_from_cmdline, NULL); if (rc) { - LDAPDebug1Arg(LDAP_DEBUG_ERR, "_export_or_index_parents - " + slapi_log_err(SLAPI_LOG_ERR, "_export_or_index_parents", "Failed to get the DN of ID %d\n", pid); goto bail; } prdn = slapi_ch_strdup(slapi_rdn_get_rdn(psrdn)); } else { /* we have entryrdn */ if (pid != temp_pid) { - LDAPDebug2Args(LDAP_DEBUG_WARNING, "_export_or_index_parents - " + slapi_log_err(SLAPI_LOG_WARNING, "_export_or_index_parents", "parentid conflict found between entryrdn (%d) and " "id2entry (%d)\n", temp_pid, pid); - LDAPDebug0Args(LDAP_DEBUG_WARNING, "_export_or_index_parents - " + slapi_log_err(SLAPI_LOG_WARNING, "_export_or_index_parents", "Ignoring entryrdn\n"); } else { struct backdn *bdn = NULL; @@ -3555,13 +3546,13 @@ _export_or_index_parents(ldbm_instance *inst, myrc = CACHE_ADD(&inst->inst_dncache, bdn, NULL); if (myrc) { backdn_free(&bdn); - slapi_log_error(SLAPI_LOG_CACHE, + slapi_log_err(SLAPI_LOG_CACHE, "_export_or_index_parents", "%s is already in the dn cache (%d)\n", pdn, myrc); } else { CACHE_RETURN(&inst->inst_dncache, &bdn); - slapi_log_error(SLAPI_LOG_CACHE, + slapi_log_err(SLAPI_LOG_CACHE, "_export_or_index_parents", "entryrdn_lookup_dn returned: %s, " "and set to dn cache\n", pdn); @@ -3576,7 +3567,7 @@ _export_or_index_parents(ldbm_instance *inst, rc = entryrdn_get_parent(be, prdn, pid, &pprdn, &ppid, NULL); slapi_ch_free_string(&pprdn); if (rc) { /* entryrdn is not available */ - LDAPDebug1Arg(LDAP_DEBUG_ERR, "_export_or_index_parents - " + slapi_log_err(SLAPI_LOG_ERR, "_export_or_index_parents", "Failed to get the parent of ID %d\n", pid); goto bail; } @@ -3595,8 +3586,8 @@ _export_or_index_parents(ldbm_instance *inst, rc = _get_and_add_parent_rdns(be, db, txn, pid, psrdn, NULL, type, run_from_cmdline, eargs); if (rc) { - LDAPDebug1Arg(LDAP_DEBUG_ERR, - "_export_or_index_parents - Failed to get rdn for ID: %d\n", pid); + slapi_log_err(SLAPI_LOG_ERR, + "_export_or_index_parents", "Failed to get rdn for ID: %d\n", pid); slapi_rdn_done(psrdn); } bail: @@ -3667,7 +3658,7 @@ int ldbm_back_upgradednformat(Slapi_PBlock *pb) return -1; } } else { - slapi_log_error(SLAPI_LOG_ERR, "ldbm_back_upgradednformat", + slapi_log_err(SLAPI_LOG_ERR, "ldbm_back_upgradednformat", " Online mode is not supported. " "Shutdown the server and run the tool\n"); goto bail; @@ -3676,11 +3667,11 @@ int ldbm_back_upgradednformat(Slapi_PBlock *pb) /* Find the instance that the ldif2db will be done on. */ inst = ldbm_instance_find_by_name(li, instance_name); if (NULL == inst) { - slapi_log_error(SLAPI_LOG_ERR, "ldbm_back_upgradednformat", + slapi_log_err(SLAPI_LOG_ERR, "ldbm_back_upgradednformat", "Unknown ldbm instance %s\n", instance_name); goto bail; } - slapi_log_error(SLAPI_LOG_INFO, "ldbm_back_upgradednformat", + slapi_log_err(SLAPI_LOG_INFO, "ldbm_back_upgradednformat", "%s: Start upgrade dn format.\n", inst->inst_name); slapi_pblock_set(pb, SLAPI_BACKEND, inst->inst_be); @@ -3689,7 +3680,7 @@ int ldbm_back_upgradednformat(Slapi_PBlock *pb) prst = PR_GetFileInfo64(rawworkdbdir, &prfinfo); if (PR_FAILURE == prst || PR_FILE_DIRECTORY != prfinfo.type) { - slapi_log_error(SLAPI_LOG_ERR, "ldbm_back_upgradednformat", + slapi_log_err(SLAPI_LOG_ERR, "ldbm_back_upgradednformat", "Working DB instance dir %s is not a directory\n", rawworkdbdir); goto bail; @@ -3697,7 +3688,7 @@ int ldbm_back_upgradednformat(Slapi_PBlock *pb) dirhandle = PR_OpenDir(rawworkdbdir); if (!dirhandle) { - slapi_log_error(SLAPI_LOG_ERR, "ldbm_back_upgradednformat", + slapi_log_err(SLAPI_LOG_ERR, "ldbm_back_upgradednformat", "Failed to open working DB instance dir %s\n", rawworkdbdir); goto bail; @@ -3714,7 +3705,7 @@ int ldbm_back_upgradednformat(Slapi_PBlock *pb) PR_CloseDir(dirhandle); if (!found) { - slapi_log_error(SLAPI_LOG_ERR, "ldbm_back_upgradednformat", + slapi_log_err(SLAPI_LOG_ERR, "ldbm_back_upgradednformat", "Working DB instance dir %s does not include %s file\n", rawworkdbdir, ID2ENTRY); goto bail; @@ -3747,7 +3738,7 @@ int ldbm_back_upgradednformat(Slapi_PBlock *pb) rc = 3; /* 0: need upgrade (dn norm sp, only) */ } else { /* DN format already takes care of the multiple spaces */ - slapi_log_error(SLAPI_LOG_INFO, "ldbm_back_upgradednformat", + slapi_log_err(SLAPI_LOG_INFO, "ldbm_back_upgradednformat", "Instance %s in %s is up-to-date\n", instance_name, workdbdir); rc = 0; /* 0: up-to-date */ @@ -3760,7 +3751,7 @@ int ldbm_back_upgradednformat(Slapi_PBlock *pb) rc = 1; /* 0: need upgrade (both) */ } } else { - slapi_log_error(SLAPI_LOG_ERR, "ldbm_back_upgradednformat", + slapi_log_err(SLAPI_LOG_ERR, "ldbm_back_upgradednformat", "Failed to get DBVERSION (Instance name: %s, dir %s)\n", instance_name, workdbdir); rc = -1; /* error */ @@ -3769,7 +3760,7 @@ int ldbm_back_upgradednformat(Slapi_PBlock *pb) sep = PL_strrchr(workdbdir, '/'); if (!sep) { - slapi_log_error(SLAPI_LOG_ERR, "ldbm_back_upgradednformat", + slapi_log_err(SLAPI_LOG_ERR, "ldbm_back_upgradednformat", "Working DB instance dir %s does not include %s file\n", workdbdir, ID2ENTRY); goto bail; @@ -3781,7 +3772,7 @@ int ldbm_back_upgradednformat(Slapi_PBlock *pb) if (run_from_cmdline) { if (0 != dblayer_start(li, DBLAYER_IMPORT_MODE)) { - slapi_log_error(SLAPI_LOG_ERR, "ldbm_back_upgradednformat", + slapi_log_err(SLAPI_LOG_ERR, "ldbm_back_upgradednformat", "Failed to init database\n"); goto bail; } @@ -3791,7 +3782,7 @@ int ldbm_back_upgradednformat(Slapi_PBlock *pb) be = inst->inst_be; if (0 != dblayer_instance_start(be, DBLAYER_IMPORT_MODE)) { - slapi_log_error(SLAPI_LOG_ERR, "ldbm_back_upgradednformat", + slapi_log_err(SLAPI_LOG_ERR, "ldbm_back_upgradednformat", "Failed to init instance %s\n", inst->inst_name); goto bail; } @@ -3805,11 +3796,11 @@ int ldbm_back_upgradednformat(Slapi_PBlock *pb) /* close the database */ if (run_from_cmdline) { if (0 != dblayer_flush(li)) { - slapi_log_error(SLAPI_LOG_ERR, "ldbm_back_upgradednformat", + slapi_log_err(SLAPI_LOG_ERR, "ldbm_back_upgradednformat", "Failed to flush database\n"); } if (0 != dblayer_close(li,DBLAYER_IMPORT_MODE)) { - slapi_log_error(SLAPI_LOG_ERR, "ldbm_back_upgradednformat", + slapi_log_err(SLAPI_LOG_ERR, "ldbm_back_upgradednformat", "Failed to close database\n"); goto bail; } diff --git a/ldap/servers/slapd/back-ldbm/misc.c b/ldap/servers/slapd/back-ldbm/misc.c index 29643f0..183ef75 100644 --- a/ldap/servers/slapd/back-ldbm/misc.c +++ b/ldap/servers/slapd/back-ldbm/misc.c @@ -18,21 +18,21 @@ /* Takes a return code supposed to be errno or from lidb which we don't expect to see and prints a handy log message */ -void ldbm_nasty(const char* str, int c, int err) +void ldbm_nasty(char *func, const char* str, int c, int err) { char *msg = NULL; char buffer[200]; if (err == DB_LOCK_DEADLOCK) { PR_snprintf(buffer,200,"%s WARNING %d",str,c); - LDAPDebug(LDAP_DEBUG_BACKLDBM,"%s, err=%d %s\n", + slapi_log_err(SLAPI_LOG_BACKLDBM, func, "%s, err=%d %s\n", buffer,err,(msg = dblayer_strerror( err )) ? msg : ""); } else if (err == DB_RUNRECOVERY) { - LDAPDebug2Args(LDAP_DEBUG_ERR, "%s (%d); " + slapi_log_err(SLAPI_LOG_ERR, func, "%s (%d); " "server stopping as database recovery needed.\n", str, c); exit(1); } else { PR_snprintf(buffer,200,"%s BAD %d",str,c); - LDAPDebug(LDAP_DEBUG_ERR, "%s, err=%d %s\n", + slapi_log_err(SLAPI_LOG_ERR, func, "%s, err=%d %s\n", buffer, err, (msg = dblayer_strerror( err )) ? msg : ""); } } @@ -224,7 +224,7 @@ allinstance_set_busy(struct ldbminfo *li) inst_obj = objset_next_obj(li->li_instance_set, inst_obj)) { inst = (ldbm_instance *)object_get_data(inst_obj); if (instance_set_busy(inst)) { - LDAPDebug1Arg(LDAP_DEBUG_TRACE, "could not set instance [%s] as busy, probably already busy\n", + slapi_log_err(SLAPI_LOG_TRACE, "could not set instance [%s] as busy, probably already busy\n", inst->inst_name); } } @@ -328,7 +328,7 @@ mkdir_p(char *dir, unsigned int mode) PR_Delete(dir); if (PR_SUCCESS != PR_MkDir(dir, mode)) { - LDAPDebug(LDAP_DEBUG_ERR, "mkdir_p - %s: error %d (%s)\n", + slapi_log_err(SLAPI_LOG_ERR, "mkdir_p - %s: error %d (%s)\n", dir, PR_GetError(),slapd_pr_strerror(PR_GetError())); return -1; } @@ -364,7 +364,7 @@ mkdir_p(char *dir, unsigned int mode) return rval; if (PR_SUCCESS != PR_MkDir(dir, mode)) { - LDAPDebug(LDAP_DEBUG_ERR, "mkdir_p - %s: error %d (%s)\n", + slapi_log_err(SLAPI_LOG_ERR, "mkdir_p - %s: error %d (%s)\n", dir, PR_GetError(),slapd_pr_strerror(PR_GetError())); return -1; } @@ -416,8 +416,7 @@ ldbm_txn_ruv_modify_context( Slapi_PBlock *pb, modify_context *mc ) if (NULL == bentry) { /* Uh oh, we couldn't find and lock the RUV entry! */ - LDAPDebug(LDAP_DEBUG_ERR, "ldbm_txn_ruv_modify_context - Failed to retrieve and lock RUV entry\n", - 0, 0, 0 ); + slapi_log_err(SLAPI_LOG_ERR, "ldbm_txn_ruv_modify_context", "Failed to retrieve and lock RUV entry\n"); rc = -1; goto done; } @@ -425,8 +424,7 @@ ldbm_txn_ruv_modify_context( Slapi_PBlock *pb, modify_context *mc ) modify_init( mc, bentry ); if (modify_apply_mods_ignore_error( mc, smods, LDAP_TYPE_OR_VALUE_EXISTS )) { - LDAPDebug(LDAP_DEBUG_ERR, "ldbm_txn_ruv_modify_context - Failed to apply updates to RUV entry\n", - 0, 0, 0 ); + slapi_log_err(SLAPI_LOG_ERR, "ldbm_txn_ruv_modify_context", "Failed to apply updates to RUV entry\n"); rc = -1; modify_term( mc, be ); } @@ -538,7 +536,7 @@ get_value_from_string(const char *string, char *type, char **value) rc = slapi_ldif_parse_line(copy, &tmptype, &bvvalue, &freeval); if (0 > rc || NULL == tmptype.bv_val || NULL == bvvalue.bv_val || 0 >= bvvalue.bv_len) { - slapi_log_error(SLAPI_LOG_ERR, "get_value_from_string", "parse " + slapi_log_err(SLAPI_LOG_ERR, "get_value_from_string", "parse " "failed: %d\n", rc); if (freeval) { slapi_ch_free_string(&bvvalue.bv_val); @@ -547,7 +545,7 @@ get_value_from_string(const char *string, char *type, char **value) goto bail; } if (0 != PL_strncasecmp(type, tmptype.bv_val, tmptype.bv_len)) { - slapi_log_error(SLAPI_LOG_ERR, "get_value_from_string", "type " + slapi_log_err(SLAPI_LOG_ERR, "get_value_from_string", "type " "does not match: %s != %s\n", type, tmptype.bv_val); if (freeval) { @@ -626,7 +624,7 @@ get_values_from_string(const char *string, char *type, char ***valuearray) char *p = PL_strchr(tmptype.bv_val, ';'); /* subtype ? */ if (p) { if (0 != strncasecmp(type, tmptype.bv_val, p - tmptype.bv_val)) { - slapi_log_error(SLAPI_LOG_ERR, "get_values_from_string", + slapi_log_err(SLAPI_LOG_ERR, "get_values_from_string", "type does not match: %s != %s\n", type, tmptype.bv_val); if (freeval) { @@ -635,7 +633,7 @@ get_values_from_string(const char *string, char *type, char ***valuearray) goto bail; } } else { - slapi_log_error(SLAPI_LOG_ERR, "get_values_from_string", + slapi_log_err(SLAPI_LOG_ERR, "get_values_from_string", "type does not match: %s != %s\n", type, tmptype.bv_val); if (freeval) { diff --git a/ldap/servers/slapd/back-ldbm/nextid.c b/ldap/servers/slapd/back-ldbm/nextid.c index ca4ba8e..e05c663 100644 --- a/ldap/servers/slapd/back-ldbm/nextid.c +++ b/ldap/servers/slapd/back-ldbm/nextid.c @@ -21,34 +21,32 @@ next_id(backend *be) ldbm_instance *inst = (ldbm_instance *) be->be_instance_info; ID id; - /*Lock*/ PR_Lock( inst->inst_nextid_mutex ); - /*Test if nextid hasn't been initialized. */ + /* Test if nextid hasn't been initialized. */ if (inst->inst_nextid < 1) { - LDAPDebug(LDAP_DEBUG_CRIT, - "next_id - nextid not initialized... exiting.\n", 0,0,0); + slapi_log_err(SLAPI_LOG_CRIT, + "next_id", "nextid not initialized... exiting.\n"); exit(1); } - /*Increment the in-memory nextid*/ + /* Increment the in-memory nextid */ inst->inst_nextid++; id = inst->inst_nextid - 1; - /*unlock*/ PR_Unlock( inst->inst_nextid_mutex ); /* if ID is above the threshold, the database may need rebuilding soon */ if (id >= ID_WARNING_THRESHOLD) { if ( id >= MAXID ) { - LDAPDebug(LDAP_DEBUG_ALERT, - "next_id - FATAL ERROR: backend '%s' has no" - "IDs left. DATABASE MUST BE REBUILT.\n", be->be_name, 0, 0); + slapi_log_err(SLAPI_LOG_ALERT, + "next_id", "FATAL ERROR: backend '%s' has no" + "IDs left. DATABASE MUST BE REBUILT.\n", be->be_name); id = MAXID; } else { - LDAPDebug(LDAP_DEBUG_WARNING, - "next_id - Backend '%s' may run out " - "of IDs. Please, rebuild database.\n", be->be_name, 0, 0); + slapi_log_err(SLAPI_LOG_WARNING, + "next_id", "Backend '%s' may run out " + "of IDs. Please, rebuild database.\n", be->be_name); } } return( id ); @@ -64,8 +62,8 @@ next_id_return( backend *be, ID id ) /*Test if nextid hasn't been initialized. */ if (inst->inst_nextid < 1) { - LDAPDebug(LDAP_DEBUG_CRIT, - "next_id_return - nextid not initialized... exiting\n", 0,0,0); + slapi_log_err(SLAPI_LOG_CRIT, + "next_id_return", "nextid not initialized... exiting\n"); exit(1); } @@ -92,8 +90,8 @@ next_id_get( backend *be ) /*Test if nextid hasn't been initialized.*/ if (inst->inst_nextid < 1) { - LDAPDebug(LDAP_DEBUG_CRIT, - "next_id_get - nextid not initialized... exiting\n", 0,0,0); + slapi_log_err(SLAPI_LOG_CRIT, + "next_id_get", "nextid not initialized... exiting\n"); exit(1); } diff --git a/ldap/servers/slapd/back-ldbm/parents.c b/ldap/servers/slapd/back-ldbm/parents.c index eabfc1f..f667a9f 100644 --- a/ldap/servers/slapd/back-ldbm/parents.c +++ b/ldap/servers/slapd/back-ldbm/parents.c @@ -99,7 +99,7 @@ parent_update_on_childchange(modify_context *mc,int op, size_t *new_sub_count ) if (!already_present) { /* This means that there was a conflict. Before coming to this point, * the entry to be deleted was deleted... */ - LDAPDebug(LDAP_DEBUG_ERR, "parent_update_on_childchange - " + slapi_log_err(SLAPI_LOG_ERR, "parent_update_on_childchange - " "Parent %s has no children. (op 0x%x, repl_op 0x%x)\n", slapi_entry_get_dn(mc->old_entry->ep_entry), op, repl_op); slapi_mods_free(&smods); diff --git a/ldap/servers/slapd/back-ldbm/proto-back-ldbm.h b/ldap/servers/slapd/back-ldbm/proto-back-ldbm.h index 6a63e9b..b435b5a 100644 --- a/ldap/servers/slapd/back-ldbm/proto-back-ldbm.h +++ b/ldap/servers/slapd/back-ldbm/proto-back-ldbm.h @@ -364,7 +364,7 @@ void add_update_entrydn_operational_attributes(struct backentry *ep); /* * misc.c */ -void ldbm_nasty(const char* str, int c, int err); +void ldbm_nasty(char *func, const char* str, int c, int err); void ldbm_log_access_message(Slapi_PBlock *pblock,char *string); int return_on_disk_full(struct ldbminfo *li); int ldbm_attribute_always_indexed(const char *attrtype); diff --git a/ldap/servers/slapd/back-ldbm/rmdb.c b/ldap/servers/slapd/back-ldbm/rmdb.c index 05311d2..b9c8447 100644 --- a/ldap/servers/slapd/back-ldbm/rmdb.c +++ b/ldap/servers/slapd/back-ldbm/rmdb.c @@ -32,9 +32,9 @@ ldbm_back_rmdb( Slapi_PBlock *pb ) if (be->be_state != BE_STATE_STOPPED) { - LDAPDebug(LDAP_DEBUG_TRACE, - "ldbm_back_cleanup: warning - backend is in a wrong state - %d\n", - be->be_state, 0, 0 ); + slapi_log_err(SLAPI_LOG_TRACE, + "ldbm_back_rmdb", "Warning - backend is in a wrong state - %d\n", + be->be_state); return 0; } @@ -42,9 +42,9 @@ ldbm_back_rmdb( Slapi_PBlock *pb ) if (be->be_state != BE_STATE_STOPPED) { - LDAPDebug(LDAP_DEBUG_TRACE, - "ldbm_back_cleanup: warning - backend is in a wrong state - %d\n", - be->be_state, 0, 0 ); + slapi_log_err(SLAPI_LOG_TRACE, + "ldbm_back_rmdb", "Warning - backend is in a wrong state 2 - %d\n", + be->be_state); PR_Unlock (be->be_state_lock); return 0; } diff --git a/ldap/servers/slapd/back-ldbm/seq.c b/ldap/servers/slapd/back-ldbm/seq.c index 48ce1d2..afdc906 100644 --- a/ldap/servers/slapd/back-ldbm/seq.c +++ b/ldap/servers/slapd/back-ldbm/seq.c @@ -87,22 +87,22 @@ ldbm_back_seq( Slapi_PBlock *pb ) /* get a database */ ainfo_get( be, attrname, &ai ); - LDAPDebug(LDAP_DEBUG_ARGS, - " ldbm_back_seq - indextype: %s indexmask: 0x%x seek type: %d\n", + slapi_log_err(SLAPI_LOG_ARGS, + "ldbm_back_seq", "indextype: %s indexmask: 0x%x seek type: %d\n", ai->ai_type, ai->ai_indexmask, type ); if ( ! (INDEX_EQUALITY & ai->ai_indexmask) ) { - LDAPDebug(LDAP_DEBUG_TRACE, - "ldbm_back_seq - caller specified un-indexed attribute %s\n", - attrname ? attrname : "", 0, 0 ); + slapi_log_err(SLAPI_LOG_TRACE, + "ldbm_back_seq", "caller specified un-indexed attribute %s\n", + attrname ? attrname : ""); slapi_send_ldap_result( pb, LDAP_UNWILLING_TO_PERFORM, NULL, "Unindexed seq access type", 0, NULL ); return -1; } if ( (return_value = dblayer_get_index_file( be, ai, &db, DBOPEN_CREATE )) != 0 ) { - LDAPDebug(LDAP_DEBUG_ERR, - "ldbm_back_seq - Could not open index file for attribute %s\n", - attrname, 0, 0 ); + slapi_log_err(SLAPI_LOG_ERR, + "ldbm_back_seq", "Could not open index file for attribute %s\n", + attrname); slapi_send_ldap_result( pb, LDAP_OPERATIONS_ERROR, NULL, NULL, 0, NULL ); return -1; } @@ -216,7 +216,7 @@ retry: idl_free(&idl); idl = idl_fetch( be, db, &key, parent_txn, ai, &err ); if(err == DB_LOCK_DEADLOCK) { - ldbm_nasty("ldbm_back_seq deadlock retry", 1600, err); + ldbm_nasty("ldbm_back_seq", "deadlock retry", 1600, err); if (txn.back_txn_txn) { /* just in case */ slapi_ch_free(&(data.data)); @@ -238,7 +238,7 @@ retry: dblayer_read_txn_abort(be, &txn); } if (DB_LOCK_DEADLOCK == return_value) { - ldbm_nasty("ldbm_back_seq - deadlock retry", 1601, err); + ldbm_nasty("ldbm_back_seq", "deadlock retry", 1601, err); /* just in case */ slapi_ch_free(&(data.data)); if ((key.data != little_buffer) && (key.data != &keystring)) { @@ -248,9 +248,9 @@ retry: } } if(retry_count == IDL_FETCH_RETRY_COUNT) { - ldbm_nasty("ldbm_back_seq - retry count exceeded",1645,err); + ldbm_nasty("ldbm_back_seq", "Retry count exceeded",1645,err); } else if ( err != 0 && err != DB_NOTFOUND ) { - ldbm_nasty("ldbm_back_seq - database error", 1650, err); + ldbm_nasty("ldbm_back_seq", "Database error", 1650, err); } slapi_ch_free( &(data.data) ); if ( key.data != little_buffer && key.data != &keystring ) { @@ -275,11 +275,11 @@ retry: { if ( err != LDAP_SUCCESS ) { - LDAPDebug(LDAP_DEBUG_ERR, "ldbm_back_seq - id2entry err %d\n", err, 0, 0 ); + slapi_log_err(SLAPI_LOG_ERR, "ldbm_back_seq", "id2entry err %d\n", err); } - LDAPDebug(LDAP_DEBUG_ARGS, - "ldbm_back_seq - candidate %lu not found\n", - (u_long)id, 0, 0 ); + slapi_log_err(SLAPI_LOG_ARGS, + "ldbm_back_seq", "candidate %lu not found\n", + (u_long)id); continue; } if ( slapi_send_ldap_search_entry( pb, e->ep_entry, NULL, NULL, 0 ) == 0 ) diff --git a/ldap/servers/slapd/back-ldbm/sort.c b/ldap/servers/slapd/back-ldbm/sort.c index 9cdc51a..0650472 100644 --- a/ldap/servers/slapd/back-ldbm/sort.c +++ b/ldap/servers/slapd/back-ldbm/sort.c @@ -150,7 +150,7 @@ int sort_candidates(backend *be,int lookthrough_limit,time_t time_up, Slapi_PBlo } /* we refuse to sort a candidate list which is vast */ if (ALLIDS(candidates)) { - LDAPDebug(LDAP_DEBUG_TRACE, "Asked to sort ALLIDS candidate list, refusing\n",0, 0, 0 ); + slapi_log_err(SLAPI_LOG_TRACE, "sort_candidates", "Asked to sort ALLIDS candidate list, refusing\n"); return LDAP_UNWILLING_TO_PERFORM; } @@ -160,7 +160,8 @@ int sort_candidates(backend *be,int lookthrough_limit,time_t time_up, Slapi_PBlo int return_value = 0; return_value = attr_get_value_cmp_fn( &this_s->sattr, &(this_s->compare_fn) ); if (return_value != 0 ) { - LDAPDebug(LDAP_DEBUG_TRACE, "Attempting to sort a non-ordered attribute (%s)\n",this_s->type, 0, 0 ); + slapi_log_err(SLAPI_LOG_TRACE, "sort_candidates", + "Attempting to sort a non-ordered attribute (%s)\n",this_s->type); /* DBDB we should set the error type here */ return_value = LDAP_UNWILLING_TO_PERFORM; *sort_error_type = this_s->type; @@ -189,7 +190,7 @@ int sort_candidates(backend *be,int lookthrough_limit,time_t time_up, Slapi_PBlo bc.check_counter = 1; return_value = slapd_qsort(&bc,candidates,s); - LDAPDebug(LDAP_DEBUG_TRACE, "<= Sorting done\n",0, 0, 0 ); + slapi_log_err(SLAPI_LOG_TRACE, "Sorting done", "<=\n"); return return_value; } @@ -463,7 +464,7 @@ static int compare_entries_sv(ID *id_a, ID *id_b, sort_spec *s,baggage_carrier * a = id2entry(be,*id_a,&txn,&err); if (NULL == a) { if (0 != err ) { - LDAPDebug(LDAP_DEBUG_TRACE,"compare_entries_sv db err %d\n",err,0,0); + slapi_log_err(SLAPI_LOG_TRACE,"compare_entries_sv", "db err %d\n",err); } /* Were up a creek without paddle here */ /* Best to log error and set some flag */ @@ -472,7 +473,7 @@ static int compare_entries_sv(ID *id_a, ID *id_b, sort_spec *s,baggage_carrier * b = id2entry(be,*id_b,&txn,&err); if (NULL == b) { if (0 != err ) { - LDAPDebug(LDAP_DEBUG_TRACE,"compare_entries_sv db err %d\n",err,0,0); + slapi_log_err(SLAPI_LOG_TRACE,"compare_entries_sv", "db err %d\n",err); } CACHE_RETURN(&inst->inst_cache,&a); return 0; diff --git a/ldap/servers/slapd/back-ldbm/start.c b/ldap/servers/slapd/back-ldbm/start.c index 898a95d..9765779 100644 --- a/ldap/servers/slapd/back-ldbm/start.c +++ b/ldap/servers/slapd/back-ldbm/start.c @@ -61,14 +61,13 @@ ldbm_back_start( Slapi_PBlock *pb ) PRUint64 memsize = pages * pagesize; #endif - LDAPDebug(LDAP_DEBUG_TRACE, "ldbm_back_start - ldbm backend starting\n", 0, 0, 0 ); + slapi_log_err(SLAPI_LOG_TRACE, "ldbm_back_start", "ldbm backend starting\n"); slapi_pblock_get( pb, SLAPI_PLUGIN_PRIVATE, &li ); /* parse the config file here */ if (0 != ldbm_config_load_dse_info(li)) { - LDAPDebug(LDAP_DEBUG_ERR, "ldbm_back_start - Loading database configuration failed\n", - 0, 0, 0 ); + slapi_log_err(SLAPI_LOG_ERR, "ldbm_back_start", "Loading database configuration failed\n"); return SLAPI_FAIL_GENERAL; } @@ -77,8 +76,7 @@ ldbm_back_start( Slapi_PBlock *pb ) if ( slapi_reslimit_register( SLAPI_RESLIMIT_TYPE_INT, LDBM_LOOKTHROUGHLIMIT_AT, &li->li_reslimit_lookthrough_handle ) != SLAPI_RESLIMIT_STATUS_SUCCESS ) { - LDAPDebug(LDAP_DEBUG_ERR, "ldbm_back_start - Resource limit registration failed for lookthroughlimit\n", - 0, 0, 0 ); + slapi_log_err(SLAPI_LOG_ERR, "ldbm_back_start", "Resource limit registration failed for lookthroughlimit\n"); return SLAPI_FAIL_GENERAL; } @@ -87,8 +85,7 @@ ldbm_back_start( Slapi_PBlock *pb ) if ( slapi_reslimit_register( SLAPI_RESLIMIT_TYPE_INT, LDBM_ALLIDSLIMIT_AT, &li->li_reslimit_allids_handle ) != SLAPI_RESLIMIT_STATUS_SUCCESS ) { - LDAPDebug(LDAP_DEBUG_ERR, "ldbm_back_start - Resource limit registration failed for allidslimit\n", - 0, 0, 0 ); + slapi_log_err(SLAPI_LOG_ERR, "ldbm_back_start", "Resource limit registration failed for allidslimit\n"); return SLAPI_FAIL_GENERAL; } @@ -97,8 +94,7 @@ ldbm_back_start( Slapi_PBlock *pb ) if ( slapi_reslimit_register( SLAPI_RESLIMIT_TYPE_INT, LDBM_PAGEDLOOKTHROUGHLIMIT_AT, &li->li_reslimit_pagedlookthrough_handle ) != SLAPI_RESLIMIT_STATUS_SUCCESS ) { - LDAPDebug(LDAP_DEBUG_ERR, "ldbm_back_start - Resource limit registration failed for pagedlookthroughlimit\n", - 0, 0, 0 ); + slapi_log_err(SLAPI_LOG_ERR, "ldbm_back_start", "Resource limit registration failed for pagedlookthroughlimit\n"); return SLAPI_FAIL_GENERAL; } @@ -107,8 +103,7 @@ ldbm_back_start( Slapi_PBlock *pb ) if ( slapi_reslimit_register( SLAPI_RESLIMIT_TYPE_INT, LDBM_PAGEDALLIDSLIMIT_AT, &li->li_reslimit_pagedallids_handle ) != SLAPI_RESLIMIT_STATUS_SUCCESS ) { - LDAPDebug(LDAP_DEBUG_ERR, "ldbm_back_start - Resource limit registration failed for pagedallidslimit\n", - 0, 0, 0 ); + slapi_log_err(SLAPI_LOG_ERR, "ldbm_back_start", "Resource limit registration failed for pagedallidslimit\n"); return SLAPI_FAIL_GENERAL; } @@ -116,8 +111,7 @@ ldbm_back_start( Slapi_PBlock *pb ) if ( slapi_reslimit_register( SLAPI_RESLIMIT_TYPE_INT, LDBM_RANGELOOKTHROUGHLIMIT_AT, &li->li_reslimit_rangelookthrough_handle ) != SLAPI_RESLIMIT_STATUS_SUCCESS ) { - LDAPDebug(LDAP_DEBUG_ERR, "ldbm_back_start - Resource limit registration failed for rangelookthroughlimit\n", - 0, 0, 0 ); + slapi_log_err(SLAPI_LOG_ERR, "ldbm_back_start", "Resource limit registration failed for rangelookthroughlimit\n"); return SLAPI_FAIL_GENERAL; } @@ -138,12 +132,11 @@ ldbm_back_start( Slapi_PBlock *pb ) (li->li_import_cache_autosize > 100) || ((li->li_cache_autosize > 0) && (li->li_import_cache_autosize > 0) && (li->li_cache_autosize + li->li_import_cache_autosize > 100))) { - LDAPDebug(LDAP_DEBUG_ERR, "ldbm_back_start - Cache autosizing: bad settings, " - "value or sum of values can not larger than 100.\n", 0, 0, 0 ); + slapi_log_err(SLAPI_LOG_ERR, "ldbm_back_start", "Cache autosizing: bad settings, " + "value or sum of values can not larger than 100.\n"); } else { if (util_info_sys_pages(&pagesize, &pages, &procpages, &availpages) != 0) { - LDAPDebug(LDAP_DEBUG_ERR, "ldbm_back_start - Unable to determine system page limits\n", - 0, 0, 0 ); + slapi_log_err(SLAPI_LOG_ERR, "ldbm_back_start", "Unable to determine system page limits\n"); return SLAPI_FAIL_GENERAL; } if (pagesize) { @@ -157,7 +150,7 @@ ldbm_back_start( Slapi_PBlock *pb ) cache_size = (PRUint64)cache_get_max_size(&(inst->inst_cache)); db_size = dblayer_get_id2entry_size(inst); if (cache_size < db_size) { - LDAPDebug(LDAP_DEBUG_NOTICE, + slapi_log_err(SLAPI_LOG_NOTICE, "ldbm_back_start - " "%s: entry cache size %llu B is " "less than db size %llu B; " @@ -165,21 +158,21 @@ ldbm_back_start( Slapi_PBlock *pb ) "nsslapd-cachememsize.\n", inst->inst_name, cache_size, db_size); } else { - LDAPDebug(LDAP_DEBUG_BACKLDBM, - "ldbm_back_start - %s: entry cache size: %llu B; db size: %llu B\n", + slapi_log_err(SLAPI_LOG_BACKLDBM, + "ldbm_back_start", "%s: entry cache size: %lu B; db size: %lu B\n", inst->inst_name, cache_size, db_size); } /* Get the dn_cachesize */ dncache_size = (PRUint64)cache_get_max_size(&(inst->inst_dncache)); total_cache_size += cache_size + dncache_size; - LDAPDebug(LDAP_DEBUG_BACKLDBM, - "ldbm_back_start - total cache size: %llu B; \n", - total_cache_size, 0 ,0 ); + slapi_log_err(SLAPI_LOG_BACKLDBM, + "ldbm_back_start", "total cache size: %lu B; \n", + total_cache_size); } - LDAPDebug(LDAP_DEBUG_BACKLDBM, - "ldbm_back_start - Total entry cache size: %llu B; " - "dbcache size: %llu B; " - "available memory size: %llu B;\n", + slapi_log_err(SLAPI_LOG_BACKLDBM, + "ldbm_back_start", "Total entry cache size: %lu B; " + "dbcache size: %lu B; " + "available memory size: %lu B;\n", #ifdef LINUX (PRUint64)total_cache_size, (PRUint64)li->li_dbcachesize, availpages * pagesize #else @@ -196,8 +189,9 @@ ldbm_back_start( Slapi_PBlock *pb ) /* In the case it is not, this will *reduce* the allocation */ issane = util_is_cachesize_sane(&zone_size); if (!issane) { - LDAPDebug(LDAP_DEBUG_ERR, "ldbm_back_start - Your autosized cache values have been reduced. Likely your nsslapd-cache-autosize percentage is too high.\n", 0,0,0); - LDAPDebug(LDAP_DEBUG_ERR, "ldbm_back_start - %s", msg,0,0); + slapi_log_err(SLAPI_LOG_ERR, "ldbm_back_start", + "Your autosized cache values have been reduced. Likely your nsslapd-cache-autosize percentage is too high.\n"); + slapi_log_err(SLAPI_LOG_ERR, "ldbm_back_start", "%s", msg); } /* It's valid, lets divide it up and set according to user prefs */ zone_pages = zone_size / pagesize; @@ -206,12 +200,12 @@ ldbm_back_start( Slapi_PBlock *pb ) /* We update this for the is-sane check below. */ total_cache_size = (zone_pages - db_pages) * pagesize; - LDAPDebug(LDAP_DEBUG_ERR, "ldbm_back_start - cache autosizing. found %dk physical memory\n", - pages*(pagesize/1024), 0, 0); - LDAPDebug(LDAP_DEBUG_ERR, "ldbm_back_start - cache autosizing. found %dk avaliable\n", - zone_pages*(pagesize/1024), 0, 0); - LDAPDebug(LDAP_DEBUG_ERR, "ldbm_back_start - cache autosizing: db cache: %dk, " - "each entry cache (%d total): %dk\n", + slapi_log_err(SLAPI_LOG_ERR, "ldbm_back_start", "cache autosizing. found %luk physical memory\n", + pages*(pagesize/1024)); + slapi_log_err(SLAPI_LOG_ERR, "ldbm_back_start", "cache autosizing. found %luk avaliable\n", + zone_pages*(pagesize/1024)); + slapi_log_err(SLAPI_LOG_ERR, "ldbm_back_start", "cache autosizing: db cache: %luk, " + "each entry cache (%d total): %luk\n", db_pages*(pagesize/1024), objset_size(li->li_instance_set), entry_pages*(pagesize/1024)); @@ -248,15 +242,14 @@ ldbm_back_start( Slapi_PBlock *pb ) import_size = import_pages * pagesize; issane = util_is_cachesize_sane(&import_size); if (!issane) { - LDAPDebug(LDAP_DEBUG_NOTICE, "ldbm_back_start - " + slapi_log_err(SLAPI_LOG_NOTICE, "ldbm_back_start", "Your autosized import cache values have been reduced. " - "Likely your nsslapd-import-cache-autosize percentage is too high.\n", - 0,0,0); + "Likely your nsslapd-import-cache-autosize percentage is too high.\n"); } /* We just accept the reduced allocation here. */ import_pages = import_size / pagesize; - LDAPDebug(LDAP_DEBUG_NOTICE, "ldbm_back_start - cache autosizing: import cache: %dk\n", - import_pages*(pagesize/1024), NULL, NULL); + slapi_log_err(SLAPI_LOG_NOTICE, "ldbm_back_start", "cache autosizing: import cache: %luk\n", + import_pages*(pagesize/1024)); sprintf(s, "%lu", (unsigned long)(import_pages * pagesize)); ldbm_config_internal_set(li, CONFIG_IMPORT_CACHESIZE, s); @@ -270,19 +263,21 @@ ldbm_back_start( Slapi_PBlock *pb ) issane = util_is_cachesize_sane(&total_size); if (!issane) { /* Right, it's time to panic */ - LDAPDebug(LDAP_DEBUG_CRIT, "ldbm_back_start - It is highly likely your memory configuration of all backends will EXCEED your systems memory.\n", 0, 0, 0 ); - LDAPDebug(LDAP_DEBUG_CRIT, "ldbm_back_start - In a future release this WILL prevent server start up. You MUST alter your configuration.\n", 0, 0, 0 ); - LDAPDebug(LDAP_DEBUG_CRIT, - "ldbm_back_start - Total entry cache size: %llu B; " - "dbcache size: %llu B; " - "available memory size: %llu B; \n", + slapi_log_err(SLAPI_LOG_CRIT, "ldbm_back_start", + "It is highly likely your memory configuration of all backends will EXCEED your systems memory.\n"); + slapi_log_err(SLAPI_LOG_CRIT, "ldbm_back_start", + "In a future release this WILL prevent server start up. You MUST alter your configuration.\n"); + slapi_log_err(SLAPI_LOG_CRIT, + "ldbm_back_start", "Total entry cache size: %lu B; " + "dbcache size: %lu B; " + "available memory size: %lu B; \n", #ifdef LINUX (PRUint64)total_cache_size, (PRUint64)li->li_dbcachesize, availpages * pagesize #else (PRUint64)total_cache_size, (PRUint64)li->li_dbcachesize, memsize #endif ); - LDAPDebug(LDAP_DEBUG_ERR, "ldbm_back_start - %s\n", msg,0,0); + slapi_log_err(SLAPI_LOG_ERR, "ldbm_back_start", "%s\n", msg); /* WB 2016 - This should be UNCOMMENTED in a future release */ /* return SLAPI_FAIL_GENERAL; */ } @@ -292,8 +287,7 @@ ldbm_back_start( Slapi_PBlock *pb ) retval = check_db_version(li, &action); if (0 != retval) { - LDAPDebug(LDAP_DEBUG_ERR, "ldbm_back_start - db version is not supported\n", - 0, 0, 0); + slapi_log_err(SLAPI_LOG_ERR, "ldbm_back_start", "db version is not supported\n"); return SLAPI_FAIL_GENERAL; } @@ -308,8 +302,8 @@ ldbm_back_start( Slapi_PBlock *pb ) } if (0 != retval) { char *msg; - LDAPDebug(LDAP_DEBUG_ERR, "ldbm_back_start - Failed to init database, err=%d %s\n", - retval, (msg = dblayer_strerror( retval )) ? msg : "", 0 ); + slapi_log_err(SLAPI_LOG_ERR, "ldbm_back_start", "Failed to init database, err=%d %s\n", + retval, (msg = dblayer_strerror( retval )) ? msg : ""); if (LDBM_OS_ERR_IS_DISKFULL(retval)) return return_on_disk_full(li); else return SLAPI_FAIL_GENERAL; } @@ -318,14 +312,14 @@ ldbm_back_start( Slapi_PBlock *pb ) retval = ldbm_instance_startall(li); if (0 != retval) { char *msg; - LDAPDebug(LDAP_DEBUG_ERR, "ldbm_back_start - Failed to start databases, err=%d %s\n", - retval, (msg = dblayer_strerror( retval )) ? msg : "", 0 ); + slapi_log_err(SLAPI_LOG_ERR, "ldbm_back_start", "Failed to start databases, err=%d %s\n", + retval, (msg = dblayer_strerror( retval )) ? msg : ""); if (LDBM_OS_ERR_IS_DISKFULL(retval)) return return_on_disk_full(li); else { if ((li->li_cache_autosize > 0) && (li->li_cache_autosize <= 100)) { - LDAPDebug(LDAP_DEBUG_ERR, "ldbm_back_start - Failed to allocate %d byte dbcache. " + slapi_log_err(SLAPI_LOG_ERR, "ldbm_back_start", "Failed to allocate %lu byte dbcache. " "Please reduce the value of %s and restart the server.\n", - li->li_dbcachesize, CONFIG_CACHE_AUTOSIZE, 0); + li->li_dbcachesize, CONFIG_CACHE_AUTOSIZE); } return SLAPI_FAIL_GENERAL; } @@ -352,7 +346,7 @@ ldbm_back_start( Slapi_PBlock *pb ) /* initialize the USN counter */ ldbm_usn_init(li); - LDAPDebug(LDAP_DEBUG_TRACE, "ldbm_back_start - ldbm backend done starting\n", 0, 0, 0 ); + slapi_log_err(SLAPI_LOG_TRACE, "ldbm_back_start", "ldbm backend done starting\n"); return( 0 ); diff --git a/ldap/servers/slapd/back-ldbm/uniqueid2entry.c b/ldap/servers/slapd/back-ldbm/uniqueid2entry.c index 8169077..495dbab 100644 --- a/ldap/servers/slapd/back-ldbm/uniqueid2entry.c +++ b/ldap/servers/slapd/back-ldbm/uniqueid2entry.c @@ -35,8 +35,7 @@ uniqueid2entry( IDList *idl = NULL; struct backentry *e = NULL; - LDAPDebug(LDAP_DEBUG_TRACE, "=> uniqueid2entry \"%s\"\n", uniqueid, - 0, 0 ); + slapi_log_err(SLAPI_LOG_TRACE, "uniqueid2entry", "=> \"%s\"\n", uniqueid); #ifdef UUIDCACHE_ON e = cache_find_uuid(&inst->inst_cache, uniqueid); #endif @@ -78,6 +77,6 @@ ext: slapi_ch_free( (void**)&idl); } - LDAPDebug(LDAP_DEBUG_TRACE, "<= uniqueid2entry %p\n", e, 0, 0 ); + slapi_log_err(SLAPI_LOG_TRACE, "uniqueid2entry", "<= %p\n", e); return( e ); } diff --git a/ldap/servers/slapd/back-ldbm/upgrade.c b/ldap/servers/slapd/back-ldbm/upgrade.c index c1616d1..c7e283f 100644 --- a/ldap/servers/slapd/back-ldbm/upgrade.c +++ b/ldap/servers/slapd/back-ldbm/upgrade.c @@ -147,7 +147,7 @@ check_db_version( struct ldbminfo *li, int *action ) value = lookup_dbversion( ldbmversion, DBVERSION_TYPE | DBVERSION_ACTION ); if ( !value ) { - LDAPDebug(LDAP_DEBUG_ERR, "check_db_version - " + slapi_log_err(SLAPI_LOG_ERR, "check_db_version", "Database version mismatch (expecting " "'%s' but found '%s' in directory %s)\n", LDBM_VERSION, ldbmversion, li->li_directory ); @@ -231,7 +231,7 @@ check_db_inst_version( ldbm_instance *inst ) value = lookup_dbversion( ldbmversion, DBVERSION_TYPE | DBVERSION_ACTION ); if ( !value ) { - LDAPDebug(LDAP_DEBUG_ERR, "check_db_inst_version -" + slapi_log_err(SLAPI_LOG_ERR, "check_db_inst_version", "Database version mismatch (expecting " "'%s' but found '%s' in directory %s)\n", LDBM_VERSION, ldbmversion, inst->inst_dir_name ); @@ -307,9 +307,9 @@ adjust_idl_switch(char *ldbmversion, struct ldbminfo *li) if (!idl_get_idl_new()) /* config: old idl */ { replace_ldbm_config_value(CONFIG_IDL_SWITCH, "new", li); - LDAPDebug(LDAP_DEBUG_WARNING, "adjust_idl_switch - " + slapi_log_err(SLAPI_LOG_WARNING, "adjust_idl_switch", "Dbversion %s does not meet nsslapd-idl-switch: \"old\"; " - "nsslapd-idl-switch is updated to \"new\"\n", ldbmversion, 0, 0); + "nsslapd-idl-switch is updated to \"new\"\n", ldbmversion); } } else if ((0 == strcmp(ldbmversion, LDBM_VERSION_OLD)) || @@ -320,17 +320,17 @@ adjust_idl_switch(char *ldbmversion, struct ldbminfo *li) if (idl_get_idl_new()) /* config: new */ { replace_ldbm_config_value(CONFIG_IDL_SWITCH, "old", li); - LDAPDebug(LDAP_DEBUG_WARNING, "adjust_idl_switch - " + slapi_log_err(SLAPI_LOG_WARNING, "adjust_idl_switch", "Dbversion %s does not meet nsslapd-idl-switch: \"new\"; " "nsslapd-idl-switch is updated to \"old\"\n", - ldbmversion, 0, 0); + ldbmversion); } } else { - LDAPDebug(LDAP_DEBUG_ERR, "adjust_idl_switch - " + slapi_log_err(SLAPI_LOG_ERR, "adjust_idl_switch", "Dbversion %s is not supported\n", - ldbmversion, 0, 0); + ldbmversion); rval = -1; } @@ -357,7 +357,7 @@ int ldbm_upgrade(ldbm_instance *inst, int action) rval = dblayer_update_db_ext(inst, LDBM_SUFFIX_OLD, LDBM_SUFFIX); if (0 == rval) { - LDAPDebug(LDAP_DEBUG_ERR, "ldbm_upgrade - " + slapi_log_err(SLAPI_LOG_ERR, "ldbm_upgrade", "Upgrading instance %s supporting bdb %d.%d " "was successfully done.\n", inst->inst_name, DB_VERSION_MAJOR, DB_VERSION_MINOR); @@ -390,18 +390,18 @@ static int upgrade_db_3x_40(backend *be) static char* indexes_modified[] = {"parentid", "numsubordinates", NULL}; - LDAPDebug(LDAP_DEBUG_WARNING, "upgrade_db_3x_40 - " - "WARNING: Detected a database older than this server, upgrading data...\n",0,0,0); + slapi_log_err(SLAPI_LOG_WARNING, "upgrade_db_3x_40", + "WARNING: Detected a database older than this server, upgrading data...\n"); dblayer_txn_init(li,&txn); ret = dblayer_txn_begin(li,NULL,&txn); if (0 != ret) { - ldbm_nasty(filename,69,ret); + ldbm_nasty("upgrade_db_3x_40",filename,69,ret); goto error; } ret = indexfile_delete_all_keys(be,"parentid",&txn); if (0 != ret) { - ldbm_nasty(filename,70,ret); + ldbm_nasty("upgrade_db_3x_40",filename,70,ret); goto error; } @@ -416,7 +416,7 @@ static int upgrade_db_3x_40(backend *be) } if (0 != ret) { - ldbm_nasty(filename,61,ret); + ldbm_nasty("upgrade_db_3x_40",filename,61,ret); } error: @@ -425,15 +425,15 @@ error: } else { ret = dblayer_txn_commit(li,&txn); if (0 != ret) { - ldbm_nasty(filename,60,ret); + ldbm_nasty("upgrade_db_3x_40",filename,60,ret); } else { /* Now update DBVERSION file */ } } if (0 == ret) { - LDAPDebug(LDAP_DEBUG_INFO, "upgrade_db_3x_40 - ...upgrade complete.\n",0,0,0); + slapi_log_err(SLAPI_LOG_INFO, "upgrade_db_3x_40", "...upgrade complete.\n"); } else { - LDAPDebug(LDAP_DEBUG_ERR, "upgrade_db_3x_40 - Attempt to upgrade the older database FAILED.\n",0,0,0); + slapi_log_err(SLAPI_LOG_ERR, "upgrade_db_3x_40", "Attempt to upgrade the older database FAILED.\n"); } return ret; } diff --git a/ldap/servers/slapd/back-ldbm/vlv.c b/ldap/servers/slapd/back-ldbm/vlv.c index caf7e36..0007d01 100644 --- a/ldap/servers/slapd/back-ldbm/vlv.c +++ b/ldap/servers/slapd/back-ldbm/vlv.c @@ -81,8 +81,8 @@ int vlv_AddIndexEntry(Slapi_PBlock *pb, Slapi_Entry* entryBefore, Slapi_Entry* e char *name = slapi_entry_attr_get_charptr(entryBefore, type_vlvName); if (vlvSearch_findname(parent, name)) { /* The vlvindex is already in the vlvSearchList. Skip adding it. */ - LDAPDebug1Arg(LDAP_DEBUG_BACKLDBM, - "vlv_AddIndexEntry: %s is already in vlvSearchList\n", + slapi_log_err(SLAPI_LOG_BACKLDBM, + "vlv_AddIndexEntry", "%s is already in vlvSearchList\n", slapi_entry_get_dn_const(entryBefore)); } else { struct vlvIndex* newVlvIndex= vlvIndex_new(); @@ -107,10 +107,10 @@ int vlv_DeleteSearchEntry(Slapi_PBlock *pb, Slapi_Entry* entryBefore, Slapi_Entr if (instance_set_busy(inst) != 0) { - LDAPDebug(LDAP_DEBUG_WARNING, - "vlv_DeleteSearchEntry - Backend instance: '%s' is already in the middle of " + slapi_log_err(SLAPI_LOG_WARNING, + "vlv_DeleteSearchEntry", "Backend instance: '%s' is already in the middle of " "another task and cannot be disturbed.\n", - inst->inst_name, 0, 0); + inst->inst_name); return SLAPI_DSE_CALLBACK_ERROR; } /* vlvSearchList is modified; need Wlock */ @@ -118,7 +118,7 @@ int vlv_DeleteSearchEntry(Slapi_PBlock *pb, Slapi_Entry* entryBefore, Slapi_Entr p = vlvSearch_finddn((struct vlvSearch *)be->vlvSearchList, slapi_entry_get_sdn(entryBefore)); if(p!=NULL) { - LDAPDebug(LDAP_DEBUG_INFO, "vlv_DeleteSearchEntry - Deleted Virtual List View Search (%s).\n", p->vlv_name, 0, 0); + slapi_log_err(SLAPI_LOG_INFO, "vlv_DeleteSearchEntry", "Deleted Virtual List View Search (%s).\n", p->vlv_name); vlvSearch_removefromlist((struct vlvSearch **)&be->vlvSearchList,p->vlv_dn); vlvSearch_delete(&p); } @@ -134,14 +134,14 @@ int vlv_DeleteIndexEntry(Slapi_PBlock *pb, Slapi_Entry* entryBefore, Slapi_Entry { ldbm_instance *inst = (ldbm_instance*)arg; if (inst && is_instance_busy(inst)) { - LDAPDebug(LDAP_DEBUG_WARNING, - "vlv_DeleteIndexEntry - Backend instance: '%s' is already in the middle of " + slapi_log_err(SLAPI_LOG_WARNING, + "vlv_DeleteIndexEntry", "Backend instance: '%s' is already in the middle of " "another task and cannot be disturbed.\n", - inst->inst_name, 0, 0); + inst->inst_name); return SLAPI_DSE_CALLBACK_ERROR; } else { - LDAPDebug(LDAP_DEBUG_INFO, - "vlv_DeleteIndexEntry - Deleted Virtual List View Index.\n", 0, 0, 0); + slapi_log_err(SLAPI_LOG_INFO, + "vlv_DeleteIndexEntry", "Deleted Virtual List View Index.\n"); return SLAPI_DSE_CALLBACK_OK; } } @@ -158,8 +158,8 @@ int vlv_ModifySearchEntry(Slapi_PBlock *pb, Slapi_Entry* entryBefore, Slapi_Entr p= vlvSearch_finddn((struct vlvSearch *)be->vlvSearchList, slapi_entry_get_sdn(entryBefore)); if(p!=NULL) { - LDAPDebug(LDAP_DEBUG_INFO, "vlv_ModifySearchEntry - Modified Virtual List View Search (%s), " - "which will be enabled when the database is rebuilt.\n", p->vlv_name, 0, 0); + slapi_log_err(SLAPI_LOG_INFO, "vlv_ModifySearchEntry", "Modified Virtual List View Search (%s), " + "which will be enabled when the database is rebuilt.\n", p->vlv_name); } slapi_rwlock_unlock(be->vlvSearchList_lock); return SLAPI_DSE_CALLBACK_DO_NOT_APPLY; @@ -170,7 +170,7 @@ int vlv_ModifySearchEntry(Slapi_PBlock *pb, Slapi_Entry* entryBefore, Slapi_Entr int vlv_ModifyIndexEntry(Slapi_PBlock *pb, Slapi_Entry* entryBefore, Slapi_Entry* entryAfter, int *returncode, char *returntext, void *arg) { - LDAPDebug(LDAP_DEBUG_INFO, "vlv_ModifyIndexEntry - Modified Virtual List View Index.\n", 0, 0, 0); + slapi_log_err(SLAPI_LOG_INFO, "vlv_ModifyIndexEntry", "Modified Virtual List View Index.\n"); return SLAPI_DSE_CALLBACK_DO_NOT_APPLY; } @@ -186,7 +186,8 @@ int vlv_ModifyRDNSearchEntry(Slapi_PBlock *pb, Slapi_Entry* entryBefore, Slapi_E p= vlvSearch_finddn((struct vlvSearch *)be->vlvSearchList, slapi_entry_get_sdn(entryBefore)); if(p!=NULL) { - LDAPDebug(LDAP_DEBUG_INFO, "vlv_ModifyRDNSearchEntry - Modified Virtual List View Search (%s), which will be enabled when the database is rebuilt.\n", p->vlv_name, 0, 0); + slapi_log_err(SLAPI_LOG_INFO, "vlv_ModifyRDNSearchEntry", + "Modified Virtual List View Search (%s), which will be enabled when the database is rebuilt.\n", p->vlv_name); } slapi_rwlock_unlock(be->vlvSearchList_lock); return SLAPI_DSE_CALLBACK_DO_NOT_APPLY; @@ -197,7 +198,7 @@ int vlv_ModifyRDNSearchEntry(Slapi_PBlock *pb, Slapi_Entry* entryBefore, Slapi_E int vlv_ModifyRDNIndexEntry(Slapi_PBlock *pb, Slapi_Entry* entryBefore, Slapi_Entry* entryAfter, int *returncode, char *returntext, void *arg) { - LDAPDebug(LDAP_DEBUG_INFO, "vlv_ModifyRDNIndexEntry - Modified Virtual List View Index.\n", 0, 0, 0); + slapi_log_err(SLAPI_LOG_INFO, "vlv_ModifyRDNIndexEntry", "Modified Virtual List View Index.\n"); return SLAPI_DSE_CALLBACK_DO_NOT_APPLY; } @@ -245,8 +246,8 @@ vlv_init_index_entry(Slapi_PBlock *pb, Slapi_Entry* entryBefore, Slapi_Entry* en slapi_sdn_get_parent(slapi_entry_get_sdn(entryBefore),&parentdn); pSearch= vlvSearch_finddn((struct vlvSearch *)be->vlvSearchList, &parentdn); if (pSearch == NULL) { - LDAPDebug(LDAP_DEBUG_WARNING, "vlv_init_index_entry - Parent doesn't exist for entry %s.\n", - slapi_entry_get_dn(entryBefore), 0, 0); + slapi_log_err(SLAPI_LOG_WARNING, "vlv_init_index_entry", "Parent doesn't exist for entry %s.\n", + slapi_entry_get_dn(entryBefore)); vlvIndex_delete(&newVlvIndex); } else { @@ -340,7 +341,7 @@ vlv_init(ldbm_instance *inst) backend *be = NULL; if (!inst) { - LDAPDebug(LDAP_DEBUG_ERR, "vlv_init - Invalid instance.\n", 0, 0, 0); + slapi_log_err(SLAPI_LOG_ERR, "vlv_init", "Invalid instance.\n"); return_value = LDAP_OPERATIONS_ERROR; goto out; } @@ -373,8 +374,8 @@ vlv_init(ldbm_instance *inst) basedn = slapi_create_dn_string("cn=%s,cn=%s,cn=plugins,cn=config", inst->inst_name, inst->inst_li->li_plugin->plg_name); if (NULL == basedn) { - LDAPDebug2Args(LDAP_DEBUG_ERR, - "vlv_init - Failed to create vlv dn for plugin %s, instance %s\n", + slapi_log_err(SLAPI_LOG_ERR, + "vlv_init", "Failed to create vlv dn for plugin %s, instance %s\n", inst->inst_name, inst->inst_li->li_plugin->plg_name); return_value = LDAP_PARAM_ERROR; return return_value; @@ -448,8 +449,8 @@ vlv_remove_callbacks(ldbm_instance *inst) basedn = slapi_create_dn_string("cn=%s,cn=%s,cn=plugins,cn=config", inst->inst_name, inst->inst_li->li_plugin->plg_name); if (NULL == basedn) { - LDAPDebug2Args(LDAP_DEBUG_ERR, - "vlv_remove_callbacks - Failed to create vlv dn for plugin %s, " + slapi_log_err(SLAPI_LOG_ERR, + "vlv_remove_callbacks", "Failed to create vlv dn for plugin %s, " "instance %s\n", inst->inst_name, inst->inst_li->li_plugin->plg_name); return_value = LDAP_PARAM_ERROR; @@ -739,8 +740,8 @@ do_vlv_update_index(back_txn *txn, struct ldbminfo *li, Slapi_PBlock *pb, struct rc = dblayer_get_index_file(be, pIndex->vlv_attrinfo, &db, DBOPEN_CREATE); if (rc != 0) { if(rc != DB_LOCK_DEADLOCK) - LDAPDebug(LDAP_DEBUG_ERR, "do_vlv_update_index - Can't get index file '%s' (err %d)\n", - pIndex->vlv_attrinfo->ai_type, rc, 0); + slapi_log_err(SLAPI_LOG_ERR, "do_vlv_update_index", "Can't get index file '%s' (err %d)\n", + pIndex->vlv_attrinfo->ai_type, rc); return rc; } @@ -757,32 +758,32 @@ do_vlv_update_index(back_txn *txn, struct ldbminfo *li, Slapi_PBlock *pb, struct data.data = &entry->ep_id; rc = db->put(db, db_txn, &key->key, &data, 0); if (rc == 0) { - LDAPDebug(LDAP_DEBUG_TRACE, - "vlv_update_index - %s Insert %s ID=%lu\n", - pIndex->vlv_name, key->key.data, (u_long)entry->ep_id); + slapi_log_err(SLAPI_LOG_TRACE, + "vlv_update_index", "%s Insert %s ID=%lu\n", + pIndex->vlv_name, (char *)key->key.data, (u_long)entry->ep_id); vlvIndex_increment_indexlength(pIndex, db, txn); } else if (rc == DB_RUNRECOVERY) { - ldbm_nasty(pIndex->vlv_name,77,rc); + ldbm_nasty("do_vlv_update_index",pIndex->vlv_name,77,rc); } else if(rc != DB_LOCK_DEADLOCK) { /* jcm: This error is valid if the key already exists. * Identical multi valued attr values could do this. */ - LDAPDebug(LDAP_DEBUG_TRACE, - "vlv_update_index - %s Insert %s ID=%lu FAILED\n", - pIndex->vlv_name, key->key.data, (u_long)entry->ep_id); + slapi_log_err(SLAPI_LOG_TRACE, + "vlv_update_index", "%s Insert %s ID=%lu FAILED\n", + pIndex->vlv_name, (char *)key->key.data, (u_long)entry->ep_id); } } else { - LDAPDebug(LDAP_DEBUG_TRACE, - "vlv_update_index - %s Delete %s\n", - pIndex->vlv_name, key->key.data, 0); + slapi_log_err(SLAPI_LOG_TRACE, + "vlv_update_index", "%s Delete %s\n", + pIndex->vlv_name, (char *)key->key.data); rc = db->del(db, db_txn, &key->key, 0); if (rc == 0) { vlvIndex_decrement_indexlength(pIndex, db, txn); } else if (rc == DB_RUNRECOVERY) { - ldbm_nasty(pIndex->vlv_name,78,rc); + ldbm_nasty("do_vlv_update_index",pIndex->vlv_name,78,rc); } else if (rc != DB_LOCK_DEADLOCK) { - LDAPDebug(LDAP_DEBUG_TRACE, - "vlv_update_index - %s Delete %s FAILED\n", - pIndex->vlv_name, key->key.data, 0); + slapi_log_err(SLAPI_LOG_TRACE, + "vlv_update_index", "%s Delete %s FAILED\n", + pIndex->vlv_name, (char *)key->key.data); } } @@ -917,7 +918,7 @@ determine_result_range(const struct vlv_request *vlv_request_control, PRUint32 i *pstop= length - 1; } } - LDAPDebug(LDAP_DEBUG_TRACE, "vlv_determine_result_range - Result Range %lu-%lu\n", *pstart, *pstop, 0 ); + slapi_log_err(SLAPI_LOG_TRACE, "vlv_determine_result_range", "Result Range %u-%u\n", *pstart, *pstop); } /* @@ -1017,7 +1018,7 @@ vlv_build_candidate_list_byvalue( struct vlvIndex* p, DBC *dbc, PRUint32 length, /* Records are numbered from one. */ si--; slapi_ch_free(&(data.data)); - LDAPDebug(LDAP_DEBUG_TRACE, "vlv_build_candidate_list_byvalue - Found. Index=%lu\n",si,0,0); + slapi_log_err(SLAPI_LOG_TRACE, "vlv_build_candidate_list_byvalue", "Found. Index=%u\n",si); } else { @@ -1038,7 +1039,7 @@ vlv_build_candidate_list_byvalue( struct vlvIndex* p, DBC *dbc, PRUint32 length, { si = length - 1; } - LDAPDebug(LDAP_DEBUG_TRACE, "vlv_build_candidate_list_byvalue - Not Found. Index=%lu\n",si,0,0); + slapi_log_err(SLAPI_LOG_TRACE, "vlv_build_candidate_list_byvalue", "Not Found. Index=%u\n",si); } if (key.data != typedown_value[0]->bv_val) { /* in case new key is set in dbc->c_get(DB_SET_RANGE) */ @@ -1087,11 +1088,11 @@ int vlv_build_idl(PRUint32 start, PRUint32 stop, DB *db, DBC *dbc, } if (err != 0) { /* some db error...? */ - LDAPDebug(LDAP_DEBUG_ERR, "vlv_build_idl - can't follow db cursor " - "(err %d)\n", err, 0, 0); + slapi_log_err(SLAPI_LOG_ERR, "vlv_build_idl", "Can't follow db cursor " + "(err %d)\n", err); if (err == ENOMEM) - LDAPDebug(LDAP_DEBUG_ERR, "vlv_build_idl - nomem: wants %d key, %d data\n", - key.size, data.size, 0); + slapi_log_err(SLAPI_LOG_ERR, "vlv_build_idl", "nomem: wants %d key, %d data\n", + key.size, data.size); rc = LDAP_OPERATIONS_ERROR; goto error; } @@ -1196,8 +1197,8 @@ vlv_build_candidate_list( backend *be, struct vlvIndex* p, const struct vlv_requ int do_trim= 1; DB_TXN *db_txn = NULL; - LDAPDebug(LDAP_DEBUG_TRACE, - "vlv_build_candidate_list - %s %s Using VLV Index %s\n", + slapi_log_err(SLAPI_LOG_TRACE, + "vlv_build_candidate_list", "%s %s Using VLV Index %s\n", slapi_sdn_get_dn(vlvIndex_getBase(p)), p->vlv_search->vlv_filter, vlvIndex_getName(p)); if (!vlvIndex_online(p)) { @@ -1209,8 +1210,8 @@ vlv_build_candidate_list( backend *be, struct vlvIndex* p, const struct vlv_requ rc = dblayer_get_index_file(be, p->vlv_attrinfo, &db, 0); if (rc != 0) { /* shouldn't happen */ - LDAPDebug(LDAP_DEBUG_ERR, "vlv_build_candidate_list - Can't get index file '%s' (err %d)\n", - p->vlv_attrinfo->ai_type, rc, 0); + slapi_log_err(SLAPI_LOG_ERR, "vlv_build_candidate_list", "Can't get index file '%s' (err %d)\n", + p->vlv_attrinfo->ai_type, rc); if (is_srchlist_locked) { slapi_rwlock_unlock(be->vlvSearchList_lock); } @@ -1231,8 +1232,8 @@ vlv_build_candidate_list( backend *be, struct vlvIndex* p, const struct vlv_requ err = db->cursor(db, db_txn, &dbc, 0); if (err != 0) { /* shouldn't happen */ - LDAPDebug(LDAP_DEBUG_ERR, "vlv_build_candidate_list - Couldn't get cursor (err %d)\n", - rc, 0, 0); + slapi_log_err(SLAPI_LOG_ERR, "vlv_build_candidate_list", "Couldn't get cursor (err %d)\n", + rc); return -1; } @@ -1305,7 +1306,7 @@ vlv_filter_candidates(backend *be, Slapi_PBlock *pb, const IDList *candidates, c return LDAP_UNWILLING_TO_PERFORM; } - LDAPDebug(LDAP_DEBUG_TRACE, "vlv_filter_candidates - Filtering %lu Candidates\n",(u_long)candidates->b_nids, 0, 0 ); + slapi_log_err(SLAPI_LOG_TRACE, "vlv_filter_candidates", "Filtering %lu Candidates\n",(u_long)candidates->b_nids); if (0 == return_value && candidates->b_nids>0) { @@ -1336,7 +1337,8 @@ vlv_filter_candidates(backend *be, Slapi_PBlock *pb, const IDList *candidates, c */ if(!(ALLIDS(candidates) && err==DB_NOTFOUND)) { - LDAPDebug(LDAP_DEBUG_ERR, "vlv_filter_candidates - Candidate %lu not found err=%d\n", (u_long)id, err, 0 ); + slapi_log_err(SLAPI_LOG_ERR, "vlv_filter_candidates", + "Candidate %lu not found err=%d\n", (u_long)id, err); } } else @@ -1347,7 +1349,8 @@ vlv_filter_candidates(backend *be, Slapi_PBlock *pb, const IDList *candidates, c if ( slapi_filter_test( pb, e->ep_entry, filter, 0 /* No ACL Check */) == 0 ) { /* The entry passed the filter test, add the id to the list */ - LDAPDebug(LDAP_DEBUG_TRACE, "vlv_filter_candidates - Candidate %lu Passed Filter\n", (u_long)id, 0, 0 ); + slapi_log_err(SLAPI_LOG_TRACE, "vlv_filter_candidates", + "Candidate %lu Passed Filter\n", (u_long)id); idl_append(resultIdl,id); } } @@ -1378,7 +1381,7 @@ vlv_filter_candidates(backend *be, Slapi_PBlock *pb, const IDList *candidates, c } *filteredCandidates= resultIdl; - LDAPDebug(LDAP_DEBUG_TRACE, "vlv_filter_candidates -Filtering done\n",0, 0, 0 ); + slapi_log_err(SLAPI_LOG_TRACE, "vlv_filter_candidates", "Filtering done\n"); return return_value; } @@ -1450,12 +1453,13 @@ vlv_trim_candidates_txn(backend *be, const IDList *candidates, const sort_spec* PRUint32 cursor= 0; for(cursor=start;cursor<=stop;cursor++) { - LDAPDebug(LDAP_DEBUG_TRACE, "vlv_trim_candidates - Include ID %lu\n",(u_long)candidates->b_ids[cursor], 0, 0 ); + slapi_log_err(SLAPI_LOG_TRACE, "vlv_trim_candidates", "Include ID %lu\n",(u_long)candidates->b_ids[cursor]); idl_append(resultIdl,candidates->b_ids[cursor]); } } } - LDAPDebug(LDAP_DEBUG_TRACE, "vlv_trim_candidates - Trimmed list contains %lu entries.\n", (u_long)(resultIdl ? resultIdl->b_nids : 0), 0, 0 ); + slapi_log_err(SLAPI_LOG_TRACE, "vlv_trim_candidates", + "Trimmed list contains %lu entries.\n", (u_long)(resultIdl ? resultIdl->b_nids : 0)); *trimmedCandidates= resultIdl; return return_value; } @@ -1477,7 +1481,8 @@ static PRUint32 vlv_trim_candidates_byindex(PRUint32 length, const struct vlv_request *vlv_request_control) { PRUint32 si= 0; /* The Selected Index */ - LDAPDebug(LDAP_DEBUG_TRACE, "vlv_trim_candidates_byindex - length=%u index=%d size=%d\n",length, vlv_request_control->index, vlv_request_control->contentCount ); + slapi_log_err(SLAPI_LOG_TRACE, "vlv_trim_candidates_byindex", + "length=%u index=%d size=%d\n",length, vlv_request_control->index, vlv_request_control->contentCount ); if(vlv_request_control->index==0) { /* Always select the first entry in the list */ @@ -1524,7 +1529,7 @@ vlv_trim_candidates_byindex(PRUint32 length, const struct vlv_request *vlv_reque } } } - LDAPDebug(LDAP_DEBUG_TRACE, "vlv_trim_candidates_byindex - Selected Index %lu\n",si, 0, 0 ); + slapi_log_err(SLAPI_LOG_TRACE, "vlv_trim_candidates_byindex", "Selected Index %u\n",si); return si; } @@ -1554,7 +1559,7 @@ vlv_trim_candidates_byvalue(backend *be, const IDList *candidates, const sort_sp { attr_get_value_cmp_fn(&sort_control->sattr, &compare_fn); if (compare_fn == NULL) { - LDAPDebug1Arg(LDAP_DEBUG_WARNING, "vlv_trim_candidates_byvalue - " + slapi_log_err(SLAPI_LOG_WARNING, "vlv_trim_candidates_byvalue", "Attempt to compare an unordered attribute [%s]\n", sort_control->type); compare_fn = slapi_berval_cmp; @@ -1566,9 +1571,8 @@ vlv_trim_candidates_byvalue(backend *be, const IDList *candidates, const sort_sp invalue[1]= NULL; slapi_attr_values2keys(&sort_control->sattr,invalue,&typedown_value,LDAP_FILTER_EQUALITY); /* JCM SLOW FUNCTION */ if (compare_fn == NULL) { - LDAPDebug(LDAP_DEBUG_WARNING, "vlv_trim_candidates_byvalue - " - "Attempt to compare an unordered attribute", - 0, 0, 0); + slapi_log_err(SLAPI_LOG_WARNING, "vlv_trim_candidates_byvalue", + "Attempt to compare an unordered attribute"); compare_fn = slapi_berval_cmp; } } @@ -1583,7 +1587,7 @@ retry: * Perform a binary search over the candidate list */ if (0 == candidates->b_nids) { /* idlist is empty */ - LDAPDebug(LDAP_DEBUG_ERR, "vlv_trim_candidates_byvalue - Candidate ID List is empty.\n", 0, 0, 0 ); + slapi_log_err(SLAPI_LOG_ERR, "vlv_trim_candidates_byvalue", "Candidate ID List is empty.\n"); ber_bvecfree((struct berval**)typedown_value); return candidates->b_nids; /* not found */ } @@ -1605,8 +1609,8 @@ retry: if ( e == NULL ) { int rval; - LDAPDebug(LDAP_DEBUG_ERR, "vlv_trim_candidates_byvalue - " - "Candidate ID %lu not found err=%d\n", (u_long)id, err, 0 ); + slapi_log_err(SLAPI_LOG_ERR, "vlv_trim_candidates_byvalue", + "Candidate ID %lu not found err=%d\n", (u_long)id, err); rval = idl_delete((IDList **)&candidates, id); if (0 == rval || 1 == rval || 2 == rval) { goto retry; @@ -1699,12 +1703,12 @@ retry: if(si==candidates->b_nids && !match) { /* Couldn't find an entry which matches the value, so return contentCount */ - LDAPDebug(LDAP_DEBUG_TRACE, "vlv_trim_candidates_byvalue - Not Found. Index %lu\n",si, 0, 0 ); + slapi_log_err(SLAPI_LOG_TRACE, "vlv_trim_candidates_byvalue", "Not Found. Index %u\n",si); si= candidates->b_nids; } else { - LDAPDebug(LDAP_DEBUG_TRACE, "vlv_trim_candidates_byvalue - Found. Index %lu\n",si, 0, 0 ); + slapi_log_err(SLAPI_LOG_TRACE, "vlv_trim_candidates_byvalue", "Found. Index %u\n",si); } } CACHE_RETURN(&(((ldbm_instance *)be->be_instance_info)->inst_cache), @@ -1772,7 +1776,8 @@ vlv_make_response_control (Slapi_PBlock *pb, const struct vlv_response* vlvp) ber_bvfree(bvp); } - LDAPDebug(LDAP_DEBUG_TRACE, "vlv_make_response_control - Index=%d Size=%d Result=%d\n", vlvp->targetPosition, vlvp->contentCount, vlvp->result ); + slapi_log_err(SLAPI_LOG_TRACE, "vlv_make_response_control", "Index=%d Size=%d Result=%d\n", + vlvp->targetPosition, vlvp->contentCount, vlvp->result ); return (rc==-1?LDAP_OPERATIONS_ERROR:LDAP_SUCCESS); } @@ -1878,8 +1883,8 @@ vlv_parse_request_control( backend *be, struct berval *vlv_spec_ber,struct vlv_r } else { - LDAPDebug(LDAP_DEBUG_TRACE, "vlv_parse_request_control - Before=%d After=%d\n", - vlvp->beforeCount, vlvp->afterCount, 0 ); + slapi_log_err(SLAPI_LOG_TRACE, "vlv_parse_request_control", "Before=%d After=%d\n", + vlvp->beforeCount, vlvp->afterCount); if (ber_scanf(ber,"t",&vlvp->tag) == LBER_ERROR) { return_value= LDAP_OPERATIONS_ERROR; @@ -1906,7 +1911,8 @@ vlv_parse_request_control( backend *be, struct berval *vlv_spec_ber,struct vlv_r { vlvp->index--; } - LDAPDebug(LDAP_DEBUG_TRACE, "vlv_parse_request_control - Index=%d Content=%d\n", vlvp->index, vlvp->contentCount, 0 ); + slapi_log_err(SLAPI_LOG_TRACE, "vlv_parse_request_control", "Index=%d Content=%d\n", + vlvp->index, vlvp->contentCount); } break; case LDAP_TAG_VLV_BY_VALUE: @@ -1925,7 +1931,7 @@ vlv_parse_request_control( backend *be, struct berval *vlv_spec_ber,struct vlv_r char *p= slapi_ch_malloc(vlvp->value.bv_len+1); strncpy(p,vlvp->value.bv_val,vlvp->value.bv_len); p[vlvp->value.bv_len]= '\0'; - LDAPDebug(LDAP_DEBUG_TRACE, "vlv_parse_request_control - Value=%s\n", p, 0, 0 ); + slapi_log_err(SLAPI_LOG_TRACE, "vlv_parse_request_control", "Value=%s\n", p); slapi_ch_free( (void**)&p); } break; @@ -1989,8 +1995,8 @@ IDList *vlv_find_index_by_filter_txn(struct backend *be, const char *base, } if (!vi) { /* no match */ - LDAPDebug(LDAP_DEBUG_TRACE, "vlv_find_index_by_filter_txn - No index online for %s\n", - t->vlv_filter, 0, 0); + slapi_log_err(SLAPI_LOG_TRACE, "vlv_find_index_by_filter_txn", "No index online for %s\n", + t->vlv_filter); slapi_rwlock_unlock(be->vlvSearchList_lock); return NULL; } @@ -2002,8 +2008,8 @@ IDList *vlv_find_index_by_filter_txn(struct backend *be, const char *base, if (err == 0) { if (length == 0) /* 609377: index size could be 0 */ { - LDAPDebug(LDAP_DEBUG_TRACE, "vlv_find_index_by_filter_txn - Index %s is empty\n", - t->vlv_filter, 0, 0); + slapi_log_err(SLAPI_LOG_TRACE, "vlv_find_index_by_filter_txn", "Index %s is empty\n", + t->vlv_filter); idl = NULL; } else @@ -2016,8 +2022,8 @@ IDList *vlv_find_index_by_filter_txn(struct backend *be, const char *base, if (err == 0) { return idl; } else { - LDAPDebug(LDAP_DEBUG_ERR, "vlv_find_index_by_filter_txn - vlv find index: err %d\n", - err, 0, 0); + slapi_log_err(SLAPI_LOG_ERR, "vlv_find_index_by_filter_txn", "vlv find index: err %d\n", + err); return NULL; } } @@ -2078,19 +2084,19 @@ int vlv_delete_search_entry(Slapi_PBlock *pb, Slapi_Entry* e, ldbm_instance *ins if (instance_set_busy(inst) != 0) { - LDAPDebug(LDAP_DEBUG_ERR, - "vlv_delete_search_entry - " + slapi_log_err(SLAPI_LOG_ERR, + "vlv_delete_search_entry", "Backend instance: '%s' is already in the middle of " "another task and cannot be disturbed.\n", - inst->inst_name, 0, 0); + inst->inst_name); return LDAP_OPERATIONS_ERROR; } tag1=create_vlv_search_tag(dn); base1 = slapi_create_dn_string("cn=MCC %s,cn=%s,cn=%s,cn=plugins,cn=config", tag1, inst->inst_name, inst->inst_li->li_plugin->plg_name); if (NULL == base1) { - LDAPDebug(LDAP_DEBUG_ERR, - "vlv_delete_search_entry - " + slapi_log_err(SLAPI_LOG_ERR, + "vlv_delete_search_entry", "failed to craete vlv search entry dn (rdn: cn=MCC %s) for " "plugin %s, instance %s\n", tag1, inst->inst_li->li_plugin->plg_name, inst->inst_name); @@ -2103,12 +2109,13 @@ int vlv_delete_search_entry(Slapi_PBlock *pb, Slapi_Entry* e, ldbm_instance *ins p = vlvSearch_finddn((struct vlvSearch *)be->vlvSearchList, newdn); if(p!=NULL) { - LDAPDebug(LDAP_DEBUG_ERR, "Deleted Virtual List View Search (%s).\n", p->vlv_name, 0, 0); + slapi_log_err(SLAPI_LOG_ERR, "vlv_delete_search_entry", + "Deleted Virtual List View Search (%s).\n", p->vlv_name); tag2=create_vlv_search_tag(dn); base2 = slapi_create_dn_string("cn=by MCC %s,%s", tag2, base1); if (NULL == base2) { - LDAPDebug(LDAP_DEBUG_ERR, - "vlv_delete_search_entry - Failed to create " + slapi_log_err(SLAPI_LOG_ERR, + "vlv_delete_search_entry", "Failed to create " "vlv search entry dn (rdn: cn=by MCC %s) for " "plugin %s, instance %s\n", tag2, inst->inst_li->li_plugin->plg_name, inst->inst_name); @@ -2127,7 +2134,7 @@ int vlv_delete_search_entry(Slapi_PBlock *pb, Slapi_Entry* e, ldbm_instance *ins slapi_delete_internal_pb(tmppb); slapi_pblock_get (tmppb, SLAPI_PLUGIN_INTOP_RESULT, &rc); if(rc != LDAP_SUCCESS) { - LDAPDebug(LDAP_DEBUG_ERR, "vlv_delete_search_entry - Can't delete dse entry '%s' error %d\n", base2, rc, 0); + slapi_log_err(SLAPI_LOG_ERR, "vlv_delete_search_entry", "Can't delete dse entry '%s' error %d\n", base2, rc); } pblock_done(tmppb); pblock_init(tmppb); @@ -2136,7 +2143,7 @@ int vlv_delete_search_entry(Slapi_PBlock *pb, Slapi_Entry* e, ldbm_instance *ins slapi_delete_internal_pb(tmppb); slapi_pblock_get (tmppb, SLAPI_PLUGIN_INTOP_RESULT, &rc); if(rc != LDAP_SUCCESS) { - LDAPDebug(LDAP_DEBUG_ERR, "vlv_delete_search_entry - Can't delete dse entry '%s' error %d\n", base1, rc, 0); + slapi_log_err(SLAPI_LOG_ERR, "vlv_delete_search_entry", "Can't delete dse entry '%s' error %d\n", base1, rc); } slapi_pblock_destroy(tmppb); slapi_ch_free((void **)&tag2); @@ -2155,13 +2162,13 @@ bail: void vlv_acquire_lock(backend *be) { - LDAPDebug(LDAP_DEBUG_TRACE, "vlv_acquire_lock - Trying to acquire the lock\n", 0, 0, 0); + slapi_log_err(SLAPI_LOG_TRACE, "vlv_acquire_lock", "Trying to acquire the lock\n"); slapi_rwlock_wrlock(be->vlvSearchList_lock); } void vlv_release_lock(backend *be) { - LDAPDebug(LDAP_DEBUG_TRACE, "vlv_release_lock - Trying to release the lock\n", 0, 0, 0); + slapi_log_err(SLAPI_LOG_TRACE, "vlv_release_lock", "Trying to release the lock\n"); slapi_rwlock_unlock(be->vlvSearchList_lock); } diff --git a/ldap/servers/slapd/back-ldbm/vlv_srch.c b/ldap/servers/slapd/back-ldbm/vlv_srch.c index 8a995f3..5bdf4f7 100644 --- a/ldap/servers/slapd/back-ldbm/vlv_srch.c +++ b/ldap/servers/slapd/back-ldbm/vlv_srch.c @@ -896,7 +896,7 @@ vlvIndex_createfilename(struct vlvIndex* pIndex, char **ppc) *p= '\0'; if(strlen(filename)==0) { - LDAPDebug(LDAP_DEBUG_ERR, "vlvIndex_createfilename - Couldn't generate valid filename from Virtual List View Index Name (%s). Need some alphabetical characters.\n", pIndex->vlv_name, 0, 0); + slapi_log_err(SLAPI_LOG_ERR, "vlvIndex_createfilename - Couldn't generate valid filename from Virtual List View Index Name (%s). Need some alphabetical characters.\n", pIndex->vlv_name, 0, 0); filenameValid= 0; } /* JCM: Check if this file clashes with another VLV Index filename */ diff --git a/ldap/servers/slapd/back-ldif/add.c b/ldap/servers/slapd/back-ldif/add.c index 17abf9e..e107515 100644 --- a/ldap/servers/slapd/back-ldif/add.c +++ b/ldap/servers/slapd/back-ldif/add.c @@ -46,7 +46,7 @@ ldif_back_add( Slapi_PBlock *pb ) tprev = NULL; /*Turn on tracing to see this printed out*/ - LDAPDebug(LDAP_DEBUG_TRACE, "=> ldif_back_add\n", 0, 0, 0 ); + slapi_log_err(SLAPI_LOG_TRACE, "=> ldif_back_add\n", 0, 0, 0 ); /*Get the database, the dn and the entry to add*/ if (slapi_pblock_get( pb, SLAPI_PLUGIN_PRIVATE, &db ) < 0 || @@ -58,14 +58,14 @@ ldif_back_add( Slapi_PBlock *pb ) /*Check to make sure the entry passes the schema check*/ if ( slapi_entry_schema_check( pb, e ) != 0 ) { - LDAPDebug(LDAP_DEBUG_TRACE, "entry failed schema check\n", 0, 0, 0 ); + slapi_log_err(SLAPI_LOG_TRACE, "entry failed schema check\n", 0, 0, 0 ); slapi_send_ldap_result( pb, LDAP_OBJECT_CLASS_VIOLATION, NULL, NULL, 0, NULL ); return( -1 ); } /* Check if the attribute values in the entry obey the syntaxes */ if ( slapi_entry_syntax_check( pb, e, 0 ) != 0 ) { - LDAPDebug(LDAP_DEBUG_TRACE, "entry failed syntax_check\n", 0, 0, 0 ); + slapi_log_err(SLAPI_LOG_TRACE, "entry failed syntax_check\n", 0, 0, 0 ); slapi_send_ldap_result( pb, LDAP_INVALID_SYNTAX, NULL, NULL, 0, NULL ); return( -1 ); } @@ -102,12 +102,12 @@ ldif_back_add( Slapi_PBlock *pb ) int rc; if ((old = (ldif_Entry *)ldif_find_entry( pb, db, parentdn, &tprev)) == NULL ) { slapi_send_ldap_result( pb, LDAP_NO_SUCH_OBJECT, NULL, NULL, 0, NULL ); - LDAPDebug(LDAP_DEBUG_TRACE, "parent does not exist\n", 0, 0, 0 ); + slapi_log_err(SLAPI_LOG_TRACE, "parent does not exist\n", 0, 0, 0 ); goto error_return; } rc= slapi_access_allowed( pb, e, NULL, NULL, SLAPI_ACL_ADD ); if ( rc!=LDAP_SUCCESS ) { - LDAPDebug(LDAP_DEBUG_TRACE, "no access to parent\n", 0,0, 0 ); + slapi_log_err(SLAPI_LOG_TRACE, "no access to parent\n", 0,0, 0 ); slapi_send_ldap_result( pb, rc, NULL, NULL, 0, NULL ); goto error_return; } @@ -115,7 +115,7 @@ ldif_back_add( Slapi_PBlock *pb ) int isroot; slapi_pblock_get( pb, SLAPI_REQUESTOR_ISROOT, &isroot ); if ( !isroot ) { - LDAPDebug(LDAP_DEBUG_TRACE, "no parent & not root\n", 0, 0, 0 ); + slapi_log_err(SLAPI_LOG_TRACE, "no parent & not root\n", 0, 0, 0 ); slapi_send_ldap_result( pb, LDAP_INSUFFICIENT_ACCESS, NULL, NULL, 0, NULL ); goto error_return; } @@ -159,7 +159,7 @@ ldif_back_add( Slapi_PBlock *pb ) if ( parentdn != NULL ){ free( (void *)parentdn ); } - LDAPDebug(LDAP_DEBUG_TRACE, "<= ldif_back_add\n", 0, 0, 0 ); + slapi_log_err(SLAPI_LOG_TRACE, "<= ldif_back_add\n", 0, 0, 0 ); return( 0 ); error_return:; diff --git a/ldap/servers/slapd/back-ldif/back-ldif.h b/ldap/servers/slapd/back-ldif/back-ldif.h index d6a812c..3d64fba 100644 --- a/ldap/servers/slapd/back-ldif/back-ldif.h +++ b/ldap/servers/slapd/back-ldif/back-ldif.h @@ -22,7 +22,6 @@ #include #include #include "prlock.h" -#include "ldaplog.h" #include "portable.h" #include "slap.h" #include diff --git a/ldap/servers/slapd/back-ldif/bind.c b/ldap/servers/slapd/back-ldif/bind.c index 422913c..06a0049 100644 --- a/ldap/servers/slapd/back-ldif/bind.c +++ b/ldap/servers/slapd/back-ldif/bind.c @@ -41,7 +41,7 @@ ldif_back_bind( Slapi_PBlock *pb ) int rc, syntax; /*Storage for error return values*/ Slapi_Attr *attr; - LDAPDebug(LDAP_DEBUG_TRACE, "=> ldif_back_bind\n", 0, 0, 0 ); + slapi_log_err(SLAPI_LOG_TRACE, "=> ldif_back_bind\n", 0, 0, 0 ); prev = NULL; @@ -109,7 +109,7 @@ ldif_back_bind( Slapi_PBlock *pb ) PR_Unlock( db->ldif_lock ); - LDAPDebug(LDAP_DEBUG_TRACE, "<= ldif_back_bind\n", 0, 0, 0 ); + slapi_log_err(SLAPI_LOG_TRACE, "<= ldif_back_bind\n", 0, 0, 0 ); /* success: front end will send result */ return( SLAPI_BIND_SUCCESS ); diff --git a/ldap/servers/slapd/back-ldif/close.c b/ldap/servers/slapd/back-ldif/close.c index 2989889..64402e6 100644 --- a/ldap/servers/slapd/back-ldif/close.c +++ b/ldap/servers/slapd/back-ldif/close.c @@ -63,10 +63,10 @@ ldif_back_close( Slapi_PBlock *pb ) { LDIF *db; - LDAPDebug(LDAP_DEBUG_TRACE, "ldif backend syncing\n", 0, 0, 0 ); + slapi_log_err(SLAPI_LOG_TRACE, "ldif backend syncing\n", 0, 0, 0 ); slapi_pblock_get( pb, SLAPI_PLUGIN_PRIVATE, &db ); ldif_free_db(db); - LDAPDebug(LDAP_DEBUG_TRACE, "ldif backend done syncing\n", 0, 0, 0 ); + slapi_log_err(SLAPI_LOG_TRACE, "ldif backend done syncing\n", 0, 0, 0 ); } /* @@ -79,8 +79,8 @@ ldif_back_close( Slapi_PBlock *pb ) void ldif_back_flush( Slapi_PBlock *pb ) { - LDAPDebug(LDAP_DEBUG_TRACE, "ldif backend flushing\n", 0, 0, 0 ); - LDAPDebug(LDAP_DEBUG_TRACE, "ldif backend done flushing\n", 0, 0, 0 ); + slapi_log_err(SLAPI_LOG_TRACE, "ldif backend flushing\n", 0, 0, 0 ); + slapi_log_err(SLAPI_LOG_TRACE, "ldif backend done flushing\n", 0, 0, 0 ); return; } diff --git a/ldap/servers/slapd/back-ldif/compare.c b/ldap/servers/slapd/back-ldif/compare.c index 76b7d14..51c362e 100644 --- a/ldap/servers/slapd/back-ldif/compare.c +++ b/ldap/servers/slapd/back-ldif/compare.c @@ -39,7 +39,7 @@ ldif_back_compare( Slapi_PBlock *pb ) Slapi_Attr *attr; int rc; - LDAPDebug(LDAP_DEBUG_TRACE, "=> ldif_back_compare\n", 0, 0, 0 ); + slapi_log_err(SLAPI_LOG_TRACE, "=> ldif_back_compare\n", 0, 0, 0 ); prev = NULL; if (slapi_pblock_get( pb, SLAPI_PLUGIN_PRIVATE, &db ) < 0 || @@ -84,7 +84,7 @@ ldif_back_compare( Slapi_PBlock *pb ) slapi_send_ldap_result( pb, LDAP_COMPARE_FALSE, NULL, NULL, 0, NULL ); PR_Unlock( db->ldif_lock ); - LDAPDebug(LDAP_DEBUG_TRACE, "<= ldif_back_compare\n", 0, 0, 0 ); + slapi_log_err(SLAPI_LOG_TRACE, "<= ldif_back_compare\n", 0, 0, 0 ); return( 0 ); } diff --git a/ldap/servers/slapd/back-ldif/config.c b/ldap/servers/slapd/back-ldif/config.c index bf5738d..f656f54 100644 --- a/ldap/servers/slapd/back-ldif/config.c +++ b/ldap/servers/slapd/back-ldif/config.c @@ -51,7 +51,7 @@ ldif_back_config( Slapi_PBlock *pb ) Slapi_Entry *tmp; /*Used for initialization purposes*/ - LDAPDebug(LDAP_DEBUG_TRACE, "=> ldif_back_config\n", 0, 0, 0 ); + slapi_log_err(SLAPI_LOG_TRACE, "=> ldif_back_config\n", 0, 0, 0 ); /* * Get the private_info structure you created in ldif_back_init(). @@ -63,7 +63,7 @@ ldif_back_config( Slapi_PBlock *pb ) slapi_pblock_get( pb, SLAPI_CONFIG_LINENO, &lineno ) < 0 || slapi_pblock_get( pb, SLAPI_CONFIG_ARGC, &argc ) < 0 || slapi_pblock_get( pb, SLAPI_CONFIG_ARGV, &argv ) < 0 ){ - LDAPDebug(LDAP_DEBUG_ERR, "Ldif Backend: unable to get data from front end\n", 0, 0, 0); + slapi_log_err(SLAPI_LOG_ERR, "Ldif Backend: unable to get data from front end\n", 0, 0, 0); return(-1); } @@ -80,14 +80,14 @@ ldif_back_config( Slapi_PBlock *pb ) /*Check for the correct number of arguments*/ if (argc != 2){ - LDAPDebug(LDAP_DEBUG_ERR, "Ldif Backend: Unable to configure; invalid ldif input file specification line format (file: %s, line: %d)\n", + slapi_log_err(SLAPI_LOG_ERR, "Ldif Backend: Unable to configure; invalid ldif input file specification line format (file: %s, line: %d)\n", fname, lineno, 0); return(-1); } /*Check for the right format*/ if (strcmp(argv[0], "file") != 0){ - LDAPDebug(LDAP_DEBUG_ERR, "Ldif Backend: unable to configure; invalid parameter \"%s\" in config file (file: %s, line: %d)\n", + slapi_log_err(SLAPI_LOG_ERR, "Ldif Backend: unable to configure; invalid parameter \"%s\" in config file (file: %s, line: %d)\n", argv[0], fname, lineno ); return(-1); } @@ -95,10 +95,10 @@ ldif_back_config( Slapi_PBlock *pb ) /*Now we fopen the file and grab up the contents*/ fp = fopen (argv[1], "r"); if (fp == NULL){ - LDAPDebug(LDAP_DEBUG_ERR, "Ldif Backend: unable to read ldif file %s\n", argv[1], 0, 0); + slapi_log_err(SLAPI_LOG_ERR, "Ldif Backend: unable to read ldif file %s\n", argv[1], 0, 0); fp = fopen (argv[1], "w"); if(fp == NULL){ - LDAPDebug(LDAP_DEBUG_ERR, "Ldif Backend: unable to create ldif file %s\n", argv[1], 0, 0); + slapi_log_err(SLAPI_LOG_ERR, "Ldif Backend: unable to create ldif file %s\n", argv[1], 0, 0); return -1; } } @@ -110,7 +110,7 @@ ldif_back_config( Slapi_PBlock *pb ) /*Save the filename, for modifications to the file later*/ if ((db->ldif_file = strdup(argv[1])) == NULL){ - LDAPDebug(LDAP_DEBUG_ERR, "Ldif Backend: out of memory\n", 0, 0, 0); + slapi_log_err(SLAPI_LOG_ERR, "Ldif Backend: out of memory\n", 0, 0, 0); PR_Unlock( db->ldif_lock ); fclose(fp); return(-1); @@ -127,7 +127,7 @@ ldif_back_config( Slapi_PBlock *pb ) SLAPI_STR2ENTRY_NOT_WELL_FORMED_LDIF); new = (ldif_Entry *) ldifentry_init(tmp); if (new == NULL){ - LDAPDebug(LDAP_DEBUG_ERR, "Ldif Backend: unable to read in ldif file; out of memory\n",0 ,0 ,0 ); + slapi_log_err(SLAPI_LOG_ERR, "Ldif Backend: unable to read in ldif file; out of memory\n",0 ,0 ,0 ); PR_Unlock( db->ldif_lock ); fclose(fp); return(-1); @@ -159,7 +159,7 @@ ldif_back_config( Slapi_PBlock *pb ) PR_Unlock( db->ldif_lock ); fclose(fp); - LDAPDebug(LDAP_DEBUG_TRACE, "<= ldif_back_config\n", 0, 0, 0 ); + slapi_log_err(SLAPI_LOG_TRACE, "<= ldif_back_config\n", 0, 0, 0 ); return( 0 ); } diff --git a/ldap/servers/slapd/back-ldif/delete.c b/ldap/servers/slapd/back-ldif/delete.c index 265d67f..6b7e36a 100644 --- a/ldap/servers/slapd/back-ldif/delete.c +++ b/ldap/servers/slapd/back-ldif/delete.c @@ -38,7 +38,7 @@ ldif_back_delete( Slapi_PBlock *pb ) char *dn; /*Storage for the dn*/ int rc; - LDAPDebug(LDAP_DEBUG_TRACE, "=> ldif_back_delete\n", 0, 0, 0 ); + slapi_log_err(SLAPI_LOG_TRACE, "=> ldif_back_delete\n", 0, 0, 0 ); prev = NULL; @@ -56,7 +56,7 @@ ldif_back_delete( Slapi_PBlock *pb ) bye = (ldif_Entry *) ldif_find_entry(pb, db, dn, &prev); if (bye == NULL) { slapi_send_ldap_result( pb, LDAP_NO_SUCH_OBJECT, NULL, NULL, 0, NULL ); - LDAPDebug(LDAP_DEBUG_TRACE, "entry for delete does not exist\n", 0, 0, 0 ); + slapi_log_err(SLAPI_LOG_TRACE, "entry for delete does not exist\n", 0, 0, 0 ); PR_Unlock( db->ldif_lock ); return(-1); } @@ -87,7 +87,7 @@ ldif_back_delete( Slapi_PBlock *pb ) /*Success*/ slapi_send_ldap_result( pb, LDAP_SUCCESS, NULL, NULL, 0, NULL ); PR_Unlock( db->ldif_lock ); - LDAPDebug(LDAP_DEBUG_TRACE, "<= ldif_back_delete\n", 0, 0, 0 ); + slapi_log_err(SLAPI_LOG_TRACE, "<= ldif_back_delete\n", 0, 0, 0 ); return( 0 ); } @@ -106,7 +106,7 @@ has_children(LDIF *db, ldif_Entry *p) ldif_Entry *cur; /*Used to walk down the list*/ int has_kid = 0; /*Flag to return*/ - LDAPDebug(LDAP_DEBUG_TRACE, "=> has_children\n", 0, 0, 0); + slapi_log_err(SLAPI_LOG_TRACE, "=> has_children\n", 0, 0, 0); /*If there is no p or db, then there can be no children*/ if (p == NULL || db == NULL){ @@ -135,7 +135,7 @@ has_children(LDIF *db, ldif_Entry *p) free( (void *) parentdn ); - LDAPDebug(LDAP_DEBUG_TRACE, "<= has_children %d\n", has_kid, 0, 0); + slapi_log_err(SLAPI_LOG_TRACE, "<= has_children %d\n", has_kid, 0, 0); return( has_kid ); } diff --git a/ldap/servers/slapd/back-ldif/init.c b/ldap/servers/slapd/back-ldif/init.c index ef3bcdf..1cd5064 100644 --- a/ldap/servers/slapd/back-ldif/init.c +++ b/ldap/servers/slapd/back-ldif/init.c @@ -39,7 +39,7 @@ ldif_back_init( Slapi_PBlock *pb ) LDIF *db; /*This will hold the ldif file in memory*/ int rc; - LDAPDebug(LDAP_DEBUG_TRACE, "=> ldif_back_init\n", 0, 0, 0 ); + slapi_log_err(SLAPI_LOG_TRACE, "=> ldif_back_init\n", 0, 0, 0 ); /* * Allocate and initialize db with everything we @@ -52,7 +52,7 @@ ldif_back_init( Slapi_PBlock *pb ) /*Allocate memory for our database and check if success*/ db = (LDIF *) malloc( sizeof(LDIF) ); if (db == NULL) { - LDAPDebug(LDAP_DEBUG_ERR, "Ldif Backend: unable to initialize; out of memory\n", 0, 0, 0); + slapi_log_err(SLAPI_LOG_ERR, "Ldif Backend: unable to initialize; out of memory\n", 0, 0, 0); return(-1); } @@ -64,7 +64,7 @@ ldif_back_init( Slapi_PBlock *pb ) db->ldif_file = NULL; db->ldif_lock = PR_NewLock(); if (&db->ldif_lock == NULL) { - LDAPDebug(LDAP_DEBUG_ERR, "Ldif Backend: Lock creation failed\n", 0, 0, 0); + slapi_log_err(SLAPI_LOG_ERR, "Ldif Backend: Lock creation failed\n", 0, 0, 0); return(-1); } @@ -102,11 +102,11 @@ ldif_back_init( Slapi_PBlock *pb ) rc |= slapi_pblock_set( pb, SLAPI_PLUGIN_START_FN, (void *) ldif_back_start ); if (rc != 0) { - LDAPDebug(LDAP_DEBUG_ERR, "Ldif Backend: unable to pass database information to front end\n",0 ,0 ,0); + slapi_log_err(SLAPI_LOG_ERR, "Ldif Backend: unable to pass database information to front end\n",0 ,0 ,0); return(-1); } - LDAPDebug(LDAP_DEBUG_TRACE, "<= ldif_back_init\n", 0, 0, 0 ); + slapi_log_err(SLAPI_LOG_TRACE, "<= ldif_back_init\n", 0, 0, 0 ); return( 0 ); } diff --git a/ldap/servers/slapd/back-ldif/modify.c b/ldap/servers/slapd/back-ldif/modify.c index eb98d85..a9f9c76 100644 --- a/ldap/servers/slapd/back-ldif/modify.c +++ b/ldap/servers/slapd/back-ldif/modify.c @@ -53,7 +53,7 @@ ldif_back_modify( Slapi_PBlock *pb ) char *dn; /*Storage for the dn*/ char *errbuf = NULL; /* To get error back */ - LDAPDebug(LDAP_DEBUG_TRACE, "=> ldif_back_modify\n", 0, 0, 0 ); + slapi_log_err(SLAPI_LOG_TRACE, "=> ldif_back_modify\n", 0, 0, 0 ); prev = NULL; /*Get the database, the dn and the mods*/ @@ -134,7 +134,7 @@ ldif_back_modify( Slapi_PBlock *pb ) slapi_send_ldap_result( pb, LDAP_SUCCESS, NULL, NULL, 0, NULL ); PR_Unlock( db->ldif_lock ); - LDAPDebug(LDAP_DEBUG_TRACE, "<= ldif_back_modify\n", 0, 0, 0 ); + slapi_log_err(SLAPI_LOG_TRACE, "<= ldif_back_modify\n", 0, 0, 0 ); return( 0 ); error_return:; @@ -528,27 +528,27 @@ apply_mods( Slapi_Entry *e, LDAPMod **mods ) { int err, i, j; - LDAPDebug(LDAP_DEBUG_TRACE, "=> apply_mods\n", 0, 0, 0 ); + slapi_log_err(SLAPI_LOG_TRACE, "=> apply_mods\n", 0, 0, 0 ); err = LDAP_SUCCESS; for ( j = 0; (mods != NULL) && (mods[j] != NULL); j++ ) { switch ( mods[j]->mod_op & ~LDAP_MOD_BVALUES ) { case LDAP_MOD_ADD: - LDAPDebug(LDAP_DEBUG_ARGS, " add: %s\n", + slapi_log_err(SLAPI_LOG_ARGS, " add: %s\n", mods[j]->mod_type, 0, 0 ); err = slapi_entry_add_values( e, mods[j]->mod_type, mods[j]->mod_bvalues ); break; case LDAP_MOD_DELETE: - LDAPDebug(LDAP_DEBUG_ARGS, " delete: %s\n", + slapi_log_err(SLAPI_LOG_ARGS, " delete: %s\n", mods[j]->mod_type, 0, 0 ); err = slapi_entry_delete_values( e, mods[j]->mod_type, mods[j]->mod_bvalues ); break; case LDAP_MOD_REPLACE: - LDAPDebug(LDAP_DEBUG_ARGS, " replace: %s\n", + slapi_log_err(SLAPI_LOG_ARGS, " replace: %s\n", mods[j]->mod_type, 0, 0 ); err = entry_replace_values( e, mods[j]->mod_type, mods[j]->mod_bvalues ); @@ -556,17 +556,17 @@ apply_mods( Slapi_Entry *e, LDAPMod **mods ) } for ( i = 0; mods[j]->mod_bvalues != NULL && mods[j]->mod_bvalues[i] != NULL; i++ ) { - LDAPDebug(LDAP_DEBUG_ARGS, " %s: %s\n", + slapi_log_err(SLAPI_LOG_ARGS, " %s: %s\n", mods[j]->mod_type, mods[j]->mod_bvalues[i]->bv_val, 0 ); } - LDAPDebug(LDAP_DEBUG_ARGS, " -\n", 0, 0, 0 ); + slapi_log_err(SLAPI_LOG_ARGS, " -\n", 0, 0, 0 ); if ( err != LDAP_SUCCESS ) { break; } } - LDAPDebug(LDAP_DEBUG_TRACE, "<= apply_mods %d\n", err, 0, 0 ); + slapi_log_err(SLAPI_LOG_TRACE, "<= apply_mods %d\n", err, 0, 0 ); return( err ); } diff --git a/ldap/servers/slapd/back-ldif/modrdn.c b/ldap/servers/slapd/back-ldif/modrdn.c index ec97631..0e53ede 100644 --- a/ldap/servers/slapd/back-ldif/modrdn.c +++ b/ldap/servers/slapd/back-ldif/modrdn.c @@ -48,7 +48,7 @@ ldif_back_modrdn( Slapi_PBlock *pb ) LDAPMod **mods; /*Holds the list of modifications*/ int rc; - LDAPDebug(LDAP_DEBUG_TRACE, "=> ldif_back_modrdn\n", 0, 0, 0 ); + slapi_log_err(SLAPI_LOG_TRACE, "=> ldif_back_modrdn\n", 0, 0, 0 ); prev = NULL; @@ -106,7 +106,7 @@ ldif_back_modrdn( Slapi_PBlock *pb ) /* parent + rdn + separator(s) + null */ newdn = (char *) malloc( strlen( pdn ) + strlen( newrdn ) + 3 ); if (newdn == NULL){ - LDAPDebug(LDAP_DEBUG_ERR,"malloc failed", 0, 0, 0 ); + slapi_log_err(SLAPI_LOG_ERR,"malloc failed", 0, 0, 0 ); exit(1); } @@ -197,7 +197,7 @@ ldif_back_modrdn( Slapi_PBlock *pb ) /*Unlock the database, and tell the user the good news*/ PR_Unlock( db->ldif_lock ); slapi_send_ldap_result( pb, LDAP_SUCCESS, NULL, NULL, 0, NULL ); - LDAPDebug(LDAP_DEBUG_TRACE, "<= ldif_back_modrdn\n", 0, 0, 0 ); + slapi_log_err(SLAPI_LOG_TRACE, "<= ldif_back_modrdn\n", 0, 0, 0 ); return( 0 ); error_return:; @@ -254,19 +254,19 @@ ldif_add_mod( LDAPMod ***modlist, int modtype, char *type, struct berval **bvps (i + 2) * sizeof(LDAPMod *) ); if (*modlist == NULL){ - LDAPDebug(LDAP_DEBUG_ERR, "realloc failed", 0, 0, 0 ); + slapi_log_err(SLAPI_LOG_ERR, "realloc failed", 0, 0, 0 ); exit(1); } (*modlist)[i] = (LDAPMod *) malloc( sizeof(LDAPMod) ); if ((*modlist)[i] == NULL){ - LDAPDebug(LDAP_DEBUG_ERR,"malloc failed", 0, 0, 0 ); + slapi_log_err(SLAPI_LOG_ERR,"malloc failed", 0, 0, 0 ); exit(1); } (*modlist)[i]->mod_type = (char *) strdup( type ); if ((*modlist)[i]->mod_type == NULL){ - LDAPDebug(LDAP_DEBUG_ERR,"strdup failed", 0, 0, 0 ); + slapi_log_err(SLAPI_LOG_ERR,"strdup failed", 0, 0, 0 ); exit(1); } @@ -274,7 +274,7 @@ ldif_add_mod( LDAPMod ***modlist, int modtype, char *type, struct berval **bvps (*modlist)[i]->mod_op = modtype; (*modlist)[i]->mod_bvalues = (struct berval **) malloc(2*sizeof(struct berval *)); if ((*modlist)[i]->mod_bvalues == NULL){ - LDAPDebug(LDAP_DEBUG_ERR,"malloc failed",0, 0, 0 ); + slapi_log_err(SLAPI_LOG_ERR,"malloc failed",0, 0, 0 ); exit(1); } (*modlist)[i]->mod_bvalues[0] = ber_bvdup( bvps[0] ); diff --git a/ldap/servers/slapd/back-ldif/search.c b/ldap/servers/slapd/back-ldif/search.c index 4b2af56..1cb2a40 100644 --- a/ldap/servers/slapd/back-ldif/search.c +++ b/ldap/servers/slapd/back-ldif/search.c @@ -50,7 +50,7 @@ ldif_back_search( Slapi_PBlock *pb ) char *freeme; /*Tmp storage for monitordn*/ time_t currtime; /*The current time*/ - LDAPDebug(LDAP_DEBUG_TRACE, "=> ldif_back_search\n", 0, 0, 0 ); + slapi_log_err(SLAPI_LOG_TRACE, "=> ldif_back_search\n", 0, 0, 0 ); /* * Get private information created in the init routine. @@ -199,7 +199,7 @@ ldif_back_search( Slapi_PBlock *pb ) /* Search is done, send LDAP_SUCCESS */ slapi_send_ldap_result( pb, LDAP_SUCCESS, NULL, NULL, nentries, NULL ); PR_Unlock( db->ldif_lock ); - LDAPDebug(LDAP_DEBUG_TRACE, "<= ldif_back_search\n", 0, 0, 0 ); + slapi_log_err(SLAPI_LOG_TRACE, "<= ldif_back_search\n", 0, 0, 0 ); return( -1 ); } diff --git a/ldap/servers/slapd/backend.c b/ldap/servers/slapd/backend.c index dcdd827..58dafd4 100644 --- a/ldap/servers/slapd/backend.c +++ b/ldap/servers/slapd/backend.c @@ -29,22 +29,22 @@ be_init( Slapi_Backend *be, const char *type, const char *name, int isprivate, i be->be_basedn = slapi_create_dn_string("cn=%s,cn=%s,cn=plugins,cn=config", name, type); if (NULL == be->be_basedn) { - LDAPDebug2Args(LDAP_DEBUG_ERR, - "be_init - Failed create instance dn for plugin %s, " + slapi_log_err(SLAPI_LOG_ERR, + "be_init", "Failed create instance dn for plugin %s, " "instance %s\n", type, name); } be->be_configdn = slapi_create_dn_string("cn=config,cn=%s,cn=%s,cn=plugins,cn=config", name, type); if (NULL == be->be_configdn) { - LDAPDebug2Args(LDAP_DEBUG_ERR, - "be_init - Failed create instance config dn for " + slapi_log_err(SLAPI_LOG_ERR, + "be_init", "Failed create instance config dn for " "plugin %s, instance %s\n", type, name); } be->be_monitordn = slapi_create_dn_string("cn=monitor,cn=%s,cn=%s,cn=plugins,cn=config", name, type); if (NULL == be->be_configdn) { - LDAPDebug2Args(LDAP_DEBUG_ERR, - "be_init - Failed create instance monitor dn for " + slapi_log_err(SLAPI_LOG_ERR, + "be_init", "Failed create instance monitor dn for " "plugin %s, instance %s\n", type, name); } be->be_sizelimit = sizelimit; @@ -465,7 +465,7 @@ slapi_be_getentrypoint(Slapi_Backend *be, int entrypoint, void **ret_fnptr, Slap *ret_fnptr = (void*)be->be_cleanup; break; default: - slapi_log_error(SLAPI_LOG_ERR, "slapi_be_getentrypoint", + slapi_log_err(SLAPI_LOG_ERR, "slapi_be_getentrypoint", "Unknown entry point %d\n", entrypoint); return -1; } @@ -576,7 +576,7 @@ slapi_be_setentrypoint(Slapi_Backend *be, int entrypoint, void *ret_fnptr, Slapi be->be_cleanup=(IFP)ret_fnptr; break; default: - slapi_log_error(SLAPI_LOG_ERR, "slapi_be_setentrypoint", + slapi_log_err(SLAPI_LOG_ERR, "slapi_be_setentrypoint", "Unknown entry point %d\n", entrypoint); return -1; } diff --git a/ldap/servers/slapd/backend_manager.c b/ldap/servers/slapd/backend_manager.c index bfd6196..c7ba5c2 100644 --- a/ldap/servers/slapd/backend_manager.c +++ b/ldap/servers/slapd/backend_manager.c @@ -52,7 +52,7 @@ slapi_be_new( const char *type, const char *name, int isprivate, int logchanges backends[i] = be; nbackends++; - slapi_log_error(SLAPI_LOG_TRACE, "slapi_be_new", + slapi_log_err(SLAPI_LOG_TRACE, "slapi_be_new", "Added new backend name [%s] type [%s] nbackends [%d]\n", name, type, nbackends); return( be ); @@ -155,8 +155,7 @@ slapi_get_next_backend (char *cookie) int i, last_be; if (cookie == NULL) { - LDAPDebug(LDAP_DEBUG_ARGS, "slapi_get_next_backend: NULL argument\n", - 0, 0, 0 ); + slapi_log_err(SLAPI_LOG_ARGS, "slapi_get_next_backend", "NULL argument\n"); return NULL; } @@ -164,8 +163,7 @@ slapi_get_next_backend (char *cookie) if ( last_be < 0 || last_be >= maxbackends) { - LDAPDebug(LDAP_DEBUG_ARGS, "slapi_get_next_backend: argument out of range\n", - 0, 0, 0 ); + slapi_log_err(SLAPI_LOG_ARGS, "slapi_get_next_backend", "argument out of range\n"); return NULL; } diff --git a/ldap/servers/slapd/bind.c b/ldap/servers/slapd/bind.c index a6de858..f5ef571 100644 --- a/ldap/servers/slapd/bind.c +++ b/ldap/servers/slapd/bind.c @@ -109,7 +109,7 @@ do_bind( Slapi_PBlock *pb ) int minssf_exclude_rootdse = 0; Slapi_DN *original_sdn = NULL; - LDAPDebug(LDAP_DEBUG_TRACE, "do_bind\n", 0, 0, 0 ); + slapi_log_err(SLAPI_LOG_TRACE, "do_bind", "=>\n"); /* * Parse the bind request. It looks like this: @@ -133,9 +133,8 @@ do_bind( Slapi_PBlock *pb ) ber_rc = ber_scanf( ber, "{iat", &version, &rawdn, &method ); if ( ber_rc == LBER_ERROR ) { - LDAPDebug(LDAP_DEBUG_ERR, - "do_bind - ber_scanf failed (op=Bind; params=Version,DN,Method)\n", - 0, 0, 0 ); + slapi_log_err(SLAPI_LOG_ERR,"do_bind", + "ber_scanf failed (op=Bind; params=Version,DN,Method)\n"); log_bind_access (pb, "???", method, version, saslmech, "decoding error"); send_ldap_result( pb, LDAP_PROTOCOL_ERROR, NULL, "decoding error", 0, NULL ); @@ -165,7 +164,7 @@ do_bind( Slapi_PBlock *pb ) slapi_sdn_free(&sdn); return; } - LDAPDebug(LDAP_DEBUG_TRACE, "do_bind - BIND dn=\"%s\" method=%" BERTAG_T " version=%d\n", + slapi_log_err(SLAPI_LOG_TRACE, "do_bind", "BIND dn=\"%s\" method=%" BERTAG_T " version=%d\n", dn?dn:"empty", method, version ); /* target spec is used to decide which plugins are applicable for the operation */ @@ -174,9 +173,8 @@ do_bind( Slapi_PBlock *pb ) switch ( method ) { case LDAP_AUTH_SASL: if ( version < LDAP_VERSION3 ) { - LDAPDebug(LDAP_DEBUG_ERR, - "do_bind - got SASL credentials from LDAPv2 client\n", - 0, 0, 0 ); + slapi_log_err(SLAPI_LOG_ERR,"do_bind", + "got SASL credentials from LDAPv2 client\n"); log_bind_access (pb, dn?dn:"empty", method, version, saslmech, "SASL credentials only in LDAPv3"); send_ldap_result( pb, LDAP_PROTOCOL_ERROR, NULL, "SASL credentials only in LDAPv3", 0, NULL ); @@ -205,7 +203,7 @@ do_bind( Slapi_PBlock *pb ) static char *kmsg = "LDAPv2-style kerberos authentication received " "on LDAPv3 connection."; - LDAPDebug(LDAP_DEBUG_ERR, kmsg, 0, 0, 0 ); + slapi_log_err(SLAPI_LOG_ERR, "do_bind", kmsg); log_bind_access (pb, dn?dn:"empty", method, version, saslmech, kmsg); send_ldap_result( pb, LDAP_PROTOCOL_ERROR, NULL, kmsg, 0, NULL ); @@ -225,9 +223,8 @@ do_bind( Slapi_PBlock *pb ) goto free_and_return; } if ( ber_rc == LBER_ERROR ) { - LDAPDebug(LDAP_DEBUG_ERR, - "do_bind - ber_scanf failed (op=Bind; params=Credentials)\n", - 0, 0, 0 ); + slapi_log_err(SLAPI_LOG_ERR,"do_bind", + "ber_scanf failed (op=Bind; params=Credentials)\n"); log_bind_access (pb, dn?dn:"empty", method, version, saslmech, "decoding error"); send_ldap_result( pb, LDAP_PROTOCOL_ERROR, NULL, "decoding error", 0, NULL ); @@ -324,14 +321,13 @@ do_bind( Slapi_PBlock *pb ) } break; default: - LDAPDebug(LDAP_DEBUG_TRACE, "do_bind - Unknown LDAP protocol version %d\n", - version, 0, 0 ); + slapi_log_err(SLAPI_LOG_TRACE, "do_bind", "Unknown LDAP protocol version %d\n", version); send_ldap_result( pb, LDAP_PROTOCOL_ERROR, NULL, "version not supported", 0, NULL ); goto free_and_return; } - LDAPDebug(LDAP_DEBUG_TRACE, "do_bind - version %d method 0x%x dn %s\n", + slapi_log_err(SLAPI_LOG_TRACE, "do_bind", "version %d method %lu dn %s\n", version, method, dn ); pb->pb_conn->c_ldapversion = version; @@ -564,13 +560,13 @@ do_bind( Slapi_PBlock *pb ) * or connections using SASL privacy layers */ conn = pb->pb_conn; if ( slapi_pblock_get(pb, SLAPI_CONN_SASL_SSF, &sasl_ssf) != 0) { - slapi_log_error(SLAPI_LOG_PLUGIN, "do_bind", + slapi_log_err(SLAPI_LOG_PLUGIN, "do_bind", "Could not get SASL SSF from connection\n" ); sasl_ssf = 0; } if ( slapi_pblock_get(pb, SLAPI_CONN_LOCAL_SSF, &local_ssf) != 0) { - slapi_log_error(SLAPI_LOG_PLUGIN, "do_bind", + slapi_log_err(SLAPI_LOG_PLUGIN, "do_bind", "Could not get local SSF from connection\n" ); local_ssf = 0; } diff --git a/ldap/servers/slapd/bulk_import.c b/ldap/servers/slapd/bulk_import.c index bf84cfb..14d2422 100644 --- a/ldap/servers/slapd/bulk_import.c +++ b/ldap/servers/slapd/bulk_import.c @@ -78,13 +78,13 @@ process_bulk_import_op (Slapi_PBlock *pb, int state, Slapi_Entry *e) if (pb == NULL) { - slapi_log_error(SLAPI_LOG_ERR, "process_bulk_import_op", "NULL pblock\n"); + slapi_log_err(SLAPI_LOG_ERR, "process_bulk_import_op", "NULL pblock\n"); return LDAP_OPERATIONS_ERROR; } if (state == SLAPI_BI_STATE_ADD && e == NULL) { - slapi_log_error(SLAPI_LOG_ERR, "process_bulk_import_op", "NULL entry\n"); + slapi_log_err(SLAPI_LOG_ERR, "process_bulk_import_op", "NULL entry\n"); return LDAP_OPERATIONS_ERROR; } @@ -100,7 +100,7 @@ process_bulk_import_op (Slapi_PBlock *pb, int state, Slapi_Entry *e) { slapi_pblock_get (pb, SLAPI_TARGET_SDN, &target_sdn); if (NULL == target_sdn) { - slapi_log_error(SLAPI_LOG_ERR, "process_bulk_import_op", + slapi_log_err(SLAPI_LOG_ERR, "process_bulk_import_op", "NULL target sdn\n"); return LDAP_OPERATIONS_ERROR; } @@ -111,7 +111,7 @@ process_bulk_import_op (Slapi_PBlock *pb, int state, Slapi_Entry *e) { if (state == SLAPI_BI_STATE_START && (!slapi_be_issuffix(be, target_sdn))) { - slapi_log_error(SLAPI_LOG_ERR, "process_bulk_import_op", + slapi_log_err(SLAPI_LOG_ERR, "process_bulk_import_op", "Wrong backend suffix\n"); return LDAP_OPERATIONS_ERROR; } @@ -119,14 +119,14 @@ process_bulk_import_op (Slapi_PBlock *pb, int state, Slapi_Entry *e) } else { - slapi_log_error(SLAPI_LOG_ERR, "process_bulk_import_op", "NULL backend\n"); + slapi_log_err(SLAPI_LOG_ERR, "process_bulk_import_op", "NULL backend\n"); return LDAP_OPERATIONS_ERROR; } } if (be->be_wire_import == NULL) { - slapi_log_error(SLAPI_LOG_ERR, "process_bulk_import_op", + slapi_log_err(SLAPI_LOG_ERR, "process_bulk_import_op", "Bulk import is not supported by this (%s) backend\n", be->be_type); return LDAP_NOT_SUPPORTED; @@ -142,7 +142,7 @@ process_bulk_import_op (Slapi_PBlock *pb, int state, Slapi_Entry *e) { /* The caller will free the entry (e), so we just * leave it alone here. */ - slapi_log_error(SLAPI_LOG_ERR, "process_bulk_import_op", + slapi_log_err(SLAPI_LOG_ERR, "process_bulk_import_op", "Failed; error = %d\n", rc); return LDAP_OPERATIONS_ERROR; } diff --git a/ldap/servers/slapd/ch_malloc.c b/ldap/servers/slapd/ch_malloc.c index dad7ece..443a785 100644 --- a/ldap/servers/slapd/ch_malloc.c +++ b/ldap/servers/slapd/ch_malloc.c @@ -71,7 +71,7 @@ create_counters(void) } /* called when we have just detected an out of memory condition, before - * we make any other library calls. Note that LDAPDebug() calls malloc, + * we make any other library calls. Note that slapi_log_err() calls malloc, * indirectly. By making 64KB free, we should be able to have a few * mallocs' succeed before we shut down. */ @@ -94,11 +94,11 @@ void oom_occurred(void) static void log_negative_alloc_msg( const char *op, const char *units, unsigned long size ) { - slapi_log_error(SLAPI_LOG_ERR, SLAPD_MODULE, - "cannot %s %lu %s;\n" - "trying to allocate 0 or a negative number of %s is not portable and\n" - "gives different results on different platforms.\n", - op, size, units, units ); + slapi_log_err(SLAPI_LOG_ERR, SLAPD_MODULE, + "cannot %s %lu %s;\n" + "trying to allocate 0 or a negative number of %s is not portable and\n" + "gives different results on different platforms.\n", + op, size, units, units ); } #if !defined(MEMPOOL_EXPERIMENTAL) @@ -107,27 +107,27 @@ slapi_ch_malloc( unsigned long size ) { - char *newmem; - - if (size <= 0) { - log_negative_alloc_msg( "malloc", "bytes", size ); - return 0; - } - - if ( (newmem = (char *) malloc( size )) == NULL ) { - int oserr = errno; - - oom_occurred(); - slapi_log_error(SLAPI_LOG_ERR, SLAPD_MODULE, - "malloc of %lu bytes failed; OS error %d (%s)%s\n", - size, oserr, slapd_system_strerror( oserr ), oom_advice ); - exit( 1 ); - } - if(!counters_created) - { - create_counters(); - counters_created= 1; - } + char *newmem; + + if (size <= 0) { + log_negative_alloc_msg( "malloc", "bytes", size ); + return 0; + } + + if ( (newmem = (char *) malloc( size )) == NULL ) { + int oserr = errno; + + oom_occurred(); + slapi_log_err(SLAPI_LOG_ERR, SLAPD_MODULE, + "malloc of %lu bytes failed; OS error %d (%s)%s\n", + size, oserr, slapd_system_strerror( oserr ), oom_advice ); + exit( 1 ); + } + if(!counters_created) + { + create_counters(); + counters_created= 1; + } PR_INCREMENT_COUNTER(slapi_ch_counter_malloc); PR_INCREMENT_COUNTER(slapi_ch_counter_created); PR_INCREMENT_COUNTER(slapi_ch_counter_exist); @@ -173,31 +173,31 @@ slapi_ch_realloc( unsigned long size ) { - char *newmem; - - if ( block == NULL ) { - return( slapi_ch_malloc( size ) ); - } - - if (size <= 0) { - log_negative_alloc_msg( "realloc", "bytes", size ); - return block; - } - - if ( (newmem = (char *) realloc( block, size )) == NULL ) { - int oserr = errno; - - oom_occurred(); - slapi_log_error(SLAPI_LOG_ERR, SLAPD_MODULE, - "realloc of %lu bytes failed; OS error %d (%s)%s\n", - size, oserr, slapd_system_strerror( oserr ), oom_advice ); - exit( 1 ); - } - if(!counters_created) - { - create_counters(); - counters_created= 1; - } + char *newmem; + + if ( block == NULL ) { + return( slapi_ch_malloc( size ) ); + } + + if (size <= 0) { + log_negative_alloc_msg( "realloc", "bytes", size ); + return block; + } + + if ( (newmem = (char *) realloc( block, size )) == NULL ) { + int oserr = errno; + + oom_occurred(); + slapi_log_err(SLAPI_LOG_ERR, SLAPD_MODULE, + "realloc of %lu bytes failed; OS error %d (%s)%s\n", + size, oserr, slapd_system_strerror( oserr ), oom_advice ); + exit( 1 ); + } + if(!counters_created) + { + create_counters(); + counters_created= 1; + } PR_INCREMENT_COUNTER(slapi_ch_counter_realloc); return( newmem ); @@ -209,32 +209,32 @@ slapi_ch_calloc( unsigned long size ) { - char *newmem; - - if (size <= 0) { - log_negative_alloc_msg( "calloc", "bytes", size ); - return 0; - } - - if (nelem <= 0) { - log_negative_alloc_msg( "calloc", "elements", nelem ); - return 0; - } - - if ( (newmem = (char *) calloc( nelem, size )) == NULL ) { - int oserr = errno; - - oom_occurred(); - slapi_log_error(SLAPI_LOG_ERR, SLAPD_MODULE, - "calloc of %lu elems of %lu bytes failed; OS error %d (%s)%s\n", - nelem, size, oserr, slapd_system_strerror( oserr ), oom_advice ); - exit( 1 ); - } - if(!counters_created) - { - create_counters(); - counters_created= 1; - } + char *newmem; + + if (size <= 0) { + log_negative_alloc_msg( "calloc", "bytes", size ); + return 0; + } + + if (nelem <= 0) { + log_negative_alloc_msg( "calloc", "elements", nelem ); + return 0; + } + + if ( (newmem = (char *) calloc( nelem, size )) == NULL ) { + int oserr = errno; + + oom_occurred(); + slapi_log_err(SLAPI_LOG_ERR, SLAPD_MODULE, + "calloc of %lu elems of %lu bytes failed; OS error %d (%s)%s\n", + nelem, size, oserr, slapd_system_strerror( oserr ), oom_advice ); + exit( 1 ); + } + if(!counters_created) + { + create_counters(); + counters_created= 1; + } PR_INCREMENT_COUNTER(slapi_ch_counter_calloc); PR_INCREMENT_COUNTER(slapi_ch_counter_created); PR_INCREMENT_COUNTER(slapi_ch_counter_exist); @@ -254,17 +254,11 @@ slapi_ch_strdup ( const char* s1) if (newmem == NULL) { int oserr = errno; oom_occurred(); - - slapi_log_error(SLAPI_LOG_ERR, SLAPD_MODULE, - "strdup of %lu characters failed; OS error %d (%s)%s\n", - (unsigned long)strlen(s1), oserr, slapd_system_strerror( oserr ), - oom_advice ); - exit (1); - } - if(!counters_created) - { - create_counters(); - counters_created= 1; + slapi_log_err(SLAPI_LOG_ERR, SLAPD_MODULE, + "strdup of %lu characters failed; OS error %d (%s)%s\n", + (unsigned long)strlen(s1), oserr, slapd_system_strerror( oserr ), + oom_advice ); + exit (1); } PR_INCREMENT_COUNTER(slapi_ch_counter_strdup); PR_INCREMENT_COUNTER(slapi_ch_counter_created); @@ -279,14 +273,14 @@ slapi_ch_bvdup (const struct berval* v) { struct berval* newberval = ber_bvdup ((struct berval *)v); if (newberval == NULL) { - int oserr = errno; - - oom_occurred(); - slapi_log_error(SLAPI_LOG_ERR, SLAPD_MODULE, - "ber_bvdup of %lu bytes failed; OS error %d (%s)%s\n", - (unsigned long)v->bv_len, oserr, slapd_system_strerror( oserr ), - oom_advice ); - exit( 1 ); + int oserr = errno; + + oom_occurred(); + slapi_log_err(SLAPI_LOG_ERR, SLAPD_MODULE, + "ber_bvdup of %lu bytes failed; OS error %d (%s)%s\n", + (unsigned long)v->bv_len, oserr, slapd_system_strerror( oserr ), + oom_advice ); + exit( 1 ); } return newberval; } diff --git a/ldap/servers/slapd/charray.c b/ldap/servers/slapd/charray.c index ac83685..5551dcc 100644 --- a/ldap/servers/slapd/charray.c +++ b/ldap/servers/slapd/charray.c @@ -462,7 +462,7 @@ charray_normdn_add(char ***chararray, char *dn, char *errstr) char *normdn = NULL; rc = slapi_dn_normalize_ext(dn, 0, &normdn, &len); if (rc < 0) { - LDAPDebug2Args(LDAP_DEBUG_ERR, "charray_normdn_add - Invalid dn: \"%s\" %s\n", + slapi_log_err(SLAPI_LOG_ERR, "charray_normdn_add - Invalid dn: \"%s\" %s\n", dn, errstr?errstr:""); return rc; } else if (0 == rc) { diff --git a/ldap/servers/slapd/compare.c b/ldap/servers/slapd/compare.c index 46360f8..07ded98 100644 --- a/ldap/servers/slapd/compare.c +++ b/ldap/servers/slapd/compare.c @@ -43,7 +43,7 @@ do_compare( Slapi_PBlock *pb ) Slapi_Entry *referral = NULL; char errorbuf[SLAPI_DSE_RETURNTEXT_SIZE]; - LDAPDebug(LDAP_DEBUG_TRACE, "do_compare\n", 0, 0, 0 ); + slapi_log_err(SLAPI_LOG_TRACE, "do_compare", "=>\n"); /* count the compare request */ slapi_counter_increment(g_get_global_snmp_vars()->ops_tbl.dsCompareOps); @@ -65,9 +65,8 @@ do_compare( Slapi_PBlock *pb ) if ( ber_scanf( ber, "{a{ao}}", &rawdn, &ava.ava_type, &ava.ava_value ) == LBER_ERROR ) { - LDAPDebug(LDAP_DEBUG_ERR, - "do_compare - ber_scanf failed (op=Compare; params=DN,Type,Value)\n", - 0, 0, 0 ); + slapi_log_err(SLAPI_LOG_ERR, + "do_compare", "ber_scanf failed (op=Compare; params=DN,Type,Value)\n"); send_ldap_result( pb, LDAP_PROTOCOL_ERROR, NULL, NULL, 0, NULL ); goto free_and_return; @@ -108,7 +107,7 @@ do_compare( Slapi_PBlock *pb ) /* target spec is used to decide which plugins are applicable for the operation */ operation_set_target_spec (pb->pb_op, &sdn); - LDAPDebug(LDAP_DEBUG_ARGS, "do_compare: dn (%s) attr (%s)\n", + slapi_log_err(SLAPI_LOG_ARGS, "do_compare: dn (%s) attr (%s)\n", rawdn, ava.ava_type, 0 ); slapi_log_access( LDAP_DEBUG_STATS, diff --git a/ldap/servers/slapd/config.c b/ldap/servers/slapd/config.c index ccd7b4b..73b5f80 100644 --- a/ldap/servers/slapd/config.c +++ b/ldap/servers/slapd/config.c @@ -83,7 +83,7 @@ entry_has_attr_and_value(Slapi_Entry *e, const char *attrname, } else { - slapi_log_error(SLAPI_LOG_ERR, "bootstrap config", + slapi_log_err(SLAPI_LOG_ERR, "bootstrap config", "Ignoring extremely large value for" " configuration attribute %s" " (length=%ld, value=%40.40s...)\n", @@ -129,7 +129,7 @@ slapd_bootstrap_config(const char *configdir) char tmpfile[MAXPATHLEN+1]; if (NULL == configdir) { - slapi_log_error(SLAPI_LOG_ERR, "slapd_bootstrap_config", + slapi_log_err(SLAPI_LOG_ERR, "slapd_bootstrap_config", "Passed null config directory\n"); return rc; /* Fail */ } @@ -146,7 +146,7 @@ slapd_bootstrap_config(const char *configdir) if ( (rc = PR_GetFileInfo64( configfile, &prfinfo )) != PR_SUCCESS ) { PRErrorCode prerr = PR_GetError(); - slapi_log_error(SLAPI_LOG_ERR, "slapd_bootstrap_config", + slapi_log_err(SLAPI_LOG_ERR, "slapd_bootstrap_config", "The given config file %s could not be accessed, " SLAPI_COMPONENT_NAME_NSPR " error %d (%s)\n", configfile, prerr, slapd_pr_strerror(prerr)); return rc; @@ -155,7 +155,7 @@ slapd_bootstrap_config(const char *configdir) SLAPD_DEFAULT_FILE_MODE )) == NULL ) { PRErrorCode prerr = PR_GetError(); - slapi_log_error(SLAPI_LOG_ERR, "slapd_bootstrap_config", + slapi_log_err(SLAPI_LOG_ERR, "slapd_bootstrap_config", "The given config file %s could not be opened for reading, " SLAPI_COMPONENT_NAME_NSPR " error %d (%s)\n", configfile, prerr, slapd_pr_strerror(prerr)); return rc; /* Fail */ @@ -166,7 +166,7 @@ slapd_bootstrap_config(const char *configdir) buf = slapi_ch_malloc( prfinfo.size + 1 ); if (( nr = slapi_read_buffer( prfd, buf, prfinfo.size )) < 0 ) { - slapi_log_error(SLAPI_LOG_ERR, "slapd_bootstrap_config", + slapi_log_err(SLAPI_LOG_ERR, "slapd_bootstrap_config", "Could only read %d of %ld bytes from config file %s\n", nr, (long int)prfinfo.size, configfile); rc = 0; /* Fail */ @@ -213,7 +213,7 @@ slapd_bootstrap_config(const char *configdir) SLAPI_STR2ENTRY_NOT_WELL_FORMED_LDIF); if (e == NULL) { - LDAPDebug(LDAP_DEBUG_ERR, "slapd_bootstrap_config - " + slapi_log_err(SLAPI_LOG_ERR, "slapd_bootstrap_config - " "The entry [%s] in the configfile %s was empty or could not be parsed\n", entrystr, configfile, 0); continue; @@ -228,7 +228,7 @@ slapd_bootstrap_config(const char *configdir) maxdescriptors, errorbuf, CONFIG_APPLY) != LDAP_SUCCESS) { - LDAPDebug(LDAP_DEBUG_ERR, "slapd_bootstrap_config - " + slapi_log_err(SLAPI_LOG_ERR, "slapd_bootstrap_config - " "%s: %s: %s\n", configfile, CONFIG_MAXDESCRIPTORS_ATTRIBUTE, errorbuf); } } @@ -244,7 +244,7 @@ slapd_bootstrap_config(const char *configdir) logenabled, SLAPD_ERROR_LOG, errorbuf, CONFIG_APPLY) != LDAP_SUCCESS) { - LDAPDebug(LDAP_DEBUG_ERR, "slapd_bootstrap_config - %s: %s: %s\n", + slapi_log_err(SLAPI_LOG_ERR, "slapd_bootstrap_config - %s: %s: %s\n", configfile, CONFIG_ERRORLOG_LOGGING_ENABLED_ATTRIBUTE, errorbuf); } } @@ -257,7 +257,7 @@ slapd_bootstrap_config(const char *configdir) if (config_set_localuser(CONFIG_LOCALUSER_ATTRIBUTE, _localuser, errorbuf, CONFIG_APPLY) != LDAP_SUCCESS) { - LDAPDebug(LDAP_DEBUG_ERR, "slapd_bootstrap_config - %s: %s: %s. \n", + slapi_log_err(SLAPI_LOG_ERR, "slapd_bootstrap_config - %s: %s: %s. \n", configfile, CONFIG_LOCALUSER_ATTRIBUTE, errorbuf); } } @@ -271,7 +271,7 @@ slapd_bootstrap_config(const char *configdir) if (config_set_errorlog(CONFIG_ERRORLOG_ATTRIBUTE, workpath, errorbuf, CONFIG_APPLY) != LDAP_SUCCESS) { - LDAPDebug(LDAP_DEBUG_ERR, "slapd_bootstrap_config - %s: %s: %s. \n", + slapi_log_err(SLAPI_LOG_ERR, "slapd_bootstrap_config - %s: %s: %s. \n", configfile, CONFIG_ERRORLOG_ATTRIBUTE, errorbuf); } } @@ -285,15 +285,14 @@ slapd_bootstrap_config(const char *configdir) if (config_set_errorlog_level(CONFIG_LOGLEVEL_ATTRIBUTE, loglevel, errorbuf, CONFIG_APPLY) != LDAP_SUCCESS) { - LDAPDebug(LDAP_DEBUG_ERR, "%s: %s: %s. \n", configfile, + slapi_log_err(SLAPI_LOG_ERR, "%s: %s: %s. \n", configfile, CONFIG_LOGLEVEL_ATTRIBUTE, errorbuf); } } else { - LDAPDebug(LDAP_DEBUG_ERR, - "slapd_bootstrap_config - %s: ignoring %s (since -d %d was given on " - "the command line)\n", + slapi_log_err(SLAPI_LOG_ERR, "slapd_bootstrap_config", + "%s: ignoring %s (since -d %d was given on the command line)\n", CONFIG_LOGLEVEL_ATTRIBUTE, loglevel, config_get_errorlog_level()); } } @@ -306,7 +305,7 @@ slapd_bootstrap_config(const char *configdir) if (config_set_certdir(CONFIG_CERTDIR_ATTRIBUTE, workpath, errorbuf, CONFIG_APPLY) != LDAP_SUCCESS) { - LDAPDebug(LDAP_DEBUG_ERR, "slapd_bootstrap_config - %s: %s: %s. \n", + slapi_log_err(SLAPI_LOG_ERR, "slapd_bootstrap_config", "%s: %s: %s. \n", configfile, CONFIG_CERTDIR_ATTRIBUTE, errorbuf); } } @@ -319,7 +318,7 @@ slapd_bootstrap_config(const char *configdir) if (config_set_saslpath(CONFIG_SASLPATH_ATTRIBUTE, workpath, errorbuf, CONFIG_APPLY) != LDAP_SUCCESS) { - LDAPDebug(LDAP_DEBUG_ERR, "slapd_bootstrap_config - %s: %s: %s. \n", + slapi_log_err(SLAPI_LOG_ERR, "slapd_bootstrap_config", "%s: %s: %s. \n", configfile, CONFIG_SASLPATH_ATTRIBUTE, errorbuf); } } @@ -332,7 +331,7 @@ slapd_bootstrap_config(const char *configdir) if (config_set_ldapi_filename(CONFIG_LDAPI_FILENAME_ATTRIBUTE, workpath, errorbuf, CONFIG_APPLY) != LDAP_SUCCESS) { - LDAPDebug(LDAP_DEBUG_ERR, "slapd_bootstrap_config - %s: %s: %s. \n", + slapi_log_err(SLAPI_LOG_ERR, "slapd_bootstrap_config", "%s: %s: %s. \n", configfile, CONFIG_LDAPI_FILENAME_ATTRIBUTE, errorbuf); } } @@ -345,7 +344,7 @@ slapd_bootstrap_config(const char *configdir) if (config_set_ldapi_switch(CONFIG_LDAPI_SWITCH_ATTRIBUTE, workpath, errorbuf, CONFIG_APPLY) != LDAP_SUCCESS) { - LDAPDebug(LDAP_DEBUG_ERR, "slapd_bootstrap_config - %s: %s: %s. \n", + slapi_log_err(SLAPI_LOG_ERR, "slapd_bootstrap_config", "%s: %s: %s. \n", configfile, CONFIG_LDAPI_SWITCH_ATTRIBUTE, errorbuf); } } @@ -364,8 +363,9 @@ slapd_bootstrap_config(const char *configdir) /* add the syntax/matching scheme rule plugin */ if (plugin_setup(e, 0, 0, 1, returntext)) { - LDAPDebug(LDAP_DEBUG_ERR, "slapd_bootstrap_config - The plugin entry [%s] in the configfile %s was invalid. %s\n", - slapi_entry_get_dn(e), configfile, returntext); + slapi_log_err(SLAPI_LOG_ERR, "slapd_bootstrap_config", + "The plugin entry [%s] in the configfile %s was invalid. %s\n", + slapi_entry_get_dn(e), configfile, returntext); rc = 0; slapi_sdn_done(&plug_dn); goto bail; @@ -386,8 +386,9 @@ slapd_bootstrap_config(const char *configdir) /* add the pwd storage scheme rule plugin */ if (plugin_setup(e, 0, 0, 1, returntext)) { - LDAPDebug(LDAP_DEBUG_ERR, "slapd_bootstrap_config - The plugin entry [%s] in the configfile %s was invalid. %s\n", - slapi_entry_get_dn(e), configfile, returntext); + slapi_log_err(SLAPI_LOG_ERR, "slapd_bootstrap_config", + "The plugin entry [%s] in the configfile %s was invalid. %s\n", + slapi_entry_get_dn(e), configfile, returntext); rc = 0; slapi_sdn_done(&plug_dn); goto bail; @@ -404,7 +405,7 @@ slapd_bootstrap_config(const char *configdir) schemacheck, errorbuf, CONFIG_APPLY) != LDAP_SUCCESS) { - LDAPDebug(LDAP_DEBUG_ERR, "slapd_bootstrap_config - %s: %s: %s\n", + slapi_log_err(SLAPI_LOG_ERR, "slapd_bootstrap_config", "%s: %s: %s\n", configfile, CONFIG_SCHEMACHECK_ATTRIBUTE, errorbuf); } } @@ -418,7 +419,7 @@ slapd_bootstrap_config(const char *configdir) plugintracking, errorbuf, CONFIG_APPLY) != LDAP_SUCCESS) { - LDAPDebug(LDAP_DEBUG_ERR, "slapd_bootstrap_config - %s: %s: %s\n", + slapi_log_err(SLAPI_LOG_ERR, "slapd_bootstrap_config", "%s: %s: %s\n", configfile, CONFIG_PLUGIN_BINDDN_TRACKING_ATTRIBUTE, errorbuf); } } @@ -432,7 +433,7 @@ slapd_bootstrap_config(const char *configdir) moddn_aci, errorbuf, CONFIG_APPLY) != LDAP_SUCCESS) { - LDAPDebug(LDAP_DEBUG_ERR, "slapd_bootstrap_config - %s: %s: %s\n", + slapi_log_err(SLAPI_LOG_ERR, "slapd_bootstrap_config", "%s: %s: %s\n", configfile, CONFIG_MODDN_ACI_ATTRIBUTE, errorbuf); } } @@ -446,7 +447,7 @@ slapd_bootstrap_config(const char *configdir) syntaxcheck, errorbuf, CONFIG_APPLY) != LDAP_SUCCESS) { - LDAPDebug(LDAP_DEBUG_ERR, "slapd_bootstrap_config - %s: %s: %s\n", + slapi_log_err(SLAPI_LOG_ERR, "slapd_bootstrap_config", "%s: %s: %s\n", configfile, CONFIG_SYNTAXCHECK_ATTRIBUTE, errorbuf); } } @@ -460,7 +461,7 @@ slapd_bootstrap_config(const char *configdir) syntaxlogging, errorbuf, CONFIG_APPLY) != LDAP_SUCCESS) { - LDAPDebug(LDAP_DEBUG_ERR, "slapd_bootstrap_config - %s: %s: %s\n", + slapi_log_err(SLAPI_LOG_ERR, "slapd_bootstrap_config", "%s: %s: %s\n", configfile, CONFIG_SYNTAXLOGGING_ATTRIBUTE, errorbuf); } } @@ -474,7 +475,7 @@ slapd_bootstrap_config(const char *configdir) dn_validate_strict, errorbuf, CONFIG_APPLY) != LDAP_SUCCESS) { - LDAPDebug(LDAP_DEBUG_ERR, "slapd_bootstrap_config - %s: %s: %s\n", + slapi_log_err(SLAPI_LOG_ERR, "slapd_bootstrap_config - %s: %s: %s\n", configfile, CONFIG_DN_VALIDATE_STRICT_ATTRIBUTE, errorbuf); } } @@ -487,7 +488,7 @@ slapd_bootstrap_config(const char *configdir) CONFIG_ENQUOTE_SUP_OC_ATTRIBUTE, val, errorbuf, CONFIG_APPLY) != LDAP_SUCCESS) { - LDAPDebug(LDAP_DEBUG_ERR, "slapd_bootstrap_config - %s: %s: %s\n", + slapi_log_err(SLAPI_LOG_ERR, "slapd_bootstrap_config", "%s: %s: %s\n", configfile, CONFIG_ENQUOTE_SUP_OC_ATTRIBUTE, errorbuf); } val[0] = 0; @@ -501,7 +502,7 @@ slapd_bootstrap_config(const char *configdir) CONFIG_RETURN_EXACT_CASE_ATTRIBUTE, val, errorbuf, CONFIG_APPLY) != LDAP_SUCCESS) { - LDAPDebug(LDAP_DEBUG_ERR, "slapd_bootstrap_config - %s: %s: %s\n", + slapi_log_err(SLAPI_LOG_ERR, "slapd_bootstrap_config", "%s: %s: %s\n", configfile, CONFIG_RETURN_EXACT_CASE_ATTRIBUTE, errorbuf); } val[0] = 0; @@ -516,7 +517,7 @@ slapd_bootstrap_config(const char *configdir) CONFIG_ATTRIBUTE_NAME_EXCEPTION_ATTRIBUTE, val, errorbuf, CONFIG_APPLY) != LDAP_SUCCESS) { - LDAPDebug(LDAP_DEBUG_ERR, "slapd_bootstrap_config - %s: %s: %s\n", + slapi_log_err(SLAPI_LOG_ERR, "slapd_bootstrap_config", "%s: %s: %s\n", configfile, CONFIG_ATTRIBUTE_NAME_EXCEPTION_ATTRIBUTE, errorbuf); } val[0] = 0; @@ -530,7 +531,7 @@ slapd_bootstrap_config(const char *configdir) CONFIG_DS4_COMPATIBLE_SCHEMA_ATTRIBUTE, val, errorbuf, CONFIG_APPLY) != LDAP_SUCCESS) { - LDAPDebug(LDAP_DEBUG_ERR, "slapd_bootstrap_config - %s: %s: %s\n", + slapi_log_err(SLAPI_LOG_ERR, "slapd_bootstrap_config", "%s: %s: %s\n", configfile, CONFIG_DS4_COMPATIBLE_SCHEMA_ATTRIBUTE, errorbuf); } val[0] = 0; @@ -544,7 +545,7 @@ slapd_bootstrap_config(const char *configdir) CONFIG_SCHEMA_IGNORE_TRAILING_SPACES, val, errorbuf, CONFIG_APPLY) != LDAP_SUCCESS) { - LDAPDebug(LDAP_DEBUG_ERR, "slapd_bootstrap_config - %s: %s: %s\n", + slapi_log_err(SLAPI_LOG_ERR, "slapd_bootstrap_config", "%s: %s: %s\n", configfile, CONFIG_SCHEMA_IGNORE_TRAILING_SPACES, errorbuf); } val[0] = 0; @@ -557,7 +558,7 @@ slapd_bootstrap_config(const char *configdir) if (config_set_rewrite_rfc1274( CONFIG_REWRITE_RFC1274_ATTRIBUTE, val, errorbuf, CONFIG_APPLY) != LDAP_SUCCESS) { - LDAPDebug(LDAP_DEBUG_ERR, "slapd_bootstrap_config - %s: %s: %s\n", + slapi_log_err(SLAPI_LOG_ERR, "slapd_bootstrap_config", "%s: %s: %s\n", configfile, CONFIG_REWRITE_RFC1274_ATTRIBUTE, errorbuf); } val[0] = 0; @@ -571,7 +572,7 @@ slapd_bootstrap_config(const char *configdir) CONFIG_LOCALHOST_ATTRIBUTE, val, errorbuf, CONFIG_APPLY) != LDAP_SUCCESS) { - LDAPDebug(LDAP_DEBUG_ERR, "slapd_bootstrap_config - %s: %s: %s\n", + slapi_log_err(SLAPI_LOG_ERR, "slapd_bootstrap_config", "%s: %s: %s\n", configfile, CONFIG_LOCALHOST_ATTRIBUTE, errorbuf); } val[0] = 0; @@ -584,7 +585,7 @@ slapd_bootstrap_config(const char *configdir) * if not explicilty set in the config file */ if ( config_set_storagescheme() ) { /* default scheme plugin not loaded */ - slapi_log_error(SLAPI_LOG_ERR, "slapd_bootstrap_config", + slapi_log_err(SLAPI_LOG_ERR, "slapd_bootstrap_config", "The default password storage scheme SSHA could not be read or was not found in the file %s. It is mandatory.\n", configfile); exit (1); diff --git a/ldap/servers/slapd/configdse.c b/ldap/servers/slapd/configdse.c index 0cf2217..06e70af 100644 --- a/ldap/servers/slapd/configdse.c +++ b/ldap/servers/slapd/configdse.c @@ -273,7 +273,7 @@ load_config_dse(Slapi_PBlock *pb, Slapi_Entry* e, Slapi_Entry* ignored, int *ret * value to the current process limit when this happens. We want * to allow the server to still start in this case. */ if (retval == LDAP_UNWILLING_TO_PERFORM) { - slapi_log_error(SLAPI_LOG_WARNING, "load_config_dse", "Config Warning: - %s\n", returntext); + slapi_log_err(SLAPI_LOG_WARNING, "load_config_dse", "Config Warning: - %s\n", returntext); retval = LDAP_SUCCESS; } } else { @@ -328,7 +328,7 @@ load_plugin_entry(Slapi_PBlock *pb, Slapi_Entry* e, Slapi_Entry* ignored, int *r */ if(retval) { - slapi_log_error(SLAPI_LOG_ERR, "load_plugin_entry", + slapi_log_err(SLAPI_LOG_ERR, "load_plugin_entry", "Unable to load plugin \"%s\"\n", slapi_entry_get_dn_const( e )); exit(1); @@ -367,7 +367,7 @@ modify_config_dse(Slapi_PBlock *pb, Slapi_Entry* entryBefore, Slapi_Entry* e, in if (SLAPI_IS_MOD_ADD(mods[i]->mod_op)) { if (apply_mods) { /* log warning once */ - slapi_log_error(SLAPI_LOG_WARNING, "modify_config_dse", + slapi_log_err(SLAPI_LOG_WARNING, "modify_config_dse", "Adding configuration attribute \"%s\"\n", config_attr); } @@ -385,7 +385,7 @@ modify_config_dse(Slapi_PBlock *pb, Slapi_Entry* entryBefore, Slapi_Entry* e, in rc = config_set(config_attr, mods[i]->mod_bvalues, returntext, apply_mods); if (apply_mods) { /* log warning once */ - slapi_log_error(SLAPI_LOG_WARNING, "modify_config_dse", + slapi_log_err(SLAPI_LOG_WARNING, "modify_config_dse", "Deleting configuration attribute \"%s\"\n", config_attr); } @@ -475,7 +475,7 @@ postop_modify_config_dse(Slapi_PBlock *pb, Slapi_Entry* entryBefore, Slapi_Entry PR_snprintf(returntext, SLAPI_DSE_RETURNTEXT_SIZE, "The change of %s will not take effect " "until the server is restarted", mods[i]->mod_type); - slapi_log_error(SLAPI_LOG_INFO, "postop_modify_config_dse", "%s\n", returntext); + slapi_log_err(SLAPI_LOG_INFO, "postop_modify_config_dse", "%s\n", returntext); break; } } diff --git a/ldap/servers/slapd/connection.c b/ldap/servers/slapd/connection.c index 11f9acf..51eb694 100644 --- a/ldap/servers/slapd/connection.c +++ b/ldap/servers/slapd/connection.c @@ -244,7 +244,7 @@ connection_reset(Connection* conn, int ns, PRNetAddr * from, int fromLen, int is char *str_unknown = "unknown"; int in_referral_mode = config_check_referral_mode(); - LDAPDebug(LDAP_DEBUG_CONNS, "new %sconnection on %d\n", pTmp, conn->c_sd, 0 ); + slapi_log_err(SLAPI_LOG_CONNS, "connection_reset", "new %sconnection on %d\n", pTmp, conn->c_sd); /* bump our count of connections and update SNMP stats */ conn->c_connid = slapi_counter_increment(num_conns); @@ -425,16 +425,16 @@ init_op_threads() if ((work_q_lock = PR_NewLock()) == NULL ) { errorCode = PR_GetError(); - LDAPDebug(LDAP_DEBUG_ERR, - "init_op_threads - PR_NewLock failed for work_q_lock, " SLAPI_COMPONENT_NAME_NSPR " error %d (%s)\n", - errorCode, slapd_pr_strerror(errorCode), 0 ); + slapi_log_err(SLAPI_LOG_ERR, + "init_op_threads", "PR_NewLock failed for work_q_lock, " SLAPI_COMPONENT_NAME_NSPR " error %d (%s)\n", + errorCode, slapd_pr_strerror(errorCode)); exit(-1); } if ((work_q_cv = PR_NewCondVar( work_q_lock )) == NULL) { errorCode = PR_GetError(); - LDAPDebug(LDAP_DEBUG_ERR, "init_op_threads - PR_NewCondVar failed for work_q_cv, " SLAPI_COMPONENT_NAME_NSPR " error %d (%s)\n", - errorCode, slapd_pr_strerror(errorCode), 0 ); + slapi_log_err(SLAPI_LOG_ERR, "init_op_threads", "PR_NewCondVar failed for work_q_cv, " SLAPI_COMPONENT_NAME_NSPR " error %d (%s)\n", + errorCode, slapd_pr_strerror(errorCode)); exit(-1); } @@ -452,8 +452,8 @@ init_op_threads() SLAPD_DEFAULT_THREAD_STACKSIZE ) == NULL ) { int prerr = PR_GetError(); - LDAPDebug(LDAP_DEBUG_ERR, "init_op_threads - PR_CreateThread failed, " SLAPI_COMPONENT_NAME_NSPR " error %d (%s)\n", - prerr, slapd_pr_strerror( prerr ), 0 ); + slapi_log_err(SLAPI_LOG_ERR, "init_op_threads", "PR_CreateThread failed, " SLAPI_COMPONENT_NAME_NSPR " error %d (%s)\n", + prerr, slapd_pr_strerror( prerr )); } else { g_incr_active_threadcnt(); } @@ -637,7 +637,8 @@ connection_dispatch_operation(Connection *conn, Operation *op, Slapi_PBlock *pb) int i = 1; int ret = setsockopt(conn->c_sd,IPPROTO_TCP,TCP_CORK,&i,sizeof(i)); if (ret < 0) { - LDAPDebug(LDAP_DEBUG_ERR, "connection_dispatch_operation - Failed to set TCP_CORK on connection %" NSPRIu64 "\n",conn->c_connid, 0, 0); + slapi_log_err(SLAPI_LOG_ERR, "connection_dispatch_operation", + "Failed to set TCP_CORK on connection %" NSPRIu64 "\n",conn->c_connid); } pop_cork = 1; } @@ -650,7 +651,8 @@ connection_dispatch_operation(Connection *conn, Operation *op, Slapi_PBlock *pb) int i = 0; int ret = setsockopt(conn->c_sd,IPPROTO_TCP,TCP_CORK,&i,sizeof(i)); if (ret < 0) { - LDAPDebug(LDAP_DEBUG_ERR, "connection_dispatch_operation - Failed to clear TCP_CORK on connection %" NSPRIu64 "\n",conn->c_connid, 0, 0); + slapi_log_err(SLAPI_LOG_ERR, "connection_dispatch_operation", + "Failed to clear TCP_CORK on connection %" NSPRIu64 "\n",conn->c_connid); } } #endif @@ -675,9 +677,9 @@ connection_dispatch_operation(Connection *conn, Operation *op, Slapi_PBlock *pb) break; default: - LDAPDebug(LDAP_DEBUG_ERR, - "connection_dispatch_operation - Ignoring unknown LDAP request (conn=%" NSPRIu64 ", tag=0x%lx)\n", - conn->c_connid, op->o_tag, 0 ); + slapi_log_err(SLAPI_LOG_ERR, + "connection_dispatch_operation", "Ignoring unknown LDAP request (conn=%" NSPRIu64 ", tag=0x%lx)\n", + conn->c_connid, op->o_tag); break; } } @@ -687,7 +689,7 @@ int connection_release_nolock_ext (Connection *conn, int release_only) { if (conn->c_refcnt <= 0) { - slapi_log_error(SLAPI_LOG_ERR, "connection_release_nolock_ext", + slapi_log_err(SLAPI_LOG_ERR, "connection_release_nolock_ext", "conn=%" NSPRIu64 " fd=%d Attempt to release connection that is not acquired\n", conn->c_connid, conn->c_sd); PR_ASSERT (PR_FALSE); @@ -719,7 +721,7 @@ int connection_acquire_nolock_ext (Connection *conn, int allow_when_closing) if (!allow_when_closing && (conn->c_flags & CONN_FLAG_CLOSING)) { /* This may happen while other threads are still working on this connection */ - slapi_log_error(SLAPI_LOG_ERR, "connection_acquire_nolock_ext", + slapi_log_err(SLAPI_LOG_ERR, "connection_acquire_nolock_ext", "conn=%" NSPRIu64 " fd=%d Attempt to acquire connection in the closing state\n", conn->c_connid, conn->c_sd); return -1; @@ -955,11 +957,11 @@ int connection_wait_for_new_work(Slapi_PBlock *pb, PRIntervalTime interval) } if ( op_shutdown ) { - LDAPDebug0Args(LDAP_DEBUG_TRACE, "connection_wait_for_new_work: shutdown\n" ); + slapi_log_err(SLAPI_LOG_TRACE, "connection_wait_for_new_work", "shutdown\n" ); ret = CONN_SHUTDOWN; } else if ( NULL == ( wqitem = get_work_q( &op_stack_obj ) ) ) { /* not sure how this can happen */ - LDAPDebug0Args(LDAP_DEBUG_TRACE, "connection_wait_for_new_work: no work to do\n" ); + slapi_log_err(SLAPI_LOG_TRACE, "connection_wait_for_new_work", "no work to do\n" ); ret = CONN_NOWORK; } else { /* make new pb */ @@ -1055,8 +1057,8 @@ get_next_from_buffer( void *buffer, size_t buffer_size, ber_len_t *lenp, } syserr = errno; /* Bad stuff happened, like the client sent us some junk */ - LDAPDebug(LDAP_DEBUG_CONNS, - "ber_get_next failed for connection %" NSPRIu64 "\n", conn->c_connid, 0, 0 ); + slapi_log_err(SLAPI_LOG_CONNS, "get_next_from_buffer", + "ber_get_next failed for connection %" NSPRIu64 "\n", conn->c_connid); /* reset private buffer */ conn->c_private->c_buffer_bytes = conn->c_private->c_buffer_offset = 0; @@ -1217,7 +1219,8 @@ int connection_read_operation(Connection *conn, Operation *op, ber_tag_t *tag, i } else { /* Otherwise we loop, unless we exceeded the ioblock timeout */ if (waits_done > ioblocktimeout_waits) { - LDAPDebug(LDAP_DEBUG_CONNS,"connection_read_operation - ioblock timeout expired on connection %" NSPRIu64 "\n", conn->c_connid, 0, 0 ); + slapi_log_err(SLAPI_LOG_CONNS,"connection_read_operation", + "ioblocktimeout expired on connection %" NSPRIu64 "\n", conn->c_connid); disconnect_server_nomutex( conn, conn->c_connid, -1, SLAPD_DISCONNECT_IO_TIMEOUT, 0 ); ret = CONN_DONE; @@ -1237,20 +1240,20 @@ int connection_read_operation(Connection *conn, Operation *op, ber_tag_t *tag, i /* PR_Poll call failed */ err = PR_GetError(); syserr = PR_GetOSError(); - LDAPDebug(LDAP_DEBUG_ERR, - "connection_read_operation - PR_Poll for connection %" NSPRIu64 " returns %d (%s)\n", conn->c_connid, err, slapd_pr_strerror( err ) ); + slapi_log_err(SLAPI_LOG_ERR, "connection_read_operation", + "PR_Poll for connection %" NSPRIu64 " returns %d (%s)\n", conn->c_connid, err, slapd_pr_strerror( err ) ); /* If this happens we should close the connection */ disconnect_server_nomutex( conn, conn->c_connid, -1, err, syserr ); ret = CONN_DONE; goto done; } - LDAPDebug(LDAP_DEBUG_CONNS, - "connection_read_operation - connection %" NSPRIu64 " waited %d times for read to be ready\n", conn->c_connid, waits_done, 0 ); + slapi_log_err(SLAPI_LOG_CONNS, + "connection_read_operation", "connection %" NSPRIu64 " waited %d times for read to be ready\n", conn->c_connid, waits_done); } else { /* Some other error, typically meaning bad stuff */ syserr = PR_GetOSError(); - LDAPDebug(LDAP_DEBUG_CONNS, - "connection_read_operation - PR_Recv for connection %" NSPRIu64 " returns %d (%s)\n", conn->c_connid, err, slapd_pr_strerror( err ) ); + slapi_log_err(SLAPI_LOG_CONNS, "connection_read_operation", + "PR_Recv for connection %" NSPRIu64 " returns %d (%s)\n", conn->c_connid, err, slapd_pr_strerror( err ) ); /* If this happens we should close the connection */ disconnect_server_nomutex( conn, conn->c_connid, -1, err, syserr ); ret = CONN_DONE; @@ -1270,8 +1273,8 @@ int connection_read_operation(Connection *conn, Operation *op, ber_tag_t *tag, i goto done; } } - LDAPDebug(LDAP_DEBUG_CONNS, - "connection_read_operation - connection %" NSPRIu64 " read %d bytes\n", conn->c_connid, ret, 0 ); + slapi_log_err(SLAPI_LOG_CONNS, + "connection_read_operation", "connection %" NSPRIu64 " read %d bytes\n", conn->c_connid, ret); new_operation = 0; ret = CONN_FOUND_WORK_TO_DO; @@ -1291,8 +1294,8 @@ int connection_read_operation(Connection *conn, Operation *op, ber_tag_t *tag, i /* * We received a non-LDAP message. Log and close connection. */ - LDAPDebug(LDAP_DEBUG_ERR, - "connection_read_operation - conn=%" NSPRIu64 " received a non-LDAP message (tag 0x%lx, expected 0x%lx)\n", + slapi_log_err(SLAPI_LOG_ERR, + "connection_read_operation", "conn=%" NSPRIu64 " received a non-LDAP message (tag 0x%lx, expected 0x%lx)\n", conn->c_connid, *tag, LDAP_TAG_MESSAGE ); disconnect_server_nomutex( conn, conn->c_connid, -1, SLAPD_DISCONNECT_BAD_BER_TAG, EPROTO ); @@ -1303,8 +1306,8 @@ int connection_read_operation(Connection *conn, Operation *op, ber_tag_t *tag, i if ( (*tag = ber_get_int( op->o_ber, &msgid )) != LDAP_TAG_MSGID ) { /* log, close and send error */ - LDAPDebug(LDAP_DEBUG_ERR, - "connection_read_operation - conn=%" NSPRIu64 " unable to read tag for incoming request\n", conn->c_connid, 0, 0 ); + slapi_log_err(SLAPI_LOG_ERR, + "connection_read_operation", "conn=%" NSPRIu64 " unable to read tag for incoming request\n", conn->c_connid); disconnect_server_nomutex( conn, conn->c_connid, -1, SLAPD_DISCONNECT_BAD_BER_TAG, EPROTO ); ret = CONN_DONE; goto done; @@ -1321,8 +1324,8 @@ int connection_read_operation(Connection *conn, Operation *op, ber_tag_t *tag, i case LBER_ERROR: case LDAP_TAG_LDAPDN: /* optional username, for CLDAP */ /* log, close and send error */ - LDAPDebug(LDAP_DEBUG_ERR, - "connection_read_operation - conn=%" NSPRIu64 " ber_peek_tag returns 0x%lx\n", conn->c_connid, *tag, 0 ); + slapi_log_err(SLAPI_LOG_ERR, + "connection_read_operation", "conn=%" NSPRIu64 " ber_peek_tag returns 0x%lx\n", conn->c_connid, *tag); disconnect_server_nomutex( conn, conn->c_connid, -1, SLAPD_DISCONNECT_BER_PEEK, EPROTO ); ret = CONN_DONE; goto done; @@ -1346,7 +1349,7 @@ void connection_make_readable(Connection *conn) void connection_make_readable_nolock(Connection *conn) { conn->c_gettingber = 0; - LDAPDebug2Args(LDAP_DEBUG_CONNS, "connection_make_readable_nolock - making readable conn %" NSPRIu64 " fd=%d\n", + slapi_log_err(SLAPI_LOG_CONNS, "connection_make_readable_nolock", "making readable conn %" NSPRIu64 " fd=%d\n", conn->c_connid, conn->c_sd); if (!(conn->c_flags & CONN_FLAG_CLOSING)) { /* if the connection is closing, try the close in connection_release_nolock */ @@ -1373,7 +1376,7 @@ void connection_check_activity_level(Connection *conn) /* update the last checked time */ conn->c_private->previous_count_check_time = current_time(); PR_ExitMonitor(conn->c_mutex); - LDAPDebug(LDAP_DEBUG_CONNS,"connection_check_activity_level - conn %" NSPRIu64 " activity level = %d\n",conn->c_connid,delta_count,0); + slapi_log_err(SLAPI_LOG_CONNS,"connection_check_activity_level", "conn %" NSPRIu64 " activity level = %d\n",conn->c_connid,delta_count); } typedef struct table_iterate_info_struct { @@ -1434,7 +1437,8 @@ void connection_enter_leave_turbo(Connection *conn, int current_turbo_flag, int } else { double activet = 0.0; connection_find_our_rank(conn,&connection_count, &our_rank); - LDAPDebug(LDAP_DEBUG_CONNS,"connection_enter_leave_turbo - conn %" NSPRIu64 " turbo rank = %d out of %d conns\n",conn->c_connid,our_rank,connection_count); + slapi_log_err(SLAPI_LOG_CONNS,"connection_enter_leave_turbo", + "conn %" NSPRIu64 " turbo rank = %d out of %d conns\n",conn->c_connid,our_rank,connection_count); activet = (double)g_get_active_threadcnt(); threshold_rank = (int)(activet * ((double)CONN_TURBO_PERCENTILE / 100.0)); @@ -1475,9 +1479,9 @@ void connection_enter_leave_turbo(Connection *conn, int current_turbo_flag, int PR_ExitMonitor(conn->c_mutex); if (current_mode != new_mode) { if (current_mode) { - LDAPDebug(LDAP_DEBUG_CONNS,"connection_enter_leave_turbo - conn %" NSPRIu64 " leaving turbo mode\n",conn->c_connid,0,0); + slapi_log_err(SLAPI_LOG_CONNS,"connection_enter_leave_turbo", "conn %" NSPRIu64 " leaving turbo mode\n",conn->c_connid); } else { - LDAPDebug(LDAP_DEBUG_CONNS,"connection_enter_leave_turbo - conn %" NSPRIu64 " entering turbo mode\n",conn->c_connid,0,0); + slapi_log_err(SLAPI_LOG_CONNS,"connection_enter_leave_turbo", "conn %" NSPRIu64 " entering turbo mode\n",conn->c_connid); } } *new_turbo_flag = new_mode; @@ -1517,8 +1521,8 @@ connection_threadmain() time_t curtime = 0; if( op_shutdown ) { - LDAPDebug(LDAP_DEBUG_TRACE, - "connection_threadmain - op_thread received shutdown signal\n", 0, 0, 0 ); + slapi_log_err(SLAPI_LOG_TRACE, "connection_threadmain", + "op_thread received shutdown signal\n"); g_decr_active_threadcnt(); return; } @@ -1534,8 +1538,8 @@ connection_threadmain() PR_ASSERT(interval != PR_INTERVAL_NO_TIMEOUT); /* this should never happen with PR_INTERVAL_NO_TIMEOUT */ continue; case CONN_SHUTDOWN: - LDAPDebug(LDAP_DEBUG_TRACE, - "connection_threadmain - op_thread received shutdown signal\n", 0, 0, 0 ); + slapi_log_err(SLAPI_LOG_TRACE, "connection_threadmain", + "op_thread received shutdown signal\n"); g_decr_active_threadcnt(); return; case CONN_FOUND_WORK_TO_DO: @@ -1567,7 +1571,8 @@ connection_threadmain() slapi_ch_free_string( &anon_dn ); } if (connection_call_io_layer_callbacks(pb->pb_conn)) { - LDAPDebug0Args(LDAP_DEBUG_ANY, "connection_threadmain - Could not add/remove IO layers from connection\n" ); + slapi_log_err(SLAPI_LOG_ERR, "connection_threadmain", + "Could not add/remove IO layers from connection\n"); } default: break; @@ -1583,7 +1588,8 @@ connection_threadmain() /* Make our own pb in turbo mode */ connection_make_new_pb(pb,conn); if (connection_call_io_layer_callbacks(conn)) { - LDAPDebug0Args(LDAP_DEBUG_ANY, "connection_threadmain - Could not add/remove IO layers from connection\n" ); + slapi_log_err(SLAPI_LOG_ERR, "connection_threadmain", + "Could not add/remove IO layers from connection\n" ); } PR_ExitMonitor(conn->c_mutex); if (! config_check_referral_mode()) { @@ -1598,12 +1604,12 @@ connection_threadmain() more_data = 0; ret = connection_read_operation(conn, op, &tag, &more_data); if ((ret == CONN_DONE) || (ret == CONN_TIMEDOUT)) { - slapi_log_error(SLAPI_LOG_CONNS, "connection_threadmain", + slapi_log_err(SLAPI_LOG_CONNS, "connection_threadmain", "conn %" NSPRIu64 " read not ready due to %d - thread_turbo_flag %d more_data %d " "ops_initiated %d refcnt %d flags %d\n", conn->c_connid, ret, thread_turbo_flag, more_data, conn->c_opsinitiated, conn->c_refcnt, conn->c_flags); } else if (ret == CONN_FOUND_WORK_TO_DO) { - slapi_log_error(SLAPI_LOG_CONNS, "connection_threadmain", + slapi_log_err(SLAPI_LOG_CONNS, "connection_threadmain", "conn %" NSPRIu64 " read operation successfully - thread_turbo_flag %d more_data %d " "ops_initiated %d refcnt %d flags %d\n", conn->c_connid, thread_turbo_flag, more_data, conn->c_opsinitiated, conn->c_refcnt, conn->c_flags); @@ -1629,8 +1635,9 @@ connection_threadmain() /* turn off turbo mode immediately if any pb waiting in global queue */ if (thread_turbo_flag && !WORK_Q_EMPTY) { thread_turbo_flag = 0; - LDAPDebug2Args(LDAP_DEBUG_CONNS,"connection_threadmain - conn %" NSPRIu64 " leaving turbo mode - pb_q is not empty %d\n", - conn->c_connid,work_q_size); + slapi_log_err(SLAPI_LOG_CONNS,"connection_threadmain", + "conn %" NSPRIu64 " leaving turbo mode - pb_q is not empty %d\n", + conn->c_connid,work_q_size); } #endif @@ -1655,12 +1662,13 @@ connection_threadmain() * should call connection_make_readable after the op is removed * connection_make_readable(conn); */ - LDAPDebug(LDAP_DEBUG_CONNS,"connection_threadmain - conn %" NSPRIu64 " leaving turbo mode due to %d\n", - conn->c_connid,ret,0); + slapi_log_err(SLAPI_LOG_CONNS,"connection_threadmain", + "conn %" NSPRIu64 " leaving turbo mode due to %d\n", + conn->c_connid,ret); goto done; case CONN_SHUTDOWN: - LDAPDebug(LDAP_DEBUG_TRACE, - "op_thread received shutdown signal\n", 0, 0, 0 ); + slapi_log_err(SLAPI_LOG_TRACE, "connection_threadmain", + "op_thread received shutdown signal\n"); g_decr_active_threadcnt(); doshutdown = 1; goto done; /* To destroy pb, jump to done once */ @@ -1712,8 +1720,8 @@ connection_threadmain() */ conn->c_idlesince = curtime; connection_activity(conn, maxthreads); - LDAPDebug(LDAP_DEBUG_CONNS,"connection_threadmain - conn %" NSPRIu64 " queued because more_data\n", - conn->c_connid,0,0); + slapi_log_err(SLAPI_LOG_CONNS,"connection_threadmain", "conn %" NSPRIu64 " queued because more_data\n", + conn->c_connid); } else { /* keep count of how many times maxthreads has blocked an operation */ conn->c_maxthreadsblocked++; @@ -1738,9 +1746,8 @@ connection_threadmain() if (conn->c_flags & CONN_FLAG_IMPORT) { if ((tag != LDAP_REQ_ADD) && (tag != LDAP_REQ_EXTENDED)) { /* no cookie for you. */ - LDAPDebug(LDAP_DEBUG_ERR, "connection_threadmain - Attempted operation %d " - "from within bulk import\n", - tag, 0, 0); + slapi_log_err(SLAPI_LOG_ERR, "connection_threadmain", "Attempted operation %lu " + "from within bulk import\n", tag); slapi_send_ldap_result(pb, LDAP_PROTOCOL_ERROR, NULL, NULL, 0, NULL); goto done; @@ -1795,7 +1802,7 @@ done: /* If we're in turbo mode, we keep our reference to the connection alive */ /* can't use the more_data var because connection could have changed in another thread */ more_data = conn_buffered_data_avail_nolock(conn, &conn_closed) ? 1 : 0; - LDAPDebug(LDAP_DEBUG_CONNS,"connection_threadmain - conn %" NSPRIu64 " check more_data %d thread_turbo_flag %d\n", + slapi_log_err(SLAPI_LOG_CONNS,"connection_threadmain", "conn %" NSPRIu64 " check more_data %d thread_turbo_flag %d\n", conn->c_connid,more_data,thread_turbo_flag); if (!more_data) { if (!thread_turbo_flag) { @@ -1843,9 +1850,9 @@ connection_activity(Connection *conn, int maxthreads) struct Slapi_op_stack *op_stack_obj; if (connection_acquire_nolock (conn) == -1) { - LDAPDebug(LDAP_DEBUG_CONNS, - "connection_activity - Could not acquire lock in connection_activity as conn %" NSPRIu64 " closing fd=%d\n", - conn->c_connid,conn->c_sd,0); + slapi_log_err(SLAPI_LOG_CONNS, + "connection_activity", "Could not acquire lock in connection_activity as conn %" NSPRIu64 " closing fd=%d\n", + conn->c_connid,conn->c_sd); /* XXX how to handle this error? */ /* MAB: 25 Jan 01: let's return on error and pray this won't leak */ return (-1); @@ -1883,7 +1890,7 @@ add_work_q( work_q_item *wqitem, struct Slapi_op_stack *op_stack_obj ) { struct Slapi_work_q *new_work_q=NULL; - LDAPDebug(LDAP_DEBUG_TRACE, "add_work_q \n", 0, 0, 0 ); + slapi_log_err(SLAPI_LOG_TRACE, "add_work_q", "=>\n"); new_work_q = create_work_q(); new_work_q->work_item = wqitem; @@ -1917,9 +1924,9 @@ get_work_q(struct Slapi_op_stack **op_stack_obj) struct Slapi_work_q *tmp = NULL; work_q_item *wqitem; - LDAPDebug0Args(LDAP_DEBUG_TRACE, "get_work_q\n" ); + slapi_log_err(SLAPI_LOG_TRACE, "get_work_q","=>\n"); if (head_work_q == NULL) { - LDAPDebug0Args(LDAP_DEBUG_TRACE, "get_work_q -The work queue is empty.\n" ); + slapi_log_err(SLAPI_LOG_TRACE, "get_work_q", "The work queue is empty.\n"); return NULL; } @@ -1947,7 +1954,7 @@ get_work_q(struct Slapi_op_stack **op_stack_obj) void op_thread_cleanup() { - LDAPDebug(LDAP_DEBUG_INFO, + slapi_log_err(SLAPI_LOG_INFO, "op_thread_cleanup", "slapd shutting down - signaling operation threads - op stack size %d max work q size %d max work q stack size %d\n", op_stack_size, work_q_size_max, work_q_stack_size_max); @@ -1987,7 +1994,7 @@ connection_post_shutdown_cleanup() } PR_DestroyStack(op_stack); op_stack = NULL; - LDAPDebug2Args(LDAP_DEBUG_INFO, + slapi_log_err(SLAPI_LOG_INFO, "connection_post_shutdown_cleanup", "slapd shutting down - freed %d work q stack objects - freed %d op stack objects\n", work_cnt, stack_cnt); } @@ -2027,8 +2034,8 @@ connection_remove_operation( Connection *conn, Operation *op ) if ( *tmp == NULL ) { - LDAPDebug(LDAP_DEBUG_ERR, "connection_remove_operation - Can't find op %d for conn %" NSPRIu64 "\n", - (int)op->o_msgid, conn->c_connid, 0 ); + slapi_log_err(SLAPI_LOG_ERR, "connection_remove_operation", "Can't find op %d for conn %" NSPRIu64 "\n", + (int)op->o_msgid, conn->c_connid); } else { @@ -2167,13 +2174,13 @@ log_ber_too_big_error(const Connection *conn, ber_len_t ber_len, maxbersize = config_get_maxbersize(); } if (0 == ber_len) { - slapi_log_error(SLAPI_LOG_ERR, "log_ber_too_big_error", + slapi_log_err(SLAPI_LOG_ERR, "log_ber_too_big_error", "conn=%" NSPRIu64 " fd=%d Incoming BER Element was too long, max allowable" " is %" BERLEN_T " bytes. Change the nsslapd-maxbersize attribute in" " cn=config to increase.\n", conn->c_connid, conn->c_sd, maxbersize ); } else { - slapi_log_error(SLAPI_LOG_ERR, "log_ber_too_big_error", + slapi_log_err(SLAPI_LOG_ERR, "log_ber_too_big_error", "conn=%" NSPRIu64 " fd=%d Incoming BER Element was %" BERLEN_T " bytes, max allowable" " is %" BERLEN_T " bytes. Change the nsslapd-maxbersize attribute in" " cn=config to increase.\n", @@ -2205,7 +2212,7 @@ disconnect_server_nomutex_ext( Connection *conn, PRUint64 opconnid, int opid, PR if ( ( conn->c_sd != SLAPD_INVALID_SOCKET && conn->c_connid == opconnid ) && !(conn->c_flags & CONN_FLAG_CLOSING) ) { - LDAPDebug(LDAP_DEBUG_CONNS, "disconnect_server_nomutex_ext - Setting conn %" NSPRIu64 " fd=%d " + slapi_log_err(SLAPI_LOG_CONNS, "disconnect_server_nomutex_ext", "Setting conn %" NSPRIu64 " fd=%d " "to be disconnected: reason %d\n", conn->c_connid, conn->c_sd, reason); /* * PR_Close must be called before anything else is done because @@ -2282,7 +2289,7 @@ disconnect_server_nomutex_ext( Connection *conn, PRUint64 opconnid, int opid, PR } } else { - LDAPDebug2Args(LDAP_DEBUG_CONNS, "disconnect_server_nomutex_ext - Not setting conn %d to be disconnected: %s\n", + slapi_log_err(SLAPI_LOG_CONNS, "disconnect_server_nomutex_ext", "Not setting conn %d to be disconnected: %s\n", conn->c_sd, (conn->c_sd == SLAPD_INVALID_SOCKET) ? "socket is invalid" : ((conn->c_connid != opconnid) ? "conn id does not match op conn id" : diff --git a/ldap/servers/slapd/conntable.c b/ldap/servers/slapd/conntable.c index c275c7e..004aeae 100644 --- a/ldap/servers/slapd/conntable.c +++ b/ldap/servers/slapd/conntable.c @@ -146,7 +146,7 @@ connection_table_get_connection(Connection_Table *ct, int sd) { c->c_mutex = NULL; c->c_pdumutex = NULL; - LDAPDebug(LDAP_DEBUG_ERR,"connection_table_get_connection - PR_NewLock failed\n",0, 0, 0 ); + slapi_log_err(SLAPI_LOG_ERR,"connection_table_get_connection", "PR_NewLock failed\n"); exit(1); } } @@ -164,7 +164,7 @@ connection_table_get_connection(Connection_Table *ct, int sd) else { /* couldn't find a Connection */ - LDAPDebug(LDAP_DEBUG_CONNS, "connection_table_get_connection - Max open connections reached\n", 0, 0, 0); + slapi_log_err(SLAPI_LOG_CONNS, "connection_table_get_connection", "Max open connections reached\n"); } return c; } @@ -208,7 +208,7 @@ int connection_table_iterate_active_connections(Connection_Table *ct, void* arg, static void connection_table_dump_active_connection (Connection *c) { - slapi_log_error(SLAPI_LOG_DEBUG, "connection_table_dump_active_connection", "conn=%p fd=%d refcnt=%d c_flags=%d\n" + slapi_log_err(SLAPI_LOG_DEBUG, "connection_table_dump_active_connection", "conn=%p fd=%d refcnt=%d c_flags=%d\n" "mutex=%p next=%p prev=%p\n\n", c, c->c_sd, c->c_refcnt, c->c_flags, c->c_mutex, c->c_next, c->c_prev); } @@ -219,7 +219,7 @@ connection_table_dump_active_connections (Connection_Table *ct) Connection* c; PR_Lock(ct->table_mutex); - slapi_log_error(SLAPI_LOG_DEBUG, "connection_table_dump_active_connections", "********** BEGIN DUMP ************\n"); + slapi_log_err(SLAPI_LOG_DEBUG, "connection_table_dump_active_connections", "********** BEGIN DUMP ************\n"); c = connection_table_get_first_active_connection (ct); while (c) { @@ -227,7 +227,7 @@ connection_table_dump_active_connections (Connection_Table *ct) c = connection_table_get_next_active_connection (ct, c); } - slapi_log_error(SLAPI_LOG_DEBUG, "connection_table_dump_active_connections", "********** END DUMP ************\n"); + slapi_log_err(SLAPI_LOG_DEBUG, "connection_table_dump_active_connections", "********** END DUMP ************\n"); PR_Unlock(ct->table_mutex); } #endif @@ -246,7 +246,7 @@ connection_table_move_connection_out_of_active_list(Connection_Table *ct,Connect PR_ASSERT (c->c_prev); #ifdef FOR_DEBUGGING - slapi_log_error(SLAPI_LOG_DEBUG, "connection_table_move_connection_out_of_active_list", "Moving connection out of active list\n"); + slapi_log_err(SLAPI_LOG_DEBUG, "connection_table_move_connection_out_of_active_list", "Moving connection out of active list\n"); connection_table_dump_active_connection (c); #endif @@ -256,9 +256,9 @@ connection_table_move_connection_out_of_active_list(Connection_Table *ct,Connect * a reference to the connection (that is, its reference count must be 1 or less). */ if(c->c_refcnt > 1) { - LDAPDebug2Args(LDAP_DEBUG_CONNS, - "connection_table_move_connection_out_of_active_list - " - "not moving conn %d out of active list because refcnt is %d\n", + slapi_log_err(SLAPI_LOG_CONNS, + "connection_table_move_connection_out_of_active_list", + "Not moving conn %d out of active list because refcnt is %d\n", c_sd, c->c_refcnt); return 1; /* failed */ } @@ -279,7 +279,7 @@ connection_table_move_connection_out_of_active_list(Connection_Table *ct,Connect PR_Unlock(ct->table_mutex); - LDAPDebug1Arg(LDAP_DEBUG_CONNS, "connection_table_move_connection_out_of_active_list - " + slapi_log_err(SLAPI_LOG_CONNS, "connection_table_move_connection_out_of_active_list", "Moved conn %d out of active list and freed\n", c_sd); #ifdef FOR_DEBUGGING @@ -307,7 +307,7 @@ connection_table_move_connection_on_to_active_list(Connection_Table *ct,Connecti } #ifdef FOR_DEBUGGING - slapi_log_error(SLAPI_LOG_DEBUG, "connection_table_move_connection_on_to_active_list", + slapi_log_err(SLAPI_LOG_DEBUG, "connection_table_move_connection_on_to_active_list", "Moving connection into active list\n"); connection_table_dump_active_connection (c); #endif @@ -476,7 +476,8 @@ connection_table_dump_activity_to_errors_log(Connection_Table *ct) int r = ct->fd[j].out_flags & SLAPD_POLL_FLAGS; if ( r ) { - LDAPDebug(LDAP_DEBUG_CONNS,"activity on %d%s\n", i, r ? "r" : "",0 ); + slapi_log_err(SLAPI_LOG_CONNS, "connection_table_dump_activity_to_errors_log", + "activity on %d%s\n", i, r ? "r" : ""); } } PR_ExitMonitor(c->c_mutex); diff --git a/ldap/servers/slapd/control.c b/ldap/servers/slapd/control.c index 8715361..8f9e74e 100644 --- a/ldap/servers/slapd/control.c +++ b/ldap/servers/slapd/control.c @@ -39,7 +39,7 @@ init_controls( void ) supported_controls_lock = slapi_new_rwlock(); if (NULL == supported_controls_lock) { /* Out of resources */ - slapi_log_error(SLAPI_LOG_ERR, "init_controls", + slapi_log_err(SLAPI_LOG_ERR, "init_controls", "Failed to create lock.\n"); exit (1); } @@ -197,10 +197,10 @@ get_ldapmessage_controls_ext( * } */ - LDAPDebug(LDAP_DEBUG_TRACE, "=> get_ldapmessage_controls\n", 0, 0, 0 ); + slapi_log_err(SLAPI_LOG_TRACE, "get_ldapmessage_controls_ext", "=> get_ldapmessage_controls\n"); if (!pb) { - LDAPDebug(LDAP_DEBUG_ERR, "<= get_ldapmessage_controls NULL PBlock\n", 0, 0, 0 ); + slapi_log_err(SLAPI_LOG_ERR, "get_ldapmessage_controls_ext", "<= NULL PBlock\n"); return( LDAP_OPERATIONS_ERROR ); /* unexpected error */ } @@ -215,21 +215,19 @@ get_ldapmessage_controls_ext( * check to see if controls were included */ if ( ber_get_option( ber, LBER_OPT_REMAINING_BYTES, &len ) != 0 ) { - LDAPDebug(LDAP_DEBUG_TRACE, - "<= get_ldapmessage_controls LDAP_OPERATIONS_ERROR\n", - 0, 0, 0 ); + slapi_log_err(SLAPI_LOG_TRACE, "get_ldapmessage_controls_ext", + "<= LDAP_OPERATIONS_ERROR\n"); return( LDAP_OPERATIONS_ERROR ); /* unexpected error */ } if ( len == 0 ) { - LDAPDebug(LDAP_DEBUG_TRACE, - "<= get_ldapmessage_controls no controls\n", 0, 0, 0 ); + slapi_log_err(SLAPI_LOG_TRACE, "get_ldapmessage_controls_ext", + "<= no controls\n"); return( LDAP_SUCCESS ); /* no controls */ } if (( tag = ber_peek_tag( ber, &len )) != LDAP_TAG_CONTROLS ) { if ( tag == LBER_ERROR ) { - LDAPDebug(LDAP_DEBUG_TRACE, - "<= get_ldapmessage_controls LDAP_PROTOCOL_ERROR\n", - 0, 0, 0 ); + slapi_log_err(SLAPI_LOG_TRACE, "get_ldapmessage_controls_ext", + "<= LDAP_PROTOCOL_ERROR\n"); return( LDAP_PROTOCOL_ERROR ); /* decoding error */ } /* @@ -237,9 +235,8 @@ get_ldapmessage_controls_ext( * happen in LDAPv3, but we don't treat this is a hard error -- * we just ignore the extra stuff. */ - LDAPDebug(LDAP_DEBUG_TRACE, - "<= get_ldapmessage_controls ignoring unrecognized data in request (tag 0x%x)\n", - tag, 0, 0 ); + slapi_log_err(SLAPI_LOG_TRACE, "get_ldapmessage_controls_ext", + "<= ignoring unrecognized data in request (tag 0x%x)\n", (unsigned int)tag); return( LDAP_SUCCESS ); } @@ -249,7 +246,7 @@ get_ldapmessage_controls_ext( */ if ( pb->pb_conn != NULL && pb->pb_conn->c_ldapversion < LDAP_VERSION3 ) { - slapi_log_error(SLAPI_LOG_ERR, "get_ldapmessage_controls_ext", + slapi_log_err(SLAPI_LOG_ERR, "get_ldapmessage_controls_ext", "Received control(s) on an LDAPv%d connection\n", pb->pb_conn->c_ldapversion ); return( LDAP_PROTOCOL_ERROR ); @@ -338,7 +335,7 @@ get_ldapmessage_controls_ext( slapi_pblock_set(pb, SLAPI_REQCONTROLS, NULL); slapi_pblock_set(pb, SLAPI_MANAGEDSAIT, &ctrl_not_found); slapi_pblock_set(pb, SLAPI_PWPOLICY, &ctrl_not_found); - slapi_log_error(SLAPI_LOG_CONNS, "connection", "Warning: conn=%" NSPRIu64 " op=%d contains an empty list of controls\n", + slapi_log_err(SLAPI_LOG_CONNS, "get_ldapmessage_controls_ext", "Warning: conn=%" NSPRIu64 " op=%d contains an empty list of controls\n", pb->pb_conn->c_connid, pb->pb_op->o_opid); } else { /* len, ber_len_t is uint, not int, cannot be != -1, may be better to remove this check. */ @@ -376,14 +373,14 @@ get_ldapmessage_controls_ext( } #endif /* SLAPD_ECHO_CONTROL */ - LDAPDebug(LDAP_DEBUG_TRACE, - "<= get_ldapmessage_controls %d controls\n", curcontrols, 0, 0 ); + slapi_log_err(SLAPI_LOG_TRACE, "get_ldapmessage_controls_ext", + "<= %d controls\n", curcontrols); return( LDAP_SUCCESS ); free_and_return:; ldap_controls_free( ctrls ); - LDAPDebug(LDAP_DEBUG_TRACE, - "<= get_ldapmessage_controls %i\n", rc, 0, 0 ); + slapi_log_err(SLAPI_LOG_TRACE, "get_ldapmessage_controls_ext", + "<= %i\n", rc); return( rc ); } @@ -402,16 +399,16 @@ slapi_control_present( LDAPControl **controls, char *oid, struct berval **val, i { int i; - LDAPDebug(LDAP_DEBUG_TRACE, - "=> slapi_control_present (looking for %s)\n", oid, 0, 0 ); + slapi_log_err(SLAPI_LOG_TRACE, "slapi_control_present", + "=> (looking for %s)\n", oid); if ( val != NULL ) { *val = NULL; } if ( controls == NULL ) { - LDAPDebug(LDAP_DEBUG_TRACE, - "<= slapi_control_present 0 (NO CONTROLS)\n", 0, 0, 0 ); + slapi_log_err(SLAPI_LOG_TRACE, "slapi_control_present", + "<= 0 (NO CONTROLS)\n"); return( 0 ); } @@ -423,14 +420,14 @@ slapi_control_present( LDAPControl **controls, char *oid, struct berval **val, i *iscritical = (int) controls[i]->ldctl_iscritical; } } - LDAPDebug(LDAP_DEBUG_TRACE, - "<= slapi_control_present 1 (FOUND)\n", 0, 0, 0 ); + slapi_log_err(SLAPI_LOG_TRACE, "slapi_control_present", + "<= 1 (FOUND)\n"); return( 1 ); } } - LDAPDebug(LDAP_DEBUG_TRACE, - "<= slapi_control_present 0 (NOT FOUND)\n", 0, 0, 0 ); + slapi_log_err(SLAPI_LOG_TRACE, "slapi_control_present", + "<= 0 (NOT FOUND)\n"); return( 0 ); } diff --git a/ldap/servers/slapd/counters.c b/ldap/servers/slapd/counters.c index b71c214..a351e7e 100644 --- a/ldap/servers/slapd/counters.c +++ b/ldap/servers/slapd/counters.c @@ -146,13 +146,13 @@ counters_to_errors_log(const char *text) #if defined(DEBUG) int i; fetch_counters(); - LDAPDebug(LDAP_DEBUG_DEBUG, "Counter Dump - %s\n",text, 0, 0); + slapi_log_err(SLAPI_LOG_DEBUG, "counters_to_errors_log", "Counter Dump - %s\n",text); for(i=0;isubseqnum == maxsubseq) { - slapi_log_error(SLAPI_LOG_ERR, "csn_increment_subsequence", + slapi_log_err(SLAPI_LOG_ERR, "csn_increment_subsequence", "subsequence overflow\n"); return -1; } diff --git a/ldap/servers/slapd/csngen.c b/ldap/servers/slapd/csngen.c index 9583d3b..468979a 100644 --- a/ldap/servers/slapd/csngen.c +++ b/ldap/servers/slapd/csngen.c @@ -114,7 +114,7 @@ csngen_new (ReplicaId rid, Slapi_Attr *state) gen = (CSNGen*)slapi_ch_calloc (1, sizeof (CSNGen)); if (gen == NULL) { - slapi_log_error(SLAPI_LOG_ERR, "csngen_new", "Memory allocation failed\n"); + slapi_log_err(SLAPI_LOG_ERR, "csngen_new", "Memory allocation failed\n"); return NULL; } @@ -122,7 +122,7 @@ csngen_new (ReplicaId rid, Slapi_Attr *state) gen->lock = slapi_new_rwlock(); if (gen->lock == NULL) { - slapi_log_error(SLAPI_LOG_ERR, "csngen_new", "Failed to create lock\n"); + slapi_log_err(SLAPI_LOG_ERR, "csngen_new", "Failed to create lock\n"); rc = CSN_NSPR_ERROR; goto done; } @@ -186,14 +186,14 @@ csngen_new_csn (CSNGen *gen, CSN **csn, PRBool notify) if (gen == NULL || csn == NULL) { - slapi_log_error(SLAPI_LOG_ERR, "csngen_new_csn", "Invalid argument\n"); + slapi_log_err(SLAPI_LOG_ERR, "csngen_new_csn", "Invalid argument\n"); return CSN_INVALID_PARAMETER; } *csn = csn_new (); if (*csn == NULL) { - slapi_log_error(SLAPI_LOG_ERR, "csngen_new_csn", "Memory allocation failed\n"); + slapi_log_err(SLAPI_LOG_ERR, "csngen_new_csn", "Memory allocation failed\n"); return CSN_MEMORY_ERROR; } @@ -224,7 +224,7 @@ csngen_new_csn (CSNGen *gen, CSN **csn, PRBool notify) * Beyond 300 secs, we advance gen->state.sampled_time by * one sec to recycle seqnum. */ - slapi_log_error(SLAPI_LOG_WARNING, "csngen_new_csn", "Too much time skew (%d secs). Current seqnum=%0x\n", delta, gen->state.seq_num ); + slapi_log_err(SLAPI_LOG_WARNING, "csngen_new_csn", "Too much time skew (%d secs). Current seqnum=%0x\n", delta, gen->state.seq_num ); rc = _csngen_adjust_local_time (gen, gen->state.sampled_time+1); if (rc != CSN_SUCCESS) { @@ -236,7 +236,7 @@ csngen_new_csn (CSNGen *gen, CSN **csn, PRBool notify) if (gen->state.seq_num == CSN_MAX_SEQNUM) { - slapi_log_error(SLAPI_LOG_INFO, "csngen_new_csn", "Sequence rollover; " + slapi_log_err(SLAPI_LOG_INFO, "csngen_new_csn", "Sequence rollover; " "local offset updated.\n"); gen->state.local_offset ++; gen->state.seq_num = 0; @@ -303,7 +303,7 @@ int csngen_adjust_time(CSNGen *gen, const CSN* csn) if (slapi_is_loglevel_set(SLAPI_LOG_REPL)) { cur_time = CSN_CALC_TSTAMP(gen); - slapi_log_error(SLAPI_LOG_REPL, "csngen_adjust_time", + slapi_log_err(SLAPI_LOG_REPL, "csngen_adjust_time", "gen state before %08lx%04x:%ld:%ld:%ld\n", cur_time, gen->state.seq_num, gen->state.sampled_time, @@ -352,7 +352,7 @@ int csngen_adjust_time(CSNGen *gen, const CSN* csn) } else /* remote_offset > CSN_MAX_TIME_ADJUST */ { - slapi_log_error(SLAPI_LOG_ERR, "csngen_adjust_time", + slapi_log_err(SLAPI_LOG_ERR, "csngen_adjust_time", "Adjustment limit exceeded; value - %ld, limit - %ld\n", remote_offset, (long)CSN_MAX_TIME_ADJUST); slapi_rwlock_unlock (gen->lock); @@ -378,7 +378,7 @@ int csngen_adjust_time(CSNGen *gen, const CSN* csn) gen->state.seq_num = remote_seqnum + 1; } if (slapi_is_loglevel_set(SLAPI_LOG_REPL)) { - slapi_log_error(SLAPI_LOG_REPL, "csngen_adjust_time", + slapi_log_err(SLAPI_LOG_REPL, "csngen_adjust_time", "gen state after %08lx%04x:%ld:%ld:%ld\n", new_time, gen->state.seq_num, gen->state.sampled_time, @@ -473,12 +473,12 @@ void csngen_dump_state (const CSNGen *gen) if (gen) { slapi_rwlock_rdlock (gen->lock); - slapi_log_error(SLAPI_LOG_DEBUG, "csngen_dump_state", "CSN generator's state:\n"); - slapi_log_error(SLAPI_LOG_DEBUG, "csngen_dump_state", "\treplica id: %d\n", gen->state.rid); - slapi_log_error(SLAPI_LOG_DEBUG, "csngen_dump_state", "\tsampled time: %ld\n", gen->state.sampled_time); - slapi_log_error(SLAPI_LOG_DEBUG, "csngen_dump_state", "\tlocal offset: %ld\n", gen->state.local_offset); - slapi_log_error(SLAPI_LOG_DEBUG, "csngen_dump_state", "\tremote offset: %ld\n", gen->state.remote_offset); - slapi_log_error(SLAPI_LOG_DEBUG, "csngen_dump_state", "\tsequence number: %d\n", gen->state.seq_num); + slapi_log_err(SLAPI_LOG_DEBUG, "csngen_dump_state", "CSN generator's state:\n"); + slapi_log_err(SLAPI_LOG_DEBUG, "csngen_dump_state", "\treplica id: %d\n", gen->state.rid); + slapi_log_err(SLAPI_LOG_DEBUG, "csngen_dump_state", "\tsampled time: %ld\n", gen->state.sampled_time); + slapi_log_err(SLAPI_LOG_DEBUG, "csngen_dump_state", "\tlocal offset: %ld\n", gen->state.local_offset); + slapi_log_err(SLAPI_LOG_DEBUG, "csngen_dump_state", "\tremote offset: %ld\n", gen->state.remote_offset); + slapi_log_err(SLAPI_LOG_DEBUG, "csngen_dump_state", "\tsequence number: %d\n", gen->state.seq_num); slapi_rwlock_unlock (gen->lock); } } @@ -491,7 +491,7 @@ void csngen_test () int rc; CSNGen *gen = csngen_new (255, NULL); - slapi_log_error(SLAPI_LOG_DEBUG, "csngen_test", "staring csn generator test ..."); + slapi_log_err(SLAPI_LOG_DEBUG, "csngen_test", "staring csn generator test ..."); csngen_dump_state (gen); rc = _csngen_start_test_threads(gen); @@ -502,7 +502,7 @@ void csngen_test () _csngen_stop_test_threads(); csngen_dump_state (gen); - slapi_log_error(SLAPI_LOG_DEBUG, "csngen_test", "csn generator test is complete..."); + slapi_log_err(SLAPI_LOG_DEBUG, "csngen_test", "csn generator test is complete..."); } /* @@ -523,7 +523,7 @@ _csngen_parse_state (CSNGen *gen, Slapi_Attr *state) rc = slapi_attr_first_value(state, &val); if (rc != 0) { - slapi_log_error(SLAPI_LOG_ERR, "_csngen_parse_state", "Invalid state format\n"); + slapi_log_err(SLAPI_LOG_ERR, "_csngen_parse_state", "Invalid state format\n"); return CSN_INVALID_FORMAT; } @@ -533,7 +533,7 @@ _csngen_parse_state (CSNGen *gen, Slapi_Attr *state) /* replicaid does not match */ if (rid != gen->state.rid) { - slapi_log_error(SLAPI_LOG_ERR, "_csngen_parse_state", "Replica id" + slapi_log_err(SLAPI_LOG_ERR, "_csngen_parse_state", "Replica id" " mismatch; current id - %d, replica id in the state - %d\n", rid, gen->state.rid); return CSN_INVALID_FORMAT; @@ -634,7 +634,7 @@ _csngen_adjust_local_time (CSNGen *gen, time_t cur_time) time_t ts_after = 0; if (slapi_is_loglevel_set(SLAPI_LOG_REPL)) { time_t new_time = CSN_CALC_TSTAMP(gen); - slapi_log_error(SLAPI_LOG_REPL, "_csngen_adjust_local_time", + slapi_log_err(SLAPI_LOG_REPL, "_csngen_adjust_local_time", "gen state before %08lx%04x:%ld:%ld:%ld\n", new_time, gen->state.seq_num, gen->state.sampled_time, @@ -661,7 +661,7 @@ _csngen_adjust_local_time (CSNGen *gen, time_t cur_time) if (slapi_is_loglevel_set(SLAPI_LOG_REPL)) { time_t new_time = CSN_CALC_TSTAMP(gen); - slapi_log_error(SLAPI_LOG_REPL, "_csngen_adjust_local_time", + slapi_log_err(SLAPI_LOG_REPL, "_csngen_adjust_local_time", "gen state after %08lx%04x:%ld:%ld:%ld\n", new_time, gen->state.seq_num, gen->state.sampled_time, @@ -674,7 +674,7 @@ _csngen_adjust_local_time (CSNGen *gen, time_t cur_time) { if (slapi_is_loglevel_set(SLAPI_LOG_REPL)) { time_t new_time = CSN_CALC_TSTAMP(gen); - slapi_log_error(SLAPI_LOG_REPL, "_csngen_adjust_local_time", + slapi_log_err(SLAPI_LOG_REPL, "_csngen_adjust_local_time", "gen state back before %08lx%04x:%ld:%ld:%ld\n", new_time, gen->state.seq_num, gen->state.sampled_time, @@ -684,7 +684,7 @@ _csngen_adjust_local_time (CSNGen *gen, time_t cur_time) if (!ignore_time_skew && (labs (time_diff) > CSN_MAX_TIME_ADJUST)) { - slapi_log_error(SLAPI_LOG_ERR, "_csngen_adjust_local_time", + slapi_log_err(SLAPI_LOG_ERR, "_csngen_adjust_local_time", "Adjustment limit exceeded; value - %ld, limit - %d\n", labs (time_diff), CSN_MAX_TIME_ADJUST); return CSN_LIMIT_EXCEEDED; @@ -696,7 +696,7 @@ _csngen_adjust_local_time (CSNGen *gen, time_t cur_time) if (slapi_is_loglevel_set(SLAPI_LOG_REPL)) { time_t new_time = CSN_CALC_TSTAMP(gen); - slapi_log_error(SLAPI_LOG_REPL, "_csngen_adjust_local_time", + slapi_log_err(SLAPI_LOG_REPL, "_csngen_adjust_local_time", "gen state back after %08lx%04x:%ld:%ld:%ld\n", new_time, gen->state.seq_num, gen->state.sampled_time, @@ -737,7 +737,7 @@ _csngen_start_test_threads(CSNGen *gen) DEFAULT_THREAD_STACKSIZE) == NULL) { PRErrorCode prerr = PR_GetError(); - slapi_log_error(SLAPI_LOG_ERR, "_csngen_start_test_threads", + slapi_log_err(SLAPI_LOG_ERR, "_csngen_start_test_threads", "Failed to create a CSN generator thread number %d; " SLAPI_COMPONENT_NAME_NSPR " error %d (%s)\n", i, prerr, slapd_pr_strerror(prerr)); return -1; @@ -752,7 +752,7 @@ _csngen_start_test_threads(CSNGen *gen) DEFAULT_THREAD_STACKSIZE) == NULL) { PRErrorCode prerr = PR_GetError(); - slapi_log_error(SLAPI_LOG_ERR, "_csngen_start_test_threads", + slapi_log_err(SLAPI_LOG_ERR, "_csngen_start_test_threads", "Failed to create the remote CSN tester thread; " SLAPI_COMPONENT_NAME_NSPR " error %d (%s)\n", prerr, slapd_pr_strerror(prerr)); return -1; @@ -767,7 +767,7 @@ _csngen_start_test_threads(CSNGen *gen) { PRErrorCode prerr = PR_GetError(); - slapi_log_error(SLAPI_LOG_ERR, "_csngen_start_test_threads", + slapi_log_err(SLAPI_LOG_ERR, "_csngen_start_test_threads", "Failed to create the local CSN tester thread; " SLAPI_COMPONENT_NAME_NSPR " error %d (%s)\n", prerr, slapd_pr_strerror(prerr)); return -1; @@ -806,12 +806,12 @@ _csngen_gen_tester_main (void *data) rc = csngen_new_csn (gen, &csn, PR_FALSE); if (rc != CSN_SUCCESS) { - slapi_log_error(SLAPI_LOG_ERR, "_csngen_gen_tester_main", + slapi_log_err(SLAPI_LOG_ERR, "_csngen_gen_tester_main", "failed to generate csn; csn error - %d\n", rc); } else { - slapi_log_error(SLAPI_LOG_INFO, "_csngen_gen_tester_main", "generate csn %s\n", + slapi_log_err(SLAPI_LOG_INFO, "_csngen_gen_tester_main", "generate csn %s\n", csn_as_string(csn, PR_FALSE, buff)); } csn_free(&csn); @@ -840,7 +840,7 @@ _csngen_remote_tester_main (void *data) rc = csngen_new_csn (gen, &csn, PR_FALSE); if (rc != CSN_SUCCESS) { - slapi_log_error(SLAPI_LOG_ERR, "_csngen_remote_tester_main", + slapi_log_err(SLAPI_LOG_ERR, "_csngen_remote_tester_main", "Failed to generate csn; csn error - %d\n", rc); } else @@ -851,7 +851,7 @@ _csngen_remote_tester_main (void *data) rc = csngen_adjust_time (gen, csn); if (rc != CSN_SUCCESS) { - slapi_log_error(SLAPI_LOG_ERR, "_csngen_remote_tester_main", + slapi_log_err(SLAPI_LOG_ERR, "_csngen_remote_tester_main", "Failed to adjust generator's time; csn error - %d\n", rc); } diff --git a/ldap/servers/slapd/daemon.c b/ldap/servers/slapd/daemon.c index b949bba..895ba89 100644 --- a/ldap/servers/slapd/daemon.c +++ b/ldap/servers/slapd/daemon.c @@ -24,6 +24,7 @@ #include #include #include +#include #if defined(HAVE_MNTENT_H) #include #endif @@ -140,9 +141,9 @@ accept_and_configure(int s, PRFileDesc *pr_acceptfd, PRNetAddr *pr_netaddr, (*pr_clonefd) = PR_Accept(pr_acceptfd, pr_netaddr, pr_timeout); if( !(*pr_clonefd) ) { PRErrorCode prerr = PR_GetError(); - LDAPDebug(LDAP_DEBUG_ERR, "accept_and_configure - PR_Accept() failed, " + slapi_log_err(SLAPI_LOG_ERR, "accept_and_configure", "PR_Accept() failed, " SLAPI_COMPONENT_NAME_NSPR " error %d (%s)\n", - prerr, slapd_pr_strerror(prerr), 0 ); + prerr, slapd_pr_strerror(prerr)); return(SLAPD_INVALID_SOCKET); } ns = configure_pr_socket( pr_clonefd, secure, local ); @@ -194,7 +195,7 @@ static PRBool MY_TestAndEnterMonitor(MY_PRMonitor *mon) PR_ASSERT(mon != NULL); rv = pthread_mutex_lock(&mon->lock); if (rv != 0) { - slapi_log_error(SLAPI_LOG_ERR, "TestAndEnterMonitor", + slapi_log_err(SLAPI_LOG_ERR, "TestAndEnterMonitor", "Failed to acquire monitor mutex, error (%d)\n", rv); return rc; } @@ -203,7 +204,7 @@ static PRBool MY_TestAndEnterMonitor(MY_PRMonitor *mon) goto done; rv = pthread_mutex_unlock(&mon->lock); if (rv != 0) { - slapi_log_error(SLAPI_LOG_ERR,"TestAndEnterMonitor", + slapi_log_err(SLAPI_LOG_ERR,"TestAndEnterMonitor", "Failed to release monitor mutex, error (%d)\n", rv); } return PR_FALSE; @@ -219,7 +220,7 @@ done: if (rv == PR_SUCCESS) { rc = PR_TRUE; } else { - slapi_log_error(SLAPI_LOG_ERR,"TestAndEnterMonitor", + slapi_log_err(SLAPI_LOG_ERR,"TestAndEnterMonitor", "Failed to release monitor mutex, error (%d)\n", rv); rc = PR_FALSE; } @@ -570,8 +571,8 @@ disk_monitoring_thread(void *nothing) */ if(passed_threshold){ if(logs_disabled){ - LDAPDebug(LDAP_DEBUG_INFO, "disk_monitoring_thread - Disk space is now within acceptable levels. " - "Restoring the log settings.\n",0,0,0); + slapi_log_err(SLAPI_LOG_INFO, "disk_monitoring_thread", "Disk space is now within acceptable levels. " + "Restoring the log settings.\n"); if(using_accesslog){ config_set_accesslog_enabled(LOGGING_ON); } @@ -582,7 +583,7 @@ disk_monitoring_thread(void *nothing) config_set_auditfaillog_enabled(LOGGING_ON); } } else { - LDAPDebug(LDAP_DEBUG_INFO, "disk_monitoring_thread - Disk space is now within acceptable levels.\n",0,0,0); + slapi_log_err(SLAPI_LOG_INFO, "disk_monitoring_thread", "Disk space is now within acceptable levels.\n"); } deleted_rotated_logs = 0; passed_threshold = 0; @@ -597,8 +598,8 @@ disk_monitoring_thread(void *nothing) * Check if we are already critical */ if(disk_space < 4096){ /* 4 k */ - LDAPDebug(LDAP_DEBUG_ALERT, "disk_monitoring_thread - Disk space is critically low on disk (%s), " - "remaining space: %" NSPRIu64 " Kb. Signaling slapd for shutdown...\n", dirstr , (disk_space / 1024), 0); + slapi_log_err(SLAPI_LOG_ALERT, "disk_monitoring_thread", "Disk space is critically low on disk (%s), " + "remaining space: %" NSPRIu64 " Kb. Signaling slapd for shutdown...\n", dirstr , (disk_space / 1024)); g_set_shutdown( SLAPI_SHUTDOWN_EXIT ); return; } @@ -607,7 +608,7 @@ disk_monitoring_thread(void *nothing) * if logging is not critical */ if(verbose_logging != 0 && verbose_logging != LDAP_DEBUG_ANY){ - LDAPDebug(LDAP_DEBUG_ALERT, "disk_monitoring_thread - Disk space is low on disk (%s), remaining space: " + slapi_log_err(SLAPI_LOG_ALERT, "disk_monitoring_thread", "Disk space is low on disk (%s), remaining space: " "%" NSPRIu64 " Kb, temporarily setting error loglevel to the default level(%d).\n", dirstr, (disk_space / 1024), SLAPD_DEFAULT_ERRORLOG_LEVEL); /* Setting the log level back to zero, actually sets the value to LDAP_DEBUG_ANY */ @@ -621,8 +622,8 @@ disk_monitoring_thread(void *nothing) * access/audit logs, log another error, and continue. */ if(!logs_disabled && !logging_critical){ - LDAPDebug(LDAP_DEBUG_ALERT, "disk_monitoring_thread - Disk space is too low on disk (%s), remaining " - "space: %" NSPRIu64 " Kb, disabling access and audit logging.\n", dirstr, (disk_space / 1024), 0); + slapi_log_err(SLAPI_LOG_ALERT, "disk_monitoring_thread", "Disk space is too low on disk (%s), remaining " + "space: %" NSPRIu64 " Kb, disabling access and audit logging.\n", dirstr, (disk_space / 1024)); config_set_accesslog_enabled(LOGGING_OFF); config_set_auditlog_enabled(LOGGING_OFF); config_set_auditfaillog_enabled(LOGGING_OFF); @@ -634,8 +635,8 @@ disk_monitoring_thread(void *nothing) * access/audit logging, then delete the rotated logs, log another error, and continue. */ if(!deleted_rotated_logs && !logging_critical){ - LDAPDebug(LDAP_DEBUG_ALERT, "disk_monitoring_thread - Disk space is too low on disk (%s), remaining " - "space: %" NSPRIu64 " Kb, deleting rotated logs.\n", dirstr, (disk_space / 1024), 0); + slapi_log_err(SLAPI_LOG_ALERT, "disk_monitoring_thread", "Disk space is too low on disk (%s), remaining " + "space: %" NSPRIu64 " Kb, deleting rotated logs.\n", dirstr, (disk_space / 1024)); log__delete_rotated_logs(); deleted_rotated_logs = 1; continue; @@ -644,8 +645,8 @@ disk_monitoring_thread(void *nothing) * Ok, we've done what we can, log a message if we continue to lose available disk space */ if(disk_space < previous_mark){ - LDAPDebug(LDAP_DEBUG_ALERT, "disk_monitoring_thread - Disk space is too low on disk (%s), remaining " - "space: %" NSPRIu64 " Kb\n", dirstr, (disk_space / 1024), 0); + slapi_log_err(SLAPI_LOG_ALERT, "disk_monitoring_thread", "Disk space is too low on disk (%s), remaining " + "space: %" NSPRIu64 " Kb\n", dirstr, (disk_space / 1024)); } /* * @@ -656,7 +657,7 @@ disk_monitoring_thread(void *nothing) * */ if(disk_space < halfway){ - LDAPDebug(LDAP_DEBUG_ALERT, "disk_monitoring_thread - Disk space on (%s) is too far below the threshold(%" NSPRIu64 " bytes). " + slapi_log_err(SLAPI_LOG_ALERT, "disk_monitoring_thread", "Disk space on (%s) is too far below the threshold(%" NSPRIu64 " bytes). " "Waiting %d minutes for disk space to be cleaned up before shutting slapd down...\n", dirstr, threshold, (grace_period / 60)); time(&start); @@ -678,9 +679,9 @@ disk_monitoring_thread(void *nothing) /* * Excellent, we are back to acceptable levels, reset everything... */ - LDAPDebug(LDAP_DEBUG_INFO, "disk_monitoring_thread - Available disk space is now " + slapi_log_err(SLAPI_LOG_INFO, "disk_monitoring_thread", "Available disk space is now " "acceptable (%" NSPRIu64 " bytes). Aborting shutdown, and restoring the log settings.\n", - disk_space,0,0); + disk_space); if(logs_disabled && using_accesslog){ config_set_accesslog_enabled(LOGGING_ON); } @@ -702,9 +703,9 @@ disk_monitoring_thread(void *nothing) /* * Disk space is critical, log an error, and shut it down now! */ - LDAPDebug(LDAP_DEBUG_ALERT, "disk_monitoring_thread - Disk space is critically low " + slapi_log_err(SLAPI_LOG_ALERT, "disk_monitoring_thread", "Disk space is critically low " "on disk (%s), remaining space: %" NSPRIu64 " Kb. Signaling slapd for shutdown...\n", - dirstr, (disk_space / 1024), 0); + dirstr, (disk_space / 1024)); g_set_shutdown( SLAPI_SHUTDOWN_DISKFULL ); return; } @@ -720,8 +721,8 @@ disk_monitoring_thread(void *nothing) /* * If disk space was freed up we would of detected in the above while loop. So shut it down. */ - LDAPDebug(LDAP_DEBUG_ALERT, "disk_monitoring_thread - Disk space is still too low " - "(%" NSPRIu64 " Kb). Signaling slapd for shutdown...\n", (disk_space / 1024), 0, 0); + slapi_log_err(SLAPI_LOG_ALERT, "disk_monitoring_thread", "Disk space is still too low " + "(%" NSPRIu64 " Kb). Signaling slapd for shutdown...\n", (disk_space / 1024)); g_set_shutdown( SLAPI_SHUTDOWN_DISKFULL ); return; @@ -743,7 +744,7 @@ handle_listeners(Connection_Table *ct) /* accept() the new connection, put it on the active list for handle_pr_read_ready */ int rc = handle_new_connection(ct, SLAPD_INVALID_SOCKET, listenfd, secure, local, NULL); if (rc) { - LDAPDebug1Arg(LDAP_DEBUG_CONNS, "Error accepting new connection listenfd=%d\n", + slapi_log_err(SLAPI_LOG_CONNS, "handle_listeners", "Error accepting new connection listenfd=%d\n", PR_FileDesc2NativeHandle(listenfd)); continue; } @@ -808,7 +809,7 @@ convert_pbe_des_to_aes(void) * Find any entries in cn=config that contain DES passwords and convert * them to AES */ - slapi_log_error(SLAPI_LOG_HOUSE, "convert_pbe_des_to_aes", + slapi_log_err(SLAPI_LOG_HOUSE, "convert_pbe_des_to_aes", "Converting DES passwords to AES...\n"); for (i = 0; attrs && attrs[i]; i++){ @@ -837,7 +838,7 @@ convert_pbe_des_to_aes(void) /* decode the DES password */ if(pw_rever_decode(val, &passwd, attrs[i]) == -1){ - slapi_log_error(SLAPI_LOG_ERR,"convert_pbe_des_to_aes", + slapi_log_err(SLAPI_LOG_ERR,"convert_pbe_des_to_aes", "Failed to decode existing DES password for (%s)\n", slapi_entry_get_dn(entries[ii])); rc = -1; @@ -847,7 +848,7 @@ convert_pbe_des_to_aes(void) if (rc == 0){ sval = slapi_value_new_string(passwd); if(pw_rever_encode(&sval, attrs[i]) == -1){ - slapi_log_error(SLAPI_LOG_ERR, "convert_pbe_des_to_aes", + slapi_log_err(SLAPI_LOG_ERR, "convert_pbe_des_to_aes", "failed to encode AES password for (%s)\n", slapi_entry_get_dn(entries[ii])); rc = -1; @@ -871,13 +872,13 @@ convert_pbe_des_to_aes(void) slapi_pblock_get(pb, SLAPI_PLUGIN_INTOP_RESULT, &result); if (LDAP_SUCCESS != result) { - slapi_log_error(SLAPI_LOG_ERR, "convert_pbe_des_to_aes" + slapi_log_err(SLAPI_LOG_ERR, "convert_pbe_des_to_aes", "Failed to convert password for (%s) error (%d)\n", slapi_entry_get_dn(entries[ii]), result); } else { - slapi_log_error(SLAPI_LOG_HOUSE, "convert_pbe_des_to_aes", + slapi_log_err(SLAPI_LOG_HOUSE, "convert_pbe_des_to_aes", "Successfully converted password for (%s)\n", - slapi_entry_get_dn(entries[ii])); + slapi_entry_get_dn(entries[ii])); converted_des_passwd = 1; } } @@ -894,7 +895,7 @@ convert_pbe_des_to_aes(void) slapi_ch_free_string(&filter); } if (!converted_des_passwd){ - slapi_log_error(SLAPI_LOG_HOUSE, "convert_pbe_des_to_aes", + slapi_log_err(SLAPI_LOG_HOUSE, "convert_pbe_des_to_aes", "No DES passwords found to convert.\n"); } } @@ -1015,8 +1016,7 @@ void slapd_daemon( daemon_ports_t *ports ) (i_unix == NULL) && #endif /* ENABLE_LDAPI */ (s_tcps == NULL) ) { /* nothing to do */ - LDAPDebug(LDAP_DEBUG_ERR, - "no port to listen on\n", 0, 0, 0 ); + slapi_log_err(SLAPI_LOG_ERR, "slapd_daemon", "No port to listen on\n"); exit( 1 ); } @@ -1030,9 +1030,9 @@ void slapd_daemon( daemon_ports_t *ports ) SLAPD_DEFAULT_THREAD_STACKSIZE); if ( NULL == time_thread_p ) { PRErrorCode errorCode = PR_GetError(); - LDAPDebug(LDAP_DEBUG_EMERG, "slapd_daemon - Unable to create time thread - Shutting Down (" + slapi_log_err(SLAPI_LOG_EMERG, "slapd_daemon", "Unable to create time thread - Shutting Down (" SLAPI_COMPONENT_NAME_NSPR " error %d - %s)\n", - errorCode, slapd_pr_strerror(errorCode), 0); + errorCode, slapd_pr_strerror(errorCode)); g_set_shutdown( SLAPI_SHUTDOWN_EXIT ); } @@ -1042,7 +1042,7 @@ void slapd_daemon( daemon_ports_t *ports ) */ if( config_get_disk_monitoring() ){ if ( ( diskmon_mutex = PR_NewLock() ) == NULL ) { - slapi_log_error(SLAPI_LOG_ERR, "slapd_daemon", + slapi_log_err(SLAPI_LOG_ERR, "slapd_daemon", "Cannot create new lock for disk space monitoring. " SLAPI_COMPONENT_NAME_NSPR " error %d (%s)\n", PR_GetError(), slapd_pr_strerror( PR_GetError() )); @@ -1050,7 +1050,7 @@ void slapd_daemon( daemon_ports_t *ports ) } if ( diskmon_mutex ){ if(( diskmon_cvar = PR_NewCondVar( diskmon_mutex )) == NULL ) { - slapi_log_error(SLAPI_LOG_EMERG, "slapd_daemon", + slapi_log_err(SLAPI_LOG_EMERG, "slapd_daemon", "Cannot create new condition variable for disk space monitoring. " SLAPI_COMPONENT_NAME_NSPR " error %d (%s)\n", PR_GetError(), slapd_pr_strerror( PR_GetError() )); @@ -1065,9 +1065,9 @@ void slapd_daemon( daemon_ports_t *ports ) SLAPD_DEFAULT_THREAD_STACKSIZE); if ( NULL == disk_thread_p ) { PRErrorCode errorCode = PR_GetError(); - LDAPDebug(LDAP_DEBUG_EMERG, "slapd_daemon - Unable to create disk monitoring thread - Shutting Down (" + slapi_log_err(SLAPI_LOG_EMERG, "slapd_daemon", "Unable to create disk monitoring thread - Shutting Down (" SLAPI_COMPONENT_NAME_NSPR " error %d - %s)\n", - errorCode, slapd_pr_strerror(errorCode), 0); + errorCode, slapd_pr_strerror(errorCode)); g_set_shutdown( SLAPI_SHUTDOWN_EXIT ); } } @@ -1082,7 +1082,7 @@ void slapd_daemon( daemon_ports_t *ports ) PRErrorCode prerr = PR_GetError(); char addrbuf[ 256 ]; - slapi_log_error(SLAPI_LOG_EMERG, "slapd_daemon", + slapi_log_err(SLAPI_LOG_EMERG, "slapd_daemon", "PR_Listen() on %s port %d failed: %s error %d (%s)\n", netaddr2string(*nap, addrbuf, sizeof(addrbuf)), ports->n_port, SLAPI_COMPONENT_NAME_NSPR, prerr, @@ -1101,7 +1101,7 @@ void slapd_daemon( daemon_ports_t *ports ) PRErrorCode prerr = PR_GetError(); char addrbuf[ 256 ]; - slapi_log_error(SLAPI_LOG_EMERG, "slapd_daemon", + slapi_log_err(SLAPI_LOG_EMERG, "slapd_daemon", "PR_Listen() on %s port %d failed: %s error %d (%s)\n", netaddr2string(*sap, addrbuf, sizeof(addrbuf)), ports->s_port, SLAPI_COMPONENT_NAME_NSPR, prerr, @@ -1119,7 +1119,7 @@ void slapd_daemon( daemon_ports_t *ports ) for (fdesp = i_unix; fdesp && *fdesp; fdesp++, iap++) { if ( PR_Listen(*fdesp, config_get_listen_backlog_size()) == PR_FAILURE) { PRErrorCode prerr = PR_GetError(); - slapi_log_error(SLAPI_LOG_EMERG, "slapd_daemon", + slapi_log_err(SLAPI_LOG_EMERG, "slapd_daemon", "listen() on %s failed: error %d (%s)\n", (*iap)->local.path, prerr, @@ -1188,9 +1188,9 @@ void slapd_daemon( daemon_ports_t *ports ) #ifdef ENABLE_NUNC_STANS if (enable_nunc_stans && ns_thrpool_wait(tp)) { - LDAPDebug(LDAP_DEBUG_ERR, - "slapd-daemon - ns_thrpool_wait failed errno %d (%s)\n", errno, - slapd_system_strerror(errno), 0 ); + slapi_log_err(SLAPI_LOG_ERR, + "slapd-daemon", "ns_thrpool_wait failed errno %d (%s)\n", errno, + slapd_system_strerror(errno)); } #endif /* The meat of the operation is in a loop on a call to select */ @@ -1207,9 +1207,9 @@ void slapd_daemon( daemon_ports_t *ports ) break; case -1: /* Error */ prerr = PR_GetError(); - LDAPDebug(LDAP_DEBUG_TRACE, "slapd_daemon - PR_Poll() failed, " + slapi_log_err(SLAPI_LOG_TRACE, "slapd_daemon", "PR_Poll() failed, " SLAPI_COMPONENT_NAME_NSPR " error %d (%s)\n", - prerr, slapd_system_strerror(prerr), 0 ); + prerr, slapd_system_strerror(prerr)); break; default: /* either a new connection or some new data ready */ /* handle new connections from the listeners */ @@ -1279,9 +1279,9 @@ void slapd_daemon( daemon_ports_t *ports ) threads = g_get_active_threadcnt(); if ( threads > 0 ) { - LDAPDebug(LDAP_DEBUG_INFO, + slapi_log_err(SLAPI_LOG_INFO, "slapd_daemon", "slapd shutting down - waiting for %d thread%s to terminate\n", - threads, ( threads > 1 ) ? "s" : "", 0 ); + threads, ( threads > 1 ) ? "s" : ""); } threads = g_get_active_threadcnt(); @@ -1301,16 +1301,16 @@ void slapd_daemon( daemon_ports_t *ports ) spe = PR_Read(signalpipe[0], &x, 1); if (spe < 0) { PRErrorCode prerr = PR_GetError(); - LDAPDebug(LDAP_DEBUG_ERR, "slapd_daemon - listener could not clear signal pipe, " + slapi_log_err(SLAPI_LOG_ERR, "slapd_daemon", "listener could not clear signal pipe, " SLAPI_COMPONENT_NAME_NSPR " error %d (%s)\n", - prerr, slapd_system_strerror(prerr), 0 ); + prerr, slapd_system_strerror(prerr)); break; } } else if (spe == -1) { PRErrorCode prerr = PR_GetError(); - LDAPDebug(LDAP_DEBUG_ERR, "slapd_daemon - PR_Poll() failed, " + slapi_log_err(SLAPI_LOG_ERR, "slapd_daemon", "PR_Poll() failed, " SLAPI_COMPONENT_NAME_NSPR " error %d (%s)\n", - prerr, slapd_system_strerror(prerr), 0 ); + prerr, slapd_system_strerror(prerr)); break; } else { /* no data */ @@ -1318,21 +1318,21 @@ void slapd_daemon( daemon_ports_t *ports ) } DS_Sleep(PR_INTERVAL_NO_WAIT); if ( threads != g_get_active_threadcnt() ) { - LDAPDebug(LDAP_DEBUG_TRACE, + slapi_log_err(SLAPI_LOG_TRACE, "slapd_daemon", "slapd shutting down - waiting for %d threads to terminate\n", - g_get_active_threadcnt(), 0, 0 ); + g_get_active_threadcnt()); threads = g_get_active_threadcnt(); } } - LDAPDebug(LDAP_DEBUG_INFO, - "slapd shutting down - closing down internal subsystems and plugins\n", - 0, 0, 0 ); + slapi_log_err(SLAPI_LOG_INFO, "slapd_daemon", + "slapd shutting down - closing down internal subsystems and plugins\n"); log_access_flush(); /* let backends do whatever cleanup they need to do */ - LDAPDebug(LDAP_DEBUG_TRACE,"slapd shutting down - waiting for backends to close down\n", 0, 0,0 ); + slapi_log_err(SLAPI_LOG_TRACE, "slapd_daemon", + "slapd shutting down - waiting for backends to close down\n"); eq_stop(); if ( ! in_referral_mode ) { @@ -1373,8 +1373,7 @@ void slapd_daemon( daemon_ports_t *ports ) be_cleanupall (); plugin_dependency_freeall(); connection_post_shutdown_cleanup(); - LDAPDebug(LDAP_DEBUG_TRACE, "slapd shutting down - backends closed down\n", - 0, 0, 0 ); + slapi_log_err(SLAPI_LOG_TRACE, "slapd_daemon", "slapd shutting down - backends closed down\n"); referrals_free(); schema_destroy_dse_lock(); @@ -1385,7 +1384,7 @@ void slapd_daemon( daemon_ports_t *ports ) if ( g_get_shutdown() == SLAPI_SHUTDOWN_DISKFULL ){ /* This is a server-induced shutdown, we need to manually remove the pid file */ if( unlink(get_pid_file()) ){ - LDAPDebug(LDAP_DEBUG_ERR, "slapd_daemon - Failed to remove pid file %s\n", get_pid_file(), 0, 0 ); + slapi_log_err(SLAPI_LOG_ERR, "slapd_daemon", "Failed to remove pid file %s\n", get_pid_file()); } } } @@ -1400,9 +1399,9 @@ int signal_listner() /* this now means that the pipe is full * this is not a problem just go-on */ - LDAPDebug(LDAP_DEBUG_CONNS, - "signal_listner - Listener could not write to signal pipe %d\n", - errno, 0, 0 ); + slapi_log_err(SLAPI_LOG_CONNS, + "signal_listner", "Listener could not write to signal pipe %d\n", + errno); } return( 0 ); } @@ -1415,10 +1414,9 @@ static int clear_signal(struct POLL_STRUCT *fds) if ( fds[FDS_SIGNAL_PIPE].out_flags & SLAPD_POLL_FLAGS ) { char buf[200]; - LDAPDebug(LDAP_DEBUG_CONNS, "clear_signal - Listener got signaled\n", 0, 0, 0 ); + slapi_log_err(SLAPI_LOG_CONNS, "clear_signal", "Listener got signaled\n"); if ( read( readsignalpipe, buf, 200 ) < 1 ) { - LDAPDebug(LDAP_DEBUG_ERR, "clear_signal - Listener could not clear signal pipe\n", - 0, 0, 0 ); + slapi_log_err(SLAPI_LOG_ERR, "clear_signal", "Listener could not clear signal pipe\n"); } } return 0; @@ -1444,16 +1442,16 @@ setup_pr_read_pds(Connection_Table *ct, PRFileDesc **n_tcps, PRFileDesc **s_tcps > slapdFrontendConfig->reservedescriptors); if ( ! accept_new_connections ) { if ( last_accept_new_connections ) { - LDAPDebug(LDAP_DEBUG_ERR, "setup_pr_read_pds - Not listening for new " - "connections - too many fds open\n", 0, 0, 0 ); + slapi_log_err(SLAPI_LOG_ERR, "setup_pr_read_pds", + "Not listening for new connections - too many fds open\n"); /* reinitialize n_tcps and s_tcps to the pds */ first_time_setup_pr_read_pds = 1; } } else { if ( ! last_accept_new_connections && last_accept_new_connections != -1 ) { - LDAPDebug(LDAP_DEBUG_ERR, "setup_pr_read_pds - Listening for new " - "connections again\n", 0, 0, 0 ); + slapi_log_err(SLAPI_LOG_ERR, "setup_pr_read_pds", + "Listening for new connections again\n"); /* reinitialize n_tcps and s_tcps to the pds */ first_time_setup_pr_read_pds = 1; } @@ -1490,8 +1488,8 @@ setup_pr_read_pds(Connection_Table *ct, PRFileDesc **n_tcps, PRFileDesc **s_tcps listener_idxs[n_listeners].listenfd = *fdesc; listener_idxs[n_listeners].idx = count; n_listeners++; - LDAPDebug(LDAP_DEBUG_HOUSE, - "setup_pr_read_pds - Listening for connections on %d\n", socketdesc, 0, 0 ); + slapi_log_err(SLAPI_LOG_HOUSE, + "setup_pr_read_pds", "Listening for connections on %d\n", socketdesc); } } else { ct->fd[count].fd = NULL; @@ -1512,8 +1510,8 @@ setup_pr_read_pds(Connection_Table *ct, PRFileDesc **n_tcps, PRFileDesc **s_tcps listener_idxs[n_listeners].idx = count; listener_idxs[n_listeners].secure = 1; n_listeners++; - LDAPDebug(LDAP_DEBUG_HOUSE, - "setup_pr_read_pds - Listening for SSL connections on %d\n", socketdesc, 0, 0 ); + slapi_log_err(SLAPI_LOG_HOUSE, + "setup_pr_read_pds", "Listening for SSL connections on %d\n", socketdesc); } } else { ct->fd[count].fd = NULL; @@ -1536,8 +1534,8 @@ setup_pr_read_pds(Connection_Table *ct, PRFileDesc **n_tcps, PRFileDesc **s_tcps listener_idxs[n_listeners].idx = count; listener_idxs[n_listeners].local = 1; n_listeners++; - LDAPDebug(LDAP_DEBUG_HOUSE, - "setup_pr_read_pds - Listening for LDAPI connections on %d\n", socketdesc, 0, 0 ); + slapi_log_err(SLAPI_LOG_HOUSE, + "setup_pr_read_pds", "Listening for LDAPI connections on %d\n", socketdesc); } } else { ct->fd[count].fd = NULL; @@ -1731,17 +1729,17 @@ handle_pr_read_ready(Connection_Table *ct, PRIntn num_poll) if ( !readready && out_flags ) { /* some error occured */ - LDAPDebug(LDAP_DEBUG_CONNS, - "handle_pr_read_ready - POLL_FN() says connection on sd %d is bad " - "(closing)\n", c->c_sd, 0, 0 ); + slapi_log_err(SLAPI_LOG_CONNS, + "handle_pr_read_ready", "POLL_FN() says connection on sd %d is bad " + "(closing)\n", c->c_sd); disconnect_server_nomutex( c, c->c_connid, -1, SLAPD_DISCONNECT_POLL, EPIPE ); } else if ( readready ) { /* read activity */ - LDAPDebug(LDAP_DEBUG_CONNS, - "handle_pr_read_ready - read activity on %d\n", c->c_ci, 0, 0 ); + slapi_log_err(SLAPI_LOG_CONNS, + "handle_pr_read_ready", "read activity on %d\n", c->c_ci); c->c_idlesince = curtime; /* This is where the work happens ! */ @@ -1750,9 +1748,9 @@ handle_pr_read_ready(Connection_Table *ct, PRIntn num_poll) /* This might happen as a result of * trying to acquire a closing connection */ - LDAPDebug(LDAP_DEBUG_ERR, - "handle_pr_read_ready - connection_activity: abandoning conn %" NSPRIu64 " as " - "fd=%d is already closing\n", c->c_connid,c->c_sd,0); + slapi_log_err(SLAPI_LOG_ERR, + "handle_pr_read_ready", "connection_activity: abandoning conn %" NSPRIu64 " as " + "fd=%d is already closing\n", c->c_connid,c->c_sd); /* The call disconnect_server should do nothing, * as the connection c should be already set to CLOSING */ disconnect_server_nomutex( c, c->c_connid, -1, @@ -1809,7 +1807,7 @@ ns_handle_closure(struct ns_job_t *job) #else /* This doesn't actually confirm it's in the event loop thread, but it's a start */ if (NS_JOB_IS_THREAD(ns_job_get_type(job)) != 0) { - LDAPDebug2Args(LDAP_DEBUG_ERR, "ns_handle_closure - Attempt to close outside of event loop thread %" NSPRIu64 " for fd=%d\n", + slapi_log_err(SLAPI_LOG_ERR, "ns_handle_closure", "Attempt to close outside of event loop thread %" NSPRIu64 " for fd=%d\n", c->c_connid, c->c_sd); return; } @@ -1848,7 +1846,7 @@ ns_connection_post_io_or_closing(Connection *conn) /* there should only ever be 0 or 1 active closure jobs */ PR_ASSERT((conn->c_ns_close_jobs == 0) || (conn->c_ns_close_jobs == 1)); if (conn->c_ns_close_jobs) { - LDAPDebug2Args(LDAP_DEBUG_CONNS, "ns_connection_post_io_or_closing - already a close " + slapi_log_err(SLAPI_LOG_CONNS, "ns_connection_post_io_or_closing", "Already a close " "job in progress on conn %" NSPRIu64 " for fd=%d\n", conn->c_connid, conn->c_sd); return; } else { @@ -1859,7 +1857,7 @@ ns_connection_post_io_or_closing(Connection *conn) connection_acquire_nolock_ext(conn, 1 /* allow acquire even when closing */); /* event framework now has a reference */ ns_add_timeout_job(conn->c_tp, &tv, NS_JOB_TIMER, ns_handle_closure, conn, NULL); - LDAPDebug2Args(LDAP_DEBUG_CONNS, "ns_connection_post_io_or_closing - post closure job " + slapi_log_err(SLAPI_LOG_CONNS, "ns_connection_post_io_or_closing", "post closure job " "for conn %" NSPRIu64 " for fd=%d\n", conn->c_connid, conn->c_sd); } @@ -1882,7 +1880,7 @@ ns_connection_post_io_or_closing(Connection *conn) ns_add_io_timeout_job(conn->c_tp, conn->c_prfd, &tv, NS_JOB_READ|NS_JOB_PRESERVE_FD, ns_handle_pr_read_ready, conn, NULL); - LDAPDebug2Args(LDAP_DEBUG_CONNS, "ns_connection_post_io_or_closing - post I/O job for " + slapi_log_err(SLAPI_LOG_CONNS, "ns_connection_post_io_or_closing", "post I/O job for " "conn %" NSPRIu64 " for fd=%d\n", conn->c_connid, conn->c_sd); } #endif @@ -1905,14 +1903,14 @@ ns_handle_pr_read_ready(struct ns_job_t *job) #else /* This doesn't actually confirm it's in the event loop thread, but it's a start */ if (NS_JOB_IS_THREAD(ns_job_get_type(job)) != 0) { - LDAPDebug2Args(LDAP_DEBUG_ERR, "ns_handle_pr_read_ready - Attempt to handle read ready outside of event loop thread %" NSPRIu64 " for fd=%d\n", + slapi_log_err(SLAPI_LOG_ERR, "ns_handle_pr_read_ready", "Attempt to handle read ready outside of event loop thread %" NSPRIu64 " for fd=%d\n", c->c_connid, c->c_sd); return; } #endif PR_EnterMonitor(c->c_mutex); - LDAPDebug2Args(LDAP_DEBUG_CONNS, "ns_handle_pr_read_ready - activity on conn %" NSPRIu64 " for fd=%d\n", + slapi_log_err(SLAPI_LOG_CONNS, "ns_handle_pr_read_ready", "activity on conn %" NSPRIu64 " for fd=%d\n", c->c_connid, c->c_sd); /* if we were called due to some i/o event, see what the state of the socket is */ if (slapi_is_loglevel_set(SLAPI_LOG_CONNS) && !NS_JOB_IS_TIMER(ns_job_get_output_type(job)) && c && c->c_sd) { @@ -1920,16 +1918,16 @@ ns_handle_pr_read_ready(struct ns_job_t *job) char buf[1]; ssize_t rc = recv(c->c_sd, buf, sizeof(buf), MSG_PEEK); if (!rc) { - LDAPDebug2Args(LDAP_DEBUG_CONNS, "ns_handle_pr_read_ready - socket is closed conn" + slapi_log_err(SLAPI_LOG_CONNS, "ns_handle_pr_read_ready", "socket is closed conn" " %" NSPRIu64 " for fd=%d\n", c->c_connid, c->c_sd); } else if (rc > 0) { - LDAPDebug2Args(LDAP_DEBUG_CONNS, "ns_handle_pr_read_ready - socket read data available" + slapi_log_err(SLAPI_LOG_CONNS, "ns_handle_pr_read_ready", "socket read data available" " for conn %" NSPRIu64 " for fd=%d\n", c->c_connid, c->c_sd); } else if ((errno == EAGAIN) || (errno == EWOULDBLOCK)) { - LDAPDebug2Args(LDAP_DEBUG_CONNS, "ns_handle_pr_read_ready - socket has no data available" + slapi_log_err(SLAPI_LOG_CONNS, "ns_handle_pr_read_ready", "socket has no data available" " conn %" NSPRIu64 " for fd=%d\n", c->c_connid, c->c_sd); } else { - LDAPDebug(LDAP_DEBUG_CONNS, "ns_handle_pr_read_ready - socket has error [%d] " + slapi_log_err(SLAPI_LOG_CONNS, "ns_handle_pr_read_ready", "socket has error [%d] " "conn %" NSPRIu64 " for fd=%d\n", errno, c->c_connid, c->c_sd); } } @@ -1946,7 +1944,7 @@ ns_handle_pr_read_ready(struct ns_job_t *job) /* This might happen as a result of * trying to acquire a closing connection */ - LDAPDebug2Args(LDAP_DEBUG_ERR, "ns_handle_pr_read_ready - connection_activity: abandoning" + slapi_log_err(SLAPI_LOG_ERR, "ns_handle_pr_read_ready", "connection_activity: abandoning" " conn %" NSPRIu64 " as fd=%d is already closing\n", c->c_connid, c->c_sd); /* The call disconnect_server should do nothing, * as the connection c should be already set to CLOSING */ @@ -1955,7 +1953,7 @@ ns_handle_pr_read_ready(struct ns_job_t *job) 0 /* do not schedule closure, do it next */); ns_handle_closure_nomutex(c); } else { - LDAPDebug2Args(LDAP_DEBUG_CONNS, "ns_handle_pr_read_ready - queued conn %" NSPRIu64 " for fd=%d\n", + slapi_log_err(SLAPI_LOG_CONNS, "ns_handle_pr_read_ready", "queued conn %" NSPRIu64 " for fd=%d\n", c->c_connid, c->c_sd); } PR_ExitMonitor(c->c_mutex); @@ -1994,9 +1992,9 @@ slapd_poll( void *handle, int output ) if (rc < 0) { PRErrorCode prerr = PR_GetError(); - LDAPDebug(LDAP_DEBUG_ERR, "slapd_poll (%d) - " - SLAPI_COMPONENT_NAME_NSPR " error %d (%s)\n", - handle, prerr, slapd_pr_strerror(prerr)); + slapi_log_err(SLAPI_LOG_ERR, "slapd_poll", + "(%d) - %s error %d (%s)\n", + (int)(uintptr_t)handle, SLAPI_COMPONENT_NAME_NSPR, prerr, slapd_pr_strerror(prerr)); if ( prerr == PR_PENDING_INTERRUPT_ERROR || SLAPD_PR_WOULD_BLOCK_ERROR(prerr)) { @@ -2005,8 +2003,7 @@ slapd_poll( void *handle, int output ) } else if (rc == 0 && ioblock_timeout > 0) { PRIntn ihandle; ihandle = PR_FileDesc2NativeHandle((PRFileDesc *)handle); - LDAPDebug(LDAP_DEBUG_ERR, "slapd_poll(%d) - Timed out\n", - ihandle, 0, 0); + slapi_log_err(SLAPI_LOG_ERR, "slapd_poll", "(%d) - Timed out\n", ihandle); PR_SetError(PR_IO_TIMEOUT_ERROR, EAGAIN); /* timeout */ rc = -1; } @@ -2042,27 +2039,27 @@ write_function( int ignore, const void *buffer, int count, struct lextiof_socket sentbytes += bytes; } else if (bytes < 0) { PRErrorCode prerr = PR_GetError(); - LDAPDebug(LDAP_DEBUG_CONNS, "write_function - PR_Write(%d) " + slapi_log_err(SLAPI_LOG_CONNS, "write_function", "PR_Write(%d) " SLAPI_COMPONENT_NAME_NSPR " error %d (%s)\n", fd, prerr, slapd_pr_strerror( prerr )); if ( !SLAPD_PR_WOULD_BLOCK_ERROR(prerr)) { if (prerr != PR_CONNECT_RESET_ERROR) { /* 'TCP connection reset by peer': no need to log */ - LDAPDebug(LDAP_DEBUG_ERR, "write_function - PR_Write(%d) " + slapi_log_err(SLAPI_LOG_ERR, "write_function", "PR_Write(%d) " SLAPI_COMPONENT_NAME_NSPR " error %d (%s)\n", fd, prerr, slapd_pr_strerror( prerr )); } if (sentbytes < count) { - LDAPDebug(LDAP_DEBUG_CONNS, - "write_function - PR_Write(%d) - wrote only %d bytes (expected %d bytes) - 0 (EOF)\n", /* disconnected */ + slapi_log_err(SLAPI_LOG_CONNS, + "write_function", "PR_Write(%d) - wrote only %d bytes (expected %d bytes) - 0 (EOF)\n", /* disconnected */ fd, sentbytes, count); } break; /* fatal error */ } } else if (bytes == 0) { /* disconnect */ PRErrorCode prerr = PR_GetError(); - LDAPDebug(LDAP_DEBUG_CONNS, - "write_function - PR_Write(%d) - 0 (EOF) %d:%s\n", /* disconnected */ + slapi_log_err(SLAPI_LOG_CONNS, + "write_function", "PR_Write(%d) - 0 (EOF) %d:%s\n", /* disconnected */ fd, prerr, slapd_pr_strerror(prerr)); PR_SetError(PR_PIPE_ERROR, EPIPE); break; @@ -2071,8 +2068,8 @@ write_function( int ignore, const void *buffer, int count, struct lextiof_socket if (sentbytes == count) { /* success */ return count; } else if (sentbytes > count) { /* too many bytes */ - LDAPDebug(LDAP_DEBUG_ERR, - "write_function - PR_Write(%d) overflow - sent %d bytes (expected %d bytes) - error\n", + slapi_log_err(SLAPI_LOG_ERR, + "write_function", "PR_Write(%d) overflow - sent %d bytes (expected %d bytes) - error\n", fd, sentbytes, count); PR_SetError(PR_BUFFER_OVERFLOW_ERROR, EMSGSIZE); break; @@ -2522,7 +2519,7 @@ handle_new_connection(Connection_Table *ct, int tcps, PRFileDesc *pr_acceptfd, i if (rv < 0) { PRErrorCode prerr = PR_GetError(); - LDAPDebug(LDAP_DEBUG_ERR, "handle_new_connection - SSL_HandshakeCallback() %d " + slapi_log_err(SLAPI_LOG_ERR, "handle_new_connection", "SSL_HandshakeCallback() %d " SLAPI_COMPONENT_NAME_NSPR " error %d (%s)\n", rv, prerr, slapd_pr_strerror( prerr )); } @@ -2530,7 +2527,7 @@ handle_new_connection(Connection_Table *ct, int tcps, PRFileDesc *pr_acceptfd, i if (rv < 0) { PRErrorCode prerr = PR_GetError(); - LDAPDebug(LDAP_DEBUG_ERR, "handle_new_connection - SSL_BadCertHook(%i) %i " + slapi_log_err(SLAPI_LOG_ERR, "handle_new_connection", "SSL_BadCertHook(%i) %i " SLAPI_COMPONENT_NAME_NSPR " error %d\n", conn->c_sd, rv, prerr); } @@ -2603,7 +2600,7 @@ ns_handle_new_connection(struct ns_job_t *job) */ slapi_log_error(SLAPI_LOG_FATAL, "ns_handle_new_connection", "PR_PROC_DESC_TABLE_FULL_ERROR: File Descriptor exhaustion has occured! Connections will be silently dropped!\n"); } else { - slapi_log_error(SLAPI_LOG_FATAL, "ns_handle_new_connection", "Error accepting new connection listenfd=%d [%d:%s]\n", + slapi_log_err(SLAPI_LOG_FATAL, "ns_handle_new_connection", "Error accepting new connection listenfd=%d [%d:%s]\n", PR_FileDesc2NativeHandle(li->listenfd), prerr, slapd_pr_strerror(prerr)); } @@ -2633,11 +2630,11 @@ static int init_shutdown_detect(void) int rc; sigset_t proc_mask; - LDAPDebug(LDAP_DEBUG_TRACE, "init_shutdown_detect - Reseting signal mask....\n", 0, 0, 0); + slapi_log_err(SLAPI_LOG_TRACE, "init_shutdown_detect", "Reseting signal mask....\n"); (void)sigemptyset( &proc_mask ); rc = pthread_sigmask( SIG_SETMASK, &proc_mask, NULL ); - LDAPDebug(LDAP_DEBUG_TRACE, "init_shutdown_detect - %s \n", - rc ? "Failed to reset signal mask":"....Done (signal mask reset)!!", 0, 0 ); + slapi_log_err(SLAPI_LOG_TRACE, "init_shutdown_detect", "%s \n", + rc ? "Failed to reset signal mask":"....Done (signal mask reset)!!"); } #if defined ( HPUX10 ) @@ -2684,7 +2681,7 @@ unfurl_banners(Connection_Table *ct,daemon_ports_t *ports, PRFileDesc **n_tcps, int isfirsttime = 1; if ( ct->size <= slapdFrontendConfig->reservedescriptors ) { - LDAPDebug(LDAP_DEBUG_ERR, + slapi_log_err(SLAPI_LOG_ERR, "slapd_daemon", "Not enough descriptors to accept any connections. " "This may be because the maxdescriptors configuration " "directive is too small, the hard limit on descriptors is " @@ -2710,16 +2707,16 @@ unfurl_banners(Connection_Table *ct,daemon_ports_t *ports, PRFileDesc **n_tcps, for (nap = ports->n_listenaddr; nap && *nap; nap++) { if (isfirsttime) { - LDAPDebug(LDAP_DEBUG_INFO, + slapi_log_err(SLAPI_LOG_INFO, "slapd_daemon", "slapd started. Listening on %s port %d for LDAP requests\n", netaddr2string(*nap, addrbuf, sizeof(addrbuf)), - ports->n_port, 0 ); + ports->n_port); isfirsttime = 0; } else { - LDAPDebug(LDAP_DEBUG_INFO, + slapi_log_err(SLAPI_LOG_INFO, "slapd_daemon", "Listening on %s port %d for LDAP requests\n", netaddr2string(*nap, addrbuf, sizeof(addrbuf)), - ports->n_port, 0 ); + ports->n_port); } } } @@ -2729,16 +2726,16 @@ unfurl_banners(Connection_Table *ct,daemon_ports_t *ports, PRFileDesc **n_tcps, for (sap = ports->s_listenaddr; sap && *sap; sap++) { if (isfirsttime) { - LDAPDebug(LDAP_DEBUG_INFO, + slapi_log_err(SLAPI_LOG_INFO, "slapd_daemon", "slapd started. Listening on %s port %d for LDAPS requests\n", netaddr2string(*sap, addrbuf, sizeof(addrbuf)), - ports->s_port, 0 ); + ports->s_port); isfirsttime = 0; } else { - LDAPDebug(LDAP_DEBUG_INFO, + slapi_log_err(SLAPI_LOG_INFO, "slapd_daemon", "Listening on %s port %d for LDAPS requests\n", netaddr2string(*sap, addrbuf, sizeof(addrbuf)), - ports->s_port, 0 ); + ports->s_port); } } } @@ -2747,9 +2744,9 @@ unfurl_banners(Connection_Table *ct,daemon_ports_t *ports, PRFileDesc **n_tcps, if ( i_unix != NULL ) { /* LDAPI */ PRNetAddr **iap = ports->i_listenaddr; - LDAPDebug(LDAP_DEBUG_INFO, + slapi_log_err(SLAPI_LOG_INFO, "slapd_daemon", "%sListening on %s for LDAPI requests\n", isfirsttime?"slapd started. ":"", - (*iap)->local.path, 0 ); + (*iap)->local.path); } #endif /* ENABLE_LDAPI */ } @@ -2785,7 +2782,7 @@ set_shutdown (int sig) * yourself). */ #if 0 - LDAPDebug(LDAP_DEBUG_INFO, "slapd got shutdown signal\n", 0, 0, 0 ); + slapi_log_err(SLAPI_LOG_INFO, "slapd_daemon", "slapd got shutdown signal\n"); #endif g_set_shutdown( SLAPI_SHUTDOWN_SIGNAL ); #ifndef LINUX @@ -2830,7 +2827,7 @@ slapd_do_nothing (int sig) * yourself). */ #if 0 - LDAPDebug(LDAP_DEBUG_TRACE, "slapd got SIGUSR1\n", 0, 0, 0 ); + slapi_log_err(SLAPI_LOG_TRACE, "slapd_daemon", "slapd got SIGUSR1\n"); #endif (void) SIGNAL( SIGUSR1, slapd_do_nothing ); @@ -2855,7 +2852,7 @@ slapd_wait4child(int sig) * yourself). */ #if 0 - LDAPDebug(LDAP_DEBUG_ARGS, "listener: catching SIGCHLD\n", 0, 0, 0 ); + slapi_log_err(SLAPI_LOG_ARGS, "slapd_daemon", "listener: catching SIGCHLD\n"); #endif #ifdef USE_WAITPID while (waitpid ((pid_t) -1, 0, WAIT_FLAGS) > 0) @@ -2894,7 +2891,7 @@ createprlistensockets(PRUint16 port, PRNetAddr **listenaddr, } if (0 == sockcnt) { - slapi_log_error(SLAPI_LOG_ERR, logname, + slapi_log_err(SLAPI_LOG_ERR, logname, "There is no address to listen\n"); goto failed; } @@ -2916,7 +2913,7 @@ createprlistensockets(PRUint16 port, PRNetAddr **listenaddr, } if ((sock[i] = PR_OpenTCPSocket(socktype)) == SLAPD_INVALID_SOCKET) { prerr = PR_GetError(); - slapi_log_error(SLAPI_LOG_ERR, logname, + slapi_log_err(SLAPI_LOG_ERR, logname, "PR_OpenTCPSocket(%s) failed: %s error %d (%s)\n", socktype_str, SLAPI_COMPONENT_NAME_NSPR, prerr, slapd_pr_strerror(prerr)); @@ -2925,7 +2922,7 @@ createprlistensockets(PRUint16 port, PRNetAddr **listenaddr, if ( PR_SetSocketOption(sock[i], &pr_socketoption ) == PR_FAILURE) { prerr = PR_GetError(); - slapi_log_error(SLAPI_LOG_ERR, logname, + slapi_log_err(SLAPI_LOG_ERR, logname, "PR_SetSocketOption(PR_SockOpt_Reuseaddr) failed: %s error %d (%s)\n", SLAPI_COMPONENT_NAME_NSPR, prerr, slapd_pr_strerror( prerr )); goto failed; @@ -2941,7 +2938,7 @@ createprlistensockets(PRUint16 port, PRNetAddr **listenaddr, prerr = PR_GetError(); if(!local) { - slapi_log_error(SLAPI_LOG_ERR, logname, + slapi_log_err(SLAPI_LOG_ERR, logname, "PR_Bind() on %s port %d failed: %s error %d (%s)\n", netaddr2string(&sa_server, addrbuf, sizeof(addrbuf)), port, SLAPI_COMPONENT_NAME_NSPR, prerr, slapd_pr_strerror(prerr)); @@ -2949,7 +2946,7 @@ createprlistensockets(PRUint16 port, PRNetAddr **listenaddr, #if defined(ENABLE_LDAPI) else { - slapi_log_error(SLAPI_LOG_ERR, logname, + slapi_log_err(SLAPI_LOG_ERR, logname, "PR_Bind() on %s file %s failed: %s error %d (%s)\n", netaddr2string(&sa_server, addrbuf, sizeof(addrbuf)), sa_server.local.path, @@ -2965,7 +2962,7 @@ createprlistensockets(PRUint16 port, PRNetAddr **listenaddr, if(chmod((*listenaddr)->local.path, S_IRUSR|S_IWUSR|S_IRGRP|S_IWGRP|S_IROTH|S_IWOTH)) { - slapi_log_error(SLAPI_LOG_ERR, logname, "err: %d", errno); + slapi_log_err(SLAPI_LOG_ERR, logname, "err: %d", errno); } } #endif /* ENABLE_LDAPI */ @@ -2999,7 +2996,7 @@ slapd_listenhost2addr(const char *listenhost, PRNetAddr ***addr) /* listen on all interfaces */ if ( PR_SUCCESS != PR_SetNetAddr(PR_IpAddrAny, PR_AF_INET6, 0, netaddr)) { prerr = PR_GetError(); - slapi_log_error(SLAPI_LOG_ERR, logname, + slapi_log_err(SLAPI_LOG_ERR, logname, "PR_SetNetAddr(PR_IpAddrAny) failed - %s error %d (%s)\n", SLAPI_COMPONENT_NAME_NSPR, prerr, slapd_pr_strerror(prerr)); rval = -1; @@ -3025,7 +3022,7 @@ slapd_listenhost2addr(const char *listenhost, PRNetAddr ***addr) addrcnt++; } if ( 0 == addrcnt ) { - slapi_log_error(SLAPI_LOG_ERR, logname, + slapi_log_err(SLAPI_LOG_ERR, logname, "PR_EnumerateAddrInfo for %s failed - %s error %d (%s)\n", listenhost, SLAPI_COMPONENT_NAME_NSPR, prerr, slapd_pr_strerror(prerr)); @@ -3058,13 +3055,13 @@ slapd_listenhost2addr(const char *listenhost, PRNetAddr ***addr) } } if (charray_inlist(strnetaddrs, abp)) { - LDAPDebug2Args(LDAP_DEBUG_ERR, - "slapd_listenhost2addr - " + slapi_log_err(SLAPI_LOG_ERR, + "slapd_listenhost2addr", "detected duplicated address %s " "[%s]\n", abuf, abp); } else { - LDAPDebug1Arg(LDAP_DEBUG_TRACE, - "slapd_listenhost2addr - " + slapi_log_err(SLAPI_LOG_TRACE, + "slapd_listenhost2addr", "registering address %s\n", abp); slapi_ch_array_add(&strnetaddrs, slapi_ch_strdup(abp)); (*addr)[i] = netaddr; @@ -3077,7 +3074,7 @@ slapd_listenhost2addr(const char *listenhost, PRNetAddr ***addr) } PR_FreeAddrInfo( infop ); } else { - slapi_log_error(SLAPI_LOG_ERR, logname, + slapi_log_err(SLAPI_LOG_ERR, logname, "PR_GetAddrInfoByName(%s) failed - %s error %d (%s)\n", listenhost, SLAPI_COMPONENT_NAME_NSPR, prerr, slapd_pr_strerror(prerr)); @@ -3130,20 +3127,20 @@ createsignalpipe( void ) } if ( PR_CreatePipe( &signalpipe[0], &signalpipe[1] ) != 0 ) { PRErrorCode prerr = PR_GetError(); - LDAPDebug(LDAP_DEBUG_ERR, "createsignalpipe - PR_CreatePipe() failed, " - SLAPI_COMPONENT_NAME_NSPR " error %d (%s)\n", - prerr, slapd_pr_strerror(prerr), SLAPD_DEFAULT_THREAD_STACKSIZE ); + slapi_log_err(SLAPI_LOG_ERR, "createsignalpipe", + "PR_CreatePipe() failed, %s error %d (%s)\n", + SLAPI_COMPONENT_NAME_NSPR, prerr, slapd_pr_strerror(prerr)); return( -1 ); } writesignalpipe = PR_FileDesc2NativeHandle(signalpipe[1]); readsignalpipe = PR_FileDesc2NativeHandle(signalpipe[0]); if(fcntl(writesignalpipe, F_SETFD, O_NONBLOCK) == -1){ - LDAPDebug(LDAP_DEBUG_ERR,"createsignalpipe - Failed to set FD for write pipe (%d).\n", - errno, 0, 0 ); + slapi_log_err(SLAPI_LOG_ERR,"createsignalpipe", + "Failed to set FD for write pipe (%d).\n", errno); } if(fcntl(readsignalpipe, F_SETFD, O_NONBLOCK) == -1){ - LDAPDebug(LDAP_DEBUG_ERR,"createsignalpipe - Failed to set FD for read pipe (%d).\n", - errno, 0, 0); + slapi_log_err(SLAPI_LOG_ERR,"createsignalpipe", + "Failed to set FD for read pipe (%d).\n", errno); } return( 0 ); } @@ -3177,12 +3174,10 @@ catch_signals() (void)sigprocmask( SIG_BLOCK, &caught_signals, NULL ); if (( sig = sigwait( &caught_signals )) < 0 ) { - LDAPDebug(LDAP_DEBUG_ERR, "catch_signals - sigwait returned -1\n", - 0, 0, 0 ); + slapi_log_err(SLAPI_LOG_ERR, "catch_signals", "sigwait returned -1\n"); continue; } else { - LDAPDebug(LDAP_DEBUG_TRACE, "catch_signals - detected signal %d\n", - sig, 0, 0 ); + slapi_log_err(SLAPI_LOG_TRACE, "catch_signals", "detected signal %d\n", sig); switch ( sig ) { case SIGUSR1: continue; /* ignore SIGUSR1 */ @@ -3195,9 +3190,8 @@ catch_signals() slapd_wait4child( sig ); break; default: - LDAPDebug(LDAP_DEBUG_ERR, - "catch_signals - Unknown signal (%d) received\n", - sig, 0, 0 ); + slapi_log_err(SLAPI_LOG_ERR, + "catch_signals", "Unknown signal (%d) received\n", sig); } } } @@ -3254,7 +3248,7 @@ int configure_pr_socket( PRFileDesc **pr_socket, int secure, int local ) PRFileDesc *nspr_layer_fd = PR_GetIdentitiesLayer( *pr_socket, PR_NSPR_IO_LAYER ); if ( NULL == nspr_layer_fd ) { - slapi_log_error(SLAPI_LOG_ERR, "configure_pr_socket", + slapi_log_err(SLAPI_LOG_ERR, "configure_pr_socket", "Unable to move socket file descriptor %d above %d:" " PR_GetIdentitiesLayer( %p, PR_NSPR_IO_LAYER )" " failed\n", ns, reservedescriptors, *pr_socket ); @@ -3266,7 +3260,7 @@ int configure_pr_socket( PRFileDesc **pr_socket, int secure, int local ) } } else { int oserr = errno; - slapi_log_error(SLAPI_LOG_ERR, "configure_pr_socket", + slapi_log_err(SLAPI_LOG_ERR, "configure_pr_socket", "Unable to move socket file descriptor %d above %d:" " OS error %d (%s)\n", ns, reservedescriptors, oserr, slapd_system_strerror( oserr ) ); @@ -3278,10 +3272,10 @@ int configure_pr_socket( PRFileDesc **pr_socket, int secure, int local ) pr_socketoption.value.keep_alive = 1; if ( PR_SetSocketOption( *pr_socket, &pr_socketoption ) == PR_FAILURE ) { PRErrorCode prerr = PR_GetError(); - LDAPDebug(LDAP_DEBUG_ERR, - "configure_pr_socket - PR_SetSocketOption(PR_SockOpt_Keepalive failed, " + slapi_log_err(SLAPI_LOG_ERR, + "configure_pr_socket", "PR_SetSocketOption(PR_SockOpt_Keepalive failed, " SLAPI_COMPONENT_NAME_NSPR " error %d (%s)\n", - prerr, slapd_pr_strerror(prerr), 0 ); + prerr, slapd_pr_strerror(prerr)); } if ( secure ) { @@ -3289,10 +3283,10 @@ int configure_pr_socket( PRFileDesc **pr_socket, int secure, int local ) pr_socketoption.value.non_blocking = 0; if ( PR_SetSocketOption( *pr_socket, &pr_socketoption ) == PR_FAILURE ) { PRErrorCode prerr = PR_GetError(); - LDAPDebug(LDAP_DEBUG_ERR, - "configure_pr_socket - PR_SetSocketOption(PR_SockOpt_Nonblocking) failed, " + slapi_log_err(SLAPI_LOG_ERR, + "configure_pr_socket", "PR_SetSocketOption(PR_SockOpt_Nonblocking) failed, " SLAPI_COMPONENT_NAME_NSPR " error %d (%s)\n", - prerr, slapd_pr_strerror(prerr), 0 ); + prerr, slapd_pr_strerror(prerr)); } } else { /* We always want to have non-blocking I/O */ @@ -3300,10 +3294,10 @@ int configure_pr_socket( PRFileDesc **pr_socket, int secure, int local ) pr_socketoption.value.non_blocking = 1; if ( PR_SetSocketOption( *pr_socket, &pr_socketoption ) == PR_FAILURE ) { PRErrorCode prerr = PR_GetError(); - LDAPDebug(LDAP_DEBUG_ERR, - "configure_pr_socket - PR_SetSocketOption(PR_SockOpt_Nonblocking) failed, " + slapi_log_err(SLAPI_LOG_ERR, + "configure_pr_socket", "PR_SetSocketOption(PR_SockOpt_Nonblocking) failed, " SLAPI_COMPONENT_NAME_NSPR " error %d (%s)\n", - prerr, slapd_pr_strerror(prerr), 0 ); + prerr, slapd_pr_strerror(prerr)); } } /* else (secure) */ @@ -3312,20 +3306,20 @@ int configure_pr_socket( PRFileDesc **pr_socket, int secure, int local ) pr_socketoption.value.no_delay = 1; if ( PR_SetSocketOption( *pr_socket, &pr_socketoption ) == PR_FAILURE) { PRErrorCode prerr = PR_GetError(); - LDAPDebug(LDAP_DEBUG_ERR, - "configure_pr_socket - PR_SetSocketOption(PR_SockOpt_NoDelay) failed, " + slapi_log_err(SLAPI_LOG_ERR, + "configure_pr_socket", "PR_SetSocketOption(PR_SockOpt_NoDelay) failed, " SLAPI_COMPONENT_NAME_NSPR " error %d (%s)\n", - prerr, slapd_pr_strerror( prerr ), 0 ); + prerr, slapd_pr_strerror( prerr )); } } else if( !local) { pr_socketoption.option = PR_SockOpt_NoDelay; pr_socketoption.value.no_delay = 0; if ( PR_SetSocketOption( *pr_socket, &pr_socketoption ) == PR_FAILURE) { PRErrorCode prerr = PR_GetError(); - LDAPDebug(LDAP_DEBUG_ERR, - "configure_pr_socket - PR_SetSocketOption(PR_SockOpt_NoDelay) failed, " + slapi_log_err(SLAPI_LOG_ERR, + "configure_pr_socket", "PR_SetSocketOption(PR_SockOpt_NoDelay) failed, " SLAPI_COMPONENT_NAME_NSPR " error %d (%s)\n", - prerr, slapd_pr_strerror( prerr ), 0 ); + prerr, slapd_pr_strerror( prerr )); } } /* else (!enable_nagle) */ @@ -3351,7 +3345,7 @@ void configure_ns_socket( int * ns ) } /* check for errors */ if((rc = setsockopt( *ns, IPPROTO_TCP, TCP_NODELAY, (char * ) &on, sizeof(on) ) != 0)){ - LDAPDebug(LDAP_DEBUG_ERR,"configure_ns_socket - Failed to configure socket (%d).\n", rc, 0, 0); + slapi_log_err(SLAPI_LOG_ERR,"configure_ns_socket", "Failed to configure socket (%d).\n", rc); } return; diff --git a/ldap/servers/slapd/defbackend.c b/ldap/servers/slapd/defbackend.c index e69399a..a07fddb 100644 --- a/ldap/servers/slapd/defbackend.c +++ b/ldap/servers/slapd/defbackend.c @@ -60,7 +60,7 @@ defbackend_init( void ) char *errmsg; Slapi_PBlock pb; - LDAPDebug(LDAP_DEBUG_TRACE, "defbackend_init\n", 0, 0, 0 ); + slapi_log_err(SLAPI_LOG_TRACE, "defbackend_init", "<==\n"); /* * create a new backend @@ -119,8 +119,7 @@ defbackend_init( void ) cleanup_and_return: if ( rc != 0 ) { - LDAPDebug(LDAP_DEBUG_ERR, "defbackend_init - Failed (%s)\n", - errmsg, 0, 0 ); + slapi_log_err(SLAPI_LOG_ERR, "defbackend_init", "Failed (%s)\n", errmsg); exit( 1 ); } } @@ -144,7 +143,7 @@ defbackend_get_backend( void ) static int defbackend_default( Slapi_PBlock *pb ) { - LDAPDebug(LDAP_DEBUG_TRACE, "defbackend_default\n", 0, 0, 0 ); + slapi_log_err(SLAPI_LOG_TRACE, "defbackend_default", "<==\n"); send_nobackend_ldap_result( pb ); @@ -155,7 +154,7 @@ defbackend_default( Slapi_PBlock *pb ) static int defbackend_noop( Slapi_PBlock *pb ) { - LDAPDebug(LDAP_DEBUG_TRACE, "defbackend_noop\n", 0, 0, 0 ); + slapi_log_err(SLAPI_LOG_TRACE, "defbackend_noop", "<==\n"); return( DEFBACKEND_OP_HANDLED ); } @@ -164,7 +163,7 @@ defbackend_noop( Slapi_PBlock *pb ) static int defbackend_abandon( Slapi_PBlock *pb ) { - LDAPDebug(LDAP_DEBUG_TRACE, "defbackend_abandon\n", 0, 0, 0 ); + slapi_log_err(SLAPI_LOG_TRACE, "defbackend_abandon", "<==\n"); /* nothing to do */ return( DEFBACKEND_OP_HANDLED ); @@ -223,7 +222,7 @@ defbackend_bind( Slapi_PBlock *pb ) ber_tag_t method; struct berval *cred; - LDAPDebug(LDAP_DEBUG_TRACE, "defbackend_bind\n", 0, 0, 0 ); + slapi_log_err(SLAPI_LOG_TRACE, "defbackend_bind", "<==\n"); /* * Accept simple binds that do not contain passwords (but do not @@ -277,7 +276,7 @@ defbackend_bind( Slapi_PBlock *pb ) static int defbackend_next_search_entry( Slapi_PBlock *pb ) { - LDAPDebug(LDAP_DEBUG_TRACE, "defbackend_next_search_entry\n", 0, 0, 0 ); + slapi_log_err(SLAPI_LOG_TRACE, "defbackend_next_search_entry", "<==\n"); return( 0 ); /* no entries and no error */ } diff --git a/ldap/servers/slapd/delete.c b/ldap/servers/slapd/delete.c index 451d5bd..37f5317 100644 --- a/ldap/servers/slapd/delete.c +++ b/ldap/servers/slapd/delete.c @@ -43,7 +43,7 @@ do_delete( Slapi_PBlock *pb ) char *rawdn = NULL; int err = 0; - LDAPDebug(LDAP_DEBUG_TRACE, "do_delete\n", 0, 0, 0 ); + slapi_log_err(SLAPI_LOG_TRACE, "do_delete", "<==\n"); slapi_pblock_get( pb, SLAPI_OPERATION, &operation); ber = operation->o_ber; @@ -58,8 +58,8 @@ do_delete( Slapi_PBlock *pb ) */ if ( ber_scanf( pb->pb_op->o_ber, "a", &rawdn ) == LBER_ERROR ) { - LDAPDebug(LDAP_DEBUG_ERR, - "do_delete - ber_scanf failed (op=Delete; params=DN)\n", 0, 0, 0 ); + slapi_log_err(SLAPI_LOG_ERR, + "do_delete", "ber_scanf failed (op=Delete; params=DN)\n"); op_shared_log_error_access (pb, "DEL", "???", "decoding error"); send_ldap_result( pb, LDAP_PROTOCOL_ERROR, NULL, NULL, 0, NULL ); @@ -89,7 +89,7 @@ do_delete( Slapi_PBlock *pb ) goto free_and_return; } - LDAPDebug1Arg(LDAP_DEBUG_ARGS, "do_delete - dn (%s)\n", rawdn ); + slapi_log_err(SLAPI_LOG_ARGS, "do_delete", "dn (%s)\n", rawdn ); slapi_pblock_set( pb, SLAPI_REQUESTOR_ISROOT, &pb->pb_op->o_isroot ); slapi_pblock_set( pb, SLAPI_ORIGINAL_TARGET, rawdn); @@ -166,7 +166,7 @@ slapi_delete_internal_set_pb (Slapi_PBlock *pb, PR_ASSERT (pb != NULL); if (pb == NULL || rawdn == NULL) { - slapi_log_error(SLAPI_LOG_ERR, "slapi_delete_internal_set_pb", + slapi_log_err(SLAPI_LOG_ERR, "slapi_delete_internal_set_pb", "NULL parameter\n"); return; } diff --git a/ldap/servers/slapd/detach.c b/ldap/servers/slapd/detach.c index 350df23..f745a51 100644 --- a/ldap/servers/slapd/detach.c +++ b/ldap/servers/slapd/detach.c @@ -61,10 +61,10 @@ set_workingdir(void) rc = chdir("/"); if (0 == rc) { if (config_set_workingdir(CONFIG_WORKINGDIR_ATTRIBUTE, "/", errorbuf, 1) == LDAP_OPERATIONS_ERROR) { - LDAPDebug1Arg(LDAP_DEBUG_ERR, "detach: set workingdir failed with \"%s\"\n", errorbuf); + slapi_log_err(SLAPI_LOG_ERR, "set_workingdir", "detach: set workingdir failed with \"%s\"\n", errorbuf); } } else { - LDAPDebug1Arg(LDAP_DEBUG_ERR, "detach: failed to chdir to %s\n", "/"); + slapi_log_err(SLAPI_LOG_ERR, "set_workingdir", "detach: failed to chdir to %s\n", "/"); } } else { ptr = strrchr(errorlog, '/'); @@ -74,25 +74,25 @@ set_workingdir(void) rc = chdir(errorlog); if (0 == rc) { if (config_set_workingdir(CONFIG_WORKINGDIR_ATTRIBUTE, errorlog, errorbuf, 1) == LDAP_OPERATIONS_ERROR) { - LDAPDebug1Arg(LDAP_DEBUG_ERR, "detach: set workingdir failed with \"%s\"\n", errorbuf); + slapi_log_err(SLAPI_LOG_ERR, "set_workingdir", "detach: set workingdir failed with \"%s\"\n", errorbuf); rc = chdir("/"); if (0 == rc) { if (config_set_workingdir(CONFIG_WORKINGDIR_ATTRIBUTE, "/", errorbuf, 1) == LDAP_OPERATIONS_ERROR) { - LDAPDebug1Arg(LDAP_DEBUG_ERR, "detach: set workingdir failed with \"%s\"\n", errorbuf); + slapi_log_err(SLAPI_LOG_ERR, "set_workingdir", "detach: set workingdir failed with \"%s\"\n", errorbuf); } } else { - LDAPDebug1Arg(LDAP_DEBUG_ERR, "detach: failed to chdir to %s\n", "/"); + slapi_log_err(SLAPI_LOG_ERR, "set_workingdir", "detach: failed to chdir to %s\n", "/"); } } } else { - LDAPDebug1Arg(LDAP_DEBUG_ERR, "detach: failed to chdir to %s\n", errorlog); + slapi_log_err(SLAPI_LOG_ERR, "set_workingdir", "detach: failed to chdir to %s\n", errorlog); rc = chdir("/"); if (0 == rc) { if (config_set_workingdir(CONFIG_WORKINGDIR_ATTRIBUTE, "/", errorbuf, 1) == LDAP_OPERATIONS_ERROR) { - LDAPDebug1Arg(LDAP_DEBUG_ERR, "detach: set workingdir failed with \"%s\"\n", errorbuf); + slapi_log_err(SLAPI_LOG_ERR, "detach: set workingdir failed with \"%s\"\n", errorbuf); } } else { - LDAPDebug1Arg(LDAP_DEBUG_ERR, "detach: failed to chdir to %s\n", "/"); + slapi_log_err(SLAPI_LOG_ERR, "set_workingdir", "detach: failed to chdir to %s\n", "/"); } } slapi_ch_free_string(&errorlog); @@ -100,19 +100,19 @@ set_workingdir(void) } else { /* calling config_set_workingdir to check for validity of directory, don't apply */ if (config_set_workingdir(CONFIG_WORKINGDIR_ATTRIBUTE, workingdir, errorbuf, 0) == LDAP_OPERATIONS_ERROR) { - LDAPDebug1Arg(LDAP_DEBUG_ERR, "detach: set workingdir failed with \"%s\"\n", errorbuf); + slapi_log_err(SLAPI_LOG_ERR, "set_workingdir", "detach: set workingdir failed with \"%s\"\n", errorbuf); rc = chdir("/"); if (0 == rc) { if (config_set_workingdir(CONFIG_WORKINGDIR_ATTRIBUTE, "/", errorbuf, 1) == LDAP_OPERATIONS_ERROR) { - LDAPDebug1Arg(LDAP_DEBUG_ERR, "detach: set workingdir failed with \"%s\"\n", errorbuf); + slapi_log_err(SLAPI_LOG_ERR, "detach: set workingdir failed with \"%s\"\n", errorbuf); } } else { - LDAPDebug1Arg(LDAP_DEBUG_ERR, "detach: failed to chdir to %s\n", "/"); + slapi_log_err(SLAPI_LOG_ERR, "set_workingdir", "detach: failed to chdir to %s\n", "/"); } } else { rc = chdir(workingdir); if (rc) { - LDAPDebug1Arg(LDAP_DEBUG_ERR, "detach: failed to chdir to %s\n", workingdir); + slapi_log_err(SLAPI_LOG_ERR, "set_workingdir", "detach: failed to chdir to %s\n", workingdir); } } slapi_ch_free_string(&workingdir); @@ -152,7 +152,7 @@ detach( int slapd_exemode, int importexport_encrypt, } if (set_workingdir()) { - LDAPDebug0Args(LDAP_DEBUG_ERR, "detach: set_workingdir failed.\n"); + slapi_log_err(SLAPI_LOG_ERR, "detach", "set_workingdir failed.\n"); } if ( (sd = open( "/dev/null", O_RDWR )) == -1 ) { @@ -179,7 +179,7 @@ detach( int slapd_exemode, int importexport_encrypt, return 1; } if (set_workingdir()) { - LDAPDebug0Args(LDAP_DEBUG_ERR, "detach: set_workingdir failed.\n"); + slapi_log_err(SLAPI_LOG_ERR, "detach", "set_workingdir failed 2.\n"); } } @@ -225,9 +225,9 @@ static void raise_process_fd_limits(void) if ( getrlimit( RLIMIT_NOFILE, &rl ) != 0 ) { int oserr = errno; - LDAPDebug(LDAP_DEBUG_ERR, + slapi_log_err(SLAPI_LOG_ERR, "raise_process_fd_limits", "getrlimit of descriptor limit failed - error %d (%s)\n", - oserr, slapd_system_strerror( oserr ), 0 ); + oserr, slapd_system_strerror( oserr )); return; } @@ -247,17 +247,16 @@ static void raise_process_fd_limits(void) if ( setrlimit( RLIMIT_NOFILE, &setrl ) != 0 ) { int oserr = errno; - LDAPDebug(LDAP_DEBUG_ERR, "setrlimit of descriptor " - "limit to %d failed - error %d (%s)\n", - setrl.rlim_cur, oserr, - slapd_system_strerror(oserr)); + slapi_log_err(SLAPI_LOG_ERR, "raise_process_fd_limits", + "setrlimit of descriptor limit to %lu failed - error %d (%s)\n", + setrl.rlim_cur, oserr, slapd_system_strerror(oserr)); return; } } (void)getrlimit( RLIMIT_NOFILE, &rl ); - LDAPDebug(LDAP_DEBUG_TRACE, "descriptor limit changed from %d to %d\n", - curlim, rl.rlim_cur, 0 ); + slapi_log_err(SLAPI_LOG_TRACE, "raise_process_fd_limits", + "descriptor limit changed from %d to %lu\n", curlim, rl.rlim_cur); } /* @@ -274,12 +273,12 @@ raise_process_limits() if (getrlimit(RLIMIT_DATA,&rl) == 0) { rl.rlim_cur = rl.rlim_max; if (setrlimit(RLIMIT_DATA,&rl) != 0) { - LDAPDebug(LDAP_DEBUG_TRACE,"setrlimit(RLIMIT_DATA) failed %d\n", - errno,0,0); + slapi_log_err(SLAPI_LOG_TRACE, "raise_process_limits", "setrlimit(RLIMIT_DATA) failed %d\n", + errno); } } else { - LDAPDebug(LDAP_DEBUG_TRACE,"getrlimit(RLIMIT_DATA) failed %d\n", - errno,0,0); + slapi_log_err(SLAPI_LOG_TRACE, "raise_process_limits", "getrlimit(RLIMIT_DATA) failed %d\n", + errno); } #endif @@ -287,12 +286,12 @@ raise_process_limits() if (getrlimit(RLIMIT_VMEM,&rl) == 0) { rl.rlim_cur = rl.rlim_max; if (setrlimit(RLIMIT_VMEM,&rl) != 0) { - LDAPDebug(LDAP_DEBUG_TRACE,"setrlimit(RLIMIT_VMEM) failed %d\n", - errno,0,0); + slapi_log_err(SLAPI_LOG_TRACE, "raise_process_limits", "setrlimit(RLIMIT_VMEM) failed %d\n", + errno); } } else { - LDAPDebug(LDAP_DEBUG_TRACE,"getrlimit(RLIMIT_VMEM) failed %d\n", - errno,0,0); + slapi_log_err(SLAPI_LOG_TRACE, "raise_process_limits", "getrlimit(RLIMIT_VMEM) failed %d\n", + errno); } #endif /* RLIMIT_VMEM */ } diff --git a/ldap/servers/slapd/dn.c b/ldap/servers/slapd/dn.c index 855fe70..d043f2a 100644 --- a/ldap/servers/slapd/dn.c +++ b/ldap/servers/slapd/dn.c @@ -340,8 +340,8 @@ substr_dn_normalize_orig( char *dn, char *end ) } else if ( *s == '"' ) { state = B4SEPARATOR; if (!value) { - LDAPDebug(LDAP_DEBUG_ERR, - "substr_dn_normalize_orig - missing value\n", 0, 0, 0 ); + slapi_log_err(SLAPI_LOG_ERR, + "substr_dn_normalize_orig", "Missing value\n" ); break; } if ( value_separator == dn /* 2 or more separators */ @@ -390,8 +390,8 @@ substr_dn_normalize_orig( char *dn, char *end ) } break; default: - LDAPDebug(LDAP_DEBUG_ERR, - "substr_dn_normalize_orig - unknown state %d\n", state, 0, 0 ); + slapi_log_err(SLAPI_LOG_ERR, + "substr_dn_normalize_orig", "Unknown state %d\n", state); break; } if ( *s == '\\' ) { @@ -1073,8 +1073,8 @@ slapi_dn_normalize_ext(char *src, size_t src_len, char **dest, size_t *dest_len) } break; default: - LDAPDebug(LDAP_DEBUG_ERR, - "slapi_dn_normalize_ext - unknown state %d\n", state, 0, 0 ); + slapi_log_err(SLAPI_LOG_ERR, + "slapi_dn_normalize_ext", "Unknown state %d\n", state); break; } } @@ -1365,9 +1365,9 @@ rdn_av_swap( struct berval *av1, struct berval *av2, int escape ) char * slapi_dn_normalize_original( char *dn ) { - /* LDAPDebug(LDAP_DEBUG_TRACE, "=> slapi_dn_normalize \"%s\"\n", dn, 0, 0 ); */ + /* slapi_log_err(SLAPI_LOG_TRACE, "=> slapi_dn_normalize \"%s\"\n", dn, 0, 0 ); */ *(substr_dn_normalize_orig( dn, dn + strlen( dn ))) = '\0'; - /* LDAPDebug(LDAP_DEBUG_TRACE, "<= slapi_dn_normalize \"%s\"\n", dn, 0, 0 ); */ + /* slapi_log_err(SLAPI_LOG_TRACE, "<= slapi_dn_normalize \"%s\"\n", dn, 0, 0 ); */ return( dn ); } @@ -1376,9 +1376,9 @@ slapi_dn_normalize_original( char *dn ) char * slapi_dn_normalize_case_original( char *dn ) { - /* LDAPDebug(LDAP_DEBUG_TRACE, "=> slapi_dn_normalize \"%s\"\n", dn, 0, 0 ); */ + /* slapi_log_err(SLAPI_LOG_TRACE, "=> slapi_dn_normalize \"%s\"\n", dn, 0, 0 ); */ *(substr_dn_normalize_orig( dn, dn + strlen( dn ))) = '\0'; - /* LDAPDebug(LDAP_DEBUG_TRACE, "<= slapi_dn_normalize \"%s\"\n", dn, 0, 0 ); */ + /* slapi_log_err(SLAPI_LOG_TRACE, "<= slapi_dn_normalize \"%s\"\n", dn, 0, 0 ); */ /* normalize case */ return( slapi_dn_ignore_case( dn )); @@ -1392,9 +1392,9 @@ slapi_dn_normalize_case_original( char *dn ) char * slapi_dn_normalize( char *dn ) { - /* LDAPDebug(LDAP_DEBUG_TRACE, "=> slapi_dn_normalize \"%s\"\n", dn, 0, 0 ); */ + /* slapi_log_err(SLAPI_LOG_TRACE, "=> slapi_dn_normalize \"%s\"\n", dn, 0, 0 ); */ *(substr_dn_normalize( dn, dn + strlen( dn ))) = '\0'; - /* LDAPDebug(LDAP_DEBUG_TRACE, "<= slapi_dn_normalize \"%s\"\n", dn, 0, 0 ); */ + /* slapi_log_err(SLAPI_LOG_TRACE, "<= slapi_dn_normalize \"%s\"\n", dn, 0, 0 ); */ return dn; } @@ -2730,7 +2730,8 @@ slapi_moddn_get_newdn(Slapi_DN *dn_olddn, const char *newrdn, const char *newsup static void sdn_dump( const Slapi_DN *sdn, const char *text) { - LDAPDebug(LDAP_DEBUG_DEBUG, "SDN %s ptr=%lx dn=%s\n", text, sdn, (sdn->dn==NULL?"NULL":sdn->dn)); + slapi_log_err(SLAPI_LOG_DEBUG, "sdn_dump", "SDN %s ptr=%lx dn=%s\n", + text, sdn, (sdn->dn==NULL?"NULL":sdn->dn)); } #endif @@ -2797,7 +2798,7 @@ ndn_cache_init() ndn_started = 1; if ( NULL == ( lru_lock = PR_NewLock()) || NULL == ( ndn_cache_lock = slapi_new_rwlock())) { ndn_cache_destroy(); - slapi_log_error(SLAPI_LOG_ERR, "ndn_cache_init", "Failed to create locks. Disabling cache.\n" ); + slapi_log_err(SLAPI_LOG_ERR, "ndn_cache_init", "Failed to create locks. Disabling cache.\n" ); } } @@ -2951,7 +2952,7 @@ ndn_cache_add(char *dn, size_t dn_len, char *ndn, size_t ndn_len) */ new_node = (struct ndn_cache_lru *)slapi_ch_malloc(sizeof(struct ndn_cache_lru)); if(new_node == NULL){ - slapi_log_error(SLAPI_LOG_ERR, "ndn_cache_add", "Failed to allocate new lru node.\n"); + slapi_log_err(SLAPI_LOG_ERR, "ndn_cache_add", "Failed to allocate new lru node.\n"); return; } new_node->prev = NULL; @@ -2974,7 +2975,7 @@ ndn_cache_add(char *dn, size_t dn_len, char *ndn, size_t ndn_len) ht_entry = (struct ndn_hash_val *)slapi_ch_malloc(sizeof(struct ndn_hash_val)); if(ht_entry == NULL){ slapi_rwlock_unlock(ndn_cache_lock); - slapi_log_error(SLAPI_LOG_ERR, "ndn_cache_add", "Failed to allocate new hash entry.\n"); + slapi_log_err(SLAPI_LOG_ERR, "ndn_cache_add", "Failed to allocate new hash entry.\n"); slapi_ch_free_string(&new_node->key); slapi_ch_free((void **)&new_node); return; @@ -3012,7 +3013,7 @@ ndn_cache_add(char *dn, size_t dn_len, char *ndn, size_t ndn_len) */ he = PL_HashTableAdd(ndn_cache_hashtable, new_node->key, (void *)ht_entry); if(he == NULL){ - slapi_log_error(SLAPI_LOG_ERR, "ndn_cache_add", "Failed to add new entry to hash(%s)\n",dn); + slapi_log_err(SLAPI_LOG_ERR, "ndn_cache_add", "Failed to add new entry to hash(%s)\n",dn); } else { ndn_cache->cache_count++; ndn_cache->cache_size += size; @@ -3044,7 +3045,7 @@ ndn_cache_flush(void) slapi_ch_free((void **)&flush_node); } - slapi_log_error(SLAPI_LOG_CACHE, "ndn_cache_flush","Flushed cache.\n"); + slapi_log_err(SLAPI_LOG_CACHE, "ndn_cache_flush","Flushed cache.\n"); } static void diff --git a/ldap/servers/slapd/dse.c b/ldap/servers/slapd/dse.c index 2199d07..c38448b 100644 --- a/ldap/servers/slapd/dse.c +++ b/ldap/servers/slapd/dse.c @@ -44,9 +44,9 @@ /* messages to always be logged */ #ifdef SLAPI_DSE_DEBUG -#define SLAPI_DSE_TRACELEVEL LDAP_DEBUG_ANY +#define SLAPI_DSE_TRACELEVEL SLAPI_LOG_INFO #else /* SLAPI_DSE_DEBUG */ -#define SLAPI_DSE_TRACELEVEL LDAP_DEBUG_TRACE +#define SLAPI_DSE_TRACELEVEL SLAPI_LOG_TRACE #endif /* SLAPI_DSE_DEBUG */ #define SCHEMA_VIOLATION -2 @@ -448,8 +448,8 @@ dse_destroy(struct dse *pdse) slapi_destroy_rwlock(pdse->dse_rwlock); } slapi_ch_free((void **)&pdse); - LDAPDebug(SLAPI_DSE_TRACELEVEL, "Removed [%d] entries from the dse tree.\n", - nentries,0,0 ); + slapi_log_err(SLAPI_DSE_TRACELEVEL, "dse_destroy", "Removed [%d] entries from the dse tree.\n", + nentries); return 0; /* no one checks this return value */ } @@ -555,7 +555,7 @@ dse_updateNumSubordinates(Slapi_Entry *entry, int op) if (!already_present) { /* This means that something is wrong---deleting a child but no subcount present on parent */ - slapi_log_error(SLAPI_LOG_ERR, "dse_updateNumSubordinates", + slapi_log_err(SLAPI_LOG_ERR, "dse_updateNumSubordinates", "numsubordinates assertion failure\n" ); return; } @@ -657,11 +657,11 @@ dse_check_file(char *filename, char *backupname) return (0); if ( PR_GetFileInfo64( filename, &prfinfo ) == PR_SUCCESS && prfinfo.size > 0 ) { - slapi_log_error(SLAPI_LOG_INFO, "dse_check_file", + slapi_log_err(SLAPI_LOG_INFO, "dse_check_file", "The configuration file %s was restored from backup %s\n", filename, backupname); return (1); } else { - slapi_log_error(SLAPI_LOG_ERR, "dse_check_file", + slapi_log_err(SLAPI_LOG_ERR, "dse_check_file", "The configuration file %s was not restored from backup %s, error %d\n", filename, backupname, rc); return (0); @@ -692,14 +692,14 @@ dse_read_one_file(struct dse *pdse, const char *filename, Slapi_PBlock *pb, if ( (rc = PR_GetFileInfo64( filename, &prfinfo )) != PR_SUCCESS ) { - slapi_log_error(SLAPI_LOG_ERR, "dse_read_one_file", + slapi_log_err(SLAPI_LOG_ERR, "dse_read_one_file", "The configuration file %s could not be accessed, error %d\n", filename, rc); rc = 0; /* Fail */ } else if (( prfd = PR_Open( filename, PR_RDONLY, SLAPD_DEFAULT_FILE_MODE )) == NULL ) { - slapi_log_error(SLAPI_LOG_ERR, "dse_read_one_file", + slapi_log_err(SLAPI_LOG_ERR, "dse_read_one_file", "The configuration file %s could not be read. " SLAPI_COMPONENT_NAME_NSPR " %d (%s)\n", filename, @@ -713,7 +713,7 @@ dse_read_one_file(struct dse *pdse, const char *filename, Slapi_PBlock *pb, buf = slapi_ch_malloc( prfinfo.size + 1 ); if (( nr = slapi_read_buffer( prfd, buf, prfinfo.size )) < 0 ) { - slapi_log_error(SLAPI_LOG_ERR, "dse_read_one_file", + slapi_log_err(SLAPI_LOG_ERR, "dse_read_one_file", "Could only read %d of %ld bytes from config file %s\n", nr, (long int)prfinfo.size, filename); rc = 0; /* Fail */ @@ -765,7 +765,7 @@ dse_read_one_file(struct dse *pdse, const char *filename, Slapi_PBlock *pb, int returncode = 0; char returntext[SLAPI_DSE_RETURNTEXT_SIZE]= {0}; - slapi_log_error(SLAPI_LOG_TRACE, "dse_read_one_file", + slapi_log_err(SLAPI_LOG_TRACE, "dse_read_one_file", " processing entry \"%s\" in file %s%s " "(lineno: %d)\n", slapi_entry_get_dn_const(e), filename, @@ -792,7 +792,7 @@ dse_read_one_file(struct dse *pdse, const char *filename, Slapi_PBlock *pb, } else /* free entry if not used */ { - slapi_log_error(SLAPI_LOG_ERR, + slapi_log_err(SLAPI_LOG_ERR, "dse_read_one_file", "The entry %s in file %s " "(lineno: %d) is invalid, " @@ -805,11 +805,11 @@ dse_read_one_file(struct dse *pdse, const char *filename, Slapi_PBlock *pb, rc = 0; /* failure */ } } else { - slapi_log_error(SLAPI_LOG_ERR, "dse_read_one_file", + slapi_log_err(SLAPI_LOG_ERR, "dse_read_one_file", "Parsing entry (lineno: %d) " "in file %s failed.\n", lineno, filename ); - slapi_log_error(SLAPI_LOG_ERR, "dse_read_one_file", + slapi_log_err(SLAPI_LOG_ERR, "dse_read_one_file", "Invalid section [%s%s]\n", errbuf, cpylen==estrlen?"":" ..." ); rc = 0; /* failure */ @@ -909,7 +909,7 @@ dse_rw_permission_to_one_file(const char *name, int loglevel) } if ( prerr != 0 ) { - slapi_log_error( loglevel, + slapi_log_err( loglevel, "dse_rw_permission_to_one_file", "Unable to %s \"%s\": "SLAPI_COMPONENT_NAME_NSPR " error %d (%s)\n", accesstype, name, prerr, slapd_pr_strerror(prerr)); return 0; /* insufficient permission */ @@ -957,7 +957,7 @@ dse_check_for_readonly_error(Slapi_PBlock *pb, struct dse* pdse) if ( !pdse->dse_is_updateable ) { if ( !pdse->dse_readonly_error_reported ) { if ( NULL != pdse->dse_filename ) { - slapi_log_error(SLAPI_LOG_ERR, "dse_check_for_readonly_error", + slapi_log_err(SLAPI_LOG_ERR, "dse_check_for_readonly_error", "The DSE database stored in \"%s\" is not writeable\n", pdse->dse_filename ); /* log the details too */ @@ -1000,7 +1000,7 @@ dse_write_file_nolock(struct dse* pdse) if (( fpw.fpw_prfd = PR_Open( pdse->dse_tmpfile, PR_RDWR | PR_CREATE_FILE | PR_TRUNCATE, SLAPD_DEFAULT_FILE_MODE )) == NULL ) { rc = PR_GetOSError(); - slapi_log_error(SLAPI_LOG_ERR, "dse_write_file_nolock", "Cannot open " + slapi_log_err(SLAPI_LOG_ERR, "dse_write_file_nolock", "Cannot open " "temporary DSE file \"%s\" for update: OS error %d (%s)\n", pdse->dse_tmpfile, rc, slapd_system_strerror( rc )); } @@ -1010,7 +1010,7 @@ dse_write_file_nolock(struct dse* pdse) if ( avl_apply( pdse->dse_tree, dse_write_entry, &fpw, STOP_TRAVERSAL, AVL_INORDER ) == STOP_TRAVERSAL ) { rc = fpw.fpw_rc; - slapi_log_error(SLAPI_LOG_ERR, "dse_write_file_nolock", "Cannot write " + slapi_log_err(SLAPI_LOG_ERR, "dse_write_file_nolock", "Cannot write " " temporary DSE file \"%s\": OS error %d (%s)\n", pdse->dse_tmpfile, rc, slapd_system_strerror( rc )); (void)PR_Close( fpw.fpw_prfd ); @@ -1025,7 +1025,7 @@ dse_write_file_nolock(struct dse* pdse) rc = slapi_destructive_rename( pdse->dse_filename, pdse->dse_fileback ); if ( rc != 0 ) { - slapi_log_error(SLAPI_LOG_ERR, "dse_write_file_nolock", "Cannot backup" + slapi_log_err(SLAPI_LOG_ERR, "dse_write_file_nolock", "Cannot backup" " DSE file \"%s\" to \"%s\": OS error %d (%s)\n", pdse->dse_filename, pdse->dse_fileback, rc, slapd_system_strerror( rc )); @@ -1034,7 +1034,7 @@ dse_write_file_nolock(struct dse* pdse) rc = slapi_destructive_rename( pdse->dse_tmpfile, pdse->dse_filename ); if ( rc != 0 ) { - slapi_log_error(SLAPI_LOG_ERR, "dse_write_file_nolock", "Cannot rename" + slapi_log_err(SLAPI_LOG_ERR, "dse_write_file_nolock", "Cannot rename" " temporary DSE file \"%s\" to \"%s\":" " OS error %d (%s)\n", pdse->dse_tmpfile, pdse->dse_filename, @@ -1722,7 +1722,7 @@ dse_search(Slapi_PBlock *pb) /* JCM There should only be one exit point from thi if ( baseentry == NULL ) { slapi_send_ldap_result( pb, LDAP_NO_SUCH_OBJECT, NULL, NULL, 0, NULL ); - slapi_log_error(SLAPI_LOG_PLUGIN,"dse_search", "node %s was not found\n", + slapi_log_err(SLAPI_LOG_PLUGIN,"dse_search", "node %s was not found\n", slapi_sdn_get_dn(basesdn)); return -1; } @@ -1866,21 +1866,21 @@ dse_modify(Slapi_PBlock *pb) /* JCM There should only be one exit point from thi slapi_pblock_get(pb, SLAPI_RESULT_CODE, &returncode); } if (rc || returncode) { - LDAPDebug(SLAPI_DSE_TRACELEVEL, - "dse_modify: SLAPI_PLUGIN_BE_TXN_PRE_MODIFY_FN failed - rc %d LDAP error %d:%s\n", + slapi_log_err(SLAPI_DSE_TRACELEVEL, + "dse_modify", "SLAPI_PLUGIN_BE_TXN_PRE_MODIFY_FN failed - rc %d LDAP error %d:%s\n", rc, returncode, ldap_err2string(returncode)); } } else { - LDAPDebug(SLAPI_DSE_TRACELEVEL, - "dse_modify: SLAPI_PLUGIN_BE_PRE_MODIFY_FN failed - rc %d LDAP error %d:%s\n", + slapi_log_err(SLAPI_DSE_TRACELEVEL, + "dse_modify", "SLAPI_PLUGIN_BE_PRE_MODIFY_FN failed - rc %d LDAP error %d:%s\n", rc, returncode, ldap_err2string(returncode)); } if (rc || returncode) { char *ldap_result_message = NULL; rc = SLAPI_DSE_CALLBACK_ERROR; if (!returncode) { - LDAPDebug0Args(SLAPI_DSE_TRACELEVEL, - "dse_modify: PRE_MODIFY plugin returned non-zero but did not set an LDAP error\n"); + slapi_log_err(SLAPI_DSE_TRACELEVEL, + "dse_modify", "PRE_MODIFY plugin returned non-zero but did not set an LDAP error\n"); returncode = LDAP_OPERATIONS_ERROR; } if (!returntext[0]) { @@ -2075,7 +2075,7 @@ dse_pre_modify_plugin(Slapi_Entry *entryBefore, Slapi_Entry *entryAfter, LDAPMod } if(restart_plugin){ /* for all other plugin config changes, restart the plugin */ if(plugin_restart(entryBefore, entryAfter) != LDAP_SUCCESS){ - slapi_log_error(SLAPI_LOG_ERR,"dse_pre_modify_plugin", + slapi_log_err(SLAPI_LOG_ERR,"dse_pre_modify_plugin", "The configuration change for plugin (%s) could not be applied.\n", slapi_entry_get_dn(entryBefore)); rc = -1; @@ -2110,7 +2110,7 @@ dse_modify_plugin(Slapi_Entry *pre_entry, Slapi_Entry *post_entry, char *returnt rc = -1; } else { rc = 2; /* plugin disabled */ - slapi_log_error(SLAPI_LOG_PLUGIN,"dse_modify_plugin", "Disabled plugin (%s)\n", + slapi_log_err(SLAPI_LOG_PLUGIN,"dse_modify_plugin", "Disabled plugin (%s)\n", slapi_entry_get_dn(post_entry)); } } else if ( slapi_entry_attr_hasvalue(pre_entry, "nsslapd-pluginEnabled", "off") && @@ -2123,7 +2123,7 @@ dse_modify_plugin(Slapi_Entry *pre_entry, Slapi_Entry *post_entry, char *returnt rc = -1; } else { rc = 1; /* plugin started */ - slapi_log_error(SLAPI_LOG_PLUGIN,"dse_modify_plugin", "Enabled plugin (%s)\n", + slapi_log_err(SLAPI_LOG_PLUGIN,"dse_modify_plugin", "Enabled plugin (%s)\n", slapi_entry_get_dn(post_entry)); } } @@ -2223,8 +2223,8 @@ dse_add(Slapi_PBlock *pb) /* JCM There should only be one exit point from this f */ if ( slapi_entry_schema_check( pb, e ) != 0 ) { char *errtext; - LDAPDebug(SLAPI_DSE_TRACELEVEL, - "dse_add: entry failed schema check\n", 0, 0, 0 ); + slapi_log_err(SLAPI_DSE_TRACELEVEL, + "dse_add", "entry failed schema check\n"); slapi_pblock_get(pb, SLAPI_PB_RESULT_TEXT, &errtext); if (errtext && errtext[0]) { PL_strncpyz(returntext, errtext, sizeof(returntext)); @@ -2237,8 +2237,8 @@ dse_add(Slapi_PBlock *pb) /* JCM There should only be one exit point from this f /* Check if the attribute values in the entry obey the syntaxes */ if ( slapi_entry_syntax_check( pb, e, 0 ) != 0 ) { char *errtext; - LDAPDebug(SLAPI_DSE_TRACELEVEL, - "dse_add: entry failed syntax check\n", 0, 0, 0 ); + slapi_log_err(SLAPI_DSE_TRACELEVEL, + "dse_add", "entry failed syntax check\n" ); slapi_pblock_get(pb, SLAPI_PB_RESULT_TEXT, &errtext); if (errtext && errtext[0]) { PL_strncpyz(returntext, errtext, sizeof(returntext)); @@ -2277,7 +2277,7 @@ dse_add(Slapi_PBlock *pb) /* JCM There should only be one exit point from this f parententry= dse_get_entry_copy( pdse, &parent, DSE_USE_LOCK ); if( parententry==NULL ) { rc = LDAP_NO_SUCH_OBJECT; - LDAPDebug(SLAPI_DSE_TRACELEVEL," dse_add: parent does not exist\n", 0, 0, 0 ); + slapi_log_err(SLAPI_DSE_TRACELEVEL," dse_add", "Narent does not exist\n"); slapi_sdn_done(&parent); e = NULL; /* caller will free upon error */ goto done; @@ -2285,7 +2285,7 @@ dse_add(Slapi_PBlock *pb) /* JCM There should only be one exit point from this f rc= plugin_call_acl_plugin ( pb, parententry, NULL, NULL, SLAPI_ACL_ADD, ACLPLUGIN_ACCESS_DEFAULT, &errbuf ); slapi_entry_free(parententry); if ( rc!=LDAP_SUCCESS ) { - LDAPDebug(SLAPI_DSE_TRACELEVEL, "dse_add: no access to parent\n", 0, 0, 0 ); + slapi_log_err(SLAPI_DSE_TRACELEVEL, "dse_add", "No access to parent\n"); if (errbuf && errbuf[0]) { PL_strncpyz(returntext, errbuf, sizeof(returntext)); } @@ -2299,7 +2299,7 @@ dse_add(Slapi_PBlock *pb) /* JCM There should only be one exit point from this f int isroot; slapi_pblock_get( pb, SLAPI_REQUESTOR_ISROOT, &isroot ); if ( !isroot ) { - LDAPDebug(SLAPI_DSE_TRACELEVEL, "dse_add: no parent and not root\n", 0, 0, 0 ); + slapi_log_err(SLAPI_DSE_TRACELEVEL, "dse_add", "No parent and not root\n"); rc = LDAP_INSUFFICIENT_ACCESS; slapi_sdn_done(&parent); e = NULL; /* caller will free upon error */ @@ -2332,7 +2332,8 @@ dse_add(Slapi_PBlock *pb) /* JCM There should only be one exit point from this f if(dse_call_callback(pdse, pb, SLAPI_OPERATION_ADD, DSE_FLAG_PREOP, e, NULL, &returncode, returntext)!=SLAPI_DSE_CALLBACK_OK) { if (!returncode) { - LDAPDebug(LDAP_DEBUG_ERR, "dse_add - DSE PREOP callback returned error but did not set returncode\n", 0, 0, 0 ); + slapi_log_err(SLAPI_LOG_ERR, "dse_add", + "DSE PREOP callback returned error but did not set returncode\n"); returncode = LDAP_OPERATIONS_ERROR; } rc = returncode; diff --git a/ldap/servers/slapd/dynalib.c b/ldap/servers/slapd/dynalib.c index 4b8630e..cc0d843 100644 --- a/ldap/servers/slapd/dynalib.c +++ b/ldap/servers/slapd/dynalib.c @@ -124,18 +124,19 @@ symload_report_error( const char *libpath, char *symbol, char *plugin, int libop if ( errlen > 0 ) { errtext = slapi_ch_malloc( errlen+1 ); if ( PR_GetErrorText( errtext ) > 0 ) { - LDAPDebug(LDAP_DEBUG_ERR, SLAPI_COMPONENT_NAME_NSPR " error %d: %s\n", - PR_GetError(), errtext, 0 ); + slapi_log_err(SLAPI_LOG_ERR, "symload_report_error", + SLAPI_COMPONENT_NAME_NSPR " error %d: %s\n", + PR_GetError(), errtext); } slapi_ch_free( (void **)&errtext ); } if ( libopen ) { - LDAPDebug(LDAP_DEBUG_ERR, + slapi_log_err(SLAPI_LOG_ERR, "symload_report_error", "Could not load symbol \"%s\" from \"%s\" for plugin %s\n", symbol, libpath, plugin ); } else { - LDAPDebug(LDAP_DEBUG_ERR, + slapi_log_err(SLAPI_LOG_ERR, "symload_report_error", "Could not open library \"%s\" for plugin %s\n", - libpath, plugin, 0 ); + libpath, plugin); } } diff --git a/ldap/servers/slapd/entry.c b/ldap/servers/slapd/entry.c index 1d04105..cfe5d2c 100644 --- a/ldap/servers/slapd/entry.c +++ b/ldap/servers/slapd/entry.c @@ -244,7 +244,7 @@ str2entry_fast( const char *rawdn, const Slapi_RDN *srdn, char *s, int flags, in * In case an entry starts with rdn:, dn must be provided. */ - LDAPDebug(LDAP_DEBUG_TRACE, "=> str2entry_fast\n", 0, 0, 0 ); + slapi_log_err(SLAPI_LOG_TRACE, "str2entry_fast" ,"==>\n"); e = slapi_entry_alloc(); slapi_entry_init(e,NULL,NULL); @@ -273,7 +273,7 @@ str2entry_fast( const char *rawdn, const Slapi_RDN *srdn, char *s, int flags, in } if ( slapi_ldif_parse_line( s, &type, &value, &freeval ) < 0 ) { - LDAPDebug0Args(LDAP_DEBUG_TRACE, "<= str2entry_fast NULL (parse_line)\n"); + slapi_log_err(SLAPI_LOG_TRACE, "str2entry_fast", "<== NULL (parse_line)\n"); continue; } @@ -324,8 +324,8 @@ str2entry_fast( const char *rawdn, const Slapi_RDN *srdn, char *s, int flags, in } else { normdn = slapi_create_dn_string("%s", rawdn); if (NULL == normdn) { - LDAPDebug1Arg(LDAP_DEBUG_TRACE, - "str2entry_fast: Invalid DN: %s\n", rawdn); + slapi_log_err(SLAPI_LOG_TRACE, + "str2entry_fast: Invalid DN: %s\n", (char *)rawdn); slapi_entry_free( e ); if (freeval) slapi_ch_free_string(&value.bv_val); e = NULL; @@ -353,8 +353,8 @@ str2entry_fast( const char *rawdn, const Slapi_RDN *srdn, char *s, int flags, in } else { normdn = slapi_create_dn_string("%s", rawdn); if (NULL == normdn) { - LDAPDebug1Arg(LDAP_DEBUG_TRACE, - "str2entry_fast: Invalid DN: %s\n", rawdn); + slapi_log_err(SLAPI_LOG_TRACE, + "str2entry_fast", "Invalid DN: %s\n", rawdn); slapi_entry_free( e ); if (freeval) slapi_ch_free_string(&value.bv_val); @@ -374,11 +374,11 @@ str2entry_fast( const char *rawdn, const Slapi_RDN *srdn, char *s, int flags, in if ( type.bv_len == SLAPI_ATTR_DN_LENGTH && PL_strncasecmp( type.bv_val, SLAPI_ATTR_DN, type.bv_len ) == 0 ) { if ( slapi_entry_get_dn_const(e)!=NULL ) { char ebuf[ BUFSIZ ]; - LDAPDebug(LDAP_DEBUG_TRACE, - "str2entry_fast: entry has multiple dns \"%s\" and " + slapi_log_err(SLAPI_LOG_TRACE, + "str2entry_fast", "entry has multiple dns \"%s\" and " "\"%s\" (second ignored)\n", slapi_entry_get_dn_const(e), - escape_string( value.bv_val, ebuf ), 0 ); + escape_string( value.bv_val, ebuf )); /* the memory below was not allocated by the slapi_ch_ functions */ if (freeval) slapi_ch_free_string(&value.bv_val); continue; @@ -391,8 +391,8 @@ str2entry_fast( const char *rawdn, const Slapi_RDN *srdn, char *s, int flags, in } if (NULL == normdn) { char ebuf[ BUFSIZ ]; - LDAPDebug1Arg(LDAP_DEBUG_TRACE, - "str2entry_fast: Invalid DN: %s\n", + slapi_log_err(SLAPI_LOG_TRACE, + "str2entry_fast", "Invalid DN: %s\n", escape_string( value.bv_val, ebuf )); slapi_entry_free( e ); if (freeval) slapi_ch_free_string(&value.bv_val); @@ -426,10 +426,10 @@ str2entry_fast( const char *rawdn, const Slapi_RDN *srdn, char *s, int flags, in /* retrieve uniqueid */ if ((type.bv_len == SLAPI_ATTR_UNIQUEID_LENGTH) && (PL_strcasecmp (type.bv_val, SLAPI_ATTR_UNIQUEID) == 0)) { if (e->e_uniqueid != NULL){ - LDAPDebug(LDAP_DEBUG_TRACE, - "str2entry_fast: entry has multiple uniqueids %s " + slapi_log_err(SLAPI_LOG_TRACE, + "str2entry_fast", "entry has multiple uniqueids %s " "and %s (second ignored)\n", - e->e_uniqueid, value.bv_val, 0); + e->e_uniqueid, value.bv_val); }else{ /* name2asi will be locked in slapi_entry_set_uniqueid */ /* attr_syntax_unlock_read(); */ @@ -458,7 +458,8 @@ str2entry_fast( const char *rawdn, const Slapi_RDN *srdn, char *s, int flags, in case ATTRIBUTE_PRESENT: if(attrlist_append_nosyntax_init(&e->e_attrs, type.bv_val, &a)==0 /* Found */) { - LDAPDebug(LDAP_DEBUG_ERR, "str2entry_fast - Non-contiguous attribute values for %s\n", type.bv_val, 0, 0); + slapi_log_err(SLAPI_LOG_ERR, "str2entry_fast", + "Non-contiguous attribute values for %s\n", type.bv_val); PR_ASSERT(0); continue; } @@ -466,13 +467,15 @@ str2entry_fast( const char *rawdn, const Slapi_RDN *srdn, char *s, int flags, in case ATTRIBUTE_DELETED: if(attrlist_append_nosyntax_init(&e->e_deleted_attrs, type.bv_val, &a)==0 /* Found */) { - LDAPDebug(LDAP_DEBUG_ERR, "str2entry_fast - Non-contiguous deleted attribute values for %s\n", type.bv_val, 0, 0); + slapi_log_err(SLAPI_LOG_ERR, "str2entry_fast", + "Non-contiguous deleted attribute values for %s\n", type.bv_val); PR_ASSERT(0); continue; } break; case ATTRIBUTE_NOTFOUND: - LDAPDebug(LDAP_DEBUG_ERR, "str2entry_fast - Non-contiguous deleted attribute values for %s\n", type.bv_val, 0, 0); + slapi_log_err(SLAPI_LOG_ERR, "str2entry_fast", + "Non-contiguous deleted attribute values for %s\n", type.bv_val); PR_ASSERT(0); continue; /* break; ??? */ @@ -489,8 +492,8 @@ str2entry_fast( const char *rawdn, const Slapi_RDN *srdn, char *s, int flags, in /* check that the dn is formatted correctly */ rc = slapi_dn_syntax_check(NULL, value.bv_val, 1); if (rc) { /* syntax check failed */ - LDAPDebug2Args(LDAP_DEBUG_TRACE, - "str2entry_fast: strict: Invalid DN value: %s: %s\n", + slapi_log_err(SLAPI_LOG_TRACE, + "str2entry_fast", "strict: Invalid DN value: %s: %s\n", type.bv_val, value.bv_val); slapi_entry_free( e ); if (freeval) slapi_ch_free_string(&value.bv_val); @@ -559,10 +562,10 @@ str2entry_fast( const char *rawdn, const Slapi_RDN *srdn, char *s, int flags, in slapi_ch_free_string(&ptype); if ( attr_val_cnt >= ENTRY_MAX_ATTRIBUTE_VALUE_COUNT ) { - LDAPDebug(LDAP_DEBUG_ERR, - "str2entry_fast - entry %s exceeded max attribute value cound %ld\n", - slapi_entry_get_dn_const(e)?slapi_entry_get_dn_const(e):"unknown", - attr_val_cnt, 0 ); + slapi_log_err(SLAPI_LOG_ERR, + "str2entry_fast", "entry %s exceeded max attribute value cound %ld\n", + slapi_entry_get_dn_const(e)?(char *)slapi_entry_get_dn_const(e):"unknown", + attr_val_cnt); } if (read_stateinfo && maxcsn) { @@ -579,7 +582,7 @@ str2entry_fast( const char *rawdn, const Slapi_RDN *srdn, char *s, int flags, in if (e->e_flags & SLAPI_ENTRY_FLAG_TOMBSTONE) { /* tombstone */ if (_entry_set_tombstone_rdn(e, slapi_entry_get_dn_const(e))) { - LDAPDebug1Arg(LDAP_DEBUG_TRACE, "str2entry_fast: " + slapi_log_err(SLAPI_LOG_TRACE, "str2entry_fast", "tombstone entry has badly formatted dn: %s\n", slapi_entry_get_dn_const(e) ); slapi_entry_free( e ); e = NULL; @@ -590,8 +593,7 @@ str2entry_fast( const char *rawdn, const Slapi_RDN *srdn, char *s, int flags, in /* check to make sure there was a dn: line */ if ( slapi_entry_get_dn_const(e)==NULL ) { if (!(SLAPI_STR2ENTRY_INCLUDE_VERSION_STR & flags)) - LDAPDebug(LDAP_DEBUG_ERR, "str2entry_fast - entry has no dn\n", - 0, 0, 0 ); + slapi_log_err(SLAPI_LOG_ERR, "str2entry_fast", "entry has no dn\n"); slapi_entry_free( e ); e = NULL; } @@ -600,8 +602,7 @@ done: csnset_free(&valuecsnset); csn_free(&attributedeletioncsn); csn_free(&maxcsn); - LDAPDebug(LDAP_DEBUG_TRACE, "<= str2entry_fast 0x%x\n", - e, 0, 0 ); + slapi_log_err(SLAPI_LOG_TRACE, "str2entry_fast", "<== 0x%p\n",e); return( e ); } @@ -797,7 +798,7 @@ str2entry_dupcheck( const char *rawdn, char *s, int flags, int read_stateinfo ) /* Check if we should be performing strict validation. */ strict = config_get_dn_validate_strict(); - LDAPDebug0Args(LDAP_DEBUG_TRACE, "=> str2entry_dupcheck\n"); + slapi_log_err(SLAPI_LOG_TRACE, "str2entry_dupcheck", "==>\n"); e = slapi_entry_alloc(); slapi_entry_init(e,NULL,NULL); @@ -824,9 +825,9 @@ str2entry_dupcheck( const char *rawdn, char *s, int flags, int read_stateinfo ) bvtype = bv_null; bvvalue = bv_null; if ( slapi_ldif_parse_line( s, &bvtype, &bvvalue, &freeval ) < 0 ) { - LDAPDebug(LDAP_DEBUG_WARNING, + slapi_log_err(SLAPI_LOG_WARNING, "str2entry_dupcheck" "Entry (%s), ignoring invalid line \"%s\"...\n", - rawdn ? rawdn : "", s, 0); + rawdn ? (char *)rawdn : "", s); continue; } type = bvtype.bv_val; @@ -863,8 +864,8 @@ str2entry_dupcheck( const char *rawdn, char *s, int flags, int read_stateinfo ) } else { normdn = slapi_create_dn_string("%s", rawdn); if (NULL == normdn) { - LDAPDebug1Arg(LDAP_DEBUG_TRACE, - "str2entry_dupcheck: Invalid DN: %s\n", rawdn); + slapi_log_err(SLAPI_LOG_TRACE, "str2entry_dupcheck" + "nvalid DN: %s\n", (char *)rawdn); slapi_entry_free( e ); if (freeval) slapi_ch_free_string(&bvvalue.bv_val); csnset_free(&valuecsnset); @@ -886,8 +887,8 @@ str2entry_dupcheck( const char *rawdn, char *s, int flags, int read_stateinfo ) } else { normdn = slapi_create_dn_string("%s", rawdn); if (NULL == normdn) { - LDAPDebug1Arg(LDAP_DEBUG_TRACE, - "str2entry_dupcheck: Invalid DN: %s\n", rawdn); + slapi_log_err(SLAPI_LOG_TRACE, "str2entry_dupcheck" + "Invalid DN: %s\n", (char *)rawdn); slapi_entry_free( e ); if (freeval) slapi_ch_free_string(&bvvalue.bv_val); csnset_free(&valuecsnset); @@ -907,19 +908,18 @@ str2entry_dupcheck( const char *rawdn, char *s, int flags, int read_stateinfo ) if ( strcasecmp( type, "dn" ) == 0 ) { if ( slapi_entry_get_dn_const(e)!=NULL ) { char ebuf[ BUFSIZ ]; - LDAPDebug(LDAP_DEBUG_TRACE, - "str2entry_dupcheck: entry has multiple dns \"%s\" " - "and \"%s\" (second ignored)\n", - slapi_entry_get_dn_const(e), - escape_string( valuecharptr, ebuf ), 0 ); + slapi_log_err(SLAPI_LOG_TRACE, "str2entry_dupcheck" + "Entry has multiple dns \"%s\" and \"%s\" (second ignored)\n", + (char *)slapi_entry_get_dn_const(e), + escape_string( valuecharptr, ebuf )); /* the memory below was not allocated by the slapi_ch_ functions */ if (freeval) slapi_ch_free_string(&bvvalue.bv_val); continue; } normdn = slapi_create_dn_string("%s", valuecharptr); if (NULL == normdn) { - LDAPDebug1Arg(LDAP_DEBUG_TRACE, - "str2entry_dupcheck: Invalid DN: %s\n", valuecharptr); + slapi_log_err(SLAPI_LOG_TRACE, "str2entry_dupcheck" + "Invalid DN: %s\n", valuecharptr); slapi_entry_free( e ); e = NULL; if (freeval) slapi_ch_free_string(&bvvalue.bv_val); goto free_and_return; @@ -950,9 +950,8 @@ str2entry_dupcheck( const char *rawdn, char *s, int flags, int read_stateinfo ) /* retrieve uniqueid */ if ((bvtype.bv_len == SLAPI_ATTR_UNIQUEID_LENGTH) && (PL_strcasecmp (type, SLAPI_ATTR_UNIQUEID) == 0)) { if (e->e_uniqueid != NULL){ - LDAPDebug(LDAP_DEBUG_TRACE, - "str2entry_dupcheck: entry has multiple uniqueids %s " - "and %s (second ignored)\n", + slapi_log_err(SLAPI_LOG_TRACE, "str2entry_dupcheck" + "Entry has multiple uniqueids %s and %s (second ignored)\n", e->e_uniqueid, valuecharptr, 0); }else{ slapi_entry_set_uniqueid (e, slapi_ch_strdup(valuecharptr)); @@ -1075,8 +1074,8 @@ str2entry_dupcheck( const char *rawdn, char *s, int flags, int read_stateinfo ) /* check that the dn is formatted correctly */ rc = slapi_dn_syntax_check(NULL, valuecharptr, 1); if (rc) { /* syntax check failed */ - LDAPDebug2Args(LDAP_DEBUG_ERR, - "str2entry_dupcheck - strict: Invalid DN value: %s: %s\n", + slapi_log_err(SLAPI_LOG_ERR, "str2entry_dupcheck" + "strict: Invalid DN value: %s: %s\n", type, valuecharptr); slapi_entry_free( e ); e = NULL; if (freeval) slapi_ch_free_string(&bvvalue.bv_val); @@ -1137,7 +1136,8 @@ str2entry_dupcheck( const char *rawdn, char *s, int flags, int read_stateinfo ) else { /* Failure adding to value tree */ - LDAPDebug(LDAP_DEBUG_ERR, "str2entry_dupcheck - unexpected failure %d adding value\n", rc, 0, 0 ); + slapi_log_err(SLAPI_LOG_ERR, "str2entry_dupcheck", + "Unexpected failure %d adding value\n", rc ); slapi_value_free(&value); /* value not consumed - free it */ slapi_entry_free( e ); e = NULL; goto free_and_return; @@ -1151,8 +1151,7 @@ str2entry_dupcheck( const char *rawdn, char *s, int flags, int read_stateinfo ) if ( slapi_entry_get_dn_const(e)==NULL ) { if (!(SLAPI_STR2ENTRY_INCLUDE_VERSION_STR & flags)) - LDAPDebug(LDAP_DEBUG_ERR, "str2entry_dupcheck - entry has no dn\n", - 0, 0, 0 ); + slapi_log_err(SLAPI_LOG_ERR, "str2entry_dupcheck", "Entry has no dn\n"); slapi_entry_free( e ); e = NULL; goto free_and_return; } @@ -1172,13 +1171,13 @@ str2entry_dupcheck( const char *rawdn, char *s, int flags, int read_stateinfo ) if ( sa->sa_numdups > 0 ) { if ( sa->sa_numdups > 1 ) { - LDAPDebug(LDAP_DEBUG_WARNING, "str2entry_dupcheck - %d duplicate values for attribute " + slapi_log_err(SLAPI_LOG_WARNING, "str2entry_dupcheck", "%d duplicate values for attribute " "type %s detected in entry %s. Extra values ignored.\n", sa->sa_numdups, sa->sa_type, slapi_entry_get_dn_const(e) ); } else { - LDAPDebug(LDAP_DEBUG_WARNING, "str2entry_dupcheck - Duplicate value for attribute " + slapi_log_err(SLAPI_LOG_WARNING, "str2entry_dupcheck", "Duplicate value for attribute " "type %s detected in entry %s. Extra value ignored.\n", - sa->sa_type, slapi_entry_get_dn_const(e), 0 ); + sa->sa_type, slapi_entry_get_dn_const(e)); } } { @@ -1237,7 +1236,7 @@ str2entry_dupcheck( const char *rawdn, char *s, int flags, int read_stateinfo ) if (e->e_flags & SLAPI_ENTRY_FLAG_TOMBSTONE) { /* tombstone */ if (_entry_set_tombstone_rdn(e, slapi_entry_get_dn_const(e))) { - LDAPDebug1Arg(LDAP_DEBUG_TRACE, "str2entry_dupcheck: " + slapi_log_err(SLAPI_LOG_TRACE, "str2entry_dupcheck", "tombstone entry has badly formatted dn: %s\n", slapi_entry_get_dn_const(e) ); slapi_entry_free( e ); e = NULL; @@ -1248,9 +1247,8 @@ str2entry_dupcheck( const char *rawdn, char *s, int flags, int read_stateinfo ) /* Add the RDN values, if asked, and if not already present */ if ( flags & SLAPI_STR2ENTRY_ADDRDNVALS ) { if ( slapi_entry_add_rdn_values( e ) != LDAP_SUCCESS ) { - LDAPDebug(LDAP_DEBUG_TRACE, - "str2entry_dupcheck: entry has badly formatted dn\n", - 0, 0, 0 ); + slapi_log_err(SLAPI_LOG_TRACE, "str2entry_dupcheck", + "Entry has badly formatted dn\n"); slapi_entry_free( e ); e = NULL; goto free_and_return; } @@ -1280,8 +1278,8 @@ free_and_return: csn_free(&attributedeletioncsn); csn_free(&maxcsn); - LDAPDebug(LDAP_DEBUG_TRACE, "<= str2entry_dupcheck 0x%x \"%s\"\n", - e, slapi_sdn_get_dn (slapi_entry_get_sdn_const(e)), 0 ); + slapi_log_err(SLAPI_LOG_TRACE, "str2entry_dupcheck", "<=0x%p \"%s\"\n", + e, slapi_sdn_get_dn (slapi_entry_get_sdn_const(e))); return e; } @@ -1331,9 +1329,9 @@ slapi_str2entry( char *s, int flags ) Slapi_Entry *e; int read_stateinfo= ~( flags & SLAPI_STR2ENTRY_IGNORE_STATE ); - LDAPDebug(LDAP_DEBUG_ARGS, - "slapi_str2entry: flags=0x%x, entry=\"%.50s...\"\n", - flags, s, 0 ); + slapi_log_err(SLAPI_LOG_ARGS, + "slapi_str2entry", "flags=0x%x, entry=\"%.50s...\"\n", + flags, s ); /* @@ -1392,8 +1390,8 @@ slapi_str2entry_ext( const char *normdn, const Slapi_RDN *srdn, char *s, int fla return slapi_str2entry( s, flags ); } - LDAPDebug(LDAP_DEBUG_ARGS, - "slapi_str2entry_ext: flags=0x%x, dn=\"%s\", entry=\"%.50s...\"\n", + slapi_log_err(SLAPI_LOG_ARGS, + "slapi_str2entry_ext", "flags=0x%x, dn=\"%s\", entry=\"%.50s...\"\n", flags, normdn, s ); @@ -1765,7 +1763,7 @@ entry2str_internal( Slapi_Entry *e, int *len, int entry2str_ctrl ) *ecur = '\0'; if ( (size_t)(ecur - ebuf + 1) > elen ) { - slapi_log_error(SLAPI_LOG_NOTICE, "entry2str_internal", + slapi_log_err(SLAPI_LOG_NOTICE, "entry2str_internal", "entry2str_internal: array boundary wrote: bufsize=%ld wrote=%ld\n", (long int)elen, (long int)(ecur - ebuf + 1)); } @@ -1859,7 +1857,7 @@ entry2str_internal_ext( Slapi_Entry *e, int *len, int entry2str_ctrl) if ((size_t)(ecur - ebuf + 1) > elen) { /* this should not happen */ - slapi_log_error(SLAPI_LOG_NOTICE, "entry2str_internal_ext", + slapi_log_err(SLAPI_LOG_NOTICE, "entry2str_internal_ext", "Array boundary wrote: bufsize=%ld wrote=%ld\n", (long int)elen, (long int)(ecur - ebuf + 1)); } @@ -2171,7 +2169,7 @@ static void entry_dump( const Slapi_Entry *e, const char *text) { const char *dn= slapi_entry_get_dn_const(e); - LDAPDebug(LDAP_DEBUG_DEBUG, "Entry %s ptr=%lx dn=%s\n", text, e, (dn==NULL?"NULL":dn)); + slapi_log_err(SLAPI_LOG_DEBUG, "entry_dump", "Entry %s ptr=%lx dn=%s\n", text, e, (dn==NULL?"NULL":dn)); } #endif @@ -2437,7 +2435,7 @@ static Slapi_Vattr *entry_vattr_lookup_nolock(const Slapi_Entry *e, const char * } else if (vattr->attr != NULL) { name = vattr->attr->a_type; } else { - slapi_log_error(SLAPI_LOG_NOTICE, "entry_vattr_lookup_nolock", + slapi_log_err(SLAPI_LOG_NOTICE, "entry_vattr_lookup_nolock", "unable to retrieve attribute name %s\n", attr_name); continue; } @@ -2733,7 +2731,7 @@ slapi_entry_vattrcache_merge_sv(Slapi_Entry *e, const char *type, * returns a non NULL value. * Possibly watermark should have been updated to clear the cache */ - slapi_log_error(SLAPI_LOG_ERR, "slapi_entry_vattrcache_merge_sv", + slapi_log_err(SLAPI_LOG_ERR, "slapi_entry_vattrcache_merge_sv", "Virtual attribute %s already cached with empty value, unwilling to cache a different value (%s) \n", type, slapi_entry_get_dn(e)); } @@ -3280,8 +3278,9 @@ slapi_entry_add_rdn_values( Slapi_Entry *e ) if ((ava.ava_value.bv_len != bv->bv_len) || (memcmp(ava.ava_value.bv_val, bv->bv_val, bv->bv_len) != 0)) { /* bytes not identical so reject */ - LDAPDebug(LDAP_DEBUG_TRACE, "RDN value is not identical to entry value for type %s in entry %s\n", - type, dn ? dn : "", 0 ); + slapi_log_err(SLAPI_LOG_TRACE, "slapi_entry_add_rdn_values", + "RDN value is not identical to entry value for type %s in entry %s\n", + type, dn ? dn : ""); #if 0 /* * This would be the right thing to do except that @@ -3326,7 +3325,8 @@ slapi_entry_has_children_ext(const Slapi_Entry *entry, int include_tombstone) Slapi_Attr *attr; int count = 0; - LDAPDebug(LDAP_DEBUG_TRACE, "=> slapi_has_children( %s )\n", slapi_entry_get_dn_const(entry), 0, 0); + slapi_log_err(SLAPI_LOG_TRACE, "slapi_entry_has_children_ext", "=> ( %s )\n", + slapi_entry_get_dn_const(entry)); /*If the subordinatecount exists, and it's nonzero, then return 1.*/ if (slapi_entry_attr_find( entry, "numsubordinates", &attr) == 0) @@ -3341,7 +3341,8 @@ slapi_entry_has_children_ext(const Slapi_Entry *entry, int include_tombstone) /* The entry has the attribute, and it's non-zero */ count = strtol(bval->bv_val, (char **)NULL, 10); if (count > 0) { - LDAPDebug1Arg(LDAP_DEBUG_TRACE, "<= slapi_has_children %d\n", count); + slapi_log_err(SLAPI_LOG_TRACE, "slapi_entry_has_children_ext", + "<= slapi_has_children %d\n", count); return count; } } @@ -3360,13 +3361,14 @@ slapi_entry_has_children_ext(const Slapi_Entry *entry, int include_tombstone) /* The entry has the attribute, and it's non-zero */ count = strtol(bval->bv_val, (char **)NULL, 10); if (count > 0) { - LDAPDebug1Arg(LDAP_DEBUG_TRACE, "<= slapi_has_tombstone_children %d\n", count); + slapi_log_err(SLAPI_LOG_TRACE, "slapi_entry_has_children_ext", + "<= slapi_has_tombstone_children %d\n", count); return count; } } } } - LDAPDebug(LDAP_DEBUG_TRACE, "<= slapi_has_children 0\n", 0, 0, 0 ); + slapi_log_err(SLAPI_LOG_TRACE, "slapi_entry_has_children_ext", "<= slapi_has_children 0\n"); return(0); } @@ -3387,7 +3389,7 @@ slapi_entry_rename(Slapi_Entry *e, const char *newrdn, int deleteoldrdn, Slapi_D Slapi_Mods *smods = NULL; Slapi_DN newsrdn; - LDAPDebug(LDAP_DEBUG_TRACE, "=> slapi_entry_rename\n", 0, 0, 0 ); + slapi_log_err(SLAPI_LOG_TRACE, "slapi_entry_rename", "=>\n"); slapi_sdn_init(&newsrdn); /* Check if entry or newrdn are NULL. */ @@ -3461,7 +3463,7 @@ done: slapi_mods_free(&smods); slapi_sdn_done(&newsrdn); - LDAPDebug(LDAP_DEBUG_TRACE, "<= slapi_entry_rename\n", 0, 0, 0 ); + slapi_log_err(SLAPI_LOG_TRACE, "slapi_entry_rename", "<= \n"); return err; } @@ -3494,7 +3496,7 @@ entry_apply_mods_ignore_error( Slapi_Entry *e, LDAPMod **mods, int ignore_error int err; LDAPMod **mp = NULL; - LDAPDebug(LDAP_DEBUG_TRACE, "=> entry_apply_mods\n", 0, 0, 0 ); + slapi_log_err(SLAPI_LOG_TRACE, "entry_apply_mods", "=>\n"); err = LDAP_SUCCESS; for ( mp = mods; mp && *mp; mp++ ) @@ -3507,7 +3509,7 @@ entry_apply_mods_ignore_error( Slapi_Entry *e, LDAPMod **mods, int ignore_error } } - LDAPDebug(LDAP_DEBUG_TRACE, "<= entry_apply_mods %d\n", err, 0, 0 ); + slapi_log_err(SLAPI_LOG_TRACE, "entry_apply_mods", "<= %d\n", err); return( err ); } @@ -3547,14 +3549,14 @@ slapi_entry_apply_mod_extension(Slapi_Entry *e, const LDAPMod *mod, int modcnt) /* vals is consumed if successful. */ err = aiep->ext_set(e, vals, SLAPI_EXT_SET_ADD); if (err) { - slapi_log_error(SLAPI_LOG_ERR, "entry_apply_mod", + slapi_log_err(SLAPI_LOG_ERR, "entry_apply_mod", "ADD: Failed to set %s to extension\n", aiep->ext_type); valuearray_free(&vals); goto bail; } } else { - slapi_log_error(SLAPI_LOG_ERR, "entry_apply_mod", + slapi_log_err(SLAPI_LOG_ERR, "entry_apply_mod", "ADD: %s has no values\n", aiep->ext_type); goto bail; @@ -3565,7 +3567,7 @@ slapi_entry_apply_mod_extension(Slapi_Entry *e, const LDAPMod *mod, int modcnt) if (modcnt > 0) { err = aiep->ext_get(e, &vals); if (err) { - slapi_log_error(SLAPI_LOG_ERR, "entry_apply_mod", + slapi_log_err(SLAPI_LOG_ERR, "entry_apply_mod", "DEL: Failed to get %s from extension\n", aiep->ext_type); goto bail; @@ -3584,7 +3586,7 @@ slapi_entry_apply_mod_extension(Slapi_Entry *e, const LDAPMod *mod, int modcnt) /* myvals is consumed if successful. */ err = aiep->ext_set(e, myvals, SLAPI_EXT_SET_REPLACE); if (err) { - slapi_log_error(SLAPI_LOG_ERR, + slapi_log_err(SLAPI_LOG_ERR, "entry_apply_mod", "DEL: Failed to set %s " "to extension\n", @@ -3598,7 +3600,7 @@ slapi_entry_apply_mod_extension(Slapi_Entry *e, const LDAPMod *mod, int modcnt) /* ext_set replaces the existing value with NULL */ err = aiep->ext_set(e, NULL, SLAPI_EXT_SET_REPLACE); if (err) { - slapi_log_error(SLAPI_LOG_ERR, "entry_apply_mod", + slapi_log_err(SLAPI_LOG_ERR, "entry_apply_mod", "DEL: Failed to set %s to extension\n", aiep->ext_type); goto bail; @@ -3613,14 +3615,14 @@ slapi_entry_apply_mod_extension(Slapi_Entry *e, const LDAPMod *mod, int modcnt) /* vals is consumed if successful. */ err = aiep->ext_set(e, vals, SLAPI_EXT_SET_REPLACE); if (err) { - slapi_log_error(SLAPI_LOG_ERR, "entry_apply_mod", + slapi_log_err(SLAPI_LOG_ERR, "entry_apply_mod", "REPLACE: Failed to set %s to extension\n", aiep->ext_type); valuearray_free(&vals); goto bail; } } else { - slapi_log_error(SLAPI_LOG_ERR, "entry_apply_mod", + slapi_log_err(SLAPI_LOG_ERR, "entry_apply_mod", "REPLACE: %s has no values\n", aiep->ext_type); goto bail; @@ -3656,10 +3658,10 @@ entry_apply_mod( Slapi_Entry *e, const LDAPMod *mod ) PRBool sawsubentry=PR_FALSE; for ( i = 0; mod->mod_bvalues != NULL && mod->mod_bvalues[i] != NULL; i++ ) { - if((strcasecmp(mod->mod_type,"objectclass") == 0) - && (strncasecmp((const char *)mod->mod_bvalues[i]->bv_val,"ldapsubentry",mod->mod_bvalues[i]->bv_len) == 0)) - sawsubentry=PR_TRUE; - LDAPDebug(LDAP_DEBUG_ARGS, " %s: %s\n", mod->mod_type, mod->mod_bvalues[i]->bv_val, 0 ); + if((strcasecmp(mod->mod_type,"objectclass") == 0) + && (strncasecmp((const char *)mod->mod_bvalues[i]->bv_val,"ldapsubentry",mod->mod_bvalues[i]->bv_len) == 0)) + sawsubentry=PR_TRUE; + slapi_log_err(SLAPI_LOG_ARGS, "entry_apply_mod", "%s: %s\n", mod->mod_type, mod->mod_bvalues[i]->bv_val); } bvcnt = i; @@ -3681,24 +3683,24 @@ entry_apply_mod( Slapi_Entry *e, const LDAPMod *mod ) switch ( mod->mod_op & ~LDAP_MOD_BVALUES ) { case LDAP_MOD_ADD: - LDAPDebug(LDAP_DEBUG_ARGS, " add: %s\n", mod->mod_type, 0, 0 ); + slapi_log_err(SLAPI_LOG_ARGS, "entry_apply_mod", "add: %s\n", mod->mod_type); if(sawsubentry) e->e_flags |= SLAPI_ENTRY_LDAPSUBENTRY; err = slapi_entry_add_values( e, mod->mod_type, mod->mod_bvalues ); break; case LDAP_MOD_DELETE: - LDAPDebug(LDAP_DEBUG_ARGS, " delete: %s\n", mod->mod_type, 0, 0 ); + slapi_log_err(SLAPI_LOG_ARGS, "entry_apply_mod", "delete: %s\n", mod->mod_type); if(sawsubentry) e->e_flags |= 0; err = slapi_entry_delete_values( e, mod->mod_type, mod->mod_bvalues ); break; case LDAP_MOD_REPLACE: - LDAPDebug(LDAP_DEBUG_ARGS, " replace: %s\n", mod->mod_type, 0, 0 ); + slapi_log_err(SLAPI_LOG_ARGS, "entry_apply_mod", "replace: %s\n", mod->mod_type); err = entry_replace_values( e, mod->mod_type, mod->mod_bvalues ); break; } done: - LDAPDebug(LDAP_DEBUG_ARGS, " -\n", 0, 0, 0 ); + slapi_log_err(SLAPI_LOG_ARGS, "entry_apply_mod","<==\n"); return( err ); } @@ -3822,8 +3824,8 @@ delete_values_sv_internal( /* delete the entire attribute */ if ( valuestodelete == NULL || valuestodelete[0] == NULL ){ - LDAPDebug(LDAP_DEBUG_ARGS, "removing entire attribute %s\n", - type, 0, 0 ); + slapi_log_err(SLAPI_LOG_ARGS, "delete_values_sv_internal", + "removing entire attribute %s\n", type); retVal = attrlist_delete( &e->e_attrs, type); if (flags & SLAPI_VALUE_FLAG_IGNOREERROR) { return LDAP_SUCCESS; @@ -3834,8 +3836,8 @@ delete_values_sv_internal( /* delete specific values - find the attribute first */ a= attrlist_find(e->e_attrs, type); if ( a == NULL ) { - LDAPDebug(LDAP_DEBUG_ARGS, "could not find attribute %s\n", - type, 0, 0 ); + slapi_log_err(SLAPI_LOG_ARGS, "delete_values_sv_internal", + "Could not find attribute %s\n", type); if (flags & SLAPI_VALUE_FLAG_IGNOREERROR) { return LDAP_SUCCESS; } @@ -3863,9 +3865,9 @@ delete_values_sv_internal( */ if ( retVal==LDAP_OPERATIONS_ERROR ) { - LDAPDebug(LDAP_DEBUG_ERR, "delete_values_sv_internal - Possible existing duplicate " + slapi_log_err(SLAPI_LOG_ERR, "delete_values_sv_internal", "Possible existing duplicate " "value for attribute type %s found in " - "entry %s\n", a->a_type, slapi_entry_get_dn_const(e), 0 ); + "entry %s\n", a->a_type, slapi_entry_get_dn_const(e)); } if (flags & SLAPI_VALUE_FLAG_IGNOREERROR) { retVal = LDAP_SUCCESS; @@ -4030,10 +4032,9 @@ slapi_entry_diff(Slapi_Mods *smods, Slapi_Entry *e1, Slapi_Entry *e2, int diff_c slapi_value_get_berval(e1_val))) { /* attr-value e1_val not found in e2_attr; add it */ - LDAPDebug(LDAP_DEBUG_TRACE, - "slapi_entry_diff: attr-val of %s is not in e2; " - "add it\n", - e1_attr_name, 0, 0); + slapi_log_err(SLAPI_LOG_TRACE, + "slapi_entry_diff", "attr-val of %s is not in e2; add it\n", + e1_attr_name); slapi_mods_add(smods, LDAP_MOD_ADD, e1_attr_name, e1_val->bv.bv_len, e1_val->bv.bv_val); } @@ -4042,9 +4043,9 @@ slapi_entry_diff(Slapi_Mods *smods, Slapi_Entry *e1, Slapi_Entry *e2, int diff_c else { /* attr e1_attr_names not found in e2 */ - LDAPDebug(LDAP_DEBUG_TRACE, - "slapi_entry_diff: attr %s is not in e2; add it\n", - e1_attr_name, 0, 0); + slapi_log_err(SLAPI_LOG_TRACE, + "slapi_entry_diff", "Attr %s is not in e2; add it\n", + e1_attr_name); slapi_mods_add_mod_values(smods, LDAP_MOD_ADD, e1_attr_name, attr_get_present_values(e1_attr)); @@ -4076,10 +4077,8 @@ slapi_entry_diff(Slapi_Mods *smods, Slapi_Entry *e1, Slapi_Entry *e2, int diff_c slapi_value_get_berval(e2_val))) { /* attr-value e2_val not found in e1_attr; delete it */ - LDAPDebug(LDAP_DEBUG_TRACE, - "slapi_entry_diff: attr-val of %s is not in e1; " - "delete it\n", - e2_attr_name, 0, 0); + slapi_log_err(SLAPI_LOG_TRACE, "slapi_entry_diff", + "attr-val of %s is not in e1; delete it\n", e2_attr_name); slapi_mods_add(smods, LDAP_MOD_DELETE, e2_attr_name, e2_val->bv.bv_len, e2_val->bv.bv_val); } @@ -4088,9 +4087,9 @@ slapi_entry_diff(Slapi_Mods *smods, Slapi_Entry *e1, Slapi_Entry *e2, int diff_c else { /* attr e2_attr_names not in e1 */ - LDAPDebug(LDAP_DEBUG_TRACE, - "slapi_entry_diff: attr %s is not in e1; delete it\n", - e2_attr_name, 0, 0); + slapi_log_err(SLAPI_LOG_TRACE, + "slapi_entry_diff", "attr %s is not in e1; delete it\n", + e2_attr_name); slapi_mods_add_mod_values(smods, LDAP_MOD_DELETE, e2_attr_name, NULL); } } @@ -4183,34 +4182,34 @@ slapi_entries_diff(Slapi_Entry **old_entries, Slapi_Entry **curr_entries, rval = 1; if (isfirst) { - LDAPDebug(LDAP_DEBUG_INFO, "slapi_entries_diff - %sEntry %s\n", my_logging_prestr, - slapi_entry_get_dn_const(*oep), 0); + slapi_log_err(SLAPI_LOG_INFO, "slapi_entries_diff", "%sEntry %s\n", my_logging_prestr, + slapi_entry_get_dn_const(*oep)); isfirst = 0; } switch (mod->mod_op & ~LDAP_MOD_BVALUES) { case LDAP_MOD_DELETE: - LDAPDebug(LDAP_DEBUG_INFO, - "slapi_entries_diff - Del Attribute %s Value %s\n", + slapi_log_err(SLAPI_LOG_INFO, + "slapi_entries_diff", "Del Attribute %s Value %s\n", mod->mod_type, mod->mod_bvalues? - mod->mod_bvalues[0]->bv_val:"N/A", 0); + mod->mod_bvalues[0]->bv_val:"N/A"); break; case LDAP_MOD_ADD: - LDAPDebug(LDAP_DEBUG_INFO, - "slapi_entries_diff - Add Attribute %s Value %s\n", - mod->mod_type, mod->mod_bvalues[0]->bv_val, 0); + slapi_log_err(SLAPI_LOG_INFO, + "slapi_entries_diff", "Add Attribute %s Value %s\n", + mod->mod_type, mod->mod_bvalues[0]->bv_val); break; case LDAP_MOD_REPLACE: - LDAPDebug(LDAP_DEBUG_INFO, - "slapi_entries_diff - Rep Attribute %s Value %s\n", - mod->mod_type, mod->mod_bvalues[0]->bv_val, 0); + slapi_log_err(SLAPI_LOG_INFO, + "slapi_entries_diff", "Rep Attribute %s Value %s\n", + mod->mod_type, mod->mod_bvalues[0]->bv_val); break; default: - LDAPDebug(LDAP_DEBUG_ERR, - "slapi_entries_diff - Unknown op %d Attribute %s\n", + slapi_log_err(SLAPI_LOG_ERR, + "slapi_entries_diff ", "Unknown op %d Attribute %s\n", mod->mod_op & ~LDAP_MOD_BVALUES, - mod->mod_type, 0); + mod->mod_type); break; } @@ -4244,8 +4243,8 @@ slapi_entries_diff(Slapi_Entry **old_entries, Slapi_Entry **curr_entries, slapi_entry_clear_flag(*oep, SLAPI_ENTRY_FLAG_DIFF_IN_BOTH); } else { rval = 1; - LDAPDebug(LDAP_DEBUG_ERR, "slapi_entries_diff - Add %sEntry %s\n", - my_logging_prestr, slapi_entry_get_dn_const(*oep), 0); + slapi_log_err(SLAPI_LOG_ERR, "slapi_entries_diff", "Add %sEntry %s\n", + my_logging_prestr, slapi_entry_get_dn_const(*oep)); if (testall) { if (force_update) @@ -4253,8 +4252,8 @@ slapi_entries_diff(Slapi_Entry **old_entries, Slapi_Entry **curr_entries, LDAPMod **mods; slapi_entry2mods(*oep, NULL, &mods); pblock_init(&pb); - slapi_add_internal_set_pb(&pb, - slapi_entry_get_dn_const(*oep), mods, NULL, plg_id, 0); + slapi_add_internal_set_pb(&pb, slapi_entry_get_dn_const(*oep), + mods, NULL, plg_id, 0); slapi_add_internal_pb(&pb); freepmods(mods); pblock_done(&pb); @@ -4273,8 +4272,8 @@ slapi_entries_diff(Slapi_Entry **old_entries, Slapi_Entry **curr_entries, } else { rval = 1; - LDAPDebug(LDAP_DEBUG_ERR, "slapi_entries_diff - Del %sEntry %s\n", - my_logging_prestr, slapi_entry_get_dn_const(*cep), 0); + slapi_log_err(SLAPI_LOG_ERR, "slapi_entries_diff", "Del %sEntry %s\n", + my_logging_prestr, slapi_entry_get_dn_const(*cep)); if (testall) { @@ -4318,7 +4317,7 @@ _entry_set_tombstone_rdn(Slapi_Entry *e, const char *normdn) Slapi_RDN mysrdn = {0}; rc = slapi_rdn_init_all_dn(&mysrdn, sepp + 1); if (rc) { - slapi_log_error(SLAPI_LOG_ERR, "_entry_set_tombstone_rdn", + slapi_log_err(SLAPI_LOG_ERR, "_entry_set_tombstone_rdn", "Failed to convert DN %s to RDN\n", sepp + 1); slapi_rdn_done(&mysrdn); goto bail; diff --git a/ldap/servers/slapd/entrywsi.c b/ldap/servers/slapd/entrywsi.c index 2e85a29..2d6620d 100644 --- a/ldap/servers/slapd/entrywsi.c +++ b/ldap/servers/slapd/entrywsi.c @@ -627,6 +627,7 @@ static int entry_delete_present_values_wsi_single_valued(Slapi_Entry *e, const char *type, struct berval **vals, const CSN *csn, int urp, int mod_op, struct berval **replacevals); static int entry_delete_present_values_wsi_multi_valued(Slapi_Entry *e, const char *type, struct berval **vals, const CSN *csn, int urp, int mod_op, struct berval **replacevals); + static int entry_delete_present_values_wsi(Slapi_Entry *e, const char *type, struct berval **vals, const CSN *csn, int urp, int mod_op, struct berval **replacevals) { @@ -664,8 +665,8 @@ entry_delete_present_values_wsi(Slapi_Entry *e, const char *type, struct berval retVal = LDAP_SUCCESS; } else { if (!urp) { - LDAPDebug1Arg(LDAP_DEBUG_ARGS, "could not find attribute %s\n", - type); + slapi_log_err(SLAPI_LOG_ARGS, "entry_delete_present_values_wsi", + "could not find attribute %s\n", type); } retVal = LDAP_NO_SUCH_ATTRIBUTE; } @@ -694,7 +695,8 @@ entry_delete_present_values_wsi_single_valued(Slapi_Entry *e, const char *type, if ( vals == NULL || vals[0] == NULL ) { /* delete the entire attribute */ - LDAPDebug(LDAP_DEBUG_ARGS, "removing entire attribute %s\n", type, 0, 0 ); + slapi_log_err(SLAPI_LOG_ARGS, "entry_delete_present_values_wsi_single_valued", + "removing entire attribute %s\n", type); const CSN *adcsn = attr_get_deletion_csn(a); if (csn_compare(csn, adcsn)<0) { /* the attribute was deleted with an adcsn @@ -772,10 +774,9 @@ entry_delete_present_values_wsi_single_valued(Slapi_Entry *e, const char *type, */ if ( retVal==LDAP_OPERATIONS_ERROR ) { - LDAPDebug(LDAP_DEBUG_ERR, "entry_delete_present_values_wsi_single_valued - " - "Possible existing duplicate " - "value for attribute type %s found in " - "entry %s\n", a->a_type, slapi_entry_get_dn_const(e), 0 ); + slapi_log_err(SLAPI_LOG_ERR, "entry_delete_present_values_wsi_single_valued", + "Possible existing duplicate value for attribute type %s found in entry %s\n", + a->a_type, slapi_entry_get_dn_const(e)); } } valuearray_free(&valuestodelete); @@ -793,7 +794,8 @@ entry_delete_present_values_wsi_multi_valued(Slapi_Entry *e, const char *type, s if ( vals == NULL || vals[0] == NULL ) { /* delete the entire attribute */ - LDAPDebug(LDAP_DEBUG_ARGS, "Removing entire attribute %s\n", type, 0, 0 ); + slapi_log_err(SLAPI_LOG_ARGS, "entry_delete_present_values_wsi_multi_valued", + "Removing entire attribute %s\n", type); const CSN *adcsn = attr_get_deletion_csn(a); if (csn_compare(csn, adcsn)<0) { /* the attribute was deleted with an adcsn @@ -890,10 +892,9 @@ entry_delete_present_values_wsi_multi_valued(Slapi_Entry *e, const char *type, s */ if ( retVal==LDAP_OPERATIONS_ERROR ) { - LDAPDebug(LDAP_DEBUG_ERR, "entry_delete_present_values_wsi_multi_valued - " - "Possible existing duplicate " - "value for attribute type %s found in " - "entry %s\n", a->a_type, slapi_entry_get_dn_const(e), 0 ); + slapi_log_err(SLAPI_LOG_ERR, "entry_delete_present_values_wsi_multi_valued", + "Possible existing duplicate value for attribute type %s found in entry %s\n", + a->a_type, slapi_entry_get_dn_const(e)); } } valuearray_free(&valuestodelete); @@ -938,28 +939,28 @@ entry_apply_mod_wsi(Slapi_Entry *e, const LDAPMod *mod, const CSN *csn, int urp) switch ( mod->mod_op & ~LDAP_MOD_BVALUES ) { case LDAP_MOD_ADD: - LDAPDebug(LDAP_DEBUG_ARGS, " add: %s\n", mod->mod_type, 0, 0 ); + slapi_log_err(SLAPI_LOG_ARGS, "entry_apply_mod_wsi", "add: %s\n", mod->mod_type); retVal = entry_add_present_values_wsi( e, mod->mod_type, mod->mod_bvalues, csn, urp, 0 ); break; case LDAP_MOD_DELETE: - LDAPDebug(LDAP_DEBUG_ARGS, " delete: %s\n", mod->mod_type, 0, 0 ); + slapi_log_err(SLAPI_LOG_ARGS, "entry_apply_mod_wsi", "delete: %s\n", mod->mod_type); retVal = entry_delete_present_values_wsi( e, mod->mod_type, mod->mod_bvalues, csn, urp, mod->mod_op, NULL ); break; case LDAP_MOD_REPLACE: - LDAPDebug(LDAP_DEBUG_ARGS, " replace: %s\n", mod->mod_type, 0, 0 ); + slapi_log_err(SLAPI_LOG_ARGS, "entry_apply_mod_wsi", "replace: %s\n", mod->mod_type); retVal = entry_replace_present_values_wsi( e, mod->mod_type, mod->mod_bvalues, csn, urp ); break; } - if ( LDAPDebugLevelIsSet( LDAP_DEBUG_ARGS )) { + if ( loglevel_is_set( LDAP_DEBUG_ARGS )) { for ( i = 0; mod->mod_bvalues != NULL && mod->mod_bvalues[i] != NULL; i++ ) { - LDAPDebug(LDAP_DEBUG_ARGS, " %s: %s\n", - mod->mod_type, mod->mod_bvalues[i]->bv_val, 0 ); + slapi_log_err(SLAPI_LOG_ARGS, "entry_apply_mod_wsi", "%s: %s\n", + mod->mod_type, mod->mod_bvalues[i]->bv_val); } - LDAPDebug(LDAP_DEBUG_ARGS, " -\n", 0, 0, 0 ); + slapi_log_err(SLAPI_LOG_ARGS, "entry_apply_mod_wsi", "-\n"); } /* @@ -1012,7 +1013,7 @@ entry_apply_mods_wsi(Slapi_Entry *e, Slapi_Mods *smods, const CSN *csn, int urp) localcsn = *csn; /* make a copy */ } - LDAPDebug(LDAP_DEBUG_TRACE, "=> entry_apply_mods_wsi\n", 0, 0, 0 ); + slapi_log_err(SLAPI_LOG_TRACE, "entry_apply_mods_wsi", "==>\n"); mod = slapi_mods_get_first_mod(smods); while(NULL!=mod && retVal==LDAP_SUCCESS) @@ -1036,7 +1037,7 @@ entry_apply_mods_wsi(Slapi_Entry *e, Slapi_Mods *smods, const CSN *csn, int urp) mod = slapi_mods_get_next_mod(smods); } - LDAPDebug(LDAP_DEBUG_TRACE, "<= entry_apply_mods_wsi %d\n", retVal, 0, 0 ); + slapi_log_err(SLAPI_LOG_TRACE, "entry_apply_mods_wsi", "<== %d\n", retVal); return retVal; } diff --git a/ldap/servers/slapd/errormap.c b/ldap/servers/slapd/errormap.c index 47cceea..57545d8 100644 --- a/ldap/servers/slapd/errormap.c +++ b/ldap/servers/slapd/errormap.c @@ -153,14 +153,12 @@ SECU_Strerror(PRErrorCode errNum) { for (i = low + 1; i <= high; ++i) { num = errStrings[i].errNum; if (num <= lastNum) { - LDAPDebug(LDAP_DEBUG_ERR, - "SECU_Strerror - Sequence error in error strings at item %d\n" - "error %d (%s)\n", - i, lastNum, errStrings[i-1].errString ); - LDAPDebug(LDAP_DEBUG_ERR, - "SECU_Strerror - Should come after \n" - "error %d (%s)\n", - num, errStrings[i].errString, 0 ); + slapi_log_err(SLAPI_LOG_ERR, "SECU_Strerror", + "Sequence error in error strings at item %d - error %d (%s)\n", + lastNum, num, errStrings[i-1].errString ); + slapi_log_err(SLAPI_LOG_ERR, "SECU_Strerror", + "Should come after %d - error %d (%s)\n", + i, num, errStrings[i].errString); } lastNum = num; } diff --git a/ldap/servers/slapd/eventq.c b/ldap/servers/slapd/eventq.c index 5eb601a..4197d31 100644 --- a/ldap/servers/slapd/eventq.c +++ b/ldap/servers/slapd/eventq.c @@ -118,7 +118,7 @@ slapi_eq_once(slapi_eq_fn_t fn, void *arg, time_t when) /* been freed, depending on the thread */ /* scheduling. Too bad */ - slapi_log_error(SLAPI_LOG_HOUSE, NULL, + slapi_log_err(SLAPI_LOG_HOUSE, NULL, "added one-time event id %p at time %ld\n", id, when); return(id); @@ -150,7 +150,7 @@ slapi_eq_repeat(slapi_eq_fn_t fn, void *arg, time_t when, unsigned long interval if (!eq_stopped) { tmp = eq_new(fn, arg, when, interval); eq_enqueue(tmp); - slapi_log_error(SLAPI_LOG_HOUSE, NULL, + slapi_log_err(SLAPI_LOG_HOUSE, NULL, "added repeating event id %p at time %ld, interval %lu\n", tmp->ec_id, when, interval); return(tmp->ec_id); @@ -187,7 +187,7 @@ slapi_eq_cancel(Slapi_Eq_Context ctx) } PR_Unlock(eq->eq_lock); } - slapi_log_error(SLAPI_LOG_HOUSE, NULL, + slapi_log_err(SLAPI_LOG_HOUSE, NULL, "cancellation of event id %p requested: %s\n", ctx, found ? "cancellation succeeded" : "event not found"); return found; @@ -281,7 +281,7 @@ eq_call_all(void) while ((p = eq_dequeue(current_time())) != NULL) { /* Call the scheduled function */ p->ec_fn(p->ec_when, p->ec_arg); - slapi_log_error(SLAPI_LOG_HOUSE, NULL, + slapi_log_err(SLAPI_LOG_HOUSE, NULL, "Event id %p called at %ld (scheduled for %ld)\n", p->ec_id, current_time(), p->ec_when); if (0UL != p->ec_interval) { @@ -346,19 +346,19 @@ eq_create(void) { PR_ASSERT(NULL == eq->eq_lock); if ((eq->eq_lock = PR_NewLock()) == NULL) { - slapi_log_error(SLAPI_LOG_ERR, "eq_create", "PR_NewLock failed\n"); + slapi_log_err(SLAPI_LOG_ERR, "eq_create", "PR_NewLock failed\n"); exit(1); } if ((eq->eq_cv = PR_NewCondVar(eq->eq_lock)) == NULL) { - slapi_log_error(SLAPI_LOG_ERR, "eq_create", "PR_NewCondVar failed\n"); + slapi_log_err(SLAPI_LOG_ERR, "eq_create", "PR_NewCondVar failed\n"); exit(1); } if ((ss_lock = PR_NewLock()) == NULL) { - slapi_log_error(SLAPI_LOG_ERR, "eq_create", "PR_NewLock failed\n"); + slapi_log_err(SLAPI_LOG_ERR, "eq_create", "PR_NewLock failed\n"); exit(1); } if ((ss_cv = PR_NewCondVar(ss_lock)) == NULL) { - slapi_log_error(SLAPI_LOG_ERR, "eq_create", "PR_NewCondVar failed\n"); + slapi_log_err(SLAPI_LOG_ERR, "eq_create", "PR_NewCondVar failed\n"); exit(1); } eq->eq_queue = NULL; @@ -384,10 +384,10 @@ eq_start() if ((eq_loop_tid = PR_CreateThread(PR_USER_THREAD, (VFP)eq_loop, NULL, PR_PRIORITY_NORMAL, PR_GLOBAL_THREAD, PR_JOINABLE_THREAD, SLAPD_DEFAULT_THREAD_STACKSIZE)) == NULL) { - slapi_log_error(SLAPI_LOG_ERR, "eq_start", "eq_loop PR_CreateThread failed\n"); + slapi_log_err(SLAPI_LOG_ERR, "eq_start", "eq_loop PR_CreateThread failed\n"); exit(1); } - slapi_log_error(SLAPI_LOG_HOUSE, NULL, "event queue services have started\n"); + slapi_log_err(SLAPI_LOG_HOUSE, NULL, "event queue services have started\n"); } @@ -407,7 +407,7 @@ eq_init() { if (!eq_initialized) { if (PR_SUCCESS != PR_CallOnce(&init_once, eq_create)) { - slapi_log_error(SLAPI_LOG_ERR, "eq_init", "eq_create failed\n"); + slapi_log_err(SLAPI_LOG_ERR, "eq_init", "eq_create failed\n"); } } } @@ -463,7 +463,7 @@ eq_stop() p = q; } PR_Unlock(eq->eq_lock); - slapi_log_error(SLAPI_LOG_HOUSE, NULL, "event queue services have shut down\n"); + slapi_log_err(SLAPI_LOG_HOUSE, NULL, "event queue services have shut down\n"); } /* diff --git a/ldap/servers/slapd/extendop.c b/ldap/servers/slapd/extendop.c index 6544434..3aa4b39 100644 --- a/ldap/servers/slapd/extendop.c +++ b/ldap/servers/slapd/extendop.c @@ -32,8 +32,8 @@ static void extop_handle_import_start(Slapi_PBlock *pb, char *extoid, int ret; if (extval == NULL || extval->bv_val == NULL) { - LDAPDebug(LDAP_DEBUG_ERR, - "extop_handle_import_start - no data supplied\n", 0, 0, 0); + slapi_log_err(SLAPI_LOG_ERR, + "extop_handle_import_start", "no data supplied\n"); send_ldap_result(pb, LDAP_OPERATIONS_ERROR, NULL, "no data supplied", 0, NULL); return; @@ -46,7 +46,7 @@ static void extop_handle_import_start(Slapi_PBlock *pb, char *extoid, /* check that the dn is formatted correctly */ ret = slapi_dn_syntax_check(pb, orig, 1); if (ret) { /* syntax check failed */ - LDAPDebug1Arg(LDAP_DEBUG_ERR, + slapi_log_err(SLAPI_LOG_ERR, "extop_handle_import_start - strict: invalid suffix\n", orig); send_ldap_result(pb, LDAP_INVALID_DN_SYNTAX, NULL, @@ -56,8 +56,8 @@ static void extop_handle_import_start(Slapi_PBlock *pb, char *extoid, } sdn = slapi_sdn_new_dn_passin(orig); if (!sdn) { - LDAPDebug(LDAP_DEBUG_ERR, - "extop_handle_import_start - out of memory\n", 0, 0, 0); + slapi_log_err(SLAPI_LOG_ERR, + "extop_handle_import_start", "Out of memory\n"); send_ldap_result(pb, LDAP_OPERATIONS_ERROR, NULL, NULL, 0, NULL); return; } @@ -69,9 +69,9 @@ static void extop_handle_import_start(Slapi_PBlock *pb, char *extoid, be = slapi_be_select_by_instance_name(suffix); } if (be == NULL || be == defbackend_get_backend()) { - LDAPDebug(LDAP_DEBUG_ERR, - "extop_handle_import_start - invalid suffix or instance name '%s'\n", - suffix, 0, 0); + slapi_log_err(SLAPI_LOG_ERR, + "extop_handle_import_start", "invalid suffix or instance name '%s'\n", + suffix); send_ldap_result(pb, LDAP_NO_SUCH_OBJECT, NULL, "invalid suffix or instance name", 0, NULL); goto out; @@ -112,9 +112,8 @@ static void extop_handle_import_start(Slapi_PBlock *pb, char *extoid, if (be->be_wire_import == NULL) { /* not supported by this backend */ - LDAPDebug(LDAP_DEBUG_ERR, - "extop_handle_import_start - bulk import attempted on '%s' (not supported)\n", - suffix, 0, 0); + slapi_log_err(SLAPI_LOG_ERR, "extop_handle_import_start", + "bulk import attempted on '%s' (not supported)\n", suffix); send_ldap_result(pb, LDAP_NOT_SUPPORTED, NULL, NULL, 0, NULL); goto out; } @@ -125,9 +124,8 @@ static void extop_handle_import_start(Slapi_PBlock *pb, char *extoid, slapi_pblock_set(pb, SLAPI_BULK_IMPORT_STATE, &ret); ret = (*be->be_wire_import)(pb); if (ret != 0) { - LDAPDebug(LDAP_DEBUG_ERR, - "extop_handle_import_start - error starting import (%d)\n", - ret, 0, 0); + slapi_log_err(SLAPI_LOG_ERR, "extop_handle_import_start", + "error starting import (%d)\n", ret); send_ldap_result(pb, LDAP_OPERATIONS_ERROR, NULL, NULL, 0, NULL); goto out; } @@ -145,8 +143,8 @@ static void extop_handle_import_start(Slapi_PBlock *pb, char *extoid, bv.bv_len = 0; slapi_pblock_set(pb, SLAPI_EXT_OP_RET_VALUE, &bv); send_ldap_result(pb, LDAP_SUCCESS, NULL, NULL, 0, NULL); - LDAPDebug(LDAP_DEBUG_INFO, - "extop_handle_import_start - Bulk import begin import on '%s'.\n", suffix, 0, 0); + slapi_log_err(SLAPI_LOG_INFO, "extop_handle_import_start", + "Bulk import begin import on '%s'.\n", suffix); out: slapi_sdn_free(&sdn); @@ -168,9 +166,8 @@ static void extop_handle_import_done(Slapi_PBlock *pb, char *extoid, if ((be == NULL) || (be->be_wire_import == NULL)) { /* can this even happen? */ - LDAPDebug(LDAP_DEBUG_ERR, - "extop_handle_import_done - backend not supported\n", - 0, 0, 0); + slapi_log_err(SLAPI_LOG_ERR, "extop_handle_import_done", + "backend not supported\n"); send_ldap_result(pb, LDAP_NOT_SUPPORTED, NULL, NULL, 0, NULL); return; } @@ -182,9 +179,8 @@ static void extop_handle_import_done(Slapi_PBlock *pb, char *extoid, slapi_pblock_set(pb, SLAPI_BULK_IMPORT_STATE, &ret); ret = (*be->be_wire_import)(pb); if (ret != 0) { - LDAPDebug(LDAP_DEBUG_ERR, - "extop_handle_import_done - bulk import error ending import (%d)\n", - ret, 0, 0); + slapi_log_err(SLAPI_LOG_ERR, "extop_handle_import_done", + "bulk import error ending import (%d)\n", ret); send_ldap_result(pb, LDAP_OPERATIONS_ERROR, NULL, NULL, 0, NULL); return; } @@ -195,8 +191,8 @@ static void extop_handle_import_done(Slapi_PBlock *pb, char *extoid, bv.bv_len = 0; slapi_pblock_set(pb, SLAPI_EXT_OP_RET_VALUE, &bv); send_ldap_result(pb, LDAP_SUCCESS, NULL, NULL, 0, NULL); - LDAPDebug(LDAP_DEBUG_INFO, - "extop_handle_import_done - Bulk import completed successfully.\n", 0, 0, 0); + slapi_log_err(SLAPI_LOG_INFO, "extop_handle_import_done", + "Bulk import completed successfully.\n"); return; } @@ -212,7 +208,7 @@ do_extended( Slapi_PBlock *pb ) ber_tag_t tag; const char *name; - LDAPDebug(LDAP_DEBUG_TRACE, "do_extended\n", 0, 0, 0 ); + slapi_log_err(SLAPI_LOG_TRACE, "do_extended", "->\n"); /* * Parse the extended request. It looks like this: @@ -225,9 +221,8 @@ do_extended( Slapi_PBlock *pb ) if ( ber_scanf( pb->pb_op->o_ber, "{a", &extoid ) == LBER_ERROR ) { - LDAPDebug(LDAP_DEBUG_ERR, - "do_extended - ber_scanf failed (op=extended; params=OID)\n", - 0, 0, 0 ); + slapi_log_err(SLAPI_LOG_ERR, + "do_extended", "ber_scanf failed (op=extended; params=OID)\n"); op_shared_log_error_access (pb, "EXT", "???", "decoding error: fail to get extension OID"); send_ldap_result( pb, LDAP_PROTOCOL_ERROR, NULL, "decoding error", 0, NULL ); @@ -251,13 +246,13 @@ do_extended( Slapi_PBlock *pb ) } } if ( NULL == ( name = extended_op_oid2string( extoid ))) { - LDAPDebug(LDAP_DEBUG_ARGS, "do_extended - oid (%s)\n", extoid, 0, 0 ); + slapi_log_err(SLAPI_LOG_ARGS, "do_extended", "oid (%s)\n", extoid); slapi_log_access( LDAP_DEBUG_STATS, "conn=%" NSPRIu64 " op=%d EXT oid=\"%s\"\n", pb->pb_conn->c_connid, pb->pb_op->o_opid, extoid ); } else { - LDAPDebug(LDAP_DEBUG_ARGS, "do_extended - oid (%s-%s)\n", - extoid, name, 0 ); + slapi_log_err(SLAPI_LOG_ARGS, "do_extended", "oid (%s-%s)\n", + extoid, name); slapi_log_access( LDAP_DEBUG_STATS, "conn=%" NSPRIu64 " op=%d EXT oid=\"%s\" name=\"%s\"\n", @@ -336,14 +331,14 @@ do_extended( Slapi_PBlock *pb ) slapi_pblock_set( pb, SLAPI_REQUESTOR_ISROOT, &pb->pb_op->o_isroot); rc = plugin_determine_exop_plugins( extoid, &p ); - slapi_log_error(SLAPI_LOG_TRACE, "do_extended", "Plugin_determine_exop_plugins rc %d\n", rc); + slapi_log_err(SLAPI_LOG_TRACE, "do_extended", "Plugin_determine_exop_plugins rc %d\n", rc); if (plugin_call_plugins(pb, SLAPI_PLUGIN_PRE_EXTOP_FN) != SLAPI_PLUGIN_SUCCESS) { goto free_and_return; } if (rc == SLAPI_PLUGIN_EXTENDEDOP && p != NULL) { - slapi_log_error(SLAPI_LOG_TRACE, "do_extended", "Calling plugin ... \n"); + slapi_log_err(SLAPI_LOG_TRACE, "do_extended", "Calling plugin ... \n"); /* * Return values: * SLAPI_PLUGIN_EXTENDED_SENT_RESULT: The result is already sent to the client. @@ -353,16 +348,16 @@ do_extended( Slapi_PBlock *pb ) */ rc = plugin_call_exop_plugins( pb, p); - slapi_log_error(SLAPI_LOG_TRACE, "do_extended", "Called exop, got %d \n", rc); + slapi_log_err(SLAPI_LOG_TRACE, "do_extended", "Called exop, got %d \n", rc); } else if (rc == SLAPI_PLUGIN_BETXNEXTENDEDOP && p != NULL) { - slapi_log_error(SLAPI_LOG_TRACE, "do_extended", "Calling betxn plugin ... \n"); + slapi_log_err(SLAPI_LOG_TRACE, "do_extended", "Calling betxn plugin ... \n"); /* Look up the correct backend to use. */ Slapi_Backend *be = plugin_extended_op_getbackend( pb, p ); if ( be == NULL ) { - slapi_log_error(SLAPI_LOG_ERR, "do_extended", "Plugin_extended_op_getbackend was unable to retrieve a backend!\n"); + slapi_log_err(SLAPI_LOG_ERR, "do_extended", "Plugin_extended_op_getbackend was unable to retrieve a backend!\n"); rc = LDAP_OPERATIONS_ERROR; } else { /* We need to make a new be pb here because when you set SLAPI_BACKEND @@ -375,7 +370,7 @@ do_extended( Slapi_PBlock *pb ) int txn_rc = slapi_back_transaction_begin(be_pb); if (txn_rc) { - slapi_log_error(SLAPI_LOG_ERR, "do_extended", "Failed to start be_txn for plugin_call_exop_plugins %d\n", txn_rc); + slapi_log_err(SLAPI_LOG_ERR, "do_extended", "Failed to start be_txn for plugin_call_exop_plugins %d\n", txn_rc); } else { /* * Return values: @@ -385,19 +380,19 @@ do_extended( Slapi_PBlock *pb ) * LDAP codes (e.g., LDAP_SUCCESS): The result is not sent yet. Call send_ldap_result. */ rc = plugin_call_exop_plugins( pb, p ); - slapi_log_error(SLAPI_LOG_TRACE, "do_extended", "Called betxn exop, got %d \n", rc); + slapi_log_err(SLAPI_LOG_TRACE, "do_extended", "Called betxn exop, got %d \n", rc); if (rc == LDAP_SUCCESS || rc == SLAPI_PLUGIN_EXTENDED_SENT_RESULT) { /* commit */ txn_rc = slapi_back_transaction_commit(be_pb); if (txn_rc == 0) { - slapi_log_error(SLAPI_LOG_TRACE, "do_extended", "Commit with result %d \n", txn_rc); + slapi_log_err(SLAPI_LOG_TRACE, "do_extended", "Commit with result %d \n", txn_rc); } else { - slapi_log_error(SLAPI_LOG_ERR, "do_extended", "Unable to commit commit with result %d \n", txn_rc); + slapi_log_err(SLAPI_LOG_ERR, "do_extended", "Unable to commit commit with result %d \n", txn_rc); } } else { /* abort */ txn_rc = slapi_back_transaction_abort(be_pb); - slapi_log_error(SLAPI_LOG_ERR, "do_extended", "Abort with result %d \n", txn_rc); + slapi_log_err(SLAPI_LOG_ERR, "do_extended", "Abort with result %d \n", txn_rc); } } /* txn_rc */ slapi_pblock_destroy(be_pb); /* Clean up after ourselves */ @@ -414,7 +409,7 @@ do_extended( Slapi_PBlock *pb ) errmsg = "unsupported extended operation"; } else { if (rc != LDAP_SUCCESS) { - slapi_log_error(SLAPI_LOG_ERR, "do_extended", "Failed with result %d \n", rc); + slapi_log_err(SLAPI_LOG_ERR, "do_extended", "Failed with result %d \n", rc); } errmsg = NULL; lderr = rc; diff --git a/ldap/servers/slapd/factory.c b/ldap/servers/slapd/factory.c index b55562e..6c6a7dd 100644 --- a/ldap/servers/slapd/factory.c +++ b/ldap/servers/slapd/factory.c @@ -170,10 +170,12 @@ factory_type_add_extension(struct factory_type *ft, struct factory_extension *fe } else { - LDAPDebug(LDAP_DEBUG_ERR, "factory_type_add_extension - Registration of %s extension by %s failed.\n", - ft->name, fe->pluginname, 0); - LDAPDebug(LDAP_DEBUG_ERR, "factory_type_add_extension - %d extensions already registered. Max is %d\n", - ft->extension_count, MAX_EXTENSIONS, 0); + slapi_log_err(SLAPI_LOG_ERR, "factory_type_add_extension", + "Registration of %s extension by %s failed.\n", + ft->name, fe->pluginname); + slapi_log_err(SLAPI_LOG_ERR, "factory_type_add_extension", + "%d extensions already registered. Max is %d\n", + ft->extension_count, MAX_EXTENSIONS); } PR_Unlock(ft->extension_lock); @@ -193,8 +195,9 @@ factory_type_decrement_existence(struct factory_type *ft) if(ft->existence_count<0) { /* This just shouldn't happen */ - LDAPDebug(LDAP_DEBUG_ERR, "factory_type_decrement_existence - %lu %s object extensions in existence.\n", - ft->extension_count, ft->name, 0); + slapi_log_err(SLAPI_LOG_ERR, "factory_type_decrement_existence", + "%d %s object extensions in existence.\n", + ft->extension_count, ft->name); } } @@ -275,8 +278,10 @@ factory_register_type(const char *name, size_t offset) } else { - LDAPDebug(LDAP_DEBUG_ERR, "factory_register_type - Registration of %s object failed.\n", name, 0, 0); - LDAPDebug(LDAP_DEBUG_ERR, "factory_register_type - %d objects already registered. Max is %d\n", number_of_types, MAX_TYPES, 0); + slapi_log_err(SLAPI_LOG_ERR, "factory_register_type", + "Registration of %s object failed.\n", name); + slapi_log_err(SLAPI_LOG_ERR, "factory_register_type", + "%d objects already registered. Max is %d\n", number_of_types, MAX_TYPES); type= -1; } PR_Unlock(factory_type_store_lock); @@ -324,7 +329,8 @@ factory_create_extension(int type,void *object,void *parent) else { /* The type wasn't registered. Programming error? */ - LDAPDebug(LDAP_DEBUG_ERR, "factory_create_extension - Object type handle %d not valid. Object not registered?\n", type, 0, 0); + slapi_log_err(SLAPI_LOG_ERR, "factory_create_extension", + "Object type handle %d not valid. Object not registered?\n", type); } return (void*)extension; } @@ -365,7 +371,8 @@ factory_destroy_extension(int type,void *object,void *parent,void **extension) else { /* The type wasn't registered. Programming error? */ - LDAPDebug(LDAP_DEBUG_ERR, "factory_destroy_extension - Object type handle %d not valid. Object not registered?\n", type, 0, 0); + slapi_log_err(SLAPI_LOG_ERR, "factory_destroy_extension", + "Object type handle %d not valid. Object not registered?\n", type); } slapi_ch_free(extension); } @@ -430,7 +437,8 @@ slapi_register_object_extension( } else { - LDAPDebug(LDAP_DEBUG_ERR, "slapi_register_object_extension - Plugin %s failed to register extension for object %s.\n", pluginname, objectname, 0); + slapi_log_err(SLAPI_LOG_ERR, "slapi_register_object_extension", + "Plugin %s failed to register extension for object %s.\n", pluginname, objectname); rc= -1; delete_factory_extension(&fe); } diff --git a/ldap/servers/slapd/features.c b/ldap/servers/slapd/features.c index d2fa69a..818f0b2 100644 --- a/ldap/servers/slapd/features.c +++ b/ldap/servers/slapd/features.c @@ -25,7 +25,7 @@ init_features( void ) { supported_features_lock = slapi_new_rwlock(); if (supported_features_lock == NULL) { - slapi_log_error(SLAPI_LOG_ERR, "startup", + slapi_log_err(SLAPI_LOG_ERR, "startup", "init_features - failed to create lock.\n"); exit(1); } diff --git a/ldap/servers/slapd/fedse.c b/ldap/servers/slapd/fedse.c index 9c8869e..3d50855 100644 --- a/ldap/servers/slapd/fedse.c +++ b/ldap/servers/slapd/fedse.c @@ -1580,7 +1580,7 @@ init_dse_file(const char *configdir, Slapi_DN *config) slapi_pblock_set(&pb, SLAPI_DSE_DONT_WRITE_WHEN_ADDING, (void*)&dont_write); if(!(rc = dse_read_file(pfedse, &pb))) { - slapi_log_error(SLAPI_LOG_ERR, "init_dse_file", + slapi_log_err(SLAPI_LOG_ERR, "init_dse_file", "Could not load config file [%s]\n", DSE_FILENAME ); } @@ -1864,7 +1864,7 @@ setup_internal_backends(char *configdir) slapi_sdn_done(&saslmapping); slapi_sdn_done(&plugins); } else { - slapi_log_error(SLAPI_LOG_ERR, "setup_internal_backends", + slapi_log_err(SLAPI_LOG_ERR, "setup_internal_backends", "Please edit the file to correct the reported problems" " and then restart the server.\n" ); exit( 1 ); @@ -1914,7 +1914,7 @@ int fedse_create_startOK(char *filename, char *startokfilename, const char *con rc = slapi_copy(dse_filename, dse_filestartOK); if ( rc != 0 ) { - slapi_log_error(SLAPI_LOG_ERR, "fedse_create_startOK", "Cannot copy" + slapi_log_err(SLAPI_LOG_ERR, "fedse_create_startOK", "Cannot copy" " DSE file \"%s\" to \"%s\" OS error %d (%s)\n", dse_filename, dse_filestartOK, rc, slapd_system_strerror(rc) ); diff --git a/ldap/servers/slapd/filter.c b/ldap/servers/slapd/filter.c index 5e05472..085a8d9 100644 --- a/ldap/servers/slapd/filter.c +++ b/ldap/servers/slapd/filter.c @@ -73,19 +73,19 @@ get_filter( Connection *conn, BerElement *ber, int scope, (*filt)->f_flags |= SLAPI_FILTER_RUV; } - if (LDAPDebugLevelIsSet( LDAP_DEBUG_FILTER ) && *filt != NULL + if (loglevel_is_set( LDAP_DEBUG_FILTER ) && *filt != NULL && *fstr != NULL) { logbufsize = strlen(*fstr) + 1; logbuf = slapi_ch_malloc(logbufsize); *logbuf = '\0'; - slapi_log_error(SLAPI_LOG_DEBUG, "get_filter", "before optimize: %s\n", + slapi_log_err(SLAPI_LOG_DEBUG, "get_filter", "before optimize: %s\n", slapi_filter_to_string(*filt, logbuf, logbufsize)); } filter_optimize(*filt); if (NULL != logbuf) { - slapi_log_error(SLAPI_LOG_DEBUG, "get_filter", " after optimize: %s\n", + slapi_log_err(SLAPI_LOG_DEBUG, "get_filter", " after optimize: %s\n", slapi_filter_to_string(*filt, logbuf, logbufsize)); slapi_ch_free_string( &logbuf ); } @@ -153,7 +153,7 @@ get_filter_internal( Connection *conn, BerElement *ber, struct slapi_filter *f; char *ftmp, *type = NULL; - LDAPDebug(LDAP_DEBUG_FILTER, "=> get_filter_internal\n", 0, 0, 0 ); + slapi_log_err(SLAPI_LOG_FILTER, "get_filter_internal", "==>\n"); /* * Track and check the depth of nesting. Use post-increment on @@ -164,9 +164,9 @@ get_filter_internal( Connection *conn, BerElement *ber, *filt = NULL; *fstr = NULL; err = LDAP_UNWILLING_TO_PERFORM; - LDAPDebug(LDAP_DEBUG_FILTER, "<= get_filter_internal %d" - " (maximum nesting level of %d exceeded)\n", - err, maxdepth, 0 ); + slapi_log_err(SLAPI_LOG_FILTER, "get_filter_internal", + "<== %d (maximum nesting level of %d exceeded)\n", + err, maxdepth); return( err ); } @@ -211,7 +211,7 @@ get_filter_internal( Connection *conn, BerElement *ber, f->f_choice = ber_peek_tag( ber, &len ); switch ( f->f_choice ) { case LDAP_FILTER_EQUALITY: - LDAPDebug(LDAP_DEBUG_FILTER, "EQUALITY\n", 0, 0, 0 ); + slapi_log_err(SLAPI_LOG_FILTER, "get_filter_internal", "EQUALITY\n"); if ( (err = get_ava( ber, &f->f_ava )) == 0 ) { if ( 0 == strcasecmp ( f->f_avtype, "objectclass")) { @@ -260,26 +260,26 @@ get_filter_internal( Connection *conn, BerElement *ber, break; case LDAP_FILTER_SUBSTRINGS: - LDAPDebug(LDAP_DEBUG_FILTER, "SUBSTRINGS\n", 0, 0, 0 ); + slapi_log_err(SLAPI_LOG_FILTER, "get_filter_internal", "SUBSTRINGS\n"); err = get_substring_filter( conn, ber, f, fstr ); break; case LDAP_FILTER_GE: - LDAPDebug(LDAP_DEBUG_FILTER, "GE\n", 0, 0, 0 ); + slapi_log_err(SLAPI_LOG_FILTER, "get_filter_internal", "GE\n"); if ( (err = get_ava( ber, &f->f_ava )) == 0 ) { *fstr=filter_escape_filter_value(f, FILTER_GE_FMT, FILTER_GE_LEN); } break; case LDAP_FILTER_LE: - LDAPDebug(LDAP_DEBUG_FILTER, "LE\n", 0, 0, 0 ); + slapi_log_err(SLAPI_LOG_FILTER, "get_filter_internal", "LE\n"); if ( (err = get_ava( ber, &f->f_ava )) == 0 ) { *fstr=filter_escape_filter_value(f, FILTER_LE_FMT, FILTER_LE_LEN); } break; case LDAP_FILTER_PRESENT: - LDAPDebug(LDAP_DEBUG_FILTER, "PRESENT\n", 0, 0, 0 ); + slapi_log_err(SLAPI_LOG_FILTER, "get_filter_internal", "PRESENT\n"); if ( ber_scanf( ber, "a", &type ) == LBER_ERROR ) { slapi_ch_free_string(&type); err = LDAP_PROTOCOL_ERROR; @@ -293,22 +293,21 @@ get_filter_internal( Connection *conn, BerElement *ber, break; case LDAP_FILTER_APPROX: - LDAPDebug(LDAP_DEBUG_FILTER, "APPROX\n", 0, 0, 0 ); + slapi_log_err(SLAPI_LOG_FILTER, "get_filter_internal", "APPROX\n"); if ( (err = get_ava( ber, &f->f_ava )) == 0 ) { *fstr=filter_escape_filter_value(f, FILTER_APROX_FMT, FILTER_APROX_LEN); } break; case LDAP_FILTER_EXTENDED: - LDAPDebug(LDAP_DEBUG_FILTER, "EXTENDED\n", 0, 0, 0 ); + slapi_log_err(SLAPI_LOG_FILTER, "get_filter_internal", "EXTENDED\n"); if ( conn->c_ldapversion < 3 ) { - LDAPDebug(LDAP_DEBUG_ERR, - "get_filter_internal - Extensible filter received from v2 client\n", - 0, 0, 0 ); + slapi_log_err(SLAPI_LOG_ERR, "get_filter_internal", + "Extensible filter received from v2 client\n"); err = LDAP_PROTOCOL_ERROR; } else if ( (err = get_extensible_filter( ber, &f->f_mr )) == LDAP_SUCCESS ) { *fstr=filter_escape_filter_value_extended(f); - LDAPDebug(LDAP_DEBUG_FILTER, "%s\n", *fstr, 0, 0); + slapi_log_err(SLAPI_LOG_FILTER, "get_filter_internal", "%s\n", *fstr); if(f->f_mr_oid==NULL) { /* * We accept: @@ -323,7 +322,7 @@ get_filter_internal( Connection *conn, BerElement *ber, break; case LDAP_FILTER_AND: - LDAPDebug(LDAP_DEBUG_FILTER, "AND\n", 0, 0, 0 ); + slapi_log_err(SLAPI_LOG_FILTER, "get_filter_internal", "AND\n"); if ( (err = get_filter_list( conn, ber, &f->f_and, &ftmp, maxdepth, curdepth, subentry_dont_rewrite, has_tombstone_filter, has_ruv_filter )) @@ -335,7 +334,7 @@ get_filter_internal( Connection *conn, BerElement *ber, break; case LDAP_FILTER_OR: - LDAPDebug(LDAP_DEBUG_FILTER, "OR\n", 0, 0, 0 ); + slapi_log_err(SLAPI_LOG_FILTER, "get_filter_internal", "OR\n"); if ( (err = get_filter_list( conn, ber, &f->f_or, &ftmp, maxdepth, curdepth, subentry_dont_rewrite, has_tombstone_filter, has_ruv_filter )) @@ -347,7 +346,7 @@ get_filter_internal( Connection *conn, BerElement *ber, break; case LDAP_FILTER_NOT: - LDAPDebug(LDAP_DEBUG_FILTER, "NOT\n", 0, 0, 0 ); + slapi_log_err(SLAPI_LOG_FILTER, "get_filter_internal", "NOT\n"); (void) ber_skip_tag( ber, &len ); if ( (err = get_filter_internal( conn, ber, &f->f_not, &ftmp, maxdepth, curdepth, subentry_dont_rewrite, @@ -360,8 +359,8 @@ get_filter_internal( Connection *conn, BerElement *ber, break; default: - LDAPDebug(LDAP_DEBUG_ERR, "get_filter_internal - Unknown type 0x%lX\n", - f->f_choice, 0, 0 ); + slapi_log_err(SLAPI_LOG_ERR, "get_filter_internal", + "Unknown type 0x%lX\n", f->f_choice); err = LDAP_PROTOCOL_ERROR; break; } @@ -372,7 +371,7 @@ get_filter_internal( Connection *conn, BerElement *ber, slapi_ch_free( (void**)fstr ); } *filt = f; - LDAPDebug(LDAP_DEBUG_FILTER, "<= get_filter_internal %d\n", err, 0, 0 ); + slapi_log_err(SLAPI_LOG_FILTER, "get_filter_internal", "<= %d\n", err); return( err ); } @@ -388,7 +387,7 @@ get_filter_list( Connection *conn, BerElement *ber, ber_len_t len = LBER_ERROR; char *last; - LDAPDebug(LDAP_DEBUG_FILTER, "=> get_filter_list\n", 0, 0, 0 ); + slapi_log_err(SLAPI_LOG_FILTER, "get_filter_list", "=>\n" ); *fstr = NULL; new = f; @@ -423,11 +422,11 @@ get_filter_list( Connection *conn, BerElement *ber, len if it has reached the end, and -1 is not a valid value for a real len */ if ( (tag != LBER_END_OF_SEQORSET) && (len != -1) && (*fstr != NULL) ) { - LDAPDebug(LDAP_DEBUG_ERR, "get_filter_list - Error parsing filter list\n", 0, 0, 0 ); + slapi_log_err(SLAPI_LOG_ERR, "get_filter_list", "Error parsing filter list\n"); slapi_ch_free((void**)fstr ); } - LDAPDebug(LDAP_DEBUG_FILTER, "<= get_filter_list\n", 0, 0, 0 ); + slapi_log_err(SLAPI_LOG_FILTER, "get_filter_list", "<=\n"); return(( *fstr == NULL ) ? LDAP_PROTOCOL_ERROR : 0 ); } @@ -444,7 +443,7 @@ get_substring_filter( char *val, *eval, *last, *type = NULL; size_t fstr_len; - LDAPDebug(LDAP_DEBUG_FILTER, "=> get_substring_filter\n", 0, 0, 0 ); + slapi_log_err(SLAPI_LOG_FILTER, "get_substring_filter", "=>\n"); if ( ber_scanf( ber, "{a", &type ) == LBER_ERROR ) { slapi_ch_free_string(&type); @@ -480,7 +479,7 @@ get_substring_filter( switch ( tag ) { case LDAP_SUBSTRING_INITIAL: - LDAPDebug(LDAP_DEBUG_FILTER, " INITIAL\n", 0, 0, 0 ); + slapi_log_err(SLAPI_LOG_FILTER, "get_substring_filter", "INITIAL\n"); if ( f->f_sub_initial != NULL ) { return( LDAP_PROTOCOL_ERROR ); } @@ -497,7 +496,7 @@ get_substring_filter( break; case LDAP_SUBSTRING_ANY: - LDAPDebug(LDAP_DEBUG_FILTER, " ANY\n", 0, 0, 0 ); + slapi_log_err(SLAPI_LOG_FILTER, "get_substring_filter", "ANY\n"); charray_add(&f->f_sub_any, val); eval = (char*)slapi_escape_filter_value(val, -1); if(eval){ @@ -512,7 +511,7 @@ get_substring_filter( break; case LDAP_SUBSTRING_FINAL: - LDAPDebug(LDAP_DEBUG_FILTER, " FINAL\n", 0, 0, 0 ); + slapi_log_err(SLAPI_LOG_FILTER, "get_substring_filter", "FINAL\n"); if ( f->f_sub_final != NULL ) { return( LDAP_PROTOCOL_ERROR ); } @@ -530,13 +529,13 @@ get_substring_filter( break; default: - LDAPDebug(LDAP_DEBUG_FILTER, " unknown tag 0x%lX\n", tag, 0, 0 ); + slapi_log_err(SLAPI_LOG_FILTER, "get_substring_filter", "Unknown tag 0x%lX\n", tag); return( LDAP_PROTOCOL_ERROR ); } } if ( (tag != LBER_END_OF_SEQORSET) && (len != -1) ) { - LDAPDebug(LDAP_DEBUG_ERR, "get_substring_filter - Error reading substring filter\n", 0, 0, 0 ); + slapi_log_err(SLAPI_LOG_ERR, "get_substring_filter", "Error reading substring filter\n"); return( LDAP_PROTOCOL_ERROR ); } if ( f->f_sub_initial == NULL && f->f_sub_any == NULL && @@ -554,7 +553,7 @@ get_substring_filter( } strcat( *fstr, ")" ); - LDAPDebug(LDAP_DEBUG_FILTER, "<= get_substring_filter\n", 0, 0, 0 ); + slapi_log_err(SLAPI_LOG_FILTER, "get_substring_filter", "<=\n"); return( 0 ); } @@ -567,7 +566,7 @@ get_extensible_filter( BerElement *ber, mr_filter_t* mrf ) char *last; int rc = LDAP_SUCCESS; - LDAPDebug(LDAP_DEBUG_FILTER, "=> get_extensible_filter\n", 0, 0, 0 ); + slapi_log_err(SLAPI_LOG_FILTER, "get_extensible_filter", "=>\n"); memset (mrf, 0, sizeof (mr_filter_t)); gotelem = gotoid = gotvalue = 0; @@ -642,12 +641,11 @@ get_extensible_filter( BerElement *ber, mr_filter_t* mrf ) goto parsing_error; } - LDAPDebug(LDAP_DEBUG_FILTER, "<= get_extensible_filter %i\n", rc, 0, 0 ); + slapi_log_err(SLAPI_LOG_FILTER, "get_extensible_filter", "<= %i\n", rc); return rc; parsing_error:; - LDAPDebug(LDAP_DEBUG_ERR, "get_extensible_filter - Error parsing extensible filter\n", - 0, 0, 0 ); + slapi_log_err(SLAPI_LOG_ERR, "get_extensible_filter", "Error parsing extensible filter\n"); return( LDAP_PROTOCOL_ERROR ); } @@ -666,8 +664,7 @@ slapi_filter_dup(Slapi_Filter *f) out = (struct slapi_filter*)slapi_ch_calloc(1, sizeof(struct slapi_filter)); if ( out == NULL ) { - LDAPDebug(LDAP_DEBUG_ERR, "slapi_filter_dup - Memory allocation error\n", - 0, 0, 0 ); + slapi_log_err(SLAPI_LOG_ERR, "slapi_filter_dup", "Memory allocation error\n"); return NULL; } @@ -675,7 +672,7 @@ slapi_filter_dup(Slapi_Filter *f) out->f_hash = f->f_hash; out->f_flags = f->f_flags; - LDAPDebug(LDAP_DEBUG_FILTER, "slapi_filter_dup type 0x%lX\n", f->f_choice, 0, 0 ); + slapi_log_err(SLAPI_LOG_FILTER, "slapi_filter_dup", "type 0x%lX\n", f->f_choice); switch ( f->f_choice ) { case LDAP_FILTER_EQUALITY: case LDAP_FILTER_GE: @@ -718,13 +715,12 @@ slapi_filter_dup(Slapi_Filter *f) out->f_mr_dnAttrs = f->f_mr_dnAttrs; if (f->f_mr.mrf_match) { int rc = plugin_mr_filter_create(&out->f_mr); - LDAPDebug1Arg(LDAP_DEBUG_FILTER, "slapi_filter_dup plugin_mr_filter_create returned %d\n", rc ); + slapi_log_err(SLAPI_LOG_FILTER, "slapi_filter_dup", "plugin_mr_filter_create returned %d\n", rc ); } break; default: - LDAPDebug(LDAP_DEBUG_FILTER, "slapi_filter_dup: unknown type 0x%lX\n", - f->f_choice, 0, 0 ); + slapi_log_err(SLAPI_LOG_FILTER, "slapi_filter_dup", "Unknown type 0x%lX\n", f->f_choice); break; } @@ -738,7 +734,7 @@ slapi_filter_free( struct slapi_filter *f, int recurse ) return; } - LDAPDebug(LDAP_DEBUG_FILTER, "slapi_filter_free type 0x%lX\n", f->f_choice, 0, 0 ); + slapi_log_err(SLAPI_LOG_FILTER, "slapi_filter_free", "type 0x%lX\n", f->f_choice); switch ( f->f_choice ) { case LDAP_FILTER_EQUALITY: case LDAP_FILTER_GE: @@ -787,8 +783,8 @@ slapi_filter_free( struct slapi_filter *f, int recurse ) break; default: - LDAPDebug(LDAP_DEBUG_ERR, "slapi_filter_free - Unknown type 0x%lX\n", - f->f_choice, 0, 0 ); + slapi_log_err(SLAPI_LOG_ERR, "slapi_filter_free", "nknown type 0x%lX\n", + f->f_choice); break; } slapi_ch_free((void**)&f); diff --git a/ldap/servers/slapd/filtercmp.c b/ldap/servers/slapd/filtercmp.c index a749ed3..fec31f2 100644 --- a/ldap/servers/slapd/filtercmp.c +++ b/ldap/servers/slapd/filtercmp.c @@ -195,7 +195,7 @@ void filter_compute_hash(struct slapi_filter *f) /* get the normalized value (according to the matching rule) */ pb = get_mr_normval(f->f_mr_oid, f->f_mr_type, inval, &outval); if (!pb) { - LDAPDebug(LDAP_DEBUG_ERR, "filter_compute_hash - Out of memory !\n", 0, 0, 0); + slapi_log_err(SLAPI_LOG_ERR, "filter_compute_hash", "Out of memory!\n"); return; } if (outval && outval[0]) { @@ -207,8 +207,8 @@ void filter_compute_hash(struct slapi_filter *f) STIR(h); break; default: - LDAPDebug(LDAP_DEBUG_ERR, "filter_compute_hash - Can't handle filter type %d !\n", - f->f_choice, 0, 0); + slapi_log_err(SLAPI_LOG_ERR, "filter_compute_hash", "Can't handle filter type %lX !\n", + f->f_choice); } f->f_hash = h; @@ -328,7 +328,7 @@ int slapi_filter_compare(struct slapi_filter *f1, struct slapi_filter *f2) int ret; Slapi_Attr sattr; - LDAPDebug(LDAP_DEBUG_TRACE, "=> slapi_filter_compare\n", 0, 0, 0); + slapi_log_err(SLAPI_LOG_TRACE, "slapi_filter_compare", "=>\n"); /* allow for the possibility that one of the filters hasn't had a hash * computed (and is therefore 0). this means that a filter node whose @@ -410,12 +410,11 @@ int slapi_filter_compare(struct slapi_filter *f1, struct slapi_filter *f2) done_mr_normval(pb2); break; default: - LDAPDebug(LDAP_DEBUG_ERR, "slapi_filter_compare - Can't handle filter %d\n", f1->f_choice, - 0, 0); + slapi_log_err(SLAPI_LOG_ERR, "slapi_filter_compare", "Can't handle filter %lX\n", f1->f_choice); ret = 1; } done: - LDAPDebug(LDAP_DEBUG_TRACE, "<= slapi_filter_compare: %d\n", ret, 0, 0); + slapi_log_err(SLAPI_LOG_TRACE, "slapi_filter_compare" , "<= %d\n", ret); return ret; } diff --git a/ldap/servers/slapd/filterentry.c b/ldap/servers/slapd/filterentry.c index 922c75b..ec9eee4 100644 --- a/ldap/servers/slapd/filterentry.c +++ b/ldap/servers/slapd/filterentry.c @@ -115,7 +115,7 @@ slapi_filter_test_ext_internal( { int rc; - LDAPDebug(LDAP_DEBUG_FILTER, "=> slapi_filter_test_ext_internal\n", 0, 0, 0 ); + slapi_log_err(SLAPI_LOG_FILTER, "slapi_filter_test_ext_internal", "=>\n"); /* * RJP: Not sure if this is semantically right, but we have to @@ -128,58 +128,58 @@ slapi_filter_test_ext_internal( switch ( f->f_choice ) { case LDAP_FILTER_EQUALITY: - LDAPDebug(LDAP_DEBUG_FILTER, " EQUALITY\n", 0, 0, 0 ); + slapi_log_err(SLAPI_LOG_FILTER, "slapi_filter_test_ext_internal", "EQUALITY\n"); rc = test_ava_filter( pb, e, e->e_attrs, &f->f_ava, LDAP_FILTER_EQUALITY, verify_access , only_check_access, access_check_done); break; case LDAP_FILTER_SUBSTRINGS: - LDAPDebug(LDAP_DEBUG_FILTER, " SUBSTRINGS\n", 0, 0, 0 ); + slapi_log_err(SLAPI_LOG_FILTER, "slapi_filter_test_ext_internal", "SUBSTRINGS\n"); rc = test_substring_filter( pb, e, f, verify_access , only_check_access, access_check_done); break; case LDAP_FILTER_GE: - LDAPDebug(LDAP_DEBUG_FILTER, " GE\n", 0, 0, 0 ); + slapi_log_err(SLAPI_LOG_FILTER, "slapi_filter_test_ext_internal", "GE\n"); rc = test_ava_filter( pb, e, e->e_attrs, &f->f_ava, LDAP_FILTER_GE, verify_access , only_check_access, access_check_done); break; case LDAP_FILTER_LE: - LDAPDebug(LDAP_DEBUG_FILTER, " LE\n", 0, 0, 0 ); + slapi_log_err(SLAPI_LOG_FILTER, "slapi_filter_test_ext_internal", "LE\n"); rc = test_ava_filter( pb, e, e->e_attrs, &f->f_ava, LDAP_FILTER_LE, verify_access , only_check_access, access_check_done); break; case LDAP_FILTER_PRESENT: - LDAPDebug(LDAP_DEBUG_FILTER, " PRESENT\n", 0, 0, 0 ); + slapi_log_err(SLAPI_LOG_FILTER, "slapi_filter_test_ext_internal", "PRESENT\n"); rc = test_presence_filter( pb, e, f->f_type, verify_access , only_check_access, access_check_done); break; case LDAP_FILTER_APPROX: - LDAPDebug(LDAP_DEBUG_FILTER, " APPROX\n", 0, 0, 0 ); + slapi_log_err(SLAPI_LOG_FILTER, "slapi_filter_test_ext_internal", "APPROX\n"); rc = test_ava_filter( pb, e, e->e_attrs, &f->f_ava, LDAP_FILTER_APPROX, verify_access , only_check_access, access_check_done); break; case LDAP_FILTER_EXTENDED: - LDAPDebug(LDAP_DEBUG_FILTER, " EXTENDED\n", 0, 0, 0 ); + slapi_log_err(SLAPI_LOG_FILTER, "slapi_filter_test_ext_internal", "EXTENDED\n"); rc = test_extensible_filter( pb, e, &f->f_mr, verify_access , only_check_access, access_check_done); break; case LDAP_FILTER_AND: - LDAPDebug(LDAP_DEBUG_FILTER, " AND\n", 0, 0, 0 ); + slapi_log_err(SLAPI_LOG_FILTER, "slapi_filter_test_ext_internal", "AND\n"); rc = test_filter_list( pb, e, f->f_and, LDAP_FILTER_AND , verify_access, only_check_access, access_check_done); break; case LDAP_FILTER_OR: - LDAPDebug(LDAP_DEBUG_FILTER, " OR\n", 0, 0, 0 ); + slapi_log_err(SLAPI_LOG_FILTER, "slapi_filter_test_ext_internal", "OR\n"); rc = test_filter_list( pb, e, f->f_or, LDAP_FILTER_OR , verify_access, only_check_access, access_check_done); break; case LDAP_FILTER_NOT: - LDAPDebug(LDAP_DEBUG_FILTER, " NOT\n", 0, 0, 0 ); + slapi_log_err(SLAPI_LOG_FILTER, "slapi_filter_test_ext_internal", "NOT\n"); rc = slapi_filter_test_ext_internal( pb, e, f->f_not , verify_access, only_check_access, access_check_done); if(!(verify_access && only_check_access)) /* dont play with access control return codes */ { @@ -202,12 +202,12 @@ slapi_filter_test_ext_internal( break; default: - LDAPDebug(LDAP_DEBUG_ERR, "slapi_filter_test_ext_internal - unknown filter type 0x%lX\n", - f->f_choice, 0, 0 ); + slapi_log_err(SLAPI_LOG_ERR, "slapi_filter_test_ext_internal", "Unknown filter type 0x%lX\n", + f->f_choice); rc = -1; } - LDAPDebug(LDAP_DEBUG_FILTER, "<= slapi_filter_test_ext_internal %d\n", rc, 0, 0 ); + slapi_log_err(SLAPI_LOG_FILTER, "slapi_filter_test_ext_internal", "<= %d\n", rc); return( rc ); } @@ -275,7 +275,7 @@ int test_ava_filter( { int rc; - LDAPDebug(LDAP_DEBUG_FILTER, "=> test_ava_filter\n", 0, 0, 0 ); + slapi_log_err(SLAPI_LOG_FILTER, "test_ava_filter", "=>\n"); *access_check_done = 0; @@ -314,8 +314,7 @@ int test_ava_filter( SLAPI_ACL_SEARCH, ACLPLUGIN_ACCESS_DEFAULT, NULL ); *access_check_done = -1; if ( only_check_access || rc != LDAP_SUCCESS ) { - LDAPDebug(LDAP_DEBUG_FILTER, "<= test_ava_filter %d\n", - rc, 0, 0 ); + slapi_log_err(SLAPI_LOG_FILTER, "test_ava_filter", "<= %d\n", rc); return( rc ); } } @@ -331,7 +330,7 @@ int test_ava_filter( } } - LDAPDebug(LDAP_DEBUG_FILTER, "<= test_ava_filter %d\n", rc, 0, 0 ); + slapi_log_err(SLAPI_LOG_FILTER, "test_ava_filter" ,"<= %d\n", rc); return( rc ); } @@ -462,7 +461,7 @@ test_extensible_filter( */ int rc; - LDAPDebug(LDAP_DEBUG_FILTER, "=> test_extensible_filter\n", 0, 0, 0 ); + slapi_log_err(SLAPI_LOG_FILTER, "test_extensible_filter", "=>\n"); *access_check_done = 0; @@ -580,7 +579,7 @@ test_extensible_filter( } } - LDAPDebug(LDAP_DEBUG_FILTER, "<= test_extensible_filter %d\n", rc, 0, 0 ); + slapi_log_err(SLAPI_LOG_FILTER, "test_extensible_filter", "<= %d\n", rc); return( rc ); } @@ -600,7 +599,7 @@ test_filter_list( struct slapi_filter *f; int access_check_tmp = -1; - LDAPDebug(LDAP_DEBUG_FILTER, "=> test_filter_list\n", 0, 0, 0 ); + slapi_log_err(SLAPI_LOG_FILTER, "test_filter_list", "=>\n"); *access_check_done = -1; @@ -627,7 +626,7 @@ test_filter_list( *access_check_done = 0; } - LDAPDebug(LDAP_DEBUG_FILTER, "<= test_filter_list %d\n", nomatch, 0, 0 ); + slapi_log_err(SLAPI_LOG_FILTER, "test_filter_list", "<= %d\n", nomatch); return( nomatch ); } @@ -683,7 +682,7 @@ int test_substring_filter( Slapi_Attr *a; int rc; - LDAPDebug(LDAP_DEBUG_FILTER, "=> test_substring_filter\n", 0, 0, 0 ); + slapi_log_err(SLAPI_LOG_FILTER, "test_substring_filter", "<=\n"); *access_check_done = 0; @@ -737,8 +736,7 @@ int test_substring_filter( } } - LDAPDebug(LDAP_DEBUG_FILTER, "<= test_substring_filter %d\n", - rc, 0, 0 ); + slapi_log_err(SLAPI_LOG_FILTER, "test_substring_filter", "<= %d\n", rc); return( rc ); } @@ -844,7 +842,7 @@ slapi_vattr_filter_test_ext_internal( { int rc = LDAP_SUCCESS; - LDAPDebug(LDAP_DEBUG_FILTER, "=> slapi_vattr_filter_test_ext_internal\n", 0, 0, 0 ); + slapi_log_err(SLAPI_LOG_FILTER, "slapi_vattr_filter_test_ext_internal", "=>\n"); /* * RJP: Not sure if this is semantically right, but we have to @@ -855,11 +853,11 @@ slapi_vattr_filter_test_ext_internal( return(0); } - LDAPDebug(LDAP_DEBUG_FILTER, "=> test_substring_filter\n", 0, 0, 0 ); + slapi_log_err(SLAPI_LOG_FILTER, "slapi_vattr_filter_test_ext_internal", "<=\n"); switch ( f->f_choice ) { case LDAP_FILTER_EQUALITY: - LDAPDebug(LDAP_DEBUG_FILTER, " EQUALITY\n", 0, 0, 0 ); + slapi_log_err(SLAPI_LOG_FILTER, "slapi_vattr_filter_test_ext_internal", "EQUALITY\n"); if ( verify_access ) { rc = test_filter_access( pb, e, f->f_ava.ava_type, &f->f_ava.ava_value); @@ -872,7 +870,7 @@ slapi_vattr_filter_test_ext_internal( break; case LDAP_FILTER_SUBSTRINGS: - LDAPDebug(LDAP_DEBUG_FILTER, " SUBSTRINGS\n", 0, 0, 0 ); + slapi_log_err(SLAPI_LOG_FILTER, "slapi_vattr_filter_test_ext_internal", "SUBSTRINGS\n"); if ( verify_access ) { rc = test_filter_access( pb, e, f->f_sub_type, NULL); *access_check_done = 1; @@ -884,7 +882,7 @@ slapi_vattr_filter_test_ext_internal( break; case LDAP_FILTER_GE: - LDAPDebug(LDAP_DEBUG_FILTER, " GE\n", 0, 0, 0 ); + slapi_log_err(SLAPI_LOG_FILTER, "slapi_vattr_filter_test_ext_internal", "GE\n"); if ( verify_access ) { rc = test_filter_access( pb, e, f->f_ava.ava_type, &f->f_ava.ava_value); @@ -897,7 +895,7 @@ slapi_vattr_filter_test_ext_internal( break; case LDAP_FILTER_LE: - LDAPDebug(LDAP_DEBUG_FILTER, " LE\n", 0, 0, 0 ); + slapi_log_err(SLAPI_LOG_FILTER, "slapi_vattr_filter_test_ext_internal", "LE\n"); if ( verify_access ) { rc = test_filter_access( pb, e, f->f_ava.ava_type, &f->f_ava.ava_value); @@ -910,7 +908,7 @@ slapi_vattr_filter_test_ext_internal( break; case LDAP_FILTER_PRESENT: - LDAPDebug(LDAP_DEBUG_FILTER, " PRESENT\n", 0, 0, 0 ); + slapi_log_err(SLAPI_LOG_FILTER, "slapi_vattr_filter_test_ext_internal", "PRESENT\n"); if ( verify_access ) { rc = test_filter_access( pb, e, f->f_type, NULL); *access_check_done = 1; @@ -922,7 +920,7 @@ slapi_vattr_filter_test_ext_internal( break; case LDAP_FILTER_APPROX: - LDAPDebug(LDAP_DEBUG_FILTER, " APPROX\n", 0, 0, 0 ); + slapi_log_err(SLAPI_LOG_FILTER, "slapi_vattr_filter_test_ext_internal", "APPROX\n"); if ( verify_access ) { rc = test_filter_access( pb, e, f->f_ava.ava_type, &f->f_ava.ava_value); @@ -935,25 +933,25 @@ slapi_vattr_filter_test_ext_internal( break; case LDAP_FILTER_EXTENDED: - LDAPDebug(LDAP_DEBUG_FILTER, " EXTENDED\n", 0, 0, 0 ); + slapi_log_err(SLAPI_LOG_FILTER, "slapi_vattr_filter_test_ext_internal", "EXTENDED\n"); rc = test_extensible_filter( pb, e, &f->f_mr, verify_access , only_check_access, access_check_done); break; case LDAP_FILTER_AND: - LDAPDebug(LDAP_DEBUG_FILTER, " AND\n", 0, 0, 0 ); + slapi_log_err(SLAPI_LOG_FILTER, "slapi_vattr_filter_test_ext_internal", "AND\n"); rc = vattr_test_filter_list_and( pb, e, f->f_and, LDAP_FILTER_AND , verify_access, only_check_access, access_check_done); break; case LDAP_FILTER_OR: - LDAPDebug(LDAP_DEBUG_FILTER, " OR\n", 0, 0, 0 ); + slapi_log_err(SLAPI_LOG_FILTER, "slapi_vattr_filter_test_ext_internal", "OR\n"); rc = vattr_test_filter_list_or( pb, e, f->f_or, LDAP_FILTER_OR , verify_access, only_check_access, access_check_done); break; case LDAP_FILTER_NOT: - LDAPDebug(LDAP_DEBUG_FILTER, " NOT\n", 0, 0, 0 ); + slapi_log_err(SLAPI_LOG_FILTER, "slapi_vattr_filter_test_ext_internal", "NOT\n"); rc = slapi_vattr_filter_test_ext_internal( pb, e, f->f_not , verify_access, only_check_access, access_check_done); if(verify_access && only_check_access) { @@ -993,13 +991,13 @@ slapi_vattr_filter_test_ext_internal( break; default: - LDAPDebug(LDAP_DEBUG_ERR, "slapi_vattr_filter_test_ext_internal - Unknown filter type 0x%lX\n", - f->f_choice, 0, 0 ); + slapi_log_err(SLAPI_LOG_ERR, "slapi_vattr_filter_test_ext_internal", + "Unknown filter type 0x%lX\n", f->f_choice); rc = -1; } - LDAPDebug(LDAP_DEBUG_FILTER, "<= slapi_vattr_filter_test_ext_internal %d\n", rc, 0, 0 ); + slapi_log_err(SLAPI_LOG_FILTER, "slapi_vattr_filter_test_ext_internal", "<= %d\n", rc); return( rc ); } @@ -1037,7 +1035,7 @@ vattr_test_filter_list_and( int rc = 0; struct slapi_filter *f; - LDAPDebug(LDAP_DEBUG_FILTER, "=> vattr_test_filter_list_and\n", 0, 0, 0 ); + slapi_log_err(SLAPI_LOG_FILTER, "vattr_test_filter_list_and", "=>\n"); for ( f = flist; f != NULL; f = f->f_next ) { rc = slapi_vattr_filter_test_ext_internal( pb, e, f, verify_access, only_check_access, access_check_done ); @@ -1058,7 +1056,7 @@ vattr_test_filter_list_and( } } - LDAPDebug(LDAP_DEBUG_FILTER, "<= test_filter_list_and %d\n", nomatch, 0, 0 ); + slapi_log_err(SLAPI_LOG_FILTER, "vattr_test_filter_list_and", "<= %d\n", nomatch); if (undefined) return undefined; return( nomatch ); } @@ -1079,7 +1077,7 @@ vattr_test_filter_list_or( int rc = 0; struct slapi_filter *f; - LDAPDebug(LDAP_DEBUG_FILTER, "=> vattr_test_filter_list_or\n", 0, 0, 0 ); + slapi_log_err(SLAPI_LOG_FILTER, "vattr_test_filter_list_or", "=>\n"); for ( f = flist; f != NULL; f = f->f_next ) { if ( verify_access) { @@ -1107,7 +1105,7 @@ vattr_test_filter_list_or( } } - LDAPDebug(LDAP_DEBUG_FILTER, "<= test_filter_list_or %d\n", nomatch, 0, 0 ); + slapi_log_err(SLAPI_LOG_FILTER, "vattr_test_filter_list_or", "<= %d\n", nomatch); if (nomatch == 1) return undefined; return( nomatch ); diff --git a/ldap/servers/slapd/house.c b/ldap/servers/slapd/house.c index be3b35b..f604573 100644 --- a/ldap/servers/slapd/house.c +++ b/ldap/servers/slapd/house.c @@ -60,13 +60,13 @@ housekeeping_start(time_t cur_time, void *arg) } if ( ( housekeeping_mutex = PR_NewLock()) == NULL ) { - slapi_log_error(SLAPI_LOG_ERR, "housekeeping_start", + slapi_log_err(SLAPI_LOG_ERR, "housekeeping_start", "housekeeping cannot create new lock. " SLAPI_COMPONENT_NAME_NSPR " error %d (%s)\n", PR_GetError(), slapd_pr_strerror( PR_GetError() )); } else if ( ( housekeeping_cvar = PR_NewCondVar( housekeeping_mutex )) == NULL ) { - slapi_log_error(SLAPI_LOG_ERR, "housekeeping_start", + slapi_log_err(SLAPI_LOG_ERR, "housekeeping_start", "housekeeping cannot create new condition variable. " SLAPI_COMPONENT_NAME_NSPR " error %d (%s)\n", PR_GetError(), slapd_pr_strerror( PR_GetError() )); @@ -77,7 +77,7 @@ housekeeping_start(time_t cur_time, void *arg) (VFP) housecleaning, (void*)&thread_start_time, PR_PRIORITY_NORMAL, PR_GLOBAL_THREAD, PR_JOINABLE_THREAD, SLAPD_DEFAULT_THREAD_STACKSIZE)) == NULL) { - slapi_log_error(SLAPI_LOG_ERR, "housekeeping_start", + slapi_log_err(SLAPI_LOG_ERR, "housekeeping_start", "housekeeping PR_CreateThread failed. " SLAPI_COMPONENT_NAME_NSPR " error %d (%s)\n", PR_GetError(), slapd_pr_strerror( PR_GetError() )); diff --git a/ldap/servers/slapd/index_subsystem.c b/ldap/servers/slapd/index_subsystem.c index 84551de..57d4f58 100644 --- a/ldap/servers/slapd/index_subsystem.c +++ b/ldap/servers/slapd/index_subsystem.c @@ -193,18 +193,18 @@ int index_subsys_assign_filter_decoders(Slapi_PBlock *pb) /* extract the filter */ slapi_pblock_get(pb, SLAPI_SEARCH_FILTER, &f); - if ( LDAPDebugLevelIsSet( LDAP_DEBUG_FILTER ) && NULL != f ) { + if ( loglevel_is_set( LDAP_DEBUG_FILTER ) && NULL != f ) { logbuf[0] = '\0'; - slapi_log_error(SLAPI_LOG_DEBUG, subsystem, "before: %s\n", + slapi_log_err(SLAPI_LOG_DEBUG, subsystem, "before: %s\n", slapi_filter_to_string(f, logbuf, sizeof(logbuf))); } /* find decoders */ rc = index_subsys_assign_decoders(f); - if ( LDAPDebugLevelIsSet( LDAP_DEBUG_FILTER ) && NULL != f ) { + if ( loglevel_is_set( LDAP_DEBUG_FILTER ) && NULL != f ) { logbuf[0] = '\0'; - slapi_log_error(SLAPI_LOG_DEBUG, subsystem, " after: %s\n", + slapi_log_err(SLAPI_LOG_DEBUG, subsystem, " after: %s\n", slapi_filter_to_string(f, logbuf, sizeof(logbuf))); } diff --git a/ldap/servers/slapd/init.c b/ldap/servers/slapd/init.c index 42f9e42..516269e 100644 --- a/ldap/servers/slapd/init.c +++ b/ldap/servers/slapd/init.c @@ -35,8 +35,8 @@ slapd_init() if ( g_get_current_conn_count_mutex() == NULL ) { - LDAPDebug(LDAP_DEBUG_CRIT, - "init: PR_NewLock failed\n", 0, 0, 0 ); + slapi_log_err(SLAPI_LOG_CRIT, + "slapd_init", "PR_NewLock failed\n"); exit( -1 ); } @@ -44,8 +44,8 @@ slapd_init() set_attr_to_protected_list(PSEUDO_ATTR_UNHASHEDUSERPASSWORD, 0); #ifndef HAVE_TIME_R if ((time_func_mutex = PR_NewLock()) == NULL ) { - LDAPDebug(LDAP_DEBUG_CRIT, - "init: PR_NewLock failed\n", 0, 0, 0 ); + slapi_log_err(SLAPI_LOG_CRIT, + "slapd_init", "PR_NewLock failed\n"); exit(-1); } diff --git a/ldap/servers/slapd/ldaputil.c b/ldap/servers/slapd/ldaputil.c index ae83e8f..090b613 100644 --- a/ldap/servers/slapd/ldaputil.c +++ b/ldap/servers/slapd/ldaputil.c @@ -81,7 +81,7 @@ internal_ol_init_init(void) PR_ASSERT(NULL == ol_init_lock); if ((ol_init_lock = PR_NewLock()) == NULL) { PRErrorCode errorCode = PR_GetError(); - slapi_log_error(SLAPI_LOG_ERR, "internal_ol_init_init", "PR_NewLock failed %d:%s\n", + slapi_log_err(SLAPI_LOG_ERR, "internal_ol_init_init", "PR_NewLock failed %d:%s\n", errorCode, slapd_pr_strerror(errorCode)); return PR_FAILURE; } @@ -163,12 +163,12 @@ convert_to_openldap_uri(const char *hostname_or_uri, int port, const char *proto proto = my_copy; start += 3; } else { - slapi_log_error(SLAPI_LOG_ERR, "convert_to_openldap_uri", + slapi_log_err(SLAPI_LOG_ERR, "convert_to_openldap_uri", "The given LDAP URI [%s] is not valid\n", hostname_or_uri); goto end; } } else if (!proto) { - slapi_log_error(SLAPI_LOG_ERR, "convert_to_openldap_uri", + slapi_log_err(SLAPI_LOG_ERR, "convert_to_openldap_uri", "The given LDAP URI [%s] is not valid\n", hostname_or_uri); goto end; } else { @@ -586,7 +586,7 @@ setup_ol_tls_conn(LDAP *ld, int clientauth) } if ((rc = ldap_set_option(ld, LDAP_OPT_X_TLS_REQUIRE_CERT, &ssl_strength))) { - slapi_log_error(SLAPI_LOG_ERR, "setup_ol_tls_conn", + slapi_log_err(SLAPI_LOG_ERR, "setup_ol_tls_conn", "failed: unable to set REQUIRE_CERT option to %d\n", ssl_strength); } if (slapi_client_uses_non_nss(ld)) { @@ -595,7 +595,7 @@ setup_ol_tls_conn(LDAP *ld, int clientauth) /* CA Cert PEM file exists. Set the path to openldap option. */ rc = ldap_set_option(ld, LDAP_OPT_X_TLS_CACERTFILE, cacert); if (rc) { - slapi_log_error(SLAPI_LOG_ERR, "setup_ol_tls_conn", + slapi_log_err(SLAPI_LOG_ERR, "setup_ol_tls_conn", "Could not set CA cert path [%s]: %d:%s\n", cacert, rc, ldap_err2string(rc)); } @@ -605,7 +605,7 @@ setup_ol_tls_conn(LDAP *ld, int clientauth) /* Sets the CRL evaluation strategy. */ rc = ldap_set_option(ld, LDAP_OPT_X_TLS_CRLCHECK, &crlcheck); if (rc) { - slapi_log_error(SLAPI_LOG_ERR, "setup_ol_tls_conn", + slapi_log_err(SLAPI_LOG_ERR, "setup_ol_tls_conn", "Could not set CRLCHECK [%d]: %d:%s\n", crlcheck, rc, ldap_err2string(rc)); } @@ -613,7 +613,7 @@ setup_ol_tls_conn(LDAP *ld, int clientauth) } /* tell it where our cert db/file is */ if ((rc = ldap_set_option(ld, LDAP_OPT_X_TLS_CACERTDIR, certdir))) { - slapi_log_error(SLAPI_LOG_ERR, "setup_ol_tls_conn", + slapi_log_err(SLAPI_LOG_ERR, "setup_ol_tls_conn", "failed: unable to set CACERTDIR option to %s\n", certdir); } slapi_ch_free_string(&certdir); @@ -622,7 +622,7 @@ setup_ol_tls_conn(LDAP *ld, int clientauth) if ((rc = ldap_set_option(ld, LDAP_OPT_X_TLS_PROTOCOL_MIN, &optval))) { char *minstr = NULL; (void)getSSLVersionRange(&minstr, NULL); - slapi_log_error(SLAPI_LOG_ERR, "setup_ol_tls_conn", + slapi_log_err(SLAPI_LOG_ERR, "setup_ol_tls_conn", "failed: unable to set minimum TLS protocol level to %s\n", minstr); slapi_ch_free_string(&minstr); } @@ -630,7 +630,7 @@ setup_ol_tls_conn(LDAP *ld, int clientauth) if (clientauth) { rc = slapd_SSL_client_auth(ld); if (rc) { - slapi_log_error(SLAPI_LOG_ERR, "setup_ol_tls_conn", + slapi_log_err(SLAPI_LOG_ERR, "setup_ol_tls_conn", "failed: unable to setup connection for TLS/SSL EXTERNAL client cert authentication - %d\n", rc); } } @@ -640,7 +640,7 @@ setup_ol_tls_conn(LDAP *ld, int clientauth) that optval is zero, meaning create a context for a client */ optval = 0; if ((rc = ldap_set_option(ld, LDAP_OPT_X_TLS_NEWCTX, &optval))) { - slapi_log_error(SLAPI_LOG_ERR, "setup_ol_tls_conn", + slapi_log_err(SLAPI_LOG_ERR, "setup_ol_tls_conn", "failed: unable to create new TLS context - %d\n", rc); } @@ -693,7 +693,7 @@ slapi_ldap_init_ext( char *pp = NULL; if (NULL == pluginpath || (*pluginpath == '\0')) { - slapi_log_error(SLAPI_LOG_SHELL, "slapi_ldap_init_ext", + slapi_log_err(SLAPI_LOG_SHELL, "slapi_ldap_init_ext", "config_get_saslpath returns NULL\n"); pluginpath = ldaputil_get_saslpath(); } @@ -702,14 +702,14 @@ slapi_ldap_init_ext( (0 != strcmp(++pp, pluginpath)) /* sasl_path has been updated */ ) { PR_snprintf(util_sasl_path, sizeof(util_sasl_path), "SASL_PATH=%s", pluginpath); - slapi_log_error(SLAPI_LOG_SHELL, "slapi_ldap_init_ext", "putenv(%s)\n", util_sasl_path); + slapi_log_err(SLAPI_LOG_SHELL, "slapi_ldap_init_ext", "putenv(%s)\n", util_sasl_path); putenv(util_sasl_path); } slapi_ch_free_string(&configpluginpath); /* if ldapurl is given, parse it */ if (ldapurl && ((rc = slapi_ldap_url_parse(ldapurl, &ludp, 0, &secureurl)) || !ludp)) { - slapi_log_error(SLAPI_LOG_ERR, "slapi_ldap_init_ext", + slapi_log_err(SLAPI_LOG_ERR, "slapi_ldap_init_ext", "Could not parse given LDAP URL [%s] : error [%s]\n", ldapurl, /* ldapurl cannot be NULL here */ slapi_urlparse_err2string(rc)); @@ -768,7 +768,7 @@ slapi_ldap_init_ext( #if defined(USE_OPENLDAP) if (ldapurl) { if (PR_SUCCESS != PR_CallOnce(&ol_init_callOnce, internal_ol_init_init)) { - slapi_log_error(SLAPI_LOG_ERR, "slapi_ldap_init_ext", + slapi_log_err(SLAPI_LOG_ERR, "slapi_ldap_init_ext", "Could not perform internal ol_init init\n"); rc = -1; goto done; @@ -778,7 +778,7 @@ slapi_ldap_init_ext( rc = ldap_initialize(&ld, ldapurl); PR_Unlock(ol_init_lock); if (rc) { - slapi_log_error(SLAPI_LOG_ERR, "slapi_ldap_init_ext", + slapi_log_err(SLAPI_LOG_ERR, "slapi_ldap_init_ext", "Could not initialize LDAP connection to [%s]: %d:%s\n", ldapurl, rc, ldap_err2string(rc)); goto done; @@ -793,7 +793,7 @@ slapi_ldap_init_ext( (secure == SLAPI_LDAP_INIT_FLAG_SSL ? "ldaps" : "ldap")); } if (PR_SUCCESS != PR_CallOnce(&ol_init_callOnce, internal_ol_init_init)) { - slapi_log_error(SLAPI_LOG_ERR, "slapi_ldap_init_ext", + slapi_log_err(SLAPI_LOG_ERR, "slapi_ldap_init_ext", "Could not perform internal ol_init init\n"); rc = -1; goto done; @@ -803,7 +803,7 @@ slapi_ldap_init_ext( rc = ldap_initialize(&ld, makeurl); PR_Unlock(ol_init_lock); if (rc) { - slapi_log_error(SLAPI_LOG_ERR, "slapi_ldap_init_ext", + slapi_log_err(SLAPI_LOG_ERR, "slapi_ldap_init_ext", "Could not initialize LDAP connection to [%s]: %d:%s\n", makeurl, rc, ldap_err2string(rc)); slapi_ch_free_string(&makeurl); @@ -821,7 +821,7 @@ slapi_ldap_init_ext( * hostname (such as localhost.localdomain). */ if((rc = ldap_set_option(ld, LDAP_OPT_X_SASL_NOCANON, LDAP_OPT_ON))){ - slapi_log_error(SLAPI_LOG_ERR, "slapi_ldap_init_ext", + slapi_log_err(SLAPI_LOG_ERR, "slapi_ldap_init_ext", "Could not set ldap option LDAP_OPT_X_SASL_NOCANON for (%s), error %d (%s)\n", ldapurl, rc, ldap_err2string(rc) ); } @@ -866,7 +866,7 @@ slapi_ldap_init_ext( tv.tv_sec = io_timeout_ms / 1000; tv.tv_usec = (io_timeout_ms % 1000) * 1000; if (LDAP_OPT_SUCCESS != ldap_set_option(ld, LDAP_OPT_NETWORK_TIMEOUT, &tv)) { - slapi_log_error(SLAPI_LOG_ERR, "slapi_ldap_init_ext", + slapi_log_err(SLAPI_LOG_ERR, "slapi_ldap_init_ext", "failed: unable to set outbound I/O timeout to %dms\n", io_timeout_ms); slapi_ldap_unbind(ld); ld = NULL; @@ -874,7 +874,7 @@ slapi_ldap_init_ext( } #else /* !USE_OPENLDAP */ if (prldap_set_session_option(ld, NULL, PRLDAP_OPT_IO_MAX_TIMEOUT, io_timeout_ms) != LDAP_SUCCESS) { - slapi_log_error(SLAPI_LOG_ERR, "slapi_ldap_init_ext", + slapi_log_err(SLAPI_LOG_ERR, "slapi_ldap_init_ext", "failed: unable to set outbound I/O timeout to %dms\n", io_timeout_ms); slapi_ldap_unbind(ld); ld = NULL; @@ -889,7 +889,7 @@ slapi_ldap_init_ext( if (secure > 0) { #if defined(USE_OPENLDAP) if (setup_ol_tls_conn(ld, 0)) { - slapi_log_error(SLAPI_LOG_ERR, "slapi_ldap_init_ext", + slapi_log_err(SLAPI_LOG_ERR, "slapi_ldap_init_ext", "failed: unable to set SSL/TLS options\n"); } #else @@ -920,7 +920,7 @@ slapi_ldap_init_ext( { int prerr = PR_GetError(); - slapi_log_error(SLAPI_LOG_ERR, "slapi_ldap_init_ext", + slapi_log_err(SLAPI_LOG_ERR, "slapi_ldap_init_ext", "failed: unable to set SSL options (" SLAPI_COMPONENT_NAME_NSPR " error %d - %s)\n", prerr, slapd_pr_strerror(prerr)); @@ -960,7 +960,7 @@ slapi_ldap_init_ext( ldap_controls_free(clientctrls); /* free the copy */ } - slapi_log_error(SLAPI_LOG_SHELL, "slapi_ldap_init_ext", + slapi_log_err(SLAPI_LOG_SHELL, "slapi_ldap_init_ext", "Success: set up conn to [%s:%d]%s\n", hostname, port, (secure == SLAPI_LDAP_INIT_FLAG_startTLS) ? " using startTLS" : @@ -1089,13 +1089,13 @@ slapi_ldap_bind( rc = slapd_SSL_client_auth(ld); #endif if (rc != 0) { - slapi_log_error(SLAPI_LOG_ERR, "slapi_ldap_bind", + slapi_log_err(SLAPI_LOG_ERR, "slapi_ldap_bind", "Error: could not configure the server for cert " "auth - error %d - make sure the server is " "correctly configured for SSL/TLS\n", rc); goto done; } else { - slapi_log_error(SLAPI_LOG_SHELL, "slapi_ldap_bind", + slapi_log_err(SLAPI_LOG_SHELL, "slapi_ldap_bind", "Set up conn to use client auth\n"); } bvcreds.bv_val = NULL; /* ignore username and passed in creds */ @@ -1111,20 +1111,20 @@ slapi_ldap_bind( if (LDAP_SUCCESS != rc) { if (errno != 0){ /* Log the system errno */ - slapi_log_error(SLAPI_LOG_ERR, "slapi_ldap_bind", + slapi_log_err(SLAPI_LOG_ERR, "slapi_ldap_bind", "Error: could not send startTLS request: " "error %d (%s) errno %d (%s)\n", rc, ldap_err2string(rc), errno, slapd_system_strerror(errno)); } else { /* Only LDAP error, no system error */ - slapi_log_error(SLAPI_LOG_ERR, "slapi_ldap_bind", + slapi_log_err(SLAPI_LOG_ERR, "slapi_ldap_bind", "Error: could not send startTLS request: " "error %d (%s)\n", rc, ldap_err2string(rc)); } goto done; } - slapi_log_error(SLAPI_LOG_SHELL, "slapi_ldap_bind", + slapi_log_err(SLAPI_LOG_SHELL, "slapi_ldap_bind", "startTLS started on connection\n"); } @@ -1134,7 +1134,7 @@ slapi_ldap_bind( !strcmp(mech, LDAP_SASL_EXTERNAL)) { int mymsgid = 0; - slapi_log_error(SLAPI_LOG_SHELL, "slapi_ldap_bind", + slapi_log_err(SLAPI_LOG_SHELL, "slapi_ldap_bind", "attempting %s bind with id [%s] creds [%s]\n", mech ? mech : "SIMPLE", bindid, creds); @@ -1163,7 +1163,7 @@ slapi_ldap_bind( } } - slapi_log_error(SLAPI_LOG_ERR, "slapi_ldap_bind", + slapi_log_err(SLAPI_LOG_ERR, "slapi_ldap_bind", "Could not send bind request for id " "[%s] authentication mechanism [%s]: error %d (%s), system error %d (%s), " "network error %d (%s, host \"%s\")\n", @@ -1199,7 +1199,7 @@ slapi_ldap_bind( rc = slapi_ldap_get_lderrno(ld, NULL, NULL); if (errno != 0){ /* Log the system errno and message */ - slapi_log_error(SLAPI_LOG_ERR, "slapi_ldap_bind", + slapi_log_err(SLAPI_LOG_ERR, "slapi_ldap_bind", "Error reading bind response for id " "[%s] authentication mechanism [%s]: error %d (%s) errno %d (%s)\n", bindid ? bindid : "(anon)", @@ -1207,7 +1207,7 @@ slapi_ldap_bind( rc, ldap_err2string(rc), errno, slapd_system_strerror(errno)); } else { /* Only LDAP error, no system error */ - slapi_log_error(SLAPI_LOG_ERR, "slapi_ldap_bind", + slapi_log_err(SLAPI_LOG_ERR, "slapi_ldap_bind", "Error reading bind response for id " "[%s] authentication mechanism [%s]: error %d (%s)\n", bindid ? bindid : "(anon)", @@ -1217,7 +1217,7 @@ slapi_ldap_bind( goto done; } else if (rc == 0) { /* timeout */ rc = LDAP_TIMEOUT; - slapi_log_error(SLAPI_LOG_ERR, "slapi_ldap_bind", + slapi_log_err(SLAPI_LOG_ERR, "slapi_ldap_bind", "Error: timeout after [%ld.%ld] seconds reading " "bind response for [%s] authentication mechanism [%s]\n", bind_timeout->tv_sec, bind_timeout->tv_usec, @@ -1233,12 +1233,12 @@ slapi_ldap_bind( NULL, returnedctrls, 0)) != LDAP_SUCCESS) { if (errno != 0){ /* Log the system errno and message */ - slapi_log_error(SLAPI_LOG_ERR, "slapi_ldap_bind", + slapi_log_err(SLAPI_LOG_ERR, "slapi_ldap_bind", "Error: could not parse bind result: error %d (%s) errno %d (%s)\n", rc, ldap_err2string(rc), errno, slapd_system_strerror(errno)); } else { /* Only LDAP error, no system error */ - slapi_log_error(SLAPI_LOG_ERR, "slapi_ldap_bind", + slapi_log_err(SLAPI_LOG_ERR, "slapi_ldap_bind", "Error: could not parse bind result: error %d (%s)\n", rc, ldap_err2string(rc)); } @@ -1250,14 +1250,14 @@ slapi_ldap_bind( rc = err; if (errno != 0){ /* Log the system errno and message */ - slapi_log_error(SLAPI_LOG_ERR, "slapi_ldap_bind", + slapi_log_err(SLAPI_LOG_ERR, "slapi_ldap_bind", "Error: could not bind id " "[%s] authentication mechanism [%s]: error %d (%s) errno %d (%s)\n", bindid ? bindid : "(anon)", mech ? mech : "SIMPLE", rc, ldap_err2string(rc), errno, slapd_system_strerror(errno)); } else { /* Only LDAP error, no system error */ - slapi_log_error(SLAPI_LOG_ERR, "slapi_ldap_bind", + slapi_log_err(SLAPI_LOG_ERR, "slapi_ldap_bind", "Error: could not bind id " "[%s] authentication mechanism [%s]: error %d (%s)\n", bindid ? bindid : "(anon)", @@ -1271,14 +1271,14 @@ slapi_ldap_bind( if ((rc = ldap_parse_sasl_bind_result(ld, result, &servercredp, 0))) { rc = slapi_ldap_get_lderrno(ld, NULL, NULL); if (errno != 0){ - slapi_log_error(SLAPI_LOG_ERR, "slapi_ldap_bind", + slapi_log_err(SLAPI_LOG_ERR, "slapi_ldap_bind", "Error: could not read bind results for id " "[%s] authentication mechanism [%s]: error %d (%s) errno %d (%s)\n", bindid ? bindid : "(anon)", mech ? mech : "SIMPLE", rc, ldap_err2string(rc), errno, slapd_system_strerror(errno)); } else { - slapi_log_error(SLAPI_LOG_ERR, "slapi_ldap_bind", + slapi_log_err(SLAPI_LOG_ERR, "slapi_ldap_bind", "Error: could not read bind results for id " "[%s] authentication mechanism [%s]: error %d (%s)\n", bindid ? bindid : "(anon)", @@ -1302,7 +1302,7 @@ slapi_ldap_bind( rc = slapd_ldap_sasl_interactive_bind(ld, bindid, creds, mech, serverctrls, returnedctrls, msgidp); if (LDAP_SUCCESS != rc) { - slapi_log_error(SLAPI_LOG_CONNS, "slapi_ldap_bind", + slapi_log_err(SLAPI_LOG_CONNS, "slapi_ldap_bind", "Error: could not perform interactive bind for id " "[%s] authentication mechanism [%s]: error %d (%s)\n", bindid ? bindid : "(anon)", @@ -1402,7 +1402,7 @@ slapi_add_auth_response_control( Slapi_PBlock *pb, const char *binddn ) } if ( slapi_pblock_set( pb, SLAPI_ADD_RESCONTROL, &arctrl ) != 0 ) { - slapi_log_error(SLAPI_LOG_ERR, "slapi_add_auth_response_control", + slapi_log_err(SLAPI_LOG_ERR, "slapi_add_auth_response_control", "Unable to add authentication response control" ); } @@ -1525,25 +1525,25 @@ ldap_sasl_get_val(ldapSaslInteractVals *vals, sasl_interact_t *interact, unsigne switch(interact->id) { case SASL_CB_AUTHNAME: defvalue = vals->authid; - slapi_log_error(authtracelevel, "ldap_sasl_get_val", + slapi_log_err(authtracelevel, "ldap_sasl_get_val", "Using value [%s] for SASL_CB_AUTHNAME\n", defvalue ? defvalue : "(null)"); break; case SASL_CB_USER: defvalue = vals->username; - slapi_log_error(authtracelevel, "ldap_sasl_get_val", + slapi_log_err(authtracelevel, "ldap_sasl_get_val", "Using value [%s] for SASL_CB_USER\n", defvalue ? defvalue : "(null)"); break; case SASL_CB_PASS: defvalue = vals->passwd; - slapi_log_error(authtracelevel, "ldap_sasl_get_val", + slapi_log_err(authtracelevel, "ldap_sasl_get_val", "Using value [%s] for SASL_CB_PASS\n", defvalue ? defvalue : "(null)"); break; case SASL_CB_GETREALM: defvalue = vals->realm; - slapi_log_error(authtracelevel, "ldap_sasl_get_val", + slapi_log_err(authtracelevel, "ldap_sasl_get_val", "Using value [%s] for SASL_CB_GETREALM\n", defvalue ? defvalue : "(null)"); break; @@ -1629,7 +1629,7 @@ slapd_ldap_sasl_interactive_bind( if (LDAP_SUCCESS != rc) { char *errmsg = NULL; rc = slapi_ldap_get_lderrno(ld, NULL, &errmsg); - slapi_log_error(SLAPI_LOG_CONNS, "slapd_ldap_sasl_interactive_bind", + slapi_log_err(SLAPI_LOG_CONNS, "slapd_ldap_sasl_interactive_bind", "Error: could not perform interactive bind for id " "[%s] mech [%s]: LDAP error %d (%s) (%s) " "errno %d (%s)\n", @@ -1670,13 +1670,13 @@ show_one_credential(int authtracelevel, char startts[BUFSIZ], endts[BUFSIZ], renewts[BUFSIZ]; if ((rc = krb5_unparse_name(ctx, cred->client, &name))) { - slapi_log_error(SLAPI_LOG_ERR, logname, + slapi_log_err(SLAPI_LOG_ERR, logname, "Could not get client name from credential: %d (%s)\n", rc, error_message(rc)); goto cleanup; } if ((rc = krb5_unparse_name(ctx, cred->server, &sname))) { - slapi_log_error(SLAPI_LOG_ERR, logname, + slapi_log_err(SLAPI_LOG_ERR, logname, "Could not get server name from credential: %d (%s)\n", rc, error_message(rc)); goto cleanup; @@ -1691,7 +1691,7 @@ show_one_credential(int authtracelevel, krb5_timestamp_to_sfstring((krb5_timestamp)cred->times.renew_till, renewts, sizeof(renewts), NULL); - slapi_log_error(authtracelevel, logname, + slapi_log_err(authtracelevel, logname, "\tKerberos credential: client [%s] server [%s] " "start time [%s] end time [%s] renew time [%s] " "flags [0x%x]\n", name, sname, startts, endts, @@ -1719,19 +1719,19 @@ show_cached_credentials(int authtracelevel, char *princ_name = NULL; if ((rc = krb5_unparse_name(ctx, princ, &princ_name))) { - slapi_log_error(SLAPI_LOG_ERR, logname, + slapi_log_err(SLAPI_LOG_ERR, logname, "Could not get principal name from principal: %d (%s)\n", rc, error_message(rc)); goto cleanup; } - slapi_log_error(authtracelevel, logname, + slapi_log_err(authtracelevel, logname, "Ticket cache: %s:%s\nDefault principal: %s\n\n", krb5_cc_get_type(ctx, cc), krb5_cc_get_name(ctx, cc), princ_name); if ((rc = krb5_cc_start_seq_get(ctx, cc, &cur))) { - slapi_log_error(SLAPI_LOG_ERR, logname, + slapi_log_err(SLAPI_LOG_ERR, logname, "Could not get cursor to iterate cached credentials: " "%d (%s)\n", rc, error_message(rc)); goto cleanup; @@ -1743,7 +1743,7 @@ show_cached_credentials(int authtracelevel, } if (rc == KRB5_CC_END) { if ((rc = krb5_cc_end_seq_get(ctx, cc, &cur))) { - slapi_log_error(SLAPI_LOG_ERR, logname, + slapi_log_err(SLAPI_LOG_ERR, logname, "Could not close cached credentials cursor: " "%d (%s)\n", rc, error_message(rc)); goto cleanup; @@ -1805,7 +1805,7 @@ credentials_are_valid( realm_len, realm_str); if ((*rc = krb5_parse_name(ctx, tgs_princ_name, &mcreds.server))) { - slapi_log_error(SLAPI_LOG_ERR, logname, + slapi_log_err(SLAPI_LOG_ERR, logname, "Could parse principal [%s]: %d (%s)\n", tgs_princ_name, *rc, error_message(*rc)); goto cleanup; @@ -1822,14 +1822,14 @@ credentials_are_valid( /* have the creds - now look at the timestamp */ if ((*rc = krb5_timeofday(ctx, ¤ttime))) { - slapi_log_error(SLAPI_LOG_ERR, logname, + slapi_log_err(SLAPI_LOG_ERR, logname, "Could not get current time: %d (%s)\n", *rc, error_message(*rc)); goto cleanup; } if (currenttime > (creds.times.endtime + time_buffer)) { - slapi_log_error(authtracelevel, logname, + slapi_log_err(authtracelevel, logname, "Credentials for [%s] have expired or will soon " "expire - now [%d] endtime [%d]\n", princ_name, currenttime, creds.times.endtime); @@ -1856,7 +1856,7 @@ internal_krb5_init(void) PR_ASSERT(NULL == krb5_lock); if ((krb5_lock = PR_NewLock()) == NULL) { PRErrorCode errorCode = PR_GetError(); - slapi_log_error(SLAPI_LOG_ERR, "internal_krb5_init", "PR_NewLock failed %d:%s\n", + slapi_log_err(SLAPI_LOG_ERR, "internal_krb5_init", "PR_NewLock failed %d:%s\n", errorCode, slapd_pr_strerror(errorCode)); return PR_FAILURE; } @@ -1911,7 +1911,7 @@ set_krb5_creds( * so we put a lock around all kerberos interactions */ if (PR_SUCCESS != PR_CallOnce(&krb5_callOnce, internal_krb5_init)) { - slapi_log_error(SLAPI_LOG_ERR, logname, + slapi_log_err(SLAPI_LOG_ERR, logname, "Could not perform internal krb5 init\n"); rc = -1; goto cleanup; @@ -1921,7 +1921,7 @@ set_krb5_creds( /* initialize the kerberos context */ if ((rc = krb5_init_context(&ctx))) { - slapi_log_error(SLAPI_LOG_ERR, logname, + slapi_log_err(SLAPI_LOG_ERR, logname, "Could not init Kerberos context: %d (%s)\n", rc, error_message(rc)); goto cleanup; @@ -1931,7 +1931,7 @@ set_krb5_creds( creds in the ccache */ /* grab the default ccache - note: this does not open the cache */ if ((rc = krb5_cc_default(ctx, &cc))) { - slapi_log_error(SLAPI_LOG_ERR, logname, + slapi_log_err(SLAPI_LOG_ERR, logname, "Could not get default Kerberos ccache: %d (%s)\n", rc, error_message(rc)); goto cleanup; @@ -1945,7 +1945,7 @@ set_krb5_creds( is no ccache */ if ((rc = krb5_cc_get_principal(ctx, cc, &princ))) { if (KRB5_FCC_NOFILE == rc) { /* no cache - ok */ - slapi_log_error(authtracelevel, logname, + slapi_log_err(authtracelevel, logname, "The default credentials cache [%s] not found: " "will create a new one.\n", cc_name); /* close the cache - we will create a new one below */ @@ -1954,19 +1954,19 @@ set_krb5_creds( slapi_ch_free_string(&cc_name); /* fall through to the keytab auth code below */ } else { /* fatal */ - slapi_log_error(SLAPI_LOG_ERR, logname, + slapi_log_err(SLAPI_LOG_ERR, logname, "Could not open default Kerberos ccache [%s]: " "%d (%s)\n", cc_name, rc, error_message(rc)); goto cleanup; } } else { /* have a valid ccache && found principal */ if ((rc = krb5_unparse_name(ctx, princ, &princ_name))) { - slapi_log_error(SLAPI_LOG_ERR, logname, + slapi_log_err(SLAPI_LOG_ERR, logname, "Unable to get name of principal from ccache [%s]: " "%d (%s)\n", cc_name, rc, error_message(rc)); goto cleanup; } - slapi_log_error(authtracelevel, logname, + slapi_log_err(authtracelevel, logname, "Using principal [%s] from ccache [%s]\n", princ_name, cc_name); } @@ -1992,7 +1992,7 @@ set_krb5_creds( about it. However, if the user knows what he/she is doing, by using an external ccache file, they probably don't want to be notified with an error every time. */ - slapi_log_error(loglevel, logname, + slapi_log_err(loglevel, logname, "The server will use the external SASL/GSSAPI " "credentials cache [%s:%s]. If you want the " "server to automatically authenticate with its " @@ -2011,7 +2011,7 @@ set_krb5_creds( */ if (!princ && looks_like_a_princ_name(username) && (rc = krb5_parse_name(ctx, username, &princ))) { - slapi_log_error(SLAPI_LOG_ERR, logname, + slapi_log_err(SLAPI_LOG_ERR, logname, "Could not convert [%s] into a kerberos " "principal: %d (%s)\n", username, rc, error_message(rc)); @@ -2020,7 +2020,7 @@ set_krb5_creds( if (getenv("HACK_PRINCIPAL_NAME") && (rc = krb5_parse_name(ctx, getenv("HACK_PRINCIPAL_NAME"), &princ))) { - slapi_log_error(SLAPI_LOG_ERR, logname, + slapi_log_err(SLAPI_LOG_ERR, logname, "Could not convert [%s] into a kerberos " "principal: %d (%s)\n", getenv("HACK_PRINCIPAL_NAME"), rc, error_message(rc)); @@ -2032,7 +2032,7 @@ set_krb5_creds( char *hostname = config_get_localhost(); if ((rc = krb5_sname_to_principal(ctx, hostname, "ldap", KRB5_NT_SRV_HST, &princ))) { - slapi_log_error(SLAPI_LOG_ERR, logname, + slapi_log_err(SLAPI_LOG_ERR, logname, "Could not construct ldap service " "principal from hostname [%s]: %d (%s)\n", hostname ? hostname : "NULL", rc, error_message(rc)); @@ -2045,26 +2045,26 @@ set_krb5_creds( slapi_ch_free_string(&princ_name); if ((rc = krb5_unparse_name(ctx, princ, &princ_name))) { - slapi_log_error(SLAPI_LOG_ERR, logname, + slapi_log_err(SLAPI_LOG_ERR, logname, "Unable to get name of principal: " "%d (%s)\n", rc, error_message(rc)); goto cleanup; } - slapi_log_error(authtracelevel, logname, + slapi_log_err(authtracelevel, logname, "Using principal named [%s]\n", princ_name); /* grab the credentials from the ccache, if any - if the credentials are still valid, we do not have to authenticate again */ if (credentials_are_valid(ctx, cc, princ, princ_name, &rc)) { - slapi_log_error(authtracelevel, logname, + slapi_log_err(authtracelevel, logname, "Credentials for principal [%s] are still " "valid - no auth is necessary.\n", princ_name); goto cleanup; } else if (rc) { /* some error other than "there are no credentials" */ - slapi_log_error(SLAPI_LOG_ERR, logname, + slapi_log_err(SLAPI_LOG_ERR, logname, "Unable to verify cached credentials for " "principal [%s]: %d (%s)\n", princ_name, rc, error_message(rc)); @@ -2073,7 +2073,7 @@ set_krb5_creds( /* find our default keytab */ if ((rc = krb5_kt_default(ctx, &kt))) { - slapi_log_error(SLAPI_LOG_ERR, logname, + slapi_log_err(SLAPI_LOG_ERR, logname, "Unable to get default keytab: %d (%s)\n", rc, error_message(rc)); goto cleanup; @@ -2081,13 +2081,13 @@ set_krb5_creds( /* get name of keytab for debugging purposes */ if ((rc = krb5_kt_get_name(ctx, kt, ktname, sizeof(ktname)))) { - slapi_log_error(SLAPI_LOG_ERR, logname, + slapi_log_err(SLAPI_LOG_ERR, logname, "Unable to get name of default keytab: %d (%s)\n", rc, error_message(rc)); goto cleanup; } - slapi_log_error(authtracelevel, logname, + slapi_log_err(authtracelevel, logname, "Using keytab named [%s]\n", ktname); /* now do the actual kerberos authentication using @@ -2095,7 +2095,7 @@ set_krb5_creds( rc = krb5_get_init_creds_keytab(ctx, &creds, princ, kt, 0, NULL, NULL); if (rc) { - slapi_log_error(SLAPI_LOG_ERR, logname, + slapi_log_err(SLAPI_LOG_ERR, logname, "Could not get initial credentials for principal [%s] " "in keytab [%s]: %d (%s)\n", princ_name, ktname, rc, error_message(rc)); @@ -2115,7 +2115,7 @@ set_krb5_creds( generates a new unique name and returns a memory cache with that name */ if ((rc = krb5_cc_new_unique(ctx, cc_type, NULL, &cc))) { - slapi_log_error(SLAPI_LOG_ERR, logname, + slapi_log_err(SLAPI_LOG_ERR, logname, "Could not create new unique memory ccache: " "%d (%s)\n", rc, error_message(rc)); @@ -2128,18 +2128,18 @@ set_krb5_creds( to create the ctx, so the address should be unique enough for our purposes */ if (!(cc_name = slapi_ch_smprintf("%s:%p", cc_type, ctx))) { - slapi_log_error(SLAPI_LOG_ERR, logname, + slapi_log_err(SLAPI_LOG_ERR, logname, "Could create Kerberos memory ccache: " "out of memory\n"); rc = 1; goto cleanup; } #endif - slapi_log_error(authtracelevel, logname, + slapi_log_err(authtracelevel, logname, "Generated new memory ccache [%s]\n", cc_name); new_ccache = 1; /* need to set this in env. */ } else { - slapi_log_error(authtracelevel, logname, + slapi_log_err(authtracelevel, logname, "Using existing ccache [%s]\n", cc_name); } @@ -2151,7 +2151,7 @@ set_krb5_creds( cc could already have been created by new_unique above */ if (!cc && (rc = krb5_cc_resolve(ctx, cc_name, &cc))) { - slapi_log_error(SLAPI_LOG_ERR, logname, + slapi_log_err(SLAPI_LOG_ERR, logname, "Could not create ccache [%s]: %d (%s)\n", cc_name, rc, error_message(rc)); goto cleanup; @@ -2159,7 +2159,7 @@ set_krb5_creds( /* wipe out previous contents of cache for this principal, if any */ if ((rc = krb5_cc_initialize(ctx, cc, princ))) { - slapi_log_error(SLAPI_LOG_ERR, logname, + slapi_log_err(SLAPI_LOG_ERR, logname, "Could not initialize ccache [%s] for the new " "credentials for principal [%s]: %d (%s)\n", cc_name, princ_name, rc, error_message(rc)); @@ -2168,7 +2168,7 @@ set_krb5_creds( /* store the credentials in the cache */ if ((rc = krb5_cc_store_cred(ctx, cc, &creds))) { - slapi_log_error(SLAPI_LOG_ERR, logname, + slapi_log_err(SLAPI_LOG_ERR, logname, "Could not store the credentials in the " "ccache [%s] for principal [%s]: %d (%s)\n", cc_name, princ_name, rc, error_message(rc)); @@ -2187,7 +2187,7 @@ set_krb5_creds( PR_snprintf(cc_env_name, sizeof(cc_env_name), "%s=%s", KRB5_ENV_CCNAME, cc_name); PR_SetEnv(cc_env_name); - slapi_log_error(authtracelevel, logname, + slapi_log_err(authtracelevel, logname, "Set new env for ccache: [%s]\n", cc_env_name); } @@ -2229,22 +2229,22 @@ clear_krb5_ccache(void) /* initialize the kerberos context */ if ((rc = krb5_init_context(&ctx))) { - slapi_log_error(SLAPI_LOG_ERR, "clear_krb5_ccache", "Could not initialize kerberos context: %d (%s)\n", + slapi_log_err(SLAPI_LOG_ERR, "clear_krb5_ccache", "Could not initialize kerberos context: %d (%s)\n", rc, error_message(rc)); goto done; } /* get the default ccache */ if ((rc = krb5_cc_default(ctx, &cc))) { - slapi_log_error(SLAPI_LOG_ERR, "clear_krb5_ccache", "Could not get default kerberos ccache: %d (%s)\n", + slapi_log_err(SLAPI_LOG_ERR, "clear_krb5_ccache", "Could not get default kerberos ccache: %d (%s)\n", rc, error_message(rc)); goto done; } /* destroy the ccache */ if((rc = krb5_cc_destroy(ctx, cc))){ - slapi_log_error(SLAPI_LOG_ERR, "clear_krb5_ccache", "Could not destroy kerberos ccache: %d (%s)\n", + slapi_log_err(SLAPI_LOG_ERR, "clear_krb5_ccache", "Could not destroy kerberos ccache: %d (%s)\n", rc, error_message(rc)); } else { - slapi_log_error(SLAPI_LOG_TRACE,"clear_krb5_ccache", "Successfully cleared kerberos ccache\n"); + slapi_log_err(SLAPI_LOG_TRACE,"clear_krb5_ccache", "Successfully cleared kerberos ccache\n"); } done: diff --git a/ldap/servers/slapd/libglobs.c b/ldap/servers/slapd/libglobs.c index d063540..df0c0b9 100644 --- a/ldap/servers/slapd/libglobs.c +++ b/ldap/servers/slapd/libglobs.c @@ -19,7 +19,6 @@ we define slapd_ldap_debug here, so we don't want to declare it in any header file which might conflict with our definition */ -#define DONT_DECLARE_SLAPD_LDAP_DEBUG /* see ldaplog.h */ #include "ldap.h" #include @@ -1434,14 +1433,14 @@ FrontendConfig_init(void) { #if SLAPI_CFG_USE_RWLOCK == 1 /* initialize the read/write configuration lock */ if ( (cfg->cfg_rwlock = slapi_new_rwlock()) == NULL ) { - LDAPDebug(LDAP_DEBUG_ERR, "FrontendConfig_init - " - "failed to initialize cfg_rwlock. Exiting now.",0,0,0); + slapi_log_err(SLAPI_LOG_EMERG, "FrontendConfig_init", + "Failed to initialize cfg_rwlock. Exiting now."); exit(-1); } #else if ((cfg->cfg_lock = PR_NewLock()) == NULL){ - LDAPDebug(LDAP_DEBUG_ERR, "FrontendConfig_init - " - "failed to initialize cfg_lock. Exiting now.",0,0,0); + slapi_log_err(SLAPI_LOG_EMERG, "FrontendConfig_init", + "Failed to initialize cfg_lock. Exiting now."); exit(-1); } #endif @@ -2037,7 +2036,7 @@ config_set_port( const char *attrname, char *port, char *errorbuf, int apply ) { } if ( nPort == 0 ) { - LDAPDebug(LDAP_DEBUG_NOTICE, "config_set_port - Information: Non-Secure Port Disabled\n", 0, 0, 0 ); + slapi_log_err(SLAPI_LOG_NOTICE, "config_set_port", "Non-Secure Port Disabled\n"); } if ( apply ) { @@ -7111,7 +7110,7 @@ config_set_allowed_to_delete_attrs( const char *attrname, char *value, cgas = (struct config_get_and_set *)PL_HashTableLookup(confighash, *s); if (!cgas && PL_strcasecmp(*s, "aci") /* aci is an exception */) { - slapi_log_error(SLAPI_LOG_ERR, "config_set_allowed_to_delete_attrs", + slapi_log_err(SLAPI_LOG_ERR, "config_set_allowed_to_delete_attrs", "%s: Unknown attribute %s will be ignored\n", CONFIG_ALLOWED_TO_DELETE_ATTRIBUTE, *s); charray_remove(allowed, *s, 1); @@ -7125,7 +7124,7 @@ config_set_allowed_to_delete_attrs( const char *attrname, char *value, /* reuse the duplicated string for the new attr value. */ if (allowed && (NULL == *allowed)) { /* all the values to allow to delete are invalid */ - slapi_log_error(SLAPI_LOG_ERR, "config_set_allowed_to_delete_attrs", + slapi_log_err(SLAPI_LOG_ERR, "config_set_allowed_to_delete_attrs", "%s: Given attributes are all invalid. No effects.\n", CONFIG_ALLOWED_TO_DELETE_ATTRIBUTE); slapi_ch_array_free(allowed); @@ -7181,10 +7180,10 @@ config_set_allowed_sasl_mechs(const char *attrname, char *value, char *errorbuf, remove_commas(value); if(invalid_sasl_mech(value)){ - LDAPDebug(LDAP_DEBUG_ERR,"config_set_allowed_sasl_mechs - " + slapi_log_err(SLAPI_LOG_ERR,"config_set_allowed_sasl_mechs", "Invalid value/character for sasl mechanism (%s). Use ASCII " "characters, upto 20 characters, that are upper-case letters, " - "digits, hyphens, or underscores\n", value, 0, 0); + "digits, hyphens, or underscores\n", value); return LDAP_UNWILLING_TO_PERFORM; } @@ -7579,7 +7578,7 @@ config_set(const char *attr, struct berval **values, char *errorbuf, int apply) debugHashTable(attr); #endif slapi_create_errormsg(errorbuf, SLAPI_DSE_RETURNTEXT_SIZE, "Unknown attribute %s will be ignored", attr); - slapi_log_error(SLAPI_LOG_ERR, "config_set", "Unknown attribute %s will be ignored", attr); + slapi_log_err(SLAPI_LOG_ERR, "config_set", "Unknown attribute %s will be ignored", attr); return LDAP_NO_SUCH_ATTRIBUTE; } @@ -7614,9 +7613,8 @@ config_set(const char *attr, struct berval **values, char *errorbuf, int apply) } else if (cgas->logsetfunc) { retval = (cgas->logsetfunc)(cgas->attr_name, initval, cgas->whichlog, errorbuf, apply); } else { - LDAPDebug1Arg(LDAP_DEBUG_ERR, - "config_set - The attribute %s is read only; " - "ignoring setting NULL value\n", attr); + slapi_log_err(SLAPI_LOG_ERR, "config_set", + "The attribute %s is read only; ignoring setting NULL value\n", attr); } } for (ii = 0; !retval && values && values[ii]; ++ii) @@ -7629,9 +7627,9 @@ config_set(const char *attr, struct berval **values, char *errorbuf, int apply) (char *)values[ii]->bv_val, cgas->whichlog, errorbuf, apply); } else { - LDAPDebug(LDAP_DEBUG_ERR, - "config_set - The attribute %s is read only; ignoring new value %s\n", - attr, values[ii]->bv_val, 0); + slapi_log_err(SLAPI_LOG_ERR, "config_set", + "The attribute %s is read only; ignoring new value %s\n", + attr, values[ii]->bv_val); } values[ii]->bv_len = strlen((char *)values[ii]->bv_val); } @@ -7955,7 +7953,7 @@ config_set_accesslog_enabled(int value) } CFG_ONOFF_UNLOCK_WRITE(slapdFrontendConfig); if (errorbuf[0] != '\0') { - slapi_log_error(SLAPI_LOG_ERR, "config_set_accesslog_enabled", "%s\n", errorbuf); + slapi_log_err(SLAPI_LOG_ERR, "config_set_accesslog_enabled", "%s\n", errorbuf); } } @@ -7974,7 +7972,7 @@ config_set_auditlog_enabled(int value){ } CFG_ONOFF_UNLOCK_WRITE(slapdFrontendConfig); if (errorbuf[0] != '\0') { - slapi_log_error(SLAPI_LOG_ERR, "config_set_auditlog_enabled", "%s\n", errorbuf); + slapi_log_err(SLAPI_LOG_ERR, "config_set_auditlog_enabled", "%s\n", errorbuf); } } @@ -7993,7 +7991,7 @@ config_set_auditfaillog_enabled(int value){ } CFG_ONOFF_UNLOCK_WRITE(slapdFrontendConfig); if (errorbuf[0] != '\0') { - slapi_log_error(SLAPI_LOG_ERR, "config_set_auditlog_enabled", "%s\n", errorbuf); + slapi_log_err(SLAPI_LOG_ERR, "config_set_auditlog_enabled", "%s\n", errorbuf); } } @@ -8084,7 +8082,7 @@ config_set_malloc_mxfast(const char *attrname, char *value, char *errorbuf, int if ((mxfast >= 0) && (mxfast <= max)) { mallopt(M_MXFAST, mxfast); } else if (DEFAULT_MALLOC_UNSET != mxfast) { - slapi_log_error(SLAPI_LOG_ERR, "config_set_malloc_mxfast", + slapi_log_err(SLAPI_LOG_ERR, "config_set_malloc_mxfast", "%s: Invalid value %d will be ignored\n", CONFIG_MALLOC_MXFAST, mxfast); } @@ -8126,7 +8124,7 @@ config_set_malloc_trim_threshold(const char *attrname, char *value, char *errorb if (trim_threshold >= -1) { mallopt(M_TRIM_THRESHOLD, trim_threshold); } else if (DEFAULT_MALLOC_UNSET != trim_threshold) { - slapi_log_error(SLAPI_LOG_ERR, "config_set_malloc_trim_threshold", + slapi_log_err(SLAPI_LOG_ERR, "config_set_malloc_trim_threshold", "%s: Invalid value %d will be ignored\n", CONFIG_MALLOC_TRIM_THRESHOLD, trim_threshold); } @@ -8175,7 +8173,7 @@ config_set_malloc_mmap_threshold(const char *attrname, char *value, char *errorb if ((mmap_threshold >= 0) && (mmap_threshold <= max)) { mallopt(M_MMAP_THRESHOLD, mmap_threshold); } else if (DEFAULT_MALLOC_UNSET != mmap_threshold) { - slapi_log_error(SLAPI_LOG_ERR, "config_set_malloc_mmap_threshold", + slapi_log_err(SLAPI_LOG_ERR, "config_set_malloc_mmap_threshold", "%s: Invalid value %d will be ignored\n", CONFIG_MALLOC_MMAP_THRESHOLD, mmap_threshold); } diff --git a/ldap/servers/slapd/localhost.c b/ldap/servers/slapd/localhost.c index 8903f53..f48fa49 100644 --- a/ldap/servers/slapd/localhost.c +++ b/ldap/servers/slapd/localhost.c @@ -64,31 +64,33 @@ find_localhost_DNS(void) if (gethostname (hostname, MAXHOSTNAMELEN)) { int oserr = errno; - LDAPDebug(LDAP_DEBUG_ERR, "find_localhost_DNS - gethostname() failed, error %d (%s)\n", - oserr, slapd_system_strerror( oserr ), 0 ); + slapi_log_err(SLAPI_LOG_ERR, "find_localhost_DNS", + "gethostname() failed, error %d (%s)\n", + oserr, slapd_system_strerror( oserr )); return NULL; } hp = GETHOSTBYNAME (hostname, &hent, hbuf, sizeof(hbuf), &err); if (hp == NULL) { int oserr = errno; - LDAPDebug(LDAP_DEBUG_ERR, + slapi_log_err(SLAPI_LOG_ERR, "find_localhost_DNS - gethostbyname(\"%s\") failed, error %d (%s)\n", hostname, oserr, slapd_system_strerror( oserr )); return NULL; } if (hp->h_name == NULL) { - LDAPDebug(LDAP_DEBUG_ERR, "find_localhost_DNS - gethostbyname(\"%s\")->h_name == NULL\n", hostname, 0, 0); + slapi_log_err(SLAPI_LOG_ERR, "find_localhost_DNS", + "gethostbyname(\"%s\")->h_name == NULL\n", hostname); return NULL; } if (strchr (hp->h_name, '.') != NULL) { - LDAPDebug(LDAP_DEBUG_CONFIG, "h_name == %s\n", hp->h_name, 0, 0); + slapi_log_err(SLAPI_LOG_CONFIG, "find_localhost_DNS", "h_name == %s\n", hp->h_name); return slapi_ch_strdup (hp->h_name); } else if (hp->h_aliases != NULL) { for (alias = hp->h_aliases; *alias != NULL; ++alias) { if (strchr (*alias, '.') != NULL && strncmp (*alias, hp->h_name, strlen (hp->h_name))) { - LDAPDebug(LDAP_DEBUG_CONFIG, "find_localhost_DNS - h_alias == %s\n", *alias, 0, 0); + slapi_log_err(SLAPI_LOG_CONFIG, "find_localhost_DNS", "h_alias == %s\n", *alias); return slapi_ch_strdup (*alias); } } @@ -100,7 +102,7 @@ find_localhost_DNS(void) if (f != NULL) { while (fgets (line, sizeof(line), f)) { if (strncasecmp (line, "domain", 6) == 0 && isspace (line[6])) { - LDAPDebug(LDAP_DEBUG_CONFIG, "find_localhost_DNS - %s: %s\n", _PATH_RESCONF, line, 0); + slapi_log_err(SLAPI_LOG_CONFIG, "find_localhost_DNS", "%s: %s\n", _PATH_RESCONF, line); for (cp = &line[7]; *cp && isspace(*cp); ++cp); if (*cp) { domain = cp; @@ -120,9 +122,9 @@ find_localhost_DNS(void) /* No domain found. Try getdomainname. */ line[0] = '\0'; if (getdomainname(line, sizeof(line)) < 0) { /* failure */ - slapi_log_error(SLAPI_LOG_ERR, "find_localhost_DNS", "getdomainname failed\n"); + slapi_log_err(SLAPI_LOG_ERR, "find_localhost_DNS", "getdomainname failed\n"); } else { - slapi_log_error(SLAPI_LOG_CONFIG, "find_localhost_DNS", "getdomainname(%s)\n", line); + slapi_log_err(SLAPI_LOG_CONFIG, "find_localhost_DNS", "getdomainname(%s)\n", line); } if (line[0] != '\0') { domain = &line[0]; @@ -138,7 +140,7 @@ find_localhost_DNS(void) PL_strcatn (hostname, sizeof(hostname), "."); PL_strcatn (hostname, sizeof(hostname), domain); } - LDAPDebug(LDAP_DEBUG_CONFIG, "find_localhost_DNS - hostname == %s\n", hostname, 0, 0); + slapi_log_err(SLAPI_LOG_CONFIG, "find_localhost_DNS", "hostname == %s\n", hostname); return slapi_ch_strdup (hostname); } @@ -192,7 +194,8 @@ set_localhost_DN(void) if (localhost_DNS != NULL) { localhost_DN = convert_DNS_to_DN (localhost_DNS); - LDAPDebug(LDAP_DEBUG_CONFIG, "set_localhost_DN - DNS %s -> DN %s\n", localhost_DNS, localhost_DN, 0); + slapi_log_err(SLAPI_LOG_CONFIG, "set_localhost_DN", + "DNS %s -> DN %s\n", localhost_DNS, localhost_DN); } slapi_ch_free_string(&localhost_DNS); } @@ -224,8 +227,8 @@ get_config_DN() if ( host ) c = slapi_ch_malloc (20 + strlen (host)); else { - LDAPDebug(LDAP_DEBUG_CONFIG, "get_config_DN - get_locahost_DN() returned \"\"\n", - 0, 0, 0); + slapi_log_err(SLAPI_LOG_CONFIG, "get_config_DN", + "Get_locahost_DN() returned \"\"\n"); c = slapi_ch_malloc (20); } sprintf (c, "cn=ldap://%s:%d", host ? host : "", config_get_port()); diff --git a/ldap/servers/slapd/lock.c b/ldap/servers/slapd/lock.c index 925a2a5..bc6ecc3 100644 --- a/ldap/servers/slapd/lock.c +++ b/ldap/servers/slapd/lock.c @@ -33,7 +33,7 @@ lock_fopen( char *fname, char *type, FILE **lfp ) /* open the lock file */ PR_snprintf( buf, MAXPATHLEN, "%s%s", fname, ".lock" ); if ( (*lfp = fopen( buf, "w" )) == NULL ) { - LDAPDebug(LDAP_DEBUG_ERR, "lock_fopen - Could not open \"%s\"\n", buf, 0, 0 ); + slapi_log_err(SLAPI_LOG_ERR, "lock_fopen - Could not open \"%s\"\n", buf, 0, 0 ); return( NULL ); } @@ -48,7 +48,7 @@ lock_fopen( char *fname, char *type, FILE **lfp ) /* open the log file */ if ( (fp = fopen( fname, type )) == NULL ) { - LDAPDebug(LDAP_DEBUG_ERR, "lock_fopen - Could not open \"%s\"\n", fname, 0, 0 ); + slapi_log_err(SLAPI_LOG_ERR, "lock_fopen - Could not open \"%s\"\n", fname, 0, 0 ); #ifdef USE_LOCKF lockf( fileno( *lfp ), F_ULOCK, 0 ); #else diff --git a/ldap/servers/slapd/log.c b/ldap/servers/slapd/log.c index 880233f..9838bd3 100644 --- a/ldap/servers/slapd/log.c +++ b/ldap/servers/slapd/log.c @@ -41,6 +41,8 @@ static struct logging_opts loginfo; static int detached=0; static int logging_hr_timestamps_enabled = 1; +//extern int slapd_ldap_debug; + /* * Note: the order of the values in the slapi_log_map array must exactly * match that of the SLAPI_LOG_XXX #defines found in slapi-plugin.h (this is @@ -152,6 +154,13 @@ get_syslog_loglevel(int loglevel) return default_level; } +int loglevel_is_set( int level ) +{ + return (0 != (slapd_ldap_debug & level)); +} + + + static int slapd_log_error_proc_internal( int loglevel, @@ -524,7 +533,7 @@ log_update_accesslogdir(char *pathname, int apply) /* try to open the file, we may have a incorrect path */ if (! LOG_OPEN_APPEND(fp, pathname, loginfo.log_access_mode)) { - LDAPDebug(LDAP_DEBUG_WARNING, "log_update_accesslogdir - Can't open file %s. " + slapi_log_err(SLAPI_LOG_WARNING, "log_update_accesslogdir - Can't open file %s. " "errno %d (%s)\n", pathname, errno, slapd_system_strerror(errno)); /* stay with the current log file */ @@ -545,7 +554,7 @@ log_update_accesslogdir(char *pathname, int apply) if (loginfo.log_access_fdes) { LogFileInfo *logp, *d_logp; - LDAPDebug(LDAP_DEBUG_TRACE, + slapi_log_err(SLAPI_LOG_TRACE, "LOGINFO:Closing the access log file. " "Moving to a new access log file (%s)\n", pathname,0,0); @@ -679,7 +688,7 @@ log_update_auditlogdir(char *pathname, int apply) /* try to open the file, we may have a incorrect path */ if (! LOG_OPEN_APPEND(fp, pathname, loginfo.log_audit_mode)) { - LDAPDebug(LDAP_DEBUG_WARNING, "log_update_auditlogdir - Can't open file %s. " + slapi_log_err(SLAPI_LOG_WARNING, "log_update_auditlogdir - Can't open file %s. " "errno %d (%s)\n", pathname, errno, slapd_system_strerror(errno)); /* stay with the current log file */ @@ -699,7 +708,7 @@ log_update_auditlogdir(char *pathname, int apply) LOG_AUDIT_LOCK_WRITE (); if (loginfo.log_audit_fdes) { LogFileInfo *logp, *d_logp; - LDAPDebug(LDAP_DEBUG_TRACE, + slapi_log_err(SLAPI_LOG_TRACE, "LOGINFO:Closing the audit log file. " "Moving to a new audit file (%s)\n", pathname,0,0); @@ -757,7 +766,7 @@ log_update_auditfaillogdir(char *pathname, int apply) /* try to open the file, we may have a incorrect path */ if (! LOG_OPEN_APPEND(fp, pathname, loginfo.log_auditfail_mode)) { - LDAPDebug(LDAP_DEBUG_WARNING, "log_update_auditfaillogdir - Can't open file %s. " + slapi_log_err(SLAPI_LOG_WARNING, "log_update_auditfaillogdir - Can't open file %s. " "errno %d (%s)\n", pathname, errno, slapd_system_strerror(errno)); /* stay with the current log file */ @@ -777,7 +786,7 @@ log_update_auditfaillogdir(char *pathname, int apply) LOG_AUDITFAIL_LOCK_WRITE (); if (loginfo.log_auditfail_fdes) { LogFileInfo *logp, *d_logp; - LDAPDebug(LDAP_DEBUG_TRACE, + slapi_log_err(SLAPI_LOG_TRACE, "LOGINFO:Closing the auditfail log file. " "Moving to a new auditfail file (%s)\n", pathname,0,0); @@ -930,8 +939,8 @@ log_set_numlogsperdir(const char *attrname, char *numlogs_str, int logtype, char break; default: rv = LDAP_OPERATIONS_ERROR; - LDAPDebug(LDAP_DEBUG_ERR, - "log_set_numlogsperdir - Invalid log type %d", logtype,0,0 ); + slapi_log_err(SLAPI_LOG_ERR, "log_set_numlogsperdir", + "Invalid log type %d", logtype); } } return rv; @@ -1026,12 +1035,12 @@ log_set_logsize(const char *attrname, char *logsize_str, int logtype, char *retu } /* logsize is in MB */ if (rv == 2) { - LDAPDebug(LDAP_DEBUG_ERR, - "log_set_logsize - Invalid value for Maximum log size:" - "Maxlogsize:%d (MB) exceeds Maxdisksize:%d (MB)\n", - logsize, mdiskspace/LOG_MB_IN_BYTES,0); + slapi_log_err(SLAPI_LOG_ERR, "log_set_logsize", + "Invalid value for Maximum log size:" + "Maxlogsize:%d (MB) exceeds Maxdisksize:%ld (MB)\n", + logsize, (long int)(mdiskspace/LOG_MB_IN_BYTES)); - rv = LDAP_OPERATIONS_ERROR; + rv = LDAP_OPERATIONS_ERROR; } return rv; } @@ -2063,9 +2072,8 @@ slapd_log_audit_internal ( if (log__needrotation(loginfo.log_audit_fdes, SLAPD_AUDIT_LOG) == LOG_ROTATE) { if (log__open_auditlogfile(LOGFILE_NEW, 1) != LOG_SUCCESS) { - LDAPDebug(LDAP_DEBUG_ERR, - "slapd_log_audit_internal - Unable to open audit file:%s\n", - loginfo.log_audit_file,0,0); + slapi_log_err(SLAPI_LOG_ERR, "slapd_log_audit_internal", + "Unable to open audit file:%s\n", loginfo.log_audit_file); LOG_AUDIT_UNLOCK_WRITE(); return 0; } @@ -2122,9 +2130,8 @@ slapd_log_auditfail_internal ( if (log__needrotation(loginfo.log_auditfail_fdes, SLAPD_AUDITFAIL_LOG) == LOG_ROTATE) { if (log__open_auditfaillogfile(LOGFILE_NEW, 1) != LOG_SUCCESS) { - LDAPDebug(LDAP_DEBUG_ERR, - "slapd_log_auditfail_internal - Unable to open auditfail file:%s\n", - loginfo.log_auditfail_file,0,0); + slapi_log_err(SLAPI_LOG_ERR, "slapd_log_auditfail_internal", + "Unable to open auditfail file:%s\n", loginfo.log_auditfail_file); LOG_AUDITFAIL_UNLOCK_WRITE(); return 0; } @@ -2420,7 +2427,7 @@ vslapd_log_error( * severity - LOG_ERR, LOG_WARNING, LOG_INFO, etc */ int -slapi_log_err( int loglevel, char *subsystem, char *fmt, ... ) +slapi_log_error( int loglevel, char *subsystem, char *fmt, ... ) { va_list ap_err; va_list ap_file; @@ -2429,7 +2436,7 @@ slapi_log_err( int loglevel, char *subsystem, char *fmt, ... ) if ( loglevel < SLAPI_LOG_MIN || loglevel > SLAPI_LOG_MAX ) { (void)slapd_log_error_proc(loglevel, subsystem, - "slapi_log_error: invalid log level %d (message %s)\n", + "slapi_log_err: invalid log level %d (message %s)\n", loglevel, fmt ); return( -1 ); } @@ -2727,7 +2734,7 @@ log__open_accesslogfile(int logfile_state, int locked) int oserr = errno; loginfo.log_access_fdes = NULL; if (!locked) LOG_ACCESS_UNLOCK_WRITE(); - LDAPDebug(LDAP_DEBUG_ERR, "log__open_accesslogfile - Access file open %s failed errno %d (%s)\n", + slapi_log_err(SLAPI_LOG_ERR, "log__open_accesslogfile", "Access file open %s failed errno %d (%s)\n", loginfo.log_access_file, oserr, slapd_system_strerror(oserr)); return LOG_UNABLE_TO_OPENFILE; } @@ -2744,7 +2751,7 @@ log__open_accesslogfile(int logfile_state, int locked) if (! LOG_OPEN_WRITE(fpinfo, loginfo.log_accessinfo_file, loginfo.log_access_mode)) { int oserr = errno; if (!locked) LOG_ACCESS_UNLOCK_WRITE(); - LDAPDebug(LDAP_DEBUG_ERR, "log__open_accesslogfile - accessinfo file open %s failed errno %d (%s)\n", + slapi_log_err(SLAPI_LOG_ERR, "log__open_accesslogfile", "accessinfo file open %s failed errno %d (%s)\n", loginfo.log_accessinfo_file, oserr, slapd_system_strerror(oserr)); return LOG_UNABLE_TO_OPENFILE; @@ -2897,14 +2904,14 @@ log_rotate: if (logtype!=SLAPD_ERROR_LOG) { if (type == LOG_SIZE_EXCEEDED) { - LDAPDebug(LDAP_DEBUG_TRACE, - "LOGINFO:End of Log because size exceeded(Max:%" - NSPRI64 "d bytes) (Is:%" NSPRI64 "d bytes)\n", - maxlogsize, f_size, 0); + slapi_log_err(SLAPI_LOG_TRACE, "log__needrotation", + "LOGINFO:End of Log because size exceeded(Max:%" + NSPRI64 "d bytes) (Is:%" NSPRI64 "d bytes)\n", + maxlogsize, f_size); } else if ( type == LOG_EXPIRED) { - LDAPDebug(LDAP_DEBUG_TRACE, - "LOGINFO:End of Log because time exceeded(Max:%d secs) (Is:%ld secs)\n", - rotationtime_secs, curr_time - log_createtime,0); + slapi_log_err(SLAPI_LOG_TRACE, "log__needrotation", + "LOGINFO:End of Log because time exceeded(Max:%d secs) (Is:%ld secs)\n", + rotationtime_secs, curr_time - log_createtime); } } return (type == LOG_CONTINUE) ? LOG_CONTINUE : LOG_ROTATE; @@ -2945,10 +2952,12 @@ log__delete_access_logfile(void) if (PR_Delete(buffer) != PR_SUCCESS) { PRErrorCode prerr = PR_GetError(); if (PR_FILE_NOT_FOUND_ERROR == prerr) { - slapi_log_error(SLAPI_LOG_TRACE, "LOGINFO", "File %s already removed\n", loginfo.log_access_file); + slapi_log_err(SLAPI_LOG_TRACE, "log__delete_access_logfile", + "File %s already removed\n", loginfo.log_access_file); } else { - slapi_log_error(SLAPI_LOG_TRACE, "LOGINFO", "Unable to remove file:%s error %d (%s)\n", - loginfo.log_access_file, prerr, slapd_pr_strerror(prerr)); + slapi_log_err(SLAPI_LOG_TRACE, "log__delete_access_logfile", + "Unable to remove file:%s error %d (%s)\n", + loginfo.log_access_file, prerr, slapd_pr_strerror(prerr)); } } @@ -2957,10 +2966,12 @@ log__delete_access_logfile(void) if (PR_Delete(buffer) != PR_SUCCESS) { PRErrorCode prerr = PR_GetError(); if (PR_FILE_NOT_FOUND_ERROR == prerr) { - slapi_log_error(SLAPI_LOG_TRACE, "LOGINFO", "File %s already removed\n", loginfo.log_access_file); + slapi_log_err(SLAPI_LOG_TRACE, "log__delete_access_logfile", + "File %s already removed\n", loginfo.log_access_file); } else { - slapi_log_error(SLAPI_LOG_TRACE, "LOGINFO", "Unable to remove file:%s.rotationinfo error %d (%s)\n", - loginfo.log_access_file, prerr, slapd_pr_strerror(prerr)); + slapi_log_err(SLAPI_LOG_TRACE, "log__delete_access_logfile", + "Unable to remove file:%s.rotationinfo error %d (%s)\n", + loginfo.log_access_file, prerr, slapd_pr_strerror(prerr)); } } return 0; @@ -3065,13 +3076,16 @@ delete_logfile: if (PR_Delete(buffer) != PR_SUCCESS) { PRErrorCode prerr = PR_GetError(); if (PR_FILE_NOT_FOUND_ERROR == prerr) { - slapi_log_error(SLAPI_LOG_TRACE, "LOGINFO", "File %s already removed\n", loginfo.log_access_file); + slapi_log_err(SLAPI_LOG_TRACE,"log__delete_access_logfile", + "File %s already removed\n", loginfo.log_access_file); } else { - slapi_log_error(SLAPI_LOG_TRACE, "LOGINFO", "Unable to remove file:%s.%s error %d (%s)\n", - loginfo.log_access_file, tbuf, prerr, slapd_pr_strerror(prerr)); + slapi_log_err(SLAPI_LOG_TRACE, "log__delete_access_logfile", + "Unable to remove file:%s.%s error %d (%s)\n", + loginfo.log_access_file, tbuf, prerr, slapd_pr_strerror(prerr)); } } else { - slapi_log_error(SLAPI_LOG_TRACE, "LOGINFO", "Removed file:%s.%s because of (%s)\n", loginfo.log_access_file, tbuf, logstr); + slapi_log_err(SLAPI_LOG_TRACE, "log__delete_access_logfile", + "Removed file:%s.%s because of (%s)\n", loginfo.log_access_file, tbuf, logstr); } slapi_ch_free((void**)&delete_logp); loginfo.log_numof_access_logs--; @@ -3101,7 +3115,8 @@ log__delete_rotated_logs() log_convert_time (logp->l_ctime, tbuf, 1); PR_snprintf (buffer, sizeof(buffer), "%s.%s", loginfo.log_access_file, tbuf); - LDAPDebug(LDAP_DEBUG_ERR,"log__delete_rotated_logs - Deleted Rotated Log: %s\n",buffer,0,0); + slapi_log_err(SLAPI_LOG_ERR,"log__delete_rotated_logs", + "Deleted Rotated Log: %s\n",buffer); if (PR_Delete(buffer) != PR_SUCCESS) { logp = logp->l_next; @@ -3697,12 +3712,12 @@ log__delete_error_logfile(int locked) PR_snprintf (buffer, sizeof(buffer), "%s", loginfo.log_error_file); if (PR_Delete(buffer) != PR_SUCCESS) { if (!locked) { - /* If locked, we should not call LDAPDebug, which tries to get a lock internally. */ + /* If locked, we should not call slapi_log_err, which tries to get a lock internally. */ PRErrorCode prerr = PR_GetError(); if (PR_FILE_NOT_FOUND_ERROR == prerr) { - slapi_log_error(SLAPI_LOG_TRACE, "LOGINFO", "File %s already removed\n", loginfo.log_error_file); + slapi_log_err(SLAPI_LOG_TRACE, "log__delete_error_logfile", "File %s already removed\n", loginfo.log_error_file); } else { - slapi_log_error(SLAPI_LOG_TRACE, "LOGINFO", "Unable to remove file:%s error %d (%s)\n", + slapi_log_err(SLAPI_LOG_TRACE, "log__delete_error_logfile", "Unable to remove file:%s error %d (%s)\n", loginfo.log_error_file, prerr, slapd_pr_strerror(prerr)); } } @@ -3712,12 +3727,12 @@ log__delete_error_logfile(int locked) PR_snprintf (buffer, sizeof(buffer), "%s.rotationinfo", loginfo.log_error_file); if (PR_Delete(buffer) != PR_SUCCESS) { if (!locked) { - /* If locked, we should not call LDAPDebug, which tries to get a lock internally. */ + /* If locked, we should not call slapi_log_err, which tries to get a lock internally. */ PRErrorCode prerr = PR_GetError(); if (PR_FILE_NOT_FOUND_ERROR == prerr) { - slapi_log_error(SLAPI_LOG_TRACE, "LOGINFO", "File %s already removed\n", loginfo.log_error_file); + slapi_log_err(SLAPI_LOG_TRACE, "log__delete_error_logfile", "File %s already removed\n", loginfo.log_error_file); } else { - slapi_log_error(SLAPI_LOG_TRACE, "LOGINFO", "Unable to remove file:%s.rotationinfo error %d (%s)\n", + slapi_log_err(SLAPI_LOG_TRACE, "log__delete_error_logfile", "Unable to remove file:%s.rotationinfo error %d (%s)\n", loginfo.log_error_file, prerr, slapd_pr_strerror(prerr)); } } @@ -3812,9 +3827,9 @@ delete_logfile: memset(tbuf, 0, sizeof(tbuf)); log_convert_time (delete_logp->l_ctime, tbuf, 1 /*short */); if (!locked) { - /* if locked, we should not call LDAPDebug, + /* if locked, we should not call slapi_log_err, which tries to get a lock internally. */ - LDAPDebug(LDAP_DEBUG_TRACE, + slapi_log_err(SLAPI_LOG_TRACE, "LOGINFO:Removing file:%s.%s because of (%s)\n", loginfo.log_error_file, tbuf, logstr); @@ -3877,9 +3892,9 @@ log__delete_audit_logfile(void) if (PR_Delete(buffer) != PR_SUCCESS) { PRErrorCode prerr = PR_GetError(); if (PR_FILE_NOT_FOUND_ERROR == prerr) { - slapi_log_error(SLAPI_LOG_TRACE, "LOGINFO", "File %s already removed\n", loginfo.log_audit_file); + slapi_log_err(SLAPI_LOG_TRACE, "log__delete_audit_logfile", "File %s already removed\n", loginfo.log_audit_file); } else { - slapi_log_error(SLAPI_LOG_TRACE, "LOGINFO", "Unable to remove file:%s error %d (%s)\n", + slapi_log_err(SLAPI_LOG_TRACE, "log__delete_audit_logfile", "Unable to remove file:%s error %d (%s)\n", loginfo.log_audit_file, prerr, slapd_pr_strerror(prerr)); } } @@ -3889,9 +3904,9 @@ log__delete_audit_logfile(void) if (PR_Delete(buffer) != PR_SUCCESS) { PRErrorCode prerr = PR_GetError(); if (PR_FILE_NOT_FOUND_ERROR == prerr) { - slapi_log_error(SLAPI_LOG_TRACE, "LOGINFO", "File %s already removed\n", loginfo.log_audit_file); + slapi_log_err(SLAPI_LOG_TRACE, "log__delete_audit_logfile", "File %s already removed\n", loginfo.log_audit_file); } else { - slapi_log_error(SLAPI_LOG_TRACE, "LOGINFO", "Unable to remove file:%s.rotatoininfo error %d (%s)\n", + slapi_log_err(SLAPI_LOG_TRACE, "log__delete_audit_logfile", "Unable to remove file:%s.rotatoininfo error %d (%s)\n", loginfo.log_audit_file, prerr, slapd_pr_strerror(prerr)); } } @@ -3996,13 +4011,13 @@ delete_logfile: if (PR_Delete(buffer) != PR_SUCCESS) { PRErrorCode prerr = PR_GetError(); if (PR_FILE_NOT_FOUND_ERROR == prerr) { - slapi_log_error(SLAPI_LOG_TRACE, "LOGINFO", "File %s already removed\n", loginfo.log_audit_file); + slapi_log_err(SLAPI_LOG_TRACE, "log__delete_audit_logfile", "File %s already removed\n", loginfo.log_audit_file); } else { - slapi_log_error(SLAPI_LOG_TRACE, "LOGINFO", "Unable to remove file:%s.%s error %d (%s)\n", + slapi_log_err(SLAPI_LOG_TRACE, "log__delete_audit_logfile", "Unable to remove file:%s.%s error %d (%s)\n", loginfo.log_audit_file, tbuf, prerr, slapd_pr_strerror(prerr)); } } else { - slapi_log_error(SLAPI_LOG_TRACE, "LOGINFO", "Removed file:%s.%s because of (%s)\n", loginfo.log_audit_file, tbuf, logstr); + slapi_log_err(SLAPI_LOG_TRACE, "log__delete_audit_logfile", "Removed file:%s.%s because of (%s)\n", loginfo.log_audit_file, tbuf, logstr); } slapi_ch_free((void**)&delete_logp); loginfo.log_numof_audit_logs--; @@ -4044,9 +4059,9 @@ log__delete_auditfail_logfile(void) if (PR_Delete(buffer) != PR_SUCCESS) { PRErrorCode prerr = PR_GetError(); if (PR_FILE_NOT_FOUND_ERROR == prerr) { - slapi_log_error(SLAPI_LOG_TRACE, "LOGINFO", "File %s already removed\n", loginfo.log_auditfail_file); + slapi_log_err(SLAPI_LOG_TRACE, "log__delete_auditfail_logfile", "File %s already removed\n", loginfo.log_auditfail_file); } else { - slapi_log_error(SLAPI_LOG_TRACE, "LOGINFO", "Unable to remove file:%s error %d (%s)\n", + slapi_log_err(SLAPI_LOG_TRACE, "log__delete_auditfail_logfile", "Unable to remove file:%s error %d (%s)\n", loginfo.log_auditfail_file, prerr, slapd_pr_strerror(prerr)); } } @@ -4056,9 +4071,9 @@ log__delete_auditfail_logfile(void) if (PR_Delete(buffer) != PR_SUCCESS) { PRErrorCode prerr = PR_GetError(); if (PR_FILE_NOT_FOUND_ERROR == prerr) { - slapi_log_error(SLAPI_LOG_TRACE, "LOGINFO", "File %s already removed\n", loginfo.log_auditfail_file); + slapi_log_err(SLAPI_LOG_TRACE, "log__delete_auditfail_logfile", "File %s already removed\n", loginfo.log_auditfail_file); } else { - slapi_log_error(SLAPI_LOG_TRACE, "LOGINFO", "Unable to remove file:%s.rotatoininfo error %d (%s)\n", + slapi_log_err(SLAPI_LOG_TRACE, "log__delete_auditfail_logfile", "Unable to remove file:%s.rotatoininfo error %d (%s)\n", loginfo.log_auditfail_file, prerr, slapd_pr_strerror(prerr)); } } @@ -4163,13 +4178,13 @@ delete_logfile: if (PR_Delete(buffer) != PR_SUCCESS) { PRErrorCode prerr = PR_GetError(); if (PR_FILE_NOT_FOUND_ERROR == prerr) { - slapi_log_error(SLAPI_LOG_TRACE, "LOGINFO", "File %s already removed\n", loginfo.log_auditfail_file); + slapi_log_err(SLAPI_LOG_TRACE, "log__delete_auditfail_logfile", "File %s already removed\n", loginfo.log_auditfail_file); } else { - slapi_log_error(SLAPI_LOG_TRACE, "LOGINFO", "Unable to remove file:%s.%s error %d (%s)\n", + slapi_log_err(SLAPI_LOG_TRACE, "log__delete_auditfail_logfile", "Unable to remove file:%s.%s error %d (%s)\n", loginfo.log_auditfail_file, tbuf, prerr, slapd_pr_strerror(prerr)); } } else { - slapi_log_error(SLAPI_LOG_TRACE, "LOGINFO", "Removed file:%s.%s because of (%s)\n", loginfo.log_auditfail_file, tbuf, logstr); + slapi_log_err(SLAPI_LOG_TRACE, "log__delete_auditfail_logfile", "Removed file:%s.%s because of (%s)\n", loginfo.log_auditfail_file, tbuf, logstr); } slapi_ch_free((void**)&delete_logp); loginfo.log_numof_auditfail_logs--; @@ -4710,9 +4725,9 @@ log__open_auditlogfile(int logfile_state, int locked) /* open a new log file */ if (! LOG_OPEN_APPEND(fp, loginfo.log_audit_file, loginfo.log_audit_mode)) { - LDAPDebug(LDAP_DEBUG_ERR, "log__open_auditlogfile - can't open file %s. " - "errno %d (%s)\n", - loginfo.log_audit_file, errno, slapd_system_strerror(errno)); + slapi_log_err(SLAPI_LOG_ERR, "log__open_auditlogfile", + "can't open file %s - errno %d (%s)\n", + loginfo.log_audit_file, errno, slapd_system_strerror(errno)); if (!locked) LOG_AUDIT_UNLOCK_WRITE(); /*if I have an old log file -- I should log a message ** that I can't open the new file. Let the caller worry @@ -4731,9 +4746,9 @@ log__open_auditlogfile(int logfile_state, int locked) loginfo.log_audit_state |= LOGGING_NEED_TITLE; if (! LOG_OPEN_WRITE(fpinfo, loginfo.log_auditinfo_file, loginfo.log_audit_mode)) { - LDAPDebug(LDAP_DEBUG_ERR, "WARNING: can't open file %s. " - "errno %d (%s)\n", - loginfo.log_auditinfo_file, errno, slapd_system_strerror(errno)); + slapi_log_err(SLAPI_LOG_ERR, "log__open_auditlogfile", + "Can't open file %s - errno %d (%s)\n", + loginfo.log_auditinfo_file, errno, slapd_system_strerror(errno)); if (!locked) LOG_AUDIT_UNLOCK_WRITE(); return LOG_UNABLE_TO_OPENFILE; } @@ -4836,9 +4851,9 @@ log__open_auditfaillogfile(int logfile_state, int locked) /* open a new log file */ if (! LOG_OPEN_APPEND(fp, loginfo.log_auditfail_file, loginfo.log_auditfail_mode)) { - LDAPDebug(LDAP_DEBUG_ERR, "log__open_auditlogfile - Can't open file %s. " - "errno %d (%s)\n", - loginfo.log_auditfail_file, errno, slapd_system_strerror(errno)); + slapi_log_err(SLAPI_LOG_ERR, "log__open_auditfaillogfile", + "Can't open file %s - errno %d (%s)\n", + loginfo.log_auditfail_file, errno, slapd_system_strerror(errno)); if (!locked) LOG_AUDITFAIL_UNLOCK_WRITE(); /*if I have an old log file -- I should log a message ** that I can't open the new file. Let the caller worry @@ -4857,9 +4872,9 @@ log__open_auditfaillogfile(int logfile_state, int locked) loginfo.log_auditfail_state |= LOGGING_NEED_TITLE; if (! LOG_OPEN_WRITE(fpinfo, loginfo.log_auditfailinfo_file, loginfo.log_auditfail_mode)) { - LDAPDebug(LDAP_DEBUG_ERR, "log__open_auditlogfile - Can't open file %s. " - "errno %d (%s)\n", - loginfo.log_auditfailinfo_file, errno, slapd_system_strerror(errno)); + slapi_log_err(SLAPI_LOG_ERR, "log__open_auditfaillogfile", + "Can't open file %s - errno %d (%s)\n", + loginfo.log_auditfailinfo_file, errno, slapd_system_strerror(errno)); if (!locked) LOG_AUDITFAIL_UNLOCK_WRITE(); return LOG_UNABLE_TO_OPENFILE; } @@ -5004,9 +5019,9 @@ static void log_flush_buffer(LogBufferInfo *lbi, int type, int sync_now) if (log__needrotation(loginfo.log_access_fdes, SLAPD_ACCESS_LOG) == LOG_ROTATE) { if (log__open_accesslogfile(LOGFILE_NEW, 1) != LOG_SUCCESS) { - LDAPDebug(LDAP_DEBUG_ERR, - "log_flush_buffer - Unable to open access file:%s\n", - loginfo.log_access_file,0,0); + slapi_log_err(SLAPI_LOG_ERR, + "log_flush_buffer", "Unable to open access file:%s\n", + loginfo.log_access_file); lbi->current = lbi->top; /* reset counter to prevent overwriting rest of lbi struct */ return; } diff --git a/ldap/servers/slapd/main.c b/ldap/servers/slapd/main.c index b9ec6b7..7d5bc24 100644 --- a/ldap/servers/slapd/main.c +++ b/ldap/servers/slapd/main.c @@ -94,11 +94,11 @@ static int init_cmd_shutdown_detect(void) int rc; sigset_t proc_mask; - LDAPDebug(LDAP_DEBUG_TRACE, "Reseting signal mask....\n", 0, 0, 0); + slapi_log_err(SLAPI_LOG_TRACE, "init_cmd_shutdown_detect", "Reseting signal mask...\n"); (void)sigemptyset( &proc_mask ); rc = pthread_sigmask( SIG_SETMASK, &proc_mask, NULL ); - LDAPDebug(LDAP_DEBUG_TRACE, " %s \n", - rc ? "Failed to reset signal mask":"....Done (signal mask reset)!!", 0, 0 ); + slapi_log_err(SLAPI_LOG_TRACE, "init_cmd_shutdown_detect", "%s\n", + rc ? "Failed to reset signal mask":"...Done (signal mask reset)!!"); } #if defined ( HPUX10 ) @@ -182,14 +182,15 @@ chown_dir_files(char *name, struct passwd *pw, PRBool strip_fn, PRBool both) { if((ptr=strrchr(log,'/'))==NULL) { - LDAPDebug(LDAP_DEBUG_ERR, "Caution changing ownership of ./%s \n",name,0,0); + slapi_log_err(SLAPI_LOG_ERR, "chown_dir_files", "Caution changing ownership of ./%s \n",name); if(slapd_chown_if_not_owner(log, pw->pw_uid, -1 )){ - LDAPDebug(LDAP_DEBUG_ERR, "chown_dir_files: file (%s) chown failed (%d) %s.\n", + slapi_log_err(SLAPI_LOG_ERR, "chown_dir_files", "file (%s) chown failed (%d) %s.\n", log, errno, slapd_system_strerror(errno)); } rc=1; } else if(log==ptr) { - LDAPDebug(LDAP_DEBUG_ERR, "Caution changing ownership of / directory and its contents to %s\n",pw->pw_name,0,0); + slapi_log_err(SLAPI_LOG_ERR, "chown_dir_files", + "Caution changing ownership of / directory and its contents to %s\n",pw->pw_name); *(++ptr)='\0'; } else { *ptr='\0'; @@ -207,7 +208,7 @@ chown_dir_files(char *name, struct passwd *pw, PRBool strip_fn, PRBool both) gid = -1; } if(slapd_chown_if_not_owner( file, pw->pw_uid, gid )){ - LDAPDebug(LDAP_DEBUG_ERR, "chown_dir_files: file (%s) chown failed (%d) %s.\n", + slapi_log_err(SLAPI_LOG_ERR, "chown_dir_files", "file (%s) chown failed (%d) %s.\n", file, errno, slapd_system_strerror(errno)); } } @@ -228,19 +229,17 @@ fix_ownership(void) slapdFrontendConfig_t *slapdFrontendConfig = getFrontendConfig(); if (slapdFrontendConfig->localuser == NULL) { - LDAPDebug(LDAP_DEBUG_ERR, - "Local user missing from frontend configuration\n", - 0, 0, 0); + slapi_log_err(SLAPI_LOG_ERR, "fix_ownership", + "Local user missing from frontend configuration\n"); return; } if (slapdFrontendConfig->localuserinfo == NULL) { pw = getpwnam( slapdFrontendConfig->localuser ); if ( NULL == pw ) { - LDAPDebug(LDAP_DEBUG_ERR, + slapi_log_err(SLAPI_LOG_ERR, "fix_ownership", "Unable to find user %s in system account database, " - "errno %d (%s)\n", - slapdFrontendConfig->localuser, errno, strerror(errno)); + "errno %d (%s)\n", slapdFrontendConfig->localuser, errno, strerror(errno)); return; } slapdFrontendConfig->localuserinfo = @@ -283,20 +282,20 @@ static int main_setuid(char *username) if (pw == NULL) { int oserr = errno; - LDAPDebug(LDAP_DEBUG_ERR, "getpwnam(%s) == NULL, error %d (%s)\n", + slapi_log_err(SLAPI_LOG_ERR, "main_setuid", "getpwnam(%s) == NULL, error %d (%s)\n", username, oserr, slapd_system_strerror(oserr)); } else { if (setgid (pw->pw_gid) != 0) { int oserr = errno; - LDAPDebug(LDAP_DEBUG_ERR, "setgid(%li) != 0, error %d (%s)\n", + slapi_log_err(SLAPI_LOG_ERR, "main_setuid", "setgid(%li) != 0, error %d (%s)\n", (long)pw->pw_gid, oserr, slapd_system_strerror(oserr)); return -1; } if (setuid (pw->pw_uid) != 0) { int oserr = errno; - LDAPDebug(LDAP_DEBUG_ERR, "setuid(%li) != 0, error %d (%s)\n", + slapi_log_err(SLAPI_LOG_ERR, "main_setuid", "setuid(%li) != 0, error %d (%s)\n", (long)pw->pw_uid, oserr, slapd_system_strerror(oserr)); return -1; } @@ -681,7 +680,7 @@ main( int argc, char **argv) * Process the config files. */ if (0 == slapd_bootstrap_config(slapdFrontendConfig->configdir)) { - slapi_log_error(SLAPI_LOG_EMERG, "startup", + slapi_log_err(SLAPI_LOG_EMERG, "main", "The configuration files in directory %s could not be read or were not found. Please refer to the error log or output for more information.\n", slapdFrontendConfig->configdir); exit(1); @@ -742,7 +741,7 @@ main( int argc, char **argv) * Process the config files. */ if (0 == slapd_bootstrap_config(slapdFrontendConfig->configdir)) { - slapi_log_error(SLAPI_LOG_EMERG, "startup", + slapi_log_err(SLAPI_LOG_EMERG, "main", "The configuration files in directory %s could not be read or were not found. Please refer to the error log or output for more information.\n", slapdFrontendConfig->configdir); exit(1); @@ -757,13 +756,13 @@ main( int argc, char **argv) /* do it before splitting off to other modes too -robey */ /* -richm: must be done before reading config files */ if (0 != (return_value = compute_init())) { - LDAPDebug(LDAP_DEBUG_EMERG, "Initialization Failed 0 %d\n",return_value,0,0); + slapi_log_err(SLAPI_LOG_EMERG, "main", "Initialization Failed 0 %d\n",return_value); exit (1); } entry_computed_attr_init(); if (0 == setup_internal_backends(slapdFrontendConfig->configdir)) { - slapi_log_error(SLAPI_LOG_EMERG, "startup", + slapi_log_err(SLAPI_LOG_EMERG, "main", "The configuration files in directory %s could not be read or were not found. Please refer to the error log or output for more information.\n", slapdFrontendConfig->configdir); exit(1); @@ -777,8 +776,8 @@ main( int argc, char **argv) #ifdef PUMPKIN_HOUR if ( time( NULL ) > (PUMPKIN_HOUR - 10) ) { - LDAPDebug(LDAP_DEBUG_ERR, - "ERROR: ** This beta software has expired **\n", 0, 0, 0 ); + slapi_log_err(SLAPI_LOG_ERR, "main", + "ERROR: ** This beta software has expired **\n"); exit( 1 ); } #endif @@ -842,8 +841,7 @@ main( int argc, char **argv) return_value = daemon_pre_setuid_init(&ports_info); if (0 != return_value) { - LDAPDebug(LDAP_DEBUG_ERR, "Failed to init daemon\n", - 0, 0, 0 ); + slapi_log_err(SLAPI_LOG_ERR, "main", "Failed to init daemon\n"); exit(1); } } @@ -851,8 +849,8 @@ main( int argc, char **argv) /* Now, sockets are open, so we can safely change identity now */ return_value = main_setuid(slapdFrontendConfig->localuser); if (0 != return_value) { - LDAPDebug(LDAP_DEBUG_ERR, "Failed to change user and group identity to that of %s\n", - slapdFrontendConfig->localuser, 0, 0 ); + slapi_log_err(SLAPI_LOG_ERR, "main", "Failed to change user and group identity to that of %s\n", + slapdFrontendConfig->localuser); exit(1); } @@ -899,8 +897,8 @@ main( int argc, char **argv) case SLAPD_EXEMODE_REFERRAL: /* check that all the necessary info was given, then go on */ if (! config_check_referral_mode()) { - LDAPDebug(LDAP_DEBUG_ALERT, - "ERROR: No referral URL supplied\n", 0, 0, 0); + slapi_log_err(SLAPI_LOG_ALERT, "main", + "ERROR: No referral URL supplied\n"); usage( myname, extraname ); exit(1); } @@ -937,12 +935,12 @@ main( int argc, char **argv) /* Ensure that we can read from and write to our rundir */ if (access(rundir, R_OK | W_OK)) { - LDAPDebug(LDAP_DEBUG_EMERG, "Unable to access " CONFIG_RUNDIR_ATTRIBUTE ": %s\n", - slapd_system_strerror(errno), 0, 0); - LDAPDebug(LDAP_DEBUG_EMERG, "Ensure that user \"%s\" has read and write " + slapi_log_err(SLAPI_LOG_EMERG, "main", "Unable to access " CONFIG_RUNDIR_ATTRIBUTE ": %s\n", + slapd_system_strerror(errno)); + slapi_log_err(SLAPI_LOG_EMERG, "main", "Ensure that user \"%s\" has read and write " "permissions on %s\n", - slapdFrontendConfig->localuser, rundir, 0); - LDAPDebug(LDAP_DEBUG_EMERG, "Shutting down.\n", 0, 0, 0); + slapdFrontendConfig->localuser, rundir); + slapi_log_err(SLAPI_LOG_EMERG, "main", "Shutting down.\n"); slapi_ch_free_string(&rundir); return_value = 1; goto cleanup; @@ -989,9 +987,8 @@ main( int argc, char **argv) ( add_new_slapd_process(slapd_exemode, db2ldif_dump_replica, skip_db_protect_check) == -1 )) { - LDAPDebug(LDAP_DEBUG_CRIT, - "Shutting down due to possible conflicts with other slapd processes\n", - 0, 0, 0 ); + slapi_log_err(SLAPI_LOG_CRIT, "main", + "Shutting down due to possible conflicts with other slapd processes\n"); return_value = 1; goto cleanup; } @@ -1005,8 +1002,8 @@ main( int argc, char **argv) if (1) { char *versionstring = config_get_versionstring(); char *buildnum = config_get_buildnum(); - LDAPDebug(LDAP_DEBUG_INFO, "%s B%s starting up\n", - versionstring, buildnum, 0 ); + slapi_log_err(SLAPI_LOG_INFO, "main", "%s B%s starting up\n", + versionstring, buildnum); slapi_ch_free((void **)&buildnum); slapi_ch_free((void **)&versionstring); } @@ -1033,8 +1030,7 @@ main( int argc, char **argv) if (mapping_tree_init()) { - LDAPDebug(LDAP_DEBUG_EMERG, "Failed to init mapping tree\n", - 0, 0, 0 ); + slapi_log_err(SLAPI_LOG_EMERG, "main", "Failed to init mapping tree\n"); return_value = 1; goto cleanup; } @@ -1048,9 +1044,9 @@ main( int argc, char **argv) slapi_sdn_free (&sdn); if (rc != UID_SUCCESS) { - LDAPDebug(LDAP_DEBUG_EMERG, + slapi_log_err(SLAPI_LOG_EMERG, "main", "Fatal Error---Failed to initialize uniqueid generator; error = %d. " - "Exiting now.\n", rc, 0, 0 ); + "Exiting now.\n", rc); return_value = 1; goto cleanup; } @@ -1058,12 +1054,10 @@ main( int argc, char **argv) /* --ugaston: register the start-tls plugin */ if ( slapd_security_library_is_initialized() != 0 ) { start_tls_register_plugin(); - LDAPDebug(LDAP_DEBUG_PLUGIN, "Start TLS plugin registered.\n", - 0, 0, 0 ); + slapi_log_err(SLAPI_LOG_PLUGIN, "main", "Start TLS plugin registered.\n"); } passwd_modify_register_plugin(); - LDAPDebug(LDAP_DEBUG_PLUGIN, - "Password Modify plugin registered.\n", 0, 0, 0 ); + slapi_log_err(SLAPI_LOG_PLUGIN, "main", "Password Modify plugin registered.\n"); /* Cleanup old tasks that may still be in the DSE from a previous session. Call before plugin_startall since cleanup needs to be @@ -1108,9 +1102,9 @@ main( int argc, char **argv) } else if (i_port) { } else if ( config_get_security()) { } else { - LDAPDebug(LDAP_DEBUG_EMERG, + slapi_log_err(SLAPI_LOG_EMERG, "main", "Fatal Error---No ports specified. " - "Exiting now.\n", 0, 0, 0 ); + "Exiting now.\n"); return_value = 1; goto cleanup; @@ -1126,7 +1120,7 @@ main( int argc, char **argv) pw_init(); /* Initialize the sasl mapping code */ if (sasl_map_init()) { - LDAPDebug(LDAP_DEBUG_CRIT, "Failed to initialize sasl mapping code\n", 0, 0, 0 ); + slapi_log_err(SLAPI_LOG_CRIT, "main", "Failed to initialize sasl mapping code\n"); } } @@ -1149,7 +1143,7 @@ main( int argc, char **argv) time( &starttime ); slapd_daemon(&ports_info); } - LDAPDebug(LDAP_DEBUG_INFO, "slapd stopped.\n", 0, 0, 0 ); + slapi_log_err(SLAPI_LOG_INFO, "main", "slapd stopped.\n"); reslimit_cleanup(); compute_terminate(); vattr_cleanup(); @@ -2013,9 +2007,8 @@ slapd_exemode_ldif2db(void) slapdFrontendConfig_t *slapdFrontendConfig = getFrontendConfig(); if ( ldif_file == NULL ) { - LDAPDebug(LDAP_DEBUG_ERR, - "ldif2db - Required argument -i missing\n", - 0, 0, 0 ); + slapi_log_err(SLAPI_LOG_ERR, "slapd_exemode_ldif2db", + "Required argument -i missing\n"); usage( myname, extraname ); return 1; } @@ -2035,10 +2028,9 @@ slapd_exemode_ldif2db(void) if (lookup_instance_name_by_suffixes(db2ldif_include, db2ldif_exclude, &instances) < 0) { - LDAPDebug(LDAP_DEBUG_ERR, - "ldif2db - backend instances name [-n ] or " - "included suffix [-s ] need to be specified.\n", - 0, 0, 0); + slapi_log_err(SLAPI_LOG_ERR, "slapd_exemode_ldif2db", + "Backend instances name [-n ] or " + "included suffix [-s ] need to be specified.\n"); return 1; } @@ -2047,37 +2039,34 @@ slapd_exemode_ldif2db(void) ; if (counter == 0) { - LDAPDebug(LDAP_DEBUG_ERR, - "ldif2db - There is no backend instance to import to.\n", - 0, 0, 0); + slapi_log_err(SLAPI_LOG_ERR, "slapd_exemode_ldif2db", + "There is no backend instance to import to.\n"); return 1; } else if (counter > 1) { int i; - LDAPDebug(LDAP_DEBUG_ERR, - "ldif2db - There are multiple backend instances specified:\n", - 0, 0, 0); + slapi_log_err(SLAPI_LOG_ERR, "slapd_exemode_ldif2db", + "There are multiple backend instances specified:\n"); for (i = 0; i < counter; i++) - LDAPDebug(LDAP_DEBUG_ERR, " : %s\n", + slapi_log_err(SLAPI_LOG_ERR, " : %s\n", instances[i], 0, 0); return 1; } else { - LDAPDebug(LDAP_DEBUG_INFO, "ldif2db - Backend Instance: %s\n", - *instances, 0, 0); + slapi_log_err(SLAPI_LOG_INFO, "slapd_exemode_ldif2db", "Backend Instance: %s\n", + *instances); cmd_line_instance_name = *instances; } } else { - LDAPDebug(LDAP_DEBUG_ERR, - "ldif2db: There is no backend instances to import to.\n", - 0, 0, 0); + slapi_log_err(SLAPI_LOG_ERR, "slapd_exemode_ldif2db", + "There is no backend instances to import to.\n"); return 1; } } plugin = lookup_plugin_by_instance_name(cmd_line_instance_name); if (plugin == NULL) { - LDAPDebug(LDAP_DEBUG_ERR, - "ldif2db - Could not find backend '%s'.\n", - cmd_line_instance_name, 0, 0); + slapi_log_err(SLAPI_LOG_ERR, + "Could not find backend '%s'.\n", + cmd_line_instance_name); return 1; } @@ -2088,15 +2077,14 @@ slapd_exemode_ldif2db(void) if ( add_new_slapd_process(slapd_exemode, db2ldif_dump_replica, skip_db_protect_check) == -1 ) { - LDAPDebug(LDAP_DEBUG_ERR, - "ldif2db - Shutting down due to possible conflicts with other slapd processes\n", - 0, 0, 0 ); + slapi_log_err(SLAPI_LOG_ERR, "slapd_exemode_ldif2db", + "Shutting down due to possible conflicts with other slapd processes\n"); return 1; } /* check for slapi v2 support */ if (! SLAPI_PLUGIN_IS_V2(plugin)) { - LDAPDebug(LDAP_DEBUG_ERR, "ldif2db - %s is too old to reindex all.\n", - plugin->plg_name, 0, 0); + slapi_log_err(SLAPI_LOG_ERR, "slapd_exemode_ldif2db", "%s is too old to reindex all.\n", + plugin->plg_name); return 1; } if (!is_quiet) { @@ -2122,9 +2110,9 @@ slapd_exemode_ldif2db(void) if ( plugin->plg_ldif2db != NULL ) { return_value = (*plugin->plg_ldif2db)( &pb ); } else { - LDAPDebug(LDAP_DEBUG_ERR, - "ldif2db - no ldif2db function defined for " - "%s\n", plugin->plg_name, 0, 0 ); + slapi_log_err(SLAPI_LOG_ERR, "slapd_exemode_ldif2db", + "No ldif2db function defined for " + "%s\n", plugin->plg_name); return_value = -1; } slapi_ch_free((void**)&myname ); @@ -2158,10 +2146,9 @@ slapd_exemode_db2ldif(int argc, char** argv) if (lookup_instance_name_by_suffixes(db2ldif_include, db2ldif_exclude, &instances) < 0) { - LDAPDebug(LDAP_DEBUG_ERR, - "db2ldif - backend instances name [-n ] or " - "included suffix [-s ] need to be specified.\n", - 0, 0, 0); + slapi_log_err(SLAPI_LOG_ERR, "slapd_exemode_db2ldif", + "Backend instances name [-n ] or " + "included suffix [-s ] need to be specified.\n"); return 1; } @@ -2170,21 +2157,19 @@ slapd_exemode_db2ldif(int argc, char** argv) ; if (counter == 0) { - LDAPDebug(LDAP_DEBUG_ERR, - "db2ldif - There is no backend instance to export from.\n", - 0, 0, 0); + slapi_log_err(SLAPI_LOG_ERR, "slapd_exemode_db2ldif", + "There is no backend instance to export from.\n"); return 1; } else { - LDAPDebug(LDAP_DEBUG_INFO, "db2ldif - Backend Instance(s): \n", 0, 0, 0); + slapi_log_err(SLAPI_LOG_INFO, "slapd_exemode_db2ldif", "db2ldif - Backend Instance(s): \n"); for (ip = instances, counter = 0; ip && *ip; ip++, counter++) { - LDAPDebug(LDAP_DEBUG_INFO, "db2ldif - %s\n", *ip, 0, 0); + slapi_log_err(SLAPI_LOG_INFO, "slapd_exemode_db2ldif", "db2ldif - %s\n", *ip); } cmd_line_instance_names = instances; } } else { - LDAPDebug(LDAP_DEBUG_ERR, - "db2ldif: There is no backend instances to export from.\n", - 0, 0, 0); + slapi_log_err(SLAPI_LOG_ERR, "slapd_exemode_db2ldif", + "There is no backend instances to export from.\n"); return 1; } } @@ -2197,15 +2182,14 @@ slapd_exemode_db2ldif(int argc, char** argv) plugin = lookup_plugin_by_instance_name(*instp); if (plugin == NULL) { - LDAPDebug(LDAP_DEBUG_ERR, - "db2ldif - Could not find backend '%s'.\n", - *instp, 0, 0); + slapi_log_err(SLAPI_LOG_ERR, "slapd_exemode_db2ldif", + "Could not find backend '%s'.\n", *instp); return 1; } if (plugin->plg_db2ldif == NULL) { - LDAPDebug(LDAP_DEBUG_ERR, "db2ldif - No db2ldif function defined for " - "backend %s - cannot export\n", *instp, 0, 0); + slapi_log_err(SLAPI_LOG_ERR, "slapd_exemode_db2ldif", + "No db2ldif function defined for backend %s - cannot export\n", *instp); return 1; } @@ -2215,16 +2199,15 @@ slapd_exemode_db2ldif(int argc, char** argv) */ if ( add_new_slapd_process(slapd_exemode, db2ldif_dump_replica, skip_db_protect_check) == -1 ) { - LDAPDebug(LDAP_DEBUG_ERR, - "db2ldif - Shutting down due to possible conflicts " - "with other slapd processes\n", - 0, 0, 0 ); + slapi_log_err(SLAPI_LOG_ERR, "slapd_exemode_db2ldif", + "Shutting down due to possible conflicts " + "with other slapd processes\n"); return 1; } if (! (SLAPI_PLUGIN_IS_V2(plugin))) { - LDAPDebug(LDAP_DEBUG_ERR, "db2ldif - %s is too old to do exports.\n", - plugin->plg_name, 0, 0); + slapi_log_err(SLAPI_LOG_ERR, "slapd_exemode_db2ldif", + "%s is too old to do exports.\n", plugin->plg_name); return 1; } @@ -2375,10 +2358,9 @@ static int slapd_exemode_db2index(void) if (lookup_instance_name_by_suffixes(db2ldif_include, db2ldif_exclude, &instances) < 0) { - LDAPDebug(LDAP_DEBUG_ERR, - "db2index - Backend instances name [-n ] or " - "included suffix [-s ] need to be specified.\n", - 0, 0, 0); + slapi_log_err(SLAPI_LOG_ERR, "slapd_exemode_db2index", + "Backend instances name [-n ] or " + "included suffix [-s ] need to be specified.\n"); return 1; } @@ -2387,46 +2369,43 @@ static int slapd_exemode_db2index(void) ; if (counter == 0) { - LDAPDebug(LDAP_DEBUG_ERR, - "db2index - There is no backend instance to import to.\n", - 0, 0, 0); + slapi_log_err(SLAPI_LOG_ERR, "slapd_exemode_db2index", + "There is no backend instance to import to.\n"); return 1; } else if (counter > 1) { int i; - LDAPDebug(LDAP_DEBUG_ERR, - "db2index - There are multiple backend instances specified:\n", - 0, 0, 0); + slapi_log_err(SLAPI_LOG_ERR, "slapd_exemode_db2index", + "There are multiple backend instances specified:\n"); for (i = 0; i < counter; i++) - LDAPDebug(LDAP_DEBUG_ERR, "db2index - %s\n", - instances[i], 0, 0); + slapi_log_err(SLAPI_LOG_ERR, "slapd_exemode_db2index", + "-- %s\n", instances[i]); return 1; } else { - LDAPDebug(LDAP_DEBUG_INFO, "db2index - Backend Instance: %s\n", - *instances, 0, 0); + slapi_log_err(SLAPI_LOG_INFO, "slapd_exemode_db2index", + "Backend Instance: %s\n", *instances); cmd_line_instance_name = *instances; } } else { - LDAPDebug(LDAP_DEBUG_ERR, - "db2index - There is no backend instances to import to.\n", - 0, 0, 0); + slapi_log_err(SLAPI_LOG_ERR, "slapd_exemode_db2index", + "There is no backend instances to import to.\n"); return 1; } } plugin = lookup_plugin_by_instance_name(cmd_line_instance_name); if (plugin == NULL) { - LDAPDebug(LDAP_DEBUG_ERR, - "db2index - Could not find backend '%s'.\n", - cmd_line_instance_name, 0, 0); + slapi_log_err(SLAPI_LOG_ERR, "slapd_exemode_db2index", + "Could not find backend '%s'.\n", + cmd_line_instance_name); return 1; } /* make sure nothing else is running */ if (add_new_slapd_process(slapd_exemode, db2ldif_dump_replica, skip_db_protect_check) == -1) { - LDAPDebug(LDAP_DEBUG_ERR, - "db2index - Shutting down due to possible conflicts with other " - "slapd processes.\n", 0, 0, 0); + slapi_log_err(SLAPI_LOG_ERR, "slapd_exemode_db2index", + "Shutting down due to possible conflicts with other " + "slapd processes.\n"); return 1; } @@ -2457,15 +2436,13 @@ slapd_exemode_db2archive(void) slapdFrontendConfig_t *slapdFrontendConfig = getFrontendConfig(); if ((backend_plugin = plugin_get_by_name("ldbm database")) == NULL) { - LDAPDebug(LDAP_DEBUG_CRIT, - "db2bak - Could not find the ldbm backend plugin.\n", - 0, 0, 0); + slapi_log_err(SLAPI_LOG_CRIT, "slapd_exemode_db2archive", + "Could not find the ldbm backend plugin.\n"); return 1; } if (NULL == archive_name) { - LDAPDebug(LDAP_DEBUG_ERR, - "db2bak - no archive directory supplied\n", - 0, 0, 0 ); + slapi_log_err(SLAPI_LOG_ERR, "slapd_exemode_db2archive", + "No archive directory supplied\n"); return 1; } @@ -2475,13 +2452,13 @@ slapd_exemode_db2archive(void) */ if ( add_new_slapd_process(slapd_exemode, db2ldif_dump_replica, skip_db_protect_check) == -1 ) { - LDAPDebug(LDAP_DEBUG_ERR, - "db2bak - Shutting down due to possible conflicts with other slapd processes\n", - 0, 0, 0 ); + slapi_log_err(SLAPI_LOG_ERR, "slapd_exemode_db2archive", + "Shutting down due to possible conflicts with other slapd processes\n"); return 1; } if (compute_init()) { - LDAPDebug(LDAP_DEBUG_ERR, "db2bak - Initialization Failed 0 %d\n",return_value,0,0); + slapi_log_err(SLAPI_LOG_ERR, "slapd_exemode_db2archive", + "Initialization Failed 0 %d\n",return_value); return 1; } if (!is_quiet) { @@ -2511,15 +2488,13 @@ slapd_exemode_archive2db(void) slapdFrontendConfig_t *slapdFrontendConfig = getFrontendConfig(); if ((backend_plugin = plugin_get_by_name("ldbm database")) == NULL) { - LDAPDebug(LDAP_DEBUG_CRIT, - "bak2db - Could not find the ldbm backend plugin.\n", - 0, 0, 0); + slapi_log_err(SLAPI_LOG_CRIT, "slapd_exemode_archive2db", + "Could not find the ldbm backend plugin.\n"); return 1; } if (NULL == archive_name) { - LDAPDebug(LDAP_DEBUG_ERR, - "bak2db - no archive directory supplied\n", - 0, 0, 0 ); + slapi_log_err(SLAPI_LOG_ERR, "slapd_exemode_archive2db", + "No archive directory supplied\n"); return 1; } @@ -2529,13 +2504,13 @@ slapd_exemode_archive2db(void) */ if ( add_new_slapd_process(slapd_exemode, db2ldif_dump_replica, skip_db_protect_check) == -1 ) { - LDAPDebug(LDAP_DEBUG_ERR, - "bak2db - Shutting down due to possible conflicts with other slapd processes\n", - 0, 0, 0 ); + slapi_log_err(SLAPI_LOG_ERR, "slapd_exemode_archive2db", + "Shutting down due to possible conflicts with other slapd processes\n"); return 1; } if (compute_init()) { - LDAPDebug(LDAP_DEBUG_ERR, "bak2db - Initialization Failed 0 %d\n",return_value,0,0); + slapi_log_err(SLAPI_LOG_ERR, "slapd_exemode_archive2db", + "Initialization Failed 0 %d\n",return_value); return 1; } @@ -2570,9 +2545,8 @@ slapd_exemode_upgradedb(void) slapdFrontendConfig_t *slapdFrontendConfig = getFrontendConfig(); if ( archive_name == NULL ) { - LDAPDebug(LDAP_DEBUG_ERR, - "upgradedb - Required argument -a missing\n", - 0, 0, 0 ); + slapi_log_err(SLAPI_LOG_ERR, "slapd_exemode_upgradedb", + "Required argument -a missing\n"); usage( myname, extraname ); return 1; } @@ -2583,9 +2557,8 @@ slapd_exemode_upgradedb(void) mapping_tree_init(); if ((backend_plugin = plugin_get_by_name("ldbm database")) == NULL) { - LDAPDebug(LDAP_DEBUG_ERR, - "upgradedb - Could not find the ldbm backend plugin.\n", - 0, 0, 0); + slapi_log_err(SLAPI_LOG_ERR, "slapd_exemode_upgradedb", + "Could not find the ldbm backend plugin.\n"); return 1; } @@ -2594,15 +2567,14 @@ slapd_exemode_upgradedb(void) * slapd processes that are currently running */ if (add_new_slapd_process(slapd_exemode, 0, skip_db_protect_check) == -1) { - LDAPDebug(LDAP_DEBUG_ERR, - "upgradedb -Shutting down due to possible conflicts with other slapd processes\n", - 0, 0, 0 ); + slapi_log_err(SLAPI_LOG_ERR, "slapd_exemode_upgradedb", + "Shutting down due to possible conflicts with other slapd processes\n"); return 1; } /* check for slapi v2 support */ if (! SLAPI_PLUGIN_IS_V2(backend_plugin)) { - LDAPDebug(LDAP_DEBUG_ERR, "upgradedb - %s is too old to do convert idl.\n", - backend_plugin->plg_name, 0, 0); + slapi_log_err(SLAPI_LOG_ERR, "slapd_exemode_upgradedb", + "%s is too old to do convert idl.\n", backend_plugin->plg_name); return 1; } @@ -2621,9 +2593,9 @@ slapd_exemode_upgradedb(void) if ( backend_plugin->plg_upgradedb != NULL ) { return_value = (*backend_plugin->plg_upgradedb)( &pb ); } else { - LDAPDebug(LDAP_DEBUG_ERR, - "upgradedb - no upgradedb function defined for " - "%s\n", backend_plugin->plg_name, 0, 0 ); + slapi_log_err(SLAPI_LOG_ERR, "slapd_exemode_upgradedb", + "No upgradedb function defined for " + "%s\n", backend_plugin->plg_name); return_value = -1; } slapi_ch_free((void**)&myname ); @@ -2640,8 +2612,8 @@ slapd_exemode_upgradednformat(void) slapdFrontendConfig_t *slapdFrontendConfig = getFrontendConfig(); if ( archive_name == NULL ) { - LDAPDebug0Args(LDAP_DEBUG_ERR, "upgradednformat - Required argument " - "\"-a \" is missing\n"); + slapi_log_err(SLAPI_LOG_ERR, "slapd_exemode_upgradednformat", + "Required argument \"-a \" is missing\n"); usage( myname, extraname ); goto bail; } @@ -2652,8 +2624,8 @@ slapd_exemode_upgradednformat(void) mapping_tree_init(); if ((backend_plugin = plugin_get_by_name("ldbm database")) == NULL) { - LDAPDebug0Args(LDAP_DEBUG_ERR, - "upgradednformat - Could not find the ldbm backend plugin.\n"); + slapi_log_err(SLAPI_LOG_ERR, "slapd_exemode_upgradednformat", + "Could not find the ldbm backend plugin.\n"); goto bail; } @@ -2664,14 +2636,15 @@ slapd_exemode_upgradednformat(void) */ if (add_new_slapd_process(slapd_exemode, 0, skip_db_protect_check) == -1) { - LDAPDebug0Args(LDAP_DEBUG_ERR, "upgradednformat - Shutting down due to possible " - "conflicts with other slapd processes\n"); + slapi_log_err(SLAPI_LOG_ERR, "slapd_exemode_upgradednformat", + "Shutting down due to possible " + "conflicts with other slapd processes\n"); goto bail; } /* check for slapi v2 support */ if (! SLAPI_PLUGIN_IS_V2(backend_plugin)) { - LDAPDebug1Arg(LDAP_DEBUG_ERR, - "upgradednformat - %s is too old to upgrade dn format.\n", + slapi_log_err(SLAPI_LOG_ERR, "slapd_exemode_upgradednformat", + "%s is too old to upgrade dn format.\n", backend_plugin->plg_name); goto bail; } @@ -2696,9 +2669,9 @@ slapd_exemode_upgradednformat(void) if ( backend_plugin->plg_upgradednformat != NULL ) { rc = (*backend_plugin->plg_upgradednformat)( &pb ); } else { - LDAPDebug(LDAP_DEBUG_ERR, - "upgradednformat - no upgradednformat function defined for " - "%s\n", backend_plugin->plg_name, 0, 0 ); + slapi_log_err(SLAPI_LOG_ERR, "slapd_exemode_upgradednformat", + "No upgradednformat function defined for " + "%s\n", backend_plugin->plg_name); } bail: slapi_ch_free((void**)&myname ); @@ -2720,16 +2693,15 @@ slapd_exemode_dbverify(void) */ mapping_tree_init(); if ((backend_plugin = plugin_get_by_name("ldbm database")) == NULL) { - LDAPDebug(LDAP_DEBUG_CRIT, - "dbverify - Could not find the ldbm backend plugin.\n", - 0, 0, 0); + slapi_log_err(SLAPI_LOG_CRIT, "slapd_exemode_dbverify", + "Could not find the ldbm backend plugin.\n"); return 1; } /* check for slapi v2 support */ if (! SLAPI_PLUGIN_IS_V2(backend_plugin)) { - LDAPDebug(LDAP_DEBUG_ERR, "dbverify - %s is too old to do dbverify.\n", - backend_plugin->plg_name, 0, 0); + slapi_log_err(SLAPI_LOG_ERR, "slapd_exemode_dbverify", + "%s is too old to do dbverify.\n", backend_plugin->plg_name); return 1; } @@ -2744,9 +2716,9 @@ slapd_exemode_dbverify(void) if ( backend_plugin->plg_dbverify != NULL ) { return_value = (*backend_plugin->plg_dbverify)( &pb ); } else { - LDAPDebug(LDAP_DEBUG_ERR, - "dbverify - no db verify function defined for " - "%s\n", backend_plugin->plg_name, 0, 0 ); + slapi_log_err(SLAPI_LOG_ERR, "slapd_exemode_dbverify", + "No db verify function defined for " + "%s\n", backend_plugin->plg_name); return_value = -1; } @@ -2886,7 +2858,7 @@ slapd_debug_level_log( int level ) } } - slapi_log_error(SLAPI_LOG_INFO, SLAPD_VERSION_STR, + slapi_log_err(SLAPI_LOG_INFO, SLAPD_VERSION_STR, "%s: %s (%d)\n", "debug level", msg, level ); slapi_ch_free( (void **)&msg ); } @@ -2929,13 +2901,15 @@ force_to_disable_security(const char *what, int *init_ssl, daemon_ports_t *ports char errorbuf[SLAPI_DSE_RETURNTEXT_SIZE]; errorbuf[0] = '\0'; - LDAPDebug2Args(LDAP_DEBUG_ERR, "ERROR: %s Initialization Failed. Disabling %s.\n", what, what); + slapi_log_err(SLAPI_LOG_ERR, "force_to_disable_security", + "ERROR: %s Initialization Failed. Disabling %s.\n", what, what); ports_info->s_socket = SLAPD_INVALID_SOCKET; ports_info->s_port = 0; *init_ssl = 0; if (config_set_security(CONFIG_SECURITY_ATTRIBUTE, "off", errorbuf, 1)) { - LDAPDebug2Args(LDAP_DEBUG_ERR, "ERROR: Failed to disable %s: \"%s\".\n", - CONFIG_SECURITY_ATTRIBUTE, errorbuf[0]?errorbuf:"no error message"); + slapi_log_err(SLAPI_LOG_ERR, "force_to_disable_security", + "ERROR: Failed to disable %s: \"%s\".\n", + CONFIG_SECURITY_ATTRIBUTE, errorbuf[0]?errorbuf:"no error message"); return 1; } return 0; diff --git a/ldap/servers/slapd/mapping_tree.c b/ldap/servers/slapd/mapping_tree.c index 1989703..e0f1ffe 100644 --- a/ldap/servers/slapd/mapping_tree.c +++ b/ldap/servers/slapd/mapping_tree.c @@ -301,7 +301,7 @@ mapping_tree_node_new(Slapi_DN *dn, Slapi_Backend **be, char **backend_names, in node->mtn_dstr_plg_rootmode = plg_rootmode; node->mtn_dstr_plg = plg; - slapi_log_error(SLAPI_LOG_TRACE, "mapping_tree", + slapi_log_err(SLAPI_LOG_TRACE, "mapping_tree_node_new", "Created new mapping tree node for suffix [%s] backend [%s] [%p]\n", slapi_sdn_get_dn(dn), backend_names && backend_names[0] ? backend_names[0] : "null", @@ -429,10 +429,10 @@ mtn_state_to_int(const char * state_string, Slapi_Entry *entry) } else if (!strcasecmp(state_string, "container")) { return MTN_CONTAINER; } else { - LDAPDebug(LDAP_DEBUG_WARNING, + slapi_log_err(SLAPI_LOG_WARNING, "mtn_state_to_int", "Unknown state, %s, for mapping tree node %s." " Defaulting to DISABLED\n", - state_string, slapi_entry_get_dn(entry), 0); + state_string, slapi_entry_get_dn(entry)); return MTN_DISABLED; } } @@ -452,8 +452,10 @@ mtn_get_referral_from_entry(Slapi_Entry * entry) slapi_attr_get_numvalues(attr, &nb); hint = slapi_attr_first_value(attr, &val); if (NULL == val) { - LDAPDebug(LDAP_DEBUG_WARNING, "The nsslapd-referral attribute has no value for the mapping tree node %s\n", slapi_entry_get_dn(entry), 0, 0); - return NULL; + slapi_log_err(SLAPI_LOG_WARNING, "mtn_get_referral_from_entry", + "The nsslapd-referral attribute has no value for the mapping tree node %s\n", + slapi_entry_get_dn(entry)); + return NULL; } referral = (char **) slapi_ch_malloc(sizeof(char *) * (nb+1)); @@ -517,10 +519,10 @@ get_backends_from_attr(Slapi_Attr *attr, backend ***be_list, char ***be_names, tmp_backend_name); if (new_node && (new_node != node)) { - LDAPDebug(LDAP_DEBUG_ERR, - "backend %s is already pointed to by a mapping tree" + slapi_log_err(SLAPI_LOG_ERR, "get_backends_from_attr", + "Backend %s is already pointed to by a mapping tree" " node. Only one mapping tree node can point to a backend\n", - tmp_backend_name, 0, 0); + tmp_backend_name); tmp_be = NULL; return -1; } @@ -613,8 +615,9 @@ mapping_tree_entry_add(Slapi_Entry *entry, mapping_tree_node **newnodep ) subtree = get_subtree_from_entry(entry); /* Make sure we know the root dn of the subtree for this node. */ if (NULL == subtree) { - LDAPDebug(LDAP_DEBUG_WARNING, "Unable to determine the subtree represented by the mapping tree node %s\n", - slapi_entry_get_dn(entry), 0, 0); + slapi_log_err(SLAPI_LOG_WARNING, "mapping_tree_entry_add", + "Unable to determine the subtree represented by the mapping tree node %s\n", + slapi_entry_get_dn(entry)); return lderr; } @@ -625,7 +628,7 @@ mapping_tree_entry_add(Slapi_Entry *entry, mapping_tree_node **newnodep ) * a special case (no parent; will replace the internal root * node (mapping_tree_root) with data from this entry). */ - slapi_log_error(SLAPI_LOG_ARGS, "mapping_tree_entry_add", "NULL suffix\n" ); + slapi_log_err(SLAPI_LOG_ARGS, "mapping_tree_entry_add", "NULL suffix\n" ); parent_node = NULL; } @@ -633,9 +636,9 @@ mapping_tree_entry_add(Slapi_Entry *entry, mapping_tree_node **newnodep ) /* Make sure a node does not already exist for this subtree */ if ( parent_node != NULL && NULL != mtn_get_mapping_tree_node_by_entry(mapping_tree_root, subtree)) { - LDAPDebug(LDAP_DEBUG_WARNING, "Mapping tree node for the" - " subtree %s already exists; unable to add the node %s\n", - slapi_sdn_get_dn(subtree), slapi_entry_get_dn(entry), 0); + slapi_log_err(SLAPI_LOG_WARNING, "mapping_tree_entry_add", + "Mapping tree node for the subtree %s already exists; unable to add the node %s\n", + slapi_sdn_get_dn(subtree), slapi_entry_get_dn(entry)); slapi_sdn_free(&subtree); return LDAP_ALREADY_EXISTS; } @@ -665,9 +668,9 @@ mapping_tree_entry_add(Slapi_Entry *entry, mapping_tree_node **newnodep ) if (NULL == be_list) { - LDAPDebug(LDAP_DEBUG_WARNING, - "The nsslapd-backend attribute has no value for the mapping tree node %s\n", - slapi_entry_get_dn(entry), 0, 0); + slapi_log_err(SLAPI_LOG_WARNING, "mapping_tree_entry_add", + "The nsslapd-backend attribute has no value for the mapping tree node %s\n", + slapi_entry_get_dn(entry)); continue; } @@ -679,8 +682,9 @@ mapping_tree_entry_add(Slapi_Entry *entry, mapping_tree_node **newnodep ) slapi_attr_first_value(attr, &val); if (NULL == val) { - LDAPDebug(LDAP_DEBUG_WARNING, "Can't determine the state of the mapping tree node %s\n", - slapi_entry_get_dn(entry), 0, 0); + slapi_log_err(SLAPI_LOG_WARNING, "mapping_tree_entry_add", + "Can't determine the state of the mapping tree node %s\n", + slapi_entry_get_dn(entry)); continue; } /* Convert the string representation for the state to an int */ @@ -690,16 +694,18 @@ mapping_tree_entry_add(Slapi_Entry *entry, mapping_tree_node **newnodep ) } else if (!strcasecmp(type, "nsslapd-distribution-plugin")) { slapi_attr_first_value(attr, &val); if (NULL == val) { - LDAPDebug(LDAP_DEBUG_WARNING, "The nsslapd-distribution-plugin attribute has no value for the mapping tree node %s\n", - slapi_entry_get_dn(entry), 0, 0); + slapi_log_err(SLAPI_LOG_WARNING, "mapping_tree_entry_add", + "The nsslapd-distribution-plugin attribute has no value for the mapping tree node %s\n", + slapi_entry_get_dn(entry)); continue; } plugin_lib = slapi_ch_strdup(slapi_value_get_string(val)); } else if (!strcasecmp(type, "nsslapd-distribution-funct")) { slapi_attr_first_value(attr, &val); if (NULL == val) { - LDAPDebug(LDAP_DEBUG_WARNING, "The nsslapd-distribution-plugin attribute has no value for the mapping tree node %s\n", - slapi_entry_get_dn(entry), 0, 0); + slapi_log_err(SLAPI_LOG_WARNING, "mapping_tree_entry_add", + "The nsslapd-distribution-plugin attribute has no value for the mapping tree node %s\n", + slapi_entry_get_dn(entry)); continue; } plugin_funct = slapi_ch_strdup(slapi_value_get_string(val)); @@ -707,20 +713,22 @@ mapping_tree_entry_add(Slapi_Entry *entry, mapping_tree_node **newnodep ) const char *sval; slapi_attr_first_value(attr, &val); if (NULL == val) { - LDAPDebug(LDAP_DEBUG_WARNING, "The nsslapd-distribution-plugin attribute has no value for the mapping tree node %s\n", - slapi_entry_get_dn(entry), 0, 0); + slapi_log_err(SLAPI_LOG_WARNING, "mapping_tree_entry_add", + "The nsslapd-distribution-plugin attribute has no value for the mapping tree node %s\n", + slapi_entry_get_dn(entry)); continue; } sval = slapi_value_get_string(val); - if (strcmp(sval,"reject") == 0) - plugin_rootmode = CHAIN_ROOT_UPDATE_REJECT; - else if (strcmp(sval,"local") == 0) - plugin_rootmode = CHAIN_ROOT_UPDATE_LOCAL; - else if (strcmp(sval,"referral") == 0) - plugin_rootmode = CHAIN_ROOT_UPDATE_REFERRAL; - else - LDAPDebug(LDAP_DEBUG_WARNING, "The nsslapd-distribution-root-update attribute has undefined value (%s) for the mapping tree node %s\n", - sval, slapi_entry_get_dn(entry), 0); + if (strcmp(sval,"reject") == 0) + plugin_rootmode = CHAIN_ROOT_UPDATE_REJECT; + else if (strcmp(sval,"local") == 0) + plugin_rootmode = CHAIN_ROOT_UPDATE_LOCAL; + else if (strcmp(sval,"referral") == 0) + plugin_rootmode = CHAIN_ROOT_UPDATE_REFERRAL; + else + slapi_log_err(SLAPI_LOG_WARNING, "mapping_tree_entry_add", + "The nsslapd-distribution-root-update attribute has undefined value (%s) for the mapping tree node %s\n", + sval, slapi_entry_get_dn(entry)); } else if (!strcasecmp(type, MAPPING_TREE_PARENT_ATTRIBUTE)) { Slapi_DN *parent_node_dn = get_parent_from_entry(entry); parent_node = mtn_get_mapping_tree_node_by_entry( @@ -729,9 +737,9 @@ mapping_tree_entry_add(Slapi_Entry *entry, mapping_tree_node **newnodep ) if (parent_node == NULL) { parent_node = mapping_tree_root; - LDAPDebug(LDAP_DEBUG_WARNING, + slapi_log_err(SLAPI_LOG_WARNING, "mapping_tree_entry_add", "Could not find parent for %s defaulting to root\n", - slapi_entry_get_dn(entry), 0, 0); + slapi_entry_get_dn(entry)); } slapi_sdn_free(&parent_node_dn); } @@ -745,9 +753,8 @@ mapping_tree_entry_add(Slapi_Entry *entry, mapping_tree_node **newnodep ) be = defbackend_get_backend(); if(be == NULL) { - LDAPDebug(LDAP_DEBUG_ERR, - "Default container has not been created for the NULL SUFFIX node.\n", - 0, 0, 0); + slapi_log_err(SLAPI_LOG_ERR, "mapping_tree_entry_add", + "Default container has not been created for the NULL SUFFIX node.\n"); slapi_sdn_free(&subtree); return -1; } @@ -778,7 +785,7 @@ mapping_tree_entry_add(Slapi_Entry *entry, mapping_tree_node **newnodep ) if (((state == MTN_BACKEND) || (state == MTN_REFERRAL_ON_UPDATE)) && (be_names == NULL)) { - LDAPDebug(LDAP_DEBUG_ERR, + slapi_log_err(SLAPI_LOG_ERR, "Node %s must define a backend\n", slapi_entry_get_dn(entry), 0, 0); slapi_sdn_free(&subtree); @@ -788,7 +795,7 @@ mapping_tree_entry_add(Slapi_Entry *entry, mapping_tree_node **newnodep ) if (((state == MTN_REFERRAL) || (state == MTN_REFERRAL_ON_UPDATE)) && (referral == NULL)) { - LDAPDebug(LDAP_DEBUG_ERR, + slapi_log_err(SLAPI_LOG_ERR, "Node %s must define referrals to be in referral state\n", slapi_entry_get_dn(entry), 0, 0); slapi_sdn_free(&subtree); @@ -802,7 +809,7 @@ mapping_tree_entry_add(Slapi_Entry *entry, mapping_tree_node **newnodep ) "Entry Distribution", 1); if (plugin == NULL) { - LDAPDebug(LDAP_DEBUG_ERR, + slapi_log_err(SLAPI_LOG_ERR, "mapping_tree_entry_add", "Node %s cannot find distribution plugin. " SLAPI_COMPONENT_NAME_NSPR " %d (%s)\n", slapi_entry_get_dn(entry), PR_GetError(), slapd_pr_strerror(PR_GetError())); @@ -821,10 +828,9 @@ mapping_tree_entry_add(Slapi_Entry *entry, mapping_tree_node **newnodep ) else { /* only one parameter configured -> ERROR */ - LDAPDebug(LDAP_DEBUG_ERR, - "Node %s must define both lib and funct" - " for distribution plugin\n", - slapi_entry_get_dn(entry), 0, 0); + slapi_log_err(SLAPI_LOG_ERR, "mapping_tree_entry_add", + "Node %s must define both lib and funct for distribution plugin\n", + slapi_entry_get_dn(entry)); slapi_sdn_free(&subtree); slapi_ch_free((void **) &plugin_funct); slapi_ch_free((void **) &plugin_lib); @@ -848,7 +854,7 @@ mapping_tree_entry_add(Slapi_Entry *entry, mapping_tree_node **newnodep ) * node hold pointers to it in their mtn_parent field). */ - slapi_log_error(SLAPI_LOG_ARGS, "mapping_tree_entry_add", "fix up NULL suffix\n" ); + slapi_log_err(SLAPI_LOG_ARGS, "mapping_tree_entry_add", "fix up NULL suffix\n"); node->mtn_children = mapping_tree_root->mtn_children; node->mtn_brother = mapping_tree_root->mtn_brother; @@ -930,8 +936,8 @@ mapping_tree_node_get_children(mapping_tree_node *target, int is_root) slapi_pblock_get(pb, SLAPI_PLUGIN_INTOP_RESULT, &res); if (res != LDAP_SUCCESS) { - LDAPDebug(LDAP_DEBUG_WARNING, "Mapping tree unable to read %s: %d\n", - MAPPING_TREE_BASE_DN, res, 0); + slapi_log_err(SLAPI_LOG_WARNING, "mapping_tree_node_get_children", + "Mapping tree unable to read %s: %d\n", MAPPING_TREE_BASE_DN, res); result = -1; goto done; } @@ -940,8 +946,8 @@ mapping_tree_node_get_children(mapping_tree_node *target, int is_root) * of the target's children. */ slapi_pblock_get(pb, SLAPI_PLUGIN_INTOP_SEARCH_ENTRIES, &entries); if (NULL == entries) { - LDAPDebug(LDAP_DEBUG_WARNING, "No mapping tree node entries found under %s\n", - MAPPING_TREE_BASE_DN, 0, 0); + slapi_log_err(SLAPI_LOG_WARNING, "mapping_tree_node_get_children", + "No mapping tree node entries found under %s\n", MAPPING_TREE_BASE_DN); result = -1; goto done; } @@ -950,9 +956,9 @@ mapping_tree_node_get_children(mapping_tree_node *target, int is_root) mapping_tree_node *child = NULL; if (LDAP_SUCCESS != mapping_tree_entry_add(entries[x], &child)) { - LDAPDebug(LDAP_DEBUG_ERR, - "Could not add mapping tree node %s\n", - slapi_entry_get_dn(entries[x]), 0, 0); + slapi_log_err(SLAPI_LOG_ERR, "mapping_tree_node_get_children", + "Could not add mapping tree node %s\n", + slapi_entry_get_dn(entries[x])); result = -1; goto done; } @@ -1009,10 +1015,10 @@ mapping_tree_node_validate(mapping_tree_node *node) if (node->mtn_parent) { if (!slapi_sdn_issuffix(node->mtn_subtree, node->mtn_parent->mtn_subtree)) { - LDAPDebug(LDAP_DEBUG_WARNING, + slapi_log_err(SLAPI_LOG_WARNING, "mapping_tree_node_validate", "Invalid mapping tree. %s can not be a child of %s\n", slapi_sdn_get_ndn(node->mtn_subtree), - slapi_sdn_get_ndn(node->mtn_parent->mtn_subtree), 0); + slapi_sdn_get_ndn(node->mtn_parent->mtn_subtree)); } } } @@ -1099,9 +1105,10 @@ int mapping_tree_entry_modify_callback(Slapi_PBlock *pb, Slapi_Entry* entryBefor if (parent_node == NULL) { parent_node = mapping_tree_root; - LDAPDebug(LDAP_DEBUG_ERR, - "Could not find parent for %s\n", - slapi_entry_get_dn(entryAfter), 0, 0); + slapi_log_err(SLAPI_LOG_ERR, + "mapping_tree_entry_modify_callback", + "Could not find parent for %s\n", + slapi_entry_get_dn(entryAfter)); slapi_sdn_free(&subtree); slapi_ch_free_string(&plugin_fct); slapi_ch_free_string(&plugin_lib); @@ -1300,10 +1307,10 @@ int mapping_tree_entry_modify_callback(Slapi_PBlock *pb, Slapi_Entry* entryBefor slapi_attr_first_value(attr, &val); slapi_ch_free_string(&plugin_fct); if (NULL == val) { - LDAPDebug(LDAP_DEBUG_WARNING, + slapi_log_err(SLAPI_LOG_WARNING, "mapping_tree_entry_modify_callback", "The nsslapd-distribution-funct attribute" " has no value for the mapping tree node %s\n", - slapi_entry_get_dn(entryAfter), 0, 0); + slapi_entry_get_dn(entryAfter)); } plugin_fct = slapi_ch_strdup(slapi_value_get_string(val)); } @@ -1324,10 +1331,10 @@ int mapping_tree_entry_modify_callback(Slapi_PBlock *pb, Slapi_Entry* entryBefor slapi_attr_first_value(attr, &val); slapi_ch_free_string(&plugin_lib); if (NULL == val) { - LDAPDebug(LDAP_DEBUG_WARNING, + slapi_log_err(SLAPI_LOG_WARNING, "mapping_tree_entry_modify_callback", "The nsslapd-distribution-plugin attribute" " has no value for the mapping tree node %s\n", - slapi_entry_get_dn(entryAfter), 0, 0); + slapi_entry_get_dn(entryAfter)); } plugin_lib = slapi_ch_strdup(slapi_value_get_string(val)); } @@ -1348,10 +1355,10 @@ int mapping_tree_entry_modify_callback(Slapi_PBlock *pb, Slapi_Entry* entryBefor "nsslapd-distribution-root-update", &attr); slapi_attr_first_value(attr, &val); if (NULL == val) { - LDAPDebug(LDAP_DEBUG_WARNING, + slapi_log_err(SLAPI_LOG_WARNING, "mapping_tree_entry_modify_callback", "The nsslapd-distribution-root-update attribute" " has no value for the mapping tree node %s\n", - slapi_entry_get_dn(entryAfter), 0, 0); + slapi_entry_get_dn(entryAfter)); plugin_rootmode = CHAIN_ROOT_UPDATE_REJECT; } else { sval = slapi_value_get_string(val); @@ -1483,9 +1490,8 @@ int mapping_tree_entry_add_callback(Slapi_PBlock *pb, Slapi_Entry* entryBefore, CONFIG_DEFAULT_NAMING_CONTEXT, escaped); if (rc) { - LDAPDebug(LDAP_DEBUG_ERR, - "mapping_tree_entry_add_callback: " - "setting %s to %s failed: RC=%d\n", + slapi_log_err(SLAPI_LOG_ERR, "mapping_tree_entry_add_callback", + "Setting %s to %s failed: RC=%d\n", escaped, CONFIG_DEFAULT_NAMING_CONTEXT, rc); } } @@ -1594,8 +1600,8 @@ done: CONFIG_DEFAULT_NAMING_CONTEXT, NULL); if (rc) { - LDAPDebug2Args(LDAP_DEBUG_ERR, - "mapping_tree_entry_delete_callback: " + slapi_log_err(SLAPI_LOG_ERR, + "mapping_tree_entry_delete_callback", "deleting config param %s failed: RC=%d\n", CONFIG_DEFAULT_NAMING_CONTEXT, rc); } @@ -1607,9 +1613,9 @@ done: if (config_set_default_naming_context( CONFIG_DEFAULT_NAMING_CONTEXT, NULL, errorbuf, CONFIG_APPLY)) { - slapi_log_error(SLAPI_LOG_ERR, "mapping_tree", - "mapping_tree_entry_delete_callback: setting NULL to %s failed. %s\n", - CONFIG_DEFAULT_NAMING_CONTEXT, errorbuf); + slapi_log_err(SLAPI_LOG_ERR, "mapping_tree_entry_delete_callback", + "Setting NULL to %s failed. %s\n", + CONFIG_DEFAULT_NAMING_CONTEXT, errorbuf); } } } @@ -2268,7 +2274,7 @@ int slapi_mapping_tree_select_all(Slapi_PBlock *pb, Slapi_Backend **be_list, /* get the operational parameters */ slapi_pblock_get(pb, SLAPI_SEARCH_TARGET_SDN, &sdn); if (NULL == sdn) { - slapi_log_error(SLAPI_LOG_ERR, "slapi_mapping_tree_select_all", + slapi_log_err(SLAPI_LOG_ERR, "slapi_mapping_tree_select_all", "Null target DN"); return LDAP_OPERATIONS_ERROR; } @@ -2325,7 +2331,7 @@ int slapi_mapping_tree_select_all(Slapi_PBlock *pb, Slapi_Backend **be_list, if (be && !be_isdeleted(be)) { /* wrong backend or referall, ignore it */ - slapi_log_error(SLAPI_LOG_ARGS, NULL, + slapi_log_err(SLAPI_LOG_ARGS, "slapi_mapping_tree_select_all", "mapping tree release backend : %s\n", slapi_be_get_name(be)); slapi_be_Unlock(be); @@ -2338,7 +2344,7 @@ int slapi_mapping_tree_select_all(Slapi_PBlock *pb, Slapi_Backend **be_list, if (be_index == BE_LIST_SIZE) { /* error - too many backends */ slapi_create_errormsg(errorbuf, ebuflen, "Error: too many backends match search request - cannot proceed"); - slapi_log_error(SLAPI_LOG_ERR, "mapping_tree", + slapi_log_err(SLAPI_LOG_ERR, "slapi_mapping_tree_select_all", "Too many backends match search request - cannot proceed"); ret_code = LDAP_ADMINLIMIT_EXCEEDED; break; @@ -2405,7 +2411,8 @@ void slapi_mapping_tree_free_all(Slapi_Backend **be_list, Slapi_Entry **referral while ((be = be_list[index++])) { - slapi_log_error(SLAPI_LOG_ARGS, NULL, "mapping tree release backend : %s\n", slapi_be_get_name(be)); + slapi_log_err(SLAPI_LOG_ARGS, "slapi_mapping_tree_free_all", + "mapping tree release backend : %s\n", slapi_be_get_name(be)); slapi_be_Unlock(be); } } @@ -2573,7 +2580,7 @@ mtn_get_be_distributed(Slapi_PBlock *pb, mapping_tree_node * target_node, /* paranoid check, never trust another programmer */ else if ((index >= target_node->mtn_be_count) || (index < 0)) { - LDAPDebug(LDAP_DEBUG_WARNING, + slapi_log_err(SLAPI_LOG_WARNING, "mtn_get_be_distributed", "Distribution plugin returned wrong backend" " : %d for entry %s at node %s\n", index, slapi_sdn_get_ndn(target_sdn), @@ -2593,9 +2600,9 @@ mtn_get_be_distributed(Slapi_PBlock *pb, mapping_tree_node * target_node, /* there is several backends but no distribution function * return the first backend */ - LDAPDebug(LDAP_DEBUG_WARNING, + slapi_log_err(SLAPI_LOG_WARNING, "mtn_get_be_distributed", "Distribution plugin not configured at node : %s\n", - slapi_sdn_get_ndn(target_node->mtn_subtree), 0, 0); + slapi_sdn_get_ndn(target_node->mtn_subtree)); index = 0; } @@ -2713,11 +2720,11 @@ static int mtn_get_be(mapping_tree_node *target_node, Slapi_PBlock *pb, target_node->mtn_backend_names[*index]); *be = target_node->mtn_be[*index]; if(*be==NULL) { - LDAPDebug(LDAP_DEBUG_BACKLDBM, + slapi_log_err(SLAPI_LOG_BACKLDBM, "mtn_get_be", "Warning: Mapping tree node entry for %s " "point to an unknown backend : %s\n", slapi_sdn_get_dn(target_node->mtn_subtree), - target_node->mtn_backend_names[*index], 0); + target_node->mtn_backend_names[*index]); /* Well there's still not backend instance for * this MTN, so let's have the default backend * deal with this. @@ -2728,10 +2735,9 @@ static int mtn_get_be(mapping_tree_node *target_node, Slapi_PBlock *pb, } if ((target_node->mtn_be_states) && (target_node->mtn_be_states[*index] == SLAPI_BE_STATE_OFFLINE)) { - LDAPDebug(LDAP_DEBUG_TRACE, - "Warning: Operation attempted on backend in OFFLINE " - "state : %s\n", - target_node->mtn_backend_names[*index], 0, 0); + slapi_log_err(SLAPI_LOG_TRACE, "mtn_get_be", + "Operation attempted on backend in OFFLINE state : %s\n", + target_node->mtn_backend_names[*index]); result = LDAP_OPERATIONS_ERROR; *be = defbackend_get_backend(); } @@ -2779,12 +2785,12 @@ static int mtn_get_be(mapping_tree_node *target_node, Slapi_PBlock *pb, if (result == LDAP_SUCCESS) { if (*be && !be_isdeleted(*be)) { - slapi_log_error(SLAPI_LOG_ARGS, NULL, + slapi_log_err(SLAPI_LOG_ARGS, "mtn_get_be", "mapping tree selected backend : %s\n", slapi_be_get_name(*be)); slapi_be_Rlock(*be); } else if (referral && *referral) { - slapi_log_error(SLAPI_LOG_ARGS, NULL, + slapi_log_err(SLAPI_LOG_ARGS, "mtn_get_be", "mapping tree selected referral at node : %s\n", slapi_sdn_get_dn(target_node->mtn_subtree)); } @@ -2980,9 +2986,9 @@ slapi_get_mapping_tree_node_configdn (const Slapi_DN *root) dn = slapi_create_dn_string("cn=\"%s\",%s", slapi_sdn_get_udn(root), MAPPING_TREE_BASE_DN); if (NULL == dn) { - LDAPDebug1Arg(LDAP_DEBUG_ERR, - "slapi_get_mapping_tree_node_configdn: " - "failed to crate mapping tree dn for %s\n", + slapi_log_err(SLAPI_LOG_ERR, + "slapi_get_mapping_tree_node_configdn", + "Failed to crate mapping tree dn for %s\n", slapi_sdn_get_dn(root)); return NULL; } @@ -3007,9 +3013,9 @@ slapi_get_mapping_tree_node_configsdn (const Slapi_DN *root) dn = slapi_create_dn_string("cn=\"%s\",%s", slapi_sdn_get_udn(root), MAPPING_TREE_BASE_DN); if (NULL == dn) { - LDAPDebug1Arg(LDAP_DEBUG_ERR, - "slapi_get_mapping_tree_node_configsdn: " - "failed to crate mapping tree dn for %s\n", + slapi_log_err(SLAPI_LOG_ERR, + "slapi_get_mapping_tree_node_configsdn", + "Failed to crate mapping tree dn for %s\n", slapi_sdn_get_dn(root)); return NULL; } @@ -3093,7 +3099,8 @@ slapi_be_select_exact(const Slapi_DN *sdn) mapping_tree_node *node = NULL; if (!sdn) { - LDAPDebug0Args(LDAP_DEBUG_ERR, "slapi_be_select_exact: Empty Slapi_DN is given.\n"); + slapi_log_err(SLAPI_LOG_ERR, "slapi_be_select_exact", + "Empty Slapi_DN is given.\n"); return NULL; } node = slapi_get_mapping_tree_node_by_dn(sdn); @@ -3597,9 +3604,9 @@ mtn_internal_be_set_state(Slapi_Backend *be, int state) node = get_mapping_tree_node_by_name(mapping_tree_root, be_name); if (node == NULL) { - LDAPDebug(LDAP_DEBUG_TRACE, - "Warning: backend %s is not declared in mapping tree\n", - be_name, 0 ,0); + slapi_log_err(SLAPI_LOG_TRACE, "mtn_internal_be_set_state", + "Backend %s is not declared in mapping tree\n", + be_name); goto done; } @@ -3620,9 +3627,8 @@ mtn_internal_be_set_state(Slapi_Backend *be, int state) /* backend is not declared in the mapping tree node * print out a warning */ - LDAPDebug(LDAP_DEBUG_TRACE, - "Warning: backend %s is not declared in mapping node entry\n", - be_name, 0 ,0); + slapi_log_err(SLAPI_LOG_TRACE, "mtn_internal_be_set_state", + "Backend %s is not declared in mapping node entry\n", be_name); goto done; } @@ -3758,7 +3764,7 @@ void mtn_wlock(void) slapi_rwlock_wrlock(myLock); #ifdef DEBUG lock_count--; - LDAPDebug(LDAP_DEBUG_ARGS, "mtn_wlock : lock count : %d\n", lock_count, 0, 0); + slapi_log_err(SLAPI_LOG_ARGS, "mtn_wlock", "lock count : %d\n", lock_count); #endif } @@ -3767,7 +3773,7 @@ void mtn_lock(void) slapi_rwlock_rdlock(myLock); #ifdef DEBUG lock_count++; - LDAPDebug(LDAP_DEBUG_ARGS, "mtn_lock : lock count : %d\n", lock_count, 0, 0); + slapi_log_err(SLAPI_LOG_ARGS, "mtn_lock", "lock count : %d\n", lock_count); #endif } @@ -3781,7 +3787,7 @@ void mtn_unlock(void) lock_count++; else lock_count = (int) 11111111; /* this happening means problems */ - LDAPDebug(LDAP_DEBUG_ARGS, "mtn_unlock : lock count : %d\n", lock_count, 0, 0); + slapi_log_err(SLAPI_LOG_ARGS, "mtn_unlock", "lock count : %d\n", lock_count); #endif slapi_rwlock_unlock(myLock); } @@ -3789,9 +3795,9 @@ void mtn_unlock(void) #ifdef TEST_FOR_REGISTER_CHANGE void my_test_fnct1(void *handle, char *be_name, int old_state, int new_state) { - slapi_log_error(SLAPI_LOG_ARGS, NULL, - "my_test_fnct1 : handle %d, be %s, old state %d, new state %d\n", - handle,be_name, old_state, new_state); + slapi_log_err(SLAPI_LOG_ARGS, "my_test_fnct1", + "handle %d, be %s, old state %d, new state %d\n", + handle,be_name, old_state, new_state); if (old_state == 2) slapi_unregister_backend_state_change(handle); @@ -3799,9 +3805,9 @@ void my_test_fnct1(void *handle, char *be_name, int old_state, int new_state) void my_test_fnct2(void *handle, char *be_name, int old_state, int new_state) { - slapi_log_error(SLAPI_LOG_ARGS, NULL, - "my_test_fnct2 : handle %d, be %s, old state %d, new state %d\n", - handle, be_name, old_state, new_state); + slapi_log_err(SLAPI_LOG_ARGS, "my_test_fnct2", + "handle %d, be %s, old state %d, new state %d\n", + handle, be_name, old_state, new_state); } void test_register() @@ -3821,7 +3827,7 @@ static void dump_mapping_tree(mapping_tree_node *parent, int depth) if (depth == 0) { - LDAPDebug(LDAP_DEBUG_DEBUG, "dump_mapping_tree\n", 0, 0, 0); + slapi_log_err(SLAPI_LOG_DEBUG, "dump_mapping_tree","\n"); } dump_indent[0] = '\0'; for (i = 0; i < depth; i++) @@ -3831,12 +3837,12 @@ static void dump_mapping_tree(mapping_tree_node *parent, int depth) { if (strlen(current->mtn_subtree->dn) == 0) { - LDAPDebug(LDAP_DEBUG_DEBUG, "MT_DUMP: %s%s (0x%x)\n", + slapi_log_err(SLAPI_LOG_DEBUG, "dump_mapping_tree", "MT_DUMP: %s%s (0x%x)\n", dump_indent, "none", current); } else { - LDAPDebug(LDAP_DEBUG_DEBUG, "MT_DUMP: %s%s (0x%x)\n", + slapi_log_err(SLAPI_LOG_DEBUG, "dump_mapping_tree", "MT_DUMP: %s%s (0x%x)\n", dump_indent, current->mtn_subtree->dn, current); } dump_mapping_tree(current, depth+1); diff --git a/ldap/servers/slapd/mempool.c b/ldap/servers/slapd/mempool.c index f8451fc..bf2bf69 100644 --- a/ldap/servers/slapd/mempool.c +++ b/ldap/servers/slapd/mempool.c @@ -96,7 +96,7 @@ mempool_init(struct mempool **my_mempool) mempool[i].mempool_mutex = PR_NewLock(); if (NULL == mempool[i].mempool_mutex) { PRErrorCode ec = PR_GetError(); - slapi_log_error(SLAPI_LOG_ERR, "mempool", "mempool_init: " + slapi_log_err(SLAPI_LOG_ERR, "mempool", "mempool_init: " "failed to create mutex - (%d - %s); mempool(%s) is disabled", ec, slapd_pr_strerror(ec), mempool[i].mempool_name); rc = LDAP_OPERATIONS_ERROR; @@ -340,7 +340,7 @@ create_counters() static void log_negative_alloc_msg( const char *op, const char *units, unsigned long size ) { - slapi_log_error(SLAPI_LOG_ERR, SLAPD_MODULE, + slapi_log_err(SLAPI_LOG_ERR, SLAPD_MODULE, "cannot %s %lu %s;\n" "trying to allocate 0 or a negative number of %s is not portable and\n" "gives different results on different platforms.\n", @@ -356,7 +356,7 @@ slapi_ch_malloc_core( unsigned long lsize ) int oserr = errno; oom_occurred(); - slapi_log_error(SLAPI_LOG_ERR, SLAPD_MODULE, + slapi_log_err(SLAPI_LOG_ERR, SLAPD_MODULE, "malloc of %lu bytes failed; OS error %d (%s)%s\n", lsize, oserr, slapd_system_strerror( oserr ), oom_advice ); exit( 1 ); @@ -424,7 +424,7 @@ slapi_ch_realloc_core( char *block, unsigned long lsize ) int oserr = errno; oom_occurred(); - slapi_log_error(SLAPI_LOG_ERR, SLAPD_MODULE, + slapi_log_err(SLAPI_LOG_ERR, SLAPD_MODULE, "realloc of %lu bytes failed; OS error %d (%s)%s\n", lsize, oserr, slapd_system_strerror( oserr ), oom_advice ); exit( 1 ); @@ -505,7 +505,7 @@ slapi_ch_calloc_core( unsigned long lsize ) int oserr = errno; oom_occurred(); - slapi_log_error(SLAPI_LOG_ERR, SLAPD_MODULE, + slapi_log_err(SLAPI_LOG_ERR, SLAPD_MODULE, "calloc of %lu bytes failed; OS error %d (%s)%s\n", lsize, oserr, slapd_system_strerror( oserr ), oom_advice ); exit( 1 ); @@ -670,7 +670,7 @@ slapi_ch_mmap(unsigned long len) int oserr = errno; oom_occurred(); - slapi_log_error(SLAPI_LOG_ERR, SLAPD_MODULE, + slapi_log_err(SLAPI_LOG_ERR, SLAPD_MODULE, "mmap of %lu bytes failed; OS error %d (%s)%s\n", roundup, oserr, slapd_system_strerror( oserr ), oom_advice ); exit( 1 ); @@ -691,7 +691,7 @@ slapi_ch_munmap(void **start, unsigned long len) if (0 != rc) { int oserr = errno; - slapi_log_error(SLAPI_LOG_ERR, SLAPD_MODULE, + slapi_log_err(SLAPI_LOG_ERR, SLAPD_MODULE, "munmap of %lu bytes failed; OS error %d (%s)\n", roundup, oserr, slapd_system_strerror( oserr ) ); /* Leaked. This should not happen */ @@ -712,7 +712,7 @@ slapi_ch_mmap_no_roundup( unsigned long size) int oserr = errno; oom_occurred(); - slapi_log_error(SLAPI_LOG_ERR, SLAPD_MODULE, + slapi_log_err(SLAPI_LOG_ERR, SLAPD_MODULE, "mmap of %lu bytes failed; OS error %d (%s)%s\n", size + sizeof(unsigned long), oserr, slapd_system_strerror( oserr ), oom_advice ); @@ -733,7 +733,7 @@ slapi_ch_munmap_no_roundup(void **start, unsigned long len) if (0 != rc) { int oserr = errno; - slapi_log_error(SLAPI_LOG_ERR, SLAPD_MODULE, + slapi_log_err(SLAPI_LOG_ERR, SLAPD_MODULE, "munmap of %lu bytes failed; OS error %d (%s)\n", len, oserr, slapd_system_strerror( oserr ) ); /* Leaked. This should not happen */ diff --git a/ldap/servers/slapd/modify.c b/ldap/servers/slapd/modify.c index d961978..4bc1e2e 100644 --- a/ldap/servers/slapd/modify.c +++ b/ldap/servers/slapd/modify.c @@ -114,7 +114,7 @@ do_modify( Slapi_PBlock *pb ) int pw_change = 0; /* 0 = no password change */ int err; - LDAPDebug(LDAP_DEBUG_TRACE, "do_modify\n", 0, 0, 0 ); + slapi_log_err(SLAPI_LOG_TRACE, "do_modify", "=>\n"); slapi_pblock_get( pb, SLAPI_OPERATION, &operation); ber = operation->o_ber; @@ -145,8 +145,8 @@ do_modify( Slapi_PBlock *pb ) int rc = 0; if ( ber_scanf( ber, "{a", &rawdn ) == LBER_ERROR ) { - LDAPDebug(LDAP_DEBUG_ERR, - "do_modify - ber_scanf failed (op=Modify; params=DN)\n", 0, 0, 0 ); + slapi_log_err(SLAPI_LOG_ERR, "do_modify", + "ber_scanf failed (op=Modify; params=DN)\n"); op_shared_log_error_access (pb, "MOD", "???", "decoding error"); send_ldap_result( pb, LDAP_PROTOCOL_ERROR, NULL, NULL, 0, NULL ); slapi_ch_free_string(&rawdn); @@ -167,7 +167,7 @@ do_modify( Slapi_PBlock *pb ) } } - LDAPDebug(LDAP_DEBUG_ARGS, "do_modify: dn (%s)\n", rawdn, 0, 0 ); + slapi_log_err(SLAPI_LOG_ARGS, "do_modify", "dn (%s)\n", rawdn); /* * If nsslapd-minssf-exclude-rootdse is on, the minssf check has been @@ -285,7 +285,8 @@ do_modify( Slapi_PBlock *pb ) int connid, opid; slapi_pblock_get(pb, SLAPI_CONN_ID, &connid); slapi_pblock_get(pb, SLAPI_OPERATION_ID, &opid); - LDAPDebug(LDAP_DEBUG_ERR,"do_modify - Rejecting replicated password policy operation(conn=%d op=%d) for " + slapi_log_err(SLAPI_LOG_ERR,"do_modify", + "Rejecting replicated password policy operation(conn=%d op=%d) for " "entry %s. To allow these changes to be accepted, set passwordIsGlobalPolicy to 'on' in " "cn=config.\n", connid, opid, rawdn); } @@ -358,12 +359,12 @@ do_modify( Slapi_PBlock *pb ) } #ifdef LDAP_DEBUG - LDAPDebug(LDAP_DEBUG_ARGS, "modifications:\n", 0, 0, 0 ); + 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)) { - LDAPDebug(LDAP_DEBUG_ARGS, "\t%s: %s\n", - mod_op_image( mod->mod_op ), mod->mod_type, 0 ); + slapi_log_err(SLAPI_LOG_ARGS, "do_modify", "\t%s: %s\n", + mod_op_image( mod->mod_op ), mod->mod_type); } #endif @@ -467,7 +468,7 @@ slapi_modify_internal_set_pb (Slapi_PBlock *pb, const char *dn, PR_ASSERT (pb != NULL); if (pb == NULL || dn == NULL || mods == NULL) { - slapi_log_error(SLAPI_LOG_ERR, "slapi_modify_internal_set_pb", + slapi_log_err(SLAPI_LOG_ERR, "slapi_modify_internal_set_pb", "NULL parameter\n"); return; } @@ -496,7 +497,7 @@ slapi_modify_internal_set_pb_ext(Slapi_PBlock *pb, const Slapi_DN *sdn, PR_ASSERT (pb != NULL); if (pb == NULL || sdn == NULL || mods == NULL) { - slapi_log_error(SLAPI_LOG_ERR, "slapi_modify_internal_set_pb_ext", + slapi_log_err(SLAPI_LOG_ERR, "slapi_modify_internal_set_pb_ext", "NULL parameter\n"); return; } diff --git a/ldap/servers/slapd/modrdn.c b/ldap/servers/slapd/modrdn.c index b984c54..8b77539 100644 --- a/ldap/servers/slapd/modrdn.c +++ b/ldap/servers/slapd/modrdn.c @@ -52,7 +52,7 @@ do_modrdn( Slapi_PBlock *pb ) Slapi_DN snewdn; Slapi_DN *snewsuperior = NULL; - LDAPDebug(LDAP_DEBUG_TRACE, "do_modrdn\n", 0, 0, 0 ); + slapi_log_err(SLAPI_LOG_TRACE, "do_modrdn", "=>\n"); /* count the modrdn request */ slapi_counter_increment(g_get_global_snmp_vars()->ops_tbl.dsModifyRDNOps); @@ -75,9 +75,8 @@ do_modrdn( Slapi_PBlock *pb ) */ if (ber_scanf(ber, "{aab", &rawdn, &newrdn, &deloldrdn) == LBER_ERROR) { - LDAPDebug(LDAP_DEBUG_ERR, - "do_modrdn - ber_scanf failed (op=ModRDN; params=DN,newRDN,deleteOldRDN)\n", - 0, 0, 0 ); + slapi_log_err(SLAPI_LOG_ERR, "do_modrdn", + "ber_scanf failed (op=ModRDN; params=DN,newRDN,deleteOldRDN)\n"); op_shared_log_error_access (pb, "MODRDN", "???", "decoding error"); send_ldap_result( pb, LDAP_PROTOCOL_ERROR, NULL, "unable to decode DN, newRDN, or deleteOldRDN parameters", @@ -88,8 +87,8 @@ do_modrdn( Slapi_PBlock *pb ) if ( ber_peek_tag( ber, &len ) == LDAP_TAG_NEWSUPERIOR ) { /* This "len" is not used... */ if ( pb->pb_conn->c_ldapversion < LDAP_VERSION3 ) { - LDAPDebug(LDAP_DEBUG_ERR, - "do_modrdn - got newSuperior in LDAPv2 modrdn op\n", 0, 0, 0 ); + slapi_log_err(SLAPI_LOG_ERR, "do_modrdn", + "Got newSuperior in LDAPv2 modrdn op\n"); op_shared_log_error_access (pb, "MODRDN", rawdn?rawdn:"", "decoding error"); send_ldap_result( pb, LDAP_PROTOCOL_ERROR, NULL, @@ -99,9 +98,8 @@ do_modrdn( Slapi_PBlock *pb ) goto free_and_return; } if ( ber_scanf( ber, "a", &rawnewsuperior ) == LBER_ERROR ) { - LDAPDebug(LDAP_DEBUG_ERR, - "do_modrdn - ber_scanf failed (op=ModRDN; params=newSuperior)\n", - 0, 0, 0 ); + slapi_log_err(SLAPI_LOG_ERR, "do_modrdn", + "ber_scanf failed (op=ModRDN; params=newSuperior)\n"); op_shared_log_error_access (pb, "MODRDN", rawdn, "decoding error"); send_ldap_result( pb, LDAP_PROTOCOL_ERROR, NULL, "unable to decode newSuperior parameter", 0, NULL ); @@ -209,8 +207,8 @@ do_modrdn( Slapi_PBlock *pb ) goto free_and_return; } - LDAPDebug(LDAP_DEBUG_ARGS, - "do_modrdn: dn (%s) newrdn (%s) deloldrdn (%d)\n", dn, newrdn, + slapi_log_err(SLAPI_LOG_ARGS, + "do_modrd", "dn (%s) newrdn (%s) deloldrdn (%d)\n", dn, newrdn, deloldrdn ); slapi_pblock_set( pb, SLAPI_REQUESTOR_ISROOT, &pb->pb_op->o_isroot ); @@ -312,7 +310,7 @@ slapi_rename_internal_set_pb_ext(Slapi_PBlock *pb, PR_ASSERT (pb != NULL); if (pb == NULL || olddn == NULL || newrdn == NULL) { - slapi_log_error(SLAPI_LOG_ERR, "slapi_rename_internal_set_pb", + slapi_log_err(SLAPI_LOG_ERR, "slapi_rename_internal_set_pb_ext", "NULL parameter\n"); return; } @@ -349,7 +347,7 @@ static int rename_internal_pb (Slapi_PBlock *pb) if (!op) { opresult = 1; slapi_pblock_set(pb, SLAPI_PLUGIN_INTOP_RESULT, &opresult); - slapi_log_error(SLAPI_LOG_ERR, "rename_internal_pb", + slapi_log_err(SLAPI_LOG_ERR, "rename_internal_pb", "Internal error: pblock was not properly initialized\n"); return -1; } @@ -500,13 +498,13 @@ op_shared_rename(Slapi_PBlock *pb, int passin_args) if ((rdns = slapi_ldap_explode_rdn(newrdn, 0)) == NULL) { if ( !internal_op ) { - slapi_log_error(SLAPI_LOG_ARGS, NULL, + slapi_log_err(SLAPI_LOG_ARGS, "op_shared_rename", "conn=%" NSPRIu64 " op=%d MODRDN invalid new RDN (\"%s\")\n", pb->pb_conn->c_connid, pb->pb_op->o_opid, (NULL == newrdn) ? "(null)" : newrdn); } else { - slapi_log_error(SLAPI_LOG_ARGS, NULL, + slapi_log_err(SLAPI_LOG_ARGS, "op_shared_rename", "conn=%s op=%d MODRDN invalid new RDN (\"%s\")\n", LOG_INTERNAL_OP_CON_ID, LOG_INTERNAL_OP_OP_ID, @@ -531,15 +529,16 @@ op_shared_rename(Slapi_PBlock *pb, int passin_args) err = slapi_dn_syntax_check(pb, newsuperior, 1); if (err) { - LDAPDebug0Args(LDAP_DEBUG_ARGS, "Syntax check of newSuperior failed\n"); + slapi_log_err(SLAPI_LOG_ARGS, "op_shared_rename", + "Syntax check of newSuperior failed\n"); if (!internal_op) { - slapi_log_error(SLAPI_LOG_ARGS, NULL, + slapi_log_err(SLAPI_LOG_ARGS, "op_shared_rename", "conn=%" NSPRIu64 " op=%d MODRDN invalid new superior (\"%s\")", pb->pb_conn->c_connid, pb->pb_op->o_opid, newsuperior ? newsuperior : "(null)"); } else { - slapi_log_error(SLAPI_LOG_ARGS, NULL, + slapi_log_err(SLAPI_LOG_ARGS, "op_shared_rename", "conn=%s op=%d MODRDN invalid new superior (\"%s\")", LOG_INTERNAL_OP_CON_ID, LOG_INTERNAL_OP_OP_ID, @@ -552,7 +551,7 @@ op_shared_rename(Slapi_PBlock *pb, int passin_args) if (newsuperior != NULL) { - LDAPDebug(LDAP_DEBUG_ARGS, "do_moddn: newsuperior (%s)\n", newsuperior, 0, 0); + slapi_log_err(SLAPI_LOG_ARGS, "op_shared_rename", "do_moddn: newsuperior (%s)\n", newsuperior); } /* target spec is used to decide which plugins are applicable for the operation */ @@ -718,14 +717,16 @@ static int check_rdn_for_created_attrs(const char *newrdn) slapi_rdn_init_dn(rdn, newrdn); for (i = 0; type[i] != NULL; i++) { if (slapi_rdn_contains_attr(rdn, type[i], &value)) { - LDAPDebug(LDAP_DEBUG_TRACE, "Invalid DN. RDN contains %s attribute\n", type[i], 0, 0); + slapi_log_err(SLAPI_LOG_TRACE, "check_rdn_for_created_attrs", + "Invalid DN. RDN contains %s attribute\n", type[i]); rc = 1; break; } } slapi_rdn_free(&rdn); } else { - LDAPDebug(LDAP_DEBUG_TRACE, "check_rdn_for_created_attrs: Error allocating RDN\n", 0, 0, 0); + slapi_log_err(SLAPI_LOG_TRACE, "check_rdn_for_created_attrs", + "Error allocating RDN\n"); rc = -1; } diff --git a/ldap/servers/slapd/modutil.c b/ldap/servers/slapd/modutil.c index 1230abe..0251d07 100644 --- a/ldap/servers/slapd/modutil.c +++ b/ldap/servers/slapd/modutil.c @@ -528,7 +528,7 @@ void slapi_mods_dump(const Slapi_Mods *smods, const char *text) { int i; - LDAPDebug(LDAP_DEBUG_DEBUG, "smod - %s\n", text, 0, 0); + slapi_log_err(SLAPI_LOG_DEBUG, "slapi_mods_dump", "smod - %s\n", text); for(i=0;inum_mods;i++) { slapi_mod_dump(smods->mods[i],i); @@ -819,19 +819,23 @@ slapi_mod_dump(LDAPMod *mod, int n) switch ( operationtype ) { case LDAP_MOD_ADD: - LDAPDebug(LDAP_DEBUG_DEBUG, "smod %d - add: %s\n", n, mod->mod_type, 0); + slapi_log_err(SLAPI_LOG_DEBUG, "slapi_mod_dump", + "smod %d - add: %s\n", n, mod->mod_type); break; case LDAP_MOD_DELETE: - LDAPDebug(LDAP_DEBUG_DEBUG, "smod %d - delete: %s\n", n, mod->mod_type, 0); + slapi_log_err(SLAPI_LOG_DEBUG, "slapi_mod_dump", + "smod %d - delete: %s\n", n, mod->mod_type); break; case LDAP_MOD_REPLACE: - LDAPDebug(LDAP_DEBUG_DEBUG, "smod %d - replace: %s\n", n, mod->mod_type, 0); + slapi_log_err(SLAPI_LOG_DEBUG, "slapi_mod_dump", + "smod %d - replace: %s\n", n, mod->mod_type); break; case LDAP_MOD_IGNORE: - LDAPDebug(LDAP_DEBUG_DEBUG, "smod %d - ignore: %s\n", n, mod->mod_type, 0); + slapi_log_err(SLAPI_LOG_DEBUG, "slapi_mod_dump", + "smod %d - ignore: %s\n", n, mod->mod_type); break; } if(operationtype!=LDAP_MOD_IGNORE) @@ -846,13 +850,13 @@ slapi_mod_dump(LDAPMod *mod, int n) bufp = buf; slapi_ldif_put_type_and_value_with_options( &bufp, mod->mod_type, mod->mod_bvalues[i]->bv_val, mod->mod_bvalues[i]->bv_len, 0 ); *bufp = '\0'; - LDAPDebug(LDAP_DEBUG_DEBUG, "smod %d - value: %s", n, buf, 0); + slapi_log_err(SLAPI_LOG_DEBUG, "slapi_mod_dump", "smod %d - value: %s", n, buf); slapi_ch_free( (void**)&buf ); } } } else { - LDAPDebug(LDAP_DEBUG_DEBUG, "smod - null\n", 0, 0, 0); + slapi_log_err(SLAPI_LOG_DEBUG, "slapi_mod_dump", "smod - null\n"); } } diff --git a/ldap/servers/slapd/operation.c b/ldap/servers/slapd/operation.c index 0c1cd0e..19e572a 100644 --- a/ldap/servers/slapd/operation.c +++ b/ldap/servers/slapd/operation.c @@ -53,8 +53,10 @@ slapi_op_internal( Slapi_PBlock *pb ) void operation_out_of_disk_space() { - LDAPDebug(LDAP_DEBUG_ERR, "*** DISK FULL ***\n", 0, 0, 0); - LDAPDebug(LDAP_DEBUG_ERR, "Attempting to shut down gracefully.\n", 0, 0, 0); + slapi_log_err(SLAPI_LOG_EMERG, "operation_out_of_disk_space", + "*** DISK FULL ***\n"); + slapi_log_err(SLAPI_LOG_EMERG, "operation_out_of_disk_space", + "Attempting to shut down gracefully.\n"); g_set_shutdown( SLAPI_SHUTDOWN_DISKFULL ); } @@ -576,7 +578,7 @@ int slapi_connection_acquire(Slapi_Connection *conn) if (conn->c_flags & CONN_FLAG_CLOSING) { /* This may happen while other threads are still working on this connection */ - slapi_log_error(SLAPI_LOG_ERR, "connection", + slapi_log_err(SLAPI_LOG_ERR, "slapi_connection_acquire", "conn=%" NSPRIu64 " fd=%d Attempt to acquire connection in the closing state\n", conn->c_connid, conn->c_sd); rc = -1; @@ -602,10 +604,12 @@ slapi_connection_remove_operation( Slapi_PBlock *pb, Slapi_Connection *conn, Sla ; /* NULL */ if ( *tmp == NULL ) { if (op) { - LDAPDebug(LDAP_DEBUG_ERR, "connection_remove_operation: can't find op %d for conn %" NSPRIu64 "\n", - (int)op->o_msgid, conn->c_connid, 0 ); + slapi_log_err(SLAPI_LOG_ERR, "slapi_connection_remove_operation", + "Can't find op %d for conn %" NSPRIu64 "\n", + (int)op->o_msgid, conn->c_connid); } else { - LDAPDebug(LDAP_DEBUG_ERR, "connection_remove_operation: no operation provided\n",0, 0, 0); + slapi_log_err(SLAPI_LOG_ERR, "slapi_connection_remove_operation", + "No operation provided\n"); } } else { *tmp = (*tmp)->o_next; @@ -614,7 +618,7 @@ slapi_connection_remove_operation( Slapi_PBlock *pb, Slapi_Connection *conn, Sla if (release) { /* connection_release_nolock(conn); */ if (conn->c_refcnt <= 0) { - slapi_log_error(SLAPI_LOG_ERR, "slapi_connection_remove_operation", + slapi_log_err(SLAPI_LOG_ERR, "slapi_connection_remove_operation", "conn=%" NSPRIu64 " fd=%d Attempt to release connection that is not acquired\n", conn->c_connid, conn->c_sd); rc = -1; diff --git a/ldap/servers/slapd/opshared.c b/ldap/servers/slapd/opshared.c index 6c8c92b..3ce7970 100644 --- a/ldap/servers/slapd/opshared.c +++ b/ldap/servers/slapd/opshared.c @@ -113,7 +113,7 @@ modify_update_last_modified_attr(Slapi_PBlock *pb, Slapi_Mods *smods) struct slapi_componentid *cid = NULL; slapdFrontendConfig_t *slapdFrontendConfig = getFrontendConfig(); - LDAPDebug(LDAP_DEBUG_TRACE, "modify_update_last_modified_attr\n", 0, 0, 0); + slapi_log_err(SLAPI_LOG_TRACE, "modify_update_last_modified_attr", "=>\n"); slapi_pblock_get(pb, SLAPI_OPERATION, &op); bvals[0] = &bv; @@ -1087,8 +1087,8 @@ process_entry(Slapi_PBlock *pb, Slapi_Entry *e, int send_result) slapi_attr_get_numvalues(a, &numValues ); if (numValues == 0) { - LDAPDebug1Arg(LDAP_DEBUG_ERR, "process_entry - null ref in (%s)\n", - slapi_entry_get_dn_const(e)); + slapi_log_err(SLAPI_LOG_ERR, "process_entry", "NULL ref in (%s)\n", + slapi_entry_get_dn_const(e)); } else { @@ -1379,9 +1379,9 @@ iterate(Slapi_PBlock *pb, Slapi_Backend *be, int send_result, if ( rc != LDAP_SUCCESS ) { /* Send error result and abort op if the control is critical */ - LDAPDebug(LDAP_DEBUG_ERR, - "iterate - Failed to get effective rights for entry (%s), rc=%d\n", - slapi_entry_get_dn_const(e), rc, 0 ); + slapi_log_err(SLAPI_LOG_ERR, "iterate", + "Failed to get effective rights for entry (%s), rc=%d\n", + slapi_entry_get_dn_const(e), rc); send_ldap_result( pb, rc, NULL, errbuf, 0, NULL ); slapi_ch_free ( (void**)&errbuf ); if (gerentry) @@ -1669,9 +1669,9 @@ compute_limits (Slapi_PBlock *pb) } slapi_pblock_set(pb, SLAPI_SEARCH_SIZELIMIT, &sizelimit); - LDAPDebug(LDAP_DEBUG_TRACE, - "=> compute_limits: sizelimit=%d, timelimit=%d\n", - sizelimit, timelimit, 0 ); + slapi_log_err(SLAPI_LOG_TRACE, "compute_limits", + "=> sizelimit=%d, timelimit=%d\n", + sizelimit, timelimit); } /* Iterates through results and send them to the client. diff --git a/ldap/servers/slapd/pagedresults.c b/ldap/servers/slapd/pagedresults.c index a208ca2..a30e2fa 100644 --- a/ldap/servers/slapd/pagedresults.c +++ b/ldap/servers/slapd/pagedresults.c @@ -62,10 +62,10 @@ pagedresults_parse_control_value( Slapi_PBlock *pb, int i; int maxreqs = config_get_maxsimplepaged_per_conn(); - LDAPDebug0Args(LDAP_DEBUG_TRACE, "--> pagedresults_parse_control_value\n"); + slapi_log_err(SLAPI_LOG_TRACE, "pagedresults_parse_control_value", "=>\n"); if ( NULL == conn || NULL == op || NULL == pagesize || NULL == index ) { - LDAPDebug1Arg(LDAP_DEBUG_ERR, - "<-- pagedresults_parse_control_value: %d\n", + slapi_log_err(SLAPI_LOG_ERR, + "pagedresults_parse_control_value", "<= Error %d\n", LDAP_OPERATIONS_ERROR); return LDAP_OPERATIONS_ERROR; } @@ -73,28 +73,28 @@ pagedresults_parse_control_value( Slapi_PBlock *pb, if ( psbvp->bv_len == 0 || psbvp->bv_val == NULL ) { - LDAPDebug0Args(LDAP_DEBUG_ERR, - "<-- pagedresults_parse_control_value: no control value\n"); + slapi_log_err(SLAPI_LOG_ERR, "pagedresults_parse_control_value", + "<= no control value\n"); return LDAP_PROTOCOL_ERROR; } ber = ber_init( psbvp ); if ( ber == NULL ) { - LDAPDebug0Args(LDAP_DEBUG_ERR, - "<-- pagedresults_parse_control_value: no control value\n"); + slapi_log_err(SLAPI_LOG_ERR, "pagedresults_parse_control_value", + "<= no control value\n"); return LDAP_PROTOCOL_ERROR; } if ( ber_scanf( ber, "{io}", pagesize, &cookie ) == LBER_ERROR ) { - LDAPDebug0Args(LDAP_DEBUG_ERR, - "<-- pagedresults_parse_control_value: corrupted control value\n"); + slapi_log_err(SLAPI_LOG_ERR, "pagedresults_parse_control_value", + "<= corrupted control value\n"); return LDAP_PROTOCOL_ERROR; } if (!maxreqs) { - LDAPDebug1Arg(LDAP_DEBUG_ERR, - "pagedresults_parse_control_value: simple paged results requests per conn exeeded the limit: %d\n", - maxreqs); + slapi_log_err(SLAPI_LOG_ERR, "pagedresults_parse_control_value", + "Simple paged results requests per conn exceeded the limit: %d\n", + maxreqs); return LDAP_UNWILLING_TO_PERFORM; } @@ -140,9 +140,9 @@ pagedresults_parse_control_value( Slapi_PBlock *pb, } if ((maxreqs > 0) && (*index >= maxreqs)) { rc = LDAP_UNWILLING_TO_PERFORM; - LDAPDebug1Arg(LDAP_DEBUG_TRACE, - "pagedresults_parse_control_value: simple paged results requests per conn exeeded the limit: %d\n", - maxreqs); + slapi_log_err(SLAPI_LOG_TRACE, "pagedresults_parse_control_value", + "Simple paged results requests per conn exeeded the limit: %d\n", + maxreqs); goto bail; } @@ -161,8 +161,8 @@ pagedresults_parse_control_value( Slapi_PBlock *pb, slapi_ch_free_string(&ptr); if ((conn->c_pagedresults.prl_maxlen <= *index) || (*index < 0)){ rc = LDAP_PROTOCOL_ERROR; - LDAPDebug1Arg(LDAP_DEBUG_ERR, - "pagedresults_parse_control_value - Invalid cookie: %d\n", *index); + slapi_log_err(SLAPI_LOG_ERR, "pagedresults_parse_control_value", + "Invalid cookie: %d\n", *index); *index = -1; /* index is invalid. reinitializing it. */ goto bail; } @@ -186,7 +186,8 @@ pagedresults_parse_control_value( Slapi_PBlock *pb, } } else { rc = LDAP_PROTOCOL_ERROR; - LDAPDebug1Arg(LDAP_DEBUG_ERR, "pagedresults_parse_control_value - Invalid cookie: %d\n", *index); + slapi_log_err(SLAPI_LOG_ERR, "pagedresults_parse_control_value", + "Invalid cookie: %d\n", *index); } bail: slapi_ch_free((void **)&cookie.bv_val); @@ -207,8 +208,8 @@ bail: } PR_ExitMonitor(conn->c_mutex); - LDAPDebug1Arg(LDAP_DEBUG_TRACE, - "<-- pagedresults_parse_control_value: idx %d\n", *index); + slapi_log_err(SLAPI_LOG_TRACE, "pagedresults_parse_control_value", + "<= idx %d\n", *index); return rc; } @@ -237,8 +238,8 @@ pagedresults_set_response_control( Slapi_PBlock *pb, int iscritical, int i; int cookie = 0; - LDAPDebug1Arg(LDAP_DEBUG_TRACE, - "--> pagedresults_set_response_control: idx=%d\n", index); + slapi_log_err(SLAPI_LOG_TRACE, "pagedresults_set_response_control", + "=> idx=%d\n", index); if ( (ber = der_alloc()) == NULL ) { @@ -291,8 +292,8 @@ bailout: ber_free ( ber, 1 ); /* ber_free() checks for NULL param */ ber_bvfree ( berval ); /* ber_bvfree() checks for NULL param */ - LDAPDebug1Arg(LDAP_DEBUG_TRACE, - "<-- pagedresults_set_response_control: idx=%d\n", index); + slapi_log_err(SLAPI_LOG_TRACE, "pagedresults_set_response_control", + "<= idx=%d\n", index); } int @@ -303,13 +304,13 @@ pagedresults_free_one( Connection *conn, Operation *op, int index ) if (!op_is_pagedresults(op)) { return 0; /* noop */ } - LDAPDebug1Arg(LDAP_DEBUG_TRACE, - "--> pagedresults_free_one: idx=%d\n", index); + slapi_log_err(SLAPI_LOG_TRACE, "pagedresults_free_one", + "=> idx=%d\n", index); if (conn && (index > -1)) { PR_EnterMonitor(conn->c_mutex); if (conn->c_pagedresults.prl_count <= 0) { - LDAPDebug2Args(LDAP_DEBUG_TRACE, "pagedresults_free_one: " - "conn=%d paged requests list count is %d\n", + slapi_log_err(SLAPI_LOG_TRACE, "pagedresults_free_one", + "conn=%" NSPRIu64 " paged requests list count is %d\n", conn->c_connid, conn->c_pagedresults.prl_count); } else if (index < conn->c_pagedresults.prl_maxlen) { PagedResults *prp = conn->c_pagedresults.prl_list + index; @@ -320,7 +321,7 @@ pagedresults_free_one( Connection *conn, Operation *op, int index ) PR_ExitMonitor(conn->c_mutex); } - LDAPDebug1Arg(LDAP_DEBUG_TRACE, "<-- pagedresults_free_one: %d\n", rc); + slapi_log_err(SLAPI_LOG_TRACE, "pagedresults_free_one", "<= %d\n", rc); return rc; } @@ -337,8 +338,8 @@ pagedresults_free_one_msgid_nolock( Connection *conn, ber_int_t msgid ) if (conn->c_pagedresults.prl_maxlen <= 0) { ; /* Not a paged result. */ } else { - LDAPDebug1Arg(LDAP_DEBUG_TRACE, - "--> pagedresults_free_one_msgid_nolock: msgid=%d\n", msgid); + slapi_log_err(SLAPI_LOG_TRACE, + "pagedresults_free_one_msgid_nolock", "=> msgid=%d\n", msgid); for (i = 0; i < conn->c_pagedresults.prl_maxlen; i++) { if (conn->c_pagedresults.prl_list[i].pr_msgid == msgid) { PagedResults *prp = conn->c_pagedresults.prl_list + i; @@ -353,8 +354,8 @@ pagedresults_free_one_msgid_nolock( Connection *conn, ber_int_t msgid ) break; } } - LDAPDebug1Arg(LDAP_DEBUG_TRACE, - "<-- pagedresults_free_one_msgid_nolock: %d\n", rc); + slapi_log_err(SLAPI_LOG_TRACE, + "pagedresults_free_one_msgid_nolock" ,"<= %d\n", rc); } } @@ -366,8 +367,8 @@ Slapi_Backend * pagedresults_get_current_be(Connection *conn, int index) { Slapi_Backend *be = NULL; - LDAPDebug1Arg(LDAP_DEBUG_TRACE, - "--> pagedresults_get_current_be: idx=%d\n", index); + slapi_log_err(SLAPI_LOG_TRACE, + "pagedresults_get_current_be", "=> idx=%d\n", index); if (conn && (index > -1)) { PR_EnterMonitor(conn->c_mutex); if (index < conn->c_pagedresults.prl_maxlen) { @@ -375,8 +376,8 @@ pagedresults_get_current_be(Connection *conn, int index) } PR_ExitMonitor(conn->c_mutex); } - LDAPDebug1Arg(LDAP_DEBUG_TRACE, - "<-- pagedresults_get_current_be: %p\n", be); + slapi_log_err(SLAPI_LOG_TRACE, + "pagedresults_get_current_be", "<= %p\n", be); return be; } @@ -384,8 +385,8 @@ int pagedresults_set_current_be(Connection *conn, Slapi_Backend *be, int index, int nolock) { int rc = -1; - LDAPDebug1Arg(LDAP_DEBUG_TRACE, - "--> pagedresults_set_current_be: idx=%d\n", index); + slapi_log_err(SLAPI_LOG_TRACE, + "pagedresults_set_current_be", "=> idx=%d\n", index); if (conn && (index > -1)) { if (!nolock) PR_EnterMonitor(conn->c_mutex); if (index < conn->c_pagedresults.prl_maxlen) { @@ -394,8 +395,8 @@ pagedresults_set_current_be(Connection *conn, Slapi_Backend *be, int index, int rc = 0; if (!nolock) PR_ExitMonitor(conn->c_mutex); } - LDAPDebug1Arg(LDAP_DEBUG_TRACE, - "<-- pagedresults_set_current_be: %d\n", rc); + slapi_log_err(SLAPI_LOG_TRACE, + "pagedresults_set_current_be", "<= %d\n", rc); return rc; } @@ -406,8 +407,8 @@ pagedresults_get_search_result(Connection *conn, Operation *op, int locked, int if (!op_is_pagedresults(op)) { return sr; /* noop */ } - LDAPDebug2Args(LDAP_DEBUG_TRACE, - "--> pagedresults_get_search_result(%s): idx=%d\n", + slapi_log_err(SLAPI_LOG_TRACE, + "pagedresults_get_search_result", "=> (%s) idx=%d\n", locked?"locked":"not locked", index); if (conn && (index > -1)) { if (!locked) { @@ -420,8 +421,8 @@ pagedresults_get_search_result(Connection *conn, Operation *op, int locked, int PR_ExitMonitor(conn->c_mutex); } } - LDAPDebug1Arg(LDAP_DEBUG_TRACE, - "<-- pagedresults_get_search_result: %p\n", sr); + slapi_log_err(SLAPI_LOG_TRACE, + "pagedresults_get_search_result", "<=%p\n", sr); return sr; } @@ -432,8 +433,8 @@ pagedresults_set_search_result(Connection *conn, Operation *op, void *sr, int lo if (!op_is_pagedresults(op)) { return 0; /* noop */ } - LDAPDebug2Args(LDAP_DEBUG_TRACE, - "--> pagedresults_set_search_result: idx=%d, sr=%p\n", + slapi_log_err(SLAPI_LOG_TRACE, + "pagedresults_set_search_result", "=> idx=%d, sr=%p\n", index, sr); if (conn && (index > -1)) { if (!locked) PR_EnterMonitor(conn->c_mutex); @@ -447,8 +448,8 @@ pagedresults_set_search_result(Connection *conn, Operation *op, void *sr, int lo } if (!locked) PR_ExitMonitor(conn->c_mutex); } - LDAPDebug1Arg(LDAP_DEBUG_TRACE, - "<-- pagedresults_set_search_result: %d\n", rc); + slapi_log_err(SLAPI_LOG_TRACE, + "pagedresults_set_search_result", "=> %d\n", rc); return rc; } @@ -459,8 +460,8 @@ pagedresults_get_search_result_count(Connection *conn, Operation *op, int index) if (!op_is_pagedresults(op)) { return count; /* noop */ } - LDAPDebug1Arg(LDAP_DEBUG_TRACE, - "--> pagedresults_get_search_result_count: idx=%d\n", index); + slapi_log_err(SLAPI_LOG_TRACE, + "pagedresults_get_search_result_count", "=> idx=%d\n", index); if (conn && (index > -1)) { PR_EnterMonitor(conn->c_mutex); if (index < conn->c_pagedresults.prl_maxlen) { @@ -468,8 +469,8 @@ pagedresults_get_search_result_count(Connection *conn, Operation *op, int index) } PR_ExitMonitor(conn->c_mutex); } - LDAPDebug1Arg(LDAP_DEBUG_TRACE, - "<-- pagedresults_get_search_result_count: %d\n", count); + slapi_log_err(SLAPI_LOG_TRACE, + "pagedresults_get_search_result_count", "<= %d\n", count); return count; } @@ -481,8 +482,8 @@ pagedresults_set_search_result_count(Connection *conn, Operation *op, if (!op_is_pagedresults(op)) { return rc; /* noop */ } - LDAPDebug1Arg(LDAP_DEBUG_TRACE, - "--> pagedresults_set_search_result_count: idx=%d\n", index); + slapi_log_err(SLAPI_LOG_TRACE, + "pagedresults_set_search_result_count", "=> idx=%d\n", index); if (conn && (index > -1)) { PR_EnterMonitor(conn->c_mutex); if (index < conn->c_pagedresults.prl_maxlen) { @@ -491,8 +492,8 @@ pagedresults_set_search_result_count(Connection *conn, Operation *op, PR_ExitMonitor(conn->c_mutex); rc = 0; } - LDAPDebug1Arg(LDAP_DEBUG_TRACE, - "<-- pagedresults_set_search_result_count: %d\n", rc); + slapi_log_err(SLAPI_LOG_TRACE, + "pagedresults_set_search_result_count", "<= %d\n", rc); return rc; } @@ -505,9 +506,9 @@ pagedresults_get_search_result_set_size_estimate(Connection *conn, if (!op_is_pagedresults(op)) { return count; /* noop */ } - LDAPDebug1Arg(LDAP_DEBUG_TRACE, - "--> pagedresults_get_search_result_set_size_estimate: " - "idx=%d\n", index); + slapi_log_err(SLAPI_LOG_TRACE, + "pagedresults_get_search_result_set_size_estimate", + "=> idx=%d\n", index); if (conn && (index > -1)) { PR_EnterMonitor(conn->c_mutex); if (index < conn->c_pagedresults.prl_maxlen) { @@ -515,8 +516,8 @@ pagedresults_get_search_result_set_size_estimate(Connection *conn, } PR_ExitMonitor(conn->c_mutex); } - LDAPDebug1Arg(LDAP_DEBUG_TRACE, - "<-- pagedresults_get_search_result_set_size_estimate: %d\n", + slapi_log_err(SLAPI_LOG_TRACE, + "pagedresults_get_search_result_set_size_estimate", "<= %d\n", count); return count; } @@ -530,9 +531,9 @@ pagedresults_set_search_result_set_size_estimate(Connection *conn, if (!op_is_pagedresults(op)) { return rc; /* noop */ } - LDAPDebug1Arg(LDAP_DEBUG_TRACE, - "--> pagedresults_set_search_result_set_size_estimate: " - "idx=%d\n", index); + slapi_log_err(SLAPI_LOG_TRACE, + "pagedresults_set_search_result_set_size_estimate", + "=> idx=%d\n", index); if (conn && (index > -1)) { PR_EnterMonitor(conn->c_mutex); if (index < conn->c_pagedresults.prl_maxlen) { @@ -541,8 +542,8 @@ pagedresults_set_search_result_set_size_estimate(Connection *conn, PR_ExitMonitor(conn->c_mutex); rc = 0; } - LDAPDebug1Arg(LDAP_DEBUG_TRACE, - "<-- pagedresults_set_search_result_set_size_estimate: %d\n", + slapi_log_err(SLAPI_LOG_TRACE, + "<-- pagedresults_set_search_result_set_size_estimate", "<= %d\n", rc); return rc; } @@ -554,8 +555,8 @@ pagedresults_get_with_sort(Connection *conn, Operation *op, int index) if (!op_is_pagedresults(op)) { return flags; /* noop */ } - LDAPDebug1Arg(LDAP_DEBUG_TRACE, - "--> pagedresults_get_with_sort: idx=%d\n", index); + slapi_log_err(SLAPI_LOG_TRACE, + "pagedresults_get_with_sort", "=> idx=%d\n", index); if (conn && (index > -1)) { PR_EnterMonitor(conn->c_mutex); if (index < conn->c_pagedresults.prl_maxlen) { @@ -563,8 +564,8 @@ pagedresults_get_with_sort(Connection *conn, Operation *op, int index) } PR_ExitMonitor(conn->c_mutex); } - LDAPDebug1Arg(LDAP_DEBUG_TRACE, - "<-- pagedresults_get_with_sort: %p\n", flags); + slapi_log_err(SLAPI_LOG_TRACE, + "pagedresults_get_with_sort", "<= %d\n", flags); return flags; } @@ -576,8 +577,8 @@ pagedresults_set_with_sort(Connection *conn, Operation *op, if (!op_is_pagedresults(op)) { return rc; /* noop */ } - LDAPDebug1Arg(LDAP_DEBUG_TRACE, - "--> pagedresults_set_with_sort: idx=%d\n", index); + slapi_log_err(SLAPI_LOG_TRACE, + "pagedresults_set_with_sort", "=> idx=%d\n", index); if (conn && (index > -1)) { PR_EnterMonitor(conn->c_mutex); if (index < conn->c_pagedresults.prl_maxlen) { @@ -589,7 +590,7 @@ pagedresults_set_with_sort(Connection *conn, Operation *op, PR_ExitMonitor(conn->c_mutex); rc = 0; } - LDAPDebug1Arg(LDAP_DEBUG_TRACE, "<-- pagedresults_set_with_sort: %d\n", rc); + slapi_log_err(SLAPI_LOG_TRACE, "pagedresults_set_with_sort", "<= %d\n", rc); return rc; } @@ -600,8 +601,8 @@ pagedresults_get_unindexed(Connection *conn, Operation *op, int index) if (!op_is_pagedresults(op)) { return flags; /* noop */ } - LDAPDebug1Arg(LDAP_DEBUG_TRACE, - "--> pagedresults_get_unindexed: idx=%d\n", index); + slapi_log_err(SLAPI_LOG_TRACE, + "pagedresults_get_unindexed", "=> idx=%d\n", index); if (conn && (index > -1)) { PR_EnterMonitor(conn->c_mutex); if (index < conn->c_pagedresults.prl_maxlen) { @@ -609,8 +610,8 @@ pagedresults_get_unindexed(Connection *conn, Operation *op, int index) } PR_ExitMonitor(conn->c_mutex); } - LDAPDebug1Arg(LDAP_DEBUG_TRACE, - "<-- pagedresults_get_unindexed: %p\n", flags); + slapi_log_err(SLAPI_LOG_TRACE, + "pagedresults_get_unindexed", "<= %d\n", flags); return flags; } @@ -621,8 +622,8 @@ pagedresults_set_unindexed(Connection *conn, Operation *op, int index) if (!op_is_pagedresults(op)) { return rc; /* noop */ } - LDAPDebug1Arg(LDAP_DEBUG_TRACE, - "--> pagedresults_set_unindexed: idx=%d\n", index); + slapi_log_err(SLAPI_LOG_TRACE, + "pagedresults_set_unindexed", "=> idx=%d\n", index); if (conn && (index > -1)) { PR_EnterMonitor(conn->c_mutex); if (index < conn->c_pagedresults.prl_maxlen) { @@ -632,8 +633,8 @@ pagedresults_set_unindexed(Connection *conn, Operation *op, int index) PR_ExitMonitor(conn->c_mutex); rc = 0; } - LDAPDebug1Arg(LDAP_DEBUG_TRACE, - "<-- pagedresults_set_unindexed: %d\n", rc); + slapi_log_err(SLAPI_LOG_TRACE, + "pagedresults_set_unindexed", "<= %d\n", rc); return rc; } @@ -644,8 +645,8 @@ pagedresults_get_sort_result_code(Connection *conn, Operation *op, int index) if (!op_is_pagedresults(op)) { return code; /* noop */ } - LDAPDebug1Arg(LDAP_DEBUG_TRACE, - "--> pagedresults_get_sort_result_code: idx=%d\n", index); + slapi_log_err(SLAPI_LOG_TRACE, + "pagedresults_get_sort_result_code", "=> idx=%d\n", index); if (conn && (index > -1)) { PR_EnterMonitor(conn->c_mutex); if (index < conn->c_pagedresults.prl_maxlen) { @@ -653,8 +654,8 @@ pagedresults_get_sort_result_code(Connection *conn, Operation *op, int index) } PR_ExitMonitor(conn->c_mutex); } - LDAPDebug1Arg(LDAP_DEBUG_TRACE, - "<-- pagedresults_get_sort_result_code: %d\n", code); + slapi_log_err(SLAPI_LOG_TRACE, + "pagedresults_get_sort_result_code", "<= %d\n", code); return code; } @@ -666,8 +667,8 @@ pagedresults_set_sort_result_code(Connection *conn, Operation *op, if (!op_is_pagedresults(op)) { return rc; /* noop */ } - LDAPDebug1Arg(LDAP_DEBUG_TRACE, - "--> pagedresults_set_sort_result_code: idx=%d\n", index); + slapi_log_err(SLAPI_LOG_TRACE, + "pagedresults_set_sort_result_code", "=> idx=%d\n", index); if (conn && (index > -1)) { PR_EnterMonitor(conn->c_mutex); if (index < conn->c_pagedresults.prl_maxlen) { @@ -676,8 +677,8 @@ pagedresults_set_sort_result_code(Connection *conn, Operation *op, PR_ExitMonitor(conn->c_mutex); rc = 0; } - LDAPDebug1Arg(LDAP_DEBUG_TRACE, - "<-- pagedresults_set_sort_result_code: %d\n", rc); + slapi_log_err(SLAPI_LOG_TRACE, + "pagedresults_set_sort_result_code", "<= %d\n", rc); return rc; } @@ -689,8 +690,8 @@ pagedresults_set_timelimit(Connection *conn, Operation *op, if (!op_is_pagedresults(op)) { return rc; /* noop */ } - LDAPDebug1Arg(LDAP_DEBUG_TRACE, - "--> pagedresults_set_timelimit: idx=%d\n", index); + slapi_log_err(SLAPI_LOG_TRACE, + "pagedresults_set_timelimit", "=> idx=%d\n", index); if (conn && (index > -1)) { PR_EnterMonitor(conn->c_mutex); if (index < conn->c_pagedresults.prl_maxlen) { @@ -699,7 +700,7 @@ pagedresults_set_timelimit(Connection *conn, Operation *op, PR_ExitMonitor(conn->c_mutex); rc = 0; } - LDAPDebug1Arg(LDAP_DEBUG_TRACE, "<-- pagedresults_set_timelimit: %d\n", rc); + slapi_log_err(SLAPI_LOG_TRACE, "pagedresults_set_timelimit", "<= %d\n", rc); return rc; } @@ -711,10 +712,9 @@ pagedresults_set_sizelimit(Connection *conn, Operation *op, if (!op_is_pagedresults(op)) { return rc; /* noop */ } - LDAPDebug1Arg(LDAP_DEBUG_TRACE, - "--> pagedresults_set_sizelimit: idx=%d\n", index); + slapi_log_err(SLAPI_LOG_TRACE, "pagedresults_set_sizelimit", "=> idx=%d\n", index); op->o_pagedresults_sizelimit = sizelimit; - LDAPDebug1Arg(LDAP_DEBUG_TRACE, "<-- pagedresults_set_sizelimit: %d\n", rc); + slapi_log_err(SLAPI_LOG_TRACE, "pagedresults_set_sizelimit", "<= %d\n", rc); return rc; } @@ -725,10 +725,9 @@ pagedresults_get_sizelimit(Connection *conn, Operation *op, int index) if (!op_is_pagedresults(op)) { return sizelimit; /* noop */ } - LDAPDebug1Arg(LDAP_DEBUG_TRACE, - "--> pagedresults_get_sizelimit: idx=%d\n", index); + slapi_log_err(SLAPI_LOG_TRACE, "pagedresults_get_sizelimit", "=> idx=%d\n", index); sizelimit = op->o_pagedresults_sizelimit; - LDAPDebug0Args(LDAP_DEBUG_TRACE, "<-- pagedresults_get_sizelimit\n"); + slapi_log_err(SLAPI_LOG_TRACE, "pagedresults_get_sizelimit", "<=\n"); return sizelimit; } @@ -746,10 +745,10 @@ pagedresults_cleanup(Connection *conn, int needlock) int i; PagedResults *prp = NULL; - LDAPDebug0Args(LDAP_DEBUG_TRACE, "--> pagedresults_cleanup\n"); + slapi_log_err(SLAPI_LOG_TRACE, "pagedresults_cleanup", "=>\n"); if (NULL == conn) { - LDAPDebug0Args(LDAP_DEBUG_TRACE, "<-- pagedresults_cleanup: -\n"); + slapi_log_err(SLAPI_LOG_TRACE, "pagedresults_cleanup", "<= Connection is NULL\n"); return 0; } @@ -774,7 +773,7 @@ pagedresults_cleanup(Connection *conn, int needlock) if (needlock) { PR_ExitMonitor(conn->c_mutex); } - LDAPDebug1Arg(LDAP_DEBUG_TRACE, "<-- pagedresults_cleanup: %d\n", rc); + slapi_log_err(SLAPI_LOG_TRACE, "pagedresults_cleanup", "<= %d\n", rc); return rc; } @@ -791,10 +790,10 @@ pagedresults_cleanup_all(Connection *conn, int needlock) int i; PagedResults *prp = NULL; - LDAPDebug0Args(LDAP_DEBUG_TRACE, "--> pagedresults_cleanup_all\n"); + slapi_log_err(SLAPI_LOG_TRACE, "pagedresults_cleanup_all", "=>\n"); if (NULL == conn) { - LDAPDebug0Args(LDAP_DEBUG_TRACE, "<-- pagedresults_cleanup_all: -\n"); + slapi_log_err(SLAPI_LOG_TRACE, "pagedresults_cleanup_all", "<= Connection is NULL\n"); return 0; } @@ -820,7 +819,7 @@ pagedresults_cleanup_all(Connection *conn, int needlock) if (needlock) { PR_ExitMonitor(conn->c_mutex); } - LDAPDebug1Arg(LDAP_DEBUG_TRACE, "<-- pagedresults_cleanup_all: %d\n", rc); + slapi_log_err(SLAPI_LOG_TRACE, "pagedresults_cleanup_all", "<= %d\n", rc); return rc; } @@ -834,8 +833,8 @@ int pagedresults_check_or_set_processing(Connection *conn, int index) { int ret = 0; - LDAPDebug1Arg(LDAP_DEBUG_TRACE, - "--> pagedresults_check_or_set_processing\n", index); + slapi_log_err(SLAPI_LOG_TRACE, + "pagedresults_check_or_set_processing", "=>\n", index); if (conn && (index > -1)) { PR_EnterMonitor(conn->c_mutex); if (index < conn->c_pagedresults.prl_maxlen) { @@ -847,8 +846,8 @@ pagedresults_check_or_set_processing(Connection *conn, int index) } PR_ExitMonitor(conn->c_mutex); } - LDAPDebug1Arg(LDAP_DEBUG_TRACE, - "<-- pagedresults_check_or_set_processing: %d\n", ret); + slapi_log_err(SLAPI_LOG_TRACE, + "pagedresults_check_or_set_processing", "<= %d\n", ret); return ret; } @@ -861,8 +860,8 @@ int pagedresults_reset_processing(Connection *conn, int index) { int ret = 0; - LDAPDebug1Arg(LDAP_DEBUG_TRACE, - "--> pagedresults_reset_processing: idx=%d\n", index); + slapi_log_err(SLAPI_LOG_TRACE, + "pagedresults_reset_processing", "=> idx=%d\n", index); if (conn && (index > -1)) { PR_EnterMonitor(conn->c_mutex); if (index < conn->c_pagedresults.prl_maxlen) { @@ -874,8 +873,8 @@ pagedresults_reset_processing(Connection *conn, int index) } PR_ExitMonitor(conn->c_mutex); } - LDAPDebug1Arg(LDAP_DEBUG_TRACE, - "<-- pagedresults_reset_processing: %d\n", ret); + slapi_log_err(SLAPI_LOG_TRACE, + "pagedresults_reset_processing", "<= %d\n", ret); return ret; } #endif @@ -899,10 +898,10 @@ pagedresults_is_timedout_nolock(Connection *conn) PagedResults *prp = NULL; time_t ctime; - LDAPDebug0Args(LDAP_DEBUG_TRACE, "--> pagedresults_is_timedout\n"); + slapi_log_err(SLAPI_LOG_TRACE, "pagedresults_is_timedout", "=>\n"); if (!conn || (0 == conn->c_pagedresults.prl_maxlen)) { - LDAPDebug0Args(LDAP_DEBUG_TRACE, "<-- pagedresults_is_timedout: false\n"); + slapi_log_err(SLAPI_LOG_TRACE, "pagedresults_is_timedout", "<= false 1\n"); return 0; } @@ -911,12 +910,12 @@ pagedresults_is_timedout_nolock(Connection *conn) if (prp && (1 == conn->c_pagedresults.prl_maxlen)) { if (prp->pr_current_be && (prp->pr_timelimit > 0)) { if (ctime > prp->pr_timelimit) { - LDAPDebug0Args(LDAP_DEBUG_TRACE, "<-- pagedresults_is_timedout: true\n"); + slapi_log_err(SLAPI_LOG_TRACE, "pagedresults_is_timedout", "<= true\n"); return 1; } } } - LDAPDebug0Args(LDAP_DEBUG_TRACE, "<-- pagedresults_is_timedout: false\n"); + slapi_log_err(SLAPI_LOG_TRACE, "<-- pagedresults_is_timedout", "<= false 2\n"); return 0; } @@ -933,13 +932,13 @@ pagedresults_reset_timedout_nolock(Connection *conn) if (NULL == conn) { return 0; } - LDAPDebug0Args(LDAP_DEBUG_TRACE, "--> pagedresults_reset_timedout\n"); + slapi_log_err(SLAPI_LOG_TRACE, "pagedresults_reset_timedout", "=>\n"); for (i = 0; i < conn->c_pagedresults.prl_maxlen; i++) { prp = conn->c_pagedresults.prl_list + i; prp->pr_timelimit = 0; } - LDAPDebug0Args(LDAP_DEBUG_TRACE, "<-- pagedresults_reset_timedout: 0\n"); + slapi_log_err(SLAPI_LOG_TRACE, "pagedresults_reset_timedout", "<=\n"); return 0; } @@ -947,12 +946,12 @@ pagedresults_reset_timedout_nolock(Connection *conn) int pagedresults_in_use_nolock(Connection *conn) { - LDAPDebug0Args(LDAP_DEBUG_TRACE, "--> pagedresults_in_use\n"); + slapi_log_err(SLAPI_LOG_TRACE, "pagedresults_in_use_nolock", "=>\n"); if (NULL == conn) { - LDAPDebug0Args(LDAP_DEBUG_TRACE, "<-- pagedresults_in_use: -\n"); + slapi_log_err(SLAPI_LOG_TRACE, "pagedresults_in_use_nolock", "<= Connection is NULL\n"); return 0; } - LDAPDebug1Arg(LDAP_DEBUG_TRACE, "<-- pagedresults_in_use: %d\n", + slapi_log_err(SLAPI_LOG_TRACE, "pagedresults_in_use_nolock", "<= %d\n", conn->c_pagedresults.prl_count); return conn->c_pagedresults.prl_count; } @@ -1044,8 +1043,8 @@ pagedresults_set_search_result_pb(Slapi_PBlock *pb, void *sr, int locked) } slapi_pblock_get(pb, SLAPI_CONNECTION, &conn); slapi_pblock_get(pb, SLAPI_PAGED_RESULTS_INDEX, &index); - LDAPDebug2Args(LDAP_DEBUG_TRACE, - "--> pagedresults_set_search_result_pb: idx=%d, sr=%p\n", index, sr); + slapi_log_err(SLAPI_LOG_TRACE, + "pagedresults_set_search_result_pb", "=> idx=%d, sr=%p\n", index, sr); if (conn && (index > -1)) { if (!locked) PR_EnterMonitor(conn->c_mutex); if (index < conn->c_pagedresults.prl_maxlen) { @@ -1054,7 +1053,7 @@ pagedresults_set_search_result_pb(Slapi_PBlock *pb, void *sr, int locked) } if (!locked) PR_ExitMonitor(conn->c_mutex); } - LDAPDebug1Arg(LDAP_DEBUG_TRACE, - "<-- pagedresults_set_search_result_pb: %d\n", rc); + slapi_log_err(SLAPI_LOG_TRACE, + "pagedresults_set_search_result_pb", "<= %d\n", rc); return rc; } diff --git a/ldap/servers/slapd/passwd_extop.c b/ldap/servers/slapd/passwd_extop.c index 9a8b150..0a96c59 100644 --- a/ldap/servers/slapd/passwd_extop.c +++ b/ldap/servers/slapd/passwd_extop.c @@ -68,7 +68,7 @@ static int passwd_check_pwd(Slapi_Entry *targetEntry, const char *pwd){ Slapi_Value cv; Slapi_Value **bvals; - LDAPDebug(LDAP_DEBUG_TRACE, "=> passwd_check_pwd\n", 0, 0, 0 ); + slapi_log_err(SLAPI_LOG_TRACE, "passwd_check_pwd", "=>\n"); slapi_value_init_string(&cv,pwd); @@ -82,7 +82,7 @@ static int passwd_check_pwd(Slapi_Entry *targetEntry, const char *pwd){ } value_done(&cv); - LDAPDebug(LDAP_DEBUG_TRACE, "<= passwd_check_pwd: %d\n", rc, 0, 0 ); + slapi_log_err(SLAPI_LOG_TRACE, "passwd_check_pwd", "<= %d\n", rc); /* if the userPassword attribute is absent then rc is -1 */ return rc; @@ -97,16 +97,16 @@ static int passwd_modify_getEntry( const char *dn, Slapi_Entry **e2 ) { int search_result = 0; Slapi_DN sdn; - LDAPDebug(LDAP_DEBUG_TRACE, "=> passwd_modify_getEntry\n", 0, 0, 0 ); + slapi_log_err(SLAPI_LOG_TRACE, "passwd_modify_getEntry", "=>\n"); slapi_sdn_init_dn_byref( &sdn, dn ); if ((search_result = slapi_search_internal_get_entry( &sdn, NULL, e2, plugin_get_default_component_id())) != LDAP_SUCCESS ){ - LDAPDebug(LDAP_DEBUG_TRACE, "passwd_modify_getEntry: No such entry-(%s), err (%d)\n", - dn, search_result, 0); + slapi_log_err(SLAPI_LOG_TRACE, "passwd_modify_getEntry", "No such entry-(%s), err (%d)\n", + (char *)dn, search_result); } slapi_sdn_done( &sdn ); - LDAPDebug(LDAP_DEBUG_TRACE, "<= passwd_modify_getEntry: %d\n", search_result, 0, 0 ); + slapi_log_err(SLAPI_LOG_TRACE, "passwd_modify_getEntry", "<= %d\n", search_result); return search_result; } @@ -123,7 +123,7 @@ passwd_apply_mods(Slapi_PBlock *pb_orig, const Slapi_DN *sdn, Slapi_Mods *mods, LDAPControl **pb_resp_controls = NULL; int ret=0; - LDAPDebug(LDAP_DEBUG_TRACE, "=> passwd_apply_mods\n", 0, 0, 0 ); + slapi_log_err(SLAPI_LOG_TRACE, "passwd_apply_mods", "=>\n"); if (mods && (slapi_mods_get_num_mods(mods) > 0)) { @@ -164,14 +164,15 @@ passwd_apply_mods(Slapi_PBlock *pb_orig, const Slapi_DN *sdn, Slapi_Mods *mods, } if (ret != LDAP_SUCCESS){ - LDAPDebug(LDAP_DEBUG_TRACE, "WARNING: passwordPolicy modify error %d on entry '%s'\n", - ret, slapi_sdn_get_dn(sdn), 0); + slapi_log_err(SLAPI_LOG_TRACE, "passwd_apply_mods", + "WARNING: passwordPolicy modify error %d on entry '%s'\n", + ret, slapi_sdn_get_dn(sdn)); } pblock_done(&pb); } - LDAPDebug(LDAP_DEBUG_TRACE, "<= passwd_apply_mods: %d\n", ret, 0, 0 ); + slapi_log_err(SLAPI_LOG_TRACE, "passwd_apply_mods", "<= %d\n", ret); return ret; } @@ -185,7 +186,7 @@ static int passwd_modify_userpassword(Slapi_PBlock *pb_orig, Slapi_Entry *target int ret = 0; Slapi_Mods smods; - LDAPDebug(LDAP_DEBUG_TRACE, "=> passwd_modify_userpassword\n", 0, 0, 0 ); + slapi_log_err(SLAPI_LOG_TRACE, "passwd_modify_userpassword", "=>\n"); slapi_mods_init (&smods, 0); slapi_mods_add_string(&smods, LDAP_MOD_REPLACE, SLAPI_USERPWD_ATTR, newPasswd); @@ -196,7 +197,7 @@ static int passwd_modify_userpassword(Slapi_PBlock *pb_orig, Slapi_Entry *target slapi_mods_done(&smods); - LDAPDebug(LDAP_DEBUG_TRACE, "<= passwd_modify_userpassword: %d\n", ret, 0, 0 ); + slapi_log_err(SLAPI_LOG_TRACE, "passwd_modify_userpassword", "<= %d\n", ret); return ret; } @@ -302,11 +303,12 @@ static int passwd_modify_generate_policy_passwd( passwdPolicy *pwpolicy, } if ( categories > 0 ) { /* password generator does not support passwordMin8Bit */ - LDAPDebug(LDAP_DEBUG_ERR, - "passwd_modify_generate_policy_passwd - Unable to generate a password that meets the current " + slapi_log_err(SLAPI_LOG_ERR, + "passwd_modify_generate_policy_passwd", + "Unable to generate a password that meets the current " "password syntax rules. A minimum categories setting " "of %d is not supported with random password generation.\n", - pwpolicy->pw_mincategories, 0, 0 ); + pwpolicy->pw_mincategories); *errMesg = "Unable to generate new random password. Please contact the Administrator."; return LDAP_CONSTRAINT_VIOLATION; } @@ -379,10 +381,11 @@ static int passwd_modify_generate_passwd( passwdPolicy *pwpolicy, return LDAP_OPERATIONS_ERROR; } if ( pwpolicy->pw_min8bit > 0 ) { - LDAPDebug(LDAP_DEBUG_ERR, "passwd_modify_generate_passwd - Unable to generate a password that meets " - "the current password syntax rules. 8-bit syntax " - "restrictions are not supported with random password " - "generation.\n", 0, 0, 0 ); + slapi_log_err(SLAPI_LOG_ERR, "passwd_modify_generate_passwd", + "Unable to generate a password that meets " + "the current password syntax rules. 8-bit syntax " + "restrictions are not supported with random password " + "generation.\n"); *errMesg = "Unable to generate new random password. Please contact the Administrator."; return LDAP_CONSTRAINT_VIOLATION; } @@ -445,7 +448,7 @@ passwd_modify_extop( Slapi_PBlock *pb ) Slapi_Entry *referrals = NULL; /* Slapi_DN sdn; */ - LDAPDebug(LDAP_DEBUG_TRACE, "=> passwd_modify_extop\n", 0, 0, 0 ); + slapi_log_err(SLAPI_LOG_TRACE, "passwd_modify_extop", "=>\n"); /* Before going any further, we'll make sure that the right extended operation plugin * has been called: i.e., the OID shipped whithin the extended operation request must @@ -453,11 +456,11 @@ passwd_modify_extop( Slapi_PBlock *pb ) if ( slapi_pblock_get( pb, SLAPI_EXT_OP_REQ_OID, &oid ) != 0 ) { errMesg = "Could not get OID value from request.\n"; rc = LDAP_OPERATIONS_ERROR; - slapi_log_error(SLAPI_LOG_PLUGIN, "passwd_modify_extop", + slapi_log_err(SLAPI_LOG_PLUGIN, "passwd_modify_extop", "%s", errMesg ); goto free_and_return; } else { - slapi_log_error(SLAPI_LOG_PLUGIN, "passwd_modify_extop", + slapi_log_err(SLAPI_LOG_PLUGIN, "passwd_modify_extop", "Received extended operation request with OID %s\n", oid ); } @@ -466,7 +469,7 @@ passwd_modify_extop( Slapi_PBlock *pb ) rc = LDAP_OPERATIONS_ERROR; goto free_and_return; } else { - slapi_log_error(SLAPI_LOG_PLUGIN, "passwd_modify_extop", + slapi_log_err(SLAPI_LOG_PLUGIN, "passwd_modify_extop", "Password Modify extended operation request confirmed.\n" ); } @@ -479,7 +482,7 @@ passwd_modify_extop( Slapi_PBlock *pb ) if ( slapi_pblock_get(pb, SLAPI_CONN_SASL_SSF, &sasl_ssf) != 0) { errMesg = "Could not get SASL SSF from connection\n"; rc = LDAP_OPERATIONS_ERROR; - slapi_log_error(SLAPI_LOG_PLUGIN, "passwd_modify_extop", + slapi_log_err(SLAPI_LOG_PLUGIN, "passwd_modify_extop", "%s", errMesg ); goto free_and_return; } @@ -487,7 +490,7 @@ passwd_modify_extop( Slapi_PBlock *pb ) if ( slapi_pblock_get(pb, SLAPI_CONN_LOCAL_SSF, &local_ssf) != 0) { errMesg = "Could not get local SSF from connection\n"; rc = LDAP_OPERATIONS_ERROR; - slapi_log_error(SLAPI_LOG_PLUGIN, "passwd_modify_extop", + slapi_log_err(SLAPI_LOG_PLUGIN, "passwd_modify_extop", "%s", errMesg ); goto free_and_return; } @@ -551,7 +554,7 @@ passwd_modify_extop( Slapi_PBlock *pb ) int rc = 0; if ( ber_scanf( ber, "a", &rawdn) == LBER_ERROR ) { slapi_ch_free_string(&rawdn); - LDAPDebug(LDAP_DEBUG_ERR, "passwd_modify_extop - ber_scanf failed :{\n", 0, 0, 0 ); + slapi_log_err(SLAPI_LOG_ERR, "passwd_modify_extop", "ber_scanf failed :{\n"); errMesg = "ber_scanf failed at userID parse.\n"; rc = LDAP_PROTOCOL_ERROR; goto free_and_return; @@ -577,7 +580,7 @@ passwd_modify_extop( Slapi_PBlock *pb ) if (tag == LDAP_EXTOP_PASSMOD_TAG_OLDPWD ) { if ( ber_scanf( ber, "a", &oldPasswd ) == LBER_ERROR ) { slapi_ch_free_string(&oldPasswd); - LDAPDebug(LDAP_DEBUG_ERR, "passwd_modify_extop - ber_scanf failed :{\n", 0, 0, 0 ); + slapi_log_err(SLAPI_LOG_ERR, "passwd_modify_extop", "ber_scanf failed :{\n"); errMesg = "ber_scanf failed at oldPasswd parse.\n"; rc = LDAP_PROTOCOL_ERROR; goto free_and_return; @@ -590,7 +593,7 @@ passwd_modify_extop( Slapi_PBlock *pb ) { if ( ber_scanf( ber, "a", &newPasswd ) == LBER_ERROR ) { slapi_ch_free_string(&newPasswd); - LDAPDebug(LDAP_DEBUG_ERR, "passwd_modify_extop - ber_scanf failed :{\n", 0, 0, 0 ); + slapi_log_err(SLAPI_LOG_ERR, "passwd_modify_extop", "ber_scanf failed :{\n"); errMesg = "ber_scanf failed at newPasswd parse.\n"; rc = LDAP_PROTOCOL_ERROR; goto free_and_return; @@ -599,7 +602,7 @@ passwd_modify_extop( Slapi_PBlock *pb ) parse_req_done: /* Uncomment for debugging, otherwise we don't want to leak the password values into the log... */ - /* LDAPDebug(LDAP_DEBUG_ARGS, "passwd: dn (%s), oldPasswd (%s) ,newPasswd (%s)\n", + /* slapi_log_err(SLAPI_LOG_ARGS, "passwd: dn (%s), oldPasswd (%s) ,newPasswd (%s)\n", dn, oldPasswd, newPasswd); */ /* Get Bind DN */ @@ -806,11 +809,11 @@ parse_req_done: slapi_pblock_set(pb, SLAPI_EXT_OP_RET_VALUE, gen_passwd); } - LDAPDebug(LDAP_DEBUG_TRACE, "<= passwd_modify_extop: %d\n", rc, 0, 0 ); + slapi_log_err(SLAPI_LOG_TRACE, "passwd_modify_extop", "<= %d\n", rc); /* Free anything that we allocated above */ free_and_return: - slapi_log_error(SLAPI_LOG_PLUGIN, "passwd_modify_extop", + slapi_log_err(SLAPI_LOG_PLUGIN, "passwd_modify_extop", "%s", errMesg ? errMesg : "success" ); if ((rc == LDAP_REFERRAL) && (referrals)) { @@ -880,18 +883,18 @@ int passwd_modify_init( Slapi_PBlock *pb ) */ if ( slapi_pblock_get( pb, SLAPI_PLUGIN_ARGV, &argv ) != 0 ) { - slapi_log_error(SLAPI_LOG_PLUGIN, "passwd_modify_init", "Could not get argv\n" ); + slapi_log_err(SLAPI_LOG_PLUGIN, "passwd_modify_init", "Could not get argv\n" ); return( -1 ); } /* Compare the OID specified in the configuration file against the Passwd OID. */ if ( argv == NULL || strcmp( argv[0], EXTOP_PASSWD_OID ) != 0 ) { - slapi_log_error(SLAPI_LOG_PLUGIN, "passwd_modify_init", + slapi_log_err(SLAPI_LOG_PLUGIN, "passwd_modify_init", "OID is missing or is not %s\n", EXTOP_PASSWD_OID ); return( -1 ); } else { - slapi_log_error(SLAPI_LOG_PLUGIN, "passwd_modify_init", + slapi_log_err(SLAPI_LOG_PLUGIN, "passwd_modify_init", "Registering plug-in for Password Modify extended op %s.\n", argv[0] /* oid */); } @@ -905,7 +908,7 @@ int passwd_modify_init( Slapi_PBlock *pb ) slapi_pblock_set( pb, SLAPI_PLUGIN_EXT_OP_OIDLIST, passwd_oid_list ) != 0 || slapi_pblock_set( pb, SLAPI_PLUGIN_EXT_OP_NAMELIST, passwd_name_list ) != 0 ) { - slapi_log_error(SLAPI_LOG_PLUGIN, "passwd_modify_init", + slapi_log_err(SLAPI_LOG_PLUGIN, "passwd_modify_init", "Failed to set plug-in version, function, and OID.\n" ); return( -1 ); } diff --git a/ldap/servers/slapd/pblock.c b/ldap/servers/slapd/pblock.c index f9b22a7..44cc350 100644 --- a/ldap/servers/slapd/pblock.c +++ b/ldap/servers/slapd/pblock.c @@ -157,8 +157,8 @@ slapi_pblock_get( Slapi_PBlock *pblock, int arg, void *value ) break; case SLAPI_CONN_ID: if (pblock->pb_conn == NULL) { - LDAPDebug(LDAP_DEBUG_TRACE, - "slapi_pblock_get - Connection is NULL and hence cannot access SLAPI_CONN_ID \n", 0, 0, 0 ); + slapi_log_err(SLAPI_LOG_TRACE, + "slapi_pblock_get", "Connection is NULL and hence cannot access SLAPI_CONN_ID \n"); return (-1); } (*(PRUint64 *)value) = pblock->pb_conn->c_connid; @@ -170,8 +170,8 @@ slapi_pblock_get( Slapi_PBlock *pblock, int arg, void *value ) * a pointer that could be freed out from under them. */ if (pblock->pb_conn == NULL) { - LDAPDebug(LDAP_DEBUG_ERR, - "slapi_pblock_get - Connection is NULL and hence cannot access SLAPI_CONN_DN \n", 0, 0, 0 ); + slapi_log_err(SLAPI_LOG_ERR, + "slapi_pblock_get", "Connection is NULL and hence cannot access SLAPI_CONN_DN \n"); return (-1); } PR_EnterMonitor(pblock->pb_conn->c_mutex); @@ -181,8 +181,8 @@ slapi_pblock_get( Slapi_PBlock *pblock, int arg, void *value ) break; case SLAPI_CONN_AUTHTYPE:/* deprecated */ if (pblock->pb_conn == NULL) { - LDAPDebug(LDAP_DEBUG_ERR, - "slapi_pblock_get - Connection is NULL and hence cannot access SLAPI_CONN_AUTHTYPE \n", 0, 0, 0 ); + slapi_log_err(SLAPI_LOG_ERR, + "slapi_pblock_get", "Connection is NULL and hence cannot access SLAPI_CONN_AUTHTYPE \n"); return (-1); } PR_EnterMonitor(pblock->pb_conn->c_mutex); @@ -208,8 +208,8 @@ slapi_pblock_get( Slapi_PBlock *pblock, int arg, void *value ) case SLAPI_CONN_AUTHMETHOD: /* returns a copy */ if (pblock->pb_conn == NULL) { - LDAPDebug(LDAP_DEBUG_ERR, - "slapi_pblock_get - Connection is NULL and hence cannot access SLAPI_CONN_AUTHMETHOD \n", 0, 0, 0 ); + slapi_log_err(SLAPI_LOG_ERR, + "slapi_pblock_get", "Connection is NULL and hence cannot access SLAPI_CONN_AUTHMETHOD \n"); return (-1); } PR_EnterMonitor(pblock->pb_conn->c_mutex); @@ -296,8 +296,8 @@ slapi_pblock_get( Slapi_PBlock *pblock, int arg, void *value ) break; case SLAPI_CONN_IS_REPLICATION_SESSION: if (pblock->pb_conn == NULL) { - LDAPDebug(LDAP_DEBUG_ERR, - "slapi_pblock_get - Connection is NULL and hence cannot access SLAPI_CONN_IS_REPLICATION_SESSION \n", 0, 0, 0 ); + slapi_log_err(SLAPI_LOG_ERR, + "slapi_pblock_get", "Connection is NULL and hence cannot access SLAPI_CONN_IS_REPLICATION_SESSION \n"); return (-1); } PR_EnterMonitor(pblock->pb_conn->c_mutex); @@ -306,8 +306,8 @@ slapi_pblock_get( Slapi_PBlock *pblock, int arg, void *value ) break; case SLAPI_CONN_IS_SSL_SESSION: if (pblock->pb_conn == NULL) { - LDAPDebug(LDAP_DEBUG_ERR, - "slapi_pblock_get - Connection is NULL and hence cannot access SLAPI_CONN_IS_SSL_SESSION \n", 0, 0, 0 ); + slapi_log_err(SLAPI_LOG_ERR, + "slapi_pblock_get", "Connection is NULL and hence cannot access SLAPI_CONN_IS_SSL_SESSION \n"); return (-1); } PR_EnterMonitor(pblock->pb_conn->c_mutex); @@ -316,8 +316,8 @@ slapi_pblock_get( Slapi_PBlock *pblock, int arg, void *value ) break; case SLAPI_CONN_SASL_SSF: if (pblock->pb_conn == NULL) { - LDAPDebug(LDAP_DEBUG_ERR, - "slapi_pblock_get - Connection is NULL and hence cannot access SLAPI_CONN_SASL_SSF \n", 0, 0, 0 ); + slapi_log_err(SLAPI_LOG_ERR, + "slapi_pblock_get", "Connection is NULL and hence cannot access SLAPI_CONN_SASL_SSF \n"); return (-1); } PR_EnterMonitor(pblock->pb_conn->c_mutex); @@ -326,8 +326,8 @@ slapi_pblock_get( Slapi_PBlock *pblock, int arg, void *value ) break; case SLAPI_CONN_SSL_SSF: if (pblock->pb_conn == NULL) { - LDAPDebug(LDAP_DEBUG_ERR, - "slapi_pblock_get - Connection is NULL and hence cannot access SLAPI_CONN_SSL_SSF \n", 0, 0, 0 ); + slapi_log_err(SLAPI_LOG_ERR, + "slapi_pblock_get", "Connection is NULL and hence cannot access SLAPI_CONN_SSL_SSF \n"); return (-1); } PR_EnterMonitor(pblock->pb_conn->c_mutex); @@ -336,8 +336,8 @@ slapi_pblock_get( Slapi_PBlock *pblock, int arg, void *value ) break; case SLAPI_CONN_LOCAL_SSF: if (pblock->pb_conn == NULL) { - LDAPDebug(LDAP_DEBUG_ERR, - "slapi_pblock_get - Connection is NULL and hence cannot access SLAPI_CONN_LOCAL_SSF \n", 0, 0, 0 ); + slapi_log_err(SLAPI_LOG_ERR, + "slapi_pblock_get", "Connection is NULL and hence cannot access SLAPI_CONN_LOCAL_SSF \n"); return (-1); } PR_EnterMonitor(pblock->pb_conn->c_mutex); @@ -346,8 +346,8 @@ slapi_pblock_get( Slapi_PBlock *pblock, int arg, void *value ) break; case SLAPI_CONN_CERT: if (pblock->pb_conn == NULL) { - LDAPDebug(LDAP_DEBUG_ERR, - "slapi_pblock_get - Connection is NULL and hence cannot access SLAPI_CONN_CERT \n", 0, 0, 0 ); + slapi_log_err(SLAPI_LOG_ERR, + "slapi_pblock_get", "Connection is NULL and hence cannot access SLAPI_CONN_CERT \n"); return (-1); } ( *(CERTCertificate **) value) = pblock->pb_conn->c_client_cert; @@ -357,16 +357,16 @@ slapi_pblock_get( Slapi_PBlock *pblock, int arg, void *value ) break; case SLAPI_OPERATION_TYPE: if (pblock->pb_op == NULL) { - LDAPDebug(LDAP_DEBUG_ERR, - "slapi_pblock_get - Operation is NULL and hence cannot access SLAPI_OPERATION_TYPE \n", 0, 0, 0 ); + slapi_log_err(SLAPI_LOG_ERR, + "slapi_pblock_get", "Operation is NULL and hence cannot access SLAPI_OPERATION_TYPE \n"); return (-1); } (*(int *)value) = pblock->pb_op->o_params.operation_type; break; case SLAPI_OPINITIATED_TIME: if (pblock->pb_op == NULL) { - LDAPDebug(LDAP_DEBUG_ERR, - "slapi_pblock_get - Operation is NULL and hence cannot access SLAPI_OPINITIATED_TIME \n", 0, 0, 0 ); + slapi_log_err(SLAPI_LOG_ERR, + "slapi_pblock_get", "Operation is NULL and hence cannot access SLAPI_OPINITIATED_TIME \n"); return (-1); } (*(time_t *)value) = pblock->pb_op->o_time; @@ -1830,8 +1830,8 @@ slapi_pblock_get( Slapi_PBlock *pblock, int arg, void *value ) case SLAPI_CLIENT_DNS: if (pblock->pb_conn == NULL) { - LDAPDebug(LDAP_DEBUG_ERR, - "slapi_pblock_get - Connection is NULL and hence cannot access SLAPI_CLIENT_DNS \n", 0, 0, 0 ); + slapi_log_err(SLAPI_LOG_ERR, + "slapi_pblock_get", "Connection is NULL and hence cannot access SLAPI_CLIENT_DNS \n"); return (-1); } (*(struct berval ***)value ) = pblock->pb_conn->c_domain; @@ -1972,8 +1972,8 @@ slapi_pblock_get( Slapi_PBlock *pblock, int arg, void *value ) break; default: - LDAPDebug(LDAP_DEBUG_ERR, - "Unknown parameter block argument %d\n", arg, 0, 0 ); + slapi_log_err(SLAPI_LOG_ERR, "slapi_pblock_get", + "Unknown parameter block argument %d\n", arg); return( -1 ); } @@ -2021,8 +2021,8 @@ slapi_pblock_set( Slapi_PBlock *pblock, int arg, void *value ) break; case SLAPI_CONN_ID: if (pblock->pb_conn == NULL) { - LDAPDebug(LDAP_DEBUG_ERR, - "slapi_pblock_set - Connection is NULL and hence cannot access SLAPI_CONN_ID \n", 0, 0, 0 ); + slapi_log_err(SLAPI_LOG_ERR, + "slapi_pblock_set", "Connection is NULL and hence cannot access SLAPI_CONN_ID \n"); return (-1); } pblock->pb_conn->c_connid = *((PRUint64 *) value); @@ -2034,8 +2034,8 @@ slapi_pblock_set( Slapi_PBlock *pblock, int arg, void *value ) * free the current authtype. */ if (pblock->pb_conn == NULL) { - LDAPDebug(LDAP_DEBUG_ERR, - "slapi_pblock_set - Connection is NULL and hence cannot access SLAPI_CONN_DN \n", 0, 0, 0 ); + slapi_log_err(SLAPI_LOG_ERR, + "slapi_pblock_set", "Connection is NULL and hence cannot access SLAPI_CONN_DN \n"); return (-1); } slapi_pblock_get(pblock, SLAPI_CONN_AUTHMETHOD, &authtype); @@ -2046,8 +2046,9 @@ slapi_pblock_set( Slapi_PBlock *pblock, int arg, void *value ) case SLAPI_CONN_AUTHTYPE: /* deprecated */ case SLAPI_CONN_AUTHMETHOD: if (pblock->pb_conn == NULL) { - LDAPDebug(LDAP_DEBUG_ERR, - "slapi_pblock_set - Connection is NULL and hence cannot access SLAPI_CONN_AUTHMETHOD \n", 0, 0, 0 ); + slapi_log_err(SLAPI_LOG_ERR, + "slapi_pblock_set", + "Connection is NULL and hence cannot access SLAPI_CONN_AUTHMETHOD \n"); return (-1); } PR_EnterMonitor(pblock->pb_conn->c_mutex); @@ -2057,8 +2058,9 @@ slapi_pblock_set( Slapi_PBlock *pblock, int arg, void *value ) break; case SLAPI_CONN_IS_REPLICATION_SESSION: if (pblock->pb_conn == NULL) { - LDAPDebug(LDAP_DEBUG_ERR, - "slapi_pblock_set - Connection is NULL and hence cannot access SLAPI_CONN_IS_REPLICATION_SESSION \n", 0, 0, 0 ); + slapi_log_err(SLAPI_LOG_ERR, + "slapi_pblock_set", + "Connection is NULL and hence cannot access SLAPI_CONN_IS_REPLICATION_SESSION \n"); return (-1); } PR_EnterMonitor(pblock->pb_conn->c_mutex); @@ -3452,8 +3454,8 @@ slapi_pblock_set( Slapi_PBlock *pblock, int arg, void *value ) break; case SLAPI_CLIENT_DNS: if (pblock->pb_conn == NULL) { - LDAPDebug(LDAP_DEBUG_ERR, - "slapi_pblock_set - Connection is NULL and hence cannot access SLAPI_CLIENT_DNS \n", 0, 0, 0 ); + slapi_log_err(SLAPI_LOG_ERR, + "slapi_pblock_set", "Connection is NULL and hence cannot access SLAPI_CLIENT_DNS \n"); return (-1); } pblock->pb_conn->c_domain = *((struct berval ***) value ); @@ -3587,8 +3589,8 @@ slapi_pblock_set( Slapi_PBlock *pblock, int arg, void *value ) break; default: - LDAPDebug(LDAP_DEBUG_ERR, - "Unknown parameter block argument %d\n", arg, 0, 0 ); + slapi_log_err(SLAPI_LOG_ERR, "slapi_pblock_set", + "Unknown parameter block argument %d\n", arg); return( -1 ); } diff --git a/ldap/servers/slapd/plugin.c b/ldap/servers/slapd/plugin.c index dae2184..2842378 100644 --- a/ldap/servers/slapd/plugin.c +++ b/ldap/servers/slapd/plugin.c @@ -99,7 +99,7 @@ void global_plugin_init() { if((global_rwlock = slapi_new_rwlock()) == NULL){ - slapi_log_error(SLAPI_LOG_ERR, "global_plugin_init", + slapi_log_err(SLAPI_LOG_ERR, "global_plugin_init", "Failed to create global plugin rwlock.\n" ); exit (1); } @@ -311,7 +311,7 @@ slapi_register_plugin_ext( if ((found_precedence == PLUGIN_DEFAULT_PRECEDENCE) && group_identity) { struct slapi_componentid * cid = (struct slapi_componentid *) group_identity; if (cid->sci_plugin && (cid->sci_plugin->plg_precedence != PLUGIN_DEFAULT_PRECEDENCE)) { - slapi_log_error(SLAPI_LOG_PLUGIN, NULL, + slapi_log_err(SLAPI_LOG_PLUGIN, "slapi_register_plugin_ext", "Plugin precedence (%s) reset to group precedence (%s): %d \n", name ? name : "", cid->sci_plugin->plg_name ? cid->sci_plugin->plg_name : "", @@ -775,8 +775,8 @@ slapi_send_ldap_result( Slapi_PBlock *pb, int err, char *matched, char *text, { if (urls || nentries) { - LDAPDebug(LDAP_DEBUG_ERR, "slapi_send_ldap_result - urls or nentries set" - "in sendldap_result while NO_SUCH_OBJECT returned\n",0,0,0); + slapi_log_err(SLAPI_LOG_ERR, "slapi_send_ldap_result", + "urls or nentries set in sendldap_result while NO_SUCH_OBJECT returned\n"); } slapi_set_ldap_result(pb, err, matched, text, 0, NULL); @@ -1282,8 +1282,8 @@ plugin_start(Slapi_Entry *entry, char *returntext) if (enabled){ if(plugin_index == plugin_idx){ /* finally, perform the op on the plugin */ - LDAPDebug(LDAP_DEBUG_PLUGIN, "Starting %s plugin %s\n" , - config[plugin_index].type, config[plugin_index].name, 0 ); + slapi_log_err(SLAPI_LOG_PLUGIN, "plugin_start", "Starting %s plugin %s\n", + config[plugin_index].type, config[plugin_index].name); /* * Put the plugin into the temporary pblock so the startup functions have * access to the real plugin for registering callbacks, task, etc. @@ -1298,8 +1298,8 @@ plugin_start(Slapi_Entry *entry, char *returntext) * Delete the plugin(undo everything), as we don't know how far the start * function got. */ - LDAPDebug(LDAP_DEBUG_ERR, "plugin_start - Failed to start %s plugin %s\n" , - config[plugin_index].type, config[plugin_index].name, 0 ); + slapi_log_err(SLAPI_LOG_ERR, "plugin_start", "Failed to start %s plugin %s\n" , + config[plugin_index].type, config[plugin_index].name); PR_snprintf (returntext, SLAPI_DSE_RETURNTEXT_SIZE,"Failed to start plugin \"%s\". See errors log.", config[plugin_index].name); plugin_delete(entry, returntext, 1); @@ -1344,14 +1344,15 @@ plugin_start(Slapi_Entry *entry, char *returntext) if(plugins_started == 0){ /* a dependency was not resolved - error */ - LDAPDebug(LDAP_DEBUG_ERR, "plugin_start - Failed to resolve plugin dependencies\n" , 0, 0, 0 ); + slapi_log_err(SLAPI_LOG_ERR, "plugin_start", "Failed to resolve plugin dependencies\n"); PR_snprintf (returntext, SLAPI_DSE_RETURNTEXT_SIZE,"Failed to resolve plugin dependencies."); /* list the plugins yet to perform op */ i = 0; while(i < total_plugins){ if(config[i].op_done == 0){ - LDAPDebug(LDAP_DEBUG_ERR, "plugin_start - %s plugin %s is not started\n" , config[i].type, config[i].name, 0 ); + slapi_log_err(SLAPI_LOG_ERR, "plugin_start", + "%s plugin %s is not started\n" , config[i].type, config[i].name); plugin_remove_plugins(config[i].plugin, config[i].type); } i++; @@ -1775,7 +1776,8 @@ plugin_dependency_startall(int argc, char** argv, char *errmsg, int operation, c { /* finally, perform the op on the plugin */ - LDAPDebug(LDAP_DEBUG_PLUGIN, "Starting %s plugin %s\n" , config[plugin_index].type, config[plugin_index].name, 0 ); + slapi_log_err(SLAPI_LOG_PLUGIN, "plugin_dependency_startall", + "Starting %s plugin %s\n" , config[plugin_index].type, config[plugin_index].name); /* * Put the plugin into the temporary pblock so the startup functions have * access to the real plugin for registering callbacks, tasks, etc. @@ -1794,8 +1796,9 @@ plugin_dependency_startall(int argc, char** argv, char *errmsg, int operation, c * problem then the plugin will never start and eventually it will * trigger an exit anyway. */ - LDAPDebug(LDAP_DEBUG_ERR, "plugin_dependency_startall - Failed to start %s plugin %s\n", - config[plugin_index].type, config[plugin_index].name, 0 ); + slapi_log_err(SLAPI_LOG_ERR, "plugin_dependency_startall", + "Failed to start %s plugin %s\n", + config[plugin_index].type, config[plugin_index].name); continue; } else { /* now set the plugin and all its registered plugin functions as started */ @@ -1843,8 +1846,7 @@ plugin_dependency_startall(int argc, char** argv, char *errmsg, int operation, c if(plugins_started == 0) { /* a dependency was not resolved - error */ - LDAPDebug(LDAP_DEBUG_ERR, "plugin_dependency_startall - Failed to resolve plugin dependencies\n", - 0, 0, 0 ); + slapi_log_err(SLAPI_LOG_ERR, "plugin_dependency_startall", "Failed to resolve plugin dependencies\n"); /* list the plugins yet to perform op */ i = 0; @@ -1852,8 +1854,8 @@ plugin_dependency_startall(int argc, char** argv, char *errmsg, int operation, c { if(config[i].op_done == 0) { - LDAPDebug(LDAP_DEBUG_ERR, "plugin_dependency_startall - %s plugin %s is not started\n", - config[i].type, config[i].name, 0 ); + slapi_log_err(SLAPI_LOG_ERR, "plugin_dependency_startall", "%s plugin %s is not started\n", + config[i].type, config[i].name); } i++; } @@ -2034,8 +2036,9 @@ plugin_call_func (struct slapdplugin *list, int operation, Slapi_PBlock *pb, int { char *n = list->plg_name; - LDAPDebug(LDAP_DEBUG_TRACE, "Calling plugin '%s' #%d type %d\n", - (n==NULL?"noname":n), count, operation ); + slapi_log_err(SLAPI_LOG_TRACE, "plugin_call_func", + "Calling plugin '%s' #%d type %d\n", + (n==NULL?"noname":n), count, operation ); /* counters_to_errors_log("before plugin call"); */ /* @@ -2147,7 +2150,7 @@ slapi_register_supported_saslmechanism( char *mechanism ) supported_saslmechanisms_lock = slapi_new_rwlock(); if (NULL == supported_saslmechanisms_lock) { /* Out of resources */ - slapi_log_error(SLAPI_LOG_ERR, + slapi_log_err(SLAPI_LOG_ERR, "slapi_register_supported_saslmechanism", "Failed to create lock.\n"); exit (1); } @@ -2197,7 +2200,7 @@ ldapi_init_extended_ops( void ) extended_ops_lock = slapi_new_rwlock(); if (NULL == extended_ops_lock) { /* Out of resources */ - slapi_log_error(SLAPI_LOG_ERR, "ldapi_init_extended_ops", + slapi_log_err(SLAPI_LOG_ERR, "ldapi_init_extended_ops", "Failed to create lock.\n"); exit (1); } @@ -2427,9 +2430,10 @@ plugin_restart(Slapi_Entry *pentryBefore, Slapi_Entry *pentryAfter) * be allowed */ if(plugin_is_critical(pentryBefore)){ - LDAPDebug(LDAP_DEBUG_ERR, "plugin_restart - Plugin (%s) is critical " - "to server operation. Server requires restart for changes to " - "take effect.\n", slapi_entry_get_dn(pentryBefore),0,0); + slapi_log_err(SLAPI_LOG_ERR, "plugin_restart", + "Plugin (%s) is critical to server operation. " + "Server requires restart for changes to take effect.\n", + slapi_entry_get_dn(pentryBefore)); return 0; } @@ -2438,22 +2442,25 @@ plugin_restart(Slapi_Entry *pentryBefore, Slapi_Entry *pentryAfter) if(plugin_delete(pentryBefore, returntext, 1) == LDAP_SUCCESS){ if(plugin_add(pentryAfter, returntext, 1) == LDAP_SUCCESS){ - LDAPDebug(LDAP_DEBUG_PLUGIN, "plugin_restart: Plugin (%s) has been successfully " - "restarted after configuration change.\n", - slapi_entry_get_dn(pentryAfter),0,0); + slapi_log_err(SLAPI_LOG_PLUGIN, "plugin_restart", + "Plugin (%s) has been successfully restarted after configuration change.\n", + slapi_entry_get_dn(pentryAfter)); } else { - LDAPDebug(LDAP_DEBUG_ERR, "plugin_restart - Plugin (%s) failed to restart after " - "configuration change (%s). Reverting to original plugin entry.\n", - slapi_entry_get_dn(pentryAfter), returntext, 0); + slapi_log_err(SLAPI_LOG_ERR, "plugin_restart", + "Plugin (%s) failed to restart after configuration change (%s). " + "Reverting to original plugin entry.\n", + slapi_entry_get_dn(pentryAfter), returntext); if(plugin_add(pentryBefore, returntext, 1) != LDAP_SUCCESS){ - LDAPDebug(LDAP_DEBUG_ERR, "plugin_restart - Plugin (%s) failed to reload " - "original plugin (%s)\n",slapi_entry_get_dn(pentryBefore), returntext, 0); + slapi_log_err(SLAPI_LOG_ERR, "plugin_restart", + "Plugin (%s) failed to reload original plugin (%s)\n", + slapi_entry_get_dn(pentryBefore), returntext); } rc = 1; } } else { - LDAPDebug(LDAP_DEBUG_ERR,"plugin_restart - Failed to disable/stop the plugin (%s): %s\n", - slapi_entry_get_dn(pentryBefore), returntext, 0); + slapi_log_err(SLAPI_LOG_ERR,"plugin_restart", + "Failed to disable/stop the plugin (%s): %s\n", + slapi_entry_get_dn(pentryBefore), returntext); rc = 1; } @@ -2509,9 +2516,9 @@ set_plugin_config_from_entry( { if (plugin_config_set_action(&config->plgc_schema_check, value)) { - LDAPDebug(LDAP_DEBUG_PLUGIN, "Error: invalid value %s for attribute %s " - "from entry %s\n", value, ATTR_PLUGIN_SCHEMA_CHECK, - slapi_entry_get_dn_const(plugin_entry)); + slapi_log_err(SLAPI_LOG_PLUGIN, "set_plugin_config_from_entry", + "Invalid value %s for attribute %s from entry %s\n", + value, ATTR_PLUGIN_SCHEMA_CHECK, slapi_entry_get_dn_const(plugin_entry)); status = 1; } slapi_ch_free((void**)&value); @@ -2522,9 +2529,9 @@ set_plugin_config_from_entry( { if (plugin_config_set_action(&config->plgc_log_access, value)) { - LDAPDebug(LDAP_DEBUG_PLUGIN, "Error: invalid value %s for attribute %s " - "from entry %s\n", value, ATTR_PLUGIN_LOG_ACCESS, - slapi_entry_get_dn_const(plugin_entry)); + slapi_log_err(SLAPI_LOG_PLUGIN, "set_plugin_config_from_entry", + "Invalid value %s for attribute %s from entry %s\n", + value, ATTR_PLUGIN_LOG_ACCESS, slapi_entry_get_dn_const(plugin_entry)); status = 1; } slapi_ch_free((void**)&value); @@ -2535,9 +2542,9 @@ set_plugin_config_from_entry( { if (plugin_config_set_action(&config->plgc_log_audit, value)) { - LDAPDebug(LDAP_DEBUG_PLUGIN, "Error: invalid value %s for attribute %s " - "from entry %s\n", value, ATTR_PLUGIN_LOG_AUDIT, - slapi_entry_get_dn_const(plugin_entry)); + slapi_log_err(SLAPI_LOG_PLUGIN, "set_plugin_config_from_entry", + "Invalid value %s for attribute %s from entry %s\n", + value, ATTR_PLUGIN_LOG_AUDIT, slapi_entry_get_dn_const(plugin_entry)); status = 1; } slapi_ch_free((void**)&value); @@ -2548,9 +2555,10 @@ set_plugin_config_from_entry( { if (plugin_config_set_action(&config->plgc_invoke_for_replop, value)) { - LDAPDebug(LDAP_DEBUG_PLUGIN, "Error: invalid value %s for attribute %s " - "from entry %s\n", value, ATTR_PLUGIN_INVOKE_FOR_REPLOP, - slapi_entry_get_dn_const(plugin_entry)); + slapi_log_err(SLAPI_LOG_PLUGIN, "set_plugin_config_from_entry", + "Invalid value %s for attribute %s from entry %s\n", + value, ATTR_PLUGIN_INVOKE_FOR_REPLOP, + slapi_entry_get_dn_const(plugin_entry)); status = 1; } slapi_ch_free((void**)&value); @@ -2562,9 +2570,10 @@ set_plugin_config_from_entry( { if (plugin_set_subtree_config(&(config->plgc_target_subtrees), values[i])) { - LDAPDebug(LDAP_DEBUG_PLUGIN, "Error: invalid value %s for attribute %s " - "from entry %s\n", values[i], ATTR_PLUGIN_TARGET_SUBTREE, - slapi_entry_get_dn_const(plugin_entry)); + slapi_log_err(SLAPI_LOG_PLUGIN, "set_plugin_config_from_entry", + "Invalid value %s for attribute %s from entry %s\n", + values[i], ATTR_PLUGIN_TARGET_SUBTREE, + slapi_entry_get_dn_const(plugin_entry)); status = 1; break; } @@ -2581,9 +2590,10 @@ set_plugin_config_from_entry( { if (plugin_set_subtree_config(&(config->plgc_excluded_target_subtrees), values[i])) { - LDAPDebug(LDAP_DEBUG_PLUGIN, "Error: invalid value %s for attribute %s " - "from entry %s\n", values[i], ATTR_PLUGIN_EXCLUDE_TARGET_SUBTREE, - slapi_entry_get_dn_const(plugin_entry)); + slapi_log_err(SLAPI_LOG_PLUGIN, "set_plugin_config_from_entry", + "Invalid value %s for attribute %s from entry %s\n", + values[i], ATTR_PLUGIN_EXCLUDE_TARGET_SUBTREE, + slapi_entry_get_dn_const(plugin_entry)); status = 1; break; } @@ -2596,9 +2606,10 @@ set_plugin_config_from_entry( { if (plugin_set_subtree_config(&(config->plgc_bind_subtrees), values[i])) { - LDAPDebug(LDAP_DEBUG_PLUGIN, "Error: invalid value %s for attribute %s " - "from entry %s\n", values[i], ATTR_PLUGIN_BIND_SUBTREE, - slapi_entry_get_dn_const(plugin_entry)); + slapi_log_err(SLAPI_LOG_PLUGIN, "set_plugin_config_from_entry", + "Invalid value %s for attribute %s from entry %s\n", + values[i], ATTR_PLUGIN_BIND_SUBTREE, + slapi_entry_get_dn_const(plugin_entry)); status = 1; break; } @@ -2615,9 +2626,10 @@ set_plugin_config_from_entry( { if (plugin_set_subtree_config(&(config->plgc_excluded_bind_subtrees), values[i])) { - LDAPDebug(LDAP_DEBUG_PLUGIN, "Error: invalid value %s for attribute %s " - "from entry %s\n", values[i], ATTR_PLUGIN_EXCLUDE_BIND_SUBTREE, - slapi_entry_get_dn_const(plugin_entry)); + slapi_log_err(SLAPI_LOG_PLUGIN, "set_plugin_config_from_entry", + "Invalid value %s for attribute %s from entry %s\n", + values[i], ATTR_PLUGIN_EXCLUDE_BIND_SUBTREE, + slapi_entry_get_dn_const(plugin_entry)); status = 1; break; } @@ -2655,9 +2667,9 @@ add_plugin_description(Slapi_Entry *e, const char *attrname, char *val) newval[0] = &desc; if ((status = entry_replace_values(e, attrname, newval)) != 0) { - LDAPDebug(LDAP_DEBUG_PLUGIN, "Error: failed to add value %s to " - "attribute %s of entry %s\n", val, attrname, - slapi_entry_get_dn_const(e)); + slapi_log_err(SLAPI_LOG_PLUGIN, "add_plugin_description", + "Error: failed to add value %s to attribute %s of entry %s\n", + val, attrname, slapi_entry_get_dn_const(e)); status = 1; } @@ -2702,10 +2714,10 @@ plugin_add_descriptive_attributes( Slapi_Entry *e, struct slapdplugin *plugin ) /* This can happen for things such as disabled syntax plug-ins. We * just treat this as a warning to allow the description attributes * to be set to a default value to avoid an objectclass violation. */ - LDAPDebug(LDAP_DEBUG_PLUGIN, - "Warning: couldn't find plugin %s in global list. " + slapi_log_err(SLAPI_LOG_PLUGIN, "plugin_add_descriptive_attributes", + "Couldn't find plugin %s in global list. " "Adding default descriptive values.\n", - slapi_entry_get_dn_const(e), 0, 0 ); + slapi_entry_get_dn_const(e)); } } @@ -2744,7 +2756,7 @@ plugin_add_descriptive_attributes( Slapi_Entry *e, struct slapdplugin *plugin ) static void plugin_free(struct slapdplugin *plugin) { - slapi_log_error(SLAPI_LOG_TRACE, "plugin_free", "Freeing %s \n", plugin->plg_name ); + slapi_log_err(SLAPI_LOG_TRACE, "plugin_free", "Freeing %s \n", plugin->plg_name ); charray_free(plugin->plg_argv); slapi_ch_free_string(&plugin->plg_libpath); slapi_ch_free_string(&plugin->plg_initfunc); @@ -2833,15 +2845,15 @@ plugin_setup(Slapi_Entry *plugin_entry, struct slapi_componentid *group, if (!slapi_entry_get_sdn_const(plugin_entry)) { - LDAPDebug0Args(LDAP_DEBUG_ERR, "plugin_setup - DN is missing from the plugin.\n"); + slapi_log_err(SLAPI_LOG_ERR, "plugin_setup", "DN is missing from the plugin.\n"); PR_snprintf (returntext, SLAPI_DSE_RETURNTEXT_SIZE,"Plugin is missing dn."); return -1; } if ((existname = plugin_exists(slapi_entry_get_sdn_const(plugin_entry))) != NULL) { - LDAPDebug(LDAP_DEBUG_ERR, "plugin_setup - The plugin named %s already exists, " - "or is already setup.\n", existname, 0, 0); + slapi_log_err(SLAPI_LOG_ERR, "plugin_setup", "The plugin named %s already exists, " + "or is already setup.\n", existname); PR_snprintf(returntext, SLAPI_DSE_RETURNTEXT_SIZE, "the plugin named %s already exists, or is already setup.", existname); return -1; @@ -2861,8 +2873,8 @@ plugin_setup(Slapi_Entry *plugin_entry, struct slapi_componentid *group, ATTR_PLUGIN_TYPE))) { /* error: required attribute %s missing */ - LDAPDebug(LDAP_DEBUG_ERR, "plugin_setup - Required attribute %s is missing from entry \"%s\"\n", - ATTR_PLUGIN_TYPE, slapi_entry_get_dn_const(plugin_entry), 0); + slapi_log_err(SLAPI_LOG_ERR, "plugin_setup", "Required attribute %s is missing from entry \"%s\"\n", + ATTR_PLUGIN_TYPE, slapi_entry_get_dn_const(plugin_entry)); PR_snprintf(returntext, SLAPI_DSE_RETURNTEXT_SIZE,"Required attribute %s is missing from entry", ATTR_PLUGIN_TYPE); status = -1; @@ -2875,8 +2887,8 @@ plugin_setup(Slapi_Entry *plugin_entry, struct slapi_componentid *group, if ( status != 0 ) { /* error: unknown plugin type */ - LDAPDebug(LDAP_DEBUG_ERR, "plugin_setup - Unknown plugin type \"%s\" in entry \"%s\"\n", - value, slapi_entry_get_dn_const(plugin_entry), 0); + slapi_log_err(SLAPI_LOG_ERR, "plugin_setup", "Unknown plugin type \"%s\" in entry \"%s\"\n", + value, slapi_entry_get_dn_const(plugin_entry)); PR_snprintf (returntext, SLAPI_DSE_RETURNTEXT_SIZE, "Unknown plugin type \"%s\" in entry", value); slapi_ch_free_string(&value); status = -1; @@ -2889,8 +2901,8 @@ plugin_setup(Slapi_Entry *plugin_entry, struct slapi_componentid *group, !(value = slapi_entry_attr_get_charptr(plugin_entry, "cn"))) { /* error: required attribute %s missing */ - LDAPDebug(LDAP_DEBUG_ERR, "plugin_setup - Required attribute %s is missing from entry \"%s\"\n", - "cn", slapi_entry_get_dn_const(plugin_entry), 0); + slapi_log_err(SLAPI_LOG_ERR, "plugin_setup", "Required attribute %s is missing from entry \"%s\"\n", + "cn", slapi_entry_get_dn_const(plugin_entry)); PR_snprintf (returntext, SLAPI_DSE_RETURNTEXT_SIZE, "Required attribute \"cn\" is missing from entry"); status = -1; goto PLUGIN_CLEANUP; @@ -2921,7 +2933,7 @@ plugin_setup(Slapi_Entry *plugin_entry, struct slapi_componentid *group, if ((*value == '\0') || (*endptr != '\0') || (precedence < PLUGIN_MIN_PRECEDENCE) || (precedence > PLUGIN_MAX_PRECEDENCE)) { - LDAPDebug(LDAP_DEBUG_ERR, "plugin_setup - Value for attribute %s must be " + slapi_log_err(SLAPI_LOG_ERR, "plugin_setup", "Value for attribute %s must be " "an integer between %d and %d\n", ATTR_PLUGIN_PRECEDENCE, PLUGIN_MIN_PRECEDENCE, PLUGIN_MAX_PRECEDENCE); PR_snprintf (returntext, SLAPI_DSE_RETURNTEXT_SIZE, "Value for attribute %s must be " @@ -2943,8 +2955,8 @@ plugin_setup(Slapi_Entry *plugin_entry, struct slapi_componentid *group, if (!initfunc) { /* error: required attribute %s missing */ - LDAPDebug(LDAP_DEBUG_ERR, "plugin_setup - Required attribute %s is missing from entry \"%s\"\n", - ATTR_PLUGIN_INITFN, slapi_entry_get_dn_const(plugin_entry), 0); + slapi_log_err(SLAPI_LOG_ERR, "plugin_setup", "Required attribute %s is missing from entry \"%s\"\n", + ATTR_PLUGIN_INITFN, slapi_entry_get_dn_const(plugin_entry)); PR_snprintf (returntext, SLAPI_DSE_RETURNTEXT_SIZE,"Required attribute %s is missing from entry.", ATTR_PLUGIN_INITFN); status = -1; @@ -2965,8 +2977,8 @@ plugin_setup(Slapi_Entry *plugin_entry, struct slapi_componentid *group, ATTR_PLUGIN_PATH))) { /* error: required attribute %s missing */ - LDAPDebug(LDAP_DEBUG_ERR, "plugin_setup - Required attribute %s is missing from entry \"%s\"\n", - ATTR_PLUGIN_PATH, slapi_entry_get_dn_const(plugin_entry), 0); + slapi_log_err(SLAPI_LOG_ERR, "plugin_setup", "Required attribute %s is missing from entry \"%s\"\n", + ATTR_PLUGIN_PATH, slapi_entry_get_dn_const(plugin_entry)); PR_snprintf(returntext, SLAPI_DSE_RETURNTEXT_SIZE, "Required attribute %s is missing from entry.", ATTR_PLUGIN_PATH); status = -1; @@ -3076,7 +3088,7 @@ plugin_setup(Slapi_Entry *plugin_entry, struct slapi_componentid *group, if (enabled && (*initfunc)(&pb) != 0) { - LDAPDebug(LDAP_DEBUG_ERR, "plugin_setup - Init function \"%s\" for \"%s\" plugin in library \"%s\" failed\n", + slapi_log_err(SLAPI_LOG_ERR, "plugin_setup", "Init function \"%s\" for \"%s\" plugin in library \"%s\" failed\n", plugin->plg_initfunc, plugin->plg_name, plugin->plg_libpath); PR_snprintf (returntext, SLAPI_DSE_RETURNTEXT_SIZE,"Init function \"%s\" for \"%s\" plugin in " "library \"%s\" failed.",plugin->plg_initfunc, plugin->plg_name, plugin->plg_libpath); @@ -3137,12 +3149,14 @@ plugin_add(Slapi_Entry *entry, char *returntext, int locked) } if((rc = plugin_setup(entry, 0, 0, 1, returntext)) != LDAP_SUCCESS){ - LDAPDebug(LDAP_DEBUG_PLUGIN, "plugin_add - plugin_setup failed for (%s)\n",slapi_entry_get_dn(entry), rc, 0); + slapi_log_err(SLAPI_LOG_PLUGIN, "plugin_add", "plugin_setup failed for (%s) %d\n", + slapi_entry_get_dn(entry), rc); goto done; } if((rc = plugin_start(entry, returntext)) != LDAP_SUCCESS){ - LDAPDebug(LDAP_DEBUG_PLUGIN, "plugin_add - plugin_start failed for (%s)\n",slapi_entry_get_dn(entry), rc, 0); + slapi_log_err(SLAPI_LOG_PLUGIN, "plugin_add", "plugin_start failed for (%s) %d\n", + slapi_entry_get_dn(entry), rc); goto done; } @@ -3280,9 +3294,9 @@ next: for(i = 0; list && list[i]; i++){ if(strcasecmp(list[i], plugin_name) == 0){ /* We have a dependency, we can not disable this pluign */ - LDAPDebug(LDAP_DEBUG_ERR, "plugin_delete_check_dependency - Can not disable plugin(%s) due " - "to dependency name issues with plugin (%s)\n", - plugin_name, config[index].plugin->plg_name, 0); + slapi_log_err(SLAPI_LOG_ERR, "plugin_delete_check_dependency", + "Can not disable plugin(%s) due to dependency name issues with plugin (%s)\n", + plugin_name, config[index].plugin->plg_name); rc = -1; goto free_and_return; } @@ -3336,8 +3350,8 @@ next: PR_snprintf(returntext, SLAPI_DSE_RETURNTEXT_SIZE, "Plugin (%s) type (%s) is needed " "by other plugins(%s), it can not be dynamically disabled/removed at this time.", plugin_name, plugin_type, plugins); - LDAPDebug(LDAP_DEBUG_ERR, "plugin_delete_check_dependency - %s\n", - returntext, 0, 0); + slapi_log_err(SLAPI_LOG_ERR, "plugin_delete_check_dependency", "%s\n", + returntext); slapi_ch_free_string(&plugins); rc = -1; @@ -3511,8 +3525,8 @@ plugin_delete(Slapi_Entry *plugin_entry, char *returntext, int locked) /* Critical server plugins can not be disabled */ if(plugin_is_critical(plugin_entry)){ - LDAPDebug(LDAP_DEBUG_ERR, "plugin_delete - Plugin \"%s\" is critical to server operations, and can not be disabled\n", - slapi_entry_get_dn_const(plugin_entry), 0, 0); + slapi_log_err(SLAPI_LOG_ERR, "plugin_delete", "Plugin \"%s\" is critical to server operations, and can not be disabled\n", + slapi_entry_get_dn_const(plugin_entry)); PR_snprintf (returntext, SLAPI_DSE_RETURNTEXT_SIZE, "Plugin \"%s\" is critical to server operations, and can not " "be disabled.\n",slapi_entry_get_dn_const(plugin_entry)); rc = -1; @@ -3521,8 +3535,8 @@ plugin_delete(Slapi_Entry *plugin_entry, char *returntext, int locked) if (!(value = slapi_entry_attr_get_charptr(plugin_entry, ATTR_PLUGIN_TYPE))){ /* error: required attribute %s missing */ - LDAPDebug(LDAP_DEBUG_ERR, "plugin_delete - Required attribute %s is missing from entry \"%s\"\n", - ATTR_PLUGIN_TYPE, slapi_entry_get_dn_const(plugin_entry), 0); + slapi_log_err(SLAPI_LOG_ERR, "plugin_delete", "Required attribute %s is missing from entry \"%s\"\n", + ATTR_PLUGIN_TYPE, slapi_entry_get_dn_const(plugin_entry)); PR_snprintf (returntext, SLAPI_DSE_RETURNTEXT_SIZE, "Required attribute %s " "is missing from entry.",ATTR_PLUGIN_TYPE); rc = -1; @@ -3538,8 +3552,8 @@ plugin_delete(Slapi_Entry *plugin_entry, char *returntext, int locked) rc = plugin_get_type_and_list(value, &type, &plugin_list); if ( rc != 0 ) { /* error: unknown plugin type */ - LDAPDebug(LDAP_DEBUG_ERR, "plugin_delete - Unknown plugin type \"%s\" in entry \"%s\"\n", - value, slapi_entry_get_dn_const(plugin_entry), 0); + slapi_log_err(SLAPI_LOG_ERR, "plugin_delete", "Unknown plugin type \"%s\" in entry \"%s\"\n", + value, slapi_entry_get_dn_const(plugin_entry)); PR_snprintf (returntext, SLAPI_DSE_RETURNTEXT_SIZE, "Unknown plugin type " "\"%s\" in entry.",value); rc = -1; @@ -3565,8 +3579,8 @@ plugin_delete(Slapi_Entry *plugin_entry, char *returntext, int locked) * Make sure there are no other plugins that depend on this one before removing it */ if(plugin_delete_check_dependency(plugin, CHECK_ALL, returntext) != LDAP_SUCCESS){ - LDAPDebug(LDAP_DEBUG_ERR, "plugin_delete - Failed to disable/delete plugin (%s)\n", - plugin->plg_dn,0,0); + slapi_log_err(SLAPI_LOG_ERR, "plugin_delete", "Failed to disable/delete plugin (%s)\n", + plugin->plg_dn); rc = -1; break; } @@ -3588,8 +3602,8 @@ done: if(!removed && rc == 0){ PR_snprintf(returntext, SLAPI_DSE_RETURNTEXT_SIZE,"Plugin delete failed: could not find plugin " "in the global list."); - LDAPDebug(LDAP_DEBUG_ERR, "plugin_delete - Did not find plugin (%s) in the global list.\n", - slapi_entry_get_dn_const(plugin_entry),0,0); + slapi_log_err(SLAPI_LOG_ERR, "plugin_delete", "Did not find plugin (%s) in the global list.\n", + slapi_entry_get_dn_const(plugin_entry)); rc = -1; } @@ -3637,7 +3651,7 @@ plugin_config_set_action (int *action, char *value) } else { - slapi_log_error(SLAPI_LOG_ERR, "plugin_config_set_action", + slapi_log_err(SLAPI_LOG_ERR, "plugin_config_set_action", "Invalid action %s\n", value); return -1; } @@ -3729,7 +3743,7 @@ plugin_invoke_plugin_sdn (struct slapdplugin *plugin, int operation, Slapi_PBloc PR_ASSERT (plugin); if (!pb) { - LDAPDebug(LDAP_DEBUG_ERR, "plugin_invoke_plugin_sdn - NULL pblock.\n", 0, 0, 0); + slapi_log_err(SLAPI_LOG_ERR, "plugin_invoke_plugin_sdn", "NULL pblock.\n"); return PR_FALSE; } @@ -3812,7 +3826,7 @@ char* plugin_get_dn (const struct slapdplugin *plugin) /* plg_name is normalized in plugin_setup. So, we can use smprintf */ plugindn = slapi_ch_smprintf(pattern, plugin->plg_name); if (NULL == plugindn) { - slapi_log_error(SLAPI_LOG_ERR, "plugin_get_dn", + slapi_log_err(SLAPI_LOG_ERR, "plugin_get_dn", "Failed to create plugin dn (plugin name: %s)\n", plugin->plg_name); return NULL; } @@ -4040,7 +4054,7 @@ static void trace_plugin_invocation (Slapi_DN *target_spec, PluginTargetData *pt Slapi_DN *sdn; - slapi_log_error(SLAPI_LOG_ERR, "default_plugin_init", + slapi_log_err(SLAPI_LOG_ERR, "trace_plugin_invocation", "Invocation parameters: target_spec = %s, bindop = %d, isroot=%d, islocal=%d\n" "Plugin configuration: local_data=%d, remote_data=%d, anonymous_bind=%d, root_bind=%d\n", slapi_sdn_get_ndn (target_spec), bindop, isroot, islocal, ptd->special_data[0], @@ -4049,11 +4063,11 @@ static void trace_plugin_invocation (Slapi_DN *target_spec, PluginTargetData *pt sdn = ptd_get_first_subtree (ptd, &cookie); while (sdn) { - slapi_log_error(SLAPI_LOG_ERR, "default_plugin_init", "target_subtree%d: %s\n", i, slapi_sdn_get_ndn (sdn)); + slapi_log_err(SLAPI_LOG_ERR, "trace_plugin_invocation", "target_subtree%d: %s\n", i, slapi_sdn_get_ndn (sdn)); sdn = ptd_get_next_subtree (ptd, &cookie); } - slapi_log_error(SLAPI_LOG_ERR, "default_plugin_init", invoked ? "Plugin is invoked\n" : "Plugin is not invoked\n"); + slapi_log_err(SLAPI_LOG_ERR, "trace_plugin_invocation", invoked ? "Plugin is invoked\n" : "Plugin is not invoked\n"); } #endif @@ -4244,11 +4258,11 @@ void plugin_print_lists(void) for (i = 0; i < PLUGIN_LIST_GLOBAL_MAX; i++) { if ((list = get_plugin_list(i))) { - slapi_log_error(SLAPI_LOG_PLUGIN, NULL, + slapi_log_err(SLAPI_LOG_PLUGIN, "plugin_print_lists", "---- Plugin List (type %d) ----\n", i); for ( tmp = list; tmp; tmp = tmp->plg_next ) { - slapi_log_error(SLAPI_LOG_PLUGIN, NULL, " %s (precedence: %d)\n", + slapi_log_err(SLAPI_LOG_PLUGIN, "plugin_print_lists", " %s (precedence: %d)\n", tmp->plg_name, tmp->plg_precedence); } } @@ -4570,7 +4584,7 @@ slapi_plugin_call_preop_be_plugins(Slapi_PBlock *pb, int function) break; default: /* invalid function */ - slapi_log_error(SLAPI_LOG_ERR, "slapi_plugin_call_preop_betxn_plugins", + slapi_log_err(SLAPI_LOG_ERR, "slapi_plugin_call_preop_be_plugins", "Invalid function specified - backend plugins will not be called.\n"); return 0; } @@ -4617,7 +4631,7 @@ slapi_plugin_call_postop_be_plugins(Slapi_PBlock *pb, int function) break; default: /* invalid function */ - slapi_log_error(SLAPI_LOG_ERR, "slapi_plugin_call_postop_betxn_plugins", + slapi_log_err(SLAPI_LOG_ERR, "slapi_plugin_call_postop_be_plugins", "Invalid function specified - backend plugins will not be called.\n"); return 0; } diff --git a/ldap/servers/slapd/plugin_acl.c b/ldap/servers/slapd/plugin_acl.c index d82fb18..dcc49a7 100644 --- a/ldap/servers/slapd/plugin_acl.c +++ b/ldap/servers/slapd/plugin_acl.c @@ -152,8 +152,7 @@ plugin_call_acl_mods_update ( Slapi_PBlock *pb, int optype ) } if (NULL == sdn) { - LDAPDebug0Args(LDAP_DEBUG_ERR, - "plugin_call_acl_mods_update - Null target DN\n" ); + slapi_log_err(SLAPI_LOG_ERR, "plugin_call_acl_mods_update", "NULL target DN\n"); return LDAP_INVALID_DN_SYNTAX; } @@ -194,7 +193,8 @@ plugin_call_acl_verify_syntax ( Slapi_PBlock *pb, Slapi_Entry *e, char **errbuf } if ( !plugin_called ) { - LDAPDebug(LDAP_DEBUG_ERR, "plugin_call_acl_verify_syntax - The ACL plugin is not initialized. The aci syntax cannot be verified\n",0,0,0); + slapi_log_err(SLAPI_LOG_ERR, "plugin_call_acl_verify_syntax", + "The ACL plugin is not initialized. The aci syntax cannot be verified\n"); } return rc; } diff --git a/ldap/servers/slapd/plugin_internal_op.c b/ldap/servers/slapd/plugin_internal_op.c index e1a1ab9..05ee90d 100644 --- a/ldap/servers/slapd/plugin_internal_op.c +++ b/ldap/servers/slapd/plugin_internal_op.c @@ -209,7 +209,7 @@ slapi_seq_callback( const char *ibase, if (ibase == NULL) { - slapi_log_error(SLAPI_LOG_ERR, "slapi_seq_callback", + slapi_log_err(SLAPI_LOG_ERR, "slapi_seq_callback", "NULL parameter\n"); return -1; } @@ -265,7 +265,7 @@ slapi_search_internal_set_pb (Slapi_PBlock *pb, const char *base, char **tmp_attrs = NULL; if (pb == NULL || base == NULL) { - slapi_log_error(SLAPI_LOG_ERR, "slapi_search_internal_set_pb", + slapi_log_err(SLAPI_LOG_ERR, "slapi_search_internal_set_pb", "NULL parameter\n"); return; } @@ -299,7 +299,7 @@ slapi_search_internal_set_pb_ext (Slapi_PBlock *pb, Slapi_DN *sdn, char **tmp_attrs = NULL; if (pb == NULL || sdn == NULL) { - slapi_log_error(SLAPI_LOG_ERR, "slapi_search_internal_set_pb", + slapi_log_err(SLAPI_LOG_ERR, "slapi_search_internal_set_pb", "NULL parameter\n"); return; } @@ -331,7 +331,7 @@ void slapi_seq_internal_set_pb(Slapi_PBlock *pb, char *base, int type, char *att char **tmp_attrs = NULL; if (pb == NULL || base == NULL) { - slapi_log_error(SLAPI_LOG_ERR, "slapi_seq_internal_set_pb", + slapi_log_err(SLAPI_LOG_ERR, "slapi_seq_internal_set_pb", "NULL parameter\n"); return; } @@ -812,13 +812,13 @@ PRBool allow_operation (Slapi_PBlock *pb) slapi_pblock_get (pb, SLAPI_PLUGIN_IDENTITY, &cid); if (cid == NULL) { - slapi_log_error(SLAPI_LOG_ERR, "allow_operation", "Component identity is NULL\n"); + slapi_log_err(SLAPI_LOG_ERR, "allow_operation", "Component identity is NULL\n"); return PR_FALSE; } plugin=(struct slapdplugin *) cid->sci_plugin; if (plugin == NULL) { - slapi_log_error(SLAPI_LOG_ERR, "allow_operation", "Plugin identity is NULL\n"); + slapi_log_err(SLAPI_LOG_ERR, "allow_operation", "Plugin identity is NULL\n"); return PR_FALSE; } diff --git a/ldap/servers/slapd/plugin_mr.c b/ldap/servers/slapd/plugin_mr.c index a1eb6d8..35874ec 100644 --- a/ldap/servers/slapd/plugin_mr.c +++ b/ldap/servers/slapd/plugin_mr.c @@ -78,8 +78,8 @@ plugin_mr_find( const char *nameoroid ) } if (nameoroid && !pi) { - slapi_log_error(SLAPI_LOG_CONFIG, "plugin_mr_find", - "Error: matching rule plugin for [%s] not found\n", nameoroid); + slapi_log_err(SLAPI_LOG_CONFIG, "plugin_mr_find", + "Matching rule plugin for [%s] not found\n", nameoroid); } return ( pi ); @@ -122,11 +122,11 @@ plugin_mr_find_registered (char* oid) { if (!strcasecmp (oid, i->oi_oid)) { - LDAPDebug(LDAP_DEBUG_FILTER, "plugin_mr_find_registered(%s) != NULL\n", oid, 0, 0); + slapi_log_err(SLAPI_LOG_FILTER, "plugin_mr_find_registered", "(%s) != NULL 1\n", oid); return i->oi_plugin; } } - LDAPDebug(LDAP_DEBUG_FILTER, "plugin_mr_find_registered(%s) == NULL\n", oid, 0, 0); + slapi_log_err(SLAPI_LOG_FILTER, "plugin_mr_find_registered", "(%s) == NULL 2\n", oid); return NULL; } @@ -134,7 +134,7 @@ static void plugin_mr_bind (char* oid, struct slapdplugin* plugin) { oid_item_t* i = (oid_item_t*) slapi_ch_malloc (sizeof (oid_item_t)); - LDAPDebug(LDAP_DEBUG_FILTER, "=> plugin_mr_bind(%s)\n", oid, 0, 0); + slapi_log_err(SLAPI_LOG_FILTER, "plugin_mr_bind", "=> (%s)\n", oid); init_global_mr_lock(); i->oi_oid = slapi_ch_strdup (oid); i->oi_plugin = plugin; @@ -142,7 +142,7 @@ plugin_mr_bind (char* oid, struct slapdplugin* plugin) i->oi_next = global_mr_oids; global_mr_oids = i; PR_Unlock (global_mr_oids_lock); - LDAPDebug(LDAP_DEBUG_FILTER, "<= plugin_mr_bind\n", 0, 0, 0); + slapi_log_err(SLAPI_LOG_FILTER, "plugin_mr_bind", "<=\n"); } int /* an LDAP error code, hopefully LDAP_SUCCESS */ @@ -281,9 +281,9 @@ mr_wrap_mr_index_sv_fn(Slapi_PBlock* pb) slapi_pblock_set(pb, SLAPI_PLUGIN_MR_KEYS, out_vals); /* make sure output is cleared */ slapi_pblock_get(pb, SLAPI_PLUGIN, &pi); if (!pi) { - LDAPDebug0Args(LDAP_DEBUG_ERR, "mr_wrap_mr_index_sv_fn - no plugin specified\n"); + slapi_log_err(SLAPI_LOG_ERR, "mr_wrap_mr_index_sv_fn", "No plugin specified\n"); } else if (!pi->plg_mr_values2keys) { - LDAPDebug0Args(LDAP_DEBUG_ERR, "mr_wrap_mr_index_sv_fn - plugin has no plg_mr_values2keys function\n"); + slapi_log_err(SLAPI_LOG_ERR, "mr_wrap_mr_index_sv_fn", "Plugin has no plg_mr_values2keys function\n"); } else { struct mr_private *mrpriv = NULL; int ftype = plugin_mr_get_type(pi); @@ -412,7 +412,7 @@ default_mr_filter_index(Slapi_PBlock *pb) slapi_pblock_get(pb, SLAPI_PLUGIN_MR_OID, &mrOID); slapi_pblock_get(pb, SLAPI_PLUGIN_MR_TYPE, &mrTYPE); - slapi_log_error(SLAPI_LOG_ERR, "default_mr_filter_index", + slapi_log_err(SLAPI_LOG_ERR, "default_mr_filter_index", "Failure because mrpriv is NULL : %s %s\n", mrOID ? "" : " oid", mrTYPE ? "" : " attribute type"); @@ -443,7 +443,7 @@ default_mr_filter_create(Slapi_PBlock *pb) struct berval* mrVALUE = NULL; struct slapdplugin* pi = NULL; - LDAPDebug0Args(LDAP_DEBUG_FILTER, "=> default_mr_filter_create\n"); + slapi_log_err(SLAPI_LOG_FILTER, "default_mr_filter_create", "=>\n"); if (!slapi_pblock_get(pb, SLAPI_PLUGIN_MR_OID, &mrOID) && mrOID != NULL && !slapi_pblock_get(pb, SLAPI_PLUGIN_MR_TYPE, &mrTYPE) && mrTYPE != NULL && @@ -453,14 +453,14 @@ default_mr_filter_create(Slapi_PBlock *pb) struct mr_private *mrpriv = NULL; int ftype = 0; - LDAPDebug2Args(LDAP_DEBUG_FILTER, "=> default_mr_filter_create(oid %s; type %s)\n", + slapi_log_err(SLAPI_LOG_FILTER, "default_mr_filter_create", "(oid %s; type %s)\n", mrOID, mrTYPE); /* check to make sure this create function is supposed to be used with the given oid */ if (!charray_inlist(pi->plg_mr_names, mrOID)) { - LDAPDebug2Args(LDAP_DEBUG_FILTER, - "=> default_mr_filter_create: cannot use matching rule %s with plugin %s\n", + slapi_log_err(SLAPI_LOG_FILTER, + "default_mr_filter_create", "<= Cannot use matching rule %s with plugin %s\n", mrOID, pi->plg_name); goto done; } @@ -484,7 +484,7 @@ default_mr_filter_create(Slapi_PBlock *pb) reason is that the API provides no way to pass in the search time limit required by the syntax filter substring match functions */ - LDAPDebug1Arg(LDAP_DEBUG_FILTER, "<= default_mr_filter_create - unsupported filter type %d\n", + slapi_log_err(SLAPI_LOG_FILTER, "default_mr_filter_create", "<= unsupported filter type %d\n", ftype); goto done; } @@ -529,15 +529,15 @@ default_mr_filter_create(Slapi_PBlock *pb) slapi_pblock_set(pb, SLAPI_PLUGIN_DESTROY_FN, default_mr_filter_destroy); rc = 0; /* success */ } else { - LDAPDebug(LDAP_DEBUG_FILTER, - "default_mr_filter_create: missing parameter: %s%s%s\n", + slapi_log_err(SLAPI_LOG_FILTER, + "default_mr_filter_create", "Missing parameter: %s%s%s\n", mrOID ? "" : " oid", mrTYPE ? "" : " attribute type", mrVALUE ? "" : " filter value"); } done: - LDAPDebug1Arg(LDAP_DEBUG_FILTER, "=> default_mr_filter_create: %d\n", rc); + slapi_log_err(SLAPI_LOG_FILTER, "default_mr_filter_create", "<= %d\n", rc); return rc; } @@ -659,7 +659,7 @@ default_mr_indexer_create(Slapi_PBlock* pb) slapi_pblock_get(pb, SLAPI_PLUGIN, &pi); if (NULL == pi) { - LDAPDebug0Args(LDAP_DEBUG_ERR, "default_mr_indexer_create - error - no plugin specified\n"); + slapi_log_err(SLAPI_LOG_ERR, "default_mr_indexer_create", "No plugin specified\n"); goto done; } slapi_pblock_get (pb, SLAPI_PLUGIN_MR_OID, &oid); @@ -667,15 +667,16 @@ default_mr_indexer_create(Slapi_PBlock* pb) * MR plugin. We need to check the selected plugin handle the expected OID */ if ( oid == NULL || !charray_inlist(pi->plg_mr_names, oid)) { - LDAPDebug2Args(LDAP_DEBUG_WARNING, "default_mr_indexer_create - plugin [%s] does not handle %s\n", + slapi_log_err(SLAPI_LOG_WARNING, "default_mr_indexer_create", "Plugin [%s] does not handle %s\n", pi->plg_name, oid ? oid : "unknown oid"); goto done; } if (NULL == pi->plg_mr_values2keys) { - LDAPDebug1Arg(LDAP_DEBUG_ERR, "default_mr_indexer_create: error - plugin [%s] has no plg_mr_values2keys function\n", - pi->plg_name); + slapi_log_err(SLAPI_LOG_ERR, "default_mr_indexer_create", + "Plugin [%s] has no plg_mr_values2keys function\n", + pi->plg_name); goto done; } diff --git a/ldap/servers/slapd/plugin_syntax.c b/ldap/servers/slapd/plugin_syntax.c index e9bbad4..5db3d21 100644 --- a/ldap/servers/slapd/plugin_syntax.c +++ b/ldap/servers/slapd/plugin_syntax.c @@ -25,13 +25,13 @@ plugin_syntax_find( const char *nameoroid ) { struct slapdplugin *pi; - /* LDAPDebug(LDAP_DEBUG_FILTER, "=> plugin_syntax_find (%s)\n", nameoroid, 0, 0 ); */ + /* slapi_log_err(SLAPI_LOG_FILTER, "plugin_syntax_find", "=> (%s)\n", nameoroid ); */ for ( pi = get_plugin_list(PLUGIN_LIST_SYNTAX); pi != NULL; pi = pi->plg_next ) { if ( charray_inlist( pi->plg_syntax_names, (char *)nameoroid ) ) { break; } } - /* LDAPDebug(LDAP_DEBUG_FILTER, "<= plugin_syntax_find %d\n", pi, 0, 0 ); */ + /* slapi_log_err(SLAPI_LOG_FILTER, "plugin_syntax_find", "<= %d\n", pi); */ return ( pi ); } @@ -60,8 +60,8 @@ slapi_get_global_syntax_plugins() char * plugin_syntax2oid( struct slapdplugin *pi ) { - LDAPDebug(LDAP_DEBUG_NOTICE, - "plugin_syntax2oid() - This function is deprecated - please use attr_get_syntax_oid() instead\n", 0, 0, 0); + slapi_log_err(SLAPI_LOG_NOTICE, "plugin_syntax2oid", + "This function is deprecated - please use attr_get_syntax_oid() instead\n"); PR_ASSERT(0); return( NULL ); } @@ -72,8 +72,8 @@ plugin_call_syntax_get_compare_fn( value_compare_fn_type *compare_fn ) { - LDAPDebug(LDAP_DEBUG_NOTICE, - "plugin_call_syntax_get_compare_fn() - This function is deprecated - please use attr_get_value_cmp_fn() instead\n", 0, 0, 0); + slapi_log_err(SLAPI_LOG_NOTICE, "plugin_call_syntax_get_compare_fn", + "This function is deprecated - please use attr_get_value_cmp_fn() instead\n"); PR_ASSERT(0); return( 0 ); } @@ -101,9 +101,9 @@ plugin_call_syntax_filter_ava_sv( Slapi_PBlock pipb; IFP ava_fn = NULL; - LDAPDebug(LDAP_DEBUG_FILTER, - "=> plugin_call_syntax_filter_ava_sv %s=%s\n", ava->ava_type, - ava->ava_value.bv_val, 0 ); + slapi_log_err(SLAPI_LOG_FILTER, + "plugin_call_syntax_filter_ava_sv", "=> %s=%s\n", ava->ava_type, + ava->ava_value.bv_val); if ( ( a->a_mr_eq_plugin == NULL ) && ( a->a_mr_ord_plugin == NULL ) && ( a->a_plugin == NULL ) ) { /* could be lazy plugin initialization, get it now */ @@ -112,9 +112,9 @@ plugin_call_syntax_filter_ava_sv( } if ( ( a->a_mr_eq_plugin == NULL ) && ( a->a_mr_ord_plugin == NULL ) && ( a->a_plugin == NULL ) ) { - LDAPDebug(LDAP_DEBUG_FILTER, - "<= plugin_call_syntax_filter_ava_sv no plugin for attr (%s)\n", - a->a_type, 0, 0 ); + slapi_log_err(SLAPI_LOG_FILTER, + "plugin_call_syntax_filter_ava_sv", "<= no plugin for attr (%s)\n", + a->a_type); return( LDAP_PROTOCOL_ERROR ); /* syntax unkonwn */ } @@ -135,9 +135,9 @@ plugin_call_syntax_filter_ava_sv( if ((a->a_mr_ord_plugin == NULL) && ((a->a_plugin->plg_syntax_flags & SLAPI_PLUGIN_SYNTAX_FLAG_ORDERING) == 0)) { - LDAPDebug(LDAP_DEBUG_FILTER, - "<= plugin_call_syntax_filter_ava: attr (%s) has no ordering matching rule, and syntax does not define a compare function\n", - a->a_type, 0, 0 ); + slapi_log_err(SLAPI_LOG_FILTER, "plugin_call_syntax_filter_ava", + "<= attr (%s) has no ordering matching rule, and syntax does not define a compare function\n", + a->a_type); rc = LDAP_PROTOCOL_ERROR; break; } @@ -177,20 +177,20 @@ plugin_call_syntax_filter_ava_sv( rc = (*ava_fn)( &pipb, &ava->ava_value, va, ftype, retVal ); } } else { - LDAPDebug(LDAP_DEBUG_FILTER, - "<= plugin_call_syntax_filter_ava: attr (%s) has no ava filter function\n", - a->a_type, 0, 0 ); + slapi_log_err(SLAPI_LOG_FILTER, + "plugin_call_syntax_filter_ava", "attr (%s) has no ava filter function\n", + a->a_type); } break; default: - LDAPDebug(LDAP_DEBUG_ERR, "plugin_call_syntax_filter_ava - " - "Unknown filter type %d\n", ftype, 0, 0 ); + slapi_log_err(SLAPI_LOG_ERR, "plugin_call_syntax_filter_ava", + "Unknown filter type %d\n", ftype); rc = LDAP_PROTOCOL_ERROR; break; } - LDAPDebug(LDAP_DEBUG_FILTER, - "<= plugin_call_syntax_filter_ava %d\n", rc, 0, 0 ); + slapi_log_err(SLAPI_LOG_FILTER, + "plugin_call_syntax_filter_ava", "<= %d\n", rc); return( rc ); } @@ -216,17 +216,17 @@ plugin_call_syntax_filter_sub_sv( IFP sub_fn = NULL; int filter_normalized = 0; - LDAPDebug(LDAP_DEBUG_FILTER, - "=> plugin_call_syntax_filter_sub_sv\n", 0, 0, 0 ); + slapi_log_err(SLAPI_LOG_FILTER, + "plugin_call_syntax_filter_sub_sv", "=>\n"); if ( ( a->a_mr_sub_plugin == NULL ) && ( a->a_plugin == NULL ) ) { /* could be lazy plugin initialization, get it now */ slapi_attr_init_syntax(a); } if ( ( a->a_mr_sub_plugin == NULL ) && ( a->a_plugin == NULL ) ) { - LDAPDebug(LDAP_DEBUG_FILTER, - "<= plugin_call_syntax_filter_sub_sv attribute (%s) has no substring matching rule or syntax plugin\n", - a->a_type, 0, 0 ); + slapi_log_err(SLAPI_LOG_FILTER, "plugin_call_syntax_filter_sub_sv", + "Attribute (%s) has no substring matching rule or syntax plugin\n", + a->a_type); return( -1 ); /* syntax unkonwn - does not match */ } @@ -262,8 +262,8 @@ plugin_call_syntax_filter_sub_sv( rc = -1; } - LDAPDebug(LDAP_DEBUG_FILTER, "<= plugin_call_syntax_filter_sub_sv %d\n", - rc, 0, 0 ); + slapi_log_err(SLAPI_LOG_FILTER, "plugin_call_syntax_filter_sub_sv", "<= %d\n", + rc); return( rc ); } @@ -313,7 +313,7 @@ slapi_dn_syntax_check( /* Validate the value. */ if (dn_plugin->plg_syntax_validate(&dn_bval) != 0) { if (syntaxlogging) { - slapi_log_error(SLAPI_LOG_ERR, "slapi_dn_syntax_check", + slapi_log_err(SLAPI_LOG_ERR, "slapi_dn_syntax_check", "DN value (%s) invalid per syntax\n", dn); } @@ -400,7 +400,7 @@ slapi_entry_syntax_check( bval = slapi_value_get_berval(val); if ((a->a_plugin->plg_syntax_validate( bval )) != 0) { if (syntaxlogging) { - slapi_log_error(SLAPI_LOG_ERR, "slapi_entry_syntax_check", + slapi_log_err(SLAPI_LOG_ERR, "slapi_entry_syntax_check", "\"%s\": (%s) value #%d invalid per syntax\n", slapi_entry_get_dn(e), a->a_type, hint ); } @@ -502,7 +502,7 @@ slapi_mods_syntax_check( for (j = 0; mod->mod_bvalues[j] != NULL; j++) { if (syntax_plugin->plg_syntax_validate(mod->mod_bvalues[j]) != 0) { if (syntaxlogging) { - slapi_log_error(SLAPI_LOG_ERR, "slapi_mods_syntax_check", "\"%s\": (%s) value #%d invalid per syntax\n", + slapi_log_err(SLAPI_LOG_ERR, "slapi_mods_syntax_check", "\"%s\": (%s) value #%d invalid per syntax\n", dn ? dn : "NULL", mod->mod_type, j ); } @@ -562,8 +562,7 @@ slapi_call_syntax_values2keys_sv( Slapi_PBlock pipb; struct slapdplugin *pi = vpi; - LDAPDebug(LDAP_DEBUG_FILTER, "=> slapi_call_syntax_values2keys\n", - 0, 0, 0 ); + slapi_log_err(SLAPI_LOG_FILTER, "slapi_call_syntax_values2keys_sv", "=>\n"); pblock_init( &pipb ); slapi_pblock_set( &pipb, SLAPI_PLUGIN, vpi ); @@ -574,8 +573,8 @@ slapi_call_syntax_values2keys_sv( rc = pi->plg_syntax_values2keys( &pipb, vals, ivals, ftype ); } - LDAPDebug(LDAP_DEBUG_FILTER, - "<= slapi_call_syntax_values2keys %d\n", rc, 0, 0 ); + slapi_log_err(SLAPI_LOG_FILTER, + "slapi_call_syntax_values2keys_sv", "<= %d\n", rc); return( rc ); } @@ -592,8 +591,7 @@ slapi_attr_values2keys_sv_pb( struct slapdplugin *pi = NULL; IFP v2k_fn = NULL; - LDAPDebug(LDAP_DEBUG_FILTER, "=> slapi_attr_values2keys_sv\n", - 0, 0, 0 ); + slapi_log_err(SLAPI_LOG_FILTER, "slapi_attr_values2keys_sv_pb", "=>\n"); if ( ( sattr->a_plugin == NULL ) ) { /* could be lazy plugin initialization, get it now */ slapi_attr_init_syntax((Slapi_Attr *)sattr); @@ -620,8 +618,8 @@ slapi_attr_values2keys_sv_pb( } break; default: - LDAPDebug(LDAP_DEBUG_ERR, "slapi_attr_values2keys_sv_pb: Unsupported filter type %d\n", - ftype, 0, 0 ); + slapi_log_err(SLAPI_LOG_ERR, "slapi_attr_values2keys_sv_pb", "Unsupported filter type %d\n", + ftype); rc = LDAP_PROTOCOL_ERROR; goto done; } @@ -635,8 +633,8 @@ slapi_attr_values2keys_sv_pb( } done: - LDAPDebug(LDAP_DEBUG_FILTER, - "<= slapi_call_syntax_values2keys %d\n", rc, 0, 0 ); + slapi_log_err(SLAPI_LOG_FILTER, + "slapi_attr_values2keys_sv_pb", "<= %d\n", rc); return( rc ); } @@ -688,8 +686,7 @@ slapi_call_syntax_values2keys_sv_pb( int rc; struct slapdplugin *pi = vpi; - LDAPDebug(LDAP_DEBUG_FILTER, "=> slapi_call_syntax_values2keys\n", - 0, 0, 0 ); + slapi_log_err(SLAPI_LOG_FILTER, "slapi_call_syntax_values2keys_sv_pb", "=>\n"); slapi_pblock_set( pb, SLAPI_PLUGIN, vpi ); @@ -699,8 +696,8 @@ slapi_call_syntax_values2keys_sv_pb( rc = pi->plg_syntax_values2keys( pb, vals, ivals, ftype ); } - LDAPDebug(LDAP_DEBUG_FILTER, - "<= slapi_call_syntax_values2keys %d\n", rc, 0, 0 ); + slapi_log_err(SLAPI_LOG_FILTER, + "slapi_call_syntax_values2keys_sv_pb", "<= %d\n", rc); return( rc ); } @@ -735,8 +732,8 @@ slapi_call_syntax_assertion2keys_ava_sv( Slapi_PBlock pipb; struct slapdplugin *pi = vpi; - LDAPDebug(LDAP_DEBUG_FILTER, - "=> slapi_call_syntax_assertion2keys_ava\n", 0, 0, 0 ); + slapi_log_err(SLAPI_LOG_FILTER, + "slapi_call_syntax_assertion2keys_ava_sv" , "=>\n"); pblock_init( &pipb ); slapi_pblock_set( &pipb, SLAPI_PLUGIN, vpi ); @@ -746,8 +743,8 @@ slapi_call_syntax_assertion2keys_ava_sv( rc = pi->plg_syntax_assertion2keys_ava( &pipb, val, ivals, ftype ); } - LDAPDebug(LDAP_DEBUG_FILTER, - "<= slapi_call_syntax_assertion2keys_ava %d\n", rc, 0, 0 ); + slapi_log_err(SLAPI_LOG_FILTER, + "slapi_call_syntax_assertion2keys_ava_sv", "<= %d\n", rc); return( rc ); } @@ -764,8 +761,8 @@ slapi_attr_assertion2keys_ava_sv( struct slapdplugin *pi = NULL; IFP a2k_fn = NULL; - LDAPDebug(LDAP_DEBUG_FILTER, - "=> slapi_attr_assertion2keys_ava_sv\n", 0, 0, 0 ); + slapi_log_err(SLAPI_LOG_FILTER, + "slapi_attr_assertion2keys_ava_sv", "=>\n"); if ( ( sattr->a_plugin == NULL ) ) { /* could be lazy plugin initialization, get it now */ slapi_attr_init_syntax((Slapi_Attr *)sattr); @@ -784,8 +781,8 @@ slapi_attr_assertion2keys_ava_sv( } break; default: - LDAPDebug(LDAP_DEBUG_ERR, "slapi_attr_assertion2keys_ava_sv - Unsupported filter type %d\n", - ftype, 0, 0 ); + slapi_log_err(SLAPI_LOG_ERR, "slapi_attr_assertion2keys_ava_sv", + "Unsupported filter type %d\n", ftype); rc = LDAP_PROTOCOL_ERROR; goto done; } @@ -798,8 +795,8 @@ slapi_attr_assertion2keys_ava_sv( rc = (*a2k_fn)( &pipb, val, ivals, ftype ); } done: - LDAPDebug(LDAP_DEBUG_FILTER, - "<= slapi_attr_assertion2keys_ava_sv %d\n", rc, 0, 0 ); + slapi_log_err(SLAPI_LOG_FILTER, + "slapi_attr_assertion2keys_ava_sv", "=> %d\n", rc); return( rc ); } @@ -852,8 +849,8 @@ slapi_call_syntax_assertion2keys_sub_sv( Slapi_PBlock pipb; struct slapdplugin *pi = vpi; - LDAPDebug(LDAP_DEBUG_FILTER, - "=> slapi_call_syntax_assertion2keys_sub\n", 0, 0, 0 ); + slapi_log_err(SLAPI_LOG_FILTER, + "slapi_call_syntax_assertion2keys_sub_sv", "=>\n"); pblock_init( &pipb ); slapi_pblock_set( &pipb, SLAPI_PLUGIN, vpi ); @@ -865,8 +862,8 @@ slapi_call_syntax_assertion2keys_sub_sv( final, ivals ); } - LDAPDebug(LDAP_DEBUG_FILTER, - "<= slapi_call_syntax_assertion2keys_sub %d\n", rc, 0, 0 ); + slapi_log_err(SLAPI_LOG_FILTER, + "slapi_call_syntax_assertion2keys_sub_sv", "<= %d\n", rc); return( rc ); } @@ -898,8 +895,8 @@ slapi_attr_assertion2keys_sub_sv_pb( struct slapdplugin *origpi = NULL; IFP a2k_fn = NULL; - LDAPDebug(LDAP_DEBUG_FILTER, - "=> slapi_attr_assertion2keys_sub_sv\n", 0, 0, 0 ); + slapi_log_err(SLAPI_LOG_FILTER, + "slapi_attr_assertion2keys_sub_sv_pb", "=>\n"); if ( ( sattr->a_plugin == NULL ) ) { /* could be lazy plugin initialization, get it now */ slapi_attr_init_syntax((Slapi_Attr *)sattr); @@ -932,8 +929,8 @@ slapi_attr_assertion2keys_sub_sv_pb( slapi_pblock_set(pb, SLAPI_PLUGIN, origpi); } - LDAPDebug(LDAP_DEBUG_FILTER, - "<= slapi_attr_assertion2keys_sub_sv %d\n", rc, 0, 0 ); + slapi_log_err(SLAPI_LOG_FILTER, + "slapi_attr_assertion2keys_sub_sv_pb", "<= %d\n", rc); return( rc ); } diff --git a/ldap/servers/slapd/poll_using_select.c b/ldap/servers/slapd/poll_using_select.c index d5e6f4b..b7e98e5 100644 --- a/ldap/servers/slapd/poll_using_select.c +++ b/ldap/servers/slapd/poll_using_select.c @@ -40,7 +40,7 @@ poll_using_select(struct my_pollfd *filed, int nfds, int timeout) int a, b, retval; #ifdef DEBUG_POLL_AS_SELECT - LDAPDebug(LDAP_DEBUG_DEBUG, "poll convert nfds=%d, timeout=%d\n", nfds, timeout,0); + slapi_log_err(SLAPI_LOG_DEBUG, "poll convert nfds=%d, timeout=%d\n", nfds, timeout,0); #endif /* DEBUG_POLL_AS_SELECT */ FD_ZERO( &rd ); @@ -61,7 +61,7 @@ poll_using_select(struct my_pollfd *filed, int nfds, int timeout) #ifdef DEBUG_POLL_AS_SELECT if (filed[a].events != 0) { - LDAPDebug(LDAP_DEBUG_DEBUG, "poll events = %d for fd=%d\n", filed[a].events, filed[a].fd,0); + slapi_log_err(SLAPI_LOG_DEBUG, "poll events = %d for fd=%d\n", filed[a].events, filed[a].fd,0); } #endif /* DEBUG_POLL_AS_SELECT */ @@ -77,7 +77,7 @@ poll_using_select(struct my_pollfd *filed, int nfds, int timeout) #ifdef DEBUG_POLL_AS_SELECT if( temp_events != 0 ){ - LDAPDebug(LDAP_DEBUG_DEBUG, "Unhandled poll event type=0x%x on FD(%d)\n",filed[a].events,filed[a].fd,0); + slapi_log_err(SLAPI_LOG_DEBUG, "Unhandled poll event type=0x%x on FD(%d)\n",filed[a].events,filed[a].fd,0); } #endif /* DEBUG_POLL_AS_SELECT */ @@ -98,7 +98,7 @@ poll_using_select(struct my_pollfd *filed, int nfds, int timeout) if( retval <= 0 ) return( retval ); #ifdef DEBUG_POLL_AS_SELECT - LDAPDebug(LDAP_DEBUG_DEBUG, "For\n",0,0,0); + slapi_log_err(SLAPI_LOG_DEBUG, "For\n",0,0,0); #endif /* DEBUG_POLL_AS_SELECT */ for( b=0; blocaluserinfo; if (chown(dir, pw->pw_uid, -1) == -1) { if ((stat(dir, &stat_buffer) == 0) && (stat_buffer.st_uid != pw->pw_uid)) { - LDAPDebug(LDAP_DEBUG_WARNING, "make_sure_dir_exists " CHOWN_WARNING, dir, 0, 0); + slapi_log_err(SLAPI_LOG_WARNING, "make_sure_dir_exists", CHOWN_WARNING, dir); return 1; } else { - LDAPDebug(LDAP_DEBUG_ERR, "make_sure_dir_exists " STAT_ERROR, dir, errno, 0); + slapi_log_err(SLAPI_LOG_ERR, "make_sure_dir_exists", STAT_ERROR, dir, errno); return 1; } } @@ -203,7 +204,7 @@ add_this_process_to(char *dir_name) file_name[sizeof(file_name)-1] = (char)0; if ((prfd = PR_Open(file_name, PR_RDWR | PR_CREATE_FILE, 0644)) == NULL) { - LDAPDebug(LDAP_DEBUG_WARNING, "add_this_process_to" FILE_CREATE_WARNING, file_name, 0, 0); + slapi_log_err(SLAPI_LOG_WARNING, "add_this_process_to", FILE_CREATE_WARNING, file_name); return; } @@ -214,7 +215,7 @@ add_this_process_to(char *dir_name) pw = slapdFrontendConfig->localuserinfo; if (chown(file_name, pw->pw_uid, -1) == -1) { if ((stat(file_name, &stat_buffer) == 0) && (stat_buffer.st_uid != pw->pw_uid)) { - LDAPDebug(LDAP_DEBUG_WARNING, "add_this_process_to" CHOWN_WARNING, file_name, 0, 0); + slapi_log_err(SLAPI_LOG_WARNING, "add_this_process_to", CHOWN_WARNING, file_name); } } } @@ -388,10 +389,10 @@ add_new_slapd_process(int exec_mode, int r_flag, int skip_flag) case SLAPD_EXEMODE_SLAPD: if (running) { result = -1; - LDAPDebug(LDAP_DEBUG_ERR, "add_new_slapd_process" NO_SERVER_DUE_TO_SERVER, running, 0, 0); + slapi_log_err(SLAPI_LOG_ERR, "add_new_slapd_process", NO_SERVER_DUE_TO_SERVER, running); } else if (importing) { result = -1; - LDAPDebug(LDAP_DEBUG_ERR, "add_new_slapd_process" NO_SERVER_DUE_TO_IMPORT, importing, 0, 0); + slapi_log_err(SLAPI_LOG_ERR, "add_new_slapd_process", NO_SERVER_DUE_TO_IMPORT, importing); } else { add_this_process_to(server_dir); result = 0; @@ -404,7 +405,7 @@ add_new_slapd_process(int exec_mode, int r_flag, int skip_flag) * it needs to run by itself, so no other slapd process can * change the database while it is running. */ if (running || importing) { - LDAPDebug(LDAP_DEBUG_ERR, "add_new_slapd_process" NO_DB2LDIFR_DUE_TO_USE, 0, 0, 0); + slapi_log_err(SLAPI_LOG_ERR, "add_new_slapd_process", NO_DB2LDIFR_DUE_TO_USE); result = -1; } else { /* Even though this is really going to export code, we will @@ -415,7 +416,7 @@ add_new_slapd_process(int exec_mode, int r_flag, int skip_flag) } } else { if (importing) { - LDAPDebug(LDAP_DEBUG_ERR, "add_new_slapd_process" NO_DB2LDIF_DUE_TO_IMPORT, importing, 0, 0); + slapi_log_err(SLAPI_LOG_ERR, "add_new_slapd_process", NO_DB2LDIF_DUE_TO_IMPORT, importing); result = -1; } else { add_this_process_to(export_dir); @@ -425,7 +426,7 @@ add_new_slapd_process(int exec_mode, int r_flag, int skip_flag) break; case SLAPD_EXEMODE_DB2ARCHIVE: if (importing) { - LDAPDebug(LDAP_DEBUG_ERR, "add_new_slapd_process" NO_DB2BAK_DUE_TO_IMPORT, importing, 0, 0); + slapi_log_err(SLAPI_LOG_ERR, "add_new_slapd_process", NO_DB2BAK_DUE_TO_IMPORT, importing); result = -1; } else { add_this_process_to(export_dir); @@ -435,7 +436,7 @@ add_new_slapd_process(int exec_mode, int r_flag, int skip_flag) case SLAPD_EXEMODE_ARCHIVE2DB: case SLAPD_EXEMODE_LDIF2DB: if (running || importing || exporting) { - LDAPDebug(LDAP_DEBUG_ERR, "add_new_slapd_process" NO_IMPORT_DUE_TO_USE, 0, 0, 0); + slapi_log_err(SLAPI_LOG_ERR, "add_new_slapd_process", NO_IMPORT_DUE_TO_USE); result = -1; } else { add_this_process_to(import_dir); @@ -444,7 +445,7 @@ add_new_slapd_process(int exec_mode, int r_flag, int skip_flag) break; case SLAPD_EXEMODE_DB2INDEX: if (running || importing || exporting) { - LDAPDebug(LDAP_DEBUG_ERR, "add_new_slapd_process" NO_DB2INDEX_DUE_TO_USE, 0, 0, 0); + slapi_log_err(SLAPI_LOG_ERR, "add_new_slapd_process", NO_DB2INDEX_DUE_TO_USE); result = -1; } else { add_this_process_to(import_dir); @@ -453,7 +454,7 @@ add_new_slapd_process(int exec_mode, int r_flag, int skip_flag) break; case SLAPD_EXEMODE_UPGRADEDB: if (running || importing || exporting) { - LDAPDebug(LDAP_DEBUG_ERR, "add_new_slapd_process" NO_UPGRADEDB_DUE_TO_USE, 0, 0, 0); + slapi_log_err(SLAPI_LOG_ERR, "add_new_slapd_process", NO_UPGRADEDB_DUE_TO_USE); result = -1; } else { add_this_process_to(import_dir); @@ -462,7 +463,7 @@ add_new_slapd_process(int exec_mode, int r_flag, int skip_flag) break; case SLAPD_EXEMODE_UPGRADEDNFORMAT: if (running || importing || exporting) { - LDAPDebug(LDAP_DEBUG_ERR, "add_new_slapd_process" NO_UPGRADEDNFORMAT_DUE_TO_USE, 0, 0, 0); + slapi_log_err(SLAPI_LOG_ERR, "add_new_slapd_process", NO_UPGRADEDNFORMAT_DUE_TO_USE); result = -1; } else { add_this_process_to(import_dir); @@ -471,7 +472,7 @@ add_new_slapd_process(int exec_mode, int r_flag, int skip_flag) break; case SLAPD_EXEMODE_DBTEST: if (running || importing || exporting) { - LDAPDebug(LDAP_DEBUG_ERR, "add_new_slapd_process" NO_DBTEST_DUE_TO_USE, 0, 0, 0); + slapi_log_err(SLAPI_LOG_ERR, "add_new_slapd_process", NO_DBTEST_DUE_TO_USE); result = -1; } else { add_this_process_to(import_dir); diff --git a/ldap/servers/slapd/proto-slap.h b/ldap/servers/slapd/proto-slap.h index ed584a4..8131a66 100644 --- a/ldap/servers/slapd/proto-slap.h +++ b/ldap/servers/slapd/proto-slap.h @@ -758,6 +758,39 @@ int lock_fclose( FILE *fp, FILE *lfp ); /* * log.c */ +#define LDAP_DEBUG_TRACE 0x00000001 /* 1 */ +#define LDAP_DEBUG_PACKETS 0x00000002 /* 2 */ +#define LDAP_DEBUG_ARGS 0x00000004 /* 4 */ +#define LDAP_DEBUG_CONNS 0x00000008 /* 8 */ +#define LDAP_DEBUG_BER 0x00000010 /* 16 */ +#define LDAP_DEBUG_FILTER 0x00000020 /* 32 */ +#define LDAP_DEBUG_CONFIG 0x00000040 /* 64 */ +#define LDAP_DEBUG_ACL 0x00000080 /* 128 */ +#define LDAP_DEBUG_STATS 0x00000100 /* 256 */ +#define LDAP_DEBUG_STATS2 0x00000200 /* 512 */ +#define LDAP_DEBUG_SHELL 0x00000400 /* 1024 */ +#define LDAP_DEBUG_PARSE 0x00000800 /* 2048 */ +#define LDAP_DEBUG_HOUSE 0x00001000 /* 4096 */ +#define LDAP_DEBUG_REPL 0x00002000 /* 8192 */ +#define LDAP_DEBUG_ANY 0x00004000 /* 16384 */ +#define LDAP_DEBUG_CACHE 0x00008000 /* 32768 */ +#define LDAP_DEBUG_PLUGIN 0x00010000 /* 65536 */ +#define LDAP_DEBUG_TIMING 0x00020000 /* 131072 */ +#define LDAP_DEBUG_ACLSUMMARY 0x00040000 /* 262144 */ +#define LDAP_DEBUG_BACKLDBM 0x00080000 /* 524288 */ +#define LDAP_DEBUG_NUNCSTANS 0x00100000 /* 1048576 */ +#define LDAP_DEBUG_EMERG 0x00200000 /* 2097152 */ +#define LDAP_DEBUG_ALERT 0x00400000 /* 4194304 */ +#define LDAP_DEBUG_CRIT 0x00800000 /* 8388608 */ +#define LDAP_DEBUG_ERR 0x01000000 /* 16777216 */ +#define LDAP_DEBUG_WARNING 0x02000000 /* 33554432 */ +#define LDAP_DEBUG_NOTICE 0x04000000 /* 67108864 */ +#define LDAP_DEBUG_INFO 0x08000000 /* 134217728 */ +#define LDAP_DEBUG_DEBUG 0x10000000 /* 268435456 */ +#define LDAP_DEBUG_ALL_LEVELS 0xFFFFFF +extern int slapd_ldap_debug; + +int loglevel_is_set( int level ); int slapd_log_error_proc( int sev_level, char *subsystem, char *fmt, ... ); int slapi_log_access( int level, char *fmt, ... ) diff --git a/ldap/servers/slapd/psearch.c b/ldap/servers/slapd/psearch.c index 8b36974..793bea3 100644 --- a/ldap/servers/slapd/psearch.c +++ b/ldap/servers/slapd/psearch.c @@ -101,18 +101,18 @@ ps_init_psearch_system() if ( !PS_IS_INITIALIZED()) { psearch_list = (PSearch_List *) slapi_ch_calloc( 1, sizeof( PSearch_List )); if (( psearch_list->pl_rwlock = slapi_new_rwlock()) == NULL ) { - LDAPDebug(LDAP_DEBUG_ERR, "init_psearch_list - Cannot initialize lock structure. " - "The server is terminating.\n", 0, 0, 0 ); + slapi_log_err(SLAPI_LOG_ERR, "ps_init_psearch_system", "Cannot initialize lock structure. " + "The server is terminating.\n"); exit( -1 ); } if (( psearch_list->pl_cvarlock = PR_NewLock()) == NULL ) { - LDAPDebug(LDAP_DEBUG_ERR, "init_psearch_list - Cannot create new lock. " - "The server is terminating.\n", 0, 0, 0 ); + slapi_log_err(SLAPI_LOG_ERR, "ps_init_psearch_system", "Cannot create new lock. " + "The server is terminating.\n"); exit( -1 ); } if (( psearch_list->pl_cvar = PR_NewCondVar( psearch_list->pl_cvarlock )) == NULL ) { - LDAPDebug(LDAP_DEBUG_ERR, "init_psearch_list - Cannot create new condition variable. " - "The server is terminating.\n", 0, 0, 0 ); + slapi_log_err(SLAPI_LOG_ERR, "ps_init_psearch_system", "Cannot create new condition variable. " + "The server is terminating.\n"); exit( -1 ); } psearch_list->pl_head = NULL; @@ -182,9 +182,9 @@ ps_add( Slapi_PBlock *pb, ber_int_t changetypes, int send_entchg_controls ) if(NULL == ps_tid){ int prerr; prerr = PR_GetError(); - LDAPDebug(LDAP_DEBUG_ERR,"ps_add - PR_CreateThread()failed in the " + slapi_log_err(SLAPI_LOG_ERR,"ps_add", "PR_CreateThread()failed in the " "ps_add function: " SLAPI_COMPONENT_NAME_NSPR " error %d (%s)\n", - prerr, slapd_pr_strerror(prerr), 0); + prerr, slapd_pr_strerror(prerr)); /* Now remove the ps from the list so call the function ps_remove */ ps_remove(ps); @@ -282,7 +282,7 @@ ps_send_results( void *arg ) PR_ExitMonitor(ps->ps_pblock->pb_conn->c_mutex); if (conn_acq_flag) { - slapi_log_error(SLAPI_LOG_CONNS, "Persistent Search", + slapi_log_err(SLAPI_LOG_CONNS, "ps_send_results", "conn=%" NSPRIu64 " op=%d Could not acquire the connection - psearch aborted\n", ps->ps_pblock->pb_conn->c_connid, ps->ps_pblock->pb_op->o_opid); } @@ -292,7 +292,7 @@ ps_send_results( void *arg ) while ( (conn_acq_flag == 0) && !ps->ps_complete ) { /* Check for an abandoned operation */ if ( ps->ps_pblock->pb_op == NULL || slapi_op_abandoned( ps->ps_pblock ) ) { - slapi_log_error(SLAPI_LOG_CONNS, "Persistent Search", + slapi_log_err(SLAPI_LOG_CONNS, "ps_send_results", "conn=%" NSPRIu64 " op=%d The operation has been abandoned\n", ps->ps_pblock->pb_conn->c_connid, ps->ps_pblock->pb_op->o_opid); break; @@ -350,7 +350,7 @@ ps_send_results( void *arg ) rc = send_ldap_search_entry( ps->ps_pblock, ec, ectrls, attrs, attrsonly ); if (rc) { - slapi_log_error(SLAPI_LOG_CONNS, "Persistent Search", + slapi_log_err(SLAPI_LOG_CONNS, "ps_send_results", "conn=%" NSPRIu64 " op=%d Error %d sending entry %s with op status %d\n", ps->ps_pblock->pb_conn->c_connid, ps->ps_pblock->pb_op->o_opid, rc, slapi_entry_get_dn_const(ec), ps->ps_pblock->pb_op->o_status); @@ -399,7 +399,7 @@ ps_send_results( void *arg ) /* Clean up the connection structure */ PR_EnterMonitor(conn->c_mutex); - slapi_log_error(SLAPI_LOG_CONNS, "Persistent Search", + slapi_log_err(SLAPI_LOG_CONNS, "ps_send_results", "conn=%" NSPRIu64 " op=%d Releasing the connection and operation\n", conn->c_connid, ps->ps_pblock->pb_op->o_opid); /* Delete this op from the connection's list */ @@ -438,8 +438,8 @@ psearch_alloc(void) ps->ps_pblock = NULL; if (( ps->ps_lock = PR_NewLock()) == NULL ) { - LDAPDebug(LDAP_DEBUG_ERR, "psearch_alloc - Cannot create new lock. " - "Persistent search abandoned.\n", 0, 0, 0 ); + slapi_log_err(SLAPI_LOG_ERR, "psearch_alloc", "Cannot create new lock. " + "Persistent search abandoned.\n"); slapi_ch_free((void **)&ps); return( NULL ); } @@ -534,7 +534,7 @@ ps_service_persistent_searches( Slapi_Entry *e, Slapi_Entry *eprev, ber_int_t ch continue; } - slapi_log_error(SLAPI_LOG_CONNS, "Persistent Search", + slapi_log_err(SLAPI_LOG_CONNS, "ps_service_persistent_searches", "conn=%" NSPRIu64 " op=%d entry %s with chgtype %d " "matches the ps changetype %d\n", ps->ps_pblock->pb_conn->c_connid, @@ -582,10 +582,10 @@ ps_service_persistent_searches( Slapi_Entry *e, Slapi_Entry *eprev, ber_int_t ch eprev ? slapi_entry_get_dn_const(eprev) : NULL, &ctrl ); if ( rc != LDAP_SUCCESS ) { - LDAPDebug(LDAP_DEBUG_ERR, "ps_service_persistent_searches -" - " unable to create EntryChangeNotification control for" + slapi_log_err(SLAPI_LOG_ERR, "ps_service_persistent_searches", + "Unable to create EntryChangeNotification control for" " entry \"%s\" -- control won't be sent.\n", - slapi_entry_get_dn_const(e), 0, 0 ); + slapi_entry_get_dn_const(e)); } } if ( ctrl ) { @@ -614,11 +614,12 @@ ps_service_persistent_searches( Slapi_Entry *e, Slapi_Entry *eprev, ber_int_t ch ldap_control_free( ctrl ); /* Turn 'em loose */ ps_wakeup_all(); - LDAPDebug(LDAP_DEBUG_TRACE, "ps_service_persistent_searches: enqueued entry " - "\"%s\" on %d persistent search lists\n", slapi_entry_get_dn_const(e), matched, 0 ); + slapi_log_err(SLAPI_LOG_TRACE, "ps_service_persistent_searches", "Enqueued entry " + "\"%s\" on %d persistent search lists\n", slapi_entry_get_dn_const(e), matched); } else { - LDAPDebug(LDAP_DEBUG_TRACE, "ps_service_persistent_searches: entry " - "\"%s\" not enqueued on any persistent search lists\n", slapi_entry_get_dn_const(e), 0, 0 ); + slapi_log_err(SLAPI_LOG_TRACE, "ps_service_persistent_searches", + "Entry \"%s\" not enqueued on any persistent search lists\n", + slapi_entry_get_dn_const(e)); } } diff --git a/ldap/servers/slapd/pw.c b/ldap/servers/slapd/pw.c index b966dcb..2506a2b 100644 --- a/ldap/servers/slapd/pw.c +++ b/ldap/servers/slapd/pw.c @@ -64,7 +64,7 @@ pw_send_ldap_result( slapi_pblock_get (pb, SLAPI_OPERATION, &operation); if (NULL == operation) { - slapi_log_error(SLAPI_LOG_ERR, "pw_send_ldap_result", "No operation\n"); + slapi_log_err(SLAPI_LOG_ERR, "pw_send_ldap_result", "No operation\n"); return; } internal_op= operation_is_flag_set(operation, OP_FLAG_INTERNAL); @@ -112,15 +112,15 @@ slapi_pw_find_sv( char *valpwd; int i; - LDAPDebug(LDAP_DEBUG_TRACE, "=> slapi_pw_find value: \"%s\"\n", slapi_value_get_string(v), 0, 0 ); /* JCM Innards */ + slapi_log_err(SLAPI_LOG_TRACE, "slapi_pw_find value", "=> \"%s\"\n", slapi_value_get_string(v)); for ( i = 0; vals && vals[i]; i++ ) { - pwsp = pw_val2scheme( (char*)slapi_value_get_string(vals[i]), &valpwd, 1 ); /* JCM Innards*/ + pwsp = pw_val2scheme( (char*)slapi_value_get_string(vals[i]), &valpwd, 1 ); if ( pwsp != NULL && - (*(pwsp->pws_cmp))( (char*)slapi_value_get_string(v), valpwd ) == 0 ) /* JCM Innards*/ + (*(pwsp->pws_cmp))( (char*)slapi_value_get_string(v), valpwd ) == 0 ) { - LDAPDebug(LDAP_DEBUG_TRACE, + slapi_log_err(SLAPI_LOG_TRACE, "<= slapi_pw_find matched \"%s\" using scheme \"%s\"\n", valpwd, pwsp->pws_name, 0 ); free_pw_scheme( pwsp ); @@ -129,7 +129,7 @@ slapi_pw_find_sv( free_pw_scheme( pwsp ); } - LDAPDebug(LDAP_DEBUG_TRACE, "<= slapi_pw_find no matching password\n", 0, 0, 0 ); + slapi_log_err(SLAPI_LOG_TRACE, "slapi_pw_find no matching password", "<=\n"); return( 1 ); /* no match */ } @@ -171,7 +171,7 @@ char* slapi_encode_ext (Slapi_PBlock *pb, const Slapi_DN *sdn, char *value, char if (pws_enc == NULL) { - slapi_log_error(SLAPI_LOG_ERR, "slapi_encode_ext", + slapi_log_err(SLAPI_LOG_ERR, "slapi_encode_ext", "no encoding password storage scheme found for %s\n", pwpolicy->pw_storagescheme->pws_name ); return NULL; @@ -184,12 +184,12 @@ char* slapi_encode_ext (Slapi_PBlock *pb, const Slapi_DN *sdn, char *value, char { char * scheme_list = plugin_get_pwd_storage_scheme_list(PLUGIN_LIST_PWD_STORAGE_SCHEME); if ( scheme_list != NULL ) { - slapi_log_error(SLAPI_LOG_ERR, "slapi_encode_ext", + slapi_log_err(SLAPI_LOG_ERR, "slapi_encode_ext", "Invalid scheme - %s\n" "Valid values are: %s\n", alg, scheme_list ); slapi_ch_free((void **)&scheme_list); } else { - slapi_log_error(SLAPI_LOG_ERR, "slapi_encode_ext", + slapi_log_err(SLAPI_LOG_ERR, "slapi_encode_ext", "Invalid scheme - %s\n" "no pwdstorage scheme plugin loaded", alg); } @@ -602,7 +602,7 @@ update_pw_info ( Slapi_PBlock *pb , char *old_pw) slapi_pblock_get( pb, SLAPI_REQUESTOR_NDN, &bind_dn); slapi_pblock_get( pb, SLAPI_ENTRY_PRE_OP, &e); if ((NULL == operation) || (NULL == sdn) || (NULL == e)){ - slapi_log_error(SLAPI_LOG_ERR, "update_pw_info", + slapi_log_err(SLAPI_LOG_ERR, "update_pw_info", "Param error - no password entry/target dn/operation\n"); return -1; } @@ -810,7 +810,7 @@ check_pw_syntax_ext ( Slapi_PBlock *pb, const Slapi_DN *sdn, Slapi_Value **vals, return 0; } if (NULL == vals) { - slapi_log_error(SLAPI_LOG_ERR, "check_pw_syntax_ext", + slapi_log_err(SLAPI_LOG_ERR, "check_pw_syntax_ext", "No passwords to check\n" ); return -1; } @@ -821,7 +821,7 @@ check_pw_syntax_ext ( Slapi_PBlock *pb, const Slapi_DN *sdn, Slapi_Value **vals, slapi_pblock_get(pb, SLAPI_IS_REPLICATED_OPERATION, &is_replication); slapi_pblock_get(pb, SLAPI_OPERATION, &operation); if (NULL == operation) { - slapi_log_error(SLAPI_LOG_ERR, "check_pw_syntax_ext", "No slapi operation\n"); + slapi_log_err(SLAPI_LOG_ERR, "check_pw_syntax_ext", "No slapi operation\n"); return -1; } internal_op = slapi_operation_is_flag_set(operation, SLAPI_OP_FLAG_INTERNAL); @@ -1229,8 +1229,8 @@ update_pw_history( Slapi_PBlock *pb, const Slapi_DN *sdn, char *old_pw ) slapi_modify_internal_pb(&mod_pb); slapi_pblock_get(&mod_pb, SLAPI_PLUGIN_INTOP_RESULT, &res); if (res != LDAP_SUCCESS){ - LDAPDebug2Args(LDAP_DEBUG_ERR, - "update_pw_history - Modify error %d on entry '%s'\n", res, dn); + slapi_log_err(SLAPI_LOG_ERR, + "update_pw_history", "Modify error %d on entry '%s'\n", res, dn); } pblock_done(&mod_pb); slapi_ch_free_string(&str); @@ -1325,7 +1325,7 @@ slapi_add_pwd_control ( Slapi_PBlock *pb, char *arg, long time) { LDAPControl new_ctrl; char buf[12]; - LDAPDebug(LDAP_DEBUG_TRACE, "=> slapi_add_pwd_control\n", 0, 0, 0 ); + slapi_log_err(SLAPI_LOG_TRACE, "slapi_add_pwd_control", "=>\n"); sprintf( buf, "%ld", time ); new_ctrl.ldctl_oid = arg; @@ -1354,7 +1354,7 @@ add_password_attrs( Slapi_PBlock *pb, Operation *op, Slapi_Entry *e ) int isShadowAccount = 0; int has_shadowLastChange = 0; - LDAPDebug0Args(LDAP_DEBUG_TRACE, "add_password_attrs\n"); + slapi_log_err(SLAPI_LOG_TRACE, "add_password_attrs", "=>\n"); bvals[0] = &bv; bvals[1] = NULL; @@ -1598,9 +1598,9 @@ pw_get_admin_users(passwdPolicy *pwp) if (res != LDAP_SUCCESS) { slapi_free_search_results_internal(pb); slapi_pblock_destroy(pb); - LDAPDebug(LDAP_DEBUG_ERR, "pw_get_admin_users - Search failed for %s: error %d - " + slapi_log_err(SLAPI_LOG_ERR, "pw_get_admin_users", "Search failed for %s: error %d - " "Password Policy Administrators can not be set\n", - slapi_sdn_get_dn(sdn), res, 0); + slapi_sdn_get_dn(sdn), res); return; } /* @@ -1754,9 +1754,9 @@ new_passwdPolicy(Slapi_PBlock *pb, const char *dn) slapi_entry_free( e ); if ( pw_entry == NULL ) { - LDAPDebug1Arg(LDAP_DEBUG_ERR, - "new_passwdPolicy - Loading global password policy for %s" - "--local policy entry not found\n", dn); + slapi_log_err(SLAPI_LOG_ERR, "new_passwdPolicy", + "Loading global password policy for %s" + " --local policy entry not found\n", dn); goto done; } @@ -1774,8 +1774,8 @@ new_passwdPolicy(Slapi_PBlock *pb, const char *dn) if ((sval = attr_get_present_values(attr))) { pwdpolicy->pw_minage = slapi_value_get_timelonglong(*sval); if (-1 == pwdpolicy->pw_minage) { - LDAPDebug2Args(LDAP_DEBUG_ERR, - "new_passwdPolicy - %s - Invalid passwordMinAge: %s\n", + slapi_log_err(SLAPI_LOG_ERR, + "new_passwdPolicy", "%s - Invalid passwordMinAge: %s\n", slapi_entry_get_dn_const(pw_entry), slapi_value_get_string(*sval)); } @@ -1786,8 +1786,8 @@ new_passwdPolicy(Slapi_PBlock *pb, const char *dn) if ((sval = attr_get_present_values(attr))) { pwdpolicy->pw_maxage = slapi_value_get_timelonglong(*sval); if (-1 == pwdpolicy->pw_maxage) { - LDAPDebug2Args(LDAP_DEBUG_ERR, - "new_passwdPolicy - %s - Invalid passwordMaxAge: %s\n", + slapi_log_err(SLAPI_LOG_ERR, + "new_passwdPolicy", "%s - Invalid passwordMaxAge: %s\n", slapi_entry_get_dn_const(pw_entry), slapi_value_get_string(*sval)); } @@ -1798,8 +1798,8 @@ new_passwdPolicy(Slapi_PBlock *pb, const char *dn) if ((sval = attr_get_present_values(attr))) { pwdpolicy->pw_warning = slapi_value_get_timelonglong(*sval); if (-1 == pwdpolicy->pw_warning) { - LDAPDebug2Args(LDAP_DEBUG_ERR, - "new_passwdPolicy - %s - Invalid passwordWarning: %s\n", + slapi_log_err(SLAPI_LOG_ERR, + "new_passwdPolicy", "%s - Invalid passwordWarning: %s\n", slapi_entry_get_dn_const(pw_entry), slapi_value_get_string(*sval)); } @@ -2078,7 +2078,7 @@ slapi_pwpolicy_make_response_control (Slapi_PBlock *pb, int seconds, int logins, passwordInHistory (8) } } */ - LDAPDebug(LDAP_DEBUG_TRACE, "=> slapi_pwpolicy_make_response_control", 0, 0, 0 ); + slapi_log_err(SLAPI_LOG_TRACE, "slapi_pwpolicy_make_response_control", "=>\n"); if ( ( ber = ber_alloc()) == NULL ) { return rc; @@ -2124,7 +2124,7 @@ slapi_pwpolicy_make_response_control (Slapi_PBlock *pb, int seconds, int logins, ber_bvfree(bvp); } - LDAPDebug(LDAP_DEBUG_TRACE, "<= slapi_pwpolicy_make_response_control (%d)", rc, 0, 0 ); + slapi_log_err(SLAPI_LOG_TRACE, "slapi_pwpolicy_make_response_control", "<= (%d)", rc); return (rc==-1?LDAP_OPERATIONS_ERROR:LDAP_SUCCESS); } @@ -2555,7 +2555,7 @@ pw_entry_constructor(void *object, void *parent) struct slapi_pw_entry_ext *pw_extp = NULL; Slapi_RWLock *rwlock; if ((rwlock = slapi_new_rwlock()) == NULL) { - slapi_log_error(SLAPI_LOG_ERR, "pw_entry_constructor", + slapi_log_err(SLAPI_LOG_ERR, "pw_entry_constructor", "slapi_new_rwlock() failed\n"); return NULL; } @@ -2595,7 +2595,7 @@ pw_exp_init ( void ) pw_entry_destructor, &pw_entry_objtype, &pw_entry_handle) != 0) { - slapi_log_error(SLAPI_LOG_ERR, "pw_exp_init", + slapi_log_err(SLAPI_LOG_ERR, "pw_exp_init", "slapi_register_object_extension failed; " "unhashed password is not able to access\n"); } @@ -2611,14 +2611,14 @@ slapi_pw_get_entry_ext(Slapi_Entry *entry, Slapi_Value ***vals) struct slapi_pw_entry_ext *extp = NULL; if (NULL == vals) { - slapi_log_error(SLAPI_LOG_ERR, "slapi_pw_get_entry_ext", + slapi_log_err(SLAPI_LOG_ERR, "slapi_pw_get_entry_ext", "Output param vals is NULL.\n"); return LDAP_PARAM_ERROR; } *vals = NULL; if ((-1 == pw_entry_objtype) || (-1 == pw_entry_handle)) { - slapi_log_error(SLAPI_LOG_TRACE, "slapi_pw_get_entry_ext", + slapi_log_err(SLAPI_LOG_TRACE, "slapi_pw_get_entry_ext", "pw_entry_extension is not registered\n"); return LDAP_OPERATIONS_ERROR; } @@ -2628,7 +2628,7 @@ slapi_pw_get_entry_ext(Slapi_Entry *entry, Slapi_Value ***vals) entry, pw_entry_handle); if ((NULL == extp) || (NULL == extp->pw_entry_values)) { - slapi_log_error(SLAPI_LOG_TRACE, "slapi_pw_get_entry_ext", + slapi_log_err(SLAPI_LOG_TRACE, "slapi_pw_get_entry_ext", "pw_entry_extension is not set\n"); return LDAP_NO_SUCH_ATTRIBUTE; } @@ -2647,7 +2647,7 @@ slapi_pw_set_entry_ext(Slapi_Entry *entry, Slapi_Value **vals, int flags) struct slapi_pw_entry_ext *extp = NULL; if ((-1 == pw_entry_objtype) || (-1 == pw_entry_handle)) { - slapi_log_error(SLAPI_LOG_TRACE, "slapi_pw_set_entry_ext", + slapi_log_err(SLAPI_LOG_TRACE, "slapi_pw_set_entry_ext", "pw_entry_extension is not registered\n"); return LDAP_OPERATIONS_ERROR; } @@ -2657,7 +2657,7 @@ slapi_pw_set_entry_ext(Slapi_Entry *entry, Slapi_Value **vals, int flags) entry, pw_entry_handle); if (NULL == extp) { - slapi_log_error(SLAPI_LOG_TRACE, "slapi_pw_set_entry_ext", + slapi_log_err(SLAPI_LOG_TRACE, "slapi_pw_set_entry_ext", "pw_entry_extension is not set\n"); return LDAP_NO_SUCH_ATTRIBUTE; } @@ -2686,7 +2686,7 @@ pw_copy_entry_ext(Slapi_Entry *src_e, Slapi_Entry *dest_e) struct slapi_pw_entry_ext *dest_extp = NULL; if ((-1 == pw_entry_objtype) || (-1 == pw_entry_handle)) { - slapi_log_error(SLAPI_LOG_TRACE, "pw_copy_entry_ext", + slapi_log_err(SLAPI_LOG_TRACE, "pw_copy_entry_ext", "pw_entry_extension is not registered\n"); return LDAP_OPERATIONS_ERROR; } @@ -2696,7 +2696,7 @@ pw_copy_entry_ext(Slapi_Entry *src_e, Slapi_Entry *dest_e) src_e, pw_entry_handle); if (NULL == src_extp) { - slapi_log_error(SLAPI_LOG_TRACE, "pw_copy_entry_ext", + slapi_log_err(SLAPI_LOG_TRACE, "pw_copy_entry_ext", "Source pw_entry_extension is not set\n"); return LDAP_NO_SUCH_ATTRIBUTE; } @@ -2708,7 +2708,7 @@ pw_copy_entry_ext(Slapi_Entry *src_e, Slapi_Entry *dest_e) pw_entry_handle); if (NULL == dest_extp) { slapi_rwlock_unlock(src_extp->pw_entry_lock); - slapi_log_error(SLAPI_LOG_TRACE, "pw_copy_entry_ext", + slapi_log_err(SLAPI_LOG_TRACE, "pw_copy_entry_ext", "dest pw_entry_extension is not set\n"); return LDAP_NO_SUCH_ATTRIBUTE; } @@ -2733,7 +2733,7 @@ slapi_get_first_clear_text_pw(Slapi_Entry *entry) const char *password_str = NULL; if ((-1 == pw_entry_objtype) || (-1 == pw_entry_handle)) { - slapi_log_error(SLAPI_LOG_TRACE, "slapi_get_first_clear_text_pw", + slapi_log_err(SLAPI_LOG_TRACE, "slapi_get_first_clear_text_pw", "pw_entry_extension is not registered\n"); return NULL; } @@ -2743,7 +2743,7 @@ slapi_get_first_clear_text_pw(Slapi_Entry *entry) entry, pw_entry_handle); if ((NULL == extp) || (NULL == extp->pw_entry_values)) { - slapi_log_error(SLAPI_LOG_TRACE, "slapi_get_first_clear_text_pw", + slapi_log_err(SLAPI_LOG_TRACE, "slapi_get_first_clear_text_pw", "pw_entry_extension is not set\n"); return NULL; } @@ -2848,7 +2848,7 @@ add_shadow_ext_password_attrs(Slapi_PBlock *pb, Slapi_Entry **e) return rc; } - LDAPDebug0Args(LDAP_DEBUG_TRACE, "--> add_shadow_password_attrs\n"); + slapi_log_err(SLAPI_LOG_TRACE, "add_shadow_ext_password_attrs", "=>\n"); /* shadowMin - the minimum number of days required between password changes. */ if (pwpolicy->pw_minage > 0) { @@ -2970,6 +2970,6 @@ add_shadow_ext_password_attrs(Slapi_PBlock *pb, Slapi_Entry **e) */ #endif - LDAPDebug0Args(LDAP_DEBUG_TRACE, "<-- add_shadow_password_attrs\n"); + slapi_log_err(SLAPI_LOG_TRACE, "add_shadow_ext_password_attrs", "<=\n"); return rc; } diff --git a/ldap/servers/slapd/pw_retry.c b/ldap/servers/slapd/pw_retry.c index a5bc402..33b1713 100644 --- a/ldap/servers/slapd/pw_retry.c +++ b/ldap/servers/slapd/pw_retry.c @@ -200,8 +200,7 @@ Slapi_Entry *get_entry ( Slapi_PBlock *pb, const char *dn) } if (target_dn == NULL) { - LDAPDebug0Args(LDAP_DEBUG_TRACE, - "WARNING: 'get_entry' - no dn specified.\n"); + slapi_log_err(SLAPI_LOG_TRACE, "get_entry", "No dn specified\n"); goto bail; } @@ -214,8 +213,7 @@ Slapi_Entry *get_entry ( Slapi_PBlock *pb, const char *dn) &retentry, pw_get_componentID()); if (search_result != LDAP_SUCCESS) { - LDAPDebug2Args(LDAP_DEBUG_TRACE, - "WARNING: 'get_entry' can't find entry '%s', err %d\n", + slapi_log_err(SLAPI_LOG_TRACE, "get_entry", "Can't find entry '%s', err %d\n", target_dn, search_result); } if (target_dn == dn) { /* target_dn is NOT from target_sdn */ @@ -246,8 +244,8 @@ pw_apply_mods(const Slapi_DN *sdn, Slapi_Mods *mods) slapi_pblock_get(&pb, SLAPI_PLUGIN_INTOP_RESULT, &res); if (res != LDAP_SUCCESS){ - LDAPDebug2Args(LDAP_DEBUG_WARNING, - "pw_apply_mods - passwordPolicy modify error %d on entry '%s'\n", + slapi_log_err(SLAPI_LOG_WARNING, + "pw_apply_mods", "Modify error %d on entry '%s'\n", res, slapi_sdn_get_dn(sdn)); } diff --git a/ldap/servers/slapd/referral.c b/ldap/servers/slapd/referral.c index 2936575..a9c01fa 100644 --- a/ldap/servers/slapd/referral.c +++ b/ldap/servers/slapd/referral.c @@ -46,8 +46,8 @@ g_get_global_referrals(void) global_referrals.ra_rwlock = slapi_new_rwlock(); if (global_referrals.ra_rwlock == NULL) { - LDAPDebug(LDAP_DEBUG_ERR, - "g_get_global_referrals - New lock creation failed\n", 0, 0, 0); + slapi_log_err(SLAPI_LOG_ERR, + "g_get_global_referrals", "New lock creation failed\n"); exit (-1); } @@ -176,9 +176,9 @@ ref_adjust( Slapi_PBlock *pb, struct berval **urls, const Slapi_DN *refsdn, slapi_pblock_get( pb, SLAPI_OPERATION, &op ) != 0 || op == NULL || ( operation_get_type(op) == SLAPI_OPERATION_SEARCH && slapi_pblock_get( pb, SLAPI_SEARCH_SCOPE, &scope ) != 0 )) { - LDAPDebug0Args(LDAP_DEBUG_ANY, "ref_adjust - Referrals suppressed " - "(could not get target DN, operation, " - "or scope from pblock)\n" ); + slapi_log_err(SLAPI_LOG_ERR, "ref_adjust", + "Referrals suppressed (could not get target DN, operation, " + "or scope from pblock)\n" ); return( NULL ); } @@ -236,11 +236,11 @@ ref_adjust( Slapi_PBlock *pb, struct berval **urls, const Slapi_DN *refsdn, /* * log what we did (for debugging purposes) */ - if ( LDAPDebugLevelIsSet( LDAP_DEBUG_ARGS )) { - for ( i = 0; urlscopy[i] != NULL; ++i ) { - LDAPDebug(LDAP_DEBUG_ARGS, "ref_adjust: \"%s\" -> \"%s\"\n", - urls[i]->bv_val, urlscopy[i]->bv_val, 0 ); - } + if ( loglevel_is_set( LDAP_DEBUG_ARGS )) { + for ( i = 0; urlscopy[i] != NULL; ++i ) { + slapi_log_err(SLAPI_LOG_ARGS, "ref_adjust", "\"%s\" -> \"%s\"\n", + urls[i]->bv_val, urlscopy[i]->bv_val); + } } /* diff --git a/ldap/servers/slapd/resourcelimit.c b/ldap/servers/slapd/resourcelimit.c index 422f05f..9e3382c 100644 --- a/ldap/servers/slapd/resourcelimit.c +++ b/ldap/servers/slapd/resourcelimit.c @@ -102,9 +102,9 @@ /* always be logged */ #ifdef SLAPI_RESLIMIT_DEBUG -#define SLAPI_RESLIMIT_TRACELEVEL LDAP_DEBUG_ANY +#define SLAPI_RESLIMIT_TRACELEVEL SLAPI_LOG_INFO #else /* SLAPI_RESLIMIT_DEBUG */ -#define SLAPI_RESLIMIT_TRACELEVEL LDAP_DEBUG_TRACE +#define SLAPI_RESLIMIT_TRACELEVEL SLAPI_LOG_TRACE #endif /* SLAPI_RESLIMIT_DEBUG */ @@ -171,14 +171,14 @@ reslimit_init( void ) reslimit_connext_destructor, &reslimit_connext_objtype, &reslimit_connext_handle ) != 0 ) { - slapi_log_error(SLAPI_LOG_ERR, SLAPI_RESLIMIT_MODULE, + slapi_log_err(SLAPI_LOG_ERR, SLAPI_RESLIMIT_MODULE, "reslimit_init - slapi_register_object_extension()" " failed\n" ); return( -1 ); } if (( reslimit_map_rwlock = slapi_new_rwlock()) == NULL ) { - slapi_log_error(SLAPI_LOG_ERR, SLAPI_RESLIMIT_MODULE, + slapi_log_err(SLAPI_LOG_ERR, SLAPI_RESLIMIT_MODULE, "reslimit_init - slapi_new_rwlock() failed\n" ); return( -1 ); } @@ -232,7 +232,7 @@ reslimit_connext_constructor( void *object, void *parent ) Slapi_RWLock *rwlock; if (( rwlock = slapi_new_rwlock()) == NULL ) { - slapi_log_error(SLAPI_LOG_ERR, SLAPI_RESLIMIT_MODULE, + slapi_log_err(SLAPI_LOG_ERR, SLAPI_RESLIMIT_MODULE, "reslimit_connext_constructor - slapi_new_rwlock() failed\n" ); return( NULL ); } @@ -275,7 +275,7 @@ reslimit_get_ext( Slapi_Connection *conn, const char *logname, { if ( !reslimit_inited && reslimit_init() != 0 ) { if ( NULL != logname ) { - slapi_log_error(SLAPI_LOG_ERR, SLAPI_RESLIMIT_MODULE, + slapi_log_err(SLAPI_LOG_ERR, SLAPI_RESLIMIT_MODULE, "%s: reslimit_init() failed\n", logname ); } return( SLAPI_RESLIMIT_STATUS_INIT_FAILURE ); @@ -285,7 +285,7 @@ reslimit_get_ext( Slapi_Connection *conn, const char *logname, reslimit_connext_objtype, conn, reslimit_connext_handle )) == NULL ) { if ( NULL != logname ) { - slapi_log_error(SLAPI_LOG_ERR, SLAPI_RESLIMIT_MODULE, + slapi_log_err(SLAPI_LOG_ERR, SLAPI_RESLIMIT_MODULE, "%s: slapi_get_object_extension() returned NULL\n", logname ); } return( SLAPI_RESLIMIT_STATUS_INTERNAL_ERROR ); @@ -351,7 +351,7 @@ reslimit_update_from_entry( Slapi_Connection *conn, Slapi_Entry *e ) int free_flags = 0; int rc, i; - LDAPDebug(SLAPI_RESLIMIT_TRACELEVEL, "=> %s conn=0x%x, entry=0x%x\n", + slapi_log_err(SLAPI_RESLIMIT_TRACELEVEL, "=> %s conn=0x%x, entry=0x%x\n", fnname, conn, e ); rc = SLAPI_RESLIMIT_STATUS_SUCCESS; /* optimistic */ @@ -392,7 +392,7 @@ reslimit_update_from_entry( Slapi_Connection *conn, Slapi_Entry *e ) continue; } - LDAPDebug(SLAPI_RESLIMIT_TRACELEVEL, + slapi_log_err(SLAPI_RESLIMIT_TRACELEVEL, "%s: setting limit for handle %d (based on %s)\n", fnname, i, reslimit_map[ i ].rlmap_at ); @@ -409,13 +409,13 @@ reslimit_update_from_entry( Slapi_Connection *conn, Slapi_Entry *e ) rlcdp->rlcd_integer_value[ i ] = slapi_value_get_int( v ); rlcdp->rlcd_integer_available[ i ] = PR_TRUE; - LDAPDebug(SLAPI_RESLIMIT_TRACELEVEL, + slapi_log_err(SLAPI_RESLIMIT_TRACELEVEL, "%s: set limit based on %s to %d\n", fnname, reslimit_map[ i ].rlmap_at, rlcdp->rlcd_integer_value[ i ] ); if ( slapi_valueset_next_value( vs, index, &v ) != -1 ) { - slapi_log_error(SLAPI_LOG_WARNING, SLAPI_RESLIMIT_MODULE, + slapi_log_err(SLAPI_LOG_WARNING, SLAPI_RESLIMIT_MODULE, "%s: ignoring multiple values for %s in entry %s\n", fnname, reslimit_map[ i ].rlmap_at, slapi_entry_get_dn_const( e )); @@ -432,7 +432,7 @@ reslimit_update_from_entry( Slapi_Connection *conn, Slapi_Entry *e ) /* UNLOCKED -- map lock */ log_and_return: - LDAPDebug(SLAPI_RESLIMIT_TRACELEVEL, "<= %s returning status %d\n", + slapi_log_err(SLAPI_RESLIMIT_TRACELEVEL, "<= %s returning status %d\n", fnname, rc, 0 ); return( rc ); @@ -482,14 +482,14 @@ slapi_reslimit_register( int type, const char *attrname, int *handlep ) char *fnname = "slapi_reslimit_register()"; int i, rc; - LDAPDebug(SLAPI_RESLIMIT_TRACELEVEL, "=> %s attrname=%s\n", + slapi_log_err(SLAPI_RESLIMIT_TRACELEVEL, "=> %s attrname=%s\n", fnname, attrname, 0 ); rc = SLAPI_RESLIMIT_STATUS_SUCCESS; /* optimistic */ /* initialize if necessary */ if ( !reslimit_inited && reslimit_init() != 0 ) { - slapi_log_error(SLAPI_LOG_ERR, SLAPI_RESLIMIT_MODULE, + slapi_log_err(SLAPI_LOG_ERR, SLAPI_RESLIMIT_MODULE, "%s: reslimit_init() failed\n", fnname ); rc = SLAPI_RESLIMIT_STATUS_INIT_FAILURE; goto log_and_return; @@ -498,7 +498,7 @@ slapi_reslimit_register( int type, const char *attrname, int *handlep ) /* sanity check parameters */ if ( type != SLAPI_RESLIMIT_TYPE_INT || attrname == NULL || handlep == NULL ) { - slapi_log_error(SLAPI_LOG_ERR, SLAPI_RESLIMIT_MODULE, + slapi_log_err(SLAPI_LOG_ERR, SLAPI_RESLIMIT_MODULE, "%s: parameter error\n", fnname ); rc = SLAPI_RESLIMIT_STATUS_PARAM_ERROR; goto log_and_return; @@ -513,7 +513,7 @@ slapi_reslimit_register( int type, const char *attrname, int *handlep ) for ( i = 0; i < reslimit_map_count; ++i ) { if ( 0 == slapi_attr_type_cmp( reslimit_map[ i ].rlmap_at, attrname, SLAPI_TYPE_CMP_EXACT )) { - slapi_log_error(SLAPI_LOG_ERR, SLAPI_RESLIMIT_MODULE, + slapi_log_err(SLAPI_LOG_ERR, SLAPI_RESLIMIT_MODULE, "%s: parameter error (%s already registered)\n", attrname, fnname ); rc = SLAPI_RESLIMIT_STATUS_PARAM_ERROR; @@ -538,7 +538,7 @@ unlock_and_return: /* UNLOCKED -- map lock */ log_and_return: - LDAPDebug(SLAPI_RESLIMIT_TRACELEVEL, + slapi_log_err(SLAPI_RESLIMIT_TRACELEVEL, "<= %s returning status=%d, handle=%d\n", fnname, rc, (handlep == NULL) ? -1 : *handlep ); @@ -566,14 +566,14 @@ slapi_reslimit_get_integer_limit( Slapi_Connection *conn, int handle, int rc; SLAPIResLimitConnData *rlcdp; - LDAPDebug(SLAPI_RESLIMIT_TRACELEVEL, "=> %s conn=0x%x, handle=%d\n", + slapi_log_err(SLAPI_RESLIMIT_TRACELEVEL, "=> %s conn=0x%x, handle=%d\n", fnname, conn, handle ); rc = SLAPI_RESLIMIT_STATUS_SUCCESS; /* optimistic */ /* sanity check parameters */ if ( limitp == NULL ) { - slapi_log_error(SLAPI_LOG_ERR, SLAPI_RESLIMIT_MODULE, + slapi_log_err(SLAPI_LOG_ERR, SLAPI_RESLIMIT_MODULE, "slapi_reslimit_get_integer_limit - %s: parameter error\n", fnname ); rc = SLAPI_RESLIMIT_STATUS_PARAM_ERROR; goto log_and_return; @@ -595,7 +595,7 @@ slapi_reslimit_get_integer_limit( Slapi_Connection *conn, int handle, if(rlcdp->rlcd_integer_count==0) { rc = SLAPI_RESLIMIT_STATUS_NOVALUE; } else if ( handle < 0 || handle >= rlcdp->rlcd_integer_count ) { - slapi_log_error(SLAPI_LOG_ERR, SLAPI_RESLIMIT_MODULE, + slapi_log_err(SLAPI_LOG_ERR, SLAPI_RESLIMIT_MODULE, "slapi_reslimit_get_integer_limit - %s: unknown handle %d\n", fnname, handle ); rc = SLAPI_RESLIMIT_STATUS_UNKNOWN_HANDLE; } else if ( rlcdp->rlcd_integer_available[ handle ] ) { @@ -608,15 +608,15 @@ slapi_reslimit_get_integer_limit( Slapi_Connection *conn, int handle, log_and_return: - if ( LDAPDebugLevelIsSet( LDAP_DEBUG_TRACE )) { + if ( loglevel_is_set( LDAP_DEBUG_TRACE )) { if ( rc == SLAPI_RESLIMIT_STATUS_SUCCESS ) { - LDAPDebug(SLAPI_RESLIMIT_TRACELEVEL, + slapi_log_err(SLAPI_RESLIMIT_TRACELEVEL, "<= %s returning SUCCESS, value=%d\n", fnname, *limitp, 0 ); } else if ( rc == SLAPI_RESLIMIT_STATUS_NOVALUE ) { - LDAPDebug(SLAPI_RESLIMIT_TRACELEVEL, "<= %s returning NO VALUE\n", + slapi_log_err(SLAPI_RESLIMIT_TRACELEVEL, "<= %s returning NO VALUE\n", fnname, 0, 0 ); } else { - LDAPDebug(SLAPI_RESLIMIT_TRACELEVEL, "<= %s returning ERROR %d\n", + slapi_log_err(SLAPI_RESLIMIT_TRACELEVEL, "<= %s returning ERROR %d\n", fnname, rc, 0 ); } } diff --git a/ldap/servers/slapd/result.c b/ldap/servers/slapd/result.c index 6cafa3a..5c38bae 100644 --- a/ldap/servers/slapd/result.c +++ b/ldap/servers/slapd/result.c @@ -204,7 +204,7 @@ int send_ldap_intermediate( Slapi_PBlock *pb, LDAPControl **ectrls, int rc = 0; int logit = 0; - LDAPDebug(LDAP_DEBUG_TRACE, "=> send_ldap_intermediate\n", 0, 0, 0 ); + slapi_log_err(SLAPI_LOG_TRACE, "send_ldap_intermediate", "=>\n"); slapi_pblock_get (pb, SLAPI_OPERATION, &operation); slapi_pblock_get (pb, SLAPI_CONNECTION, &connection); @@ -213,7 +213,7 @@ int send_ldap_intermediate( Slapi_PBlock *pb, LDAPControl **ectrls, } tag = LDAP_RES_INTERMEDIATE; if ( (ber = der_alloc()) == NULL ) { - LDAPDebug(LDAP_DEBUG_ERR, "send_ldap_intermediate - ber_alloc failed\n", 0, 0, 0 ); + slapi_log_err(SLAPI_LOG_ERR, "send_ldap_intermediate", "ber_alloc failed\n"); goto log_and_return; } /* add the intermediate message */ @@ -239,7 +239,7 @@ int send_ldap_intermediate( Slapi_PBlock *pb, LDAPControl **ectrls, rc = ber_put_seq( ber ); } if ( rc == LBER_ERROR ) { - LDAPDebug(LDAP_DEBUG_ERR, "send_ldap_intermediate - ber_printf failed 0\n", 0, 0, 0 ); + slapi_log_err(SLAPI_LOG_ERR, "send_ldap_intermediate", "ber_printf failed 0\n"); ber_free( ber, 1 /* freebuf */ ); goto log_and_return; } @@ -266,7 +266,7 @@ log_and_return: log_result( pb, operation, rc, tag, 0 ); } - LDAPDebug(LDAP_DEBUG_TRACE, "<= send_ldap_intermediate\n", 0, 0, 0 ); + slapi_log_err(SLAPI_LOG_TRACE, "send_ldap_intermediate", "<= %d\n", rc); return rc; } @@ -385,7 +385,7 @@ send_ldap_result_ext( } - LDAPDebug(LDAP_DEBUG_TRACE, "=> send_ldap_result %d:%s:%s\n", err, + slapi_log_err(SLAPI_LOG_TRACE, "send_ldap_result_ext", "=> %d:%s:%s\n", err, matched ? matched : "", text ? text : "" ); switch ( operation->o_tag ) { @@ -444,7 +444,7 @@ send_ldap_result_ext( if ( ber == NULL ) { if ( (ber = der_alloc()) == NULL ) { - LDAPDebug(LDAP_DEBUG_ERR, "send_ldap_result_ext - ber_alloc failed\n", 0, 0, 0 ); + slapi_log_err(SLAPI_LOG_ERR, "send_ldap_result_ext", "ber_alloc failed\n"); goto log_and_return; } } @@ -598,7 +598,7 @@ send_ldap_result_ext( } if ( rc == LBER_ERROR ) { - LDAPDebug(LDAP_DEBUG_ERR, "send_ldap_result_ext - ber_printf failed 1\n", 0, 0, 0 ); + slapi_log_err(SLAPI_LOG_ERR, "send_ldap_result_ext", "ber_printf failed 1\n"); if (flush_ber_element == 1) { /* we alloced the ber */ ber_free( ber, 1 /* freebuf */ ); @@ -622,7 +622,7 @@ log_and_return: log_result( pb, operation, err, tag, nentries ); } - LDAPDebug(LDAP_DEBUG_TRACE, "<= send_ldap_result\n", 0, 0, 0 ); + slapi_log_err(SLAPI_LOG_TRACE, "send_ldap_result_ext", "<= %d\n", err); } /* @@ -665,8 +665,8 @@ process_read_entry_controls(Slapi_PBlock *pb, char *oid) slapi_pblock_get(pb, SLAPI_ENTRY_PRE_OP, &e); } else { /* Ok, read control not used for this type of operation */ - LDAPDebug(LDAP_DEBUG_ERR, "process_read_entry_controls - Read Entry Controls " - "can not be used for a %s operation.\n", op_to_string(op->o_tag), 0, 0); + slapi_log_err(SLAPI_LOG_ERR, "process_read_entry_controls", "Read Entry Controls " + "can not be used for a %s operation.\n", op_to_string(op->o_tag)); rc = -1; goto done; } @@ -677,14 +677,14 @@ process_read_entry_controls(Slapi_PBlock *pb, char *oid) slapi_pblock_get(pb, SLAPI_ENTRY_POST_OP, &e); } else { /* Ok, read control not used for this type of operation */ - LDAPDebug(LDAP_DEBUG_ERR, "process_read_entry_controls - Read Entry Controls " - "can not be used for a %s operation.\n", op_to_string(op->o_tag), 0, 0); + slapi_log_err(SLAPI_LOG_ERR, "process_read_entry_controls", "Read Entry Controls " + "can not be used for a %s operation.\n", op_to_string(op->o_tag)); rc = -1; goto done; } } if(e == NULL){ - LDAPDebug(LDAP_DEBUG_ERR, "process_read_entry_controls - Unable to retrieve entry\n",0,0,0); + slapi_log_err(SLAPI_LOG_ERR, "process_read_entry_controls", "Unable to retrieve entry\n"); rc = -1; goto done; } @@ -694,8 +694,8 @@ process_read_entry_controls(Slapi_PBlock *pb, char *oid) if ( plugin_call_acl_plugin (pb, e, attrs, NULL, SLAPI_ACL_READ, ACLPLUGIN_ACCESS_READ_ON_ENTRY, NULL ) != LDAP_SUCCESS ) { - LDAPDebug(LDAP_DEBUG_ACL, "process_read_entry_controls - Access to entry not allowed (%s)\n", - slapi_entry_get_dn_const(e), 0, 0 ); + slapi_log_err(SLAPI_LOG_ACL, "process_read_entry_controls", "Access to entry not allowed (%s)\n", + slapi_entry_get_dn_const(e)); rc = -1; goto done; } @@ -734,8 +734,8 @@ process_read_entry_controls(Slapi_PBlock *pb, char *oid) } if(no_attrs && (all_attrs || attr_count)){ /* Can't have both no attrs and some attributes */ - LDAPDebug(LDAP_DEBUG_ERR, "process_read_entry_controls - Both no attributes \"1.1\" and " - "specific attributes were requested.\n", 0, 0, 0 ); + slapi_log_err(SLAPI_LOG_ERR, "process_read_entry_controls", "Both no attributes \"1.1\" and " + "specific attributes were requested.\n"); rc = -1; goto free; } @@ -746,7 +746,7 @@ process_read_entry_controls(Slapi_PBlock *pb, char *oid) } } else { /* this is a problem, malformed request control value */ - LDAPDebug(LDAP_DEBUG_ERR, "process_read_entry_controls - Invalid control value.\n",0,0,0); + slapi_log_err(SLAPI_LOG_ERR, "process_read_entry_controls", "Invalid control value.\n"); rc = -1; goto free; } @@ -765,8 +765,8 @@ process_read_entry_controls(Slapi_PBlock *pb, char *oid) ber_bvfree(res_value); } else { /* failed to encode the result entry */ - LDAPDebug(LDAP_DEBUG_ERR, "process_read_entry_controls - Failed to process READ ENTRY" - " Control (%s), error encoding result entry\n", oid, 0, 0 ); + slapi_log_err(SLAPI_LOG_ERR, "process_read_entry_controls", "Failed to process READ ENTRY" + " Control (%s), error encoding result entry\n", oid); rc = -1; } @@ -776,8 +776,8 @@ free: } if(rc != 0){ /* log an error */ - LDAPDebug(LDAP_DEBUG_ERR, "process_read_entry_controls - Failed to process READ ENTRY " - "Control (%s) ber decoding error\n", oid, 0, 0 ); + slapi_log_err(SLAPI_LOG_ERR, "process_read_entry_controls", "Failed to process READ ENTRY " + "Control (%s) ber decoding error\n", oid); } } done: @@ -818,7 +818,7 @@ send_ldapv3_referral( slapi_pblock_get (pb, SLAPI_OPERATION, &operation); - LDAPDebug(LDAP_DEBUG_TRACE, "=> send_ldapv3_referral\n", 0, 0, 0 ); + slapi_log_err(SLAPI_LOG_TRACE, "send_ldapv3_referral", "=>\n"); if ( conn == NULL ) { if ( operation->o_search_referral_handler != NULL ) { @@ -835,7 +835,7 @@ send_ldapv3_referral( } if ( (ber = der_alloc()) == NULL ) { - LDAPDebug(LDAP_DEBUG_ERR, "send_ldapv3_referral - ber_alloc failed\n", 0, 0, 0 ); + slapi_log_err(SLAPI_LOG_ERR, "send_ldapv3_referral", "ber_alloc failed\n"); send_ldap_result( pb, LDAP_OPERATIONS_ERROR, NULL, "ber_alloc", 0, NULL ); return( -1 ); @@ -860,13 +860,13 @@ send_ldapv3_referral( rc = ber_printf( ber, "s", urls[i]->bv_val ); } if ( rc == LBER_ERROR ) { - LDAPDebug(LDAP_DEBUG_ERR, "send_ldapv3_referral - ber_printf failed 2\n", 0, 0, 0 ); + slapi_log_err(SLAPI_LOG_ERR, "send_ldapv3_referral", "ber_printf failed 2\n"); send_ldap_result( pb, LDAP_OPERATIONS_ERROR, NULL, "ber_printf", 0, NULL ); return( -1 ); } if ( ber_printf( ber, "}}" ) == LBER_ERROR ) { - LDAPDebug(LDAP_DEBUG_ERR, "send_ldapv3_referral - ber_printf failed 3\n", 0, 0, 0 ); + slapi_log_err(SLAPI_LOG_ERR, "send_ldapv3_referral", "ber_printf failed 3\n"); send_ldap_result( pb, LDAP_OPERATIONS_ERROR, NULL, "ber_printf", 0, NULL ); return( -1 ); @@ -983,7 +983,7 @@ encode_attr_2( #endif if (ber_printf(ber, "{s[", returned_type?returned_type:attribute_type) == -1) { - LDAPDebug(LDAP_DEBUG_ERR, "encode_attr_2 - ber_printf failed 4\n", 0, 0, 0 ); + slapi_log_err(SLAPI_LOG_ERR, "encode_attr_2", "ber_printf failed 4\n"); ber_free( ber, 1 ); send_ldap_result(pb, LDAP_OPERATIONS_ERROR, NULL, "ber_printf type", 0, NULL); @@ -996,8 +996,8 @@ encode_attr_2( { if ( ber_printf( ber, "o", v->bv.bv_val,v->bv.bv_len ) == -1 ) { - LDAPDebug(LDAP_DEBUG_ERR, - "encode_attr_2 - ber_printf failed 5\n", 0, 0, 0 ); + slapi_log_err(SLAPI_LOG_ERR, + "encode_attr_2", "ber_printf failed 5\n"); ber_free( ber, 1 ); send_ldap_result( pb, LDAP_OPERATIONS_ERROR, NULL, "ber_printf value", 0, NULL ); @@ -1008,7 +1008,7 @@ encode_attr_2( } if ( ber_printf( ber, "]}" ) == -1 ) { - LDAPDebug(LDAP_DEBUG_ERR, "encode_attr_2 - ber_printf failed 6\n", 0, 0, 0 ); + slapi_log_err(SLAPI_LOG_ERR, "encode_attr_2", "ber_printf failed 6\n"); ber_free( ber, 1 ); send_ldap_result( pb, LDAP_OPERATIONS_ERROR, NULL, "ber_printf type end", 0, NULL ); @@ -1491,8 +1491,8 @@ send_ldap_search_entry_ext( slapi_pblock_get (pb, SLAPI_OPERATION, &operation); - LDAPDebug(LDAP_DEBUG_TRACE, "=> send_ldap_search_entry_ext (%s)\n", - e ? slapi_entry_get_dn_const(e) : "null", 0, 0 ); + slapi_log_err(SLAPI_LOG_TRACE, "send_ldap_search_entry_ext", "=> (%s)\n", + e ? slapi_entry_get_dn_const(e) : "null"); /* set current entry */ slapi_pblock_set(pb, SLAPI_SEARCH_ENTRY_ORIG, e); @@ -1502,9 +1502,9 @@ send_ldap_search_entry_ext( /* call pre entry fn */ rc = plugin_call_plugins(pb, SLAPI_PLUGIN_PRE_ENTRY_FN); if (rc) { - LDAPDebug(LDAP_DEBUG_ERR, - "send_ldap_search_entry_ext - Error %d returned by pre entry plugins for entry %s\n", - rc, e?slapi_entry_get_dn_const(e):"null", 0 ); + slapi_log_err(SLAPI_LOG_ERR, "send_ldap_search_entry_ext", + "Error %d returned by pre entry plugins for entry %s\n", + rc, e?slapi_entry_get_dn_const(e):"null"); goto cleanup; } @@ -1531,8 +1531,7 @@ send_ldap_search_entry_ext( #if !defined(DISABLE_ACL_CHECK) if ( e && plugin_call_acl_plugin (pb, e, attrs, NULL, SLAPI_ACL_READ, ACLPLUGIN_ACCESS_READ_ON_ENTRY, NULL ) != LDAP_SUCCESS ) { - LDAPDebug(LDAP_DEBUG_ACL, "send_ldap_search_entry_ext - Access to entry not allowed\n", - 0, 0, 0 ); + slapi_log_err(SLAPI_LOG_ACL, "send_ldap_search_entry_ext", "Access to entry not allowed\n"); rc = 1; goto cleanup; } @@ -1544,7 +1543,7 @@ send_ldap_search_entry_ext( } if ( (ber = der_alloc()) == NULL ) { - LDAPDebug(LDAP_DEBUG_ERR, "send_ldap_search_entry_ext - ber_alloc failed\n", 0, 0, 0 ); + slapi_log_err(SLAPI_LOG_ERR, "send_ldap_search_entry_ext", "ber_alloc failed\n"); send_ldap_result( pb, LDAP_OPERATIONS_ERROR, NULL, "ber_alloc", 0, NULL ); rc = -1; @@ -1555,7 +1554,7 @@ send_ldap_search_entry_ext( LDAP_RES_SEARCH_ENTRY, slapi_entry_get_dn_const(e) ); if ( rc == -1 ) { - LDAPDebug(LDAP_DEBUG_ERR, "send_ldap_search_entry_ext - ber_printf failed 7\n", 0, 0, 0 ); + slapi_log_err(SLAPI_LOG_ERR, "send_ldap_search_entry_ext", "ber_printf failed 7\n"); send_ldap_result( pb, LDAP_OPERATIONS_ERROR, NULL, "ber_printf dn", 0, NULL ); goto cleanup; @@ -1594,9 +1593,8 @@ send_ldap_search_entry_ext( * and some other stuff. this is not allowed, but * what should we do? we'll allow them to keep going. */ - LDAPDebug(LDAP_DEBUG_TRACE, - "send_ldap_search_entry_ext - Accepting illegal other attributes specified with " - "special \"1.1\" attribute\n", 0, 0, 0 ); + slapi_log_err(SLAPI_LOG_TRACE, "send_ldap_search_entry_ext", + "Accepting illegal other attributes specified with special \"1.1\" attribute\n"); } } @@ -1673,7 +1671,7 @@ send_ldap_search_entry_ext( } if ( rc == -1 ) { - LDAPDebug(LDAP_DEBUG_ERR, "send_ldap_search_entry_ext - ber_printf failed 8\n", 0, 0, 0 ); + slapi_log_err(SLAPI_LOG_ERR, "send_ldap_search_entry_ext", "ber_printf failed 8\n"); send_ldap_result( pb, LDAP_OPERATIONS_ERROR, NULL, "ber_printf entry end", 0, NULL ); goto cleanup; @@ -1736,7 +1734,7 @@ cleanup: ldap_controls_free(searchctrlp); } ber_free( ber, 1 ); - LDAPDebug(LDAP_DEBUG_TRACE, "<= send_ldap_search_entry_ext\n", 0, 0, 0 ); + slapi_log_err(SLAPI_LOG_TRACE, "send_ldap_search_entry_ext", "<= %d\n", rc); return( rc ); } @@ -1776,8 +1774,8 @@ flush_ber( } if ((conn->c_flags & CONN_FLAG_CLOSING) || slapi_op_abandoned(pb)) { - LDAPDebug(LDAP_DEBUG_CONNS, "flush_ber skipped because the " - "connection was marked to be closed or abandoned\n", 0, 0, 0); + slapi_log_err(SLAPI_LOG_CONNS, "flush_ber", + "Skipped because the connection was marked to be closed or abandoned\n"); ber_free( ber, 1 ); /* One of the failure can be because the client has reset the connection ( closed ) * and the status needs to be updated to reflect it */ @@ -1796,9 +1794,8 @@ flush_ber( * and the status needs to be updated to reflect it */ op->o_status = SLAPI_OP_STATUS_ABANDONED; - LDAPDebug(LDAP_DEBUG_CONNS, - "flush_ber failed, error %d (%s)\n", - oserr, slapd_system_strerror( oserr ), 0 ); + slapi_log_err(SLAPI_LOG_CONNS, "flush_ber", "Failed, error %d (%s)\n", + oserr, slapd_system_strerror( oserr )); if (op->o_flags & OP_FLAG_PS) { /* We need to tell disconnect_server() not to ding * all the psearches if one if them disconnected @@ -1811,9 +1808,8 @@ flush_ber( ber_free( ber, 1 ); } else { PRUint64 b; - LDAPDebug(LDAP_DEBUG_BER, - "flush_ber() wrote %u bytes to socket %d\n", - bytes, conn->c_sd, 0 ); + slapi_log_err(SLAPI_LOG_BER, "flush_ber", + "Wrote %lu bytes to socket %d\n", bytes, conn->c_sd); LL_I2L ( b, bytes ) ; slapi_counter_add(num_bytes_sent, b); @@ -2126,7 +2122,7 @@ log_result( Slapi_PBlock *pb, Operation *op, int err, ber_tag_t tag, int nentrie } plugin_dn = plugin_get_dn(plugin); - slapi_log_error(SLAPI_LOG_ERR, "log_result", "Internal unindexed search: source (%s) " + slapi_log_err(SLAPI_LOG_ERR, "log_result", "Internal unindexed search: source (%s) " "search base=\"%s\" filter=\"%s\" etime=%s nentries=%d %s\n", plugin_dn, base_dn, filter_str, etime, nentries, notes_str); @@ -2221,8 +2217,8 @@ encode_read_entry (Slapi_PBlock *pb, Slapi_Entry *e, char **attrs, int alluserat real_attrs_only = SLAPI_SEND_VATTR_FLAG_VIRTUALONLY; } else { /* we cannot service a request for virtual only and real only */ - LDAPDebug(LDAP_DEBUG_ERR,"encode_read_entry - Both real and virtual attributes " - "only controls requested.\n", 0, 0, 0 ); + slapi_log_err(SLAPI_LOG_ERR,"encode_read_entry", + "Both real and virtual attributes only controls requested.\n"); rc = -1; goto cleanup; } diff --git a/ldap/servers/slapd/sasl_io.c b/ldap/servers/slapd/sasl_io.c index 57e5a5e..1337e1c 100644 --- a/ldap/servers/slapd/sasl_io.c +++ b/ldap/servers/slapd/sasl_io.c @@ -77,43 +77,43 @@ debug_print_layers(PRFileDesc *fd) PRSocketOptionData sod; PRInt32 err; - LDAPDebug2Args(LDAP_DEBUG_CONNS, - "debug_print_layers: fd %d sasl_io_recv = %p\n", + slapi_log_err(SLAPI_LOG_CONNS, + "debug_print_layers", "fd %d sasl_io_recv = %p\n", PR_FileDesc2NativeHandle(fd), sasl_io_recv ); - LDAPDebug(LDAP_DEBUG_CONNS, - "debug_print_layers: fd name %s type = %d recv = %p\n", + slapi_log_err(SLAPI_LOG_CONNS, + "debug_print_layers", "fd name %s type = %d recv = %p\n", PR_GetNameForIdentity(fd->identity), PR_GetDescType(fd), fd->methods->recv ? fd->methods->recv : NULL ); sod.option = PR_SockOpt_Nonblocking; if (PR_FAILURE == PR_GetSocketOption(fd, &sod)) { err = PR_GetError(); - LDAPDebug2Args(LDAP_DEBUG_CONNS, - "debug_print_layers: error getting nonblocking option: %d %s\n", + slapi_log_err(SLAPI_LOG_CONNS, + "debug_print_layers", "Error getting nonblocking option: %d %s\n", err, slapd_pr_strerror(err) ); } else { - LDAPDebug1Arg(LDAP_DEBUG_CONNS, - "debug_print_layers: non blocking %d\n", sod.value.non_blocking ); + slapi_log_err(SLAPI_LOG_CONNS, + "debug_print_layers", "Non blocking %d\n", sod.value.non_blocking ); } sod.option = PR_SockOpt_Reuseaddr; if (PR_FAILURE == PR_GetSocketOption(fd, &sod)) { err = PR_GetError(); - LDAPDebug2Args(LDAP_DEBUG_CONNS, - "debug_print_layers: error getting reuseaddr option: %d %s\n", + slapi_log_err(SLAPI_LOG_CONNS, + "debug_print_layers", "Error getting reuseaddr option: %d %s\n", err, slapd_pr_strerror(err) ); } else { - LDAPDebug1Arg(LDAP_DEBUG_CONNS, - "debug_print_layers: reuseaddr %d\n", sod.value.reuse_addr ); + slapi_log_err(SLAPI_LOG_CONNS, + "debug_print_layers", "reuseaddr %d\n", sod.value.reuse_addr ); } sod.option = PR_SockOpt_RecvBufferSize; if (PR_FAILURE == PR_GetSocketOption(fd, &sod)) { err = PR_GetError(); - LDAPDebug2Args(LDAP_DEBUG_CONNS, - "debug_print_layers: error getting recvbuffer option: %d %s\n", + slapi_log_err(SLAPI_LOG_CONNS, + "debug_print_layers", "Error getting recvbuffer option: %d %s\n", err, slapd_pr_strerror(err) ); } else { - LDAPDebug1Arg(LDAP_DEBUG_CONNS, - "debug_print_layers: recvbuffer %d\n", sod.value.recv_buffer_size ); + slapi_log_err(SLAPI_LOG_CONNS, + "debug_print_layers", "recvbuffer %d\n", sod.value.recv_buffer_size ); } fd = fd->lower; } @@ -197,19 +197,19 @@ sasl_io_start_packet(PRFileDesc *fd, PRIntn flags, PRIntervalTime timeout, PRInt debug_print_layers(fd); /* first we need the length bytes */ ret = PR_Recv(fd->lower, buffer, amount, flags, timeout); - LDAPDebug(LDAP_DEBUG_CONNS, - "sasl_io_start_packet - read sasl packet length returned %d on connection %" NSPRIu64 "\n", - ret, c->c_connid, 0 ); + slapi_log_err(SLAPI_LOG_CONNS, "sasl_io_start_packet", + "Read sasl packet length returned %d on connection %" NSPRIu64 "\n", + ret, c->c_connid); if (ret <= 0) { *err = PR_GetError(); if (ret == 0) { - LDAPDebug1Arg(LDAP_DEBUG_CONNS, - "sasl_io_start_packet - connection closed while reading sasl packet length on connection %" NSPRIu64 "\n", - c->c_connid ); + slapi_log_err(SLAPI_LOG_CONNS, "sasl_io_start_packet", + "Connection closed while reading sasl packet length on connection %" NSPRIu64 "\n", + c->c_connid ); } else { - LDAPDebug(LDAP_DEBUG_CONNS, - "sasl_io_start_packet - error reading sasl packet length on connection %" NSPRIu64 " %d:%s\n", - c->c_connid, *err, slapd_pr_strerror(*err) ); + slapi_log_err(SLAPI_LOG_CONNS, "sasl_io_start_packet", + "Error reading sasl packet length on connection %" NSPRIu64 " %d:%s\n", + c->c_connid, *err, slapd_pr_strerror(*err) ); } return ret; } @@ -224,8 +224,8 @@ sasl_io_start_packet(PRFileDesc *fd, PRIntn flags, PRIntervalTime timeout, PRInt memcpy(sp->encrypted_buffer + sp->encrypted_buffer_offset, buffer, ret); sp->encrypted_buffer_offset += ret; if (sp->encrypted_buffer_offset < sizeof(buffer)) { - LDAPDebug2Args(LDAP_DEBUG_CONNS, - "sasl_io_start_packet - read only %d bytes of sasl packet " + slapi_log_err(SLAPI_LOG_CONNS, + "sasl_io_start_packet", "Read only %d bytes of sasl packet " "length on connection %" NSPRIu64 "\n", ret, c->c_connid ); #if defined(EWOULDBLOCK) errno = EWOULDBLOCK; @@ -251,7 +251,7 @@ sasl_io_start_packet(PRFileDesc *fd, PRIntn flags, PRIntervalTime timeout, PRInt ber_len_t ber_len = 0; ber_tag_t tag = 0; - slapi_log_error(SLAPI_LOG_CONNS, "sasl_io_start_packet", "conn=%" NSPRIu64 " fd=%d " + slapi_log_err(SLAPI_LOG_CONNS, "sasl_io_start_packet", "conn=%" NSPRIu64 " fd=%d " "Sent an LDAP message that was not encrypted.\n", c->c_connid, c->c_sd); @@ -264,7 +264,7 @@ sasl_io_start_packet(PRFileDesc *fd, PRIntn flags, PRIntervalTime timeout, PRInt /* Is the ldap operation too large? */ if(ber_len > maxbersize){ - slapi_log_error(SLAPI_LOG_ERR, "sasl_io_start_packet", + slapi_log_err(SLAPI_LOG_ERR, "sasl_io_start_packet", "conn=%" NSPRIu64 " fd=%d Incoming BER Element was too long, max allowable " "is %" BERLEN_T " bytes. Change the nsslapd-maxbersize attribute in " "cn=config to increase.\n", @@ -303,9 +303,10 @@ sasl_io_start_packet(PRFileDesc *fd, PRIntn flags, PRIntervalTime timeout, PRInt PR_SetError(PR_WOULD_BLOCK_ERROR, errno); return PR_FAILURE; } else if (ret > 0) { - LDAPDebug(LDAP_DEBUG_CONNS, - "sasl_io_start_packet - Continued: read sasl packet length returned %d on connection %" NSPRIu64 "\n", - ret, c->c_connid, 0 ); + slapi_log_err(SLAPI_LOG_CONNS, + "sasl_io_start_packet", + "Continued: read sasl packet length returned %d on connection %" NSPRIu64 "\n", + ret, c->c_connid); if((ret + sp->encrypted_buffer_offset) > sp->encrypted_buffer_size){ sasl_io_resize_encrypted_buffer(sp, ret + sp->encrypted_buffer_offset); } @@ -313,7 +314,8 @@ sasl_io_start_packet(PRFileDesc *fd, PRIntn flags, PRIntervalTime timeout, PRInt sp->encrypted_buffer_offset += ret; } else if (ret < 0){ *err = PR_GetError(); - LDAPDebug(LDAP_DEBUG_CONNS, "sasl_io_start_packet - error reading sasl packet length on connection " + slapi_log_err(SLAPI_LOG_CONNS, "sasl_io_start_packet", + "Error reading sasl packet length on connection " "%" NSPRIu64 " %d:%s\n", c->c_connid, *err, slapd_pr_strerror(*err) ); return ret; } @@ -358,7 +360,7 @@ sasl_io_start_packet(PRFileDesc *fd, PRIntn flags, PRIntervalTime timeout, PRInt tag = *ber->ber_ptr++; if (*ber->ber_ptr == LDAP_REQ_UNBIND){ #endif - slapi_log_error(SLAPI_LOG_CONNS, "sasl_io_start_packet", "conn=%" NSPRIu64 " fd=%d " + slapi_log_err(SLAPI_LOG_CONNS, "sasl_io_start_packet", "conn=%" NSPRIu64 " fd=%d " "Received unencrypted UNBIND operation.\n", c->c_connid, c->c_sd); sp->encrypted_buffer_count = sp->encrypted_buffer_offset; @@ -366,7 +368,7 @@ sasl_io_start_packet(PRFileDesc *fd, PRIntn flags, PRIntervalTime timeout, PRInt ber_free(ber, 1); return SASL_IO_BUFFER_NOT_ENCRYPTED; } - slapi_log_error(SLAPI_LOG_CONNS, "sasl_io_start_packet", "conn=%" NSPRIu64 " fd=%d " + slapi_log_err(SLAPI_LOG_CONNS, "sasl_io_start_packet", "conn=%" NSPRIu64 " fd=%d " "Error: received an LDAP message (tag 0x%lx) that was not encrypted.\n", #ifdef USE_OPENLDAP c->c_connid, c->c_sd, (long unsigned int)tag); @@ -378,7 +380,7 @@ sasl_io_start_packet(PRFileDesc *fd, PRIntn flags, PRIntervalTime timeout, PRInt done: /* If we got here we have garbage, or a denied LDAP operation */ - slapi_log_error(SLAPI_LOG_CONNS, "sasl_io_start_packet", "conn=%" NSPRIu64 " fd=%d " + slapi_log_err(SLAPI_LOG_CONNS, "sasl_io_start_packet", "conn=%" NSPRIu64 " fd=%d " "Error: received an invalid message that was not encrypted.\n", c->c_connid, c->c_sd); @@ -396,7 +398,7 @@ done: /* add length itself (for Cyrus SASL library) */ packet_length += sizeof(uint32_t); - LDAPDebug2Args(LDAP_DEBUG_CONNS, + slapi_log_err(SLAPI_LOG_CONNS, "sasl_io_start_packet", "read sasl packet length %ld on connection %" NSPRIu64 "\n", packet_length, c->c_connid ); @@ -404,8 +406,8 @@ done: * setting of -1 means that we allow any size SASL IO packet. */ saslio_limit = config_get_maxsasliosize(); if(((long)saslio_limit != -1) && (packet_length > saslio_limit)) { - LDAPDebug2Args(LDAP_DEBUG_ANY, - "sasl_io_start_packet - SASL encrypted packet length exceeds maximum allowed limit (length=%ld, limit=%ld)." + slapi_log_err(SLAPI_LOG_ERR, "sasl_io_start_packet", + "SASL encrypted packet length exceeds maximum allowed limit (length=%ld, limit=%ld)." " Change the nsslapd-maxsasliosize attribute in cn=config to increase limit.\n", packet_length, config_get_maxsasliosize() ); PR_SetError(PR_BUFFER_OVERFLOW_ERROR, 0); @@ -429,19 +431,19 @@ sasl_io_read_packet(PRFileDesc *fd, PRIntn flags, PRIntervalTime timeout, PRInt3 Connection *c = sp->conn; size_t bytes_remaining_to_read = sp->encrypted_buffer_count - sp->encrypted_buffer_offset; - LDAPDebug2Args(LDAP_DEBUG_CONNS, - "sasl_io_read_packet: reading %d bytes for connection %" NSPRIu64 "\n", - bytes_remaining_to_read, - c->c_connid ); + slapi_log_err(SLAPI_LOG_CONNS, + "sasl_io_read_packet", "Reading %lu bytes for connection %" NSPRIu64 "\n", + bytes_remaining_to_read, c->c_connid ); ret = PR_Recv(fd->lower, sp->encrypted_buffer + sp->encrypted_buffer_offset, bytes_remaining_to_read, flags, timeout); if (ret <= 0) { *err = PR_GetError(); if (ret == 0) { - LDAPDebug1Arg(LDAP_DEBUG_CONNS, - "sasl_io_read_packet: connection closed while reading sasl packet on connection %" NSPRIu64 "\n", c->c_connid ); + slapi_log_err(SLAPI_LOG_CONNS, "sasl_io_read_packet", + "Connection closed while reading sasl packet on connection %" NSPRIu64 "\n", c->c_connid ); } else { - LDAPDebug(LDAP_DEBUG_CONNS, - "sasl_io_read_packet: error reading sasl packet on connection %" NSPRIu64 " %d:%s\n", c->c_connid, *err, slapd_pr_strerror(*err) ); + slapi_log_err(SLAPI_LOG_CONNS, "sasl_io_read_packet", + "Error reading sasl packet on connection %" NSPRIu64 " %d:%s\n", + c->c_connid, *err, slapd_pr_strerror(*err) ); } return ret; } @@ -461,10 +463,12 @@ sasl_io_recv(PRFileDesc *fd, void *buf, PRInt32 len, PRIntn flags, /* Do we have decrypted data buffered from 'before' ? */ bytes_in_buffer = sp->decrypted_buffer_count - sp->decrypted_buffer_offset; - LDAPDebug(LDAP_DEBUG_CONNS, - "sasl_io_recv - Connection %" NSPRIu64 " len %d bytes_in_buffer %d\n", c->c_connid, len, bytes_in_buffer ); - LDAPDebug(LDAP_DEBUG_CONNS, - "sasl_io_recv - Connection %" NSPRIu64 " len %d encrypted buffer count %d\n", c->c_connid, len, sp->encrypted_buffer_count ); + slapi_log_err(SLAPI_LOG_CONNS, "sasl_io_recv", + "Connection %" NSPRIu64 " len %d bytes_in_buffer %lu\n", + c->c_connid, len, bytes_in_buffer ); + slapi_log_err(SLAPI_LOG_CONNS, "sasl_io_recv", + "Connection %" NSPRIu64 " len %d encrypted buffer count %lu\n", + c->c_connid, len, sp->encrypted_buffer_count ); if (0 == bytes_in_buffer) { /* If there wasn't buffered decrypted data, we need to get some... */ if (!sasl_io_reading_packet(sp)) { @@ -497,8 +501,8 @@ sasl_io_recv(PRFileDesc *fd, void *buf, PRInt32 len, PRIntn flags, * when more data arrives */ if (!sasl_io_finished_packet(sp)) { - LDAPDebug(LDAP_DEBUG_CONNS, - "sasl_io_recv - Connection %" NSPRIu64 " - not finished reading packet yet\n", c->c_connid, 0, 0 ); + slapi_log_err(SLAPI_LOG_CONNS, "sasl_io_recv", + "Connection %" NSPRIu64 " - not finished reading packet yet\n", c->c_connid); #if defined(EWOULDBLOCK) errno = EWOULDBLOCK; #elif defined(EAGAIN) @@ -511,16 +515,16 @@ sasl_io_recv(PRFileDesc *fd, void *buf, PRInt32 len, PRIntn flags, { const char *output_buffer = NULL; unsigned int output_length = 0; - LDAPDebug1Arg(LDAP_DEBUG_CONNS, - "sasl_io_recv - Finished reading packet for connection %" NSPRIu64 "\n", c->c_connid ); + slapi_log_err(SLAPI_LOG_CONNS, "sasl_io_recv", + "Finished reading packet for connection %" NSPRIu64 "\n", c->c_connid ); /* Now decode it */ ret = sasl_decode(c->c_sasl_conn,sp->encrypted_buffer,sp->encrypted_buffer_count,&output_buffer,&output_length); /* even if decode fails, need re-initialize the encrypted_buffer */ sp->encrypted_buffer_offset = 0; sp->encrypted_buffer_count = 0; if (SASL_OK == ret) { - LDAPDebug2Args(LDAP_DEBUG_CONNS, - "sasl_io_recv - Decoded packet length %d for connection %" NSPRIu64 "\n", output_length, c->c_connid ); + slapi_log_err(SLAPI_LOG_CONNS, "sasl_io_recv", + "Decoded packet length %u for connection %" NSPRIu64 "\n", output_length, c->c_connid ); if (output_length) { sasl_io_resize_decrypted_buffer(sp,output_length); memcpy(sp->decrypted_buffer,output_buffer,output_length); @@ -529,8 +533,8 @@ sasl_io_recv(PRFileDesc *fd, void *buf, PRInt32 len, PRIntn flags, bytes_in_buffer = output_length; } } else { - LDAPDebug1Arg(LDAP_DEBUG_ANY, - "sasl_io_recv - Failed to decode packet for connection %" NSPRIu64 "\n", c->c_connid ); + slapi_log_err(SLAPI_LOG_ERR, "sasl_io_recv", + "Failed to decode packet for connection %" NSPRIu64 "\n", c->c_connid ); PR_SetError(PR_IO_ERROR, 0); return PR_FAILURE; } @@ -547,15 +551,13 @@ sasl_io_recv(PRFileDesc *fd, void *buf, PRInt32 len, PRIntn flags, if (bytes_in_buffer == bytes_to_return) { sp->decrypted_buffer_offset = 0; sp->decrypted_buffer_count = 0; - LDAPDebug1Arg(LDAP_DEBUG_CONNS, - "sasl_io_recv - All decrypted data returned for connection %" NSPRIu64 "\n", c->c_connid ); + slapi_log_err(SLAPI_LOG_CONNS, "sasl_io_recv", + "All decrypted data returned for connection %" NSPRIu64 "\n", c->c_connid ); } else { sp->decrypted_buffer_offset += bytes_to_return; - LDAPDebug(LDAP_DEBUG_CONNS, - "sasl_io_recv - Returning %d bytes to caller %d bytes left to return for connection %" NSPRIu64 "\n", - bytes_to_return, - sp->decrypted_buffer_count - sp->decrypted_buffer_offset, - c->c_connid ); + slapi_log_err(SLAPI_LOG_CONNS, "sasl_io_recv", + "Returning %lu bytes to caller %lu bytes left to return for connection %" NSPRIu64 "\n", + bytes_to_return, sp->decrypted_buffer_count - sp->decrypted_buffer_offset, c->c_connid ); } ret = bytes_to_return; } @@ -582,28 +584,28 @@ sasl_io_send(PRFileDesc *fd, const void *buf, PRInt32 amount, sasl_io_private *sp = sasl_get_io_private(fd); Connection *c = sp->conn; - LDAPDebug1Arg(LDAP_DEBUG_CONNS, - "sasl_io_send - Writing %d bytes\n", amount ); + slapi_log_err(SLAPI_LOG_CONNS, + "sasl_io_send", "Writing %d bytes\n", amount ); if (sp->send_encrypted) { /* Get SASL to encrypt the buffer */ if (NULL == sp->send_buffer) { ret = sasl_encode(c->c_sasl_conn, buf, amount, &sp->send_buffer, &sp->send_size); if (ret != SASL_OK) { const char *saslerr = sasl_errdetail(c->c_sasl_conn); - LDAPDebug2Args(LDAP_DEBUG_ANY, - "sasl_io_send - Could not encode %d bytes - sasl error %s\n", + slapi_log_err(SLAPI_LOG_ERR, + "sasl_io_send", "Could not encode %d bytes - sasl error %s\n", amount, saslerr ? saslerr : "unknown" ); reset_send_info(sp); PR_SetError(PR_IO_ERROR, 0); return PR_FAILURE; } - LDAPDebug1Arg(LDAP_DEBUG_CONNS, - "sasl_io_send - Encoded as %d bytes\n", sp->send_size ); + slapi_log_err(SLAPI_LOG_CONNS, + "sasl_io_send", "Encoded as %d bytes\n", sp->send_size ); sp->send_offset = 0; } else if ((amount > 0) && (sp->send_offset >= sp->send_size)) { /* something went wrong - we sent too many bytes */ - LDAPDebug2Args(LDAP_DEBUG_ANY, - "sasl_io_send - Client requested to send %d bytes but we " + slapi_log_err(SLAPI_LOG_ERR, + "sasl_io_send", "Client requested to send %d bytes but we " "already sent %d bytes\n", amount, (sp->send_offset >= sp->send_size)); reset_send_info(sp); PR_SetError(PR_BUFFER_OVERFLOW_ERROR, EMSGSIZE); @@ -616,8 +618,8 @@ sasl_io_send(PRFileDesc *fd, const void *buf, PRInt32 amount, ret = amount; /* sent amount of data requested by caller */ reset_send_info(sp); /* done with this buffer, ready for next buffer */ } else if (ret > 0) { /* could not send the entire encrypted buffer - tell caller we're blocked */ - LDAPDebug2Args(LDAP_DEBUG_CONNS, - "sasl_io_send - error: only sent %d of %d encoded bytes\n", ret, + slapi_log_err(SLAPI_LOG_CONNS, + "sasl_io_send", "error: only sent %d of %d encoded bytes\n", ret, (sp->send_size - sp->send_offset) ); sp->send_offset += ret; ret = PR_FAILURE; @@ -656,8 +658,8 @@ sasl_pop_IO_layer(PRFileDesc* stack, int doclose) /* see if stack has the sasl io layer */ if (!sasl_LayerID || !stack) { - LDAPDebug0Args(LDAP_DEBUG_CONNS, - "sasl_pop_IO_layer - No SASL IO layer\n" ); + slapi_log_err(SLAPI_LOG_CONNS, + "sasl_pop_IO_layer", "No SASL IO layer\n" ); return PR_SUCCESS; } @@ -666,8 +668,8 @@ sasl_pop_IO_layer(PRFileDesc* stack, int doclose) if (!doclose) { id = sasl_LayerID; if (!PR_GetIdentitiesLayer(stack, id)) { - LDAPDebug0Args(LDAP_DEBUG_CONNS, - "sasl_pop_IO_layer - No SASL IO layer\n" ); + slapi_log_err(SLAPI_LOG_CONNS, + "sasl_pop_IO_layer", "No SASL IO layer\n" ); return PR_SUCCESS; } } @@ -675,8 +677,8 @@ sasl_pop_IO_layer(PRFileDesc* stack, int doclose) /* remove the layer from the stack */ layer = PR_PopIOLayer(stack, id); if (!layer) { - LDAPDebug0Args(LDAP_DEBUG_CONNS, - "sasl_pop_IO_layer - error - could not pop SASL IO layer\n" ); + slapi_log_err(SLAPI_LOG_CONNS, + "sasl_pop_IO_layer", "Could not pop SASL IO layer\n" ); return PR_FAILURE; } @@ -684,8 +686,8 @@ sasl_pop_IO_layer(PRFileDesc* stack, int doclose) sp = sasl_get_io_private(layer); if (sp) { - LDAPDebug0Args(LDAP_DEBUG_CONNS, - "sasl_pop_IO_layer - removing SASL IO layer\n" ); + slapi_log_err(SLAPI_LOG_CONNS, + "sasl_pop_IO_layer", "Removing SASL IO layer\n" ); /* Free the buffers */ slapi_ch_free_string(&sp->encrypted_buffer); slapi_ch_free_string(&sp->decrypted_buffer); @@ -709,12 +711,12 @@ static PRStatus PR_CALLBACK closeLayer(PRFileDesc* stack) { PRStatus rv = 0; - LDAPDebug0Args(LDAP_DEBUG_CONNS, - "closeLayer - Closing SASL IO layer\n" ); + slapi_log_err(SLAPI_LOG_CONNS, + "closeLayer", "Closing SASL IO layer\n" ); rv = sasl_pop_IO_layer(stack, 1 /* do close */); if (PR_SUCCESS != rv) { - LDAPDebug0Args(LDAP_DEBUG_CONNS, - "closeLayer - Error closing SASL IO layer\n" ); + slapi_log_err(SLAPI_LOG_CONNS, + "closeLayer", "Error closing SASL IO layer\n" ); return rv; } @@ -758,7 +760,7 @@ sasl_io_enable(Connection *c, void *data /* UNUSED */) sasl_io_private *sp = NULL; if ( c->c_flags & CONN_FLAG_CLOSING ) { - slapi_log_error(SLAPI_LOG_ERR, "sasl_io_enable", + slapi_log_err(SLAPI_LOG_ERR, "sasl_io_enable", "Cannot enable SASL security on connection in CLOSING state\n"); return PR_FAILURE; } @@ -769,11 +771,12 @@ sasl_io_enable(Connection *c, void *data /* UNUSED */) sp->conn = c; rv = PR_PushIOLayer(c->c_prfd, PR_TOP_IO_LAYER, layer); if (rv) { - LDAPDebug(LDAP_DEBUG_ERR, - "sasl_io_enable - Error enabling sasl io on connection %" NSPRIu64 " %d:%s\n", c->c_connid, rv, slapd_pr_strerror(rv) ); + slapi_log_err(SLAPI_LOG_ERR, "sasl_io_enable", + "Error enabling sasl io on connection %" NSPRIu64 " %d:%s\n", + c->c_connid, rv, slapd_pr_strerror(rv) ); } else { - LDAPDebug(LDAP_DEBUG_CONNS, - "sasl_io_enable - Enabled sasl io on connection %" NSPRIu64 " \n", c->c_connid, 0, 0 ); + slapi_log_err(SLAPI_LOG_CONNS, "sasl_io_enable", + "Enabled sasl io on connection %" NSPRIu64 " \n", c->c_connid); debug_print_layers(c->c_prfd); } } @@ -790,8 +793,8 @@ sasl_io_cleanup(Connection *c, void *data /* UNUSED */) { int ret = 0; - LDAPDebug(LDAP_DEBUG_CONNS, - "sasl_io_cleanup - Connection %" NSPRIu64 "\n", c->c_connid, 0, 0 ); + slapi_log_err(SLAPI_LOG_CONNS, "sasl_io_cleanup", + "Connection %" NSPRIu64 "\n", c->c_connid); ret = sasl_pop_IO_layer(c->c_prfd, 0 /* do not close */); diff --git a/ldap/servers/slapd/sasl_map.c b/ldap/servers/slapd/sasl_map.c index 3c49d86..1b28e4c 100644 --- a/ldap/servers/slapd/sasl_map.c +++ b/ldap/servers/slapd/sasl_map.c @@ -367,12 +367,12 @@ sasl_map_config_parse_entry(Slapi_Entry *entry, sasl_map_data **new_dp) desc.bv_len = strlen(desc.bv_val); newval[0] = &desc; if (entry_replace_values(entry, "nsSaslMapPriority", newval) != 0){ - LDAPDebug(LDAP_DEBUG_ERR, "sasl_map_config_parse_entry - Failed to reset entry " - "priority to (%d) - previous value (%s)\n", LOW_PRIORITY, priority_str, 0); + slapi_log_err(SLAPI_LOG_ERR, "sasl_map_config_parse_entry", "Failed to reset entry " + "priority to (%d) - previous value (%s)\n", LOW_PRIORITY, priority_str); } else { - LDAPDebug(LDAP_DEBUG_ERR, "sasl_map_config_parse_entry - Resetting invalid nsSaslMapPriority " + slapi_log_err(SLAPI_LOG_ERR, "sasl_map_config_parse_entry", "Resetting invalid nsSaslMapPriority " " value (%s) to the lowest priority (%d)\n", - priority_str, LOW_PRIORITY, 0); + priority_str, LOW_PRIORITY); } priority = LOW_PRIORITY; } @@ -402,34 +402,34 @@ sasl_map_read_config_startup(sasl_map_private *priv) char **map_entry_list = NULL; int ret = 0; - LDAPDebug(LDAP_DEBUG_TRACE, "-> sasl_map_read_config_startup\n", 0, 0, 0 ); + slapi_log_err(SLAPI_LOG_TRACE, "sasl_map_read_config_startup", "=>\n"); if((map_entry_list = getChildren(configDN))) { char **map_entry = NULL; Slapi_Entry *entry = NULL; sasl_map_data *dp = NULL; for (map_entry = map_entry_list; *map_entry && !ret; map_entry++) { - LDAPDebug(LDAP_DEBUG_CONFIG, "sasl_map_read_config_startup - proceesing [%s]\n", *map_entry, 0, 0 ); + slapi_log_err(SLAPI_LOG_CONFIG, "sasl_map_read_config_startup", "Processing [%s]\n", *map_entry); getConfigEntry( *map_entry, &entry ); if ( entry == NULL ) { continue; } ret = sasl_map_config_parse_entry(entry,&dp); if (ret) { - LDAPDebug(LDAP_DEBUG_ERR, "sasl_map_read_config_startup - Failed to parse entry\n", 0, 0, 0 ); + slapi_log_err(SLAPI_LOG_ERR, "sasl_map_read_config_startup", "Failed to parse entry\n"); } else { ret = sasl_map_insert_list_entry(priv,dp); if (ret) { - LDAPDebug(LDAP_DEBUG_ERR, "sasl_map_read_config_startup - Failed to insert entry\n", 0, 0, 0 ); + slapi_log_err(SLAPI_LOG_ERR, "sasl_map_read_config_startup", "Failed to insert entry\n"); } else { - LDAPDebug(LDAP_DEBUG_CONFIG, "sasl_map_read_config_startup - processed [%s]\n", *map_entry, 0, 0 ); + slapi_log_err(SLAPI_LOG_CONFIG, "sasl_map_read_config_startup", "Processed [%s]\n", *map_entry); } } freeConfigEntry( &entry ); } freeChildren( map_entry_list ); } - LDAPDebug(LDAP_DEBUG_TRACE, "<- sasl_map_read_config_startup\n", 0, 0, 0 ); + slapi_log_err(SLAPI_LOG_TRACE, "sasl_map_read_config_startup", "<= %d\n", ret); return ret; } @@ -439,7 +439,7 @@ sasl_map_config_add(Slapi_PBlock *pb, Slapi_Entry* entryBefore, Slapi_Entry* e, int ret = 0; sasl_map_data *dp = NULL; sasl_map_private *priv = sasl_map_get_global_priv(); - LDAPDebug(LDAP_DEBUG_TRACE, "-> sasl_map_config_add\n", 0, 0, 0 ); + slapi_log_err(SLAPI_LOG_TRACE, "sasl_map_config_add", "=>\n"); ret = sasl_map_config_parse_entry(entryBefore,&dp); if (!ret && dp) { ret = sasl_map_insert_list_entry(priv,dp); @@ -451,7 +451,7 @@ sasl_map_config_add(Slapi_PBlock *pb, Slapi_Entry* entryBefore, Slapi_Entry* e, *returncode = LDAP_UNWILLING_TO_PERFORM; ret = SLAPI_DSE_CALLBACK_ERROR; } - LDAPDebug(LDAP_DEBUG_TRACE, "<- sasl_map_config_add\n", 0, 0, 0 ); + slapi_log_err(SLAPI_LOG_TRACE, "sasl_map_config_add", "<= %d\n", ret); return ret; } @@ -464,7 +464,7 @@ sasl_map_config_modify(Slapi_PBlock *pb, Slapi_Entry* entryBefore, Slapi_Entry* int ret = SLAPI_DSE_CALLBACK_ERROR; if((map_name = slapi_entry_attr_get_charptr( entryBefore, "cn" )) == NULL){ - LDAPDebug(LDAP_DEBUG_TRACE, "sasl_map_config_modify: could not find name of map\n",0,0,0); + slapi_log_err(SLAPI_LOG_TRACE, "sasl_map_config_modify", "Could not find name of map\n"); return ret; } if(sasl_map_remove_list_entry(priv, map_name) == 0){ @@ -477,7 +477,7 @@ sasl_map_config_modify(Slapi_PBlock *pb, Slapi_Entry* entryBefore, Slapi_Entry* } } if(ret == SLAPI_DSE_CALLBACK_ERROR){ - LDAPDebug(LDAP_DEBUG_TRACE, "sasl_map_config_modify: failed to update map(%s)\n",map_name,0,0); + slapi_log_err(SLAPI_LOG_TRACE, "sasl_map_config_modify", "Failed to update map(%s)\n",map_name); } slapi_ch_free_string(&map_name); @@ -491,7 +491,7 @@ sasl_map_config_delete(Slapi_PBlock *pb, Slapi_Entry* entryBefore, Slapi_Entry* sasl_map_private *priv = sasl_map_get_global_priv(); char *entry_name = NULL; - LDAPDebug(LDAP_DEBUG_TRACE, "-> sasl_map_config_delete\n", 0, 0, 0 ); + slapi_log_err(SLAPI_LOG_TRACE, "sasl_map_config_delete", "=>\n"); entry_name = slapi_entry_attr_get_charptr( entryBefore, "cn" ); if (entry_name) { /* remove this entry from the list */ @@ -505,7 +505,7 @@ sasl_map_config_delete(Slapi_PBlock *pb, Slapi_Entry* entryBefore, Slapi_Entry* } else { ret = SLAPI_DSE_CALLBACK_OK; } - LDAPDebug(LDAP_DEBUG_TRACE, "<- sasl_map_config_delete\n", 0, 0, 0 ); + slapi_log_err(SLAPI_LOG_TRACE, "sasl_map_config_delete", "<= %d\n", ret); return ret; } @@ -561,17 +561,17 @@ sasl_map_check(sasl_map_data *dp, char *sasl_user_and_realm, char **ldap_search_ int matched = 0; const char *recomp_result = NULL; - LDAPDebug(LDAP_DEBUG_TRACE, "-> sasl_map_check\n", 0, 0, 0 ); + slapi_log_err(SLAPI_LOG_TRACE, "sasl_map_check", "=>\n"); /* Compiles the regex */ re = slapi_re_comp(dp->regular_expression, &recomp_result); if (NULL == re) { - LDAPDebug(LDAP_DEBUG_ERR, - "sasl_map_check - slapi_re_comp failed for expression (%s): %s\n", - dp->regular_expression, recomp_result?recomp_result:"unknown", 0 ); + slapi_log_err(SLAPI_LOG_ERR, + "sasl_map_check", "slapi_re_comp failed for expression (%s): %s\n", + dp->regular_expression, recomp_result?recomp_result:"unknown"); } else { /* Matches the compiled regex against sasl_user_and_realm */ matched = slapi_re_exec(re, sasl_user_and_realm, -1 /* no timelimit */); - LDAPDebug(LDAP_DEBUG_TRACE, "regex: %s, id: %s, %s\n", + slapi_log_err(SLAPI_LOG_TRACE, "sasl_map_check", "regex: %s, id: %s, %s\n", dp->regular_expression, sasl_user_and_realm, matched ? "matched" : "didn't match" ); } @@ -598,8 +598,8 @@ sasl_map_check(sasl_map_data *dp, char *sasl_user_and_realm, char **ldap_search_ rc = slapi_re_subs(re, sasl_user_and_realm, dp->template_base_dn, ldap_search_base, ldap_search_base_len); if (0 != rc) { - LDAPDebug(LDAP_DEBUG_ERR, - "sasl_map_check - slapi_re_subs failed: " + slapi_log_err(SLAPI_LOG_ERR, + "sasl_map_check", "slapi_re_subs failed: " "subject: %s, subst str: %s (%d)\n", sasl_user_and_realm, dp->template_base_dn, rc); slapi_ch_free_string(ldap_search_base); @@ -610,8 +610,8 @@ sasl_map_check(sasl_map_data *dp, char *sasl_user_and_realm, char **ldap_search_ dp->template_search_filter, ldap_search_filter, ldap_search_filter_len, 1); if (0 != rc) { - LDAPDebug(LDAP_DEBUG_ERR, - "sasl_map_check - slapi_re_subs failed: " + slapi_log_err(SLAPI_LOG_ERR, + "sasl_map_check", "slapi_re_subs failed: " "subject: %s, subst str: %s (%d)\n", sasl_user_and_realm, dp->template_search_filter, rc); slapi_ch_free_string(ldap_search_base); @@ -619,22 +619,22 @@ sasl_map_check(sasl_map_data *dp, char *sasl_user_and_realm, char **ldap_search_ } else { /* these values are internal regex representations with * lots of unprintable control chars - escape for logging */ - LDAPDebug(LDAP_DEBUG_TRACE, - "mapped base dn: %s, filter: %s\n", + slapi_log_err(SLAPI_LOG_TRACE, + "sasl_map_check", "mapped base dn: %s, filter: %s\n", escape_string( *ldap_search_base, escape_base ), - escape_string( *ldap_search_filter, escape_filt ), 0 ); + escape_string( *ldap_search_filter, escape_filt )); ret = 1; } } } else { - LDAPDebug(LDAP_DEBUG_ERR, - "sasl_map_check - slapi_re_exec failed: " + slapi_log_err(SLAPI_LOG_ERR, + "sasl_map_check", "slapi_re_exec failed: " "regex: %s, subject: %s (%d)\n", dp->regular_expression, sasl_user_and_realm, matched); } } slapi_re_free(re); - LDAPDebug(LDAP_DEBUG_TRACE, "<- sasl_map_check\n", 0, 0, 0 ); + slapi_log_err(SLAPI_LOG_TRACE, "sasl_map_check", "<= %d\n", ret); return ret; } @@ -660,9 +660,9 @@ sasl_map_domap(sasl_map_data **map, char *sasl_user, char *sasl_realm, char **ld char *sasl_user_and_realm = NULL; int ret = 0; - LDAPDebug(LDAP_DEBUG_TRACE, "-> sasl_map_domap\n", 0, 0, 0 ); + slapi_log_err(SLAPI_LOG_TRACE, "sasl_map_domap", "=>\n"); if(map == NULL){ - LDAPDebug(LDAP_DEBUG_TRACE, "<- sasl_map_domap: Internal error, mapping is NULL\n",0,0,0); + slapi_log_err(SLAPI_LOG_TRACE, "sasl_map_domap", "<= Internal error, mapping is NULL\n"); return ret; } *ldap_search_base = NULL; @@ -673,7 +673,7 @@ sasl_map_domap(sasl_map_data **map, char *sasl_user, char *sasl_realm, char **ld *map = priv->map_data_list; while (*map) { /* If one matches, then make the search params */ - LDAPDebug(LDAP_DEBUG_TRACE, "sasl_map_domap - trying map [%s]\n", (*map)->name, 0, 0 ); + slapi_log_err(SLAPI_LOG_TRACE, "sasl_map_domap", "Trying map [%s]\n", (*map)->name); if((ret = sasl_map_check(*map, sasl_user_and_realm, ldap_search_base, ldap_search_filter))){ *map = sasl_map_next(*map); break; @@ -683,7 +683,7 @@ sasl_map_domap(sasl_map_data **map, char *sasl_user, char *sasl_realm, char **ld if (sasl_user_and_realm) { slapi_ch_free((void**)&sasl_user_and_realm); } - LDAPDebug(LDAP_DEBUG_TRACE, "<- sasl_map_domap (%s)\n", (1 == ret) ? "mapped" : "not mapped", 0, 0 ); + slapi_log_err(SLAPI_LOG_TRACE, "sasl_map_domap", "<= (%s)\n", (1 == ret) ? "mapped" : "not mapped"); return ret; } diff --git a/ldap/servers/slapd/saslbind.c b/ldap/servers/slapd/saslbind.c index 9158f78..bac26ba 100644 --- a/ldap/servers/slapd/saslbind.c +++ b/ldap/servers/slapd/saslbind.c @@ -150,8 +150,8 @@ static int ids_sasl_getopt( { unsigned tmplen; - LDAPDebug(LDAP_DEBUG_TRACE, "ids_sasl_getopt: plugin=%s option=%s\n", - plugin_name ? plugin_name : "", option, 0); + slapi_log_err(SLAPI_LOG_TRACE, "ids_sasl_getopt", "plugin=%s option=%s\n", + plugin_name ? plugin_name : "", option); if (len == NULL) len = &tmplen; @@ -163,7 +163,7 @@ static int ids_sasl_getopt( } else if (strcasecmp(option, "has_plain_passwords") == 0) { *result = "yes"; } else if (strcasecmp(option, "LOG_LEVEL") == 0) { - if (LDAPDebugLevelIsSet(LDAP_DEBUG_TRACE)) { + if (loglevel_is_set(LDAP_DEBUG_TRACE)) { *result = "6"; /* SASL_LOG_TRACE */ } } else if (strcasecmp(option, "auxprop_plugin") == 0) { @@ -185,7 +185,7 @@ static int ids_sasl_log( { switch (level) { case SASL_LOG_ERR: /* log unusual errors (default) */ - slapi_log_error(SLAPI_LOG_ERR, "sasl", "%s\n", message); + slapi_log_err(SLAPI_LOG_ERR, "ids_sasl_log", "%s\n", message); break; case SASL_LOG_FAIL: /* log all authentication failures */ @@ -195,7 +195,7 @@ static int ids_sasl_log( case SASL_LOG_TRACE: /* traces of internal protocols */ case SASL_LOG_PASS: /* traces of internal protocols, including * passwords */ - LDAPDebug(LDAP_DEBUG_TRACE, "sasl(%d): %s\n", level, message, 0); + slapi_log_err(SLAPI_LOG_TRACE, "ids_sasl_log", "(%d): %s\n", level, message); break; case SASL_LOG_NONE: /* don't log anything */ @@ -220,12 +220,13 @@ static void ids_sasl_user_search( Slapi_PBlock *pb = NULL; int i, ret; - LDAPDebug(LDAP_DEBUG_TRACE, "sasl user search basedn=\"%s\" filter=\"%s\"\n", basedn, filter, 0); + slapi_log_err(SLAPI_LOG_TRACE, "ids_sasl_user_search", + "sasl user search basedn=\"%s\" filter=\"%s\"\n", basedn, filter); /* TODO: set size and time limits */ pb = slapi_pblock_new(); if (!pb) { - LDAPDebug(LDAP_DEBUG_TRACE, "null pblock for search_internal_pb\n", 0, 0, 0); + slapi_log_err(SLAPI_LOG_TRACE, "ids_sasl_user_search", "NULL pblock for search_internal_pb\n"); goto out; } @@ -236,16 +237,16 @@ static void ids_sasl_user_search( slapi_pblock_get(pb, SLAPI_PLUGIN_INTOP_RESULT, &ret); if (ret != LDAP_SUCCESS) { - LDAPDebug(LDAP_DEBUG_TRACE, "sasl user search failed basedn=\"%s\" " - "filter=\"%s\": %s\n", - basedn, filter, ldap_err2string(ret)); + slapi_log_err(SLAPI_LOG_TRACE, "ids_sasl_user_search", + "sasl user search failed basedn=\"%s\" filter=\"%s\": %s\n", + basedn, filter, ldap_err2string(ret)); goto out; } slapi_pblock_get(pb, SLAPI_PLUGIN_INTOP_SEARCH_ENTRIES, &entries); if ((entries == NULL) || (entries[0] == NULL)) { - LDAPDebug(LDAP_DEBUG_TRACE, "sasl user search found no entries\n", - 0, 0, 0); + slapi_log_err(SLAPI_LOG_TRACE, "ids_sasl_user_search", + "sasl user search found no entries\n"); goto out; } @@ -255,8 +256,8 @@ static void ids_sasl_user_search( slapi_entry_free(*ep); } *ep = slapi_entry_dup(entries[i]); - LDAPDebug(LDAP_DEBUG_TRACE, "sasl user search found dn=%s\n", - slapi_entry_get_dn(*ep), 0, 0); + slapi_log_err(SLAPI_LOG_TRACE, "ids_sasl_user_search", + "sasl user search found dn=%s\n", slapi_entry_get_dn(*ep)); } out: @@ -292,12 +293,14 @@ static Slapi_Entry *ids_sasl_user_to_entry( /* Check for wildcards in the authid and realm. If we encounter one, * just fail the mapping without performing a costly internal search. */ if (user && strchr(user, '*')) { - LDAPDebug(LDAP_DEBUG_TRACE, "sasl user search encountered a wildcard in " - "the authid. Not attempting to map to entry. (authid=%s)\n", user, 0, 0); + slapi_log_err(SLAPI_LOG_TRACE, "ids_sasl_user_to_entry", + "sasl user search encountered a wildcard in " + "the authid. Not attempting to map to entry. (authid=%s)\n", user); return NULL; } else if (user_realm && strchr(user_realm, '*')) { - LDAPDebug(LDAP_DEBUG_TRACE, "sasl user search encountered a wildcard in " - "the realm. Not attempting to map to entry. (realm=%s)\n", user_realm, 0, 0); + slapi_log_err(SLAPI_LOG_TRACE, "ids_sasl_user_to_entry", + "sasl user search encountered a wildcard in " + "the realm. Not attempting to map to entry. (realm=%s)\n", user_realm); return NULL; } @@ -310,14 +313,15 @@ static Slapi_Entry *ids_sasl_user_to_entry( ctrls, attrs, attrsonly, &entry, &found); if (found == 1) { - LDAPDebug(LDAP_DEBUG_TRACE, "sasl user search found this entry: dn:%s, " - "matching filter=%s\n", entry->e_sdn.dn, filter, 0); + slapi_log_err(SLAPI_LOG_TRACE, "ids_sasl_user_to_entry", + "sasl user search found this entry: dn:%s, matching filter=%s\n", + entry->e_sdn.dn, filter); } else if (found == 0) { - LDAPDebug(LDAP_DEBUG_TRACE, "sasl user search found no entries matching " - "filter=%s\n", filter, 0, 0); + slapi_log_err(SLAPI_LOG_TRACE, "ids_sasl_user_to_entry", + "sasl user search found no entries matchingfilter=%s\n", filter); } else { - LDAPDebug(LDAP_DEBUG_TRACE, "sasl user search found more than one entry " - "matching filter=%s\n", filter, 0, 0); + slapi_log_err(SLAPI_LOG_TRACE, "sasl user search found more than one entry " + "matching filter=%s\n", filter); if (entry) { slapi_entry_free(entry); entry = NULL; @@ -378,14 +382,14 @@ static int ids_sasl_canon_user( if (user == NULL) { goto fail; } - LDAPDebug(LDAP_DEBUG_TRACE, - "ids_sasl_canon_user(user=%s, realm=%s)\n", - user, user_realm ? user_realm : "", 0); + slapi_log_err(SLAPI_LOG_TRACE, + "ids_sasl_canon_user", "(user=%s, realm=%s)\n", + user, user_realm ? user_realm : ""); sasl_getprop(conn, SASL_MECHNAME, (const void**)&mech); if (mech == NULL) { - LDAPDebug0Args(LDAP_DEBUG_TRACE, "Unable to read SASL mechanism while " - "canonifying user.\n") + slapi_log_err(SLAPI_LOG_TRACE, "ids_sasl_canon_user", + "Unable to read SASL mechanism while canonifying user.\n"); goto fail; } @@ -425,11 +429,11 @@ static int ids_sasl_canon_user( * property determines what the bind identity will be if authentication succeeds. */ if (strcasecmp(mech, "ANONYMOUS") == 0) { if (prop_set(propctx, "dn", "", -1) != 0) { - LDAPDebug(LDAP_DEBUG_TRACE, "prop_set(dn) failed\n", 0, 0, 0); + slapi_log_err(SLAPI_LOG_TRACE, "ids_sasl_canon_user", "prop_set(dn) failed\n"); goto fail; } } else if (prop_set(propctx, "dn", dn, -1) != 0) { - LDAPDebug(LDAP_DEBUG_TRACE, "prop_set(dn) failed\n", 0, 0, 0); + slapi_log_err(SLAPI_LOG_TRACE, "ids_sasl_canon_user", "prop_set(dn) failed\n"); goto fail; } @@ -442,10 +446,11 @@ static int ids_sasl_canon_user( * Any SASL mechanism that actually needs the * password is going to fail. We should print a warning * to aid in troubleshooting. */ - LDAPDebug(LDAP_DEBUG_TRACE, "Warning: Detected a sasl bind attempt by an " - "entry whose password is stored in a non-cleartext format. This " - "will not work for mechanisms which require a cleartext password " - "such as DIGEST-MD5 and CRAM-MD5.\n", 0, 0, 0); + slapi_log_err(SLAPI_LOG_TRACE, "ids_sasl_canon_user", + "Warning: Detected a sasl bind attempt by an " + "entry whose password is stored in a non-cleartext format. This " + "will not work for mechanisms which require a cleartext password " + "such as DIGEST-MD5 and CRAM-MD5.\n"); } else { /* This password doesn't have a storage prefix but * just happens to start with the '{' character. We'll @@ -463,13 +468,13 @@ static int ids_sasl_canon_user( #ifdef SASL_AUX_PASSWORD_PROP if (prop_set(propctx, SASL_AUX_PASSWORD_PROP, clear, -1) != 0) { /* Failure is benign here because some mechanisms don't support this property */ - /*LDAPDebug(LDAP_DEBUG_TRACE, "prop_set(userpassword) failed\n", 0, 0, 0); + /*slapi_log_err(SLAPI_LOG_TRACE, "prop_set(userpassword) failed\n", 0, 0, 0); goto fail */ ; } #endif /* SASL_AUX_PASSWORD_PROP */ if (prop_set(propctx, SASL_AUX_PASSWORD, clear, -1) != 0) { /* Failure is benign here because some mechanisms don't support this property */ - /*LDAPDebug(LDAP_DEBUG_TRACE, "prop_set(userpassword) failed\n", 0, 0, 0); + /*slapi_log_err(SLAPI_LOG_TRACE, "prop_set(userpassword) failed\n", 0, 0, 0); goto fail */ ; } } @@ -544,18 +549,18 @@ int ids_sasl_init(void) static int inited = 0; int result; - LDAPDebug(LDAP_DEBUG_TRACE, "=> ids_sasl_init\n", 0, 0, 0 ); + slapi_log_err(SLAPI_LOG_TRACE, "ids_sasl_init", "=>\n"); PR_ASSERT(inited == 0); if (inited != 0) { - LDAPDebug0Args(LDAP_DEBUG_ERR, "ids_sasl_init - called more than once.\n"); + slapi_log_err(SLAPI_LOG_ERR, "ids_sasl_init", "Called more than once.\n"); } inited = 1; serverfqdn = get_localhost_DNS(); - LDAPDebug(LDAP_DEBUG_TRACE, "ids_sasl_init - sasl service fqdn is: %s\n", - serverfqdn, 0, 0); + slapi_log_err(SLAPI_LOG_TRACE, "ids_sasl_init", "sasl service fqdn is: %s\n", + serverfqdn); /* get component ID for internal operations */ generate_component_id(); @@ -577,14 +582,13 @@ int ids_sasl_init(void) result = sasl_server_init(ids_sasl_callbacks, "iDS"); if (result != SASL_OK) { - LDAPDebug(LDAP_DEBUG_TRACE, "ids_sasl_init - failed to initialize sasl library\n", - 0, 0, 0); + slapi_log_err(SLAPI_LOG_TRACE, "ids_sasl_init", "Failed to initialize sasl library\n"); return result; } result = sasl_auxprop_add_plugin("iDS", ids_auxprop_plug_init); - LDAPDebug(LDAP_DEBUG_TRACE, "<= ids_sasl_init\n", 0, 0, 0 ); + slapi_log_err(SLAPI_LOG_TRACE, "ids_sasl_init", "<= \n"); return result; } @@ -599,7 +603,7 @@ void ids_sasl_server_new(Connection *conn) struct propctx *propctx; sasl_security_properties_t secprops = {0}; - LDAPDebug(LDAP_DEBUG_TRACE, "=> ids_sasl_server_new (%s)\n", serverfqdn, 0, 0 ); + slapi_log_err(SLAPI_LOG_TRACE, "ids_sasl_server_new", "=> (%s)\n", serverfqdn); rc = sasl_server_new("ldap", serverfqdn, @@ -611,8 +615,8 @@ void ids_sasl_server_new(Connection *conn) &sasl_conn); if (rc != SASL_OK) { - LDAPDebug(LDAP_DEBUG_ERR, "ids_sasl_server_new - %s\n", - sasl_errstring(rc, NULL, NULL), 0, 0); + slapi_log_err(SLAPI_LOG_ERR, "ids_sasl_server_new", "%s\n", + sasl_errstring(rc, NULL, NULL)); } if (rc == SASL_OK) { @@ -634,14 +638,14 @@ void ids_sasl_server_new(Connection *conn) rc = sasl_setprop(sasl_conn, SASL_SEC_PROPS, &secprops); if (rc != SASL_OK) { - LDAPDebug(LDAP_DEBUG_ERR, "ids_sasl_server_new - sasl_setprop: %s\n", - sasl_errstring(rc, NULL, NULL), 0, 0); + slapi_log_err(SLAPI_LOG_ERR, "ids_sasl_server_new", "sasl_setprop: %s\n", + sasl_errstring(rc, NULL, NULL)); } conn->c_sasl_conn = sasl_conn; conn->c_sasl_ssf = 0; - LDAPDebug(LDAP_DEBUG_TRACE, "<= ids_sasl_server_new\n", 0, 0, 0 ); + slapi_log_err(SLAPI_LOG_TRACE, "ids_sasl_server_new", "<=\n"); return; } @@ -657,7 +661,7 @@ char **ids_sasl_listmech(Slapi_PBlock *pb) char *dupstr; sasl_conn_t *sasl_conn; - LDAPDebug(LDAP_DEBUG_TRACE, "=> ids_sasl_listmech\n", 0, 0, 0 ); + slapi_log_err(SLAPI_LOG_TRACE, "ids_sasl_listmech", "=>\n"); PR_ASSERT(pb); @@ -675,7 +679,7 @@ char **ids_sasl_listmech(Slapi_PBlock *pb) NULL, /* username */ "", ",", "", &str, NULL, NULL) == SASL_OK) { - LDAPDebug(LDAP_DEBUG_TRACE, "ids_sasl_listmech - sasl library mechs: %s\n", str, 0, 0); + slapi_log_err(SLAPI_LOG_TRACE, "ids_sasl_listmech", "sasl library mechs: %s\n", str); /* merge into result set */ dupstr = slapi_ch_strdup(str); others = slapi_str2charray_ext(dupstr, ",", 0 /* don't list duplicate mechanisms */); @@ -685,7 +689,7 @@ char **ids_sasl_listmech(Slapi_PBlock *pb) } PR_ExitMonitor(pb->pb_conn->c_mutex); - LDAPDebug(LDAP_DEBUG_TRACE, "<= ids_sasl_listmech\n", 0, 0, 0 ); + slapi_log_err(SLAPI_LOG_TRACE, "ids_sasl_listmech", "<=\n"); return ret; } @@ -705,7 +709,7 @@ ids_sasl_mech_supported(Slapi_PBlock *pb, const char *mech) int sasl_result = 0; sasl_conn_t *sasl_conn = (sasl_conn_t *)pb->pb_conn->c_sasl_conn; - LDAPDebug(LDAP_DEBUG_TRACE, "=> ids_sasl_mech_supported\n", 0, 0, 0 ); + slapi_log_err(SLAPI_LOG_TRACE, "ids_sasl_mech_supported", "=>\n"); /* sasl_listmech is not thread-safe - caller must lock pb_conn */ @@ -730,7 +734,7 @@ ids_sasl_mech_supported(Slapi_PBlock *pb, const char *mech) charray_free(mechs); slapi_ch_free((void**)&dupstr); - LDAPDebug(LDAP_DEBUG_TRACE, "<= ids_sasl_mech_supported\n", 0, 0, 0 ); + slapi_log_err(SLAPI_LOG_TRACE, "ids_sasl_mech_supported", "<=\n"); return ret; } @@ -760,7 +764,7 @@ void ids_sasl_check_bind(Slapi_PBlock *pb) Slapi_Entry *bind_target_entry = NULL, *referral = NULL; Slapi_Backend *be = NULL; - LDAPDebug(LDAP_DEBUG_TRACE, "=> ids_sasl_check_bind\n", 0, 0, 0 ); + slapi_log_err(SLAPI_LOG_TRACE, "ids_sasl_check_bind", "=>\n"); PR_ASSERT(pb); PR_ASSERT(pb->pb_conn); @@ -810,11 +814,13 @@ void ids_sasl_check_bind(Slapi_PBlock *pb) */ sasl_getprop(sasl_conn, SASL_MECHNAME, (const void**)&activemech); if (activemech == NULL) { - LDAPDebug(LDAP_DEBUG_TRACE, "ids_sasl_check_bind - could not get active sasl mechanism\n", 0, 0, 0); + slapi_log_err(SLAPI_LOG_TRACE, "ids_sasl_check_bind", + "Could not get active sasl mechanism\n"); goto sasl_start; } if (strcasecmp(activemech, mech) != 0) { - LDAPDebug(LDAP_DEBUG_TRACE, "ids_sasl_check_bind - sasl mechanisms differ: active=%s current=%s\n", 0, 0, 0); + slapi_log_err(SLAPI_LOG_TRACE, "ids_sasl_check_bind", + "sasl mechanisms differ: active=%s current=%s\n", activemech, mech); goto sasl_start; } @@ -834,7 +840,7 @@ void ids_sasl_check_bind(Slapi_PBlock *pb) if ((pb->pb_conn->c_flags & CONN_FLAG_SASL_COMPLETE) || continuing) { Slapi_Operation *operation; slapi_pblock_get( pb, SLAPI_OPERATION, &operation); - slapi_log_error(SLAPI_LOG_CONNS, "ids_sasl_check_bind", + slapi_log_err(SLAPI_LOG_CONNS, "ids_sasl_check_bind", "cleaning up sasl IO conn=%" NSPRIu64 " op=%d complete=%d continuing=%d\n", pb->pb_conn->c_connid, operation->o_opid, (pb->pb_conn->c_flags & CONN_FLAG_SASL_COMPLETE), continuing); @@ -874,8 +880,8 @@ sasl_check_result: break; } - LDAPDebug(LDAP_DEBUG_TRACE, "ids_sasl_check_bind - sasl authenticated mech=%s user=%s\n", - mech, username, 0); + slapi_log_err(SLAPI_LOG_TRACE, "ids_sasl_check_bind", "sasl authenticated mech=%s user=%s\n", + mech, username); /* * Retrieve the DN corresponding to the authenticated user. @@ -906,7 +912,7 @@ sasl_check_result: if ((sasl_getprop(sasl_conn, SASL_SSF, (const void**)&ssfp) == SASL_OK) && (*ssfp > 0)) { - LDAPDebug(LDAP_DEBUG_TRACE, "ids_sasl_check_bind - sasl ssf=%u\n", (unsigned)*ssfp, 0, 0); + slapi_log_err(SLAPI_LOG_TRACE, "ids_sasl_check_bind", "sasl ssf=%u\n", (unsigned)*ssfp); } else { *ssfp = 0; } @@ -961,7 +967,7 @@ sasl_check_result: if (slapi_mapping_tree_select(pb, &be, &referral, NULL, 0) != LDAP_SUCCESS) { send_nobackend_ldap_result( pb ); be = NULL; - LDAPDebug(LDAP_DEBUG_TRACE, "<= ids_sasl_check_bind\n", 0, 0, 0 ); + slapi_log_err(SLAPI_LOG_TRACE, "ids_sasl_check_bind", "<=\n"); return; } @@ -1064,7 +1070,7 @@ sasl_check_result: if (bind_target_entry) slapi_entry_free(bind_target_entry); - LDAPDebug(LDAP_DEBUG_TRACE, "=> ids_sasl_check_bind\n", 0, 0, 0 ); + slapi_log_err(SLAPI_LOG_TRACE, "ids_sasl_check_bind", "<=\n"); return; } diff --git a/ldap/servers/slapd/schema.c b/ldap/servers/slapd/schema.c index c0581b7..ff77c92 100644 --- a/ldap/servers/slapd/schema.c +++ b/ldap/servers/slapd/schema.c @@ -293,7 +293,7 @@ static PRStatus schema_dse_mandatory_init( void ) { if ( NULL == ( schema_dse_lock = slapi_new_rwlock())) { - slapi_log_error(SLAPI_LOG_ERR, "schema_dse_mandatory_init", + slapi_log_err(SLAPI_LOG_ERR, "schema_dse_mandatory_init", "slapi_new_rwlock() for schema DSE lock failed\n" ); return PR_FAILURE; } @@ -437,7 +437,7 @@ slapi_schema_load_repl_policies() { if (schema_policy_lock == NULL) { if (NULL == (schema_policy_lock = slapi_new_rwlock())) { - slapi_log_error(SLAPI_LOG_ERR, "slapi_schema_load_repl_policies", + slapi_log_err(SLAPI_LOG_ERR, "slapi_schema_load_repl_policies", "slapi_new_rwlock() for schema replication policy lock failed\n"); return -1; } @@ -745,9 +745,9 @@ slapi_entry_schema_check_ext( Slapi_PBlock *pb, Slapi_Entry *e, int repl_check ) /* find the object class attribute - could error out here */ if ( (aoc = attrlist_find( e->e_attrs, "objectclass" )) == NULL ) { - LDAPDebug(LDAP_DEBUG_ERR, - "slapi_entry_schema_check_ext - Entry \"%s\" required attribute \"objectclass\" missing\n", - slapi_entry_get_dn_const(e), 0, 0 ); + slapi_log_err(SLAPI_LOG_ERR, + "slapi_entry_schema_check_ext", "Entry \"%s\" required attribute \"objectclass\" missing\n", + slapi_entry_get_dn_const(e)); if (pb) { PR_snprintf( errtext, sizeof( errtext ), "missing required attribute \"objectclass\"\n" ); @@ -782,9 +782,9 @@ slapi_entry_schema_check_ext( Slapi_PBlock *pb, Slapi_Entry *e, int repl_check ) ocname = slapi_value_get_string(v); if ( !ocname ) { - LDAPDebug(LDAP_DEBUG_ERR, - "slapi_entry_schema_check_ext - Entry \"%s\" \"objectclass\" value missing\n", - slapi_entry_get_dn_const(e), 0, 0 ); + slapi_log_err(SLAPI_LOG_ERR, + "slapi_entry_schema_check_ext", "Entry \"%s\" \"objectclass\" value missing\n", + slapi_entry_get_dn_const(e)); if (pb) { PR_snprintf( errtext, sizeof( errtext ), "missing \"objectclass\" value\n" ); @@ -820,8 +820,8 @@ slapi_entry_schema_check_ext( Slapi_PBlock *pb, Slapi_Entry *e, int repl_check ) } } - LDAPDebug(LDAP_DEBUG_ERR, - "slapi_entry_schema_check_ext - Entry \"%s\" has unknown object class \"%s\"%s\n", + slapi_log_err(SLAPI_LOG_ERR, + "slapi_entry_schema_check_ext", "Entry \"%s\" has unknown object class \"%s\"%s\n", slapi_entry_get_dn_const(e), escape_string(ocname, ebuf), extra_msg ); if (pb) { @@ -883,10 +883,10 @@ slapi_entry_schema_check_ext( Slapi_PBlock *pb, Slapi_Entry *e, int repl_check ) if ( slapi_attr_flag_is_set( a, SLAPI_ATTR_FLAG_SINGLE ) ) { if (slapi_valueset_count(&a->a_present_values) > 1) { - LDAPDebug(LDAP_DEBUG_ERR, - "slapi_entry_schema_check_ext - Entry \"%s\" single-valued attribute \"%s\" has multiple values\n", + slapi_log_err(SLAPI_LOG_ERR, + "slapi_entry_schema_check_ext", "Entry \"%s\" single-valued attribute \"%s\" has multiple values\n", slapi_entry_get_dn_const(e), - a->a_type, 0 ); + a->a_type); if (pb) { PR_snprintf( errtext, sizeof( errtext ), "single-valued attribute \"%s\" has multiple values\n", @@ -937,8 +937,8 @@ oc_check_required( Slapi_PBlock *pb, Slapi_Entry *e, struct objclass *oc ) /* not there => schema violation */ if ( a == NULL ) { char errtext[ BUFSIZ ]; - LDAPDebug(LDAP_DEBUG_ERR, - "oc_check_required - Entry \"%s\" missing attribute \"%s\" required" + slapi_log_err(SLAPI_LOG_ERR, + "oc_check_required", "Entry \"%s\" missing attribute \"%s\" required" " by object class \"%s\"\n", slapi_entry_get_dn_const(e), oc->oc_required[i], oc->oc_name); @@ -1008,11 +1008,9 @@ oc_check_allowed_sv(Slapi_PBlock *pb, Slapi_Entry *e, const char *type, struct o if ( 0 != rc ) { char errtext[ BUFSIZ ]; char ebuf[ BUFSIZ ]; - LDAPDebug(LDAP_DEBUG_ERR, - "oc_check_allowed_sv - Entry \"%s\" -- attribute \"%s\" not allowed\n", - slapi_entry_get_dn_const(e), - escape_string( type, ebuf ), - 0); + slapi_log_err(SLAPI_LOG_ERR, + "oc_check_allowed_sv", "Entry \"%s\" -- attribute \"%s\" not allowed\n", + slapi_entry_get_dn_const(e), escape_string( type, ebuf )); if (pb) { PR_snprintf( errtext, sizeof( errtext ), @@ -1558,9 +1556,8 @@ schema_attr_enum_callback(struct asyntaxinfo *asip, void *arg) vals[0] = &val; if (!asip) { - LDAPDebug(LDAP_DEBUG_ERR, - "schema_attr_enum_callback - Error: no attribute types in schema_attr_enum_callback\n", - 0, 0, 0); + slapi_log_err(SLAPI_LOG_ERR, "schema_attr_enum_callback", + "Error: no attribute types in schema_attr_enum_callback\n"); return ATTR_SYNTAX_ENUM_NEXT; } @@ -1719,9 +1716,9 @@ schema_syntax_enum_callback(char **names, Slapi_PluginDesc *plugindesc, } if ( oid == NULL ) { /* must have an OID */ - LDAPDebug(LDAP_DEBUG_ERR, "schema_syntax_enum_callback - Error: no OID found in" + slapi_log_err(SLAPI_LOG_ERR, "schema_syntax_enum_callback ", "Error: no OID found in" " schema_syntax_enum_callback for syntax %s\n", - ( names == NULL ) ? "unknown" : names[0], 0, 0); + ( names == NULL ) ? "unknown" : names[0]); return 1; } @@ -1781,8 +1778,8 @@ schema_list_attributes_callback(struct asyntaxinfo *asi, void *arg) struct listargs *aew = (struct listargs *)arg; if (!asi) { - LDAPDebug(LDAP_DEBUG_ERR, "schema_list_attributes_callback - Error: no attribute types in schema_list_attributes_callback\n", - 0, 0, 0); + slapi_log_err(SLAPI_LOG_ERR, "schema_list_attributes_callback", + "Error: no attribute types in schema_list_attributes_callback\n"); return ATTR_SYNTAX_ENUM_NEXT; } if (aew->flag && (asi->asi_flags & aew->flag)) { @@ -2117,7 +2114,7 @@ modify_schema_dse (Slapi_PBlock *pb, Slapi_Entry *entryBefore, Slapi_Entry *entr schema_create_errormsg( returntext, SLAPI_DSE_RETURNTEXT_SIZE, schema_errprefix_generic, attr_name, "Replace is not possible, local consumer schema is a superset of the supplier" ); - slapi_log_error(SLAPI_LOG_ERR, "modify_schema_dse", + slapi_log_err(SLAPI_LOG_ERR, "modify_schema_dse", "[C] Local %s must not be overwritten (set replication log for additional info)\n", attr_name); /* @@ -2214,7 +2211,8 @@ modify_schema_dse (Slapi_PBlock *pb, Slapi_Entry *entryBefore, Slapi_Entry *entr schema_create_errormsg( returntext, SLAPI_DSE_RETURNTEXT_SIZE, schema_errprefix_generic, mods[i]->mod_type, "Replace is not allowed on the subschema subentry" ); - slapi_log_error(SLAPI_LOG_REPL, "schema", "modify_schema_dse: Replace is not allowed on the subschema subentry\n"); + slapi_log_err(SLAPI_LOG_REPL, "modify_schema_dse", + "Replace is not allowed on the subschema subentry\n"); rc = SLAPI_DSE_CALLBACK_ERROR; } else { if (strcasecmp (mods[i]->mod_type, "attributetypes") == 0) { @@ -2492,7 +2490,8 @@ schema_delete_objectclasses( Slapi_Entry *entryBefore, LDAPMod *mod, if ( NULL == mod->mod_bvalues ) { if (is_internal_operation) { - slapi_log_error(SLAPI_LOG_REPL, "schema", "schema_delete_objectclasses: Remove all objectclass in Internal op\n"); + slapi_log_err(SLAPI_LOG_REPL, "schema_delete_objectclasses", + "schema_delete_objectclasses: Remove all objectclass in Internal op\n"); } else { schema_create_errormsg(errorbuf, errorbufsize, schema_errprefix_oc, NULL, "Cannot remove all schema object classes"); @@ -2516,14 +2515,16 @@ schema_delete_objectclasses( Slapi_Entry *entryBefore, LDAPMod *mod, if (poc2->oc_superior && (strcasecmp (poc2->oc_superior, delete_oc->oc_name) == 0)) { if (is_internal_operation) { - slapi_log_error(SLAPI_LOG_REPL, "schema", "schema_delete_objectclasses: Should not delete object class (%s) which has child object classes" + slapi_log_err(SLAPI_LOG_REPL, "schema_delete_objectclasses", + "Should not delete object class (%s) which has child object classes" ". But accept it because it is internal operation\n", delete_oc->oc_name); } else { schema_create_errormsg(errorbuf, errorbufsize, schema_errprefix_oc, delete_oc->oc_name, "Cannot delete an object class" " which has child object classes"); - slapi_log_error(SLAPI_LOG_REPL, "schema", "schema_delete_objectclasses: Cannot delete an object class (%s) which has child object classes\n", + slapi_log_err(SLAPI_LOG_REPL, "schema_delete_objectclasses", + "Cannot delete an object class (%s) which has child object classes\n", delete_oc->oc_name); rc = LDAP_UNWILLING_TO_PERFORM; goto unlock_and_return; @@ -2537,14 +2538,16 @@ schema_delete_objectclasses( Slapi_Entry *entryBefore, LDAPMod *mod, else { if (is_internal_operation) { - slapi_log_error(SLAPI_LOG_REPL, "schema", "schema_delete_objectclasses: Should not delete a standard object class (%s)" + slapi_log_err(SLAPI_LOG_REPL, "schema_delete_objectclasses", + "Should not delete a standard object class (%s)" ". But accept it because it is internal operation\n", delete_oc->oc_name); oc_delete_nolock (poc->oc_name); } else { schema_create_errormsg( errorbuf, errorbufsize, schema_errprefix_oc, delete_oc->oc_name, "Cannot delete a standard object class" ); - slapi_log_error(SLAPI_LOG_REPL, "schema", "schema_delete_objectclasses: Cannot delete a standard object class (%s)\n", + slapi_log_err(SLAPI_LOG_REPL, "schema_delete_objectclasses", + "Cannot delete a standard object class (%s)\n", delete_oc->oc_name); rc = LDAP_UNWILLING_TO_PERFORM; goto unlock_and_return; @@ -2604,7 +2607,7 @@ schema_delete_attributes ( Slapi_Entry *entryBefore, LDAPMod *mod, if (NULL == mod->mod_bvalues) { if (is_internal_operation) { - slapi_log_error(SLAPI_LOG_REPL, "schema", "schema_delete_attributes: Remove all attributetypes in Internal op\n"); + slapi_log_err(SLAPI_LOG_REPL, "schema_delete_attributes", "Remove all attributetypes in Internal op\n"); } else { schema_create_errormsg( errorbuf, errorbufsize, schema_errprefix_at, NULL, "Cannot remove all schema attribute types" ); @@ -2637,14 +2640,14 @@ schema_delete_attributes ( Slapi_Entry *entryBefore, LDAPMod *mod, /* only modify attrs which were user defined */ if (a->asi_flags & SLAPI_ATTR_FLAG_STD_ATTR) { if (is_internal_operation) { - slapi_log_error(SLAPI_LOG_REPL, "schema", "schema_delete_attributes: Should not delete a standard attribute type (%s)" + slapi_log_err(SLAPI_LOG_REPL, "schema_delete_attributes", "Should not delete a standard attribute type (%s)" ". But accept it because it is internal operation\n", psbAttrName->buffer); } else { schema_create_errormsg( errorbuf, errorbufsize, schema_errprefix_at, psbAttrName->buffer, "Cannot delete a standard attribute type"); - slapi_log_error(SLAPI_LOG_REPL, "schema", "schema_delete_attributes: Cannot delete a standard attribute type (%s)\n", + slapi_log_err(SLAPI_LOG_REPL, "schema_delete_attributes", "Cannot delete a standard attribute type (%s)\n", psbAttrName->buffer); attr_syntax_return(a); return schema_return(LDAP_UNWILLING_TO_PERFORM, psbAttrOid, psbAttrName, @@ -2680,14 +2683,14 @@ schema_delete_attributes ( Slapi_Entry *entryBefore, LDAPMod *mod, if (attr_in_use_by_an_oc) { if (is_internal_operation) { - slapi_log_error(SLAPI_LOG_REPL, "schema", "schema_delete_attributes: Should not delete an attribute (%s) used in oc (%s)" + slapi_log_err(SLAPI_LOG_REPL, "schema_delete_attributes", "Should not delete an attribute (%s) used in oc (%s)" ". But accept it because it is internal operation\n", oc_list_type, oc->oc_name); } else { schema_create_errormsg(errorbuf, errorbufsize, schema_errprefix_at, psbAttrName->buffer, "Is included in the %s list for object class %s. Cannot delete.", oc_list_type, oc->oc_name); - slapi_log_error(SLAPI_LOG_REPL, "schema", "schema_delete_attributes: Could delete an attribute (%s) used in oc (%s)" + slapi_log_err(SLAPI_LOG_REPL, "schema_delete_attributes", "Could delete an attribute (%s) used in oc (%s)" ". But accept it because it is internal operation\n", oc_list_type, oc->oc_name); break; @@ -2697,7 +2700,7 @@ schema_delete_attributes ( Slapi_Entry *entryBefore, LDAPMod *mod, oc_unlock(); if (attr_in_use_by_an_oc) { if (is_internal_operation) { - slapi_log_error(SLAPI_LOG_REPL, "schema", "schema_delete_attributes: Should not delete an attribute used in oc" + slapi_log_err(SLAPI_LOG_REPL, "schema_delete_attributes", "Should not delete an attribute used in oc" ". But accept it because it is internal operation\n"); } else { @@ -2958,9 +2961,9 @@ schema_replace_attributes ( Slapi_PBlock *pb, LDAPMod *mod, char *errorbuf, if ( NULL == ( oldasip = attr_syntax_get_by_oid( newasip->asi_oid, 0 ))) { /* new attribute type */ - LDAPDebug(LDAP_DEBUG_TRACE, "schema_replace_attributes:" - " new type %s (OID %s)\n", - newasip->asi_name, newasip->asi_oid, 0 ); + slapi_log_err(SLAPI_LOG_TRACE, "schema_replace_attributes", + "New type %s (OID %s)\n", + newasip->asi_name, newasip->asi_oid); } else { /* the name matches -- check the rest */ if ( attr_syntax_equal( newasip, oldasip )) { @@ -2970,9 +2973,9 @@ schema_replace_attributes ( Slapi_PBlock *pb, LDAPMod *mod, char *errorbuf, newasip = NULL; } else { /* modified attribute type */ - LDAPDebug(LDAP_DEBUG_TRACE, "schema_replace_attributes:" - " replacing type %s (OID %s)\n", - newasip->asi_name, newasip->asi_oid, 0 ); + slapi_log_err(SLAPI_LOG_TRACE, "schema_replace_attributes", + "Replacing type %s (OID %s)\n", + newasip->asi_name, newasip->asi_oid); /* flag for deletion */ attr_syntax_delete( oldasip, 0 ); } @@ -3132,9 +3135,9 @@ schema_replace_objectclasses ( Slapi_PBlock *pb, LDAPMod *mod, char *errorbuf, } else { /* some differences: discard old and keep the new one */ oc_free( &tmpocp ); - LDAPDebug(LDAP_DEBUG_TRACE, "schema_replace_objectclasses:" - " replacing object class %s (OID %s)\n", - newocp->oc_name, newocp->oc_oid, 0 ); + slapi_log_err(SLAPI_LOG_TRACE, "schema_replace_objectclasses", + "Replacing object class %s (OID %s)\n", + newocp->oc_name, newocp->oc_oid); addocp = newocp; } break; /* we found it -- exit the loop */ @@ -3144,9 +3147,9 @@ schema_replace_objectclasses ( Slapi_PBlock *pb, LDAPMod *mod, char *errorbuf, } if ( NULL == addocp ) { - LDAPDebug(LDAP_DEBUG_TRACE, "schema_replace_objectclasses:" - " new object class %s (OID %s)\n", - newocp->oc_name, newocp->oc_oid, 0 ); + slapi_log_err(SLAPI_LOG_TRACE, "schema_replace_objectclasses", + "New object class %s (OID %s)\n", + newocp->oc_name, newocp->oc_oid); addocp = newocp; } @@ -3399,7 +3402,7 @@ read_oc_ldif ( const char *input, struct objclass **oc, char *errorbuf, schema_create_errormsg( errorbuf, errorbufsize, schema_errprefix_oc, NULL, "One or more values are required for the objectClasses attribute" ); - LDAPDebug(LDAP_DEBUG_ERR, "read_oc_ldif - NULL args passed to read_oc_ldif\n",0,0,0); + slapi_log_err(SLAPI_LOG_ERR, "read_oc_ldif", "NULL args passed to read_oc_ldif\n"); return read_oc_ldif_return( LDAP_OPERATIONS_ERROR, pOcOid, psbOcName, pOcSup, pOcDesc ); } @@ -3938,9 +3941,8 @@ read_at_ldif(const char *input, struct asyntaxinfo **asipp, char *errorbuf, asi_parent = attr_syntax_get_by_name(pSuperior, schema_flags); /* if we find no match then server won't start or add the attribute type */ if (asi_parent == NULL) { - LDAPDebug(LDAP_DEBUG_PARSE, - "Cannot find parent attribute type \"%s\"\n",pSuperior, - NULL,NULL); + slapi_log_err(SLAPI_LOG_PARSE, "read_at_ldif", + "Cannot find parent attribute type \"%s\"\n",pSuperior); schema_create_errormsg( errorbuf, errorbufsize, schema_errprefix_at, first_attr_name, "Missing parent attribute syntax OID"); @@ -3953,9 +3955,9 @@ read_at_ldif(const char *input, struct asyntaxinfo **asipp, char *errorbuf, if (pso && (NULL == pSyntax)) { pSyntax = slapi_ch_strdup(pso); - LDAPDebug(LDAP_DEBUG_TRACE, + slapi_log_err(SLAPI_LOG_TRACE, "read_at_ldif", "Inheriting syntax %s from parent type %s\n", - pSyntax, pSuperior,NULL); + pSyntax, pSuperior); } else if (NULL == pSyntax) { schema_create_errormsg( errorbuf, errorbufsize, schema_errprefix_at, first_attr_name, @@ -4147,7 +4149,7 @@ parse_attr_str(const char *input, struct asyntaxinfo **asipp, char *errorbuf, char ebuf[SLAPI_DSE_RETURNTEXT_SIZE]; parser_flags |= LDAP_SCHEMA_ALLOW_QUOTED; if (config_set_enquote_sup_oc(CONFIG_ENQUOTE_SUP_OC_ATTRIBUTE, "on", ebuf, CONFIG_APPLY)) { - slapi_log_error(SLAPI_LOG_ERR, "parse_attr_str", "Failed to enable %s: %s\n", + slapi_log_err(SLAPI_LOG_ERR, "parse_attr_str", "Failed to enable %s: %s\n", CONFIG_ENQUOTE_SUP_OC_ATTRIBUTE, ebuf); } } @@ -4188,7 +4190,7 @@ parse_attr_str(const char *input, struct asyntaxinfo **asipp, char *errorbuf, if(input == NULL || '\0' == input[0]){ schema_create_errormsg( errorbuf, errorbufsize, schema_errprefix_at, NULL, "One or more values are required for the attributeTypes attribute" ); - LDAPDebug(LDAP_DEBUG_ERR, "parse_attr_str - NULL args passed to parse_attr_str\n",0,0,0); + slapi_log_err(SLAPI_LOG_ERR, "parse_attr_str", "NULL args passed to parse_attr_str\n"); return invalid_syntax_error; } /* @@ -4260,8 +4262,8 @@ parse_attr_str(const char *input, struct asyntaxinfo **asipp, char *errorbuf, asi_parent = attr_syntax_get_by_name(atype->at_sup_oid, schema_flags); /* if we find no match then server won't start or add the attribute type */ if (asi_parent == NULL) { - LDAPDebug(LDAP_DEBUG_ERR, "parse_attr_str - Cannot find parent attribute type \"%s\"\n", - atype->at_sup_oid, NULL, NULL); + slapi_log_err(SLAPI_LOG_ERR, "parse_attr_str", "Cannot find parent attribute type \"%s\"\n", + atype->at_sup_oid); schema_create_errormsg( errorbuf, errorbufsize, schema_errprefix_at, first_attr_name, "Missing parent attribute syntax OID"); status = invalid_syntax_error; @@ -4278,9 +4280,9 @@ parse_attr_str(const char *input, struct asyntaxinfo **asipp, char *errorbuf, if (pso && (NULL == atype->at_syntax_oid)) { atype->at_syntax_oid = slapi_ch_strdup(pso); - LDAPDebug(LDAP_DEBUG_TRACE, - "parse_attr_str - Inheriting syntax %s from parent type %s\n", - atype->at_syntax_oid, atype->at_sup_oid,NULL); + slapi_log_err(SLAPI_LOG_TRACE, + "parse_attr_str", "Inheriting syntax %s from parent type %s\n", + atype->at_syntax_oid, atype->at_sup_oid); } else if (NULL == atype->at_syntax_oid) { schema_create_errormsg( errorbuf, errorbufsize, schema_errprefix_at, first_attr_name, @@ -4532,7 +4534,7 @@ parse_objclass_str ( const char *input, struct objclass **oc, char *errorbuf, char ebuf[SLAPI_DSE_RETURNTEXT_SIZE]; parser_flags |= LDAP_SCHEMA_ALLOW_QUOTED; if (config_set_enquote_sup_oc(CONFIG_ENQUOTE_SUP_OC_ATTRIBUTE, "on", ebuf, CONFIG_APPLY)) { - slapi_log_error(SLAPI_LOG_ERR, "parse_objclass_str", "Failed to enable %s: %s\n", + slapi_log_err(SLAPI_LOG_ERR, "parse_objclass_str", "Failed to enable %s: %s\n", CONFIG_ENQUOTE_SUP_OC_ATTRIBUTE, ebuf); } } @@ -4567,7 +4569,7 @@ parse_objclass_str ( const char *input, struct objclass **oc, char *errorbuf, if ( NULL == input || '\0' == input[0] ) { schema_create_errormsg( errorbuf, errorbufsize, schema_errprefix_oc, NULL, "One or more values are required for the objectClasses attribute" ); - LDAPDebug(LDAP_DEBUG_ERR, "parse_objclass_str - NULL args passed to read_oc_ldif\n",0,0,0); + slapi_log_err(SLAPI_LOG_ERR, "parse_objclass_str", "NULL args passed to read_oc_ldif\n"); return LDAP_OPERATIONS_ERROR; } /* @@ -4812,9 +4814,8 @@ schema_check_oc_attrs ( struct objclass *poc, if ( errorbuf == NULL || poc == NULL || poc->oc_name == NULL) { /* error */ - LDAPDebug(LDAP_DEBUG_PARSE, - "Null args passed to schema_check_oc_attrs\n", - NULL, NULL, NULL); + slapi_log_err(SLAPI_LOG_PARSE, "schema_check_oc_attrs", + "Null args passed to schema_check_oc_attrs\n"); return -1; } @@ -4946,7 +4947,7 @@ schema_check_oid( const char *name, const char *oid, PRBool isAttribute, if ( name == NULL || oid == NULL) { /* this is bad */ - LDAPDebug(LDAP_DEBUG_ERR, "schema_check_oid - NULL passed to schema_check_oid\n",0,0,0); + slapi_log_err(SLAPI_LOG_ERR, "schema_check_oid", "NULL passed to schema_check_oid\n"); return 0; } @@ -5079,8 +5080,8 @@ strip_oc_options( struct objclass *poc ) { for ( i = 0; poc->oc_allowed && poc->oc_allowed[i]; i++ ) { if ( (mod = stripOption( poc->oc_allowed[i] )) != NULL ){ - LDAPDebug(LDAP_DEBUG_ERR, - "strip_oc_options - Removed option \"%s\" from allowed attribute type " + slapi_log_err(SLAPI_LOG_ERR, + "strip_oc_options", "Removed option \"%s\" from allowed attribute type " "\"%s\" in object class \"%s\".\n", mod, poc->oc_allowed[i], poc->oc_name ); numRemoved++; @@ -5089,8 +5090,8 @@ strip_oc_options( struct objclass *poc ) { for ( i = 0; poc->oc_required && poc->oc_required[i]; i++ ) { if ( (mod = stripOption( poc->oc_required[i] )) != NULL ){ - LDAPDebug(LDAP_DEBUG_ERR, - "strip_oc_options - Removed option \"%s\" from required attribute type " + slapi_log_err(SLAPI_LOG_ERR, + "strip_oc_options", "Removed option \"%s\" from required attribute type " "\"%s\" in object class \"%s\".\n", mod, poc->oc_required[i], poc->oc_name ); numRemoved++; @@ -5299,7 +5300,7 @@ init_schema_dse_ext(char *schemadir, Slapi_Backend *be, filelist = get_priority_filelist(myschemadir, ".*ldif$"); if (!filelist || !*filelist) { - slapi_log_error(SLAPI_LOG_ERR, "init_schema_dse_ext", + slapi_log_err(SLAPI_LOG_ERR, "init_schema_dse_ext", "No schema files were found in the directory %s\n", myschemadir); free_filelist(filelist); rc = 0; @@ -5376,7 +5377,7 @@ init_schema_dse_ext(char *schemadir, Slapi_Backend *be, } if (rc) { - slapi_log_error(SLAPI_LOG_ERR, "init_schema_dse_ext", "Could not add" + slapi_log_err(SLAPI_LOG_ERR, "init_schema_dse_ext", "Could not add" " attribute type \"objectClass\" to the schema: %s\n", errorbuf); } @@ -5424,7 +5425,7 @@ init_schema_dse_ext(char *schemadir, Slapi_Backend *be, if (backend_plugin->plg_add_schema) { (backend_plugin->plg_add_schema)( NULL ); } else { - slapi_log_error(SLAPI_LOG_ERR, "init_schema_dse_ext", + slapi_log_err(SLAPI_LOG_ERR, "init_schema_dse_ext", "backend has not set internal schema\n" ); } } @@ -5493,7 +5494,7 @@ parse_xstring_list( const char *schema_value, const char *name, size_t namelen, /* for debugging if ( xvals == NULL || xvals[0] == NULL ) { - LDAPDebug(LDAP_DEBUG_ERR, "no xstring values for xstring (%s) in (%s)\n", name, schema_value, 0 ); + slapi_log_err(SLAPI_LOG_ERR, "no xstring values for xstring (%s) in (%s)\n", name, schema_value, 0 ); } */ @@ -6057,9 +6058,9 @@ va_expand_one_oc( const char *dn, const Slapi_Attr *a, Slapi_ValueSet *vs, const slapi_valueset_add_attr_value_ext(a, vs, slapi_value_new_string(sup_oc->oc_name), SLAPI_VALUE_FLAG_PASSIN); - LDAPDebug(LDAP_DEBUG_TRACE, + slapi_log_err(SLAPI_LOG_TRACE, "va_expand_one_oc", "Entry \"%s\": added missing objectClass value %s\n", - dn, sup_oc->oc_name, 0 ); + dn, sup_oc->oc_name); } @@ -6145,7 +6146,7 @@ slapi_validate_schema_files(char *schemadir) if (rc) { return LDAP_SUCCESS; } else { - slapi_log_error(SLAPI_LOG_ERR, "schema_reload", + slapi_log_err(SLAPI_LOG_ERR, "schema_reload", "slapi_validate_schema_files failed\n" ); return LDAP_OBJECT_CLASS_VIOLATION; } @@ -6170,7 +6171,7 @@ slapi_reload_schema_files(char *schemadir) if (NULL == be) { - slapi_log_error(SLAPI_LOG_ERR, "schema_reload", + slapi_log_err(SLAPI_LOG_ERR, "schema_reload", "slapi_reload_schema_files failed\n" ); return LDAP_LOCAL_ERROR; } @@ -6199,7 +6200,7 @@ slapi_reload_schema_files(char *schemadir) } else { reload_schemafile_unlock(); slapi_be_Unlock(be); - slapi_log_error(SLAPI_LOG_ERR, "schema_reload", + slapi_log_err(SLAPI_LOG_ERR, "schema_reload", "slapi_reload_schema_files failed\n" ); return LDAP_LOCAL_ERROR; } @@ -6241,7 +6242,7 @@ slapi_schema_list_objectclass_attributes(const char *ocname_or_oid, charray_merge(&attrs, oc->oc_allowed, 1/*copy_strs*/); break; default: - slapi_log_error(SLAPI_LOG_ERR, "slapi_schema_list_objectclass_attributes", + slapi_log_err(SLAPI_LOG_ERR, "slapi_schema_list_objectclass_attributes", "flag 0x%x not supported\n", flags ); break; } @@ -6316,13 +6317,15 @@ schema_oc_superset_check(struct objclass *oc_list1, struct objclass *oc_list2, c repl_schema_policy = schema_check_policy(replica_role, REPL_SCHEMA_OBJECTCLASS, oc_1->oc_name, oc_1->oc_oid); if (repl_schema_policy == REPL_SCHEMA_UPDATE_ACCEPT_VALUE) { /* We are skipping the superset checking for that objectclass */ - slapi_log_error(SLAPI_LOG_REPL, "schema", "Do not check if this OBJECTCLASS is missing on local/remote schema [%s or %s]\n", oc_1->oc_name, oc_1->oc_oid); + slapi_log_err(SLAPI_LOG_REPL, "schema_oc_superset_check", + "Do not check if this OBJECTCLASS is missing on local/remote schema [%s or %s]\n", oc_1->oc_name, oc_1->oc_oid); continue; } else if (repl_schema_policy == REPL_SCHEMA_UPDATE_REJECT_VALUE) { /* This objectclass being present, we need to fail as if it was a superset * keep evaluating to have all the objectclass checking */ - slapi_log_error(SLAPI_LOG_REPL, "schema", "%s objectclass prevents replication of the schema\n", oc_1->oc_name); + slapi_log_err(SLAPI_LOG_REPL, "schema_oc_superset_check", + "%s objectclass prevents replication of the schema\n", oc_1->oc_name); rc = 1; if(debug_logging){ /* we continue to check all the objectclasses so we log what is wrong */ @@ -6343,11 +6346,13 @@ schema_oc_superset_check(struct objclass *oc_list1, struct objclass *oc_list2, c rc = 1; if (debug_logging) { if (replica_role == REPL_SCHEMA_AS_CONSUMER) { - slapi_log_error(SLAPI_LOG_REPL, "schema", "Local %s schema objectclasses is a superset of" - " the received one.\n", oc_1->oc_name); + slapi_log_err(SLAPI_LOG_REPL, "schema_oc_superset_check", + "Local %s schema objectclasses is a superset of" + " the received one.\n", oc_1->oc_name); } else { - slapi_log_error(SLAPI_LOG_REPL, "schema", "Remote %s schema objectclasses is a superset of" - " the received one.\n", oc_1->oc_name); + slapi_log_err(SLAPI_LOG_REPL, "schema_oc_superset_check", + "Remote %s schema objectclasses is a superset of" + " the received one.\n", oc_1->oc_name); } continue; } else { @@ -6355,7 +6360,8 @@ schema_oc_superset_check(struct objclass *oc_list1, struct objclass *oc_list2, c } } } else { - slapi_log_error(SLAPI_LOG_REPL, "schema", "Fail to retrieve in the %s schema [%s or %s]\n", + slapi_log_err(SLAPI_LOG_REPL, "schema_oc_superset_check", + "Fail to retrieve in the %s schema [%s or %s]\n", description, oc_1->oc_name, oc_1->oc_oid); @@ -6457,8 +6463,8 @@ schema_oc_to_string(struct objclass *oc) } strcat(oc_str, " )"); - slapi_log_error(SLAPI_LOG_REPL, "schema", "schema_oc_to_string: replace (old[%d]=%s)\n", - size, oc_str); + slapi_log_err(SLAPI_LOG_REPL, "schema_oc_to_string", + "Replace (old[%d]=%s)\n",size, oc_str); return(oc_str); @@ -6497,21 +6503,23 @@ schema_list_oc2learn(struct objclass *oc_remote_list, struct objclass *oc_local_ if ((oc_local == NULL) || (schema_oc_compare(oc_local, oc_remote, message) < 0)) { /* This replica does not know this objectclass, It needs to be added */ - slapi_log_error(SLAPI_LOG_REPL, "schema", "Add that unknown/extended objectclass %s (%s)\n", + slapi_log_err(SLAPI_LOG_REPL, "schema_list_oc2learn", + "Add that unknown/extended objectclass %s (%s)\n", oc_remote->oc_name, oc_remote->oc_oid); if ((mods_index = (struct schema_mods_indexes *) slapi_ch_calloc(1, sizeof (struct schema_mods_indexes))) == NULL) { - slapi_log_error(SLAPI_LOG_ERR, "schema_list_oc2learn", "Fail to Add (no memory) objectclass %s (%s)\n", + slapi_log_err(SLAPI_LOG_ERR, "schema_list_oc2learn", + "Fail to Add (no memory) objectclass %s (%s)\n", oc_remote->oc_name, oc_remote->oc_oid); continue; } /* insert it at the end of the list - * to keep the order of the original schema - * For example superior oc should be declared first - */ + * to keep the order of the original schema + * For example superior oc should be declared first + */ mods_index->index = index; mods_index->next = NULL; mods_index->new_value = NULL; @@ -6560,15 +6568,17 @@ schema_list_attr2learn(struct asyntaxinfo *at_list_local, struct asyntaxinfo *at if (((at_local = attr_syntax_find(at_remote, at_list_local)) == NULL) || (schema_at_compare(at_local, at_remote, message, debug_logging) < 0)) { /* This replica does not know this attribute, It needs to be added */ - slapi_log_error(SLAPI_LOG_REPL, "schema_list_attr2learn", "Add that unknown/extended attribute %s (%s)\n", + slapi_log_err(SLAPI_LOG_REPL, "schema_list_attr2learn", + "Add that unknown/extended attribute %s (%s)\n", at_remote->asi_name, at_remote->asi_oid); if ((mods_index = (struct schema_mods_indexes *) slapi_ch_calloc(1, sizeof (struct schema_mods_indexes))) == NULL) { - slapi_log_error(SLAPI_LOG_ERR, "schema_list_attr2learn", "Fail to Add (no memory) attribute %s (%s)\n", + slapi_log_err(SLAPI_LOG_ERR, "schema_list_attr2learn", + "Fail to Add (no memory) attribute %s (%s)\n", at_remote->asi_name, at_remote->asi_oid); - continue; + break; } /* insert it in the list */ @@ -6632,7 +6642,7 @@ schema_oc_compare_strict(struct objclass *oc_1, struct objclass *oc_2, const cha } if (moved_must_to_may) { /* This is a special case where oc1 is actually NOT a superset of oc2 */ - slapi_log_error(SLAPI_LOG_REPL, "schema", "Attribute %s is no longer 'required' in '%s' of the %s schema but is now 'allowed'\n", + slapi_log_err(SLAPI_LOG_REPL, "schema_oc_compare_strict", "Attribute %s is no longer 'required' in '%s' of the %s schema but is now 'allowed'\n", oc_1->oc_orig_required[i], oc_1->oc_name, description); @@ -6640,7 +6650,7 @@ schema_oc_compare_strict(struct objclass *oc_1, struct objclass *oc_2, const cha /* The required attribute in the oc1 * is not required in the oc2 */ - slapi_log_error(SLAPI_LOG_REPL, "schema", "Attribute %s is not required in '%s' of the %s schema\n", + slapi_log_err(SLAPI_LOG_REPL, "schema_oc_compare_strict", "Attribute %s is not required in '%s' of the %s schema\n", oc_1->oc_orig_required[i], oc_1->oc_name, description); @@ -6671,7 +6681,7 @@ schema_oc_compare_strict(struct objclass *oc_1, struct objclass *oc_2, const cha /* The allowed attribute in the remote schema (remote_oc->oc_orig_allowed[i]) * is not allowed in the local schema */ - slapi_log_error(SLAPI_LOG_REPL, "schema", "Attribute %s is not allowed in '%s' of the %s schema\n", + slapi_log_err(SLAPI_LOG_REPL, "schema_oc_compare_strict", "Attribute %s is not allowed in '%s' of the %s schema\n", oc_1->oc_orig_allowed[i], oc_1->oc_name, description); @@ -6740,7 +6750,7 @@ schema_at_compare(struct asyntaxinfo *at_1, struct asyntaxinfo *at_2, char *mess /* at_1 is a superset */ if (debug_logging) { - slapi_log_error(SLAPI_LOG_REPL, "schema", "%s schema attribute [%s] is not " + slapi_log_err(SLAPI_LOG_REPL, "schema_at_compare", "%s schema attribute [%s] is not " "\"single-valued\" \n", message, at_1->asi_name); } return 1; @@ -6748,7 +6758,7 @@ schema_at_compare(struct asyntaxinfo *at_1, struct asyntaxinfo *at_2, char *mess if ((at_1->asi_flags & SLAPI_ATTR_FLAG_SINGLE) && !(at_2->asi_flags & SLAPI_ATTR_FLAG_SINGLE)) { /* at_2 is a superset */ if (debug_logging) { - slapi_log_error(SLAPI_LOG_REPL, "schema", "%s schema attribute [%s] is not " + slapi_log_err(SLAPI_LOG_REPL, "schema_at_compare", "%s schema attribute [%s] is not " "\"single-valued\" \n", message, at_1->asi_name); } return -1; @@ -6760,7 +6770,7 @@ schema_at_compare(struct asyntaxinfo *at_1, struct asyntaxinfo *at_2, char *mess if (schema_at_superset_check_syntax_oids(at_1->asi_syntax_oid, at_2->asi_syntax_oid)) { /* at_1 is a superset */ if (debug_logging) { - slapi_log_error(SLAPI_LOG_REPL, "schema", "%s schema attribute [%s] syntax " + slapi_log_err(SLAPI_LOG_REPL, "schema_at_compare", "%s schema attribute [%s] syntax " "can not be overwritten\n", message, at_1->asi_name); } return 1; @@ -6768,7 +6778,7 @@ schema_at_compare(struct asyntaxinfo *at_1, struct asyntaxinfo *at_2, char *mess if (schema_at_superset_check_syntax_oids(at_2->asi_syntax_oid, at_1->asi_syntax_oid)) { /* at_2 is a superset */ if (debug_logging) { - slapi_log_error(SLAPI_LOG_REPL, "schema", "%s schema attribute [%s] syntax " + slapi_log_err(SLAPI_LOG_REPL, "schema_at_compare", "%s schema attribute [%s] syntax " "can not be overwritten\n", message, at_2->asi_name); } return -1; @@ -6781,14 +6791,14 @@ schema_at_compare(struct asyntaxinfo *at_1, struct asyntaxinfo *at_2, char *mess */ if (schema_at_superset_check_mr(at_1, at_2, info)) { if (debug_logging) { - slapi_log_error(SLAPI_LOG_REPL, "schema", "%s schema attribute [%s] matching " + slapi_log_err(SLAPI_LOG_REPL, "schema_at_compare", "%s schema attribute [%s] matching " "rule can not be overwritten\n", message, at_1->asi_name); } return 1; } if (schema_at_superset_check_mr(at_2, at_1, info)) { if (debug_logging) { - slapi_log_error(SLAPI_LOG_REPL, "schema", "%s schema attribute [%s] matching " + slapi_log_err(SLAPI_LOG_REPL, "schema_at_compare", "%s schema attribute [%s] matching " "rule can not be overwritten\n", message, at_2->asi_name); } return -1; @@ -6821,13 +6831,13 @@ schema_at_superset_check(struct asyntaxinfo *at_list1, struct asyntaxinfo *at_li repl_schema_policy = schema_check_policy(replica_role, REPL_SCHEMA_ATTRIBUTE, at_1->asi_name, at_1->asi_oid); if (repl_schema_policy == REPL_SCHEMA_UPDATE_ACCEPT_VALUE) { /* We are skipping the superset checking for that attribute */ - slapi_log_error(SLAPI_LOG_REPL, "schema", "Do not check if this ATTRIBUTE is missing on local/remote schema [%s or %s]\n", at_1->asi_name, at_1->asi_oid); + slapi_log_err(SLAPI_LOG_REPL, "schema_at_superset_check", "Do not check if this ATTRIBUTE is missing on local/remote schema [%s or %s]\n", at_1->asi_name, at_1->asi_oid); continue; } else if (repl_schema_policy == REPL_SCHEMA_UPDATE_REJECT_VALUE) { /* This attribute being present, we need to fail as if it was a superset * but keep evaluating to have all the attribute checking */ - slapi_log_error(SLAPI_LOG_REPL, "schema", "%s attribute prevents replication of the schema\n", at_1->asi_name); + slapi_log_err(SLAPI_LOG_REPL, "schema_at_superset_check", "%s attribute prevents replication of the schema\n", at_1->asi_name); rc = 1; if (debug_logging) { /* we continue to check all the objectclasses so we log what is wrong */ @@ -6843,10 +6853,10 @@ schema_at_superset_check(struct asyntaxinfo *at_list1, struct asyntaxinfo *at_li rc = 1; if (debug_logging) { if (replica_role == REPL_SCHEMA_AS_CONSUMER) { - slapi_log_error(SLAPI_LOG_REPL, "schema", "Local %s schema attributetypes is a superset of" + slapi_log_err(SLAPI_LOG_REPL, "schema_at_superset_check", "Local %s schema attributetypes is a superset of" " the received one.\n", at_1->asi_name); } else { - slapi_log_error(SLAPI_LOG_REPL, "schema", "Remote %s schema attributetypes is a superset of" + slapi_log_err(SLAPI_LOG_REPL, "schema_at_superset_check", "Remote %s schema attributetypes is a superset of" " the received one.\n", at_1->asi_name); } continue; @@ -6858,7 +6868,7 @@ schema_at_superset_check(struct asyntaxinfo *at_list1, struct asyntaxinfo *at_li rc = 1; if(debug_logging){ /* we continue to check all attributes so we log what is wrong */ - slapi_log_error(SLAPI_LOG_REPL, "schema", "Fail to retrieve in the %s schema [%s or %s]\n", + slapi_log_err(SLAPI_LOG_REPL, "schema_at_superset_check", "Fail to retrieve in the %s schema [%s or %s]\n", message, at_1->asi_name, at_1->asi_oid); continue; } else { @@ -7211,7 +7221,7 @@ schema_berval_to_oclist(struct berval **oc_berval) if (LDAP_SUCCESS != (rc = parse_oc_str(oc_berval[i]->bv_val, &oc, errorbuf, sizeof(errorbuf), DSE_SCHEMA_NO_CHECK | DSE_SCHEMA_USE_PRIV_SCHEMA, 0, schema_ds4x_compat, oc_list))) { - slapi_log_error(SLAPI_LOG_ERR, "schema_berval_to_oclist", + slapi_log_err(SLAPI_LOG_ERR, "schema_berval_to_oclist", "parse_oc_str returned error: %s\n", errorbuf[0]?errorbuf:"unknown"); oc_free(&oc); @@ -7253,7 +7263,7 @@ schema_berval_to_atlist(struct berval **at_berval) rc = parse_at_str(at_berval[i]->bv_val, &at, errorbuf, sizeof(errorbuf), DSE_SCHEMA_NO_CHECK | DSE_SCHEMA_USE_PRIV_SCHEMA, 0, schema_ds4x_compat, 0); if (rc) { - slapi_log_error(SLAPI_LOG_ERR, "schema_berval_to_atlist", + slapi_log_err(SLAPI_LOG_ERR, "schema_berval_to_atlist", "parse_at_str(%s) failed - %s\n", at_berval[i]->bv_val, errorbuf[0]?errorbuf:"unknown"); attr_syntax_free(at); @@ -7400,7 +7410,7 @@ modify_schema_internal_mod(Slapi_DN *sdn, Slapi_Mods *smods) } else { type = "unknown"; } - slapi_log_error(SLAPI_LOG_REPL, "modify_schema_internal_mod", "Successfully learn %s definitions\n", type); + slapi_log_err(SLAPI_LOG_REPL, "modify_schema_internal_mod", "Successfully learn %s definitions\n", type); /* Update the schema csn if the operation succeeded */ schema_csn = csn_new(); if (NULL != schema_csn) { @@ -7409,7 +7419,7 @@ modify_schema_internal_mod(Slapi_DN *sdn, Slapi_Mods *smods) g_set_global_schema_csn(schema_csn); } } else { - slapi_log_error(SLAPI_LOG_ERR, "modify_schema_internal_mod", "Fail to learn schema definitions (%d) \n", op_result); + slapi_log_err(SLAPI_LOG_ERR, "modify_schema_internal_mod", "Fail to learn schema definitions (%d) \n", op_result); } slapi_pblock_destroy(newpb); @@ -7444,7 +7454,7 @@ modify_schema_prepare_mods(Slapi_Mods *smods, char *type, struct schema_mods_ind bv->bv_val = (void*) object->old_value; bvps_del[i] = bv; i++; - slapi_log_error(SLAPI_LOG_REPL, "schema", "MOD[%d] del (%s): %s\n", i, type, object->old_value); + slapi_log_err(SLAPI_LOG_REPL, "modify_schema_prepare_mods", "MOD[%d] del (%s): %s\n", i, type, object->old_value); } } bvps_del[nb_values_del] = NULL; @@ -7462,7 +7472,7 @@ modify_schema_prepare_mods(Slapi_Mods *smods, char *type, struct schema_mods_ind bv->bv_len = strlen(object->new_value); bv->bv_val = (void*) object->new_value; bvps_add[i] = bv; - slapi_log_error(SLAPI_LOG_REPL, "schema", "MOD[%d] add (%s): %s\n", i, type, object->new_value); + slapi_log_err(SLAPI_LOG_REPL, "modify_schema_prepare_mods", "MOD[%d] add (%s): %s\n", i, type, object->new_value); } bvps_add[nb_values_add] = NULL; } @@ -7513,7 +7523,7 @@ modify_schema_apply_new_definitions(char *attr_name, struct schema_mods_indexes /* Then the sdn */ sdn = slapi_sdn_new(); if (!sdn) { - slapi_log_error(SLAPI_LOG_ERR, "modify_schema_apply_new_definitions", "Out of memory\n"); + slapi_log_err(SLAPI_LOG_ERR, "modify_schema_apply_new_definitions", "Out of memory\n"); goto done; } slapi_sdn_set_dn_byval(sdn, SLAPD_SCHEMA_DN); @@ -7598,7 +7608,7 @@ modify_schema_get_new_definitions(Slapi_PBlock *pb, LDAPMod **mods, struct schem /* If we can not build an attributes list from the mods, just skip * it and look for objectclasses */ - slapi_log_error(SLAPI_LOG_ERR, "modify_schema_get_new_definitions", + slapi_log_err(SLAPI_LOG_ERR, "modify_schema_get_new_definitions", "Not able to build an attributes list (%s) from the schema received from the supplier\n", mods[i]->mod_type); continue; @@ -7615,7 +7625,7 @@ modify_schema_get_new_definitions(Slapi_PBlock *pb, LDAPMod **mods, struct schem at2learn->new_value = (char *) slapi_ch_malloc(bv->bv_len + 1); memcpy(at2learn->new_value, bv->bv_val, bv->bv_len); at2learn->new_value[bv->bv_len] = '\0'; - slapi_log_error(SLAPI_LOG_REPL, "modify_schema_get_new_definitions", "take attributetypes: %s\n", at2learn->new_value); + slapi_log_err(SLAPI_LOG_REPL, "modify_schema_get_new_definitions", "take attributetypes: %s\n", at2learn->new_value); } /* Free the remote schema list */ @@ -7629,7 +7639,7 @@ modify_schema_get_new_definitions(Slapi_PBlock *pb, LDAPMod **mods, struct schem /* If we can not build an objectclasses list from the mods, just skip * it and look for attributes */ - slapi_log_error(SLAPI_LOG_ERR, "modify_schema_get_new_definitions", + slapi_log_err(SLAPI_LOG_ERR, "modify_schema_get_new_definitions", "Not able to build an objectclasses list (%s) from the schema received from the supplier\n", mods[i]->mod_type); continue; @@ -7646,7 +7656,7 @@ modify_schema_get_new_definitions(Slapi_PBlock *pb, LDAPMod **mods, struct schem oc2learn->new_value = (char *) slapi_ch_malloc(bv->bv_len + 1); memcpy(oc2learn->new_value, bv->bv_val, bv->bv_len); oc2learn->new_value[bv->bv_len] = '\0'; - slapi_log_error(SLAPI_LOG_REPL, "modify_schema_get_new_definitions", "take objectclass: %s\n", oc2learn->new_value); + slapi_log_err(SLAPI_LOG_REPL, "modify_schema_get_new_definitions", "take objectclass: %s\n", oc2learn->new_value); } /* Free the remote schema list*/ @@ -7780,14 +7790,14 @@ supplier_get_new_definitions(struct berval **objectclasses, struct berval **attr oc2learn->new_value = (char *) slapi_ch_malloc(bv->bv_len + 1); memcpy(oc2learn->new_value, bv->bv_val, bv->bv_len); oc2learn->new_value[bv->bv_len] = '\0'; - slapi_log_error(SLAPI_LOG_REPL, "supplier_get_new_definitions", "supplier takes objectclass: %s\n", oc2learn->new_value); + slapi_log_err(SLAPI_LOG_REPL, "supplier_get_new_definitions", "supplier takes objectclass: %s\n", oc2learn->new_value); } /* Free the remote schema list*/ schema_oclist_free(remote_oc_list); } else { /* If we can not build an objectclasses list */ - slapi_log_error(SLAPI_LOG_ERR, "supplier_get_new_definitions", + slapi_log_err(SLAPI_LOG_ERR, "supplier_get_new_definitions", "Not able to build an objectclasses list from the consumer schema\n"); } @@ -7809,7 +7819,7 @@ supplier_get_new_definitions(struct berval **objectclasses, struct berval **attr at2learn->new_value = (char *) slapi_ch_malloc(bv->bv_len + 1); memcpy(at2learn->new_value, bv->bv_val, bv->bv_len); at2learn->new_value[bv->bv_len] = '\0'; - slapi_log_error(SLAPI_LOG_REPL, "schema", "supplier takes attributetypes: %s\n", at2learn->new_value); + slapi_log_err(SLAPI_LOG_REPL, "schema", "supplier takes attributetypes: %s\n", at2learn->new_value); } /* Free the remote schema list */ @@ -7818,7 +7828,7 @@ supplier_get_new_definitions(struct berval **objectclasses, struct berval **attr /* If we can not build an attributes list from the mods, just skip * it and look for objectclasses */ - slapi_log_error(SLAPI_LOG_ERR, "schema", + slapi_log_err(SLAPI_LOG_ERR, "supplier_get_new_definitions", "Not able to build an attributes list from the consumer schema"); } schema_dse_unlock(); diff --git a/ldap/servers/slapd/schemaparse.c b/ldap/servers/slapd/schemaparse.c index 673bb3e..a210767 100644 --- a/ldap/servers/slapd/schemaparse.c +++ b/ldap/servers/slapd/schemaparse.c @@ -39,7 +39,7 @@ static PRStatus oc_init_lock( void ) { if ( NULL == ( oc_lock = slapi_new_rwlock())) { - slapi_log_error(SLAPI_LOG_ERR, "oc_init_lock", + slapi_log_err(SLAPI_LOG_ERR, "oc_init_lock", "slapi_new_rwlock() for objectclass lock failed\n" ); return PR_FAILURE; } @@ -206,7 +206,7 @@ normalize_oc( void ) oc_lock_write(); for ( oc = g_get_global_oc_nolock(); oc != NULL; oc = oc->oc_next ) { - LDAPDebug(LDAP_DEBUG_PARSE, + slapi_log_err(SLAPI_LOG_PARSE, "normalize_oc: normalizing '%s'\n", oc->oc_name, 0, 0); /* required attributes */ normalize_list( oc->oc_required ); @@ -226,7 +226,7 @@ normalize_oc_nolock( void ) struct objclass *oc; for ( oc = g_get_global_oc_nolock(); oc != NULL; oc = oc->oc_next ) { - LDAPDebug(LDAP_DEBUG_PARSE, + slapi_log_err(SLAPI_LOG_PARSE, "normalize_oc: normalizing '%s'\n", oc->oc_name, 0, 0); /* required attributes */ normalize_list( oc->oc_required ); diff --git a/ldap/servers/slapd/search.c b/ldap/servers/slapd/search.c index 8896eb5..670347e 100644 --- a/ldap/servers/slapd/search.c +++ b/ldap/servers/slapd/search.c @@ -55,7 +55,7 @@ do_search( Slapi_PBlock *pb ) int minssf_exclude_rootdse = 0; int filter_normalized = 0; - LDAPDebug(LDAP_DEBUG_TRACE, "do_search\n", 0, 0, 0 ); + slapi_log_err(SLAPI_LOG_TRACE, "do_search", "=>\n"); slapi_pblock_get( pb, SLAPI_OPERATION, &operation); ber = operation->o_ber; @@ -240,7 +240,7 @@ do_search( Slapi_PBlock *pb ) char *dummyary[2]; /* need a char ** for charray_merge_nodup */ if ((*(p + 1) == '\0') || (p == attrs[i]) || (strchr(p+1, '@'))) /* e.g. "foo@" or "@objectclassname" or "foo@bar@baz" */ { - slapi_log_error(SLAPI_LOG_ARGS, "do_search", + slapi_log_err(SLAPI_LOG_ARGS, "do_search", "invalid attribute [%s] in list - must be of the form " "attributename@objectclassname where attributename is the " "name of an attribute or \"*\" or \"+\" and objectclassname " @@ -295,7 +295,7 @@ do_search( Slapi_PBlock *pb ) strarray2str( attrs, abuf, sizeof( abuf ), 1 /* include quotes */); astr = abuf; } - slapi_log_error(SLAPI_LOG_ARGS, NULL, "SRCH base=\"%s\" " + slapi_log_err(SLAPI_LOG_ARGS, "do_search", "SRCH base=\"%s\" " "scope=%d deref=%d " "sizelimit=%d timelimit=%d attrsonly=%d filter=\"%s\" " "attrs=%s\n", base, scope, deref, sizelimit, timelimit, diff --git a/ldap/servers/slapd/slap.h b/ldap/servers/slapd/slap.h index a03c6d4..a8a3176 100644 --- a/ldap/servers/slapd/slap.h +++ b/ldap/servers/slapd/slap.h @@ -113,7 +113,6 @@ typedef struct symbol_t { #include "ldap.h" #include "ldaprot.h" #include "ldif.h" -#include "ldaplog.h" #include "portable.h" #include "disconnect_errors.h" diff --git a/ldap/servers/slapd/slapi-plugin.h b/ldap/servers/slapd/slapi-plugin.h index d7d130d..11afeca 100644 --- a/ldap/servers/slapd/slapi-plugin.h +++ b/ldap/servers/slapd/slapi-plugin.h @@ -59,10 +59,10 @@ NSPR_API(PRUint32) PR_fprintf(struct PRFileDesc* fd, const char *fmt, ...) #endif /* Define our logging macros */ -#define slapi_log_error(level, subsystem, fmt, ...) +#define slapi_log_err(level, subsystem, fmt, ...) #ifdef LDAP_DEBUG -# undef slapi_log_error -# define slapi_log_error(level, subsystem, ...) slapi_log_err(level, subsystem, __VA_ARGS__) +# 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 @@ -6081,7 +6081,7 @@ int slapi_register_plugin_ext( const char *plugintype, int enabled, /* * logging */ -int slapi_log_err( int loglevel, char *subsystem, char *fmt, ... ) +int slapi_log_error( int loglevel, char *subsystem, char *fmt, ... ) #ifdef __GNUC__ __attribute__ ((format (printf, 3, 4))); #else diff --git a/ldap/servers/slapd/snmp_collator.c b/ldap/servers/slapd/snmp_collator.c index 4bc758b..f8ac664 100644 --- a/ldap/servers/slapd/snmp_collator.c +++ b/ldap/servers/slapd/snmp_collator.c @@ -369,7 +369,7 @@ int snmp_collator_start() { if (err != EEXIST) /* Ignore if file already exists */ { - slapi_log_error(SLAPI_LOG_EMERG, "snmp collator", "Failed to open stats file (%s) " + slapi_log_err(SLAPI_LOG_EMERG, "snmp collator", "Failed to open stats file (%s) " "(error %d): %s.\n", szStatsFile, err, slapd_system_strerror(err)); exit(1); } @@ -457,20 +457,20 @@ snmp_collator_create_semaphore(void) /* It appears that we didn't exit cleanly last time and left the semaphore * around. Recreate it since we don't know what state it is in. */ if (sem_unlink(stats_sem_name) != 0) { - LDAPDebug(LDAP_DEBUG_EMERG, "snmp_collator_create_semaphore - Failed to delete old semaphore for stats file (%s). " + slapi_log_err(SLAPI_LOG_EMERG, "snmp_collator_create_semaphore - Failed to delete old semaphore for stats file (%s). " "Error %d (%s).\n", szStatsFile, errno, slapd_system_strerror(errno) ); exit(1); } if ((stats_sem = sem_open(stats_sem_name, O_CREAT | O_EXCL, SLAPD_DEFAULT_FILE_MODE, 1)) == SEM_FAILED) { /* No dice */ - LDAPDebug(LDAP_DEBUG_EMERG, "snmp_collator_create_semaphore - Failed to create semaphore for stats file (%s). Error %d (%s).\n", + slapi_log_err(SLAPI_LOG_EMERG, "snmp_collator_create_semaphore - Failed to create semaphore for stats file (%s). Error %d (%s).\n", szStatsFile, errno, slapd_system_strerror(errno) ); exit(1); } } else { /* Some other problem occurred creating the semaphore. */ - LDAPDebug(LDAP_DEBUG_EMERG, "snmp_collator_create_semaphore - Failed to create semaphore for stats file (%s). Error %d.(%s)\n", + slapi_log_err(SLAPI_LOG_EMERG, "snmp_collator_create_semaphore - Failed to create semaphore for stats file (%s). Error %d.(%s)\n", szStatsFile, errno, slapd_system_strerror(errno) ); exit(1); } @@ -494,7 +494,7 @@ snmp_collator_sem_wait(void) int got_sem = 0; if (SEM_FAILED == stats_sem) { - LDAPDebug1Arg(LDAP_DEBUG_ERR, + slapi_log_err(SLAPI_LOG_ERR, "snmp_collator_sem_wait - semaphore for stats file (%s) is not available.\n", szStatsFile); return; } diff --git a/ldap/servers/slapd/ssl.c b/ldap/servers/slapd/ssl.c index 7649589..0b18922 100644 --- a/ldap/servers/slapd/ssl.c +++ b/ldap/servers/slapd/ssl.c @@ -271,17 +271,17 @@ slapd_SSL_report(int degree, char *fmt, va_list args) int sev; if (degree == LOG_FAILURE){ - sev = LDAP_DEBUG_ERR; + sev = SLAPI_LOG_ERR; msg = "failure"; } else if (degree == LOG_WARN){ - sev = LDAP_DEBUG_WARNING; + sev = SLAPI_LOG_WARNING; msg = "alert"; } else { - sev = LDAP_DEBUG_INFO; + sev = SLAPI_LOG_INFO; msg = "info"; } PR_vsnprintf( buf, sizeof(buf), fmt, args ); - LDAPDebug(sev, "SSL %s: %s\n", msg,buf, 0 ); + slapi_log_err(sev, "Security Initialization", "SSL %s: %s\n", msg, buf); } void @@ -417,7 +417,7 @@ cipher_check_fips(int idx, char ***suplist, char ***unsuplist) &info, sizeof info)) { PRErrorCode errorCode = PR_GetError(); if (slapi_is_loglevel_set(SLAPI_LOG_CONFIG)) { - slapd_SSL_warn("Security Initialization: no information for cipher suite [%s] " + slapd_SSL_warn("No information for cipher suite [%s] " "error %d - %s", _conf_ciphers[idx].name, errorCode, slapd_pr_strerror(errorCode)); } @@ -425,7 +425,7 @@ cipher_check_fips(int idx, char ***suplist, char ***unsuplist) } if (rc && !info.isFIPS) { if (slapi_is_loglevel_set(SLAPI_LOG_CONFIG)) { - slapd_SSL_warn("Security Initialization: FIPS mode is enabled but " + slapd_SSL_warn("FIPS mode is enabled but " "cipher suite [%s] is not approved for FIPS - " "the cipher suite will be disabled - if " "you want to use this cipher suite, you must use modutil to " @@ -570,7 +570,7 @@ _conf_init_ciphers(void) for (x = 0; implementedCiphers && (x < SSL_NumImplementedCiphers); x++) { rc = SSL_GetCipherSuiteInfo(implementedCiphers[x], &info, sizeof info); if (SECFailure == rc) { - slapi_log_error(SLAPI_LOG_ERR, "Security Initialization", + slapi_log_err(SLAPI_LOG_ERR, "Security Initialization", "_conf_init_ciphers - Failed to get the cipher suite info of cipher ID %d\n", implementedCiphers[x]); continue; @@ -621,7 +621,7 @@ _conf_setallciphers(int flag, char ***suplist, char ***unsuplist) */ rc = SSL_CipherPrefGetDefault(_conf_ciphers[x].num, &setme); if (SECFailure == rc) { - slapi_log_error(SLAPI_LOG_ERR, "Security Initialization", + slapi_log_err(SLAPI_LOG_ERR, "Security Initialization", "_conf_setallciphers - Failed to get the default state of cipher %s\n", _conf_ciphers[x].name); continue; @@ -698,7 +698,7 @@ _conf_setciphers(char *ciphers, int flags) /* Default is to activate all of them ==> none of them*/ if (!ciphers || (ciphers[0] == '\0') || !PL_strcasecmp(ciphers, "default")) { _conf_setallciphers((CIPHER_SET_DEFAULT|flags), NULL, NULL); - slapd_SSL_info("Security Initialization: Enabling default cipher set."); + slapd_SSL_info("Enabling default cipher set."); _conf_dumpciphers(); return NULL; } @@ -822,7 +822,7 @@ _conf_setciphers(char *ciphers, int flags) if (unsuplist && *unsuplist) { char *strsup = charray2str(suplist, ","); char *strunsup = charray2str(unsuplist, ","); - slapd_SSL_warn("Security Initialization: FIPS mode is enabled - only the following " + slapd_SSL_warn("FIPS mode is enabled - only the following " "cipher suites are approved for FIPS: [%s] - " "the specified cipher suites [%s] are disabled - if " "you want to use these unsupported cipher suites, you must use modutil to " @@ -975,7 +975,7 @@ warn_if_no_cert_file(const char *dir, int no_log) if (PR_SUCCESS != status) { ret = 1; if (!no_log) { - slapi_log_error(SLAPI_LOG_CRIT, "Security Initialization", + slapi_log_err(SLAPI_LOG_CRIT, "Security Initialization", "warn_if_no_cert_file - Certificate DB file cert8.db nor cert7.db exists in [%s] - " "SSL initialization will likely fail\n", dir); } @@ -997,7 +997,7 @@ warn_if_no_key_file(const char *dir, int no_log) if (PR_SUCCESS != status) { ret = 1; if (!no_log) { - slapi_log_error(SLAPI_LOG_CRIT, "Security Initialization", + slapi_log_err(SLAPI_LOG_CRIT, "Security Initialization", "warn_if_no_key_file - Key DB file %s does not exist - SSL initialization will " "likely fail\n", filename); } @@ -1206,7 +1206,7 @@ slapd_nss_init(int init_ssl, int config_available) (void) slapi_getSSLVersion_str(enabledNSSVersions.min, emin, sizeof(emin)); (void) slapi_getSSLVersion_str(enabledNSSVersions.max, emax, sizeof(emax)); - slapi_log_error(SLAPI_LOG_CONFIG, "Security Initialization", + slapi_log_err(SLAPI_LOG_CONFIG, "Security Initialization", "slapd_nss_init - Supported range by NSS: min: %s, max: %s\n", emin, emax); #endif @@ -1232,7 +1232,7 @@ slapd_nss_init(int init_ssl, int config_available) char *serveruser = "unknown"; serveruser = config_get_localuser(); - slapi_log_error(SLAPI_LOG_CRIT, "Security Initialization", + slapi_log_err(SLAPI_LOG_CRIT, "Security Initialization", "slapd_nss_init - The key/cert database directory [%s] is not writable by " "the server uid [%s]: initialization likely to fail.\n", certdir, serveruser); @@ -1256,7 +1256,7 @@ slapd_nss_init(int init_ssl, int config_available) if (secStatus != SECSuccess) { errorCode = PR_GetError(); - slapd_SSL_error("Security Initialization: NSS initialization failed (" + slapd_SSL_error("NSS initialization failed (" SLAPI_COMPONENT_NAME_NSPR " error %d - %s): " "certdir: %s", errorCode, slapd_pr_strerror(errorCode), certdir); @@ -1265,7 +1265,7 @@ slapd_nss_init(int init_ssl, int config_available) if(SSLPLCY_Install() != PR_SUCCESS) { errorCode = PR_GetError(); - slapd_SSL_error("Security Initialization: Unable to set SSL export policy (" + slapd_SSL_error("Unable to set SSL export policy (" SLAPI_COMPONENT_NAME_NSPR " error %d - %s)", errorCode, slapd_pr_strerror(errorCode)); return -1; @@ -1281,15 +1281,15 @@ slapd_nss_init(int init_ssl, int config_available) keydb_file_name = slapi_ch_smprintf("%s/key3.db", certdir); secmoddb_file_name = slapi_ch_smprintf("%s/secmod.db", certdir); if(chmod(certdb_file_name, S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP )){ - LDAPDebug(LDAP_DEBUG_ERR, "Security Initialization - slapd_nss_init: chmod failed for file %s error (%d) %s.\n", + slapi_log_err(SLAPI_LOG_ERR, "Security Initialization - slapd_nss_init: chmod failed for file %s error (%d) %s.\n", certdb_file_name, errno, slapd_system_strerror(errno)); } if(chmod(keydb_file_name, S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP )){ - LDAPDebug(LDAP_DEBUG_ERR, "Security Initialization - slapd_nss_init: chmod failed for file %s error (%d) %s.\n", + slapi_log_err(SLAPI_LOG_ERR, "Security Initialization - slapd_nss_init: chmod failed for file %s error (%d) %s.\n", keydb_file_name, errno, slapd_system_strerror(errno)); } if(chmod(secmoddb_file_name, S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP )){ - LDAPDebug(LDAP_DEBUG_ERR, "Security Initialization - slapd_nss_init: chmod failed for file %s error (%d) %s.\n", + slapi_log_err(SLAPI_LOG_ERR, "Security Initialization - slapd_nss_init: chmod failed for file %s error (%d) %s.\n", secmoddb_file_name, errno, slapd_system_strerror(errno)); } } @@ -1325,7 +1325,7 @@ svrcore_setup(void) if ( SVRCORE_CreateStdPinObj(&StdPinObj, dongle_file_name, PR_TRUE) != SVRCORE_Success) { #endif errorCode = PR_GetError(); - slapd_SSL_warn("Security Initialization: Unable to create PinObj (" + slapd_SSL_warn("Unable to create PinObj (" SLAPI_COMPONENT_NAME_NSPR " error %d - %s)", errorCode, slapd_pr_strerror(errorCode)); return -1; @@ -1379,7 +1379,7 @@ slapd_ssl_init() if(!val) { errorCode = PR_GetError(); - slapd_SSL_error("Security Initialization: Failed to retrieve SSL " + slapd_SSL_error("Failed to retrieve SSL " "configuration information (" SLAPI_COMPONENT_NAME_NSPR " error %d - %s): " "nssslSessionTimeout: %s ", @@ -1441,7 +1441,7 @@ slapd_ssl_init() } } else { errorCode = PR_GetError(); - slapd_SSL_error("Security Initialization: Unable to get token (" + slapd_SSL_error("Unable to get token (" SLAPI_COMPONENT_NAME_NSPR " error %d - %s)", errorCode, slapd_pr_strerror(errorCode)); freeChildren(family_list); @@ -1451,7 +1451,7 @@ slapd_ssl_init() if (!slot) { errorCode = PR_GetError(); - slapd_SSL_error("Security Initialization: Unable to find slot (" + slapd_SSL_error("Unable to find slot (" SLAPI_COMPONENT_NAME_NSPR " error %d - %s)", errorCode, slapd_pr_strerror(errorCode)); freeChildren(family_list); @@ -1466,7 +1466,7 @@ slapd_ssl_init() #endif if (slapd_pk11_authenticate(slot, PR_TRUE, NULL) != SECSuccess) { errorCode = PR_GetError(); - slapi_log_error(SLAPI_LOG_ERR, "Security Initialization", + slapi_log_err(SLAPI_LOG_ERR, "Security Initialization", "slapd_ssl_init - Unable to authenticate (" SLAPI_COMPONENT_NAME_NSPR " error %d - %s)\n", errorCode, slapd_pr_strerror(errorCode)); freeChildren(family_list); @@ -1522,7 +1522,7 @@ set_NSS_version(char *val, PRUint16 *rval, int ismin) if (2 == vnum) { if (ismin) { if (enabledNSSVersions.min > SSL_LIBRARY_VERSION_2) { - slapd_SSL_warn("Security Initialization: The value of sslVersionMin " + slapd_SSL_warn("The value of sslVersionMin " "\"%s\" is lower than the supported version; " "the default value \"%s\" is used.", val, emin); @@ -1533,7 +1533,7 @@ set_NSS_version(char *val, PRUint16 *rval, int ismin) } else { if (enabledNSSVersions.max < SSL_LIBRARY_VERSION_2) { /* never happens */ - slapd_SSL_warn("Security Initialization: The value of sslVersionMax " + slapd_SSL_warn("The value of sslVersionMax " "\"%s\" is higher than the supported version; " "the default value \"%s\" is used.", val, emax); @@ -1545,7 +1545,7 @@ set_NSS_version(char *val, PRUint16 *rval, int ismin) } else if (3 == vnum) { if (ismin) { if (enabledNSSVersions.min > SSL_LIBRARY_VERSION_3_0) { - slapd_SSL_warn("Security Initialization: The value of sslVersionMin " + slapd_SSL_warn("The value of sslVersionMin " "\"%s\" is lower than the supported version; " "the default value \"%s\" is used.", val, emin); @@ -1556,7 +1556,7 @@ set_NSS_version(char *val, PRUint16 *rval, int ismin) } else { if (enabledNSSVersions.max < SSL_LIBRARY_VERSION_3_0) { /* never happens */ - slapd_SSL_warn("Security Initialization: The value of sslVersionMax " + slapd_SSL_warn("The value of sslVersionMax " "\"%s\" is higher than the supported version; " "the default value \"%s\" is used.", val, emax); @@ -1567,12 +1567,12 @@ set_NSS_version(char *val, PRUint16 *rval, int ismin) } } else { if (ismin) { - slapd_SSL_warn("Security Initialization: The value of sslVersionMin " + slapd_SSL_warn("The value of sslVersionMin " "\"%s\" is invalid; the default value \"%s\" is used.", val, emin); (*rval) = enabledNSSVersions.min; } else { - slapd_SSL_warn("Security Initialization: The value of sslVersionMax " + slapd_SSL_warn("The value of sslVersionMax " "\"%s\" is invalid; the default value \"%s\" is used.", val, emax); (*rval) = enabledNSSVersions.max; @@ -1585,7 +1585,7 @@ set_NSS_version(char *val, PRUint16 *rval, int ismin) if (tlsv < 1.1) { /* TLS1.0 */ if (ismin) { if (enabledNSSVersions.min > CURRENT_DEFAULT_SSL_VERSION) { - slapd_SSL_warn("Security Initialization: The value of sslVersionMin " + slapd_SSL_warn("The value of sslVersionMin " "\"%s\" is lower than the supported version; " "the default value \"%s\" is used.", val, emin); @@ -1596,7 +1596,7 @@ set_NSS_version(char *val, PRUint16 *rval, int ismin) } else { if (enabledNSSVersions.max < CURRENT_DEFAULT_SSL_VERSION) { /* never happens */ - slapd_SSL_warn("Security Initialization: The value of sslVersionMax " + slapd_SSL_warn("The value of sslVersionMax " "\"%s\" is higher than the supported version; " "the default value \"%s\" is used.", val, emax); @@ -1608,7 +1608,7 @@ set_NSS_version(char *val, PRUint16 *rval, int ismin) } else if (tlsv < 1.2) { /* TLS1.1 */ if (ismin) { if (enabledNSSVersions.min > SSL_LIBRARY_VERSION_TLS_1_1) { - slapd_SSL_warn("Security Initialization: The value of sslVersionMin " + slapd_SSL_warn("The value of sslVersionMin " "\"%s\" is lower than the supported version; " "the default value \"%s\" is used.", val, emin); @@ -1619,7 +1619,7 @@ set_NSS_version(char *val, PRUint16 *rval, int ismin) } else { if (enabledNSSVersions.max < SSL_LIBRARY_VERSION_TLS_1_1) { /* never happens */ - slapd_SSL_warn("Security Initialization: The value of sslVersionMax " + slapd_SSL_warn("The value of sslVersionMax " "\"%s\" is higher than the supported version; " "the default value \"%s\" is used.", val, emax); @@ -1632,7 +1632,7 @@ set_NSS_version(char *val, PRUint16 *rval, int ismin) #if defined(NSS_TLS12) if (ismin) { if (enabledNSSVersions.min > SSL_LIBRARY_VERSION_TLS_1_2) { - slapd_SSL_warn("Security Initialization: The value of sslVersionMin " + slapd_SSL_warn("The value of sslVersionMin " "\"%s\" is lower than the supported version; " "the default value \"%s\" is used.", val, emin); @@ -1643,7 +1643,7 @@ set_NSS_version(char *val, PRUint16 *rval, int ismin) } else { if (enabledNSSVersions.max < SSL_LIBRARY_VERSION_TLS_1_2) { /* never happens */ - slapd_SSL_warn("Security Initialization: The value of sslVersionMax " + slapd_SSL_warn("The value of sslVersionMax " "\"%s\" is higher than the supported version; " "the default value \"%s\" is used.", val, emax); @@ -1655,13 +1655,13 @@ set_NSS_version(char *val, PRUint16 *rval, int ismin) #endif } else { /* Specified TLS is newer than supported */ if (ismin) { - slapd_SSL_warn("Security Initialization: The value of sslVersionMin " + slapd_SSL_warn("The value of sslVersionMin " "\"%s\" is out of the range of the supported version; " "the default value \"%s\" is used.", val, emin); (*rval) = enabledNSSVersions.min; } else { - slapd_SSL_warn("Security Initialization: The value of sslVersionMax " + slapd_SSL_warn("The value of sslVersionMax " "\"%s\" is out of the range of the supported version; " "the default value \"%s\" is used.", val, emax); @@ -1670,12 +1670,12 @@ set_NSS_version(char *val, PRUint16 *rval, int ismin) } } else { if (ismin) { - slapd_SSL_warn("Security Initialization: The value of sslVersionMin " + slapd_SSL_warn("The value of sslVersionMin " "\"%s\" is invalid; the default value \"%s\" is used.", val, emin); (*rval) = enabledNSSVersions.min; } else { - slapd_SSL_warn("Security Initialization: The value of sslVersionMax " + slapd_SSL_warn("The value of sslVersionMax " "\"%s\" is invalid; the default value \"%s\" is used.", val, emax); (*rval) = enabledNSSVersions.max; @@ -1737,7 +1737,7 @@ slapd_ssl_init2(PRFileDesc **fd, int startTLS) */ getConfigEntry(configDN, &e); if (e == NULL) { - slapd_SSL_error("Security Initialization: Failed get config entry %s", configDN); + slapd_SSL_error("Failed get config entry %s", configDN); return 1; } val = slapi_entry_attr_get_charptr(e, "allowWeakCipher"); @@ -1763,7 +1763,7 @@ slapd_ssl_init2(PRFileDesc **fd, int startTLS) if ( NULL != (val = _conf_setciphers(cipher_string, allowweakcipher)) ) { errorCode = PR_GetError(); - slapd_SSL_warn("Security Initialization: Failed to set SSL cipher " + slapd_SSL_warn("Failed to set SSL cipher " "preference information: %s (" SLAPI_COMPONENT_NAME_NSPR " error %d - %s)", val, errorCode, slapd_pr_strerror(errorCode)); slapi_ch_free((void **) &val); @@ -1774,7 +1774,7 @@ slapd_ssl_init2(PRFileDesc **fd, int startTLS) pr_sock = SSL_ImportFD( NULL, sock ); if( pr_sock == (PRFileDesc *)NULL ) { errorCode = PR_GetError(); - slapd_SSL_warn("Security Initialization: Failed to import NSPR " + slapd_SSL_warn("Failed to import NSPR " "fd into SSL (" SLAPI_COMPONENT_NAME_NSPR " error %d - %s)", errorCode, slapd_pr_strerror(errorCode)); return 1; @@ -1790,7 +1790,7 @@ slapd_ssl_init2(PRFileDesc **fd, int startTLS) PK11SlotInfo *slot = slapd_pk11_getInternalSlot(); if (!slot) { errorCode = PR_GetError(); - slapd_SSL_error("Security Initialization: Unable to get internal slot (" + slapd_SSL_error("Unable to get internal slot (" SLAPI_COMPONENT_NAME_NSPR " error %d - %s)", errorCode, slapd_pr_strerror(errorCode)); return -1; @@ -1799,7 +1799,7 @@ slapd_ssl_init2(PRFileDesc **fd, int startTLS) if(slapd_pk11_isFIPS()) { if(slapd_pk11_authenticate(slot, PR_TRUE, NULL) != SECSuccess) { errorCode = PR_GetError(); - slapi_log_error(SLAPI_LOG_ERR, "Security Initialization", + slapi_log_err(SLAPI_LOG_ERR, "Security Initialization", "slapd_ssl_init2 - Unable to authenticate (" SLAPI_COMPONENT_NAME_NSPR " error %d - %s)\n", errorCode, slapd_pr_strerror(errorCode)); return -1; @@ -1858,7 +1858,7 @@ slapd_ssl_init2(PRFileDesc **fd, int startTLS) } else { errorCode = PR_GetError(); - slapd_SSL_warn("Security Initialization: Failed to get cipher " + slapd_SSL_warn("Failed to get cipher " "family information. Missing nsssltoken or" "nssslpersonalityssl in %s (" SLAPI_COMPONENT_NAME_NSPR " error %d - %s)", @@ -1876,7 +1876,7 @@ slapd_ssl_init2(PRFileDesc **fd, int startTLS) if (cert == NULL) { errorCode = PR_GetError(); - slapd_SSL_warn("Security Initialization: Can't find " + slapd_SSL_warn("Can't find " "certificate (%s) for family %s (" SLAPI_COMPONENT_NAME_NSPR " error %d - %s)", cert_name, *family, @@ -1888,7 +1888,7 @@ slapd_ssl_init2(PRFileDesc **fd, int startTLS) if (key == NULL) { errorCode = PR_GetError(); - slapd_SSL_warn("Security Initialization: Unable to retrieve " + slapd_SSL_warn("Unable to retrieve " "private key for cert %s of family %s (" SLAPI_COMPONENT_NAME_NSPR " error %d - %s)", cert_name, *family, @@ -2000,7 +2000,7 @@ slapd_ssl_init2(PRFileDesc **fd, int startTLS) tmpDir = slapd_get_tmp_dir(); - slapi_log_error(SLAPI_LOG_TRACE, "Security Initialization", + slapi_log_err(SLAPI_LOG_TRACE, "Security Initialization", "slapd_ssl_init2 - tmp dir = %s\n", tmpDir); rv = SSL_ConfigServerSessionIDCache(0, stimeout, stimeout, tmpDir); @@ -2022,7 +2022,7 @@ slapd_ssl_init2(PRFileDesc **fd, int startTLS) sslStatus = SSL_OptionSet(pr_sock, SSL_SECURITY, PR_TRUE); if (sslStatus != SECSuccess) { errorCode = PR_GetError(); - slapd_SSL_error("Security Initialization: Failed to enable security " + slapd_SSL_error("Failed to enable security " "on the imported socket (" SLAPI_COMPONENT_NAME_NSPR " error %d - %s)", errorCode, slapd_pr_strerror(errorCode)); return -1; @@ -2032,7 +2032,7 @@ slapd_ssl_init2(PRFileDesc **fd, int startTLS) sslStatus = SSL_OptionSet(pr_sock, SSL_ENABLE_SSL2, enableSSL2); if (sslStatus != SECSuccess) { errorCode = PR_GetError(); - slapd_SSL_error("Security Initialization: Failed to %s SSLv2 " + slapd_SSL_error("Failed to %s SSLv2 " "on the imported socket (" SLAPI_COMPONENT_NAME_NSPR " error %d - %s)", enableSSL2 ? "enable" : "disable", errorCode, slapd_pr_strerror(errorCode)); @@ -2049,7 +2049,7 @@ slapd_ssl_init2(PRFileDesc **fd, int startTLS) if( !val ) { errorCode = PR_GetError(); - slapd_SSL_warn("Security Initialization: Cannot get SSL Client " + slapd_SSL_warn("Cannot get SSL Client " "Authentication status. No nsslclientauth in %s (" SLAPI_COMPONENT_NAME_NSPR " error %d - %s)", configDN, errorCode, slapd_pr_strerror(errorCode)); @@ -2072,7 +2072,7 @@ slapd_ssl_init2(PRFileDesc **fd, int startTLS) if( config_set_SSLclientAuth( "nssslclientauth", val, errorbuf, CONFIG_APPLY ) != LDAP_SUCCESS ) { errorCode = PR_GetError(); - slapd_SSL_warn("Security Initialization: Cannot set SSL Client " + slapd_SSL_warn("Cannot set SSL Client " "Authentication status to \"%s\", error (%s). " "Supported values are \"off\", \"allowed\" " "and \"required\". (" SLAPI_COMPONENT_NAME_NSPR " error %d - %s)", @@ -2093,7 +2093,7 @@ slapd_ssl_init2(PRFileDesc **fd, int startTLS) enableSSL3 = slapi_entry_attr_get_bool( e, "nsSSL3" ); } if ( fipsMode && enableSSL3 ) { - slapd_SSL_warn("Security Initialization: FIPS mode is enabled and " + slapd_SSL_warn("FIPS mode is enabled and " "nsSSL3 explicitly set to on - SSLv3 is not approved " "for use in FIPS mode - SSLv3 will be disabled - if " "you want to use SSLv3, you must use modutil to " @@ -2146,7 +2146,7 @@ slapd_ssl_init2(PRFileDesc **fd, int startTLS) restrict_SSLVersionRange(); (void) slapi_getSSLVersion_str(slapdNSSVersions.min, mymin, sizeof(mymin)); (void) slapi_getSSLVersion_str(slapdNSSVersions.max, mymax, sizeof(mymax)); - slapi_log_error(SLAPI_LOG_INFO, "Security Initialization", + slapi_log_err(SLAPI_LOG_INFO, "Security Initialization", "slapd_ssl_init2 - Configured SSL version range: min: %s, max: %s\n", mymin, mymax); sslStatus = SSL_VersionRangeSet(pr_sock, &slapdNSSVersions); @@ -2163,7 +2163,7 @@ slapd_ssl_init2(PRFileDesc **fd, int startTLS) sslStatus = SSL_OptionSet(pr_sock, SSL_ENABLE_SSL3, enableSSL3); if (sslStatus != SECSuccess) { errorCode = PR_GetError(); - slapd_SSL_warn("Security Initialization: Failed to %s SSLv3 " + slapd_SSL_warn("Failed to %s SSLv3 " "on the imported socket (" SLAPI_COMPONENT_NAME_NSPR " error %d - %s)", enableSSL3 ? "enable" : "disable", errorCode, slapd_pr_strerror(errorCode)); @@ -2172,7 +2172,7 @@ slapd_ssl_init2(PRFileDesc **fd, int startTLS) sslStatus = SSL_OptionSet(pr_sock, SSL_ENABLE_TLS, enableTLS1); if (sslStatus != SECSuccess) { errorCode = PR_GetError(); - slapd_SSL_warn("Security Initialization: Failed to %s TLSv1 " + slapd_SSL_warn("Failed to %s TLSv1 " "on the imported socket (" SLAPI_COMPONENT_NAME_NSPR " error %d - %s)", enableTLS1 ? "enable" : "disable", errorCode, slapd_pr_strerror(errorCode)); @@ -2189,7 +2189,7 @@ slapd_ssl_init2(PRFileDesc **fd, int startTLS) #ifdef SSL_REQUIRE_CERTIFICATE /* new feature */ if ((err = SSL_OptionSet (pr_sock, SSL_REQUIRE_CERTIFICATE, PR_FALSE)) < 0) { PRErrorCode prerr = PR_GetError(); - LDAPDebug(LDAP_DEBUG_ERR, + slapi_log_err(SLAPI_LOG_ERR, "Security Initialization", "SSL_OptionSet(SSL_REQUIRE_CERTIFICATE,PR_FALSE) %d " SLAPI_COMPONENT_NAME_NSPR " error %d (%s)\n", err, prerr, slapd_pr_strerror(prerr)); @@ -2199,7 +2199,7 @@ slapd_ssl_init2(PRFileDesc **fd, int startTLS) case SLAPD_SSLCLIENTAUTH_REQUIRED: if ((err = SSL_OptionSet (pr_sock, SSL_REQUEST_CERTIFICATE, PR_TRUE)) < 0) { PRErrorCode prerr = PR_GetError(); - LDAPDebug(LDAP_DEBUG_ERR, + slapi_log_err(SLAPI_LOG_ERR, "Security Initialization", "SSL_OptionSet(SSL_REQUEST_CERTIFICATE,PR_TRUE) %d " SLAPI_COMPONENT_NAME_NSPR " error %d (%s)\n", err, prerr, slapd_pr_strerror(prerr)); @@ -2313,7 +2313,7 @@ slapd_SSL_client_auth (LDAP* ld) } } else { errorCode = PR_GetError(); - slapd_SSL_warn("Security Initialization: Failed to get cipher " + slapd_SSL_warn("Failed to get cipher " "family information. Missing nsssltoken or" "nssslpersonalityssl in %s (" SLAPI_COMPONENT_NAME_NSPR " error %d - %s)", @@ -2338,7 +2338,7 @@ slapd_SSL_client_auth (LDAP* ld) PR_snprintf(cert_name, sizeof(cert_name), "%s:%s", token, personality); } else { errorCode = PR_GetError(); - slapd_SSL_warn("Security Initialization: Failed to get cipher " + slapd_SSL_warn("Failed to get cipher " "family information. Missing nsssltoken or" "nssslpersonalityssl in %s (" SLAPI_COMPONENT_NAME_NSPR " error %d - %s)", @@ -2475,7 +2475,7 @@ slapd_SSL_client_auth (LDAP* ld) slapi_ch_free_string(&pw); slapi_ch_free_string(&finalpersonality); - LDAPDebug(LDAP_DEBUG_TRACE, "slapd_SSL_client_auth() %i\n", rc, 0, 0); + slapi_log_err(SLAPI_LOG_TRACE, "slapd_SSL_client_auth", "%i\n", rc); return rc; } @@ -2514,7 +2514,7 @@ char* slapd_get_tmp_dir() if((tmpdir = config_get_tmpdir()) == NULL) { - slapi_log_error( + slapi_log_err( SLAPI_LOG_NOTICE, "slapd_get_tmp_dir", "config_get_tmpdir returns NULL Setting tmp dir to default\n"); @@ -2526,13 +2526,13 @@ char* slapd_get_tmp_dir() if(mkdir(tmpdir, 00770) == -1) { if (errno == EEXIST) { - slapi_log_error( + slapi_log_err( SLAPI_LOG_TRACE, "slapd_get_tmp_dir", "mkdir(%s, 00770) - already exists\n", tmpdir); } else { - slapi_log_error( + slapi_log_err( SLAPI_LOG_DEBUG, "slapd_get_tmp_dir", "mkdir(%s, 00770) Error: %s\n", @@ -2553,7 +2553,7 @@ slapd_get_unlocked_key_for_cert(CERTCertificate *cert, void *pin_arg) if (!slotlist) { PRErrorCode errcode = PR_GetError(); - slapi_log_error(SLAPI_LOG_ERR, "slapd_get_unlocked_key_for_cert", + slapi_log_err(SLAPI_LOG_ERR, "slapd_get_unlocked_key_for_cert", "Cannot get slot list for certificate [%s] (%d: %s)\n", certsubject, errcode, slapd_pr_strerror(errcode)); return key; @@ -2564,25 +2564,25 @@ slapd_get_unlocked_key_for_cert(CERTCertificate *cert, void *pin_arg) const char *slotname = (slot && PK11_GetSlotName(slot)) ? PK11_GetSlotName(slot) : "unknown slot"; const char *tokenname = (slot && PK11_GetTokenName(slot)) ? PK11_GetTokenName(slot) : "unknown token"; if (!slot) { - slapi_log_error(SLAPI_LOG_TRACE, "slapd_get_unlocked_key_for_cert", + slapi_log_err(SLAPI_LOG_TRACE, "slapd_get_unlocked_key_for_cert", "Missing slot for slot list element for certificate [%s]\n", certsubject); } else if (!PK11_NeedLogin(slot) || PK11_IsLoggedIn(slot, pin_arg)) { key = PK11_FindKeyByDERCert(slot, cert, pin_arg); - slapi_log_error(SLAPI_LOG_TRACE, "slapd_get_unlocked_key_for_cert", + slapi_log_err(SLAPI_LOG_TRACE, "slapd_get_unlocked_key_for_cert", "Found unlocked slot [%s] token [%s] for certificate [%s]\n", slotname, tokenname, certsubject); break; } else { PRErrorCode errcode = PR_GetError(); - slapi_log_error(SLAPI_LOG_NOTICE, "slapd_get_unlocked_key_for_cert", + slapi_log_err(SLAPI_LOG_NOTICE, "slapd_get_unlocked_key_for_cert", "Skipping locked slot [%s] token [%s] for certificate [%s] (%d - %s)\n", slotname, tokenname, certsubject, errcode, slapd_pr_strerror(errcode)); } } if (!key) { - slapi_log_error(SLAPI_LOG_ERR, "slapd_get_unlocked_key_for_cert", + slapi_log_err(SLAPI_LOG_ERR, "slapd_get_unlocked_key_for_cert", "Could not find any unlocked slots for certificate [%s]. " "Please review your TLS/SSL configuration. The following slots were found:\n", certsubject); @@ -2590,7 +2590,7 @@ slapd_get_unlocked_key_for_cert(CERTCertificate *cert, void *pin_arg) PK11SlotInfo *slot = sle->slot; const char *slotname = (slot && PK11_GetSlotName(slot)) ? PK11_GetSlotName(slot) : "unknown slot"; const char *tokenname = (slot && PK11_GetTokenName(slot)) ? PK11_GetTokenName(slot) : "unknown token"; - slapi_log_error(SLAPI_LOG_ERR, "slapd_get_unlocked_key_for_cert", + slapi_log_err(SLAPI_LOG_ERR, "slapd_get_unlocked_key_for_cert", "Slot [%s] token [%s] was locked.\n", slotname, tokenname); } @@ -2639,18 +2639,18 @@ listCerts(CERTCertDBHandle *handle, CERTCertificate *cert, PK11SlotInfo *slot, char *name = NULL; if (!cert) { - slapi_log_error(SLAPI_LOG_ERR, "listCerts", "No cert given\n"); + slapi_log_err(SLAPI_LOG_ERR, "listCerts", "No cert given\n"); return rv; } name = cert->nickname; if (!name) { - slapi_log_error(SLAPI_LOG_ERR, "listCerts", "No cert nickname\n"); + slapi_log_err(SLAPI_LOG_ERR, "listCerts", "No cert nickname\n"); return rv; } the_cert = CERT_FindCertByNicknameOrEmailAddr(handle, name); if (!the_cert) { - slapi_log_error(SLAPI_LOG_ERR, "listCerts", "Could not find cert: %s\n", name); + slapi_log_err(SLAPI_LOG_ERR, "listCerts", "Could not find cert: %s\n", name); return SECFailure; } @@ -2665,7 +2665,7 @@ listCerts(CERTCertDBHandle *handle, CERTCertificate *cert, PK11SlotInfo *slot, PR_Now(), PR_FALSE); CERT_DestroyCertificate(the_cert); if (!certs) { - slapi_log_error(SLAPI_LOG_ERR, "listCerts", "Problem printing certificates\n"); + slapi_log_err(SLAPI_LOG_ERR, "listCerts", "Problem printing certificates\n"); return SECFailure; } for (node = CERT_LIST_HEAD(certs); !CERT_LIST_END(node,certs); node = CERT_LIST_NEXT(node)) { @@ -2683,7 +2683,7 @@ listCerts(CERTCertDBHandle *handle, CERTCertificate *cert, PK11SlotInfo *slot, CERT_DestroyCertList(certs); } if (rv) { - slapi_log_error(SLAPI_LOG_ERR, "listCerts", "Problem printing certificate nicknames\n"); + slapi_log_err(SLAPI_LOG_ERR, "listCerts", "Problem printing certificate nicknames\n"); return SECFailure; } @@ -2738,7 +2738,7 @@ slapd_extract_cert(Slapi_Entry *entry, int isCA) char *personality = NULL; if (!entry) { - slapi_log_error(SLAPI_LOG_ERR, "slapd_extract_cert", + slapi_log_err(SLAPI_LOG_ERR, "slapd_extract_cert", "No entry is given for %s Cert.\n", isCA?"CA":"Server"); goto bail; } @@ -2768,7 +2768,7 @@ slapd_extract_cert(Slapi_Entry *entry, int isCA) (trust.sslFlags & (CERTDB_VALID_CA|CERTDB_TRUSTED_CA|CERTDB_TRUSTED_CLIENT_CA))) { /* default token "internal" */ PK11SlotInfo *slot = slapd_pk11_getInternalKeySlot(); - slapi_log_error(SLAPI_LOG_INFO, "slapd_extract_cert", "CA CERT NAME: %s\n", cert->nickname); + slapi_log_err(SLAPI_LOG_INFO, "slapd_extract_cert", "CA CERT NAME: %s\n", cert->nickname); if (!certfile) { char buf[BUFSIZ]; certfile = slapi_ch_smprintf("%s/%s%s", certdir, @@ -2780,14 +2780,14 @@ slapd_extract_cert(Slapi_Entry *entry, int isCA) outFile = PR_Open(certfile, PR_CREATE_FILE | PR_RDWR | PR_TRUNCATE, 00660); } if (!outFile) { - slapi_log_error(SLAPI_LOG_ERR, "slapd_extract_cert", + slapi_log_err(SLAPI_LOG_ERR, "slapd_extract_cert", "Unable to open \"%s\" for writing (%d, %d).\n", certfile, PR_GetError(), PR_GetOSError()); goto bail; } rv = listCerts(certHandle, cert, slot, outFile, NULL); if (rv) { - slapi_log_error(SLAPI_LOG_ERR, "slapd_extract_cert", "listCerts failed\n"); + slapi_log_err(SLAPI_LOG_ERR, "slapd_extract_cert", "listCerts failed\n"); break; } } @@ -2795,7 +2795,7 @@ slapd_extract_cert(Slapi_Entry *entry, int isCA) default: if (!PL_strcmp(cert->nickname, personality)) { PK11SlotInfo *slot = slapd_pk11_getInternalKeySlot(); - slapi_log_error(SLAPI_LOG_INFO, "slapd_extract_cert", "SERVER CERT NAME: %s\n", cert->nickname); + slapi_log_err(SLAPI_LOG_INFO, "slapd_extract_cert", "SERVER CERT NAME: %s\n", cert->nickname); if (!certfile) { char buf[BUFSIZ]; certfile = slapi_ch_smprintf("%s/%s%s", certdir, @@ -2805,14 +2805,14 @@ slapd_extract_cert(Slapi_Entry *entry, int isCA) outFile = PR_Open(certfile, PR_CREATE_FILE | PR_RDWR | PR_TRUNCATE, 00660); } if (!outFile) { - slapi_log_error(SLAPI_LOG_ERR, "slapd_extract_cert", + slapi_log_err(SLAPI_LOG_ERR, "slapd_extract_cert", "Unable to open \"%s\" for writing (%d, %d).\n", certfile, PR_GetError(), PR_GetOSError()); goto bail; } rv = listCerts(certHandle, cert, slot, outFile, NULL); if (rv) { - slapi_log_error(SLAPI_LOG_ERR, "slapd_extract_cert", "listCerts failed\n"); + slapi_log_err(SLAPI_LOG_ERR, "slapd_extract_cert", "listCerts failed\n"); } PR_Close(outFile); outFile = NULL; @@ -2863,7 +2863,7 @@ extractRSAKeysAndSubject( CERTCertificate *cert = PK11_FindCertFromNickname((char *)nickname, NULL); if (!cert) { rv = PR_GetError(); - slapi_log_error(SLAPI_LOG_ERR, "extractRSAKeysAndSubject", + slapi_log_err(SLAPI_LOG_ERR, "extractRSAKeysAndSubject", "Failed extract cert with %s, (%d-%s, %d).\n", nickname, rv, slapd_pr_strerror(rv), PR_GetOSError()); goto bail; @@ -2872,7 +2872,7 @@ extractRSAKeysAndSubject( *pubkey = CERT_ExtractPublicKey(cert); if (!*pubkey) { rv = PR_GetError(); - slapi_log_error(SLAPI_LOG_ERR, "extractRSAKeysAndSubject", + slapi_log_err(SLAPI_LOG_ERR, "extractRSAKeysAndSubject", "Could not get public key from cert for %s, (%d-%s, %d)\n", nickname, rv, slapd_pr_strerror(rv), PR_GetOSError()); goto bail; @@ -2881,13 +2881,13 @@ extractRSAKeysAndSubject( *privkey = PK11_FindKeyByDERCert(slot, cert, pwdata); if (!*privkey) { rv = PR_GetError(); - slapi_log_error(SLAPI_LOG_ERR, "extractRSAKeysAndSubject", + slapi_log_err(SLAPI_LOG_ERR, "extractRSAKeysAndSubject", "Unable to find the key with PK11_FindKeyByDERCert for %s, (%d-%s, %d)\n", nickname, rv, slapd_pr_strerror(rv), PR_GetOSError()); *privkey= PK11_FindKeyByAnyCert(cert, &pwdata); if (!*privkey) { rv = PR_GetError(); - slapi_log_error(SLAPI_LOG_ERR, "extractRSAKeysAndSubject", + slapi_log_err(SLAPI_LOG_ERR, "extractRSAKeysAndSubject", "Unable to find the key with PK11_FindKeyByAnyCert for %s, (%d-%s, %d)\n", nickname, rv, slapd_pr_strerror(rv), PR_GetOSError()); goto bail; @@ -2898,7 +2898,7 @@ extractRSAKeysAndSubject( *subject = CERT_AsciiToName(cert->subjectName); if (!*subject) { - slapi_log_error(SLAPI_LOG_ERR, "extractRSAKeysAndSubject", + slapi_log_err(SLAPI_LOG_ERR, "extractRSAKeysAndSubject", "Improperly formatted name: \"%s\"\n", cert->subjectName); goto bail; @@ -3017,25 +3017,25 @@ slapd_extract_key(Slapi_Entry *entry, char *token, PK11SlotInfo *slot) #endif if (!entry) { - slapi_log_error(SLAPI_LOG_ERR, "slapd_extract_key", + slapi_log_err(SLAPI_LOG_ERR, "slapd_extract_key", "No entry is given for Server Key.\n"); goto bail; } #if defined(ENCRYPTEDKEY) if (!token) { - slapi_log_error(SLAPI_LOG_ERR, "slapd_extract_key", + slapi_log_err(SLAPI_LOG_ERR, "slapd_extract_key", "No token is given.\n"); goto bail; } StdPinObj = (SVRCOREStdPinObj *)SVRCORE_GetRegisteredPinObj(); if (!StdPinObj) { - slapi_log_error(SLAPI_LOG_ERR, "slapd_extract_key", + slapi_log_err(SLAPI_LOG_ERR, "slapd_extract_key", "No entry is given for Server Key.\n"); goto bail; } err = SVRCORE_StdPinGetPin(&keyEncPwd, StdPinObj, token); if (err || !keyEncPwd) { - slapi_log_error(SLAPI_LOG_ERR, "slapd_extract_key", + slapi_log_err(SLAPI_LOG_ERR, "slapd_extract_key", "Failed to extract pw with token %s.\n", token); goto bail; } @@ -3049,7 +3049,7 @@ slapd_extract_key(Slapi_Entry *entry, char *token, PK11SlotInfo *slot) */ rv = PK11_GenerateRandom(randomPassword, sizeof(randomPassword) - 1); if (rv != SECSuccess) { - slapi_log_error(SLAPI_LOG_ERR, "slapd_extract_key", "Failed to generate random.\n"); + slapi_log_err(SLAPI_LOG_ERR, "slapd_extract_key", "Failed to generate random.\n"); goto bail; } pwitem.data = randomPassword; @@ -3061,7 +3061,7 @@ slapd_extract_key(Slapi_Entry *entry, char *token, PK11SlotInfo *slot) KeyExtractFile = slapi_entry_attr_get_charptr(entry, "ServerKeyExtractFile"); personality = slapi_entry_attr_get_charptr(entry, "nsSSLPersonalitySSL" ); if (!personality) { - slapi_log_error(SLAPI_LOG_ERR, "slapd_extract_key", + slapi_log_err(SLAPI_LOG_ERR, "slapd_extract_key", "nsSSLPersonalitySSL value not found.\n"); goto bail; } @@ -3074,7 +3074,7 @@ slapd_extract_key(Slapi_Entry *entry, char *token, PK11SlotInfo *slot) } outFile = PR_Open(keyfile, PR_CREATE_FILE | PR_RDWR | PR_TRUNCATE, 00660); if (!outFile) { - slapi_log_error(SLAPI_LOG_ERR, "slapd_extract_key", + slapi_log_err(SLAPI_LOG_ERR, "slapd_extract_key", "Unable to open \"%s\" for writing (%d, %d).\n", keyfile, PR_GetError(), PR_GetOSError()); goto bail; @@ -3082,10 +3082,10 @@ slapd_extract_key(Slapi_Entry *entry, char *token, PK11SlotInfo *slot) rv = extractRSAKeysAndSubject(personality, slot, &pwdata, &privkey, &pubkey, &subject); if (rv != SECSuccess) { #if defined(ENCRYPTEDKEY) - slapi_log_error(SLAPI_LOG_ERR, "slapd_extract_key", + slapi_log_err(SLAPI_LOG_ERR, "slapd_extract_key", "Failed to extract keys for \"%s\".\n", token); #else - slapi_log_error(SLAPI_LOG_ERR, "slapd_extract_key", "Failed to extract keys for %s.\n", personality); + slapi_log_err(SLAPI_LOG_ERR, "slapd_extract_key", "Failed to extract keys for %s.\n", personality); #endif goto bail; } @@ -3096,7 +3096,7 @@ slapd_extract_key(Slapi_Entry *entry, char *token, PK11SlotInfo *slot) */ epki = PK11_ExportEncryptedPrivKeyInfo(NULL, SEC_OID_DES_EDE3_CBC, &pwitem, privkey, 1000, &pwdata); if (!epki) { - slapi_log_error(SLAPI_LOG_ERR, "slapd_extract_key", + slapi_log_err(SLAPI_LOG_ERR, "slapd_extract_key", "Unable to export encrypted private key (%d, %d).\n", PR_GetError(), PR_GetOSError()); goto bail; @@ -3106,7 +3106,7 @@ slapd_extract_key(Slapi_Entry *entry, char *token, PK11SlotInfo *slot) /* NULL dest to let it allocate memory for us */ encryptedKeyDER = SEC_ASN1EncodeItem(arenaForEPKI, NULL, epki, SECKEY_EncryptedPrivateKeyInfoTemplate); if (!encryptedKeyDER) { - slapi_log_error(SLAPI_LOG_ERR, "slapd_extract_key", + slapi_log_err(SLAPI_LOG_ERR, "slapd_extract_key", "SEC_ASN1EncodeItem failed. (%d, %d).\n", PR_GetError(), PR_GetOSError()); goto bail; } @@ -3114,7 +3114,7 @@ slapd_extract_key(Slapi_Entry *entry, char *token, PK11SlotInfo *slot) /* Make a decrypted key the one to write out. */ arenaForPKI = PORT_NewArena(2048); if (!arenaForPKI) { - slapi_log_error(SLAPI_LOG_ERR, "slapd_extract_key", + slapi_log_err(SLAPI_LOG_ERR, "slapd_extract_key", "PORT_NewArena failed. (%d, %d).\n", PR_GetError(), PR_GetOSError()); goto bail; } @@ -3124,7 +3124,7 @@ slapd_extract_key(Slapi_Entry *entry, char *token, PK11SlotInfo *slot) rv = DecryptKey(epki, SEC_OID_DES_EDE3_CBC, &pwitem, &pwdata, &clearKeyDER); if (rv != SECSuccess) { - slapi_log_error(SLAPI_LOG_ERR, "slapd_extract_key", + slapi_log_err(SLAPI_LOG_ERR, "slapd_extract_key", "DekryptKey failed. (%d, %d).\n", PR_GetError(), PR_GetOSError()); goto bail; } @@ -3137,7 +3137,7 @@ slapd_extract_key(Slapi_Entry *entry, char *token, PK11SlotInfo *slot) b64 = BTOA_ConvertItemToAscii(&clearKeyDER); #endif if (!b64) { - slapi_log_error(SLAPI_LOG_ERR, "slapd_extract_key", + slapi_log_err(SLAPI_LOG_ERR, "slapd_extract_key", "Failed to conver to the ASCII (%d, %d).\n", PR_GetError(), PR_GetOSError()); goto bail; @@ -3152,7 +3152,7 @@ slapd_extract_key(Slapi_Entry *entry, char *token, PK11SlotInfo *slot) #endif numBytes = PR_Write(outFile, b64, total); if (numBytes != total) { - slapi_log_error(SLAPI_LOG_ERR, "slapd_extract_key", + slapi_log_err(SLAPI_LOG_ERR, "slapd_extract_key", "Failed to write to the file (%d, %d).\n", PR_GetError(), PR_GetOSError()); goto bail; diff --git a/ldap/servers/slapd/start_tls_extop.c b/ldap/servers/slapd/start_tls_extop.c index ae22dc9..413aa24 100644 --- a/ldap/servers/slapd/start_tls_extop.c +++ b/ldap/servers/slapd/start_tls_extop.c @@ -55,19 +55,19 @@ start_tls_io_enable(Connection *c, void *data /* UNUSED */) ssl_listensocket = get_ssl_listener_fd(); if ( ssl_listensocket == (PRFileDesc *) NULL ) { - slapi_log_error(SLAPI_LOG_ERR, "start_tls_io_enable", + slapi_log_err(SLAPI_LOG_ERR, "start_tls_io_enable", "SSL listener socket not found.\n" ); goto done; } newsocket = slapd_ssl_importFD( ssl_listensocket, c->c_prfd ); if ( newsocket == (PRFileDesc *) NULL ) { - slapi_log_error(SLAPI_LOG_ERR, "start_tls_io_enable", + slapi_log_err(SLAPI_LOG_ERR, "start_tls_io_enable", "SSL socket import failed.\n" ); goto done; } } else { if ( slapd_ssl_init2( &c->c_prfd, 1 ) != 0 ) { - slapi_log_error(SLAPI_LOG_ERR, "start_tls_io_enable", + slapi_log_err(SLAPI_LOG_ERR, "start_tls_io_enable", "SSL socket import or configuration failed.\n" ); goto done; } @@ -77,7 +77,7 @@ start_tls_io_enable(Connection *c, void *data /* UNUSED */) rv = slapd_ssl_resetHandshake( newsocket, 1 ); if ( rv != SECSuccess ) { - slapi_log_error(SLAPI_LOG_ERR, "start_tls_io_enable", + slapi_log_err(SLAPI_LOG_ERR, "start_tls_io_enable", "Unable to set socket ready for SSL handshake.\n" ); goto done; } @@ -100,7 +100,7 @@ start_tls_io_enable(Connection *c, void *data /* UNUSED */) if ( rv < 0 ) { PRErrorCode prerr = PR_GetError(); - slapi_log_error(SLAPI_LOG_ERR, "start_tls_io_enable", + slapi_log_err(SLAPI_LOG_ERR, "start_tls_io_enable", "SSL_HandshakeCallback() %d " SLAPI_COMPONENT_NAME_NSPR " error %d (%s)\n", rv, prerr, slapd_pr_strerror( prerr ) ); } @@ -109,7 +109,7 @@ start_tls_io_enable(Connection *c, void *data /* UNUSED */) rv = slapd_ssl_badCertHook (c->c_prfd, (void *)handle_bad_certificate, c); if ( rv < 0 ) { PRErrorCode prerr = PR_GetError(); - slapi_log_error(SLAPI_LOG_ERR, "start_tls_io_enable", + slapi_log_err(SLAPI_LOG_ERR, "start_tls_io_enable", "SSL_BadCertHook(%i) %i " SLAPI_COMPONENT_NAME_NSPR " error %d (%s)\n", c->c_sd, rv, prerr, slapd_pr_strerror( prerr ) ); } @@ -134,7 +134,7 @@ start_tls( Slapi_PBlock *pb ) * The only requirement is to set the LDAP OID of the extended response to the START_TLS_OID. */ if ( slapi_pblock_set( pb, SLAPI_EXT_OP_RET_OID, START_TLS_OID ) != 0 ) { - slapi_log_error(SLAPI_LOG_PLUGIN, "start_tls", + slapi_log_err(SLAPI_LOG_PLUGIN, "start_tls", "Could not set extended response oid.\n" ); slapi_send_ldap_result( pb, LDAP_OPERATIONS_ERROR, NULL, "Could not set extended response oid.", 0, NULL ); @@ -147,24 +147,24 @@ start_tls( Slapi_PBlock *pb ) * match this very plugin's OID: START_TLS_OID. */ if ( slapi_pblock_get( pb, SLAPI_EXT_OP_REQ_OID, &oid ) != 0 ) { - slapi_log_error(SLAPI_LOG_PLUGIN, "start_tls", + slapi_log_err(SLAPI_LOG_PLUGIN, "start_tls", "Could not get OID value from request.\n" ); slapi_send_ldap_result( pb, LDAP_OPERATIONS_ERROR, NULL, "Could not get OID value from request.", 0, NULL ); return( SLAPI_PLUGIN_EXTENDED_SENT_RESULT ); } else { - slapi_log_error(SLAPI_LOG_PLUGIN, "start_tls", + slapi_log_err(SLAPI_LOG_PLUGIN, "start_tls", "Received extended operation request with OID %s\n", oid ); } if ( strcasecmp( oid, START_TLS_OID ) != 0) { - slapi_log_error(SLAPI_LOG_PLUGIN, "start_tls", + slapi_log_err(SLAPI_LOG_PLUGIN, "start_tls", "Request OID does not match Start TLS OID.\n" ); slapi_send_ldap_result( pb, LDAP_OPERATIONS_ERROR, NULL, "Request OID does not match Start TLS OID.", 0, NULL ); return( SLAPI_PLUGIN_EXTENDED_SENT_RESULT ); } else { - slapi_log_error(SLAPI_LOG_PLUGIN, "start_tls", + slapi_log_err(SLAPI_LOG_PLUGIN, "start_tls", "Start TLS extended operation request confirmed.\n" ); } @@ -175,7 +175,7 @@ start_tls( Slapi_PBlock *pb ) PR_EnterMonitor(conn->c_mutex); /* cannot call slapi_send_ldap_result with mutex locked - will deadlock if ber_flush returns error */ if ( conn->c_prfd == (PRFileDesc *) NULL ) { - slapi_log_error(SLAPI_LOG_PLUGIN, "start_tls", + slapi_log_err(SLAPI_LOG_PLUGIN, "start_tls", "Connection socket not available.\n" ); ldaprc = LDAP_UNAVAILABLE; ldapmsg = "Connection socket not available."; @@ -185,7 +185,7 @@ start_tls( Slapi_PBlock *pb ) /* Check whether the Start TLS request can be accepted. */ if ( connection_operations_pending( conn, pb->pb_op, 1 /* check for ops where result not yet sent */ )) { - slapi_log_error(SLAPI_LOG_PLUGIN, "start_tls", + slapi_log_err(SLAPI_LOG_PLUGIN, "start_tls", "Other operations are still pending on the connection.\n" ); ldaprc = LDAP_OPERATIONS_ERROR; ldapmsg = "Other operations are still pending on the connection."; @@ -196,7 +196,7 @@ start_tls( Slapi_PBlock *pb ) if ( !config_get_security() ) { /* if any, here is where the referral to another SSL supporting server should be done: */ /* slapi_send_ldap_result( pb, LDAP_REFERRAL, NULL, msg, 0, url ); */ - slapi_log_error(SLAPI_LOG_PLUGIN, "start_tls", + slapi_log_err(SLAPI_LOG_PLUGIN, "start_tls", "SSL not supported by this server.\n" ); ldaprc = LDAP_PROTOCOL_ERROR; ldapmsg = "SSL not supported by this server."; @@ -205,7 +205,7 @@ start_tls( Slapi_PBlock *pb ) if ( conn->c_flags & CONN_FLAG_SSL ) { - slapi_log_error(SLAPI_LOG_PLUGIN, "start_tls", + slapi_log_err(SLAPI_LOG_PLUGIN, "start_tls", "SSL connection already established.\n" ); ldaprc = LDAP_OPERATIONS_ERROR; ldapmsg = "SSL connection already established."; @@ -213,7 +213,7 @@ start_tls( Slapi_PBlock *pb ) } if ( conn->c_flags & CONN_FLAG_SASL_CONTINUE ) { - slapi_log_error(SLAPI_LOG_PLUGIN, "start_tls", + slapi_log_err(SLAPI_LOG_PLUGIN, "start_tls", "SASL multi-stage bind in progress.\n" ); ldaprc = LDAP_OPERATIONS_ERROR; ldapmsg = "SASL multi-stage bind in progress."; @@ -221,7 +221,7 @@ start_tls( Slapi_PBlock *pb ) } if ( conn->c_flags & CONN_FLAG_CLOSING ) { - slapi_log_error(SLAPI_LOG_PLUGIN, "start_tls", + slapi_log_err(SLAPI_LOG_PLUGIN, "start_tls", "Connection being closed at this moment.\n" ); ldaprc = LDAP_UNAVAILABLE; ldapmsg = "Connection being closed at this moment."; @@ -232,7 +232,7 @@ start_tls( Slapi_PBlock *pb ) * So, we may as well try initialising SSL. */ if ( slapd_security_library_is_initialized() == 0 ) { - slapi_log_error(SLAPI_LOG_PLUGIN, "start_tls", + slapi_log_err(SLAPI_LOG_PLUGIN, "start_tls", "NSS libraries not initialised.\n" ); ldaprc = LDAP_UNAVAILABLE; ldapmsg = "NSS libraries not initialised."; @@ -279,7 +279,7 @@ start_tls_graceful_closure( Connection *c, Slapi_PBlock * pb, int is_initiator ) pblock->pb_op = c->c_ops; set_db_default_result_handlers( pblock ); if ( slapi_pblock_set( pblock, SLAPI_EXT_OP_RET_OID, START_TLS_OID ) != 0 ) { - slapi_log_error(SLAPI_LOG_PLUGIN, "start_tls", + slapi_log_err(SLAPI_LOG_PLUGIN, "start_tls", "Could not set extended response oid.\n" ); slapi_send_ldap_result( pblock, LDAP_OPERATIONS_ERROR, NULL, "Could not set extended response oid.", 0, NULL ); @@ -293,12 +293,12 @@ start_tls_graceful_closure( Connection *c, Slapi_PBlock * pb, int is_initiator ) */ while ( connection_operations_pending( c, pblock->pb_op, 0 /* wait for all other ops to full complete */ )) { - slapi_log_error(SLAPI_LOG_PLUGIN, "start_tls", + slapi_log_err(SLAPI_LOG_PLUGIN, "start_tls", "Still %d operations to be completed before closing the SSL connection.\n", c->c_refcnt - 1 ); } - slapi_log_error(SLAPI_LOG_PLUGIN, "start_tls_graceful_closure", "SSL_CLOSE_NOTIFY_ALERT\n" ); + slapi_log_err(SLAPI_LOG_PLUGIN, "start_tls_graceful_closure", "SSL_CLOSE_NOTIFY_ALERT\n" ); /* An SSL close_notify alert should be sent to the client. However, the NSS API * doesn't provide us with anything alike. @@ -380,19 +380,19 @@ int start_tls_init( Slapi_PBlock *pb ) */ if ( slapi_pblock_get( pb, SLAPI_PLUGIN_ARGV, &argv ) != 0 ) { - slapi_log_error(SLAPI_LOG_PLUGIN, "start_tls_init", "Could not get argv\n" ); + slapi_log_err(SLAPI_LOG_PLUGIN, "start_tls_init", "Could not get argv\n" ); return( -1 ); } /* Compare the OID specified in the configuration file against the Start TLS OID. */ if ( argv == NULL || strcmp( argv[0], START_TLS_OID ) != 0 ) { - slapi_log_error(SLAPI_LOG_PLUGIN, "start_tls_init", + slapi_log_err(SLAPI_LOG_PLUGIN, "start_tls_init", "OID is missing or is not %s\n", START_TLS_OID ); return( -1 ); } else { oid = slapi_ch_strdup( argv[0] ); - slapi_log_error(SLAPI_LOG_PLUGIN, "start_tls_init", + slapi_log_err(SLAPI_LOG_PLUGIN, "start_tls_init", "Registering plug-in for Start TLS extended op %s.\n", oid ); slapi_ch_free_string( &oid ); } @@ -407,7 +407,7 @@ int start_tls_init( Slapi_PBlock *pb ) slapi_pblock_set( pb, SLAPI_PLUGIN_EXT_OP_OIDLIST, start_tls_oid_list ) != 0 || slapi_pblock_set( pb, SLAPI_PLUGIN_EXT_OP_NAMELIST, start_tls_name_list ) != 0 ) { - slapi_log_error(SLAPI_LOG_PLUGIN, "start_tls_init", + slapi_log_err(SLAPI_LOG_PLUGIN, "start_tls_init", "Failed to set plug-in version, function, and OID.\n" ); return( -1 ); } diff --git a/ldap/servers/slapd/str2filter.c b/ldap/servers/slapd/str2filter.c index 3d7ef6f..ebd5c5d 100644 --- a/ldap/servers/slapd/str2filter.c +++ b/ldap/servers/slapd/str2filter.c @@ -30,7 +30,7 @@ slapi_str2filter( char *str ) struct slapi_filter *f = NULL; char *end; - LDAPDebug(LDAP_DEBUG_FILTER, "slapi_str2filter \"%s\"\n", str, 0, 0 ); + slapi_log_err(SLAPI_LOG_FILTER, "slapi_str2filter", "\"%s\"\n", str); if ( str == NULL || *str == '\0' ) { return( NULL ); @@ -47,28 +47,28 @@ slapi_str2filter( char *str ) str++; switch ( *str ) { case '&': - LDAPDebug0Args(LDAP_DEBUG_FILTER, "slapi_str2filter: AND\n"); + slapi_log_err(SLAPI_LOG_FILTER, "slapi_str2filter", "AND\n"); str++; f = str2list( str, LDAP_FILTER_AND ); break; case '|': - LDAPDebug0Args(LDAP_DEBUG_FILTER, "put_filter: OR\n"); + slapi_log_err(SLAPI_LOG_FILTER, "slapi_str2filter", "OR\n"); str++; f = str2list( str, LDAP_FILTER_OR ); break; case '!': - LDAPDebug0Args(LDAP_DEBUG_FILTER, "put_filter: NOT\n"); + slapi_log_err(SLAPI_LOG_FILTER, "slapi_str2filter", "NOT\n"); str++; f = str2list( str, LDAP_FILTER_NOT ); break; default: - LDAPDebug0Args(LDAP_DEBUG_FILTER, "slapi_str2filter: simple\n"); + slapi_log_err(SLAPI_LOG_FILTER, "slapi_str2filter", "simple\n"); f = str2simple( str , 1 /* unescape_filter */); break; @@ -77,7 +77,7 @@ slapi_str2filter( char *str ) break; default: /* assume it's a simple type=value filter */ - LDAPDebug0Args(LDAP_DEBUG_FILTER, "slapi_str2filter: default\n"); + slapi_log_err(SLAPI_LOG_FILTER, "slapi_str2filter", "default\n"); f = str2simple( str , 1 /* unescape_filter */); break; @@ -98,7 +98,7 @@ str2list( char *str, unsigned long ftype ) char *next; char save; - LDAPDebug(LDAP_DEBUG_FILTER, "str2list \"%s\"\n", str, 0, 0 ); + slapi_log_err(SLAPI_LOG_FILTER, "str2list","\"%s\"\n", str); f = (struct slapi_filter *) slapi_ch_calloc( 1, sizeof(struct slapi_filter) ); f->f_choice = ftype; @@ -312,7 +312,7 @@ str2simple( char *str , int unescape_filter) char *s; char *value, savechar; - LDAPDebug(LDAP_DEBUG_FILTER, "str2simple \"%s\"\n", str, 0, 0 ); + slapi_log_err(SLAPI_LOG_FILTER, "str2simple", "\"%s\"\n", str); PR_ASSERT(str); @@ -433,7 +433,7 @@ str2subvals( char *val, struct slapi_filter *f, int unescape_filter ) int gotstar; size_t len, outlen; - LDAPDebug(LDAP_DEBUG_FILTER, "str2subvals \"%s\"\n", val, 0, 0 ); + slapi_log_err(SLAPI_LOG_FILTER, "str2subvals", "\"%s\"\n", val); gotstar = 0; while ( val != NULL && *val ) { diff --git a/ldap/servers/slapd/stubs.c b/ldap/servers/slapd/stubs.c index e3c9600..c527911 100644 --- a/ldap/servers/slapd/stubs.c +++ b/ldap/servers/slapd/stubs.c @@ -29,7 +29,7 @@ void *PT_Lock( PRLock *x_mutex ) int lcache_init(LDAP *ld, void *arg) { - LDAPDebug(LDAP_DEBUG_ERR, - "lcache_init: Shouldn't have been called\n", 0,0,0); + slapi_log_err(SLAPI_LOG_ERR, + "lcache_init", "Shouldn't have been called\n"); return -1; } diff --git a/ldap/servers/slapd/task.c b/ldap/servers/slapd/task.c index 7a3c64a..0305ec8 100644 --- a/ldap/servers/slapd/task.c +++ b/ldap/servers/slapd/task.c @@ -471,8 +471,7 @@ slapi_plugin_task_register_handler(const char *name, dseCallbackFn func, Slapi_P dn = slapi_create_dn_string("cn=%s,%s", name, TASK_BASE_DN); if (NULL == dn) { - LDAPDebug1Arg(LDAP_DEBUG_ANY, - "slapi_task_register_handler - " + slapi_log_err(SLAPI_LOG_ERR, "slapi_plugin_task_register_handler", "failed to create task dn for %s\n", name); return ret; } @@ -508,9 +507,9 @@ slapi_plugin_task_register_handler(const char *name, dseCallbackFn func, Slapi_P slapi_add_internal_pb(add_pb); slapi_pblock_get(add_pb, SLAPI_PLUGIN_INTOP_RESULT, &x); if ((x != LDAP_SUCCESS) && (x != LDAP_ALREADY_EXISTS)) { - LDAPDebug(LDAP_DEBUG_ERR, - "slapi_plugin_task_register_handler - Can't create task node '%s' (error %d)\n", - name, x, 0); + slapi_log_err(SLAPI_LOG_ERR, + "slapi_plugin_task_register_handler", "Can't create task node '%s' (error %d)\n", + name, x); ret = x; goto out; } @@ -571,8 +570,8 @@ new_task(const char *rawdn, void *plugin) dn = slapi_create_dn_string("%s", rawdn); if (NULL == dn) { - LDAPDebug1Arg(LDAP_DEBUG_ERR, - "new_task - Invalid task dn: %s\n", rawdn); + slapi_log_err(SLAPI_LOG_ERR, + "new_task", "Invalid task dn: %s\n", rawdn); return NULL; } task = (Slapi_Task *)slapi_ch_calloc(1, sizeof(Slapi_Task)); @@ -686,15 +685,15 @@ static Slapi_Entry *get_internal_entry(Slapi_PBlock *pb, char *dn) slapi_search_internal_pb(pb); slapi_pblock_get(pb, SLAPI_PLUGIN_INTOP_RESULT, &ret); if (ret != LDAP_SUCCESS) { - LDAPDebug(LDAP_DEBUG_WARNING, "get_internal_entry - Can't find task entry '%s'\n", - dn, 0, 0); + slapi_log_err(SLAPI_LOG_WARNING, "get_internal_entry", + "Can't find task entry '%s'\n", dn); return NULL; } slapi_pblock_get(pb, SLAPI_PLUGIN_INTOP_SEARCH_ENTRIES, &entries); if ((NULL == entries) || (NULL == entries[0])) { - LDAPDebug(LDAP_DEBUG_WARNING, "get_internal_entry - Can't find task entry '%s'\n", - dn, 0, 0); + slapi_log_err(SLAPI_LOG_WARNING, "get_internal_entry", + "Can't find task entry '%s'\n", dn); return NULL; } return entries[0]; @@ -733,7 +732,7 @@ static void modify_internal_entry(char *dn, LDAPMod **mods) */ tries++; if (tries == 3) { - LDAPDebug(LDAP_DEBUG_WARNING, "modify_internal_entry - Can't modify task " + slapi_log_err(SLAPI_LOG_WARNING, "modify_internal_entry", "Can't modify task " "entry '%s'; %s (%d)\n", dn, ldap_err2string(ret), ret); pblock_done(&pb); return; @@ -815,8 +814,8 @@ static int task_modify(Slapi_PBlock *pb, Slapi_Entry *e, task->task_state = SLAPI_TASK_CANCELLED; if (task->cancel) { (*task->cancel)(task); - LDAPDebug(LDAP_DEBUG_INFO, "task_modify - Canceling task '%s'\n", - fetch_attr(eAfter, "cn", "?"), 0, 0); + slapi_log_err(SLAPI_LOG_INFO, "task_modify", "Canceling task '%s'\n", + fetch_attr(eAfter, "cn", "?")); } } } @@ -886,8 +885,8 @@ static int task_import_add(Slapi_PBlock *pb, Slapi_Entry *e, if (slapi_lookup_instance_name_by_suffixes(include, exclude, &instances) < 0) { - LDAPDebug(LDAP_DEBUG_ERR, - "task_import_add - No backend instance is specified.\n", 0, 0, 0); + slapi_log_err(SLAPI_LOG_ERR, + "task_import_add", "No backend instance is specified.\n"); *returncode = LDAP_OBJECT_CLASS_VIOLATION; return SLAPI_DSE_CALLBACK_ERROR; } @@ -902,14 +901,14 @@ static int task_import_add(Slapi_PBlock *pb, Slapi_Entry *e, } else if (counter == 0) { - LDAPDebug(LDAP_DEBUG_ERR, - "task_import_add - No backend instance is specified.\n", 0, 0, 0); + slapi_log_err(SLAPI_LOG_ERR, + "task_import_add", "No backend instance is specified.\n"); *returncode = LDAP_OBJECT_CLASS_VIOLATION; return SLAPI_DSE_CALLBACK_ERROR; } else { - LDAPDebug(LDAP_DEBUG_ERR, - "task_import_add - Multiple backend instances are specified: " - "%s, %s, ...\n", instances[0], instances[1], 0); + slapi_log_err(SLAPI_LOG_ERR, + "task_import_add", "Multiple backend instances are specified: " + "%s, %s, ...\n", instances[0], instances[1]); *returncode = LDAP_OBJECT_CLASS_VIOLATION; return SLAPI_DSE_CALLBACK_ERROR; } @@ -922,8 +921,8 @@ static int task_import_add(Slapi_PBlock *pb, Slapi_Entry *e, /* lookup the backend */ be = slapi_be_select_by_instance_name(instance_name); if (be == NULL) { - LDAPDebug(LDAP_DEBUG_ERR, "task_import_add - Can't import to nonexistent backend %s\n", - instance_name, 0, 0); + slapi_log_err(SLAPI_LOG_ERR, "task_import_add", "Can't import to nonexistent backend %s\n", + instance_name); slapi_ch_free_string(&nameFrombe_name); *returncode = LDAP_NO_SUCH_OBJECT; return SLAPI_DSE_CALLBACK_ERROR; @@ -933,15 +932,15 @@ static int task_import_add(Slapi_PBlock *pb, Slapi_Entry *e, * for DS 5.0 where the import/export stuff changed a lot. */ if (! SLAPI_PLUGIN_IS_V3(be->be_database)) { - LDAPDebug(LDAP_DEBUG_ERR, "task_import_add - Can't perform an import with pre-V3 " - "backend plugin %s\n", be->be_database->plg_name, 0, 0); + slapi_log_err(SLAPI_LOG_ERR, "task_import_add", "Can't perform an import with pre-V3 " + "backend plugin %s\n", be->be_database->plg_name); *returncode = LDAP_UNWILLING_TO_PERFORM; slapi_ch_free_string(&nameFrombe_name); return SLAPI_DSE_CALLBACK_ERROR; } if (be->be_database->plg_ldif2db == NULL) { - LDAPDebug(LDAP_DEBUG_ERR, "task_import_add - No ldif2db function defined for " - "backend %s\n", be->be_database->plg_name, 0, 0); + slapi_log_err(SLAPI_LOG_ERR, "task_import_add", "No ldif2db function defined for " + "backend %s\n", be->be_database->plg_name); *returncode = LDAP_UNWILLING_TO_PERFORM; slapi_ch_free_string(&nameFrombe_name); return SLAPI_DSE_CALLBACK_ERROR; @@ -974,7 +973,7 @@ static int task_import_add(Slapi_PBlock *pb, Slapi_Entry *e, /* allocate new task now */ task = slapi_new_task(slapi_entry_get_ndn(e)); if (task == NULL) { - LDAPDebug(LDAP_DEBUG_ERR, "task_import_add - Unable to allocate new task!\n", 0, 0, 0); + slapi_log_err(SLAPI_LOG_ERR, "task_import_add", "Unable to allocate new task!\n"); rv = LDAP_OPERATIONS_ERROR; goto out; } @@ -1044,8 +1043,8 @@ static void task_export_thread(void *arg) be = slapi_be_select_by_instance_name((const char *)*inp); if (be == NULL) { /* shouldn't happen */ - LDAPDebug(LDAP_DEBUG_ERR, "task_export_thread - Backend '%s' is missing\n", - (const char *)*inp, 0, 0); + slapi_log_err(SLAPI_LOG_ERR, "task_export_thread", "Backend '%s' is missing\n", + (const char *)*inp); continue; } @@ -1085,15 +1084,15 @@ static void task_export_thread(void *arg) } slapi_task_log_notice(task, "Beginning export of '%s'", *inp); - LDAPDebug(LDAP_DEBUG_INFO, "task_export_thread - Beginning export of '%s'\n", *inp, 0, 0); + slapi_log_err(SLAPI_LOG_INFO, "task_export_thread", "Beginning export of '%s'\n", *inp); rv = (*pb->pb_plugin->plg_db2ldif)(pb); if (rv != 0) { slapi_task_log_notice(task, "backend '%s' export failed (%d)", *inp, rv); - LDAPDebug(LDAP_DEBUG_ERR, - "task_export_thread - Backend '%s' export failed (%d)\n", - (const char *)*inp, rv, 0); + slapi_log_err(SLAPI_LOG_ERR, + "task_export_thread", "Backend '%s' export failed (%d)\n", + (const char *)*inp, rv); } if (release_me) { @@ -1115,10 +1114,10 @@ static void task_export_thread(void *arg) if (rv == 0) { slapi_task_log_notice(task, "Export finished."); - LDAPDebug(LDAP_DEBUG_INFO, "task_export_thread - Export finished.\n", 0, 0, 0); + slapi_log_err(SLAPI_LOG_INFO, "task_export_thread", "Export finished.\n"); } else { slapi_task_log_notice(task, "Export failed."); - LDAPDebug(LDAP_DEBUG_ERR, "task_export_thread - Export failed.\n", 0, 0, 0); + slapi_log_err(SLAPI_LOG_ERR, "task_export_thread", "Export failed.\n"); } slapi_task_finish(task, rv); @@ -1199,8 +1198,8 @@ static int task_export_add(Slapi_PBlock *pb, Slapi_Entry *e, if (slapi_lookup_instance_name_by_suffixes(include, exclude, &instance_names) < 0) { - LDAPDebug(LDAP_DEBUG_ERR, - "task_export_add - No backend instance is specified.\n", 0, 0, 0); + slapi_log_err(SLAPI_LOG_ERR, + "task_export_add", "No backend instance is specified.\n"); *returncode = LDAP_OBJECT_CLASS_VIOLATION; rv = SLAPI_DSE_CALLBACK_ERROR; goto out; @@ -1212,15 +1211,15 @@ static int task_export_add(Slapi_PBlock *pb, Slapi_Entry *e, ; if (instance_cnt == 0) { - LDAPDebug(LDAP_DEBUG_ERR, - "task_export_add - No backend instance is specified.\n", 0, 0, 0); + slapi_log_err(SLAPI_LOG_ERR, + "task_export_add", "No backend instance is specified.\n"); *returncode = LDAP_OBJECT_CLASS_VIOLATION; rv = SLAPI_DSE_CALLBACK_ERROR; goto out; } } else { - LDAPDebug(LDAP_DEBUG_ERR, - "task_export_add - No backend instance is specified.\n", 0, 0, 0); + slapi_log_err(SLAPI_LOG_ERR, + "task_export_add", "No backend instance is specified.\n"); *returncode = LDAP_OBJECT_CLASS_VIOLATION; rv = SLAPI_DSE_CALLBACK_ERROR; goto out; @@ -1280,9 +1279,9 @@ static int task_export_add(Slapi_PBlock *pb, Slapi_Entry *e, /* lookup the backend */ be = slapi_be_select_by_instance_name((const char *)*inp); if (be == NULL) { - LDAPDebug(LDAP_DEBUG_ERR, - "task_export_add - Can't export to nonexistent backend %s\n", - *inp, 0, 0); + slapi_log_err(SLAPI_LOG_ERR, + "task_export_add", "Can't export to nonexistent backend %s\n", + *inp); *returncode = LDAP_NO_SUCH_OBJECT; rv = SLAPI_DSE_CALLBACK_ERROR; goto out; @@ -1292,15 +1291,15 @@ static int task_export_add(Slapi_PBlock *pb, Slapi_Entry *e, * for DS 5.0 where the import/export stuff changed a lot. */ if (! SLAPI_PLUGIN_IS_V3(be->be_database)) { - LDAPDebug(LDAP_DEBUG_ERR, "task_export_add - Can't perform an export with pre-V3 " - "backend plugin %s\n", be->be_database->plg_name, 0, 0); + slapi_log_err(SLAPI_LOG_ERR, "task_export_add", "Can't perform an export with pre-V3 " + "backend plugin %s\n", be->be_database->plg_name); *returncode = LDAP_UNWILLING_TO_PERFORM; rv = SLAPI_DSE_CALLBACK_ERROR; goto out; } if (be->be_database->plg_db2ldif == NULL) { - LDAPDebug(LDAP_DEBUG_ERR, "task_export_add - No db2ldif function defined for " - "backend %s\n", be->be_database->plg_name, 0, 0); + slapi_log_err(SLAPI_LOG_ERR, "task_export_add", "No db2ldif function defined for " + "backend %s\n", be->be_database->plg_name); *returncode = LDAP_UNWILLING_TO_PERFORM; rv = SLAPI_DSE_CALLBACK_ERROR; goto out; @@ -1310,7 +1309,7 @@ static int task_export_add(Slapi_PBlock *pb, Slapi_Entry *e, /* allocate new task now */ task = slapi_new_task(slapi_entry_get_ndn(e)); if (task == NULL) { - LDAPDebug(LDAP_DEBUG_ERR, "task_export_add - Unable to allocate new task!\n", 0, 0, 0); + slapi_log_err(SLAPI_LOG_ERR, "task_export_add", "Unable to allocate new task!\n"); *returncode = LDAP_OPERATIONS_ERROR; rv = SLAPI_DSE_CALLBACK_ERROR; goto out; @@ -1341,8 +1340,8 @@ static int task_export_add(Slapi_PBlock *pb, Slapi_Entry *e, (void *)mypb, PR_PRIORITY_NORMAL, PR_GLOBAL_THREAD, PR_UNJOINABLE_THREAD, SLAPD_DEFAULT_THREAD_STACKSIZE); if (thread == NULL) { - LDAPDebug(LDAP_DEBUG_ERR, - "task_export_add - Unable to create ldbm2ldif thread!\n", 0, 0, 0); + slapi_log_err(SLAPI_LOG_ERR, + "task_export_add", "Unable to create ldbm2ldif thread!\n"); *returncode = LDAP_OPERATIONS_ERROR; rv = SLAPI_DSE_CALLBACK_ERROR; slapi_pblock_destroy(mypb); @@ -1378,18 +1377,18 @@ static void task_backup_thread(void *arg) slapi_task_log_notice(task, "Beginning backup of '%s'", pb->pb_plugin->plg_name); - LDAPDebug(LDAP_DEBUG_INFO, "task_backup_thread - Beginning backup of '%s'\n", - pb->pb_plugin->plg_name, 0, 0); + slapi_log_err(SLAPI_LOG_INFO, "task_backup_thread", "Beginning backup of '%s'\n", + pb->pb_plugin->plg_name); rv = (*pb->pb_plugin->plg_db2archive)(pb); if (rv != 0) { slapi_task_log_notice(task, "Backup failed (error %d)", rv); slapi_task_log_status(task, "Backup failed (error %d)", rv); - LDAPDebug(LDAP_DEBUG_ERR, "task_backup_thread - Backup failed (error %d)\n", rv, 0, 0); + slapi_log_err(SLAPI_LOG_ERR, "task_backup_thread", "Backup failed (error %d)\n", rv); } else { slapi_task_log_notice(task, "Backup finished."); slapi_task_log_status(task, "Backup finished."); - LDAPDebug(LDAP_DEBUG_INFO, "task_backup_thread - Backup finished.\n", 0, 0, 0); + slapi_log_err(SLAPI_LOG_INFO, "task_backup_thread", "Backup finished.\n"); } slapi_task_finish(task, rv); @@ -1441,17 +1440,17 @@ static int task_backup_add(Slapi_PBlock *pb, Slapi_Entry *e, } slapi_ch_free_string(&cookie); if (NULL == be || NULL == be->be_database->plg_db2archive) { - LDAPDebug(LDAP_DEBUG_ERR, - "task_backup_add - no db2archive function defined.\n", 0, 0, 0); + slapi_log_err(SLAPI_LOG_ERR, + "task_backup_add", "no db2archive function defined.\n"); *returncode = LDAP_UNWILLING_TO_PERFORM; rv = SLAPI_DSE_CALLBACK_ERROR; goto out; } if (! SLAPI_PLUGIN_IS_V3(be->be_database)) { - LDAPDebug(LDAP_DEBUG_ERR, - "task_backup_add - Can't perform an backup with pre-V3 " - "backend plugin %s\n", be->be_database->plg_name, 0, 0); + slapi_log_err(SLAPI_LOG_ERR, + "task_backup_add", "Can't perform an backup with pre-V3 " + "backend plugin %s\n", be->be_database->plg_name); *returncode = LDAP_UNWILLING_TO_PERFORM; rv = SLAPI_DSE_CALLBACK_ERROR; goto out; @@ -1460,7 +1459,7 @@ static int task_backup_add(Slapi_PBlock *pb, Slapi_Entry *e, /* allocate new task now */ task = slapi_new_task(slapi_entry_get_ndn(e)); if (task == NULL) { - LDAPDebug(LDAP_DEBUG_ERR, "task_backup_add - Unable to allocate new task!\n", 0, 0, 0); + slapi_log_err(SLAPI_LOG_ERR, "task_backup_add", "Unable to allocate new task!\n"); *returncode = LDAP_OPERATIONS_ERROR; rv = SLAPI_DSE_CALLBACK_ERROR; goto out; @@ -1482,8 +1481,8 @@ static int task_backup_add(Slapi_PBlock *pb, Slapi_Entry *e, (void *)mypb, PR_PRIORITY_NORMAL, PR_GLOBAL_THREAD, PR_UNJOINABLE_THREAD, SLAPD_DEFAULT_THREAD_STACKSIZE); if (thread == NULL) { - LDAPDebug(LDAP_DEBUG_ERR, - "task_backup_add - Unable to create backup thread!\n", 0, 0, 0); + slapi_log_err(SLAPI_LOG_ERR, + "task_backup_add", "Unable to create backup thread!\n"); *returncode = LDAP_OPERATIONS_ERROR; rv = SLAPI_DSE_CALLBACK_ERROR; slapi_ch_free((void **)&mypb->pb_seq_val); @@ -1513,18 +1512,18 @@ static void task_restore_thread(void *arg) slapi_task_log_notice(task, "Beginning restore to '%s'", pb->pb_plugin->plg_name); - LDAPDebug(LDAP_DEBUG_INFO, "task_restore_thread - Beginning restore to '%s'\n", - pb->pb_plugin->plg_name, 0, 0); + slapi_log_err(SLAPI_LOG_INFO, "task_restore_thread", "Beginning restore to '%s'\n", + pb->pb_plugin->plg_name); rv = (*pb->pb_plugin->plg_archive2db)(pb); if (rv != 0) { slapi_task_log_notice(task, "Restore failed (error %d)", rv); slapi_task_log_status(task, "Restore failed (error %d)", rv); - LDAPDebug(LDAP_DEBUG_ERR, "task_restore_thread - Restore failed (error %d)\n", rv, 0, 0); + slapi_log_err(SLAPI_LOG_ERR, "task_restore_thread", "Restore failed (error %d)\n", rv); } else { slapi_task_log_notice(task, "Restore finished."); slapi_task_log_status(task, "Restore finished."); - LDAPDebug(LDAP_DEBUG_INFO, "task_restore_thread - Restore finished.\n", 0, 0, 0); + slapi_log_err(SLAPI_LOG_INFO, "task_restore_thread", "Restore finished.\n"); } slapi_task_finish(task, rv); @@ -1580,8 +1579,8 @@ static int task_restore_add(Slapi_PBlock *pb, Slapi_Entry *e, } slapi_ch_free_string(&cookie); if (NULL == be || NULL == be->be_database->plg_archive2db) { - LDAPDebug(LDAP_DEBUG_ERR, - "task_restore_add - No archive2db function defined.\n", 0, 0, 0); + slapi_log_err(SLAPI_LOG_ERR, + "task_restore_add", "No archive2db function defined.\n"); *returncode = LDAP_UNWILLING_TO_PERFORM; rv = SLAPI_DSE_CALLBACK_ERROR; goto out; @@ -1591,8 +1590,8 @@ static int task_restore_add(Slapi_PBlock *pb, Slapi_Entry *e, * for DS 5.0 where the import/export stuff changed a lot. */ if (! SLAPI_PLUGIN_IS_V3(be->be_database)) { - LDAPDebug(LDAP_DEBUG_ERR, "task_restore_add - Can't perform an restore with pre-V3 " - "backend plugin %s\n", be->be_database->plg_name, 0, 0); + slapi_log_err(SLAPI_LOG_ERR, "task_restore_add", "Can't perform an restore with pre-V3 " + "backend plugin %s\n", be->be_database->plg_name); *returncode = LDAP_UNWILLING_TO_PERFORM; rv = SLAPI_DSE_CALLBACK_ERROR; goto out; @@ -1601,7 +1600,7 @@ static int task_restore_add(Slapi_PBlock *pb, Slapi_Entry *e, /* allocate new task now */ task = slapi_new_task(slapi_entry_get_ndn(e)); if (task == NULL) { - LDAPDebug(LDAP_DEBUG_ERR, "task_restore_add - Unable to allocate new task!\n", 0, 0, 0); + slapi_log_err(SLAPI_LOG_ERR, "task_restore_add", "Unable to allocate new task!\n"); *returncode = LDAP_OPERATIONS_ERROR; rv = SLAPI_DSE_CALLBACK_ERROR; goto out; @@ -1625,8 +1624,8 @@ static int task_restore_add(Slapi_PBlock *pb, Slapi_Entry *e, (void *)mypb, PR_PRIORITY_NORMAL, PR_GLOBAL_THREAD, PR_UNJOINABLE_THREAD, SLAPD_DEFAULT_THREAD_STACKSIZE); if (thread == NULL) { - LDAPDebug(LDAP_DEBUG_ERR, - "task_restore_add - Unable to create restore thread!\n", 0, 0, 0); + slapi_log_err(SLAPI_LOG_ERR, + "task_restore_add", "Unable to create restore thread!\n"); *returncode = LDAP_OPERATIONS_ERROR; rv = SLAPI_DSE_CALLBACK_ERROR; slapi_ch_free((void **)&mypb->pb_seq_val); @@ -1659,7 +1658,7 @@ static void task_index_thread(void *arg) if (rv != 0) { slapi_task_log_notice(task, "Index failed (error %d)", rv); slapi_task_log_status(task, "Index failed (error %d)", rv); - LDAPDebug(LDAP_DEBUG_ERR, "task_index_thread - Index failed (error %d)\n", rv, 0, 0); + slapi_log_err(SLAPI_LOG_ERR, "task_index_thread", "Index failed (error %d)\n", rv); } slapi_task_finish(task, rv); @@ -1698,14 +1697,14 @@ static int task_index_add(Slapi_PBlock *pb, Slapi_Entry *e, /* lookup the backend */ be = slapi_be_select_by_instance_name(instance_name); if (be == NULL) { - LDAPDebug(LDAP_DEBUG_ERR, "task_index_add - Can't import to nonexistent backend %s\n", - instance_name, 0, 0); + slapi_log_err(SLAPI_LOG_ERR, "task_index_add", "Can't import to nonexistent backend %s\n", + instance_name); *returncode = LDAP_NO_SUCH_OBJECT; return SLAPI_DSE_CALLBACK_ERROR; } if (be->be_database->plg_db2index == NULL) { - LDAPDebug(LDAP_DEBUG_ERR, "task_index_add - no db2index function defined for " - "backend %s\n", be->be_database->plg_name, 0, 0); + slapi_log_err(SLAPI_LOG_ERR, "task_index_add", "no db2index function defined for " + "backend %s\n", be->be_database->plg_name); *returncode = LDAP_UNWILLING_TO_PERFORM; return SLAPI_DSE_CALLBACK_ERROR; } @@ -1737,7 +1736,7 @@ static int task_index_add(Slapi_PBlock *pb, Slapi_Entry *e, } if (NULL == indexlist) { - LDAPDebug(LDAP_DEBUG_ERR, "task_index_add - No index is specified!\n", 0, 0, 0); + slapi_log_err(SLAPI_LOG_ERR, "task_index_add", "No index is specified!\n"); *returncode = LDAP_OPERATIONS_ERROR; rv = SLAPI_DSE_CALLBACK_OK; goto out; @@ -1746,7 +1745,7 @@ static int task_index_add(Slapi_PBlock *pb, Slapi_Entry *e, /* allocate new task now */ task = slapi_new_task(slapi_entry_get_ndn(e)); if (task == NULL) { - LDAPDebug(LDAP_DEBUG_ERR, "task_index_add - Unable to allocate new task!\n", 0, 0, 0); + slapi_log_err(SLAPI_LOG_ERR, "task_index_add", "Unable to allocate new task!\n"); *returncode = LDAP_OPERATIONS_ERROR; rv = SLAPI_DSE_CALLBACK_ERROR; goto out; @@ -1770,8 +1769,8 @@ static int task_index_add(Slapi_PBlock *pb, Slapi_Entry *e, (void *)mypb, PR_PRIORITY_NORMAL, PR_GLOBAL_THREAD, PR_UNJOINABLE_THREAD, SLAPD_DEFAULT_THREAD_STACKSIZE); if (thread == NULL) { - LDAPDebug(LDAP_DEBUG_ERR, - "task_index_add - Unable to create index thread!\n", 0, 0, 0); + slapi_log_err(SLAPI_LOG_ERR, + "task_index_add", "Unable to create index thread!\n"); rv = SLAPI_DSE_CALLBACK_ERROR; slapi_ch_free((void **)&mypb->pb_instance_name); slapi_pblock_destroy(mypb); @@ -1837,17 +1836,17 @@ task_upgradedb_add(Slapi_PBlock *pb, Slapi_Entry *e, Slapi_Entry *eAfter, } slapi_ch_free_string(&cookie); if (NULL == be) { - LDAPDebug(LDAP_DEBUG_ERR, - "task_upgradedb_add - No upgradedb is defined.\n", 0, 0, 0); + slapi_log_err(SLAPI_LOG_ERR, + "task_upgradedb_add", "No upgradedb is defined.\n"); *returncode = LDAP_UNWILLING_TO_PERFORM; rv = SLAPI_DSE_CALLBACK_ERROR; goto out; } if (NULL == be->be_database->plg_upgradedb || strcasecmp(database_type, be->be_database->plg_name)) { - LDAPDebug(LDAP_DEBUG_ERR, - "task_upgradedb_add - No upgradedb is defined in %s.\n", - be->be_database->plg_name, 0, 0); + slapi_log_err(SLAPI_LOG_ERR, + "task_upgradedb_add", "No upgradedb is defined in %s.\n", + be->be_database->plg_name); *returncode = LDAP_UNWILLING_TO_PERFORM; rv = SLAPI_DSE_CALLBACK_ERROR; goto out; @@ -1856,7 +1855,7 @@ task_upgradedb_add(Slapi_PBlock *pb, Slapi_Entry *e, Slapi_Entry *eAfter, /* allocate new task now */ task = slapi_new_task(slapi_entry_get_ndn(e)); if (task == NULL) { - LDAPDebug(LDAP_DEBUG_ERR, "task_upgradedb_add - Unable to allocate new task!\n", 0, 0, 0); + slapi_log_err(SLAPI_LOG_ERR, "task_upgradedb_add", "Unable to allocate new task!\n"); *returncode = LDAP_OPERATIONS_ERROR; rv = SLAPI_DSE_CALLBACK_ERROR; goto out; @@ -1933,7 +1932,7 @@ task_sysconfig_reload_add(Slapi_PBlock *pb, Slapi_Entry *e, Slapi_Entry *eAfter, *returncode = LDAP_OPERATIONS_ERROR; PR_snprintf (returntext, SLAPI_DSE_RETURNTEXT_SIZE, "missing required attribute \"%s\".", TASK_SYSCONFIG_FILE_ATTR); - LDAPDebug(LDAP_DEBUG_ERR, "task_sysconfig_reload_add - %s\n", returntext, 0, 0); + slapi_log_err(SLAPI_LOG_ERR, "task_sysconfig_reload_add", "Error: %s\n", returntext); rc = SLAPI_DSE_CALLBACK_ERROR; goto done; } @@ -1948,8 +1947,8 @@ task_sysconfig_reload_add(Slapi_PBlock *pb, Slapi_Entry *e, Slapi_Entry *eAfter, char *end_of_line = line + sizeof(line) - 1; if(logchanges){ - LDAPDebug(LDAP_DEBUG_INFO, "task_sysconfig_reload_add - processing file (%s)\n", - filename, 0 , 0); + slapi_log_err(SLAPI_LOG_INFO, "task_sysconfig_reload_add", "Processing file (%s)\n", + filename); } while ( fgets ( line, sizeof line, file ) != NULL ){ @@ -2060,14 +2059,14 @@ task_sysconfig_reload_add(Slapi_PBlock *pb, Slapi_Entry *e, Slapi_Entry *eAfter, /* Update the environment variable */ if(setenv(env_var, env_value, 1) != 0){ *returncode = LDAP_OPERATIONS_ERROR; - PR_snprintf (returntext, SLAPI_DSE_RETURNTEXT_SIZE,"failed to set (%s)", env_var); - LDAPDebug(LDAP_DEBUG_ERR, "task_sysconfig_reload_add - %s\n",returntext,0,0); + PR_snprintf (returntext, SLAPI_DSE_RETURNTEXT_SIZE,"Failed to set (%s)", env_var); + slapi_log_err(SLAPI_LOG_ERR, "task_sysconfig_reload_add", "%s\n",returntext); rc = SLAPI_DSE_CALLBACK_ERROR; break; } if(logchanges){ - LDAPDebug(LDAP_DEBUG_INFO, "task_sysconfig_reload_add - set (%s) to (%s)\n", - env_var, env_value , 0); + slapi_log_err(SLAPI_LOG_INFO, "task_sysconfig_reload_add", "Set (%s) to (%s)\n", + env_var, env_value); } } } @@ -2075,9 +2074,9 @@ task_sysconfig_reload_add(Slapi_PBlock *pb, Slapi_Entry *e, Slapi_Entry *eAfter, fclose ( file ); } else { *returncode = LDAP_OPERATIONS_ERROR; - PR_snprintf (returntext, SLAPI_DSE_RETURNTEXT_SIZE,"failed to open file \"%s\" (%s)", + PR_snprintf (returntext, SLAPI_DSE_RETURNTEXT_SIZE,"Failed to open file \"%s\" (%s)", filename, strerror(errno)); - LDAPDebug(LDAP_DEBUG_ERR, "task_sysconfig_reload_add - %s\n", returntext, 0, 0); + slapi_log_err(SLAPI_LOG_ERR, "task_sysconfig_reload_add", "%s\n", returntext); rc = SLAPI_DSE_CALLBACK_ERROR; } @@ -2101,8 +2100,8 @@ fixup_tombstone(Slapi_PBlock *pb, char *suffix, Slapi_Entry *e, int *fixup_count int rc = LDAP_SUCCESS; if((tombstone_csn = entry_get_deletion_csn(e))){ - slapi_log_error(SLAPI_LOG_REPL, TASK_TOMBSTONE_FIXUP, - "Fixing tombstone (%s)\n", slapi_entry_get_dn(e)); + slapi_log_err(SLAPI_LOG_REPL, TASK_TOMBSTONE_FIXUP, + "Fixing tombstone: (%s)\n", slapi_entry_get_dn(e)); /* We have an entry tombstone that needs fixing */ slapi_pblock_init(pb); @@ -2143,7 +2142,7 @@ strip_tombstone(Slapi_PBlock *pb, char *suffix, Slapi_Entry *e, int *strip_count LDAPMod *mods[2]; int rc = 0; - slapi_log_error(SLAPI_LOG_REPL, TASK_TOMBSTONE_FIXUP, + slapi_log_err(SLAPI_LOG_REPL, TASK_TOMBSTONE_FIXUP, "Stripping tombstone (%s)\n", slapi_entry_get_dn(e)); /* We have an entry tombstone that needs stripping */ @@ -2166,7 +2165,7 @@ strip_tombstone(Slapi_PBlock *pb, char *suffix, Slapi_Entry *e, int *strip_count if(rc == LDAP_SUCCESS){ (*strip_count)++; } else { - slapi_log_error(SLAPI_LOG_REPL, TASK_TOMBSTONE_FIXUP, + slapi_log_err(SLAPI_LOG_REPL, TASK_TOMBSTONE_FIXUP, "Stripping tombstone (%s) failed, error %d\n", slapi_entry_get_dn(e), rc); } } @@ -2196,12 +2195,12 @@ task_fixup_tombstone_thread(void *arg) return; /* no task */ } slapi_task_inc_refcount(task); - slapi_log_error(SLAPI_LOG_PLUGIN, TASK_TOMBSTONE_FIXUP, - "fixup_tombstone_task_thread --> refcount incremented.\n" ); + slapi_log_err(SLAPI_LOG_PLUGIN, TASK_TOMBSTONE_FIXUP, + "fixup_tombstone_task_thread: refcount incremented.\n" ); slapi_task_begin(task, 1); slapi_task_log_notice(task, "Beginning tombstone fixup task...\n"); - slapi_log_error(SLAPI_LOG_REPL, TASK_TOMBSTONE_FIXUP, - "Beginning tombstone fixup task...\n"); + slapi_log_err(SLAPI_LOG_REPL, TASK_TOMBSTONE_FIXUP, + "fixup_tombstone_task_thread: Beginning tombstone fixup task...\n"); if(task_data->stripcsn){ /* find tombstones with nsTombstoneCSN */ @@ -2230,8 +2229,8 @@ task_fixup_tombstone_thread(void *arg) if (rc != LDAP_SUCCESS) { slapi_task_log_notice(task, "Failed to search backend for tombstones, error %d\n", rc); - slapi_log_error(SLAPI_LOG_REPL, TASK_TOMBSTONE_FIXUP, - "Failed to search backend for tombstones, error %d\n", rc); + slapi_log_err(SLAPI_LOG_REPL, TASK_TOMBSTONE_FIXUP, + "fixup_tombstone_task_thread: Failed to search backend for tombstones, error %d\n", rc); slapi_pblock_destroy(search_pb); goto bail; } @@ -2250,8 +2249,8 @@ task_fixup_tombstone_thread(void *arg) slapi_task_log_notice(task, "Failed to update tombstone entry (%s) error %d\n", slapi_entry_get_dn(entries[j]), rc); - slapi_log_error(SLAPI_LOG_ERR, TASK_TOMBSTONE_FIXUP, - "Failed to update tombstone entry (%s) error %d\n", + slapi_log_err(SLAPI_LOG_ERR, TASK_TOMBSTONE_FIXUP, + "fixup_tombstone_task_thread: Failed to update tombstone entry (%s) error %d\n", slapi_entry_get_dn(entries[j]), rc); } } @@ -2263,14 +2262,14 @@ task_fixup_tombstone_thread(void *arg) } slapi_task_log_notice(task, "%s %d tombstones.\n", task_data->stripcsn ? "Stripped" : "Fixed", fixup_count); - slapi_log_error(SLAPI_LOG_REPL, TASK_TOMBSTONE_FIXUP, "%s %d tombstones.\n", + slapi_log_err(SLAPI_LOG_REPL, TASK_TOMBSTONE_FIXUP, "fixup_tombstone_task_thread: %s %d tombstones.\n", task_data->stripcsn ? "Stripped" : "Fixed", fixup_count); slapi_task_inc_progress(task); bail: slapi_task_finish(task, rc); slapi_task_dec_refcount(task); - slapi_log_error(SLAPI_LOG_PLUGIN, TASK_TOMBSTONE_FIXUP, - "fixup_tombstone_task_thread <-- refcount decremented.\n" ); + slapi_log_err(SLAPI_LOG_PLUGIN, TASK_TOMBSTONE_FIXUP, + "fixup_tombstone_task_thread: refcount decremented.\n" ); } @@ -2391,8 +2390,8 @@ task_fixup_tombstones_add(Slapi_PBlock *pb, Slapi_Entry *e, Slapi_Entry *eAfter, (void *)task_data, PR_PRIORITY_NORMAL, PR_GLOBAL_THREAD, PR_UNJOINABLE_THREAD, SLAPD_DEFAULT_THREAD_STACKSIZE); if (thread == NULL) { - LDAPDebug(LDAP_DEBUG_ERR, - "task_fixup_tombstones_add - Unable to create index thread!\n", 0, 0, 0); + slapi_log_err(SLAPI_LOG_ERR, + "task_fixup_tombstones_add", "Unable to create index thread!\n"); *returncode = LDAP_OPERATIONS_ERROR; slapi_task_finish(task, *returncode); slapi_ch_array_free(base); @@ -2414,7 +2413,7 @@ done: static void fixup_tombstone_task_destructor(Slapi_Task *task) { - slapi_log_error(SLAPI_LOG_PLUGIN, TASK_TOMBSTONE_FIXUP, + slapi_log_err(SLAPI_LOG_PLUGIN, TASK_TOMBSTONE_FIXUP, "fixup_tombstone_task_destructor -->\n" ); if (task) { struct task_tombstone_data *mydata = (struct task_tombstone_data *)slapi_task_get_data(task); @@ -2427,7 +2426,7 @@ fixup_tombstone_task_destructor(Slapi_Task *task) slapi_ch_free((void **)&mydata); } } - slapi_log_error(SLAPI_LOG_PLUGIN, TASK_TOMBSTONE_FIXUP, + slapi_log_err(SLAPI_LOG_PLUGIN, TASK_TOMBSTONE_FIXUP, "fixup_tombstone_task_destructor <--\n" ); } @@ -2505,7 +2504,7 @@ task_des2aes(Slapi_PBlock *pb, Slapi_Entry *e, Slapi_Entry *eAfter, if (thread == NULL) { PR_snprintf(returntext, SLAPI_DSE_RETURNTEXT_SIZE, "unable to create des2aes thread!\n"); - slapi_log_error(SLAPI_LOG_ERR, TASK_DES2AES, + slapi_log_err(SLAPI_LOG_ERR, TASK_DES2AES, "Unable to create des2aes thread!\n"); *returncode = LDAP_OPERATIONS_ERROR; slapi_task_finish(task, *returncode); @@ -2578,7 +2577,7 @@ task_des2aes_thread(void *arg) struct suffixlist *list; char *cookie = NULL; - slapi_log_error(SLAPI_LOG_INFO, TASK_DES2AES, + slapi_log_err(SLAPI_LOG_INFO, TASK_DES2AES, "Checking for DES passwords to convert to AES...\n"); slapi_task_log_notice(task, "Checking for DES passwords to convert to AES...\n"); @@ -2622,7 +2621,7 @@ task_des2aes_thread(void *arg) slapi_search_internal_pb(pb); slapi_pblock_get(pb, SLAPI_PLUGIN_INTOP_RESULT, &result); if (LDAP_SUCCESS != result) { - slapi_log_error(SLAPI_LOG_ERR, TASK_DES2AES, + slapi_log_err(SLAPI_LOG_ERR, TASK_DES2AES, "Failed to search for password attribute (%s) error (%d), skipping suffix (%s)\n", attrs[i], result, backends[be_idx]); slapi_task_log_notice(task, @@ -2649,7 +2648,7 @@ task_des2aes_thread(void *arg) /* Decode the DES password */ if(pw_rever_decode(val, &passwd, attrs[i]) == -1){ - slapi_log_error(SLAPI_LOG_ERR, TASK_DES2AES, + slapi_log_err(SLAPI_LOG_ERR, TASK_DES2AES, "Failed to decode existing DES password for (%s)\n", slapi_entry_get_dn(entries[ii])); slapi_task_log_notice(task, @@ -2662,7 +2661,7 @@ task_des2aes_thread(void *arg) /* Encode the password */ sval = slapi_value_new_string(passwd); if(pw_rever_encode(&sval, attrs[i]) == -1){ - slapi_log_error(SLAPI_LOG_ERR, TASK_DES2AES, + slapi_log_err(SLAPI_LOG_ERR, TASK_DES2AES, "Failed to encode AES password for (%s)\n", slapi_entry_get_dn(entries[ii])); slapi_task_log_notice(task, @@ -2690,7 +2689,7 @@ task_des2aes_thread(void *arg) slapi_pblock_get(pb, SLAPI_PLUGIN_INTOP_RESULT, &result); if (LDAP_SUCCESS != result) { - slapi_log_error(SLAPI_LOG_ERR, TASK_DES2AES, + slapi_log_err(SLAPI_LOG_ERR, TASK_DES2AES, "Failed to convert password for (%s) error (%d)\n", slapi_entry_get_dn(entries[ii]), result); slapi_task_log_notice(task, @@ -2698,7 +2697,7 @@ task_des2aes_thread(void *arg) slapi_entry_get_dn(entries[ii]), result); rc = 1; } else { - slapi_log_error(SLAPI_LOG_ERR, TASK_DES2AES, + slapi_log_err(SLAPI_LOG_ERR, TASK_DES2AES, "Successfully converted password for (%s)\n", slapi_entry_get_dn(entries[ii])); slapi_task_log_notice(task, @@ -2720,23 +2719,23 @@ task_des2aes_thread(void *arg) slapi_ch_free_string(&filter); } if (!converted_des_passwd){ - slapi_log_error(SLAPI_LOG_INFO, TASK_DES2AES, + slapi_log_err(SLAPI_LOG_INFO, TASK_DES2AES, "No DES passwords found to convert.\n"); slapi_task_log_notice(task, "No DES passwords found to convert.\n"); } } else { /* No AES/DES */ if (!have_des){ - slapi_log_error(SLAPI_LOG_ERR, TASK_DES2AES, + slapi_log_err(SLAPI_LOG_ERR, TASK_DES2AES, "DES plugin not enabled\n"); slapi_task_log_notice(task, "DES plugin not enabled\n"); } if (!have_aes){ - slapi_log_error(SLAPI_LOG_ERR, TASK_DES2AES, + slapi_log_err(SLAPI_LOG_ERR, TASK_DES2AES, "AES plugin not enabled\n"); slapi_task_log_notice(task, "AES plugin not enabled\n"); } - slapi_log_error(SLAPI_LOG_ERR, TASK_DES2AES, + slapi_log_err(SLAPI_LOG_ERR, TASK_DES2AES, "Unable to convert passwords\n"); slapi_task_log_notice(task, "Unable to convert passwords\n"); rc = 1; @@ -2753,7 +2752,7 @@ done: static void des2aes_task_destructor(Slapi_Task *task) { - slapi_log_error(SLAPI_LOG_TRACE, TASK_DES2AES, + slapi_log_err(SLAPI_LOG_TRACE, TASK_DES2AES, "des2aes_task_destructor -->\n" ); if (task) { struct task_des2aes_data *task_data = (struct task_des2aes_data *)slapi_task_get_data(task); @@ -2766,7 +2765,7 @@ des2aes_task_destructor(Slapi_Task *task) slapi_ch_free((void **)&task_data); } } - slapi_log_error(SLAPI_LOG_TRACE, TASK_DES2AES, + slapi_log_err(SLAPI_LOG_TRACE, TASK_DES2AES, "des2aes_task_destructor <--\n" ); } @@ -2787,15 +2786,15 @@ void task_cleanup(void) slapi_search_internal_pb(pb); slapi_pblock_get(pb, SLAPI_PLUGIN_INTOP_RESULT, &ret); if (ret != LDAP_SUCCESS) { - LDAPDebug(LDAP_DEBUG_WARNING, "task_cleanup - Failed to search for %s - error %d\n", - TASK_BASE_DN, ret, 0); + slapi_log_err(SLAPI_LOG_WARNING, "task_cleanup", "Failed to search for %s - error %d\n", + TASK_BASE_DN, ret); slapi_pblock_destroy(pb); return; } slapi_pblock_get(pb, SLAPI_PLUGIN_INTOP_SEARCH_ENTRIES, &entries); if (NULL == entries) { - LDAPDebug(LDAP_DEBUG_WARNING, "task_cleanup - Entire cn=tasks tree is empty.\n", 0, 0, 0); + slapi_log_err(SLAPI_LOG_WARNING, "task_cleanup", "Entire cn=tasks tree is empty.\n"); slapi_pblock_destroy(pb); return; } @@ -2837,8 +2836,7 @@ void task_init(void) { global_task_lock = PR_NewLock(); if (global_task_lock == NULL) { - LDAPDebug(LDAP_DEBUG_ERR, "task_init - Unable to create global tasks lock!\n", - 0, 0, 0); + slapi_log_err(SLAPI_LOG_ERR, "task_init", "Unable to create global tasks lock!\n"); return; } @@ -2867,8 +2865,8 @@ void task_shutdown(void) (task->task_state != SLAPI_TASK_FINISHED)) { task->task_state = SLAPI_TASK_CANCELLED; if (task->cancel) { - LDAPDebug(LDAP_DEBUG_INFO, "task_shutdown - Cancelling task '%s'\n", - task->task_dn, 0, 0); + slapi_log_err(SLAPI_LOG_INFO, "task_shutdown", "Cancelling task '%s'\n", + task->task_dn); (*task->cancel)(task); found_any = 1; } diff --git a/ldap/servers/slapd/test-plugins/README b/ldap/servers/slapd/test-plugins/README index ba40d43..a11d092 100644 --- a/ldap/servers/slapd/test-plugins/README +++ b/ldap/servers/slapd/test-plugins/README @@ -102,7 +102,7 @@ Server plug-ins are built as libraries available to the server. if (error) { - slapi_log_error(); + slapi_log_err(); return error_code; } else return 0; diff --git a/ldap/servers/slapd/test-plugins/sampletask.c b/ldap/servers/slapd/test-plugins/sampletask.c index a618b1e..0551bb0 100644 --- a/ldap/servers/slapd/test-plugins/sampletask.c +++ b/ldap/servers/slapd/test-plugins/sampletask.c @@ -101,7 +101,7 @@ task_sampletask_thread(void *arg) /* update task state to show it's running */ slapi_task_begin(task, total_work); slapi_task_log_notice(task, "Sample task starts (arg: %s) ...\n", myarg); - slapi_log_error(SLAPI_LOG_ERR, "sampletask", "Sample task starts (arg: %s) ...\n", myarg); + slapi_log_err(SLAPI_LOG_ERR, "sampletask", "Sample task starts (arg: %s) ...\n", myarg); /* real work would be done here */ for (i = 0; i < total_work; i++) { @@ -112,7 +112,7 @@ task_sampletask_thread(void *arg) /* update task state to say we're finished */ slapi_task_log_notice(task, "Sample task finished."); slapi_task_log_status(task, "Sample task finished."); - slapi_log_error(SLAPI_LOG_ERR, "sampletask", "Sample task finished.\n"); + slapi_log_err(SLAPI_LOG_ERR, "sampletask", "Sample task finished.\n"); /* this will queue the destruction of the task */ slapi_task_finish(task, rv); @@ -179,7 +179,7 @@ task_sampletask_add(Slapi_PBlock *pb, Slapi_Entry *e, /* allocate new task now */ task = slapi_new_task(slapi_entry_get_ndn(e)); if (task == NULL) { - slapi_log_error(SLAPI_LOG_ERR, "sampletask", "unable to allocate new task!\n"); + slapi_log_err(SLAPI_LOG_ERR, "sampletask", "unable to allocate new task!\n"); *returncode = LDAP_OPERATIONS_ERROR; rv = SLAPI_DSE_CALLBACK_ERROR; goto out; @@ -196,7 +196,7 @@ task_sampletask_add(Slapi_PBlock *pb, Slapi_Entry *e, (void *)task, PR_PRIORITY_NORMAL, PR_GLOBAL_THREAD, PR_UNJOINABLE_THREAD, SLAPD_DEFAULT_THREAD_STACKSIZE); if (thread == NULL) { - slapi_log_error(SLAPI_LOG_ERR, "sampletask", + slapi_log_err(SLAPI_LOG_ERR, "sampletask", "unable to create sample task thread!\n"); *returncode = LDAP_OPERATIONS_ERROR; rv = SLAPI_DSE_CALLBACK_ERROR; diff --git a/ldap/servers/slapd/test-plugins/testbind.c b/ldap/servers/slapd/test-plugins/testbind.c index 928ab71..16c2551 100644 --- a/ldap/servers/slapd/test-plugins/testbind.c +++ b/ldap/servers/slapd/test-plugins/testbind.c @@ -66,7 +66,7 @@ test_bind( Slapi_PBlock *pb ) Slapi_Attr *attr = NULL; /* Log a message to the server error log. */ - slapi_log_error(SLAPI_LOG_PLUGIN, "test_bind", + slapi_log_err(SLAPI_LOG_PLUGIN, "test_bind", "Pre-operation bind function called.\n" ); /* Gets parameters available when processing an LDAP bind @@ -75,7 +75,7 @@ test_bind( Slapi_PBlock *pb ) slapi_pblock_get( pb, SLAPI_BIND_METHOD, &method ) != 0 || slapi_pblock_get( pb, SLAPI_BIND_CREDENTIALS, &credentials ) != 0 ) { - slapi_log_error(SLAPI_LOG_PLUGIN, "test_bind", + slapi_log_err(SLAPI_LOG_PLUGIN, "test_bind", "Could not get parameters for bind operation\n" ); slapi_send_ldap_result( pb, LDAP_OPERATIONS_ERROR, NULL, NULL, 0, NULL ); @@ -92,7 +92,7 @@ test_bind( Slapi_PBlock *pb ) slapi_sdn_free( &sdn ); if ( rc != LDAP_SUCCESS ) { - slapi_log_error(SLAPI_LOG_PLUGIN, "test_bind", + slapi_log_err(SLAPI_LOG_PLUGIN, "test_bind", "Could not find entry %s (error %d)\n", dn, rc ); break; @@ -108,7 +108,7 @@ test_bind( Slapi_PBlock *pb ) if ( slapi_entry_attr_find( e, SLAPI_USERPWD_ATTR, &attr ) != 0 || slapi_attr_get_numvalues( attr, &valcount ) != 0 ) { - slapi_log_error(SLAPI_LOG_PLUGIN, "test_bind", + slapi_log_err(SLAPI_LOG_PLUGIN, "test_bind", "Entry has no %s attribute values\n", SLAPI_USERPWD_ATTR ); rc = LDAP_INAPPROPRIATE_AUTH; @@ -126,7 +126,7 @@ test_bind( Slapi_PBlock *pb ) } if ( slapi_pw_find_sv( pwvals, credval ) != 0 ) { - slapi_log_error(SLAPI_LOG_PLUGIN, "test_bind", + slapi_log_err(SLAPI_LOG_PLUGIN, "test_bind", "Credentials are not correct\n" ); rc = LDAP_INVALID_CREDENTIALS; } @@ -140,7 +140,7 @@ test_bind( Slapi_PBlock *pb ) } else { /* This should not happen. The previous section of code already checks for this case. */ - slapi_log_error(SLAPI_LOG_PLUGIN, "test_bind", + slapi_log_err(SLAPI_LOG_PLUGIN, "test_bind", "Could find entry for %s\n", dn ); rc = LDAP_NO_SUCH_OBJECT; break; @@ -152,14 +152,14 @@ test_bind( Slapi_PBlock *pb ) slapi_pblock_set( pb, SLAPI_CONN_AUTHMETHOD, SLAPD_AUTH_SIMPLE ) != 0 ) { - slapi_log_error(SLAPI_LOG_PLUGIN, "test_bind", + slapi_log_err(SLAPI_LOG_PLUGIN, "test_bind", "Failed to set DN and method for connection\n" ); rc = LDAP_OPERATIONS_ERROR; break; } /* Send a "success" result code back to the client. */ - slapi_log_error(SLAPI_LOG_PLUGIN, "test_bind", + slapi_log_err(SLAPI_LOG_PLUGIN, "test_bind", "Authenticated: %s\n", dn ); rc = LDAP_SUCCESS; break; @@ -172,7 +172,7 @@ test_bind( Slapi_PBlock *pb ) 1. */ case LDAP_AUTH_NONE: - slapi_log_error(SLAPI_LOG_PLUGIN, "test_bind", + slapi_log_err(SLAPI_LOG_PLUGIN, "test_bind", "Authenticating anonymously\n" ); rc = LDAP_SUCCESS; break; @@ -180,7 +180,7 @@ test_bind( Slapi_PBlock *pb ) /* This plug-in does not support any other method of authentication */ case LDAP_AUTH_SASL: default: - slapi_log_error(SLAPI_LOG_PLUGIN, "test_bind", + slapi_log_err(SLAPI_LOG_PLUGIN, "test_bind", "Unsupported authentication method requested: %d\n", method ); rc = LDAP_AUTH_METHOD_NOT_SUPPORTED; @@ -199,7 +199,7 @@ test_search( Slapi_PBlock *pb ) char *reqdn; /* Log a message to the server error log. */ - slapi_log_error(SLAPI_LOG_PLUGIN, "test_search", + slapi_log_err(SLAPI_LOG_PLUGIN, "test_search", "Pre-operation search function called.\n" ); /* Get requestor of search operation. This is not critical @@ -208,17 +208,17 @@ test_search( Slapi_PBlock *pb ) if this fails. */ if ( slapi_pblock_get( pb, SLAPI_REQUESTOR_DN, &reqdn ) != 0 ) { - slapi_log_error(SLAPI_LOG_PLUGIN, "test_search", + slapi_log_err(SLAPI_LOG_PLUGIN, "test_search", "Could not get requestor parameter for search operation\n" ); return( 0 ); } /* Indicate who is requesting the search */ if ( reqdn != NULL && *reqdn != '\0' ) { - slapi_log_error(SLAPI_LOG_PLUGIN, "test_search", + slapi_log_err(SLAPI_LOG_PLUGIN, "test_search", "Search requested by %s\n", reqdn ); } else { - slapi_log_error(SLAPI_LOG_PLUGIN, "test_search", + slapi_log_err(SLAPI_LOG_PLUGIN, "test_search", "Search requested by anonymous client\n" ); } return( 0 ); @@ -232,7 +232,7 @@ testbind_init( Slapi_PBlock *pb ) /* Retrieve and save the plugin identity to later pass to internal operations */ if ( slapi_pblock_get( pb, SLAPI_PLUGIN_IDENTITY, &plugin_id ) != 0 ) { - slapi_log_error(SLAPI_LOG_PLUGIN, "testbind_init", + slapi_log_err(SLAPI_LOG_PLUGIN, "testbind_init", "Failed to retrieve SLAPI_PLUGIN_IDENTITY\n" ); return( -1 ); } @@ -248,7 +248,7 @@ testbind_init( Slapi_PBlock *pb ) slapi_pblock_set( pb, SLAPI_PLUGIN_PRE_SEARCH_FN, (void *) test_search ) != 0 ) { - slapi_log_error(SLAPI_LOG_PLUGIN, "testbind_init", + slapi_log_err(SLAPI_LOG_PLUGIN, "testbind_init", "Failed to set version and functions\n" ); return( -1 ); } diff --git a/ldap/servers/slapd/test-plugins/testdatainterop.c b/ldap/servers/slapd/test-plugins/testdatainterop.c index 63c0f8c..836742c 100644 --- a/ldap/servers/slapd/test-plugins/testdatainterop.c +++ b/ldap/servers/slapd/test-plugins/testdatainterop.c @@ -115,11 +115,11 @@ nullsuffix_init( Slapi_PBlock *pb ) { int i; - slapi_log_error(SLAPI_LOG_PLUGIN, PLUGIN_NAME, "nullsuffix_init\n" ); + slapi_log_err(SLAPI_LOG_PLUGIN, PLUGIN_NAME, "nullsuffix_init\n" ); /* retrieve plugin identity to later pass to internal operations */ if ( slapi_pblock_get( pb, SLAPI_PLUGIN_IDENTITY, &plugin_id ) != 0 ) { - slapi_log_error(SLAPI_LOG_PLUGIN, PLUGIN_NAME, + slapi_log_err(SLAPI_LOG_PLUGIN, PLUGIN_NAME, "unable to get SLAPI_PLUGIN_IDENTITY\n" ); return -1; } @@ -143,7 +143,7 @@ nullsuffix_init( Slapi_PBlock *pb ) (void *)nullsuffix_bind) != 0 || slapi_pblock_set( pb, SLAPI_PLUGIN_PRE_MODRDN_FN, (void *)nullsuffix_modrdn) != 0) { - slapi_log_error(SLAPI_LOG_PLUGIN, PLUGIN_NAME, + slapi_log_err(SLAPI_LOG_PLUGIN, PLUGIN_NAME, "failed to set version and function\n" ); return -1; } @@ -159,7 +159,7 @@ nullsuffix_bind( Slapi_PBlock *pb ) if( slapi_op_reserved(pb) ){ return PLUGIN_OPERATION_IGNORED; } - slapi_log_error(SLAPI_LOG_PLUGIN, PLUGIN_NAME, "nullsuffix_bind\n" ); + slapi_log_err(SLAPI_LOG_PLUGIN, PLUGIN_NAME, "nullsuffix_bind\n" ); send_ldap_result( pb, LDAP_SUCCESS, NULL, NULL, 0, NULL ); return PLUGIN_OPERATION_HANDLED; @@ -172,7 +172,7 @@ nullsuffix_add( Slapi_PBlock *pb ) if( slapi_op_reserved(pb) ){ return PLUGIN_OPERATION_IGNORED; } - slapi_log_error(SLAPI_LOG_PLUGIN, PLUGIN_NAME, "nullsuffix_add\n" ); + slapi_log_err(SLAPI_LOG_PLUGIN, PLUGIN_NAME, "nullsuffix_add\n" ); slapi_pblock_get( pb, SLAPI_ADD_TARGET, &dn ); db_put_dn(dn); send_ldap_result( pb, LDAP_SUCCESS, NULL, NULL, 0, NULL ); @@ -193,7 +193,7 @@ nullsuffix_modify( Slapi_PBlock *pb ) slapi_pblock_get( pb, SLAPI_ENTRY_PRE_OP, &entry); db_put_dn(dn); send_ldap_result( pb, LDAP_SUCCESS, NULL, NULL, 0, NULL ); - slapi_log_error(SLAPI_LOG_PLUGIN, PLUGIN_NAME, "nullsuffix_modify\n" ); + slapi_log_err(SLAPI_LOG_PLUGIN, PLUGIN_NAME, "nullsuffix_modify\n" ); return PLUGIN_OPERATION_HANDLED; } @@ -204,7 +204,7 @@ nullsuffix_delete( Slapi_PBlock *pb ) if( slapi_op_reserved(pb) ){ return PLUGIN_OPERATION_IGNORED; } - slapi_log_error(SLAPI_LOG_PLUGIN, PLUGIN_NAME, "nullsuffix_delete\n" ); + slapi_log_err(SLAPI_LOG_PLUGIN, PLUGIN_NAME, "nullsuffix_delete\n" ); send_ldap_result( pb, LDAP_SUCCESS, NULL, NULL, 0, NULL ); return PLUGIN_OPERATION_HANDLED; } @@ -215,7 +215,7 @@ nullsuffix_modrdn( Slapi_PBlock *pb ) if( slapi_op_reserved(pb) ){ return PLUGIN_OPERATION_IGNORED; } - slapi_log_error(SLAPI_LOG_PLUGIN, PLUGIN_NAME, "nullsuffix_modrdn\n" ); + slapi_log_err(SLAPI_LOG_PLUGIN, PLUGIN_NAME, "nullsuffix_modrdn\n" ); send_ldap_result( pb, LDAP_SUCCESS, NULL, NULL, 0, NULL ); return PLUGIN_OPERATION_HANDLED; } @@ -244,7 +244,7 @@ nullsuffix_search( Slapi_PBlock *pb ) "uid:jsmith\n" "mail:jsmith@example.com\n"; - slapi_log_error(SLAPI_LOG_PLUGIN, PLUGIN_NAME, "nullsuffix_search\n" ); + slapi_log_err(SLAPI_LOG_PLUGIN, PLUGIN_NAME, "nullsuffix_search\n" ); if( slapi_op_reserved(pb) ){ return PLUGIN_OPERATION_IGNORED; } @@ -252,7 +252,7 @@ nullsuffix_search( Slapi_PBlock *pb ) /* get essential search parameters */ if ( slapi_pblock_get( pb, SLAPI_SEARCH_TARGET, &dn_base ) != 0 || slapi_pblock_get( pb, SLAPI_SEARCH_SCOPE, &scope ) != 0 ) { - slapi_log_error(SLAPI_LOG_PLUGIN, PLUGIN_NAME, + slapi_log_err(SLAPI_LOG_PLUGIN, PLUGIN_NAME, "could not get base DN and scope search parameters\n" ); } if ( dn_base == NULL ) { @@ -268,12 +268,12 @@ nullsuffix_search( Slapi_PBlock *pb ) slapi_pblock_get( pb, SLAPI_SEARCH_FILTER, &filter ) != 0 || slapi_pblock_get( pb, SLAPI_SEARCH_ATTRS, &attrs ) != 0 || slapi_pblock_get( pb, SLAPI_SEARCH_ATTRSONLY, &attrsonly ) != 0 ) { - slapi_log_error(SLAPI_LOG_PLUGIN, PLUGIN_NAME, + slapi_log_err(SLAPI_LOG_PLUGIN, PLUGIN_NAME, "could not get remaining search parameters\n" ); } if ( slapi_pblock_get( pb, SLAPI_OPERATION, &op ) != 0 ) { - slapi_log_error(SLAPI_LOG_PLUGIN, PLUGIN_NAME, + slapi_log_err(SLAPI_LOG_PLUGIN, PLUGIN_NAME, "could not get operation\n" ); } else { slapi_operation_set_flag(op, SLAPI_OP_FLAG_NO_ACCESS_CHECK ); @@ -284,7 +284,7 @@ nullsuffix_search( Slapi_PBlock *pb ) if ( NULL == ( e = slapi_str2entry( newStr, SLAPI_STR2ENTRY_ADDRDNVALS | SLAPI_STR2ENTRY_EXPAND_OBJECTCLASSES ))) { - slapi_log_error(SLAPI_LOG_PLUGIN, PLUGIN_NAME, + slapi_log_err(SLAPI_LOG_PLUGIN, PLUGIN_NAME, "nullsuffix_search: slapi_str2entry() failed\n" ); } else { slapi_send_ldap_search_entry( pb, e, NULL /* controls */, @@ -295,7 +295,7 @@ nullsuffix_search( Slapi_PBlock *pb ) slapi_send_ldap_result( pb, ldaperr, NULL, "kilroy was here", nentries, NULL ); - slapi_log_error(SLAPI_LOG_PLUGIN, PLUGIN_NAME, "nullsuffix_search:" + slapi_log_err(SLAPI_LOG_PLUGIN, PLUGIN_NAME, "nullsuffix_search:" " handled search based at %s with scope %d; ldaperr=%d\n", dn_base, scope, ldaperr ); @@ -312,6 +312,6 @@ nullsuffix_search( Slapi_PBlock *pb ) static int nullsuffix_close( Slapi_PBlock *pb ) { - slapi_log_error(SLAPI_LOG_PLUGIN, PLUGIN_NAME, "nullsuffix_close\n" ); + slapi_log_err(SLAPI_LOG_PLUGIN, PLUGIN_NAME, "nullsuffix_close\n" ); return 0; } diff --git a/ldap/servers/slapd/test-plugins/testdbinterop.c b/ldap/servers/slapd/test-plugins/testdbinterop.c index be49ded..04b0b9d 100644 --- a/ldap/servers/slapd/test-plugins/testdbinterop.c +++ b/ldap/servers/slapd/test-plugins/testdbinterop.c @@ -55,7 +55,7 @@ void make_key(DBT *key) unsigned int seed = (unsigned int)time( (time_t*) 0); long int key_long = slapi_rand_r(&seed) % number_of_keys; sprintf(key_string,"key%ld",key_long); - slapi_log_error(SLAPI_LOG_PLUGIN, DB_PLUGIN_NAME,"generated key: %s\n", key_string); + slapi_log_err(SLAPI_LOG_PLUGIN, DB_PLUGIN_NAME,"generated key: %s\n", key_string); key->size = strlen(key_string); } @@ -91,10 +91,10 @@ db_put_dn(char *data_dn) switch (ret = dbp->put(dbp, NULL, &key, &data, DB_NOOVERWRITE)) { case 0: - slapi_log_error(SLAPI_LOG_PLUGIN, DB_PLUGIN_NAME, "db: %s: key stored.\n", (char *)key.data); + slapi_log_err(SLAPI_LOG_PLUGIN, DB_PLUGIN_NAME, "db: %s: key stored.\n", (char *)key.data); break; case DB_KEYEXIST: - slapi_log_error(SLAPI_LOG_PLUGIN, DB_PLUGIN_NAME, "db: %s: key previously stored.\n", + slapi_log_err(SLAPI_LOG_PLUGIN, DB_PLUGIN_NAME, "db: %s: key previously stored.\n", (char *)key.data); break; default: @@ -104,7 +104,7 @@ db_put_dn(char *data_dn) err: if(ret){ - slapi_log_error(SLAPI_LOG_PLUGIN, DB_PLUGIN_NAME, "db: Error detected in db_put \n"); + slapi_log_err(SLAPI_LOG_PLUGIN, DB_PLUGIN_NAME, "db: Error detected in db_put \n"); } free(key.data); if (dbp){ @@ -151,7 +151,7 @@ db_put_dn(char *data_dn) /* open a file */ if ((prfd = PR_Open(db_path, PR_RDWR | PR_CREATE_FILE | PR_APPEND, 0600)) == NULL ) { - slapi_log_error(SLAPI_LOG_ERR, DB_PLUGIN_NAME, + slapi_log_err(SLAPI_LOG_ERR, DB_PLUGIN_NAME, "db: Could not open file \"%s\" for read/write; %d (%s)\n", db_path, PR_GetError(), slapd_pr_strerror(PR_GetError())); return; @@ -162,17 +162,17 @@ db_put_dn(char *data_dn) ret = PR_Write(prfd, data_dnp, data_sz); if (ret == data_sz) { - slapi_log_error(SLAPI_LOG_PLUGIN, DB_PLUGIN_NAME, + slapi_log_err(SLAPI_LOG_PLUGIN, DB_PLUGIN_NAME, "db: %s: key stored.\n", data_dn); ret = 0; } else { - slapi_log_error(SLAPI_LOG_ERR, DB_PLUGIN_NAME, + slapi_log_err(SLAPI_LOG_ERR, DB_PLUGIN_NAME, "db: Failed to store key \"%s\"; %d (%s)\n", data_dn, PR_GetError(), slapd_pr_strerror(PR_GetError())); ret = 1; } if(ret) { - slapi_log_error(SLAPI_LOG_ERR, DB_PLUGIN_NAME, + slapi_log_err(SLAPI_LOG_ERR, DB_PLUGIN_NAME, "db: Error detected in db_put_dn \n"); } slapi_ch_free_string(&data_dnp); diff --git a/ldap/servers/slapd/test-plugins/testentry.c b/ldap/servers/slapd/test-plugins/testentry.c index 588ff9b..6eb0ddb 100644 --- a/ldap/servers/slapd/test-plugins/testentry.c +++ b/ldap/servers/slapd/test-plugins/testentry.c @@ -77,7 +77,7 @@ testentry_scramble( char **entry, unsigned long *len ) /* Log an entry to the server's error log file whenever this function is called. */ - slapi_log_error(SLAPI_LOG_PLUGIN, "testentry_scramble", + slapi_log_err(SLAPI_LOG_PLUGIN, "testentry_scramble", "Entry data scrambled.\n" ); /* Perform a bitwise exclusive-OR operation on each @@ -107,7 +107,7 @@ testentry_unscramble( char **entry, unsigned long *len ) (*entry)[i] ^= 0xaa; } - slapi_log_error(SLAPI_LOG_PLUGIN, "testentry_unscramble", + slapi_log_err(SLAPI_LOG_PLUGIN, "testentry_unscramble", "Entry data unscrambled.\n"); return( 0 ); } @@ -126,7 +126,7 @@ testentry_init(Slapi_PBlock *pb) slapi_pblock_set( pb, SLAPI_PLUGIN_ENTRY_STORE_FUNC, (void *) testentry_scramble ) != 0 ) { - slapi_log_error(SLAPI_LOG_PLUGIN, "testentry_init", + slapi_log_err(SLAPI_LOG_PLUGIN, "testentry_init", "Failed to set version and functions\n" ); return( -1 ); } diff --git a/ldap/servers/slapd/test-plugins/testextendedop.c b/ldap/servers/slapd/test-plugins/testextendedop.c index b209f11..20b1ee2 100644 --- a/ldap/servers/slapd/test-plugins/testextendedop.c +++ b/ldap/servers/slapd/test-plugins/testextendedop.c @@ -76,16 +76,16 @@ testexop_babs( Slapi_PBlock *pb ) if ( slapi_pblock_get( pb, SLAPI_EXT_OP_REQ_OID, &oid ) != 0 || slapi_pblock_get( pb, SLAPI_EXT_OP_REQ_VALUE, &bval ) != 0 ) { msg = "Could not get OID and value from request."; - slapi_log_error(SLAPI_LOG_PLUGIN, "testexop_babs", "%s\n", + slapi_log_err(SLAPI_LOG_PLUGIN, "testexop_babs", "%s\n", msg ); slapi_send_ldap_result( pb, LDAP_OPERATIONS_ERROR, NULL, msg, 0, NULL ); return( SLAPI_PLUGIN_EXTENDED_SENT_RESULT ); } else { - slapi_log_error(SLAPI_LOG_PLUGIN, "testexop_babs", + slapi_log_err(SLAPI_LOG_PLUGIN, "testexop_babs", "Received extended operation request with OID %s\n", oid ); - slapi_log_error(SLAPI_LOG_PLUGIN, "testexop_babs", + slapi_log_err(SLAPI_LOG_PLUGIN, "testexop_babs", "Value from client: %s\n", bval->bv_val ); } @@ -107,7 +107,7 @@ testexop_babs( Slapi_PBlock *pb ) slapi_pblock_set( pb, SLAPI_EXT_OP_RET_VALUE, &retbval ) != 0 ) { slapi_ch_free( ( void ** ) &retval ); msg = "Could not set return values"; - slapi_log_error(SLAPI_LOG_PLUGIN, "testexop_babs", "%s\n", + slapi_log_err(SLAPI_LOG_PLUGIN, "testexop_babs", "%s\n", msg ); slapi_send_ldap_result( pb, LDAP_OPERATIONS_ERROR, NULL, msg, 0, NULL ); @@ -118,9 +118,9 @@ testexop_babs( Slapi_PBlock *pb ) back to the client. */ slapi_send_ldap_result( pb, LDAP_SUCCESS, NULL, "operation babs successful!", 0, NULL ); - slapi_log_error(SLAPI_LOG_PLUGIN, "testexop_babs", + slapi_log_err(SLAPI_LOG_PLUGIN, "testexop_babs", "OID sent to client: %s\n", "5.6.7.8" ); - slapi_log_error(SLAPI_LOG_PLUGIN, "testexop_babs", + slapi_log_err(SLAPI_LOG_PLUGIN, "testexop_babs", "Value sent to client: %s\n", retval ); /* Free any memory allocated by this plug-in. */ @@ -145,7 +145,7 @@ testexop_init( Slapi_PBlock *pb ) */ if ( slapi_pblock_get( pb, SLAPI_PLUGIN_ARGV, &argv ) != 0 ) { - slapi_log_error(SLAPI_LOG_PLUGIN, + slapi_log_err(SLAPI_LOG_PLUGIN, "testexop_init", "Could not get argv\n" ); return( -1 ); } @@ -154,12 +154,12 @@ testexop_init( Slapi_PBlock *pb ) against the OID supported by this plug-in function. */ if ( argv == NULL || strcmp( argv[0], MY_OID ) != 0 ) { - slapi_log_error(SLAPI_LOG_PLUGIN, + slapi_log_err(SLAPI_LOG_PLUGIN, "testexop_init", "OID is missing or is not %s\n", MY_OID ); return( -1 ); } else { oid = slapi_ch_strdup( argv[0] ); - slapi_log_error(SLAPI_LOG_PLUGIN, "testexop_init", + slapi_log_err(SLAPI_LOG_PLUGIN, "testexop_init", "Registering plug-in for extended op %s.\n", oid ); } @@ -183,7 +183,7 @@ testexop_init( Slapi_PBlock *pb ) slapi_pblock_set( pb, SLAPI_PLUGIN_EXT_OP_OIDLIST, oidlist ) || slapi_pblock_set( pb, SLAPI_PLUGIN_EXT_OP_NAMELIST, namelist ) != 0 ) { - slapi_log_error(SLAPI_LOG_PLUGIN, "testexop_init", + slapi_log_err(SLAPI_LOG_PLUGIN, "testexop_init", "Failed to set plug-in version, function, and OID.\n" ); return( -1 ); } diff --git a/ldap/servers/slapd/test-plugins/testgetip.c b/ldap/servers/slapd/test-plugins/testgetip.c index 200cc15..0a86467 100644 --- a/ldap/servers/slapd/test-plugins/testgetip.c +++ b/ldap/servers/slapd/test-plugins/testgetip.c @@ -73,11 +73,11 @@ testgetip( Slapi_PBlock *pb ) */ if ( slapi_pblock_get( pb, SLAPI_CONN_CLIENTNETADDR, &client_addr ) != 0 || ( client_addr.raw.family == 0 )) { - slapi_log_error(SLAPI_LOG_PLUGIN, "testgetip", + slapi_log_err(SLAPI_LOG_PLUGIN, "testgetip", "Could not get client IP.\n" ); } else if (( addrstr = netaddr2str( &client_addr, addrbuf, sizeof(addrbuf))) != NULL ) { - slapi_log_error(SLAPI_LOG_PLUGIN, "testgetip", + slapi_log_err(SLAPI_LOG_PLUGIN, "testgetip", "Client's IP address is %s\n", addrstr ); } @@ -86,11 +86,11 @@ testgetip( Slapi_PBlock *pb ) */ if ( slapi_pblock_get( pb, SLAPI_CONN_SERVERNETADDR, &server_addr ) != 0 || ( server_addr.raw.family == 0 )) { - slapi_log_error(SLAPI_LOG_PLUGIN, "testgetip", + slapi_log_err(SLAPI_LOG_PLUGIN, "testgetip", "Could not get server IP.\n" ); } else if (( addrstr = netaddr2str( &server_addr, addrbuf, sizeof(addrbuf))) != NULL ) { - slapi_log_error(SLAPI_LOG_PLUGIN, "testgetip", + slapi_log_err(SLAPI_LOG_PLUGIN, "testgetip", "Client sent request to server IP %s\n", addrstr ); } @@ -107,12 +107,12 @@ testgetip_init( Slapi_PBlock *pb ) (void *)&getippdesc ) != 0 || slapi_pblock_set( pb, SLAPI_PLUGIN_PRE_SEARCH_FN, (void *) testgetip ) != 0 ) { - slapi_log_error(SLAPI_LOG_ERR, "testgetip_init", + slapi_log_err(SLAPI_LOG_ERR, "testgetip_init", "Failed to set version and functions.\n" ); return( -1 ); } - slapi_log_error(SLAPI_LOG_PLUGIN, "testgetip_init", + slapi_log_err(SLAPI_LOG_PLUGIN, "testgetip_init", "Registered preop plugins.\n" ); return( 0 ); } @@ -128,7 +128,7 @@ netaddr2str( PRNetAddr *addrp, char *buf, size_t buflen ) *buf = '\0'; if ( PR_NetAddrToString( addrp, buf, buflen ) != PR_SUCCESS ) { - slapi_log_error(SLAPI_LOG_PLUGIN, "testgetip", + slapi_log_err(SLAPI_LOG_PLUGIN, "testgetip", "PR_NetAddrToString failed.\n" ); return( NULL ); } diff --git a/ldap/servers/slapd/test-plugins/testpostop.c b/ldap/servers/slapd/test-plugins/testpostop.c index e036012..5207fc3 100644 --- a/ldap/servers/slapd/test-plugins/testpostop.c +++ b/ldap/servers/slapd/test-plugins/testpostop.c @@ -83,13 +83,13 @@ testpostop_add( Slapi_PBlock *pb ) that entry. */ if ( slapi_pblock_get( pb, SLAPI_ADD_ENTRY, &e ) != 0 || slapi_pblock_get( pb, SLAPI_ADD_TARGET, &dn ) != 0 ) { - slapi_log_error(SLAPI_LOG_PLUGIN, + slapi_log_err(SLAPI_LOG_PLUGIN, "testpostop_add", "Could not get parameters\n" ); return( -1 ); } /* Log the DN of the newly added entry in the server error log. */ - slapi_log_error(SLAPI_LOG_PLUGIN, "testpostop_add", + slapi_log_err(SLAPI_LOG_PLUGIN, "testpostop_add", "Added entry (%s)\n", dn ); /* Log the DN and the entry to the change log file. */ @@ -108,13 +108,13 @@ testpostop_mod( Slapi_PBlock *pb ) /* Get the DN of the modified entry and the modifications made. */ if ( slapi_pblock_get( pb, SLAPI_MODIFY_TARGET, &dn ) != 0 || slapi_pblock_get( pb, SLAPI_MODIFY_MODS, &mods ) != 0 ) { - slapi_log_error(SLAPI_LOG_PLUGIN, + slapi_log_err(SLAPI_LOG_PLUGIN, "testpostop_mod", "Could not get parameters\n" ); return( -1 ); } /* Log the DN of the modified entry to the server error log. */ - slapi_log_error(SLAPI_LOG_PLUGIN, "testpostop_mod", + slapi_log_err(SLAPI_LOG_PLUGIN, "testpostop_mod", "Modified entry (%s)\n", dn ); /* Log the DN and the modifications made to the change log file. */ @@ -131,13 +131,13 @@ testpostop_del( Slapi_PBlock *pb ) /* Get the DN of the entry that was removed from the directory. */ if ( slapi_pblock_get( pb, SLAPI_DELETE_TARGET, &dn ) != 0 ) { - slapi_log_error(SLAPI_LOG_PLUGIN, + slapi_log_err(SLAPI_LOG_PLUGIN, "testpostop_del", "Could not get parameters\n" ); return( -1 ); } /* Log the DN of the deleted entry to the server error log. */ - slapi_log_error(SLAPI_LOG_PLUGIN, "testpostop_del", + slapi_log_err(SLAPI_LOG_PLUGIN, "testpostop_del", "Deleted entry (%s)\n", dn ); /* Log the DN of the deleted entry to the change log. */ @@ -160,13 +160,13 @@ testpostop_modrdn( Slapi_PBlock *pb ) if ( slapi_pblock_get( pb, SLAPI_MODRDN_TARGET, &dn ) != 0 || slapi_pblock_get( pb, SLAPI_MODRDN_NEWRDN, &newrdn ) != 0 || slapi_pblock_get( pb, SLAPI_MODRDN_DELOLDRDN, &dflag ) != 0 ) { - slapi_log_error(SLAPI_LOG_PLUGIN, + slapi_log_err(SLAPI_LOG_PLUGIN, "testpostop_modrdn", "Could not get parameters\n" ); return( -1 ); } /* Log the DN of the renamed entry to the server error log. */ - slapi_log_error(SLAPI_LOG_PLUGIN, "testpostop_modrdn", + slapi_log_err(SLAPI_LOG_PLUGIN, "testpostop_modrdn", "modrdn entry (%s)\n", dn ); /* Log the DN of the renamed entry, its new RDN, and the @@ -185,14 +185,14 @@ testpostop_abandon( Slapi_PBlock *pb ) /* Get the LDAP message ID of the abandoned operation */ if ( slapi_pblock_get( pb, SLAPI_ABANDON_MSGID, &msgid ) != 0 ) { - slapi_log_error(SLAPI_LOG_PLUGIN, + slapi_log_err(SLAPI_LOG_PLUGIN, "testpostop_abandon", "Could not get parameters\n" ); return( -1 ); } /* Log information about the abandon operation to the server error log. */ - slapi_log_error(SLAPI_LOG_PLUGIN, "testpostop_abandon", + slapi_log_err(SLAPI_LOG_PLUGIN, "testpostop_abandon", "Postoperation abandon function called.\n" "\tTarget MsgID: %d\n", msgid ); @@ -220,7 +220,7 @@ testpostop_init( Slapi_PBlock *pb ) (void *) testpostop_modrdn ) != 0 || slapi_pblock_set( pb, SLAPI_PLUGIN_POST_ABANDON_FN, (void *) testpostop_abandon ) != 0 ) { - slapi_log_error(SLAPI_LOG_PLUGIN, "testpostop_init", + slapi_log_err(SLAPI_LOG_PLUGIN, "testpostop_init", "Failed to set version and functions\n" ); return( -1 ); } @@ -285,7 +285,7 @@ write_changelog( return; } if ( (fp = fopen( changelogfile, "ab" )) == NULL ) { - slapi_log_error(SLAPI_LOG_PLUGIN, "write_changelog", + slapi_log_err(SLAPI_LOG_PLUGIN, "write_changelog", "Could not open log file %s\n", changelogfile ); return; } diff --git a/ldap/servers/slapd/test-plugins/testpreop.c b/ldap/servers/slapd/test-plugins/testpreop.c index 4d08c54..363cccd 100644 --- a/ldap/servers/slapd/test-plugins/testpreop.c +++ b/ldap/servers/slapd/test-plugins/testpreop.c @@ -70,7 +70,7 @@ testpreop_bind( Slapi_PBlock *pb ) of authentication used. */ if ( slapi_pblock_get( pb, SLAPI_BIND_TARGET, &dn ) != 0 || slapi_pblock_get( pb, SLAPI_BIND_METHOD, &method ) != 0 ) { - slapi_log_error(SLAPI_LOG_PLUGIN, + slapi_log_err(SLAPI_LOG_PLUGIN, "testpreop_bind", "Could not get parameters\n" ); return( -1 ); } @@ -92,7 +92,7 @@ testpreop_bind( Slapi_PBlock *pb ) /* Log information about the bind operation to the server error log. */ - slapi_log_error(SLAPI_LOG_PLUGIN, "testpreop_bind", + slapi_log_err(SLAPI_LOG_PLUGIN, "testpreop_bind", "Preoperation bind function called.\n" "\tTarget DN: %s\n\tAuthentication method: %s\n", dn, auth ); @@ -114,7 +114,7 @@ testpreop_add( Slapi_PBlock *pb ) /* Get the entry that is about to be added. */ if ( slapi_pblock_get( pb, SLAPI_ADD_ENTRY, &e ) != 0 ) { - slapi_log_error(SLAPI_LOG_PLUGIN, + slapi_log_err(SLAPI_LOG_PLUGIN, "testpreop_add", "Could not get entry\n" ); return( -1 ); } @@ -142,15 +142,15 @@ testpreop_search( Slapi_PBlock *pb ) { char *base; /* Log a message to indicate when the plug-in function starts */ - slapi_log_error(SLAPI_LOG_ERR, "testpreop_search", + slapi_log_err(SLAPI_LOG_ERR, "testpreop_search", "*** PREOPERATION SEARCH PLUGIN ***\n"); /* Get and log the base DN of the search criteria */ if ( slapi_pblock_get( pb, SLAPI_SEARCH_TARGET, &base ) == 0 ) - slapi_log_error(SLAPI_LOG_ERR, "SLAPI_SEARCH_TARGET", + slapi_log_err(SLAPI_LOG_ERR, "SLAPI_SEARCH_TARGET", "%s\n", base ); /* Get and log the original base DN */ if ( slapi_pblock_get( pb, SLAPI_ORIGINAL_TARGET_DN, &base ) == 0 ) - slapi_log_error(SLAPI_LOG_ERR, "SLAPI_ORIGINAL_TARGET_DN", + slapi_log_err(SLAPI_LOG_ERR, "SLAPI_ORIGINAL_TARGET_DN", "%s\n", base ); return( 0 ); /* allow the operation to continue */ @@ -165,14 +165,14 @@ testpreop_abandon( Slapi_PBlock *pb ) /* Get the LDAP message ID of the abandon target */ if ( slapi_pblock_get( pb, SLAPI_ABANDON_MSGID, &msgid ) != 0 ) { - slapi_log_error(SLAPI_LOG_PLUGIN, + slapi_log_err(SLAPI_LOG_PLUGIN, "testpreop_abandon", "Could not get parameters\n" ); return( -1 ); } /* Log information about the abandon operation to the server error log. */ - slapi_log_error(SLAPI_LOG_PLUGIN, "testpreop_bind", + slapi_log_err(SLAPI_LOG_PLUGIN, "testpreop_bind", "Preoperation abandon function called.\n" "\tTarget MsgID: %d\n", msgid ); @@ -189,19 +189,19 @@ get_plugin_config_dn_and_entry( char *msg, Slapi_PBlock *pb ) int loglevel = SLAPI_LOG_PLUGIN; if ( slapi_pblock_get( pb, SLAPI_TARGET_DN, &dn ) != 0 || dn == NULL ) { - slapi_log_error( loglevel, msg, "failed to get plugin config DN\n" ); + slapi_log_err( loglevel, msg, "failed to get plugin config DN\n" ); } else { - slapi_log_error( loglevel, msg, "this plugin's config DN is \"%s\"\n", + slapi_log_err( loglevel, msg, "this plugin's config DN is \"%s\"\n", dn ); } if ( slapi_pblock_get( pb, SLAPI_ADD_ENTRY, &e ) != 0 || e == NULL ) { - slapi_log_error( loglevel, msg, "failed to get plugin config entry\n" ); + slapi_log_err( loglevel, msg, "failed to get plugin config entry\n" ); } else { char *ldif; ldif = slapi_entry2str_with_options( e, NULL, 0 ); - slapi_log_error( loglevel, msg, + slapi_log_err( loglevel, msg, "this plugin's config entry is \"\n%s\"\n", ldif ); slapi_ch_free_string( &ldif ); } @@ -234,7 +234,7 @@ testpreop_init( Slapi_PBlock *pb ) (void *) testpreop_search ) != 0 || slapi_pblock_set( pb, SLAPI_PLUGIN_PRE_ABANDON_FN, (void *) testpreop_abandon ) != 0 ) { - slapi_log_error(SLAPI_LOG_ERR, "testpreop_init", + slapi_log_err(SLAPI_LOG_ERR, "testpreop_init", "Failed to set version and function\n" ); return( -1 ); } diff --git a/ldap/servers/slapd/test-plugins/testsaslbind.c b/ldap/servers/slapd/test-plugins/testsaslbind.c index 08c3830..b1406da 100644 --- a/ldap/servers/slapd/test-plugins/testsaslbind.c +++ b/ldap/servers/slapd/test-plugins/testsaslbind.c @@ -74,7 +74,7 @@ testsasl_bind( Slapi_PBlock *pb ) struct berval svrcreds; /* Log a message to the server error log. */ - slapi_log_error(SLAPI_LOG_PLUGIN, "testsasl_bind", + slapi_log_err(SLAPI_LOG_PLUGIN, "testsasl_bind", "Pre-operation bind function called.\n" ); /* Gets parameters available when processing an LDAP bind @@ -84,7 +84,7 @@ testsasl_bind( Slapi_PBlock *pb ) slapi_pblock_get( pb, SLAPI_BIND_CREDENTIALS, &credentials ) != 0 || slapi_pblock_get( pb, SLAPI_BIND_SASLMECHANISM, &mechanism ) != 0 ) { - slapi_log_error(SLAPI_LOG_ERR, "testsasl_bind", + slapi_log_err(SLAPI_LOG_ERR, "testsasl_bind", "Could not get parameters for bind operation\n" ); return( 0 ); /* let the server try other mechanisms */ } @@ -102,7 +102,7 @@ testsasl_bind( Slapi_PBlock *pb ) if ( slapi_pblock_set( pb, SLAPI_CONN_DN, slapi_ch_strdup( target ) ) != 0 || slapi_pblock_set( pb, SLAPI_CONN_AUTHMETHOD, TEST_SASL_AUTHMETHOD ) != 0 ) { - slapi_log_error(SLAPI_LOG_ERR, "testsasl_bind", + slapi_log_err(SLAPI_LOG_ERR, "testsasl_bind", "Failed to set DN and method for connection\n" ); slapi_send_ldap_result( pb, LDAP_OPERATIONS_ERROR, NULL, NULL, 0, NULL ); @@ -114,7 +114,7 @@ testsasl_bind( Slapi_PBlock *pb ) svrcreds.bv_len = sizeof("my credentials") - 1; if ( slapi_pblock_set( pb, SLAPI_BIND_RET_SASLCREDS, &svrcreds ) != 0 ) { - slapi_log_error(SLAPI_LOG_PLUGIN, "testsasl_bind", + slapi_log_err(SLAPI_LOG_PLUGIN, "testsasl_bind", "Could not set credentials to return to client\n" ); slapi_pblock_set( pb, SLAPI_CONN_DN, NULL ); slapi_pblock_set( pb, SLAPI_CONN_AUTHMETHOD, SLAPD_AUTH_NONE ); @@ -122,7 +122,7 @@ testsasl_bind( Slapi_PBlock *pb ) } /* Send the credentials back to the client. */ - slapi_log_error(SLAPI_LOG_PLUGIN, "testsasl_bind", + slapi_log_err(SLAPI_LOG_PLUGIN, "testsasl_bind", "Authenticated: %s\n", target ); slapi_send_ldap_result( pb, LDAP_SUCCESS, NULL, NULL, 0, NULL ); @@ -138,7 +138,7 @@ testsasl_init( Slapi_PBlock *pb ) if ( slapi_pblock_set( pb, SLAPI_PLUGIN_VERSION, SLAPI_PLUGIN_VERSION_01 ) != 0 || slapi_pblock_set( pb, SLAPI_PLUGIN_DESCRIPTION, (void *)&saslpdesc ) != 0 || slapi_pblock_set( pb, SLAPI_PLUGIN_PRE_BIND_FN, (void *) testsasl_bind ) != 0 ) { - slapi_log_error(SLAPI_LOG_PLUGIN, "testsasl_init", + slapi_log_err(SLAPI_LOG_PLUGIN, "testsasl_init", "Failed to set version and function\n" ); return( -1 ); } diff --git a/ldap/servers/slapd/time.c b/ldap/servers/slapd/time.c index 0ffdbae..3dfda73 100644 --- a/ldap/servers/slapd/time.c +++ b/ldap/servers/slapd/time.c @@ -517,7 +517,7 @@ parse_duration(char *value) duration *= times; bail: if (duration == -1) { - LDAPDebug1Arg(LDAP_DEBUG_ERR, "parse_duration - Invalid duration (%s)\n", value?value:"null"); + slapi_log_err(SLAPI_LOG_ERR, "parse_duration - Invalid duration (%s)\n", value?value:"null"); } slapi_ch_free_string(&input); return duration; @@ -584,7 +584,7 @@ parse_duration_longlong(char *value) duration *= times; bail: if (duration == -1) { - LDAPDebug1Arg(LDAP_DEBUG_ERR, "parse_duration_longlong - Invalid duration (%s)\n", value?value:"null"); + slapi_log_err(SLAPI_LOG_ERR, "parse_duration_longlong - Invalid duration (%s)\n", value?value:"null"); } slapi_ch_free_string(&input); return duration; diff --git a/ldap/servers/slapd/tools/ldaptool.h b/ldap/servers/slapd/tools/ldaptool.h index 40d1975..414e8cf 100644 --- a/ldap/servers/slapd/tools/ldaptool.h +++ b/ldap/servers/slapd/tools/ldaptool.h @@ -73,7 +73,6 @@ #include #include -#include #include #ifdef __cplusplus diff --git a/ldap/servers/slapd/tools/mmldif.c b/ldap/servers/slapd/tools/mmldif.c index ddfaf6c..ea4ab91 100644 --- a/ldap/servers/slapd/tools/mmldif.c +++ b/ldap/servers/slapd/tools/mmldif.c @@ -26,7 +26,6 @@ #include #include -#include #ifndef TRUE #define TRUE 1 @@ -36,6 +35,8 @@ #define FALSE 0 #endif +//extern int slapd_ldap_debug; + /* * VSTRING was defined in PMDF headers. */ @@ -320,11 +321,11 @@ int mm_diff(stats_t *statsp) for (i = 0; i < ndirectories; i++) { pindex = i / 32; pmask = 1 << (i % 32); - LDAPDebug(LDAP_DEBUG_TRACE, "finger printing directory %d\n", i, 0, 0); + slapi_log_err(SLAPI_LOG_TRACE, "mm_diff", "finger printing directory %d\n", i); while (TRUE) { stat = readrec(&edfin[i], &attrib); if (stat == IDDS_MM_ABSENT) { - LDAPDebug(LDAP_DEBUG_TRACE, "ignored: %s: %s\n", + slapi_log_err(SLAPI_LOG_TRACE, "ignored: %s: %s\n", attrib->name, attrib->value, 0); continue; } @@ -335,7 +336,7 @@ int mm_diff(stats_t *statsp) return stat; } records++; - LDAPDebug(LDAP_DEBUG_TRACE, "db%d: %s: %s\n", + slapi_log_err(SLAPI_LOG_TRACE, "mm_diff", "db%d: %s: %s\n", i, attrib->name, attrib->value); hashname(seed, attrib, hashkey.data); key = hashkey.key & hashmask; @@ -348,9 +349,9 @@ int mm_diff(stats_t *statsp) hashentry = hashentry->overflow; if (hashentry != NULL) { if (hashentry->present[pindex] & pmask) { - LDAPDebug(LDAP_DEBUG_TRACE, + slapi_log_err(SLAPI_LOG_TRACE, "mm_diff", "duplicate DN <%s=%s> (ignored)\n", - attrib->name, attrib->value, 0); + attrib->name, attrib->value); if (emitchanges) { fprintf(edfout[i], "\n# Duplicate DN:\n"); commententry(edfout[i], attrib); @@ -364,14 +365,14 @@ int mm_diff(stats_t *statsp) hashentry->present[pindex] |= pmask; hashvalue(seed, attrib, fingerprint); if (memcmp(fingerprint, hashentry->fingerprint, 16)) { - LDAPDebug(LDAP_DEBUG_TRACE, - "...data modified\n", key, 0, 0); + slapi_log_err(SLAPI_LOG_TRACE, "mm_diff", + "...data modified - key %u\n", key); hashentry->flags = MODIFIED; } } continue; } - LDAPDebug(LDAP_DEBUG_TRACE, "overflow in key %u\n", key, 0, 0); + slapi_log_err(SLAPI_LOG_TRACE, "mm_diff", "overflow in key %u\n", key); hashentry2 = entryalloc(); hashentry2->overflow = hashtable[key]; hashentry = hashtable[key] = hashentry2; @@ -406,13 +407,13 @@ int mm_diff(stats_t *statsp) rewind(edfin[i].fp); edfin[i].end = FALSE; - LDAPDebug(LDAP_DEBUG_TRACE, - "loading authoritative data from directory %d\n", i, 0, 0); + slapi_log_err(SLAPI_LOG_TRACE, "mm_diff", + "loading authoritative data from directory %d\n", i); while (TRUE) { stat = readrec(&edfin[i], &attrib); if (stat == IDDS_MM_ABSENT) { - LDAPDebug(LDAP_DEBUG_TRACE, "ignored: %s: %s\n", - attrib->name, attrib->value, 0); + slapi_log_err(SLAPI_LOG_TRACE, "mm_diff", "ignored: %s: %s\n", + attrib->name, attrib->value); continue; } if (stat == IDDS_MM_EOF) @@ -421,7 +422,7 @@ int mm_diff(stats_t *statsp) free(hashtable); return stat; } - LDAPDebug(LDAP_DEBUG_TRACE, "db%d: %s: %s\n", + slapi_log_err(SLAPI_LOG_TRACE, "mm_diff", "db%d: %s: %s\n", i, attrib->name, attrib->value); hashname(seed, attrib, hashkey.data); key = hashkey.key & hashmask; @@ -430,14 +431,14 @@ int mm_diff(stats_t *statsp) memcmp(hashentry->key, hashkey.data, 16)) hashentry = hashentry->overflow; if (hashentry == NULL) { - LDAPDebug(LDAP_DEBUG_TRACE, "...hash entry not found\n", 0, 0, 0); + slapi_log_err(SLAPI_LOG_TRACE, "mm_diff", "...hash entry not found\n"); continue; } if (!(hashentry->flags & LOADED)) { hashentry->first = newrecord(attrib); hashentry->flags |= LOADED; - LDAPDebug(LDAP_DEBUG_TRACE, " ...data loaded\n", 0, 0, 0); + slapi_log_err(SLAPI_LOG_TRACE, "mm_diff", " ...data loaded\n"); hashentry->db = i; continue; } @@ -445,7 +446,7 @@ int mm_diff(stats_t *statsp) continue; if (mm_get_winner(hashentry->first, attrib)) { hashentry->flags |= LOADED; - LDAPDebug(LDAP_DEBUG_TRACE, " ...winner data loaded\n", 0, 0, 0); + slapi_log_err(SLAPI_LOG_TRACE, "mm_diff", " ...winner data loaded\n"); hashentry->db = i; free(hashentry->first); hashentry->first = newrecord(attrib); @@ -473,13 +474,13 @@ int mm_diff(stats_t *statsp) rewind(edfin[i].fp); edfin[i].end = FALSE; - LDAPDebug(LDAP_DEBUG_TRACE, - "generating differences for directory %d\n", i, 0, 0); + slapi_log_err(SLAPI_LOG_TRACE, "mm_diff", + "generating differences for directory %d\n", i); while (TRUE) { stat = readrec(&edfin[i], &attrib); if (stat == IDDS_MM_ABSENT) { - LDAPDebug(LDAP_DEBUG_TRACE, "ignored: %s: %s\n", - attrib->name, attrib->value, 0); + slapi_log_err(SLAPI_LOG_TRACE, "mm_diff", "ignored: %s: %s\n", + attrib->name, attrib->value); continue; } if (stat == IDDS_MM_EOF) @@ -488,7 +489,7 @@ int mm_diff(stats_t *statsp) free(hashtable); return stat; } - LDAPDebug(LDAP_DEBUG_TRACE, "db%d: %s: %s\n", + slapi_log_err(SLAPI_LOG_TRACE, "mm_diff", "db%d: %s: %s\n", i, attrib->name, attrib->value); hashname(seed, attrib, hashkey.data); key = hashkey.key & hashmask; @@ -497,7 +498,7 @@ int mm_diff(stats_t *statsp) memcmp(hashentry->key, hashkey.data, 16)) hashentry = hashentry->overflow; if (hashentry == NULL) { - LDAPDebug(LDAP_DEBUG_TRACE, "...hash entry not found\n", 0, 0, 0); + slapi_log_err(SLAPI_LOG_TRACE, "mm_diff", "...hash entry not found\n"); continue; } if (hashentry->flags & IDENTITY) @@ -507,10 +508,10 @@ int mm_diff(stats_t *statsp) hashvalue(seed, attrib, fingerprint); if (memcmp(fingerprint, hashentry->fingerprint, 16)) { if (mm_is_deleted(hashentry->first, attrib, 0)) { - LDAPDebug(LDAP_DEBUG_TRACE, " ...deleted\n", 0, 0, 0); + slapi_log_err(SLAPI_LOG_TRACE, "mm_diff", " ...deleted\n"); adddelete(edfout[i], attrib); } else { - LDAPDebug(LDAP_DEBUG_TRACE, " ...modified\n", 0, 0, 0); + slapi_log_err(SLAPI_LOG_TRACE, "mm_diff", " ...modified\n"); addmodified(edfout[i], attrib, hashentry->first); } } @@ -525,7 +526,7 @@ int mm_diff(stats_t *statsp) * no action is needed here. Otherwise we emit an add. * we take this opportunity to free the memory. */ - LDAPDebug(LDAP_DEBUG_TRACE, "scanning db for new entries\n", 0, 0, 0); + slapi_log_err(SLAPI_LOG_TRACE, "mm_diff", "scanning db for new entries\n"); for (h = 0; h < 0x1000; h++) { for (hashentry = hashtable[h]; hashentry; hashentry = overflow) { if (!hashentry->flags) @@ -539,7 +540,7 @@ int mm_diff(stats_t *statsp) if (mm_is_deleted(hashentry->first, NULL, 0)) continue; added++; if (!emitchanges) continue; - LDAPDebug(LDAP_DEBUG_TRACE, " ...add new\n", 0, 0, 0); + slapi_log_err(SLAPI_LOG_TRACE, "mm_diff", " ...add new\n"); addnew(edfout[i], "add", hashentry->first); } @@ -737,8 +738,8 @@ readrec(edfFILE * edf1, attrib1_t ** attrib) } vptr = strchr(line, ':'); if (!vptr) { - LDAPDebug(LDAP_DEBUG_TRACE, "%s\n invalid input line\n", - line, 0, 0); + slapi_log_err(SLAPI_LOG_TRACE, "readrec", "%s\n invalid input line\n", + line); continue; /* invalid line, but we'll just skip it */ } *vptr = 0; @@ -766,7 +767,7 @@ readrec(edfFILE * edf1, attrib1_t ** attrib) while (*vptr == ' ') vptr++; /* skip optional spaces */ b64 = initDec64((unsigned char *)att->value, 0x20000); if (Dec64(b64, (unsigned char *) vptr)) { - LDAPDebug(LDAP_DEBUG_TRACE, "%s\n invalid input line\n", line, 0, 0); + slapi_log_err(SLAPI_LOG_TRACE, "readrec", "%s\n invalid input line\n", line); continue; /* invalid line, but we'll just skip it */ } toolong = FALSE; @@ -776,7 +777,7 @@ readrec(edfFILE * edf1, attrib1_t ** attrib) break; line[0] = '\0'; if (NULL == fgets(line, sizeof(line), edf1->fp)) { - LDAPDebug0Args(LDAP_DEBUG_TRACE, "readrec: failed to read line\n"); + slapi_log_err(SLAPI_LOG_TRACE, "readrec", "Failed to read line\n"); break; } len = strlen(line); @@ -788,14 +789,14 @@ readrec(edfFILE * edf1, attrib1_t ** attrib) rc = Dec64(b64, (unsigned char *)line); if (rc == -1) { - LDAPDebug(LDAP_DEBUG_TRACE, "%s\n invalid input line\n", line, 0, 0); + slapi_log_err(SLAPI_LOG_TRACE, "readrec", "%s\n invalid input line\n", line); continue; /* invalid line, but we'll just skip it */ } if (rc) { if (!toolong) { toolong = TRUE; - LDAPDebug(LDAP_DEBUG_TRACE, "%s\n line too long\n", line, 0, 0); + slapi_log_err(SLAPI_LOG_TRACE, "readrec", "%s\n line too long\n", line); } continue; } @@ -815,7 +816,7 @@ readrec(edfFILE * edf1, attrib1_t ** attrib) if (lookahead != ' ') break; if (NULL == fgets(line, sizeof(line), edf1->fp)) { - LDAPDebug0Args(LDAP_DEBUG_TRACE, "readrec: failed to read line\n"); + slapi_log_err(SLAPI_LOG_TRACE, "readrec", "Failed to read line\n"); break; } len = strlen(line); diff --git a/ldap/servers/slapd/unbind.c b/ldap/servers/slapd/unbind.c index 17d98cf..fd44249 100644 --- a/ldap/servers/slapd/unbind.c +++ b/ldap/servers/slapd/unbind.c @@ -39,7 +39,7 @@ do_unbind( Slapi_PBlock *pb ) int err; int ignore_criticality = 1; - LDAPDebug(LDAP_DEBUG_TRACE, "do_unbind\n", 0, 0, 0 ); + slapi_log_err(SLAPI_LOG_TRACE, "do_unbind", "=>\n"); slapi_pblock_get( pb, SLAPI_OPERATION, &operation); ber = operation->o_ber; diff --git a/ldap/servers/slapd/uniqueid.c b/ldap/servers/slapd/uniqueid.c index 3db7813..c878a8f 100644 --- a/ldap/servers/slapd/uniqueid.c +++ b/ldap/servers/slapd/uniqueid.c @@ -41,7 +41,7 @@ Slapi_UniqueID *slapi_uniqueIDNew () if (uId == NULL) { - slapi_log_error(SLAPI_LOG_ERR, MODULE, "uniqueIDNew: " + slapi_log_err(SLAPI_LOG_ERR, MODULE, "uniqueIDNew: " "failed to allocate new id.\n"); return NULL; } @@ -78,7 +78,7 @@ void slapi_uniqueIDDestroy (Slapi_UniqueID **uId) int slapi_uniqueIDCompare (const Slapi_UniqueID *uId1, const Slapi_UniqueID *uId2){ if (uId1 == NULL || uId2 == NULL) { - slapi_log_error(SLAPI_LOG_ERR, MODULE, "uniqueIDCompare: " + slapi_log_err(SLAPI_LOG_ERR, MODULE, "uniqueIDCompare: " "NULL argument passed to the function.\n"); return UID_BADDATA; } @@ -126,7 +126,7 @@ int slapi_uniqueIDFormat (const Slapi_UniqueID *uId, char **buff){ if (uId == NULL || buff == NULL) { - slapi_log_error(SLAPI_LOG_ERR, MODULE, "uniqueIDFormat: " + slapi_log_err(SLAPI_LOG_ERR, MODULE, "uniqueIDFormat: " "NULL argument passed to the function.\n"); return UID_BADDATA; } @@ -134,7 +134,7 @@ int slapi_uniqueIDFormat (const Slapi_UniqueID *uId, char **buff){ *buff = (char*)slapi_ch_malloc (UIDSTR_SIZE + 1); if (*buff == NULL) { - slapi_log_error(SLAPI_LOG_ERR, MODULE, "uniqueIDFormat: " + slapi_log_err(SLAPI_LOG_ERR, MODULE, "uniqueIDFormat: " "failed to allocate buffer.\n"); return UID_MEMORY_ERROR; } @@ -179,14 +179,14 @@ int slapi_uniqueIDFormat (const Slapi_UniqueID *uId, char **buff){ int slapi_uniqueIDScan (Slapi_UniqueID *uId, const char *buff){ if (uId == NULL || buff == NULL) { - slapi_log_error(SLAPI_LOG_ERR, MODULE, "uniqueIDScan: " + slapi_log_err(SLAPI_LOG_ERR, MODULE, "uniqueIDScan: " "NULL argument passed to the function.\n"); return UID_BADDATA; } if (!isValidFormat (buff)) { - slapi_log_error(SLAPI_LOG_ERR, MODULE, "uniqueIDScan: " + slapi_log_err(SLAPI_LOG_ERR, MODULE, "uniqueIDScan: " "invalid data format.\n"); return UID_BADDATA; } diff --git a/ldap/servers/slapd/uniqueidgen.c b/ldap/servers/slapd/uniqueidgen.c index f7896c0..a6c03d7 100644 --- a/ldap/servers/slapd/uniqueidgen.c +++ b/ldap/servers/slapd/uniqueidgen.c @@ -46,7 +46,7 @@ int uniqueIDGenInit (const char *configDir, const Slapi_DN *configDN, PRBool mtG if ((configDN == NULL && (configDir == NULL || !validDir(configDir))) || (configDN && configDir)) { - slapi_log_error(SLAPI_LOG_ERR, MODULE, "uniqueIDGenInit: invalid arguments\n"); + slapi_log_err(SLAPI_LOG_ERR, MODULE, "uniqueIDGenInit: invalid arguments\n"); return UID_BADDATA; } @@ -57,7 +57,7 @@ int uniqueIDGenInit (const char *configDir, const Slapi_DN *configDN, PRBool mtG return UID_SUCCESS; else { - slapi_log_error(SLAPI_LOG_ERR, MODULE, "uniqueIDGenInit: " + slapi_log_err(SLAPI_LOG_ERR, MODULE, "uniqueIDGenInit: " "generator initialization failed\n"); return UID_SYSTEM_ERROR; } @@ -85,7 +85,7 @@ int slapi_uniqueIDGenerate (Slapi_UniqueID *uId){ if (uId == NULL) { - slapi_log_error(SLAPI_LOG_ERR, MODULE, "uniqueIDGenerate: " + slapi_log_err(SLAPI_LOG_ERR, MODULE, "uniqueIDGenerate: " "NULL parameter is passed to the function.\n"); return UID_BADDATA; } @@ -93,7 +93,7 @@ int slapi_uniqueIDGenerate (Slapi_UniqueID *uId){ rt = uuid_create(uId); if (rt != UUID_SUCCESS) { - slapi_log_error(SLAPI_LOG_ERR, MODULE, "uniqueIDGenerate: " + slapi_log_err(SLAPI_LOG_ERR, MODULE, "uniqueIDGenerate: " "id generation failed.\n"); return UID_SYSTEM_ERROR; } @@ -145,7 +145,7 @@ int slapi_uniqueIDGenerateFromName (Slapi_UniqueID *uId, const Slapi_UniqueID *u { if (uId == NULL || uIdBase == NULL || name == NULL || namelen <= 0) { - slapi_log_error(SLAPI_LOG_ERR, MODULE, "uniqueIDGenerateMT: " + slapi_log_err(SLAPI_LOG_ERR, MODULE, "uniqueIDGenerateMT: " "invalid parameter is passed to the function.\n"); return UID_BADDATA; } diff --git a/ldap/servers/slapd/util.c b/ldap/servers/slapd/util.c index 207c024..7fef95d 100644 --- a/ldap/servers/slapd/util.c +++ b/ldap/servers/slapd/util.c @@ -333,7 +333,7 @@ filter_stuff_func(void *arg, const char *val, PRUint32 slen) raw_filter.bv_val = (char *)buf; raw_filter.bv_len = filter_len; if(ldap_bv2escaped_filter_value(&raw_filter, &escaped_filter) != 0){ - LDAPDebug(LDAP_DEBUG_TRACE, "slapi_filter_sprintf: failed to escape filter value(%s)\n",val,0,0); + slapi_log_err(SLAPI_LOG_TRACE, "filter_stuff_func", "Failed to escape filter value(%s)\n",val); ctx->next_arg_needs_esc_norm = 0; return -1; } else { @@ -345,7 +345,7 @@ filter_stuff_func(void *arg, const char *val, PRUint32 slen) buf = slapi_ch_calloc(sizeof(char), filter_len*3 + 1); val2 = (char *)do_escape_string(val, filter_len, buf, special_filter); if(val2 == NULL){ - LDAPDebug(LDAP_DEBUG_TRACE, "slapi_filter_sprintf: failed to escape filter value(%s)\n",val,0,0); + slapi_log_err(SLAPI_LOG_TRACE, "filter_stuff_func", "Failed to escape filter value(%s)\n",val); ctx->next_arg_needs_esc_norm = 0; slapi_ch_free_string(&buf); return -1; @@ -473,7 +473,8 @@ slapi_escape_filter_value(char* filter_str, int len) raw_filter.bv_val = filter_str; raw_filter.bv_len = filter_len; if(ldap_bv2escaped_filter_value(&raw_filter, &escaped_filter) != 0){ - LDAPDebug(LDAP_DEBUG_TRACE, "slapi_escape_filter_value: failed to escape filter value(%s)\n",filter_str,0,0); + slapi_log_err(SLAPI_LOG_TRACE, "slapi_escape_filter_value", + "Failed to escape filter value(%s)\n",filter_str); return NULL; } else { return escaped_filter.bv_val; @@ -612,8 +613,8 @@ int slapi_mods2entry (Slapi_Entry **e, const char *idn, LDAPMod **iattrs) valuearray_free(&vals); if (rc != LDAP_SUCCESS) { - LDAPDebug2Args(LDAP_DEBUG_ERR, - "slapi_mods2entry - Add_values for type %s failed (rc: %d)\n", + slapi_log_err(SLAPI_LOG_ERR, + "slapi_mods2entry", "Add_values for type %s failed (rc: %d)\n", normtype, rc ); slapi_entry_free (*e); *e = NULL; @@ -932,8 +933,7 @@ rel2abspath_ext( char *relpath, char *cwd ) if ( NULL == cwd ) { if ( getcwd( abspath, MAXPATHLEN ) == NULL ) { perror( "getcwd" ); - LDAPDebug(LDAP_DEBUG_ERR, "rel2abspath_ext - Cannot determine current directory\n", - 0, 0, 0 ); + slapi_log_err(SLAPI_LOG_ERR, "rel2abspath_ext", "Cannot determine current directory\n"); exit( 1 ); } } else { @@ -941,8 +941,8 @@ rel2abspath_ext( char *relpath, char *cwd ) } if ( strlen( relpath ) + strlen( abspath ) + 1 > MAXPATHLEN ) { - LDAPDebug(LDAP_DEBUG_ERR, "rel2abspath_ext - Pathname \"%s" _PSEP "%s\" too long\n", - abspath, relpath, 0 ); + slapi_log_err(SLAPI_LOG_ERR, "rel2abspath_ext", "Pathname \"%s" _PSEP "%s\" too long\n", + abspath, relpath); exit( 1 ); } @@ -1003,7 +1003,7 @@ void slapd_nasty(char* str, int c, int err) char *msg = NULL; char buffer[100]; PR_snprintf(buffer,sizeof(buffer), "%s BAD %d",str,c); - LDAPDebug(LDAP_DEBUG_ERR,"%s, err=%d %s\n",buffer,err,(msg = strerror( err )) ? msg : ""); + slapi_log_err(SLAPI_LOG_ERR,"%s, err=%d %s\n",buffer,err,(msg = strerror( err )) ? msg : ""); } /* *************************************************** @@ -1415,11 +1415,11 @@ slapi_is_special_rdn(const char *rdn, int flag) } if ((RDN_IS_TOMBSTONE != flag) && (RDN_IS_CONFLICT != flag)) { - LDAPDebug1Arg(LDAP_DEBUG_ERR, "slapi_is_special_rdn - Invalid flag %d\n", flag); + slapi_log_err(SLAPI_LOG_ERR, "slapi_is_special_rdn", "Invalid flag %d\n", flag); return 0; /* not a special rdn/dn */ } if (!rdn) { - LDAPDebug0Args(LDAP_DEBUG_ERR, "slapi_is_special_rdn - NULL rdn\n"); + slapi_log_err(SLAPI_LOG_ERR, "slapi_is_special_rdn", "NULL rdn\n"); return 0; /* not a special rdn/dn */ } @@ -1490,7 +1490,8 @@ static size_t util_getvirtualmemsize(void) * memory. */ int errsrv = errno; - slapi_log_error(SLAPI_LOG_ERR,"util_getvirtualmemsize", "getrlimit returned non-zero. errno=%u\n", errsrv); + slapi_log_err(SLAPI_LOG_ERR,"util_getvirtualmemsize", + "getrlimit returned non-zero. errno=%u\n", errsrv); return 0; } return rl.rlim_cur; @@ -1503,7 +1504,7 @@ static size_t util_getvirtualmemsize(void) int util_info_sys_pages(size_t *pagesize, size_t *pages, size_t *procpages, size_t *availpages) { if ((NULL == pagesize) || (NULL == pages) || (NULL == procpages) || (NULL == availpages)) { - slapi_log_error(SLAPI_LOG_ERR, "util_info_sys_pages", + slapi_log_err(SLAPI_LOG_ERR, "util_info_sys_pages", "Null return variables are passed. Skip getting the system info.\n"); return 1; } @@ -1590,7 +1591,7 @@ int util_info_sys_pages(size_t *pagesize, size_t *pages, size_t *procpages, size if (!f) { /* fopen failed */ /* We should probably make noise here! */ int errsrv = errno; - slapi_log_error(SLAPI_LOG_ERR,"util_info_sys_pages", "Unable to open file /proc/%d/status. errno=%u\n", getpid(), errsrv); + slapi_log_err(SLAPI_LOG_ERR,"util_info_sys_pages", "Unable to open file /proc/%d/status. errno=%u\n", getpid(), errsrv); return 1; } while (! feof(f)) { @@ -1614,7 +1615,7 @@ int util_info_sys_pages(size_t *pagesize, size_t *pages, size_t *procpages, size fm = fopen(fmn, "r"); if (!fm) { int errsrv = errno; - slapi_log_error(SLAPI_LOG_ERR,"util_info_sys_pages", "Unable to open file /proc/meminfo. errno=%u\n", errsrv); + slapi_log_err(SLAPI_LOG_ERR,"util_info_sys_pages", "Unable to open file /proc/meminfo. errno=%u\n", errsrv); return 1; } while (! feof(fm)) { @@ -1648,9 +1649,9 @@ int util_info_sys_pages(size_t *pagesize, size_t *pages, size_t *procpages, size } /* Pages is the total ram on the system. */ - LDAPDebug(LDAP_DEBUG_TRACE,"util_info_sys_pages - pages=%lu, \n", - (unsigned long) *pages, 0,0); - LDAPDebug(LDAP_DEBUG_TRACE,"util_info_sys_pages - using pages for pages \n",0,0,0); + slapi_log_err(SLAPI_LOG_TRACE,"util_info_sys_pages", "pages=%lu, \n", + (unsigned long) *pages); + slapi_log_err(SLAPI_LOG_TRACE,"util_info_sys_pages", "using pages for pages \n"); /* Availpages is how much we *could* alloc. We should take the smallest: * - pages @@ -1658,21 +1659,21 @@ int util_info_sys_pages(size_t *pagesize, size_t *pages, size_t *procpages, size * - freesize */ if (rlimsize == RLIM_INFINITY) { - LDAPDebug(LDAP_DEBUG_TRACE,"util_info_sys_pages - pages=%lu, getrlim=RLIM_INFINITY, freesize=%lu\n", - (unsigned long)*pages, (unsigned long)freesize, 0); + slapi_log_err(SLAPI_LOG_TRACE,"util_info_sys_pages", "pages=%lu, getrlim=RLIM_INFINITY, freesize=%lu\n", + (unsigned long)*pages, (unsigned long)freesize); } else { - LDAPDebug(LDAP_DEBUG_TRACE,"util_info_sys_pages - pages=%lu, getrlim=%lu, freesize=%lu\n", + slapi_log_err(SLAPI_LOG_TRACE,"util_info_sys_pages", "pages=%lu, getrlim=%lu, freesize=%lu\n", (unsigned long)*pages, (unsigned long)*availpages, (unsigned long)freesize); } if (rlimsize != RLIM_INFINITY && rlimsize < freesize && rlimsize < *pages && rlimsize > 0) { - LDAPDebug(LDAP_DEBUG_TRACE,"util_info_sys_pages - using getrlim for availpages \n",0,0,0); + slapi_log_err(SLAPI_LOG_TRACE,"util_info_sys_pages", "using getrlim for availpages \n"); *availpages = rlimsize; } else if (freesize < *pages && freesize > 0) { - LDAPDebug(LDAP_DEBUG_TRACE,"util_info_sys_pages - using freesize for availpages \n",0,0,0); + slapi_log_err(SLAPI_LOG_TRACE,"util_info_sys_pages", "using freesize for availpages \n"); *availpages = freesize; } else { - LDAPDebug(LDAP_DEBUG_TRACE,"util_info_sys_pages - using pages for availpages \n",0,0,0); + slapi_log_err(SLAPI_LOG_TRACE,"util_info_sys_pages", "using pages for availpages \n"); *availpages = *pages; } @@ -1733,8 +1734,9 @@ int util_info_sys_pages(size_t *pagesize, size_t *pages, size_t *procpages, size #define GIGABYTE (1024*1024*1024) size_t one_gig_pages = GIGABYTE / *pagesize; if (*pages > (2 * one_gig_pages) ) { - LDAPDebug(LDAP_DEBUG_TRACE,"util_info_sys_pages - More than 2Gbytes physical memory detected. Since this is a 32-bit process, truncating memory size used for auto cache calculations to 2Gbytes\n", - 0, 0, 0); + slapi_log_err(SLAPI_LOG_TRACE,"util_info_sys_pages", + "More than 2Gbytes physical memory detected. Since this is a 32-bit process, " + "truncating memory size used for auto cache calculations to 2Gbytes\n"; *pages = (2 * one_gig_pages); } } @@ -1743,7 +1745,7 @@ int util_info_sys_pages(size_t *pagesize, size_t *pages, size_t *procpages, size /* This is stupid. If you set %u to %zu to print a size_t, you get literal %zu in your logs * So do the filthy cast instead. */ - slapi_log_error(SLAPI_LOG_TRACE,"util_info_sys_pages", "USING pages=%lu, procpages=%lu, availpages=%lu \n", + slapi_log_err(SLAPI_LOG_TRACE,"util_info_sys_pages", "USING pages=%lu, procpages=%lu, availpages=%lu \n", (unsigned long)*pages, (unsigned long)*procpages, (unsigned long)*availpages); return 0; @@ -1782,14 +1784,14 @@ int util_is_cachesize_sane(size_t *cachesize) */ cachepages = *cachesize / pagesize; - LDAPDebug(LDAP_DEBUG_TRACE,"util_is_cachesize_sane - cachesize=%lu / pagesize=%lu \n", - (unsigned long)*cachesize,(unsigned long)pagesize,0); + slapi_log_err(SLAPI_LOG_TRACE,"util_is_cachesize_sane", "cachesize=%lu / pagesize=%lu \n", + (unsigned long)*cachesize,(unsigned long)pagesize); #ifdef LINUX /* Linux we calculate availpages correctly, so USE IT */ issane = (int)(cachepages <= availpages); - LDAPDebug(LDAP_DEBUG_TRACE,"util_is_cachesize_sane - cachepages=%lu <= availpages=%lu\n", - (unsigned long)cachepages,(unsigned long)availpages,0); + slapi_log_err(SLAPI_LOG_TRACE,"util_is_cachesize_sane", "cachepages=%lu <= availpages=%lu\n", + (unsigned long)cachepages,(unsigned long)availpages); if (!issane) { /* Since we are ask for more than what's available, we give 3/4 of the remaining. @@ -1799,28 +1801,30 @@ int util_is_cachesize_sane(size_t *cachesize) /* These are now trace warnings, because it was to confusing to log this *then* kill the request anyway. * Instead, we will let the caller worry about the notification, and we'll just use this in debugging and tracing. */ - slapi_log_error(SLAPI_LOG_TRACE, "util_is_cachesize_sane", "Available pages %lu, requested pages %lu, pagesize %lu\n", (unsigned long)availpages, (unsigned long)cachepages, (unsigned long)pagesize); - slapi_log_error(SLAPI_LOG_TRACE, "util_is_cachesize_sane", "WARNING adjusted cachesize to %lu\n", (unsigned long)*cachesize); + slapi_log_err(SLAPI_LOG_TRACE, "util_is_cachesize_sane", + "Available pages %lu, requested pages %lu, pagesize %lu\n", (unsigned long)availpages, (unsigned long)cachepages, (unsigned long)pagesize); + slapi_log_err(SLAPI_LOG_TRACE, "util_is_cachesize_sane", + "WARNING adjusted cachesize to %lu\n", (unsigned long)*cachesize); } #else size_t freepages = 0; freepages = pages - procpages; - LDAPDebug(LDAP_DEBUG_TRACE,"util_is_cachesize_sane pages=%lu - procpages=%lu\n", - (unsigned long)pages,(unsigned long)procpages,0); + slapi_log_err(SLAPI_LOG_TRACE,"util_is_cachesize_sane", "pages=%lu - procpages=%lu\n", + (unsigned long)pages,(unsigned long)procpages); issane = (int)(cachepages <= freepages); - LDAPDebug(LDAP_DEBUG_TRACE,"util_is_cachesize_sane cachepages=%lu <= freepages=%lu\n", - (unsigned long)cachepages,(unsigned long)freepages,0); + slapi_log_err(SLAPI_LOG_TRACE,"util_is_cachesize_sane", "cachepages=%lu <= freepages=%lu\n", + (unsigned long)cachepages,(unsigned long)freepages); if (!issane) { *cachesize = (size_t)((pages - procpages) * pagesize); - slapi_log_error(SLAPI_LOG_WARNING, "util_is_cachesize_sane", "util_is_cachesize_sane WARNING adjusted cachesize to %lu\n", + slapi_log_err(SLAPI_LOG_WARNING, "util_is_cachesize_sane", "WARNING adjusted cachesize to %lu\n", (unsigned long )*cachesize); } #endif out: if (!issane) { - slapi_log_error(SLAPI_LOG_TRACE,"util_is_cachesize_sane", "WARNING: Cachesize not sane \n"); + slapi_log_err(SLAPI_LOG_TRACE,"util_is_cachesize_sane", "WARNING: Cachesize not sane \n"); } return issane; diff --git a/ldap/servers/slapd/uuid.c b/ldap/servers/slapd/uuid.c index cbd85d5..bfa8467 100644 --- a/ldap/servers/slapd/uuid.c +++ b/ldap/servers/slapd/uuid.c @@ -128,7 +128,7 @@ int uuid_init (const char *configDir, const Slapi_DN *configDN, PRBool mtGen) if (_state.initialized) { - slapi_log_error(SLAPI_LOG_ERR, MODULE, + slapi_log_err(SLAPI_LOG_ERR, MODULE, "uuid_init: generator is already initialized\n"); return UUID_SUCCESS; } @@ -139,7 +139,7 @@ int uuid_init (const char *configDir, const Slapi_DN *configDN, PRBool mtGen) rt = read_state(configDir, configDN, &newState); if (rt != UUID_SUCCESS) { - slapi_log_error(SLAPI_LOG_ERR, MODULE, + slapi_log_err(SLAPI_LOG_ERR, MODULE, "uuid_init: failed to get generator's state\n"); uuid_cleanup (); return rt; @@ -154,7 +154,7 @@ int uuid_init (const char *configDir, const Slapi_DN *configDN, PRBool mtGen) if (!_state.lock) { PRErrorCode prerr = PR_GetError(); - slapi_log_error(SLAPI_LOG_ERR, MODULE, "uuid_init: " + slapi_log_err(SLAPI_LOG_ERR, MODULE, "uuid_init: " "failed to create state lock; " SLAPI_COMPONENT_NAME_NSPR " error %d (%s).\n", prerr, slapd_pr_strerror(prerr)); uuid_cleanup (); @@ -173,12 +173,12 @@ int uuid_init (const char *configDir, const Slapi_DN *configDN, PRBool mtGen) * If server is readonly and error is UUID_LDAP_ERROR * we can continue. */ - slapi_log_error(SLAPI_LOG_WARNING, MODULE, + slapi_log_err(SLAPI_LOG_WARNING, MODULE, "The server is in read-only mode, therefore the unique ID generator cannot be used. " "Do not use this server in any replication agreement\n"); } else { - slapi_log_error(SLAPI_LOG_ERR, MODULE, "uuid_init: " + slapi_log_err(SLAPI_LOG_ERR, MODULE, "uuid_init: " "failed to save generator's state.\n"); uuid_cleanup (); return rt; @@ -336,7 +336,7 @@ static int uuid_create_mt(guid_t *uuid) * time calls are made by a uuid_update_state */ if (update_time_mt(×tamp, &clock_seq) == UUID_TIME_ERROR) { - slapi_log_error(SLAPI_LOG_ERR, MODULE, "uuid_create_mt: generator ran " + slapi_log_err(SLAPI_LOG_ERR, MODULE, "uuid_create_mt: generator ran " "out of sequence numbers.\n"); return UUID_TIME_ERROR; } @@ -390,7 +390,7 @@ static int read_state(const char *configDir, const Slapi_DN *configDN, PRBool *n if (rt != UUID_SUCCESS && rt != UUID_NOTFOUND) /* fatal error - bail out */ { - slapi_log_error(SLAPI_LOG_ERR, MODULE, + slapi_log_err(SLAPI_LOG_ERR, MODULE, "read_state: failed to get generator's state\n"); return rt; } @@ -435,7 +435,7 @@ static int read_state_from_file (const char *configDir) path = (char*)slapi_ch_malloc(strlen (STATE_FILE) + 1); if (path == NULL) { - slapi_log_error(SLAPI_LOG_ERR, MODULE, "read_state: " + slapi_log_err(SLAPI_LOG_ERR, MODULE, "read_state: " "memory allocation failed.\n"); return (UUID_MEMORY_ERROR); } @@ -447,7 +447,7 @@ static int read_state_from_file (const char *configDir) path = slapi_ch_smprintf("%s/%s", configDir, STATE_FILE); if (path == NULL) { - slapi_log_error(SLAPI_LOG_ERR, MODULE, "read_state: " + slapi_log_err(SLAPI_LOG_ERR, MODULE, "read_state: " "memory allocation failed.\n"); return (UUID_MEMORY_ERROR); } @@ -460,7 +460,7 @@ static int read_state_from_file (const char *configDir) if (!_state.fd) { PRErrorCode prerr = PR_GetError(); - slapi_log_error(SLAPI_LOG_ERR, MODULE, "read_state: " + slapi_log_err(SLAPI_LOG_ERR, MODULE, "read_state: " "failed to open state file - %s; " SLAPI_COMPONENT_NAME_NSPR " error %d (%s).\n", path, prerr, slapd_pr_strerror(prerr)); return (UUID_IO_ERROR); @@ -475,7 +475,7 @@ static int read_state_from_file (const char *configDir) if (rt == -1) { PRErrorCode prerr = PR_GetError(); - slapi_log_error(SLAPI_LOG_ERR, MODULE, "read_state: " + slapi_log_err(SLAPI_LOG_ERR, MODULE, "read_state: " "failed to read state information; " SLAPI_COMPONENT_NAME_NSPR " error %d (%s).\n", prerr, slapd_pr_strerror(prerr)); return (UUID_IO_ERROR); @@ -502,7 +502,7 @@ static int read_state_from_entry (const Slapi_DN *configDN) if (pb == NULL) { /* the only time NULL pb is returned is when memory allocation fails */ - slapi_log_error(SLAPI_LOG_ERR, MODULE, "read_state_from_entry: " + slapi_log_err(SLAPI_LOG_ERR, MODULE, "read_state_from_entry: " "NULL pblock returned from search\n"); return UUID_MEMORY_ERROR; } @@ -517,7 +517,7 @@ static int read_state_from_entry (const Slapi_DN *configDN) if (res != LDAP_SUCCESS) { - slapi_log_error(SLAPI_LOG_ERR, MODULE, "read_state_from_entry: " + slapi_log_err(SLAPI_LOG_ERR, MODULE, "read_state_from_entry: " "search operation failed; LDAP error - %d\n", res); rt = UUID_LDAP_ERROR; goto done; @@ -586,7 +586,7 @@ static int write_state_to_file(void) if (rt == -1) { PRErrorCode prerr = PR_GetError(); - slapi_log_error(SLAPI_LOG_ERR, MODULE, "write_state: " + slapi_log_err(SLAPI_LOG_ERR, MODULE, "write_state: " "failed to rewind state file; " SLAPI_COMPONENT_NAME_NSPR " error %d (%s).\n", prerr, slapd_pr_strerror(prerr)); return UUID_IO_ERROR; @@ -596,7 +596,7 @@ static int write_state_to_file(void) if (rt == -1) { PRErrorCode prerr = PR_GetError(); - slapi_log_error(SLAPI_LOG_ERR, MODULE, "write_state: " + slapi_log_err(SLAPI_LOG_ERR, MODULE, "write_state: " "failed to update state file; " SLAPI_COMPONENT_NAME_NSPR " error %d (%s).\n", prerr, slapd_pr_strerror(prerr)); @@ -649,7 +649,7 @@ static int add_state_entry(void) if (pb == NULL) { /* the only time NULL pb is returned is when memory allocation fails */ - slapi_log_error(SLAPI_LOG_ERR, MODULE, "add_state_entry: " + slapi_log_err(SLAPI_LOG_ERR, MODULE, "add_state_entry: " "NULL pblock returned from search\n"); return UUID_MEMORY_ERROR; } @@ -661,12 +661,12 @@ static int add_state_entry(void) if (rt != LDAP_SUCCESS) { - slapi_log_error(SLAPI_LOG_ERR, MODULE, "add_state_entry: " + slapi_log_err(SLAPI_LOG_ERR, MODULE, "add_state_entry: " "add operation failed; LDAP error - %d.\n", rt); return UUID_LDAP_ERROR; } - slapi_log_error(SLAPI_LOG_HOUSE, MODULE, "add_state_entry: " + slapi_log_err(SLAPI_LOG_HOUSE, MODULE, "add_state_entry: " "successfully added generator's state entry"); return UUID_SUCCESS; @@ -695,7 +695,7 @@ static int modify_state_entry(void) if (pb == NULL) { /* the only time NULL pb is returned is when memory allocation fails */ - slapi_log_error(SLAPI_LOG_ERR, MODULE, "modify_state_entry: " + slapi_log_err(SLAPI_LOG_ERR, MODULE, "modify_state_entry: " "NULL pblock returned from search\n"); return UUID_MEMORY_ERROR; } @@ -704,13 +704,13 @@ static int modify_state_entry(void) slapi_pblock_destroy(pb); if (res != LDAP_SUCCESS) { - slapi_log_error(SLAPI_LOG_ERR, MODULE, "modify_state_entry: " + slapi_log_err(SLAPI_LOG_ERR, MODULE, "modify_state_entry: " "update operation failed; LDAP error - %d.\n", res); return UUID_LDAP_ERROR; } - slapi_log_error(SLAPI_LOG_HOUSE, MODULE, "modify_state_entry: " + slapi_log_err(SLAPI_LOG_HOUSE, MODULE, "modify_state_entry: " "successfully updated generator's state entry"); return UUID_SUCCESS; } @@ -775,7 +775,7 @@ static int update_time_mt (uuid_time_t *timestamp, unsigned16 *clock_seq) if (_state.time_seq >= SEQ_PER_SEC - 1) { _state.time_seq = NEED_TIME_UPDATE; - slapi_log_error(SLAPI_LOG_ERR, MODULE, "update_time_mt: " + slapi_log_err(SLAPI_LOG_ERR, MODULE, "update_time_mt: " "ran out of time sequence numbers; " "uuid_update_state must be called\n"); diff --git a/ldap/servers/slapd/value.c b/ldap/servers/slapd/value.c index e7888af..63a1ca9 100644 --- a/ldap/servers/slapd/value.c +++ b/ldap/servers/slapd/value.c @@ -562,7 +562,7 @@ value_size(const Slapi_Value *v) static void value_dump( const Slapi_Value *value, const char *text) { - LDAPDebug(LDAP_DEBUG_DEBUG, "Slapi_Value %s ptr=%lx\n", text, value, 0); + slapi_log_err(SLAPI_LOG_DEBUG, "Slapi_Value %s ptr=%lx\n", text, value, 0); /* JCM - Dump value contents... */ } #endif diff --git a/ldap/servers/slapd/valueset.c b/ldap/servers/slapd/valueset.c index 66b34ab..7f630aa 100644 --- a/ldap/servers/slapd/valueset.c +++ b/ldap/servers/slapd/valueset.c @@ -894,9 +894,9 @@ valueset_value_syntax_cmp( const Slapi_Attr *a, const Slapi_Value *v1, const Sla * generate the keys will be found (there exists a default plugin) * log an error and continue. */ - LDAPDebug(LDAP_DEBUG_ERR, "valueset_value_syntax_cmp - " + slapi_log_err(SLAPI_LOG_ERR, "valueset_value_syntax_cmp", "slapi_attr_values2keys_sv failed for type %s\n", - a->a_type, 0, 0 ); + a->a_type); } else { const struct berval *bv1, *bv2; bv1 = &keyvals[0]->bv; @@ -1290,7 +1290,8 @@ valueset_remove_valuearray(Slapi_ValueSet *vs, const Slapi_Attr *a, Slapi_Value { if((flags & SLAPI_VALUE_FLAG_IGNOREERROR) == 0) { - LDAPDebug(LDAP_DEBUG_ARGS,"could not find value %d for attr %s\n", i-1, a->a_type, 0 ); + slapi_log_err(SLAPI_LOG_ARGS, "valueset_remove_valuearray", + "Could not find value %d for attr %s\n", i-1, a->a_type); rc= LDAP_NO_SUCH_ATTRIBUTE; } } diff --git a/ldap/servers/slapd/vattr.c b/ldap/servers/slapd/vattr.c index c128104..9e2d4f5 100644 --- a/ldap/servers/slapd/vattr.c +++ b/ldap/servers/slapd/vattr.c @@ -623,9 +623,9 @@ slapi_vattr_values_get_sp(vattr_context *c, if(!vattr_context_is_loop_msg_displayed(&c)) { /* Print a handy error log message */ - LDAPDebug(LDAP_DEBUG_ERR, - "slapi_vattr_values_get_sp - Detected virtual attribute loop in get on entry %s, attribute %s\n", - slapi_entry_get_dn_const(e), type, 0); + slapi_log_err(SLAPI_LOG_ERR, + "slapi_vattr_values_get_sp", "Detected virtual attribute loop in get on entry %s, attribute %s\n", + slapi_entry_get_dn_const(e), type); vattr_context_set_loop_msg_displayed(&c); } return rc; @@ -831,7 +831,9 @@ int slapi_vattr_namespace_values_get_sp(vattr_context *c, /* Print a handy error log message */ if(!vattr_context_is_loop_msg_displayed(&c)) { - LDAPDebug(LDAP_DEBUG_ERR,"slapi_vattr_namespace_values_get_sp - Detected virtual attribute loop in get on entry %s, attribute %s\n", slapi_entry_get_dn_const(e), type, 0); + slapi_log_err(SLAPI_LOG_ERR,"slapi_vattr_namespace_values_get_sp", + "Detected virtual attribute loop in get on entry %s, attribute %s\n", + slapi_entry_get_dn_const(e), type); vattr_context_set_loop_msg_displayed(&c); } return rc; @@ -1060,7 +1062,9 @@ int slapi_vattr_namespace_value_compare_sp(vattr_context *c,/* Entry we're inter if (0 != rc) { if(!vattr_context_is_loop_msg_displayed(&c)) { /* Print a handy error log message */ - LDAPDebug(LDAP_DEBUG_ERR,"slapi_vattr_namespace_value_compare_sp - Detected virtual attribute loop in compare on entry %s, attribute %s\n", slapi_entry_get_dn_const(e), type, 0); + slapi_log_err(SLAPI_LOG_ERR,"slapi_vattr_namespace_value_compare_sp", + "Detected virtual attribute loop in compare on entry %s, attribute %s\n", + slapi_entry_get_dn_const(e), type); vattr_context_set_loop_msg_displayed(&c); } return rc; @@ -1197,7 +1201,7 @@ int slapi_vattr_list_attrs(/* Entry we're interested in */ Slapi_Entry *e, vattr_type_list_context type_context = {0}; if (NULL == types || NULL == buffer_flags) { - LDAPDebug(LDAP_DEBUG_ERR, "slapi_vattr_list_attrs - Invalid param\n", 0, 0, 0); + slapi_log_err(SLAPI_LOG_ERR, "slapi_vattr_list_attrs", "Invalid param\n"); return -1; } @@ -1946,7 +1950,7 @@ int vattr_add_attrval(objAttrValue **attrval, char *val) int ret = 0; objAttrValue *theVal; - LDAPDebug(LDAP_DEBUG_TRACE, "--> vattr_add_attrval\n",0,0,0); + slapi_log_err(SLAPI_LOG_TRACE, "vattr_add_attrval", "-->\n"); /* create the attrvalue */ theVal = (objAttrValue*) slapi_ch_malloc(sizeof(objAttrValue)); @@ -1961,17 +1965,17 @@ int vattr_add_attrval(objAttrValue **attrval, char *val) else { slapi_ch_free((void**)&theVal); - LDAPDebug(LDAP_DEBUG_ERR, "vattr_add_attrval - Failed to allocate memory\n",0,0,0); + slapi_log_err(SLAPI_LOG_ERR, "vattr_add_attrval", "Failed to allocate memory\n"); ret = -1; } } else { - LDAPDebug(LDAP_DEBUG_ERR, "vattr_add_attrval - Failed to allocate memory\n",0,0,0); + slapi_log_err(SLAPI_LOG_ERR, "vattr_add_attrval", "Failed to allocate memory\n"); ret = -1; } - LDAPDebug(LDAP_DEBUG_TRACE, "<-- vattr_add_attrval\n",0,0,0); + slapi_log_err(SLAPI_LOG_TRACE, "vattr_add_attrval", "-->\n"); return ret; } @@ -1981,7 +1985,7 @@ objAttrValue *vattr_map_entry_build_schema(char *type_name) objAttrValue *ret = 0; struct objclass *oc; - LDAPDebug(LDAP_DEBUG_TRACE, "--> vattr_map_entry_build_schema\n",0,0,0); + slapi_log_err(SLAPI_LOG_TRACE, "vattr_map_entry_build_schema", "-->\n"); /* this is the first opportunity to register * with the statechange api, our init function @@ -2000,7 +2004,7 @@ objAttrValue *vattr_map_entry_build_schema(char *type_name) if(!config_get_schemacheck()) { - LDAPDebug(LDAP_DEBUG_TRACE, "<-- vattr_map_entry_build_schema - schema off\n",0,0,0); + slapi_log_err(SLAPI_LOG_TRACE, "vattr_map_entry_build_schema", "<-- schema off\n"); return 0; } @@ -2038,7 +2042,7 @@ objAttrValue *vattr_map_entry_build_schema(char *type_name) } oc_unlock(); - LDAPDebug(LDAP_DEBUG_TRACE, "<-- vattr_map_entry_build_schema\n",0,0,0); + slapi_log_err(SLAPI_LOG_TRACE, "vattr_map_entry_build_schema", "<--\n"); return ret; } diff --git a/lib/base/ereport.cpp b/lib/base/ereport.cpp index e409de0..3836c76 100644 --- a/lib/base/ereport.cpp +++ b/lib/base/ereport.cpp @@ -45,13 +45,13 @@ NSAPI_PUBLIC int ereport_v(int degree, char *fmt, va_list args) case LOG_INFORM: case LOG_VERBOSE: case LOG_MISCONFIG: -// slapi_log_error(SLAPI_LOG_PLUGIN, ACL_PLUGIN_NAME, errstr); +// slapi_log_err(SLAPI_LOG_PLUGIN, ACL_PLUGIN_NAME, errstr); break; case LOG_SECURITY: -// slapi_log_error(SLAPI_LOG_ACL, ACL_PLUGIN_NAME, errstr); +// slapi_log_err(SLAPI_LOG_ACL, ACL_PLUGIN_NAME, errstr); break; case LOG_CATASTROPHE: -// slapi_log_error(SLAPI_LOG_ERR, ACL_PLUGIN_NAME, errstr); +// slapi_log_err(SLAPI_LOG_ERR, ACL_PLUGIN_NAME, errstr); break; default: break; diff --git a/ltmain.sh b/ltmain.sh index 63ae69d..0f0a2da 100644 --- a/ltmain.sh +++ b/ltmain.sh @@ -1,9 +1,12 @@ +#! /bin/sh +## DO NOT EDIT - This file generated from ./build-aux/ltmain.in +## by inline-source v2014-01-03.01 -# libtool (GNU libtool) 2.4.2 +# libtool (GNU libtool) 2.4.6 +# Provide generalized library-building support services. # Written by Gordon Matzigkeit , 1996 -# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, 2006, -# 2007, 2008, 2009, 2010, 2011 Free Software Foundation, Inc. +# Copyright (C) 1996-2015 Free Software Foundation, Inc. # This is free software; see the source for copying conditions. There is NO # warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. @@ -23,881 +26,2112 @@ # General Public License for more details. # # You should have received a copy of the GNU General Public License -# along with GNU Libtool; see the file COPYING. If not, a copy -# can be downloaded from http://www.gnu.org/licenses/gpl.html, -# or obtained by writing to the Free Software Foundation, Inc., -# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +# along with this program. If not, see . -# Usage: $progname [OPTION]... [MODE-ARG]... -# -# Provide generalized library-building support services. -# -# --config show all configuration variables -# --debug enable verbose shell tracing -# -n, --dry-run display commands without modifying any files -# --features display basic configuration information and exit -# --mode=MODE use operation mode MODE -# --preserve-dup-deps don't remove duplicate dependency libraries -# --quiet, --silent don't print informational messages -# --no-quiet, --no-silent -# print informational messages (default) -# --no-warn don't display warning messages -# --tag=TAG use configuration variables from tag TAG -# -v, --verbose print more informational messages than default -# --no-verbose don't print the extra informational messages -# --version print version information -# -h, --help, --help-all print short, long, or detailed help message -# -# MODE must be one of the following: -# -# clean remove files from the build directory -# compile compile a source file into a libtool object -# execute automatically set library path, then run a program -# finish complete the installation of libtool libraries -# install install libraries or executables -# link create a library or an executable -# uninstall remove libraries from an installed directory -# -# MODE-ARGS vary depending on the MODE. When passed as first option, -# `--mode=MODE' may be abbreviated as `MODE' or a unique abbreviation of that. -# Try `$progname --help --mode=MODE' for a more detailed description of MODE. -# -# When reporting a bug, please describe a test case to reproduce it and -# include the following information: -# -# host-triplet: $host -# shell: $SHELL -# compiler: $LTCC -# compiler flags: $LTCFLAGS -# linker: $LD (gnu? $with_gnu_ld) -# $progname: (GNU libtool) 2.4.2 -# automake: $automake_version -# autoconf: $autoconf_version -# -# Report bugs to . -# GNU libtool home page: . -# General help using GNU software: . PROGRAM=libtool PACKAGE=libtool -VERSION=2.4.2 -TIMESTAMP="" -package_revision=1.3337 +VERSION=2.4.6 +package_revision=2.4.6 -# Be Bourne compatible -if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then + +## ------ ## +## Usage. ## +## ------ ## + +# Run './libtool --help' for help with using this script from the +# command line. + + +## ------------------------------- ## +## User overridable command paths. ## +## ------------------------------- ## + +# After configure completes, it has a better idea of some of the +# shell tools we need than the defaults used by the functions shared +# with bootstrap, so set those here where they can still be over- +# ridden by the user, but otherwise take precedence. + +: ${AUTOCONF="autoconf"} +: ${AUTOMAKE="automake"} + + +## -------------------------- ## +## Source external libraries. ## +## -------------------------- ## + +# Much of our low-level functionality needs to be sourced from external +# libraries, which are installed to $pkgauxdir. + +# Set a version string for this script. +scriptversion=2015-01-20.17; # UTC + +# General shell script boiler plate, and helper functions. +# Written by Gary V. Vaughan, 2004 + +# Copyright (C) 2004-2015 Free Software Foundation, Inc. +# This is free software; see the source for copying conditions. There is NO +# warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 3 of the License, or +# (at your option) any later version. + +# As a special exception to the GNU General Public License, if you distribute +# this file as part of a program or library that is built using GNU Libtool, +# you may include this file under the same distribution terms that you use +# for the rest of that program. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNES FOR A PARTICULAR PURPOSE. See the GNU +# General Public License for more details. + +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . + +# Please report bugs or propose patches to gary@gnu.org. + + +## ------ ## +## Usage. ## +## ------ ## + +# Evaluate this file near the top of your script to gain access to +# the functions and variables defined here: +# +# . `echo "$0" | ${SED-sed} 's|[^/]*$||'`/build-aux/funclib.sh +# +# If you need to override any of the default environment variable +# settings, do that before evaluating this file. + + +## -------------------- ## +## Shell normalisation. ## +## -------------------- ## + +# Some shells need a little help to be as Bourne compatible as possible. +# Before doing anything else, make sure all that help has been provided! + +DUALCASE=1; export DUALCASE # for MKS sh +if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then : emulate sh NULLCMD=: - # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which + # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST else - case `(set -o) 2>/dev/null` in *posix*) set -o posix;; esac + case `(set -o) 2>/dev/null` in *posix*) set -o posix ;; esac fi -BIN_SH=xpg4; export BIN_SH # for Tru64 -DUALCASE=1; export DUALCASE # for MKS sh - -# A function that is used when there is no print builtin or printf. -func_fallback_echo () -{ - eval 'cat <<_LTECHO_EOF -$1 -_LTECHO_EOF' -} -# NLS nuisances: We save the old values to restore during execute mode. -lt_user_locale= -lt_safe_locale= -for lt_var in LANG LANGUAGE LC_ALL LC_CTYPE LC_COLLATE LC_MESSAGES +# NLS nuisances: We save the old values in case they are required later. +_G_user_locale= +_G_safe_locale= +for _G_var in LANG LANGUAGE LC_ALL LC_CTYPE LC_COLLATE LC_MESSAGES do - eval "if test \"\${$lt_var+set}\" = set; then - save_$lt_var=\$$lt_var - $lt_var=C - export $lt_var - lt_user_locale=\"$lt_var=\\\$save_\$lt_var; \$lt_user_locale\" - lt_safe_locale=\"$lt_var=C; \$lt_safe_locale\" + eval "if test set = \"\${$_G_var+set}\"; then + save_$_G_var=\$$_G_var + $_G_var=C + export $_G_var + _G_user_locale=\"$_G_var=\\\$save_\$_G_var; \$_G_user_locale\" + _G_safe_locale=\"$_G_var=C; \$_G_safe_locale\" fi" done -LC_ALL=C -LANGUAGE=C -export LANGUAGE LC_ALL -$lt_unset CDPATH +# CDPATH. +(unset CDPATH) >/dev/null 2>&1 && unset CDPATH +# Make sure IFS has a sensible default +sp=' ' +nl=' +' +IFS="$sp $nl" + +# There are apparently some retarded systems that use ';' as a PATH separator! +if test "${PATH_SEPARATOR+set}" != set; then + PATH_SEPARATOR=: + (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { + (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || + PATH_SEPARATOR=';' + } +fi -# Work around backward compatibility issue on IRIX 6.5. On IRIX 6.4+, sh -# is ksh but when the shell is invoked as "sh" and the current value of -# the _XPG environment variable is not equal to 1 (one), the special -# positional parameter $0, within a function call, is the name of the -# function. -progpath="$0" +## ------------------------- ## +## Locate command utilities. ## +## ------------------------- ## + + +# func_executable_p FILE +# ---------------------- +# Check that FILE is an executable regular file. +func_executable_p () +{ + test -f "$1" && test -x "$1" +} + + +# func_path_progs PROGS_LIST CHECK_FUNC [PATH] +# -------------------------------------------- +# Search for either a program that responds to --version with output +# containing "GNU", or else returned by CHECK_FUNC otherwise, by +# trying all the directories in PATH with each of the elements of +# PROGS_LIST. +# +# CHECK_FUNC should accept the path to a candidate program, and +# set $func_check_prog_result if it truncates its output less than +# $_G_path_prog_max characters. +func_path_progs () +{ + _G_progs_list=$1 + _G_check_func=$2 + _G_PATH=${3-"$PATH"} + + _G_path_prog_max=0 + _G_path_prog_found=false + _G_save_IFS=$IFS; IFS=${PATH_SEPARATOR-:} + for _G_dir in $_G_PATH; do + IFS=$_G_save_IFS + test -z "$_G_dir" && _G_dir=. + for _G_prog_name in $_G_progs_list; do + for _exeext in '' .EXE; do + _G_path_prog=$_G_dir/$_G_prog_name$_exeext + func_executable_p "$_G_path_prog" || continue + case `"$_G_path_prog" --version 2>&1` in + *GNU*) func_path_progs_result=$_G_path_prog _G_path_prog_found=: ;; + *) $_G_check_func $_G_path_prog + func_path_progs_result=$func_check_prog_result + ;; + esac + $_G_path_prog_found && break 3 + done + done + done + IFS=$_G_save_IFS + test -z "$func_path_progs_result" && { + echo "no acceptable sed could be found in \$PATH" >&2 + exit 1 + } +} + + +# We want to be able to use the functions in this file before configure +# has figured out where the best binaries are kept, which means we have +# to search for them ourselves - except when the results are already set +# where we skip the searches. + +# Unless the user overrides by setting SED, search the path for either GNU +# sed, or the sed that truncates its output the least. +test -z "$SED" && { + _G_sed_script=s/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb/ + for _G_i in 1 2 3 4 5 6 7; do + _G_sed_script=$_G_sed_script$nl$_G_sed_script + done + echo "$_G_sed_script" 2>/dev/null | sed 99q >conftest.sed + _G_sed_script= + + func_check_prog_sed () + { + _G_path_prog=$1 + + _G_count=0 + printf 0123456789 >conftest.in + while : + do + cat conftest.in conftest.in >conftest.tmp + mv conftest.tmp conftest.in + cp conftest.in conftest.nl + echo '' >> conftest.nl + "$_G_path_prog" -f conftest.sed conftest.out 2>/dev/null || break + diff conftest.out conftest.nl >/dev/null 2>&1 || break + _G_count=`expr $_G_count + 1` + if test "$_G_count" -gt "$_G_path_prog_max"; then + # Best one so far, save it but keep looking for a better one + func_check_prog_result=$_G_path_prog + _G_path_prog_max=$_G_count + fi + # 10*(2^10) chars as input seems more than enough + test 10 -lt "$_G_count" && break + done + rm -f conftest.in conftest.tmp conftest.nl conftest.out + } + + func_path_progs "sed gsed" func_check_prog_sed $PATH:/usr/xpg4/bin + rm -f conftest.sed + SED=$func_path_progs_result +} + + +# Unless the user overrides by setting GREP, search the path for either GNU +# grep, or the grep that truncates its output the least. +test -z "$GREP" && { + func_check_prog_grep () + { + _G_path_prog=$1 + + _G_count=0 + _G_path_prog_max=0 + printf 0123456789 >conftest.in + while : + do + cat conftest.in conftest.in >conftest.tmp + mv conftest.tmp conftest.in + cp conftest.in conftest.nl + echo 'GREP' >> conftest.nl + "$_G_path_prog" -e 'GREP$' -e '-(cannot match)-' conftest.out 2>/dev/null || break + diff conftest.out conftest.nl >/dev/null 2>&1 || break + _G_count=`expr $_G_count + 1` + if test "$_G_count" -gt "$_G_path_prog_max"; then + # Best one so far, save it but keep looking for a better one + func_check_prog_result=$_G_path_prog + _G_path_prog_max=$_G_count + fi + # 10*(2^10) chars as input seems more than enough + test 10 -lt "$_G_count" && break + done + rm -f conftest.in conftest.tmp conftest.nl conftest.out + } + + func_path_progs "grep ggrep" func_check_prog_grep $PATH:/usr/xpg4/bin + GREP=$func_path_progs_result +} + + +## ------------------------------- ## +## User overridable command paths. ## +## ------------------------------- ## + +# All uppercase variable names are used for environment variables. These +# variables can be overridden by the user before calling a script that +# uses them if a suitable command of that name is not already available +# in the command search PATH. : ${CP="cp -f"} -test "${ECHO+set}" = set || ECHO=${as_echo-'printf %s\n'} +: ${ECHO="printf %s\n"} +: ${EGREP="$GREP -E"} +: ${FGREP="$GREP -F"} +: ${LN_S="ln -s"} : ${MAKE="make"} : ${MKDIR="mkdir"} : ${MV="mv -f"} : ${RM="rm -f"} : ${SHELL="${CONFIG_SHELL-/bin/sh}"} -: ${Xsed="$SED -e 1s/^X//"} - -# Global variables: -EXIT_SUCCESS=0 -EXIT_FAILURE=1 -EXIT_MISMATCH=63 # $? = 63 is used to indicate version mismatch to missing. -EXIT_SKIP=77 # $? = 77 is used to indicate a skipped test to automake. - -exit_status=$EXIT_SUCCESS - -# Make sure IFS has a sensible default -lt_nl=' -' -IFS=" $lt_nl" -dirname="s,/[^/]*$,," -basename="s,^.*/,," -# func_dirname file append nondir_replacement -# Compute the dirname of FILE. If nonempty, add APPEND to the result, -# otherwise set result to NONDIR_REPLACEMENT. -func_dirname () -{ - func_dirname_result=`$ECHO "${1}" | $SED "$dirname"` - if test "X$func_dirname_result" = "X${1}"; then - func_dirname_result="${3}" - else - func_dirname_result="$func_dirname_result${2}" - fi -} # func_dirname may be replaced by extended shell implementation +## -------------------- ## +## Useful sed snippets. ## +## -------------------- ## +sed_dirname='s|/[^/]*$||' +sed_basename='s|^.*/||' -# func_basename file -func_basename () -{ - func_basename_result=`$ECHO "${1}" | $SED "$basename"` -} # func_basename may be replaced by extended shell implementation +# Sed substitution that helps us do robust quoting. It backslashifies +# metacharacters that are still active within double-quoted strings. +sed_quote_subst='s|\([`"$\\]\)|\\\1|g' +# Same as above, but do not quote variable references. +sed_double_quote_subst='s/\(["`\\]\)/\\\1/g' -# func_dirname_and_basename file append nondir_replacement -# perform func_basename and func_dirname in a single function -# call: -# dirname: Compute the dirname of FILE. If nonempty, -# add APPEND to the result, otherwise set result -# to NONDIR_REPLACEMENT. -# value returned in "$func_dirname_result" -# basename: Compute filename of FILE. -# value retuned in "$func_basename_result" -# Implementation must be kept synchronized with func_dirname -# and func_basename. For efficiency, we do not delegate to -# those functions but instead duplicate the functionality here. -func_dirname_and_basename () -{ - # Extract subdirectory from the argument. - func_dirname_result=`$ECHO "${1}" | $SED -e "$dirname"` - if test "X$func_dirname_result" = "X${1}"; then - func_dirname_result="${3}" - else - func_dirname_result="$func_dirname_result${2}" - fi - func_basename_result=`$ECHO "${1}" | $SED -e "$basename"` -} # func_dirname_and_basename may be replaced by extended shell implementation +# Sed substitution that turns a string into a regex matching for the +# string literally. +sed_make_literal_regex='s|[].[^$\\*\/]|\\&|g' +# Sed substitution that converts a w32 file name or path +# that contains forward slashes, into one that contains +# (escaped) backslashes. A very naive implementation. +sed_naive_backslashify='s|\\\\*|\\|g;s|/|\\|g;s|\\|\\\\|g' + +# Re-'\' parameter expansions in output of sed_double_quote_subst that +# were '\'-ed in input to the same. If an odd number of '\' preceded a +# '$' in input to sed_double_quote_subst, that '$' was protected from +# expansion. Since each input '\' is now two '\'s, look for any number +# of runs of four '\'s followed by two '\'s and then a '$'. '\' that '$'. +_G_bs='\\' +_G_bs2='\\\\' +_G_bs4='\\\\\\\\' +_G_dollar='\$' +sed_double_backslash="\ + s/$_G_bs4/&\\ +/g + s/^$_G_bs2$_G_dollar/$_G_bs&/ + s/\\([^$_G_bs]\\)$_G_bs2$_G_dollar/\\1$_G_bs2$_G_bs$_G_dollar/g + s/\n//g" -# func_stripname prefix suffix name -# strip PREFIX and SUFFIX off of NAME. -# PREFIX and SUFFIX must not contain globbing or regex special -# characters, hashes, percent signs, but SUFFIX may contain a leading -# dot (in which case that matches only a dot). -# func_strip_suffix prefix name -func_stripname () -{ - case ${2} in - .*) func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%\\\\${2}\$%%"`;; - *) func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%${2}\$%%"`;; - esac -} # func_stripname may be replaced by extended shell implementation +## ----------------- ## +## Global variables. ## +## ----------------- ## -# These SED scripts presuppose an absolute path with a trailing slash. -pathcar='s,^/\([^/]*\).*$,\1,' -pathcdr='s,^/[^/]*,,' -removedotparts=':dotsl - s@/\./@/@g - t dotsl - s,/\.$,/,' -collapseslashes='s@/\{1,\}@/@g' -finalslash='s,/*$,/,' +# Except for the global variables explicitly listed below, the following +# functions in the '^func_' namespace, and the '^require_' namespace +# variables initialised in the 'Resource management' section, sourcing +# this file will not pollute your global namespace with anything +# else. There's no portable way to scope variables in Bourne shell +# though, so actually running these functions will sometimes place +# results into a variable named after the function, and often use +# temporary variables in the '^_G_' namespace. If you are careful to +# avoid using those namespaces casually in your sourcing script, things +# should continue to work as you expect. And, of course, you can freely +# overwrite any of the functions or variables defined here before +# calling anything to customize them. -# func_normal_abspath PATH -# Remove doubled-up and trailing slashes, "." path components, -# and cancel out any ".." path components in PATH after making -# it an absolute path. -# value returned in "$func_normal_abspath_result" -func_normal_abspath () -{ - # Start from root dir and reassemble the path. - func_normal_abspath_result= - func_normal_abspath_tpath=$1 - func_normal_abspath_altnamespace= - case $func_normal_abspath_tpath in - "") - # Empty path, that just means $cwd. - func_stripname '' '/' "`pwd`" - func_normal_abspath_result=$func_stripname_result - return - ;; - # The next three entries are used to spot a run of precisely - # two leading slashes without using negated character classes; - # we take advantage of case's first-match behaviour. - ///*) - # Unusual form of absolute path, do nothing. - ;; - //*) - # Not necessarily an ordinary path; POSIX reserves leading '//' - # and for example Cygwin uses it to access remote file shares - # over CIFS/SMB, so we conserve a leading double slash if found. - func_normal_abspath_altnamespace=/ - ;; - /*) - # Absolute path, do nothing. - ;; - *) - # Relative path, prepend $cwd. - func_normal_abspath_tpath=`pwd`/$func_normal_abspath_tpath - ;; - esac - # Cancel out all the simple stuff to save iterations. We also want - # the path to end with a slash for ease of parsing, so make sure - # there is one (and only one) here. - func_normal_abspath_tpath=`$ECHO "$func_normal_abspath_tpath" | $SED \ - -e "$removedotparts" -e "$collapseslashes" -e "$finalslash"` - while :; do - # Processed it all yet? - if test "$func_normal_abspath_tpath" = / ; then - # If we ascended to the root using ".." the result may be empty now. - if test -z "$func_normal_abspath_result" ; then - func_normal_abspath_result=/ - fi - break - fi - func_normal_abspath_tcomponent=`$ECHO "$func_normal_abspath_tpath" | $SED \ - -e "$pathcar"` - func_normal_abspath_tpath=`$ECHO "$func_normal_abspath_tpath" | $SED \ - -e "$pathcdr"` - # Figure out what to do with it - case $func_normal_abspath_tcomponent in - "") - # Trailing empty path component, ignore it. - ;; - ..) - # Parent dir; strip last assembled component from result. - func_dirname "$func_normal_abspath_result" - func_normal_abspath_result=$func_dirname_result - ;; - *) - # Actual path component, append it. - func_normal_abspath_result=$func_normal_abspath_result/$func_normal_abspath_tcomponent - ;; - esac - done - # Restore leading double-slash if one was found on entry. - func_normal_abspath_result=$func_normal_abspath_altnamespace$func_normal_abspath_result -} +EXIT_SUCCESS=0 +EXIT_FAILURE=1 +EXIT_MISMATCH=63 # $? = 63 is used to indicate version mismatch to missing. +EXIT_SKIP=77 # $? = 77 is used to indicate a skipped test to automake. -# func_relative_path SRCDIR DSTDIR -# generates a relative path from SRCDIR to DSTDIR, with a trailing -# slash if non-empty, suitable for immediately appending a filename -# without needing to append a separator. -# value returned in "$func_relative_path_result" -func_relative_path () -{ - func_relative_path_result= - func_normal_abspath "$1" - func_relative_path_tlibdir=$func_normal_abspath_result - func_normal_abspath "$2" - func_relative_path_tbindir=$func_normal_abspath_result - - # Ascend the tree starting from libdir - while :; do - # check if we have found a prefix of bindir - case $func_relative_path_tbindir in - $func_relative_path_tlibdir) - # found an exact match - func_relative_path_tcancelled= - break - ;; - $func_relative_path_tlibdir*) - # found a matching prefix - func_stripname "$func_relative_path_tlibdir" '' "$func_relative_path_tbindir" - func_relative_path_tcancelled=$func_stripname_result - if test -z "$func_relative_path_result"; then - func_relative_path_result=. - fi - break - ;; - *) - func_dirname $func_relative_path_tlibdir - func_relative_path_tlibdir=${func_dirname_result} - if test "x$func_relative_path_tlibdir" = x ; then - # Have to descend all the way to the root! - func_relative_path_result=../$func_relative_path_result - func_relative_path_tcancelled=$func_relative_path_tbindir - break - fi - func_relative_path_result=../$func_relative_path_result - ;; - esac - done +# Allow overriding, eg assuming that you follow the convention of +# putting '$debug_cmd' at the start of all your functions, you can get +# bash to show function call trace with: +# +# debug_cmd='eval echo "${FUNCNAME[0]} $*" >&2' bash your-script-name +debug_cmd=${debug_cmd-":"} +exit_cmd=: - # Now calculate path; take care to avoid doubling-up slashes. - func_stripname '' '/' "$func_relative_path_result" - func_relative_path_result=$func_stripname_result - func_stripname '/' '/' "$func_relative_path_tcancelled" - if test "x$func_stripname_result" != x ; then - func_relative_path_result=${func_relative_path_result}/${func_stripname_result} - fi +# By convention, finish your script with: +# +# exit $exit_status +# +# so that you can set exit_status to non-zero if you want to indicate +# something went wrong during execution without actually bailing out at +# the point of failure. +exit_status=$EXIT_SUCCESS - # Normalisation. If bindir is libdir, return empty string, - # else relative path ending with a slash; either way, target - # file name can be directly appended. - if test ! -z "$func_relative_path_result"; then - func_stripname './' '' "$func_relative_path_result/" - func_relative_path_result=$func_stripname_result - fi -} +# Work around backward compatibility issue on IRIX 6.5. On IRIX 6.4+, sh +# is ksh but when the shell is invoked as "sh" and the current value of +# the _XPG environment variable is not equal to 1 (one), the special +# positional parameter $0, within a function call, is the name of the +# function. +progpath=$0 -# The name of this program: -func_dirname_and_basename "$progpath" -progname=$func_basename_result +# The name of this program. +progname=`$ECHO "$progpath" |$SED "$sed_basename"` -# Make sure we have an absolute path for reexecution: +# Make sure we have an absolute progpath for reexecution: case $progpath in [\\/]*|[A-Za-z]:\\*) ;; *[\\/]*) - progdir=$func_dirname_result + progdir=`$ECHO "$progpath" |$SED "$sed_dirname"` progdir=`cd "$progdir" && pwd` - progpath="$progdir/$progname" + progpath=$progdir/$progname ;; *) - save_IFS="$IFS" + _G_IFS=$IFS IFS=${PATH_SEPARATOR-:} for progdir in $PATH; do - IFS="$save_IFS" + IFS=$_G_IFS test -x "$progdir/$progname" && break done - IFS="$save_IFS" + IFS=$_G_IFS test -n "$progdir" || progdir=`pwd` - progpath="$progdir/$progname" + progpath=$progdir/$progname ;; esac -# Sed substitution that helps us do robust quoting. It backslashifies -# metacharacters that are still active within double-quoted strings. -Xsed="${SED}"' -e 1s/^X//' -sed_quote_subst='s/\([`"$\\]\)/\\\1/g' - -# Same as above, but do not quote variable references. -double_quote_subst='s/\(["`\\]\)/\\\1/g' -# Sed substitution that turns a string into a regex matching for the -# string literally. -sed_make_literal_regex='s,[].[^$\\*\/],\\&,g' +## ----------------- ## +## Standard options. ## +## ----------------- ## -# Sed substitution that converts a w32 file name or path -# which contains forward slashes, into one that contains -# (escaped) backslashes. A very naive implementation. -lt_sed_naive_backslashify='s|\\\\*|\\|g;s|/|\\|g;s|\\|\\\\|g' - -# Re-`\' parameter expansions in output of double_quote_subst that were -# `\'-ed in input to the same. If an odd number of `\' preceded a '$' -# in input to double_quote_subst, that '$' was protected from expansion. -# Since each input `\' is now two `\'s, look for any number of runs of -# four `\'s followed by two `\'s and then a '$'. `\' that '$'. -bs='\\' -bs2='\\\\' -bs4='\\\\\\\\' -dollar='\$' -sed_double_backslash="\ - s/$bs4/&\\ -/g - s/^$bs2$dollar/$bs&/ - s/\\([^$bs]\\)$bs2$dollar/\\1$bs2$bs$dollar/g - s/\n//g" +# The following options affect the operation of the functions defined +# below, and should be set appropriately depending on run-time para- +# meters passed on the command line. -# Standard options: opt_dry_run=false -opt_help=false opt_quiet=false opt_verbose=false -opt_warning=: -# func_echo arg... -# Echo program name prefixed message, along with the current mode -# name if it has been set yet. -func_echo () -{ - $ECHO "$progname: ${opt_mode+$opt_mode: }$*" -} +# Categories 'all' and 'none' are always available. Append any others +# you will pass as the first argument to func_warning from your own +# code. +warning_categories= -# func_verbose arg... -# Echo program name prefixed message in verbose mode only. -func_verbose () -{ - $opt_verbose && func_echo ${1+"$@"} +# By default, display warnings according to 'opt_warning_types'. Set +# 'warning_func' to ':' to elide all warnings, or func_fatal_error to +# treat the next displayed warning as a fatal error. +warning_func=func_warn_and_continue - # A bug in bash halts the script if the last line of a function - # fails when set -e is in force, so we need another command to - # work around that: - : -} +# Set to 'all' to display all warnings, 'none' to suppress all +# warnings, or a space delimited list of some subset of +# 'warning_categories' to display only the listed warnings. +opt_warning_types=all -# func_echo_all arg... -# Invoke $ECHO with all args, space-separated. -func_echo_all () -{ - $ECHO "$*" -} -# func_error arg... -# Echo program name prefixed message to standard error. -func_error () -{ - $ECHO "$progname: ${opt_mode+$opt_mode: }"${1+"$@"} 1>&2 -} +## -------------------- ## +## Resource management. ## +## -------------------- ## -# func_warning arg... -# Echo program name prefixed warning message to standard error. -func_warning () -{ - $opt_warning && $ECHO "$progname: ${opt_mode+$opt_mode: }warning: "${1+"$@"} 1>&2 +# This section contains definitions for functions that each ensure a +# particular resource (a file, or a non-empty configuration variable for +# example) is available, and if appropriate to extract default values +# from pertinent package files. Call them using their associated +# 'require_*' variable to ensure that they are executed, at most, once. +# +# It's entirely deliberate that calling these functions can set +# variables that don't obey the namespace limitations obeyed by the rest +# of this file, in order that that they be as useful as possible to +# callers. - # bash bug again: - : -} -# func_fatal_error arg... -# Echo program name prefixed message to standard error, and exit. -func_fatal_error () +# require_term_colors +# ------------------- +# Allow display of bold text on terminals that support it. +require_term_colors=func_require_term_colors +func_require_term_colors () { - func_error ${1+"$@"} - exit $EXIT_FAILURE -} + $debug_cmd + + test -t 1 && { + # COLORTERM and USE_ANSI_COLORS environment variables take + # precedence, because most terminfo databases neglect to describe + # whether color sequences are supported. + test -n "${COLORTERM+set}" && : ${USE_ANSI_COLORS="1"} + + if test 1 = "$USE_ANSI_COLORS"; then + # Standard ANSI escape sequences + tc_reset='' + tc_bold=''; tc_standout='' + tc_red=''; tc_green='' + tc_blue=''; tc_cyan='' + else + # Otherwise trust the terminfo database after all. + test -n "`tput sgr0 2>/dev/null`" && { + tc_reset=`tput sgr0` + test -n "`tput bold 2>/dev/null`" && tc_bold=`tput bold` + tc_standout=$tc_bold + test -n "`tput smso 2>/dev/null`" && tc_standout=`tput smso` + test -n "`tput setaf 1 2>/dev/null`" && tc_red=`tput setaf 1` + test -n "`tput setaf 2 2>/dev/null`" && tc_green=`tput setaf 2` + test -n "`tput setaf 4 2>/dev/null`" && tc_blue=`tput setaf 4` + test -n "`tput setaf 5 2>/dev/null`" && tc_cyan=`tput setaf 5` + } + fi + } -# func_fatal_help arg... -# Echo program name prefixed message to standard error, followed by -# a help hint, and exit. -func_fatal_help () -{ - func_error ${1+"$@"} - func_fatal_error "$help" + require_term_colors=: } -help="Try \`$progname --help' for more information." ## default -# func_grep expression filename +## ----------------- ## +## Function library. ## +## ----------------- ## + +# This section contains a variety of useful functions to call in your +# scripts. Take note of the portable wrappers for features provided by +# some modern shells, which will fall back to slower equivalents on +# less featureful shells. + + +# func_append VAR VALUE +# --------------------- +# Append VALUE onto the existing contents of VAR. + + # We should try to minimise forks, especially on Windows where they are + # unreasonably slow, so skip the feature probes when bash or zsh are + # being used: + if test set = "${BASH_VERSION+set}${ZSH_VERSION+set}"; then + : ${_G_HAVE_ARITH_OP="yes"} + : ${_G_HAVE_XSI_OPS="yes"} + # The += operator was introduced in bash 3.1 + case $BASH_VERSION in + [12].* | 3.0 | 3.0*) ;; + *) + : ${_G_HAVE_PLUSEQ_OP="yes"} + ;; + esac + fi + + # _G_HAVE_PLUSEQ_OP + # Can be empty, in which case the shell is probed, "yes" if += is + # useable or anything else if it does not work. + test -z "$_G_HAVE_PLUSEQ_OP" \ + && (eval 'x=a; x+=" b"; test "a b" = "$x"') 2>/dev/null \ + && _G_HAVE_PLUSEQ_OP=yes + +if test yes = "$_G_HAVE_PLUSEQ_OP" +then + # This is an XSI compatible shell, allowing a faster implementation... + eval 'func_append () + { + $debug_cmd + + eval "$1+=\$2" + }' +else + # ...otherwise fall back to using expr, which is often a shell builtin. + func_append () + { + $debug_cmd + + eval "$1=\$$1\$2" + } +fi + + +# func_append_quoted VAR VALUE +# ---------------------------- +# Quote VALUE and append to the end of shell variable VAR, separated +# by a space. +if test yes = "$_G_HAVE_PLUSEQ_OP"; then + eval 'func_append_quoted () + { + $debug_cmd + + func_quote_for_eval "$2" + eval "$1+=\\ \$func_quote_for_eval_result" + }' +else + func_append_quoted () + { + $debug_cmd + + func_quote_for_eval "$2" + eval "$1=\$$1\\ \$func_quote_for_eval_result" + } +fi + + +# func_append_uniq VAR VALUE +# -------------------------- +# Append unique VALUE onto the existing contents of VAR, assuming +# entries are delimited by the first character of VALUE. For example: +# +# func_append_uniq options " --another-option option-argument" +# +# will only append to $options if " --another-option option-argument " +# is not already present somewhere in $options already (note spaces at +# each end implied by leading space in second argument). +func_append_uniq () +{ + $debug_cmd + + eval _G_current_value='`$ECHO $'$1'`' + _G_delim=`expr "$2" : '\(.\)'` + + case $_G_delim$_G_current_value$_G_delim in + *"$2$_G_delim"*) ;; + *) func_append "$@" ;; + esac +} + + +# func_arith TERM... +# ------------------ +# Set func_arith_result to the result of evaluating TERMs. + test -z "$_G_HAVE_ARITH_OP" \ + && (eval 'test 2 = $(( 1 + 1 ))') 2>/dev/null \ + && _G_HAVE_ARITH_OP=yes + +if test yes = "$_G_HAVE_ARITH_OP"; then + eval 'func_arith () + { + $debug_cmd + + func_arith_result=$(( $* )) + }' +else + func_arith () + { + $debug_cmd + + func_arith_result=`expr "$@"` + } +fi + + +# func_basename FILE +# ------------------ +# Set func_basename_result to FILE with everything up to and including +# the last / stripped. +if test yes = "$_G_HAVE_XSI_OPS"; then + # If this shell supports suffix pattern removal, then use it to avoid + # forking. Hide the definitions single quotes in case the shell chokes + # on unsupported syntax... + _b='func_basename_result=${1##*/}' + _d='case $1 in + */*) func_dirname_result=${1%/*}$2 ;; + * ) func_dirname_result=$3 ;; + esac' + +else + # ...otherwise fall back to using sed. + _b='func_basename_result=`$ECHO "$1" |$SED "$sed_basename"`' + _d='func_dirname_result=`$ECHO "$1" |$SED "$sed_dirname"` + if test "X$func_dirname_result" = "X$1"; then + func_dirname_result=$3 + else + func_append func_dirname_result "$2" + fi' +fi + +eval 'func_basename () +{ + $debug_cmd + + '"$_b"' +}' + + +# func_dirname FILE APPEND NONDIR_REPLACEMENT +# ------------------------------------------- +# Compute the dirname of FILE. If nonempty, add APPEND to the result, +# otherwise set result to NONDIR_REPLACEMENT. +eval 'func_dirname () +{ + $debug_cmd + + '"$_d"' +}' + + +# func_dirname_and_basename FILE APPEND NONDIR_REPLACEMENT +# -------------------------------------------------------- +# Perform func_basename and func_dirname in a single function +# call: +# dirname: Compute the dirname of FILE. If nonempty, +# add APPEND to the result, otherwise set result +# to NONDIR_REPLACEMENT. +# value returned in "$func_dirname_result" +# basename: Compute filename of FILE. +# value retuned in "$func_basename_result" +# For efficiency, we do not delegate to the functions above but instead +# duplicate the functionality here. +eval 'func_dirname_and_basename () +{ + $debug_cmd + + '"$_b"' + '"$_d"' +}' + + +# func_echo ARG... +# ---------------- +# Echo program name prefixed message. +func_echo () +{ + $debug_cmd + + _G_message=$* + + func_echo_IFS=$IFS + IFS=$nl + for _G_line in $_G_message; do + IFS=$func_echo_IFS + $ECHO "$progname: $_G_line" + done + IFS=$func_echo_IFS +} + + +# func_echo_all ARG... +# -------------------- +# Invoke $ECHO with all args, space-separated. +func_echo_all () +{ + $ECHO "$*" +} + + +# func_echo_infix_1 INFIX ARG... +# ------------------------------ +# Echo program name, followed by INFIX on the first line, with any +# additional lines not showing INFIX. +func_echo_infix_1 () +{ + $debug_cmd + + $require_term_colors + + _G_infix=$1; shift + _G_indent=$_G_infix + _G_prefix="$progname: $_G_infix: " + _G_message=$* + + # Strip color escape sequences before counting printable length + for _G_tc in "$tc_reset" "$tc_bold" "$tc_standout" "$tc_red" "$tc_green" "$tc_blue" "$tc_cyan" + do + test -n "$_G_tc" && { + _G_esc_tc=`$ECHO "$_G_tc" | $SED "$sed_make_literal_regex"` + _G_indent=`$ECHO "$_G_indent" | $SED "s|$_G_esc_tc||g"` + } + done + _G_indent="$progname: "`echo "$_G_indent" | $SED 's|.| |g'`" " ## exclude from sc_prohibit_nested_quotes + + func_echo_infix_1_IFS=$IFS + IFS=$nl + for _G_line in $_G_message; do + IFS=$func_echo_infix_1_IFS + $ECHO "$_G_prefix$tc_bold$_G_line$tc_reset" >&2 + _G_prefix=$_G_indent + done + IFS=$func_echo_infix_1_IFS +} + + +# func_error ARG... +# ----------------- +# Echo program name prefixed message to standard error. +func_error () +{ + $debug_cmd + + $require_term_colors + + func_echo_infix_1 " $tc_standout${tc_red}error$tc_reset" "$*" >&2 +} + + +# func_fatal_error ARG... +# ----------------------- +# Echo program name prefixed message to standard error, and exit. +func_fatal_error () +{ + $debug_cmd + + func_error "$*" + exit $EXIT_FAILURE +} + + +# func_grep EXPRESSION FILENAME +# ----------------------------- # Check whether EXPRESSION matches any line of FILENAME, without output. func_grep () { + $debug_cmd + $GREP "$1" "$2" >/dev/null 2>&1 } -# func_mkdir_p directory-path +# func_len STRING +# --------------- +# Set func_len_result to the length of STRING. STRING may not +# start with a hyphen. + test -z "$_G_HAVE_XSI_OPS" \ + && (eval 'x=a/b/c; + test 5aa/bb/cc = "${#x}${x%%/*}${x%/*}${x#*/}${x##*/}"') 2>/dev/null \ + && _G_HAVE_XSI_OPS=yes + +if test yes = "$_G_HAVE_XSI_OPS"; then + eval 'func_len () + { + $debug_cmd + + func_len_result=${#1} + }' +else + func_len () + { + $debug_cmd + + func_len_result=`expr "$1" : ".*" 2>/dev/null || echo $max_cmd_len` + } +fi + + +# func_mkdir_p DIRECTORY-PATH +# --------------------------- # Make sure the entire path to DIRECTORY-PATH is available. func_mkdir_p () { - my_directory_path="$1" - my_dir_list= + $debug_cmd - if test -n "$my_directory_path" && test "$opt_dry_run" != ":"; then + _G_directory_path=$1 + _G_dir_list= - # Protect directory names starting with `-' - case $my_directory_path in - -*) my_directory_path="./$my_directory_path" ;; + if test -n "$_G_directory_path" && test : != "$opt_dry_run"; then + + # Protect directory names starting with '-' + case $_G_directory_path in + -*) _G_directory_path=./$_G_directory_path ;; esac # While some portion of DIR does not yet exist... - while test ! -d "$my_directory_path"; do + while test ! -d "$_G_directory_path"; do # ...make a list in topmost first order. Use a colon delimited # list incase some portion of path contains whitespace. - my_dir_list="$my_directory_path:$my_dir_list" + _G_dir_list=$_G_directory_path:$_G_dir_list # If the last portion added has no slash in it, the list is done - case $my_directory_path in */*) ;; *) break ;; esac + case $_G_directory_path in */*) ;; *) break ;; esac # ...otherwise throw away the child directory and loop - my_directory_path=`$ECHO "$my_directory_path" | $SED -e "$dirname"` + _G_directory_path=`$ECHO "$_G_directory_path" | $SED -e "$sed_dirname"` done - my_dir_list=`$ECHO "$my_dir_list" | $SED 's,:*$,,'` + _G_dir_list=`$ECHO "$_G_dir_list" | $SED 's|:*$||'` - save_mkdir_p_IFS="$IFS"; IFS=':' - for my_dir in $my_dir_list; do - IFS="$save_mkdir_p_IFS" - # mkdir can fail with a `File exist' error if two processes + func_mkdir_p_IFS=$IFS; IFS=: + for _G_dir in $_G_dir_list; do + IFS=$func_mkdir_p_IFS + # mkdir can fail with a 'File exist' error if two processes # try to create one of the directories concurrently. Don't # stop in that case! - $MKDIR "$my_dir" 2>/dev/null || : + $MKDIR "$_G_dir" 2>/dev/null || : done - IFS="$save_mkdir_p_IFS" + IFS=$func_mkdir_p_IFS # Bail out if we (or some other process) failed to create a directory. - test -d "$my_directory_path" || \ - func_fatal_error "Failed to create \`$1'" + test -d "$_G_directory_path" || \ + func_fatal_error "Failed to create '$1'" fi } -# func_mktempdir [string] +# func_mktempdir [BASENAME] +# ------------------------- # Make a temporary directory that won't clash with other running # libtool processes, and avoids race conditions if possible. If -# given, STRING is the basename for that directory. +# given, BASENAME is the basename for that directory. func_mktempdir () { - my_template="${TMPDIR-/tmp}/${1-$progname}" + $debug_cmd + + _G_template=${TMPDIR-/tmp}/${1-$progname} - if test "$opt_dry_run" = ":"; then + if test : = "$opt_dry_run"; then # Return a directory name, but don't create it in dry-run mode - my_tmpdir="${my_template}-$$" + _G_tmpdir=$_G_template-$$ else # If mktemp works, use that first and foremost - my_tmpdir=`mktemp -d "${my_template}-XXXXXXXX" 2>/dev/null` + _G_tmpdir=`mktemp -d "$_G_template-XXXXXXXX" 2>/dev/null` - if test ! -d "$my_tmpdir"; then + if test ! -d "$_G_tmpdir"; then # Failing that, at least try and use $RANDOM to avoid a race - my_tmpdir="${my_template}-${RANDOM-0}$$" + _G_tmpdir=$_G_template-${RANDOM-0}$$ - save_mktempdir_umask=`umask` + func_mktempdir_umask=`umask` umask 0077 - $MKDIR "$my_tmpdir" - umask $save_mktempdir_umask + $MKDIR "$_G_tmpdir" + umask $func_mktempdir_umask fi # If we're not in dry-run mode, bomb out on failure - test -d "$my_tmpdir" || \ - func_fatal_error "cannot create temporary directory \`$my_tmpdir'" + test -d "$_G_tmpdir" || \ + func_fatal_error "cannot create temporary directory '$_G_tmpdir'" + fi + + $ECHO "$_G_tmpdir" +} + + +# func_normal_abspath PATH +# ------------------------ +# Remove doubled-up and trailing slashes, "." path components, +# and cancel out any ".." path components in PATH after making +# it an absolute path. +func_normal_abspath () +{ + $debug_cmd + + # These SED scripts presuppose an absolute path with a trailing slash. + _G_pathcar='s|^/\([^/]*\).*$|\1|' + _G_pathcdr='s|^/[^/]*||' + _G_removedotparts=':dotsl + s|/\./|/|g + t dotsl + s|/\.$|/|' + _G_collapseslashes='s|/\{1,\}|/|g' + _G_finalslash='s|/*$|/|' + + # Start from root dir and reassemble the path. + func_normal_abspath_result= + func_normal_abspath_tpath=$1 + func_normal_abspath_altnamespace= + case $func_normal_abspath_tpath in + "") + # Empty path, that just means $cwd. + func_stripname '' '/' "`pwd`" + func_normal_abspath_result=$func_stripname_result + return + ;; + # The next three entries are used to spot a run of precisely + # two leading slashes without using negated character classes; + # we take advantage of case's first-match behaviour. + ///*) + # Unusual form of absolute path, do nothing. + ;; + //*) + # Not necessarily an ordinary path; POSIX reserves leading '//' + # and for example Cygwin uses it to access remote file shares + # over CIFS/SMB, so we conserve a leading double slash if found. + func_normal_abspath_altnamespace=/ + ;; + /*) + # Absolute path, do nothing. + ;; + *) + # Relative path, prepend $cwd. + func_normal_abspath_tpath=`pwd`/$func_normal_abspath_tpath + ;; + esac + + # Cancel out all the simple stuff to save iterations. We also want + # the path to end with a slash for ease of parsing, so make sure + # there is one (and only one) here. + func_normal_abspath_tpath=`$ECHO "$func_normal_abspath_tpath" | $SED \ + -e "$_G_removedotparts" -e "$_G_collapseslashes" -e "$_G_finalslash"` + while :; do + # Processed it all yet? + if test / = "$func_normal_abspath_tpath"; then + # If we ascended to the root using ".." the result may be empty now. + if test -z "$func_normal_abspath_result"; then + func_normal_abspath_result=/ + fi + break + fi + func_normal_abspath_tcomponent=`$ECHO "$func_normal_abspath_tpath" | $SED \ + -e "$_G_pathcar"` + func_normal_abspath_tpath=`$ECHO "$func_normal_abspath_tpath" | $SED \ + -e "$_G_pathcdr"` + # Figure out what to do with it + case $func_normal_abspath_tcomponent in + "") + # Trailing empty path component, ignore it. + ;; + ..) + # Parent dir; strip last assembled component from result. + func_dirname "$func_normal_abspath_result" + func_normal_abspath_result=$func_dirname_result + ;; + *) + # Actual path component, append it. + func_append func_normal_abspath_result "/$func_normal_abspath_tcomponent" + ;; + esac + done + # Restore leading double-slash if one was found on entry. + func_normal_abspath_result=$func_normal_abspath_altnamespace$func_normal_abspath_result +} + + +# func_notquiet ARG... +# -------------------- +# Echo program name prefixed message only when not in quiet mode. +func_notquiet () +{ + $debug_cmd + + $opt_quiet || func_echo ${1+"$@"} + + # A bug in bash halts the script if the last line of a function + # fails when set -e is in force, so we need another command to + # work around that: + : +} + + +# func_relative_path SRCDIR DSTDIR +# -------------------------------- +# Set func_relative_path_result to the relative path from SRCDIR to DSTDIR. +func_relative_path () +{ + $debug_cmd + + func_relative_path_result= + func_normal_abspath "$1" + func_relative_path_tlibdir=$func_normal_abspath_result + func_normal_abspath "$2" + func_relative_path_tbindir=$func_normal_abspath_result + + # Ascend the tree starting from libdir + while :; do + # check if we have found a prefix of bindir + case $func_relative_path_tbindir in + $func_relative_path_tlibdir) + # found an exact match + func_relative_path_tcancelled= + break + ;; + $func_relative_path_tlibdir*) + # found a matching prefix + func_stripname "$func_relative_path_tlibdir" '' "$func_relative_path_tbindir" + func_relative_path_tcancelled=$func_stripname_result + if test -z "$func_relative_path_result"; then + func_relative_path_result=. + fi + break + ;; + *) + func_dirname $func_relative_path_tlibdir + func_relative_path_tlibdir=$func_dirname_result + if test -z "$func_relative_path_tlibdir"; then + # Have to descend all the way to the root! + func_relative_path_result=../$func_relative_path_result + func_relative_path_tcancelled=$func_relative_path_tbindir + break + fi + func_relative_path_result=../$func_relative_path_result + ;; + esac + done + + # Now calculate path; take care to avoid doubling-up slashes. + func_stripname '' '/' "$func_relative_path_result" + func_relative_path_result=$func_stripname_result + func_stripname '/' '/' "$func_relative_path_tcancelled" + if test -n "$func_stripname_result"; then + func_append func_relative_path_result "/$func_stripname_result" + fi + + # Normalisation. If bindir is libdir, return '.' else relative path. + if test -n "$func_relative_path_result"; then + func_stripname './' '' "$func_relative_path_result" + func_relative_path_result=$func_stripname_result fi - $ECHO "$my_tmpdir" + test -n "$func_relative_path_result" || func_relative_path_result=. + + : +} + + +# func_quote_for_eval ARG... +# -------------------------- +# Aesthetically quote ARGs to be evaled later. +# This function returns two values: +# i) func_quote_for_eval_result +# double-quoted, suitable for a subsequent eval +# ii) func_quote_for_eval_unquoted_result +# has all characters that are still active within double +# quotes backslashified. +func_quote_for_eval () +{ + $debug_cmd + + func_quote_for_eval_unquoted_result= + func_quote_for_eval_result= + while test 0 -lt $#; do + case $1 in + *[\\\`\"\$]*) + _G_unquoted_arg=`printf '%s\n' "$1" |$SED "$sed_quote_subst"` ;; + *) + _G_unquoted_arg=$1 ;; + esac + if test -n "$func_quote_for_eval_unquoted_result"; then + func_append func_quote_for_eval_unquoted_result " $_G_unquoted_arg" + else + func_append func_quote_for_eval_unquoted_result "$_G_unquoted_arg" + fi + + case $_G_unquoted_arg in + # Double-quote args containing shell metacharacters to delay + # word splitting, command substitution and variable expansion + # for a subsequent eval. + # Many Bourne shells cannot handle close brackets correctly + # in scan sets, so we specify it separately. + *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") + _G_quoted_arg=\"$_G_unquoted_arg\" + ;; + *) + _G_quoted_arg=$_G_unquoted_arg + ;; + esac + + if test -n "$func_quote_for_eval_result"; then + func_append func_quote_for_eval_result " $_G_quoted_arg" + else + func_append func_quote_for_eval_result "$_G_quoted_arg" + fi + shift + done +} + + +# func_quote_for_expand ARG +# ------------------------- +# Aesthetically quote ARG to be evaled later; same as above, +# but do not quote variable references. +func_quote_for_expand () +{ + $debug_cmd + + case $1 in + *[\\\`\"]*) + _G_arg=`$ECHO "$1" | $SED \ + -e "$sed_double_quote_subst" -e "$sed_double_backslash"` ;; + *) + _G_arg=$1 ;; + esac + + case $_G_arg in + # Double-quote args containing shell metacharacters to delay + # word splitting and command substitution for a subsequent eval. + # Many Bourne shells cannot handle close brackets correctly + # in scan sets, so we specify it separately. + *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") + _G_arg=\"$_G_arg\" + ;; + esac + + func_quote_for_expand_result=$_G_arg +} + + +# func_stripname PREFIX SUFFIX NAME +# --------------------------------- +# strip PREFIX and SUFFIX from NAME, and store in func_stripname_result. +# PREFIX and SUFFIX must not contain globbing or regex special +# characters, hashes, percent signs, but SUFFIX may contain a leading +# dot (in which case that matches only a dot). +if test yes = "$_G_HAVE_XSI_OPS"; then + eval 'func_stripname () + { + $debug_cmd + + # pdksh 5.2.14 does not do ${X%$Y} correctly if both X and Y are + # positional parameters, so assign one to ordinary variable first. + func_stripname_result=$3 + func_stripname_result=${func_stripname_result#"$1"} + func_stripname_result=${func_stripname_result%"$2"} + }' +else + func_stripname () + { + $debug_cmd + + case $2 in + .*) func_stripname_result=`$ECHO "$3" | $SED -e "s%^$1%%" -e "s%\\\\$2\$%%"`;; + *) func_stripname_result=`$ECHO "$3" | $SED -e "s%^$1%%" -e "s%$2\$%%"`;; + esac + } +fi + + +# func_show_eval CMD [FAIL_EXP] +# ----------------------------- +# Unless opt_quiet is true, then output CMD. Then, if opt_dryrun is +# not true, evaluate CMD. If the evaluation of CMD fails, and FAIL_EXP +# is given, then evaluate it. +func_show_eval () +{ + $debug_cmd + + _G_cmd=$1 + _G_fail_exp=${2-':'} + + func_quote_for_expand "$_G_cmd" + eval "func_notquiet $func_quote_for_expand_result" + + $opt_dry_run || { + eval "$_G_cmd" + _G_status=$? + if test 0 -ne "$_G_status"; then + eval "(exit $_G_status); $_G_fail_exp" + fi + } +} + + +# func_show_eval_locale CMD [FAIL_EXP] +# ------------------------------------ +# Unless opt_quiet is true, then output CMD. Then, if opt_dryrun is +# not true, evaluate CMD. If the evaluation of CMD fails, and FAIL_EXP +# is given, then evaluate it. Use the saved locale for evaluation. +func_show_eval_locale () +{ + $debug_cmd + + _G_cmd=$1 + _G_fail_exp=${2-':'} + + $opt_quiet || { + func_quote_for_expand "$_G_cmd" + eval "func_echo $func_quote_for_expand_result" + } + + $opt_dry_run || { + eval "$_G_user_locale + $_G_cmd" + _G_status=$? + eval "$_G_safe_locale" + if test 0 -ne "$_G_status"; then + eval "(exit $_G_status); $_G_fail_exp" + fi + } +} + + +# func_tr_sh +# ---------- +# Turn $1 into a string suitable for a shell variable name. +# Result is stored in $func_tr_sh_result. All characters +# not in the set a-zA-Z0-9_ are replaced with '_'. Further, +# if $1 begins with a digit, a '_' is prepended as well. +func_tr_sh () +{ + $debug_cmd + + case $1 in + [0-9]* | *[!a-zA-Z0-9_]*) + func_tr_sh_result=`$ECHO "$1" | $SED -e 's/^\([0-9]\)/_\1/' -e 's/[^a-zA-Z0-9_]/_/g'` + ;; + * ) + func_tr_sh_result=$1 + ;; + esac +} + + +# func_verbose ARG... +# ------------------- +# Echo program name prefixed message in verbose mode only. +func_verbose () +{ + $debug_cmd + + $opt_verbose && func_echo "$*" + + : +} + + +# func_warn_and_continue ARG... +# ----------------------------- +# Echo program name prefixed warning message to standard error. +func_warn_and_continue () +{ + $debug_cmd + + $require_term_colors + + func_echo_infix_1 "${tc_red}warning$tc_reset" "$*" >&2 +} + + +# func_warning CATEGORY ARG... +# ---------------------------- +# Echo program name prefixed warning message to standard error. Warning +# messages can be filtered according to CATEGORY, where this function +# elides messages where CATEGORY is not listed in the global variable +# 'opt_warning_types'. +func_warning () +{ + $debug_cmd + + # CATEGORY must be in the warning_categories list! + case " $warning_categories " in + *" $1 "*) ;; + *) func_internal_error "invalid warning category '$1'" ;; + esac + + _G_category=$1 + shift + + case " $opt_warning_types " in + *" $_G_category "*) $warning_func ${1+"$@"} ;; + esac +} + + +# func_sort_ver VER1 VER2 +# ----------------------- +# 'sort -V' is not generally available. +# Note this deviates from the version comparison in automake +# in that it treats 1.5 < 1.5.0, and treats 1.4.4a < 1.4-p3a +# but this should suffice as we won't be specifying old +# version formats or redundant trailing .0 in bootstrap.conf. +# If we did want full compatibility then we should probably +# use m4_version_compare from autoconf. +func_sort_ver () +{ + $debug_cmd + + printf '%s\n%s\n' "$1" "$2" \ + | sort -t. -k 1,1n -k 2,2n -k 3,3n -k 4,4n -k 5,5n -k 6,6n -k 7,7n -k 8,8n -k 9,9n +} + +# func_lt_ver PREV CURR +# --------------------- +# Return true if PREV and CURR are in the correct order according to +# func_sort_ver, otherwise false. Use it like this: +# +# func_lt_ver "$prev_ver" "$proposed_ver" || func_fatal_error "..." +func_lt_ver () +{ + $debug_cmd + + test "x$1" = x`func_sort_ver "$1" "$2" | $SED 1q` +} + + +# Local variables: +# mode: shell-script +# sh-indentation: 2 +# eval: (add-hook 'before-save-hook 'time-stamp) +# time-stamp-pattern: "10/scriptversion=%:y-%02m-%02d.%02H; # UTC" +# time-stamp-time-zone: "UTC" +# End: +#! /bin/sh + +# Set a version string for this script. +scriptversion=2014-01-07.03; # UTC + +# A portable, pluggable option parser for Bourne shell. +# Written by Gary V. Vaughan, 2010 + +# Copyright (C) 2010-2015 Free Software Foundation, Inc. +# This is free software; see the source for copying conditions. There is NO +# warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. + +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . + +# Please report bugs or propose patches to gary@gnu.org. + + +## ------ ## +## Usage. ## +## ------ ## + +# This file is a library for parsing options in your shell scripts along +# with assorted other useful supporting features that you can make use +# of too. +# +# For the simplest scripts you might need only: +# +# #!/bin/sh +# . relative/path/to/funclib.sh +# . relative/path/to/options-parser +# scriptversion=1.0 +# func_options ${1+"$@"} +# eval set dummy "$func_options_result"; shift +# ...rest of your script... +# +# In order for the '--version' option to work, you will need to have a +# suitably formatted comment like the one at the top of this file +# starting with '# Written by ' and ending with '# warranty; '. +# +# For '-h' and '--help' to work, you will also need a one line +# description of your script's purpose in a comment directly above the +# '# Written by ' line, like the one at the top of this file. +# +# The default options also support '--debug', which will turn on shell +# execution tracing (see the comment above debug_cmd below for another +# use), and '--verbose' and the func_verbose function to allow your script +# to display verbose messages only when your user has specified +# '--verbose'. +# +# After sourcing this file, you can plug processing for additional +# options by amending the variables from the 'Configuration' section +# below, and following the instructions in the 'Option parsing' +# section further down. + +## -------------- ## +## Configuration. ## +## -------------- ## + +# You should override these variables in your script after sourcing this +# file so that they reflect the customisations you have added to the +# option parser. + +# The usage line for option parsing errors and the start of '-h' and +# '--help' output messages. You can embed shell variables for delayed +# expansion at the time the message is displayed, but you will need to +# quote other shell meta-characters carefully to prevent them being +# expanded when the contents are evaled. +usage='$progpath [OPTION]...' + +# Short help message in response to '-h' and '--help'. Add to this or +# override it after sourcing this library to reflect the full set of +# options your script accepts. +usage_message="\ + --debug enable verbose shell tracing + -W, --warnings=CATEGORY + report the warnings falling in CATEGORY [all] + -v, --verbose verbosely report processing + --version print version information and exit + -h, --help print short or long help message and exit +" + +# Additional text appended to 'usage_message' in response to '--help'. +long_help_message=" +Warning categories include: + 'all' show all warnings + 'none' turn off all the warnings + 'error' warnings are treated as fatal errors" + +# Help message printed before fatal option parsing errors. +fatal_help="Try '\$progname --help' for more information." + + + +## ------------------------- ## +## Hook function management. ## +## ------------------------- ## + +# This section contains functions for adding, removing, and running hooks +# to the main code. A hook is just a named list of of function, that can +# be run in order later on. + +# func_hookable FUNC_NAME +# ----------------------- +# Declare that FUNC_NAME will run hooks added with +# 'func_add_hook FUNC_NAME ...'. +func_hookable () +{ + $debug_cmd + + func_append hookable_fns " $1" +} + + +# func_add_hook FUNC_NAME HOOK_FUNC +# --------------------------------- +# Request that FUNC_NAME call HOOK_FUNC before it returns. FUNC_NAME must +# first have been declared "hookable" by a call to 'func_hookable'. +func_add_hook () +{ + $debug_cmd + + case " $hookable_fns " in + *" $1 "*) ;; + *) func_fatal_error "'$1' does not accept hook functions." ;; + esac + + eval func_append ${1}_hooks '" $2"' +} + + +# func_remove_hook FUNC_NAME HOOK_FUNC +# ------------------------------------ +# Remove HOOK_FUNC from the list of functions called by FUNC_NAME. +func_remove_hook () +{ + $debug_cmd + + eval ${1}_hooks='`$ECHO "\$'$1'_hooks" |$SED "s| '$2'||"`' +} + + +# func_run_hooks FUNC_NAME [ARG]... +# --------------------------------- +# Run all hook functions registered to FUNC_NAME. +# It is assumed that the list of hook functions contains nothing more +# than a whitespace-delimited list of legal shell function names, and +# no effort is wasted trying to catch shell meta-characters or preserve +# whitespace. +func_run_hooks () +{ + $debug_cmd + + case " $hookable_fns " in + *" $1 "*) ;; + *) func_fatal_error "'$1' does not support hook funcions.n" ;; + esac + + eval _G_hook_fns=\$$1_hooks; shift + + for _G_hook in $_G_hook_fns; do + eval $_G_hook '"$@"' + + # store returned options list back into positional + # parameters for next 'cmd' execution. + eval _G_hook_result=\$${_G_hook}_result + eval set dummy "$_G_hook_result"; shift + done + + func_quote_for_eval ${1+"$@"} + func_run_hooks_result=$func_quote_for_eval_result +} + + + +## --------------- ## +## Option parsing. ## +## --------------- ## + +# In order to add your own option parsing hooks, you must accept the +# full positional parameter list in your hook function, remove any +# options that you action, and then pass back the remaining unprocessed +# options in '_result', escaped suitably for +# 'eval'. Like this: +# +# my_options_prep () +# { +# $debug_cmd +# +# # Extend the existing usage message. +# usage_message=$usage_message' +# -s, --silent don'\''t print informational messages +# ' +# +# func_quote_for_eval ${1+"$@"} +# my_options_prep_result=$func_quote_for_eval_result +# } +# func_add_hook func_options_prep my_options_prep +# +# +# my_silent_option () +# { +# $debug_cmd +# +# # Note that for efficiency, we parse as many options as we can +# # recognise in a loop before passing the remainder back to the +# # caller on the first unrecognised argument we encounter. +# while test $# -gt 0; do +# opt=$1; shift +# case $opt in +# --silent|-s) opt_silent=: ;; +# # Separate non-argument short options: +# -s*) func_split_short_opt "$_G_opt" +# set dummy "$func_split_short_opt_name" \ +# "-$func_split_short_opt_arg" ${1+"$@"} +# shift +# ;; +# *) set dummy "$_G_opt" "$*"; shift; break ;; +# esac +# done +# +# func_quote_for_eval ${1+"$@"} +# my_silent_option_result=$func_quote_for_eval_result +# } +# func_add_hook func_parse_options my_silent_option +# +# +# my_option_validation () +# { +# $debug_cmd +# +# $opt_silent && $opt_verbose && func_fatal_help "\ +# '--silent' and '--verbose' options are mutually exclusive." +# +# func_quote_for_eval ${1+"$@"} +# my_option_validation_result=$func_quote_for_eval_result +# } +# func_add_hook func_validate_options my_option_validation +# +# You'll alse need to manually amend $usage_message to reflect the extra +# options you parse. It's preferable to append if you can, so that +# multiple option parsing hooks can be added safely. + + +# func_options [ARG]... +# --------------------- +# All the functions called inside func_options are hookable. See the +# individual implementations for details. +func_hookable func_options +func_options () +{ + $debug_cmd + + func_options_prep ${1+"$@"} + eval func_parse_options \ + ${func_options_prep_result+"$func_options_prep_result"} + eval func_validate_options \ + ${func_parse_options_result+"$func_parse_options_result"} + + eval func_run_hooks func_options \ + ${func_validate_options_result+"$func_validate_options_result"} + + # save modified positional parameters for caller + func_options_result=$func_run_hooks_result } -# func_quote_for_eval arg -# Aesthetically quote ARG to be evaled later. -# This function returns two values: FUNC_QUOTE_FOR_EVAL_RESULT -# is double-quoted, suitable for a subsequent eval, whereas -# FUNC_QUOTE_FOR_EVAL_UNQUOTED_RESULT has merely all characters -# which are still active within double quotes backslashified. -func_quote_for_eval () +# func_options_prep [ARG]... +# -------------------------- +# All initialisations required before starting the option parse loop. +# Note that when calling hook functions, we pass through the list of +# positional parameters. If a hook function modifies that list, and +# needs to propogate that back to rest of this script, then the complete +# modified list must be put in 'func_run_hooks_result' before +# returning. +func_hookable func_options_prep +func_options_prep () { - case $1 in - *[\\\`\"\$]*) - func_quote_for_eval_unquoted_result=`$ECHO "$1" | $SED "$sed_quote_subst"` ;; - *) - func_quote_for_eval_unquoted_result="$1" ;; - esac + $debug_cmd - case $func_quote_for_eval_unquoted_result in - # Double-quote args containing shell metacharacters to delay - # word splitting, command substitution and and variable - # expansion for a subsequent eval. - # Many Bourne shells cannot handle close brackets correctly - # in scan sets, so we specify it separately. - *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") - func_quote_for_eval_result="\"$func_quote_for_eval_unquoted_result\"" - ;; - *) - func_quote_for_eval_result="$func_quote_for_eval_unquoted_result" - esac + # Option defaults: + opt_verbose=false + opt_warning_types= + + func_run_hooks func_options_prep ${1+"$@"} + + # save modified positional parameters for caller + func_options_prep_result=$func_run_hooks_result } -# func_quote_for_expand arg -# Aesthetically quote ARG to be evaled later; same as above, -# but do not quote variable references. -func_quote_for_expand () +# func_parse_options [ARG]... +# --------------------------- +# The main option parsing loop. +func_hookable func_parse_options +func_parse_options () { - case $1 in - *[\\\`\"]*) - my_arg=`$ECHO "$1" | $SED \ - -e "$double_quote_subst" -e "$sed_double_backslash"` ;; - *) - my_arg="$1" ;; - esac + $debug_cmd - case $my_arg in - # Double-quote args containing shell metacharacters to delay - # word splitting and command substitution for a subsequent eval. - # Many Bourne shells cannot handle close brackets correctly - # in scan sets, so we specify it separately. - *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") - my_arg="\"$my_arg\"" - ;; - esac + func_parse_options_result= - func_quote_for_expand_result="$my_arg" -} + # this just eases exit handling + while test $# -gt 0; do + # Defer to hook functions for initial option parsing, so they + # get priority in the event of reusing an option name. + func_run_hooks func_parse_options ${1+"$@"} + # Adjust func_parse_options positional parameters to match + eval set dummy "$func_run_hooks_result"; shift -# func_show_eval cmd [fail_exp] -# Unless opt_silent is true, then output CMD. Then, if opt_dryrun is -# not true, evaluate CMD. If the evaluation of CMD fails, and FAIL_EXP -# is given, then evaluate it. -func_show_eval () -{ - my_cmd="$1" - my_fail_exp="${2-:}" + # Break out of the loop if we already parsed every option. + test $# -gt 0 || break - ${opt_silent-false} || { - func_quote_for_expand "$my_cmd" - eval "func_echo $func_quote_for_expand_result" - } + _G_opt=$1 + shift + case $_G_opt in + --debug|-x) debug_cmd='set -x' + func_echo "enabling shell trace mode" + $debug_cmd + ;; + + --no-warnings|--no-warning|--no-warn) + set dummy --warnings none ${1+"$@"} + shift + ;; - if ${opt_dry_run-false}; then :; else - eval "$my_cmd" - my_status=$? - if test "$my_status" -eq 0; then :; else - eval "(exit $my_status); $my_fail_exp" - fi - fi + --warnings|--warning|-W) + test $# = 0 && func_missing_arg $_G_opt && break + case " $warning_categories $1" in + *" $1 "*) + # trailing space prevents matching last $1 above + func_append_uniq opt_warning_types " $1" + ;; + *all) + opt_warning_types=$warning_categories + ;; + *none) + opt_warning_types=none + warning_func=: + ;; + *error) + opt_warning_types=$warning_categories + warning_func=func_fatal_error + ;; + *) + func_fatal_error \ + "unsupported warning category: '$1'" + ;; + esac + shift + ;; + + --verbose|-v) opt_verbose=: ;; + --version) func_version ;; + -\?|-h) func_usage ;; + --help) func_help ;; + + # Separate optargs to long options (plugins may need this): + --*=*) func_split_equals "$_G_opt" + set dummy "$func_split_equals_lhs" \ + "$func_split_equals_rhs" ${1+"$@"} + shift + ;; + + # Separate optargs to short options: + -W*) + func_split_short_opt "$_G_opt" + set dummy "$func_split_short_opt_name" \ + "$func_split_short_opt_arg" ${1+"$@"} + shift + ;; + + # Separate non-argument short options: + -\?*|-h*|-v*|-x*) + func_split_short_opt "$_G_opt" + set dummy "$func_split_short_opt_name" \ + "-$func_split_short_opt_arg" ${1+"$@"} + shift + ;; + + --) break ;; + -*) func_fatal_help "unrecognised option: '$_G_opt'" ;; + *) set dummy "$_G_opt" ${1+"$@"}; shift; break ;; + esac + done + + # save modified positional parameters for caller + func_quote_for_eval ${1+"$@"} + func_parse_options_result=$func_quote_for_eval_result } -# func_show_eval_locale cmd [fail_exp] -# Unless opt_silent is true, then output CMD. Then, if opt_dryrun is -# not true, evaluate CMD. If the evaluation of CMD fails, and FAIL_EXP -# is given, then evaluate it. Use the saved locale for evaluation. -func_show_eval_locale () +# func_validate_options [ARG]... +# ------------------------------ +# Perform any sanity checks on option settings and/or unconsumed +# arguments. +func_hookable func_validate_options +func_validate_options () { - my_cmd="$1" - my_fail_exp="${2-:}" + $debug_cmd - ${opt_silent-false} || { - func_quote_for_expand "$my_cmd" - eval "func_echo $func_quote_for_expand_result" - } + # Display all warnings if -W was not given. + test -n "$opt_warning_types" || opt_warning_types=" $warning_categories" - if ${opt_dry_run-false}; then :; else - eval "$lt_user_locale - $my_cmd" - my_status=$? - eval "$lt_safe_locale" - if test "$my_status" -eq 0; then :; else - eval "(exit $my_status); $my_fail_exp" - fi - fi -} + func_run_hooks func_validate_options ${1+"$@"} -# func_tr_sh -# Turn $1 into a string suitable for a shell variable name. -# Result is stored in $func_tr_sh_result. All characters -# not in the set a-zA-Z0-9_ are replaced with '_'. Further, -# if $1 begins with a digit, a '_' is prepended as well. -func_tr_sh () -{ - case $1 in - [0-9]* | *[!a-zA-Z0-9_]*) - func_tr_sh_result=`$ECHO "$1" | $SED 's/^\([0-9]\)/_\1/; s/[^a-zA-Z0-9_]/_/g'` - ;; - * ) - func_tr_sh_result=$1 - ;; - esac + # Bail if the options were screwed! + $exit_cmd $EXIT_FAILURE + + # save modified positional parameters for caller + func_validate_options_result=$func_run_hooks_result } -# func_version -# Echo version message to standard output and exit. -func_version () -{ - $opt_debug - $SED -n '/(C)/!b go - :more - /\./!{ - N - s/\n# / / - b more - } - :go - /^# '$PROGRAM' (GNU /,/# warranty; / { - s/^# // - s/^# *$// - s/\((C)\)[ 0-9,-]*\( [1-9][0-9]*\)/\1\2/ - p - }' < "$progpath" - exit $? -} +## ----------------- ## +## Helper functions. ## +## ----------------- ## -# func_usage -# Echo short help message to standard output and exit. -func_usage () +# This section contains the helper functions used by the rest of the +# hookable option parser framework in ascii-betical order. + + +# func_fatal_help ARG... +# ---------------------- +# Echo program name prefixed message to standard error, followed by +# a help hint, and exit. +func_fatal_help () { - $opt_debug + $debug_cmd - $SED -n '/^# Usage:/,/^# *.*--help/ { - s/^# // - s/^# *$// - s/\$progname/'$progname'/ - p - }' < "$progpath" - echo - $ECHO "run \`$progname --help | more' for full usage" - exit $? + eval \$ECHO \""Usage: $usage"\" + eval \$ECHO \""$fatal_help"\" + func_error ${1+"$@"} + exit $EXIT_FAILURE } -# func_help [NOEXIT] -# Echo long help message to standard output and exit, -# unless 'noexit' is passed as argument. + +# func_help +# --------- +# Echo long help message to standard output and exit. func_help () { - $opt_debug - - $SED -n '/^# Usage:/,/# Report bugs to/ { - :print - s/^# // - s/^# *$// - s*\$progname*'$progname'* - s*\$host*'"$host"'* - s*\$SHELL*'"$SHELL"'* - s*\$LTCC*'"$LTCC"'* - s*\$LTCFLAGS*'"$LTCFLAGS"'* - s*\$LD*'"$LD"'* - s/\$with_gnu_ld/'"$with_gnu_ld"'/ - s/\$automake_version/'"`(${AUTOMAKE-automake} --version) 2>/dev/null |$SED 1q`"'/ - s/\$autoconf_version/'"`(${AUTOCONF-autoconf} --version) 2>/dev/null |$SED 1q`"'/ - p - d - } - /^# .* home page:/b print - /^# General help using/b print - ' < "$progpath" - ret=$? - if test -z "$1"; then - exit $ret - fi + $debug_cmd + + func_usage_message + $ECHO "$long_help_message" + exit 0 } -# func_missing_arg argname + +# func_missing_arg ARGNAME +# ------------------------ # Echo program name prefixed message to standard error and set global # exit_cmd. func_missing_arg () { - $opt_debug + $debug_cmd - func_error "missing argument for $1." + func_error "Missing argument for '$1'." exit_cmd=exit } -# func_split_short_opt shortopt +# func_split_equals STRING +# ------------------------ +# Set func_split_equals_lhs and func_split_equals_rhs shell variables after +# splitting STRING at the '=' sign. +test -z "$_G_HAVE_XSI_OPS" \ + && (eval 'x=a/b/c; + test 5aa/bb/cc = "${#x}${x%%/*}${x%/*}${x#*/}${x##*/}"') 2>/dev/null \ + && _G_HAVE_XSI_OPS=yes + +if test yes = "$_G_HAVE_XSI_OPS" +then + # This is an XSI compatible shell, allowing a faster implementation... + eval 'func_split_equals () + { + $debug_cmd + + func_split_equals_lhs=${1%%=*} + func_split_equals_rhs=${1#*=} + test "x$func_split_equals_lhs" = "x$1" \ + && func_split_equals_rhs= + }' +else + # ...otherwise fall back to using expr, which is often a shell builtin. + func_split_equals () + { + $debug_cmd + + func_split_equals_lhs=`expr "x$1" : 'x\([^=]*\)'` + func_split_equals_rhs= + test "x$func_split_equals_lhs" = "x$1" \ + || func_split_equals_rhs=`expr "x$1" : 'x[^=]*=\(.*\)$'` + } +fi #func_split_equals + + +# func_split_short_opt SHORTOPT +# ----------------------------- # Set func_split_short_opt_name and func_split_short_opt_arg shell # variables after splitting SHORTOPT after the 2nd character. -func_split_short_opt () +if test yes = "$_G_HAVE_XSI_OPS" +then + # This is an XSI compatible shell, allowing a faster implementation... + eval 'func_split_short_opt () + { + $debug_cmd + + func_split_short_opt_arg=${1#??} + func_split_short_opt_name=${1%"$func_split_short_opt_arg"} + }' +else + # ...otherwise fall back to using expr, which is often a shell builtin. + func_split_short_opt () + { + $debug_cmd + + func_split_short_opt_name=`expr "x$1" : 'x-\(.\)'` + func_split_short_opt_arg=`expr "x$1" : 'x-.\(.*\)$'` + } +fi #func_split_short_opt + + +# func_usage +# ---------- +# Echo short help message to standard output and exit. +func_usage () { - my_sed_short_opt='1s/^\(..\).*$/\1/;q' - my_sed_short_rest='1s/^..\(.*\)$/\1/;q' + $debug_cmd - func_split_short_opt_name=`$ECHO "$1" | $SED "$my_sed_short_opt"` - func_split_short_opt_arg=`$ECHO "$1" | $SED "$my_sed_short_rest"` -} # func_split_short_opt may be replaced by extended shell implementation + func_usage_message + $ECHO "Run '$progname --help |${PAGER-more}' for full usage" + exit 0 +} -# func_split_long_opt longopt -# Set func_split_long_opt_name and func_split_long_opt_arg shell -# variables after splitting LONGOPT at the `=' sign. -func_split_long_opt () +# func_usage_message +# ------------------ +# Echo short help message to standard output. +func_usage_message () { - my_sed_long_opt='1s/^\(--[^=]*\)=.*/\1/;q' - my_sed_long_arg='1s/^--[^=]*=//' + $debug_cmd - func_split_long_opt_name=`$ECHO "$1" | $SED "$my_sed_long_opt"` - func_split_long_opt_arg=`$ECHO "$1" | $SED "$my_sed_long_arg"` -} # func_split_long_opt may be replaced by extended shell implementation + eval \$ECHO \""Usage: $usage"\" + echo + $SED -n 's|^# || + /^Written by/{ + x;p;x + } + h + /^Written by/q' < "$progpath" + echo + eval \$ECHO \""$usage_message"\" +} -exit_cmd=: +# func_version +# ------------ +# Echo version message to standard output and exit. +func_version () +{ + $debug_cmd + printf '%s\n' "$progname $scriptversion" + $SED -n ' + /(C)/!b go + :more + /\./!{ + N + s|\n# | | + b more + } + :go + /^# Written by /,/# warranty; / { + s|^# || + s|^# *$|| + s|\((C)\)[ 0-9,-]*[ ,-]\([1-9][0-9]* \)|\1 \2| + p + } + /^# Written by / { + s|^# || + p + } + /^warranty; /q' < "$progpath" + exit $? +} -magic="%%%MAGIC variable%%%" -magic_exe="%%%MAGIC EXE variable%%%" +# Local variables: +# mode: shell-script +# sh-indentation: 2 +# eval: (add-hook 'before-save-hook 'time-stamp) +# time-stamp-pattern: "10/scriptversion=%:y-%02m-%02d.%02H; # UTC" +# time-stamp-time-zone: "UTC" +# End: -# Global variables. -nonopt= -preserve_args= -lo2o="s/\\.lo\$/.${objext}/" -o2lo="s/\\.${objext}\$/.lo/" -extracted_archives= -extracted_serial=0 +# Set a version string. +scriptversion='(GNU libtool) 2.4.6' -# If this variable is set in any of the actions, the command in it -# will be execed at the end. This prevents here-documents from being -# left over by shells. -exec_cmd= -# func_append var value -# Append VALUE to the end of shell variable VAR. -func_append () +# func_echo ARG... +# ---------------- +# Libtool also displays the current mode in messages, so override +# funclib.sh func_echo with this custom definition. +func_echo () { - eval "${1}=\$${1}\${2}" -} # func_append may be replaced by extended shell implementation + $debug_cmd -# func_append_quoted var value -# Quote VALUE and append to the end of shell variable VAR, separated -# by a space. -func_append_quoted () -{ - func_quote_for_eval "${2}" - eval "${1}=\$${1}\\ \$func_quote_for_eval_result" -} # func_append_quoted may be replaced by extended shell implementation + _G_message=$* + func_echo_IFS=$IFS + IFS=$nl + for _G_line in $_G_message; do + IFS=$func_echo_IFS + $ECHO "$progname${opt_mode+: $opt_mode}: $_G_line" + done + IFS=$func_echo_IFS +} -# func_arith arithmetic-term... -func_arith () + +# func_warning ARG... +# ------------------- +# Libtool warnings are not categorized, so override funclib.sh +# func_warning with this simpler definition. +func_warning () { - func_arith_result=`expr "${@}"` -} # func_arith may be replaced by extended shell implementation + $debug_cmd + $warning_func ${1+"$@"} +} -# func_len string -# STRING may not start with a hyphen. -func_len () -{ - func_len_result=`expr "${1}" : ".*" 2>/dev/null || echo $max_cmd_len` -} # func_len may be replaced by extended shell implementation +## ---------------- ## +## Options parsing. ## +## ---------------- ## + +# Hook in the functions to make sure our own options are parsed during +# the option parsing loop. + +usage='$progpath [OPTION]... [MODE-ARG]...' + +# Short help message in response to '-h'. +usage_message="Options: + --config show all configuration variables + --debug enable verbose shell tracing + -n, --dry-run display commands without modifying any files + --features display basic configuration information and exit + --mode=MODE use operation mode MODE + --no-warnings equivalent to '-Wnone' + --preserve-dup-deps don't remove duplicate dependency libraries + --quiet, --silent don't print informational messages + --tag=TAG use configuration variables from tag TAG + -v, --verbose print more informational messages than default + --version print version information + -W, --warnings=CATEGORY report the warnings falling in CATEGORY [all] + -h, --help, --help-all print short, long, or detailed help message +" -# func_lo2o object -func_lo2o () +# Additional text appended to 'usage_message' in response to '--help'. +func_help () { - func_lo2o_result=`$ECHO "${1}" | $SED "$lo2o"` -} # func_lo2o may be replaced by extended shell implementation + $debug_cmd + + func_usage_message + $ECHO "$long_help_message + +MODE must be one of the following: + + clean remove files from the build directory + compile compile a source file into a libtool object + execute automatically set library path, then run a program + finish complete the installation of libtool libraries + install install libraries or executables + link create a library or an executable + uninstall remove libraries from an installed directory + +MODE-ARGS vary depending on the MODE. When passed as first option, +'--mode=MODE' may be abbreviated as 'MODE' or a unique abbreviation of that. +Try '$progname --help --mode=MODE' for a more detailed description of MODE. + +When reporting a bug, please describe a test case to reproduce it and +include the following information: + + host-triplet: $host + shell: $SHELL + compiler: $LTCC + compiler flags: $LTCFLAGS + linker: $LD (gnu? $with_gnu_ld) + version: $progname (GNU libtool) 2.4.6 + automake: `($AUTOMAKE --version) 2>/dev/null |$SED 1q` + autoconf: `($AUTOCONF --version) 2>/dev/null |$SED 1q` + +Report bugs to . +GNU libtool home page: . +General help using GNU software: ." + exit 0 +} -# func_xform libobj-or-source -func_xform () -{ - func_xform_result=`$ECHO "${1}" | $SED 's/\.[^.]*$/.lo/'` -} # func_xform may be replaced by extended shell implementation +# func_lo2o OBJECT-NAME +# --------------------- +# Transform OBJECT-NAME from a '.lo' suffix to the platform specific +# object suffix. + +lo2o=s/\\.lo\$/.$objext/ +o2lo=s/\\.$objext\$/.lo/ + +if test yes = "$_G_HAVE_XSI_OPS"; then + eval 'func_lo2o () + { + case $1 in + *.lo) func_lo2o_result=${1%.lo}.$objext ;; + * ) func_lo2o_result=$1 ;; + esac + }' + + # func_xform LIBOBJ-OR-SOURCE + # --------------------------- + # Transform LIBOBJ-OR-SOURCE from a '.o' or '.c' (or otherwise) + # suffix to a '.lo' libtool-object suffix. + eval 'func_xform () + { + func_xform_result=${1%.*}.lo + }' +else + # ...otherwise fall back to using sed. + func_lo2o () + { + func_lo2o_result=`$ECHO "$1" | $SED "$lo2o"` + } + + func_xform () + { + func_xform_result=`$ECHO "$1" | $SED 's|\.[^.]*$|.lo|'` + } +fi -# func_fatal_configuration arg... +# func_fatal_configuration ARG... +# ------------------------------- # Echo program name prefixed message to standard error, followed by # a configuration failure hint, and exit. func_fatal_configuration () { - func_error ${1+"$@"} - func_error "See the $PACKAGE documentation for more information." - func_fatal_error "Fatal configuration error." + func__fatal_error ${1+"$@"} \ + "See the $PACKAGE documentation for more information." \ + "Fatal configuration error." } # func_config +# ----------- # Display the configuration for all the tags in this script. func_config () { @@ -915,17 +2149,19 @@ func_config () exit $? } + # func_features +# ------------- # Display the features supported by this script. func_features () { echo "host: $host" - if test "$build_libtool_libs" = yes; then + if test yes = "$build_libtool_libs"; then echo "enable shared libraries" else echo "disable shared libraries" fi - if test "$build_old_libs" = yes; then + if test yes = "$build_old_libs"; then echo "enable static libraries" else echo "disable static libraries" @@ -934,314 +2170,350 @@ func_features () exit $? } -# func_enable_tag tagname + +# func_enable_tag TAGNAME +# ----------------------- # Verify that TAGNAME is valid, and either flag an error and exit, or # enable the TAGNAME tag. We also add TAGNAME to the global $taglist # variable here. func_enable_tag () { - # Global variable: - tagname="$1" + # Global variable: + tagname=$1 - re_begincf="^# ### BEGIN LIBTOOL TAG CONFIG: $tagname\$" - re_endcf="^# ### END LIBTOOL TAG CONFIG: $tagname\$" - sed_extractcf="/$re_begincf/,/$re_endcf/p" + re_begincf="^# ### BEGIN LIBTOOL TAG CONFIG: $tagname\$" + re_endcf="^# ### END LIBTOOL TAG CONFIG: $tagname\$" + sed_extractcf=/$re_begincf/,/$re_endcf/p - # Validate tagname. - case $tagname in - *[!-_A-Za-z0-9,/]*) - func_fatal_error "invalid tag name: $tagname" - ;; - esac + # Validate tagname. + case $tagname in + *[!-_A-Za-z0-9,/]*) + func_fatal_error "invalid tag name: $tagname" + ;; + esac - # Don't test for the "default" C tag, as we know it's - # there but not specially marked. - case $tagname in - CC) ;; + # Don't test for the "default" C tag, as we know it's + # there but not specially marked. + case $tagname in + CC) ;; *) - if $GREP "$re_begincf" "$progpath" >/dev/null 2>&1; then - taglist="$taglist $tagname" - - # Evaluate the configuration. Be careful to quote the path - # and the sed script, to avoid splitting on whitespace, but - # also don't use non-portable quotes within backquotes within - # quotes we have to do it in 2 steps: - extractedcf=`$SED -n -e "$sed_extractcf" < "$progpath"` - eval "$extractedcf" - else - func_error "ignoring unknown tag $tagname" - fi - ;; - esac + if $GREP "$re_begincf" "$progpath" >/dev/null 2>&1; then + taglist="$taglist $tagname" + + # Evaluate the configuration. Be careful to quote the path + # and the sed script, to avoid splitting on whitespace, but + # also don't use non-portable quotes within backquotes within + # quotes we have to do it in 2 steps: + extractedcf=`$SED -n -e "$sed_extractcf" < "$progpath"` + eval "$extractedcf" + else + func_error "ignoring unknown tag $tagname" + fi + ;; + esac } + # func_check_version_match +# ------------------------ # Ensure that we are using m4 macros, and libtool script from the same # release of libtool. func_check_version_match () { - if test "$package_revision" != "$macro_revision"; then - if test "$VERSION" != "$macro_version"; then - if test -z "$macro_version"; then - cat >&2 <<_LT_EOF + if test "$package_revision" != "$macro_revision"; then + if test "$VERSION" != "$macro_version"; then + if test -z "$macro_version"; then + cat >&2 <<_LT_EOF $progname: Version mismatch error. This is $PACKAGE $VERSION, but the $progname: definition of this LT_INIT comes from an older release. $progname: You should recreate aclocal.m4 with macros from $PACKAGE $VERSION $progname: and run autoconf again. _LT_EOF - else - cat >&2 <<_LT_EOF + else + cat >&2 <<_LT_EOF $progname: Version mismatch error. This is $PACKAGE $VERSION, but the $progname: definition of this LT_INIT comes from $PACKAGE $macro_version. $progname: You should recreate aclocal.m4 with macros from $PACKAGE $VERSION $progname: and run autoconf again. _LT_EOF - fi - else - cat >&2 <<_LT_EOF + fi + else + cat >&2 <<_LT_EOF $progname: Version mismatch error. This is $PACKAGE $VERSION, revision $package_revision, $progname: but the definition of this LT_INIT comes from revision $macro_revision. $progname: You should recreate aclocal.m4 with macros from revision $package_revision $progname: of $PACKAGE $VERSION and run autoconf again. _LT_EOF - fi + fi - exit $EXIT_MISMATCH - fi + exit $EXIT_MISMATCH + fi } -# Shorthand for --mode=foo, only valid as the first argument -case $1 in -clean|clea|cle|cl) - shift; set dummy --mode clean ${1+"$@"}; shift - ;; -compile|compil|compi|comp|com|co|c) - shift; set dummy --mode compile ${1+"$@"}; shift - ;; -execute|execut|execu|exec|exe|ex|e) - shift; set dummy --mode execute ${1+"$@"}; shift - ;; -finish|finis|fini|fin|fi|f) - shift; set dummy --mode finish ${1+"$@"}; shift - ;; -install|instal|insta|inst|ins|in|i) - shift; set dummy --mode install ${1+"$@"}; shift - ;; -link|lin|li|l) - shift; set dummy --mode link ${1+"$@"}; shift - ;; -uninstall|uninstal|uninsta|uninst|unins|unin|uni|un|u) - shift; set dummy --mode uninstall ${1+"$@"}; shift - ;; -esac +# libtool_options_prep [ARG]... +# ----------------------------- +# Preparation for options parsed by libtool. +libtool_options_prep () +{ + $debug_mode + # Option defaults: + opt_config=false + opt_dlopen= + opt_dry_run=false + opt_help=false + opt_mode= + opt_preserve_dup_deps=false + opt_quiet=false + nonopt= + preserve_args= -# Option defaults: -opt_debug=: -opt_dry_run=false -opt_config=false -opt_preserve_dup_deps=false -opt_features=false -opt_finish=false -opt_help=false -opt_help_all=false -opt_silent=: -opt_warning=: -opt_verbose=: -opt_silent=false -opt_verbose=false + # Shorthand for --mode=foo, only valid as the first argument + case $1 in + clean|clea|cle|cl) + shift; set dummy --mode clean ${1+"$@"}; shift + ;; + compile|compil|compi|comp|com|co|c) + shift; set dummy --mode compile ${1+"$@"}; shift + ;; + execute|execut|execu|exec|exe|ex|e) + shift; set dummy --mode execute ${1+"$@"}; shift + ;; + finish|finis|fini|fin|fi|f) + shift; set dummy --mode finish ${1+"$@"}; shift + ;; + install|instal|insta|inst|ins|in|i) + shift; set dummy --mode install ${1+"$@"}; shift + ;; + link|lin|li|l) + shift; set dummy --mode link ${1+"$@"}; shift + ;; + uninstall|uninstal|uninsta|uninst|unins|unin|uni|un|u) + shift; set dummy --mode uninstall ${1+"$@"}; shift + ;; + esac + + # Pass back the list of options. + func_quote_for_eval ${1+"$@"} + libtool_options_prep_result=$func_quote_for_eval_result +} +func_add_hook func_options_prep libtool_options_prep -# Parse options once, thoroughly. This comes as soon as possible in the -# script to make things like `--version' happen as quickly as we can. +# libtool_parse_options [ARG]... +# --------------------------------- +# Provide handling for libtool specific options. +libtool_parse_options () { - # this just eases exit handling - while test $# -gt 0; do - opt="$1" - shift - case $opt in - --debug|-x) opt_debug='set -x' - func_echo "enabling shell trace mode" - $opt_debug - ;; - --dry-run|--dryrun|-n) - opt_dry_run=: - ;; - --config) - opt_config=: -func_config - ;; - --dlopen|-dlopen) - optarg="$1" - opt_dlopen="${opt_dlopen+$opt_dlopen -}$optarg" - shift - ;; - --preserve-dup-deps) - opt_preserve_dup_deps=: - ;; - --features) - opt_features=: -func_features - ;; - --finish) - opt_finish=: -set dummy --mode finish ${1+"$@"}; shift - ;; - --help) - opt_help=: - ;; - --help-all) - opt_help_all=: -opt_help=': help-all' - ;; - --mode) - test $# = 0 && func_missing_arg $opt && break - optarg="$1" - opt_mode="$optarg" -case $optarg in - # Valid mode arguments: - clean|compile|execute|finish|install|link|relink|uninstall) ;; - - # Catch anything else as an error - *) func_error "invalid argument for $opt" - exit_cmd=exit - break - ;; -esac - shift - ;; - --no-silent|--no-quiet) - opt_silent=false -func_append preserve_args " $opt" - ;; - --no-warning|--no-warn) - opt_warning=false -func_append preserve_args " $opt" - ;; - --no-verbose) - opt_verbose=false -func_append preserve_args " $opt" - ;; - --silent|--quiet) - opt_silent=: -func_append preserve_args " $opt" - opt_verbose=false - ;; - --verbose|-v) - opt_verbose=: -func_append preserve_args " $opt" -opt_silent=false - ;; - --tag) - test $# = 0 && func_missing_arg $opt && break - optarg="$1" - opt_tag="$optarg" -func_append preserve_args " $opt $optarg" -func_enable_tag "$optarg" - shift - ;; - - -\?|-h) func_usage ;; - --help) func_help ;; - --version) func_version ;; - - # Separate optargs to long options: - --*=*) - func_split_long_opt "$opt" - set dummy "$func_split_long_opt_name" "$func_split_long_opt_arg" ${1+"$@"} - shift - ;; - - # Separate non-argument short options: - -\?*|-h*|-n*|-v*) - func_split_short_opt "$opt" - set dummy "$func_split_short_opt_name" "-$func_split_short_opt_arg" ${1+"$@"} - shift - ;; - - --) break ;; - -*) func_fatal_help "unrecognized option \`$opt'" ;; - *) set dummy "$opt" ${1+"$@"}; shift; break ;; - esac - done + $debug_cmd - # Validate options: + # Perform our own loop to consume as many options as possible in + # each iteration. + while test $# -gt 0; do + _G_opt=$1 + shift + case $_G_opt in + --dry-run|--dryrun|-n) + opt_dry_run=: + ;; + + --config) func_config ;; + + --dlopen|-dlopen) + opt_dlopen="${opt_dlopen+$opt_dlopen +}$1" + shift + ;; + + --preserve-dup-deps) + opt_preserve_dup_deps=: ;; + + --features) func_features ;; + + --finish) set dummy --mode finish ${1+"$@"}; shift ;; + + --help) opt_help=: ;; + + --help-all) opt_help=': help-all' ;; + + --mode) test $# = 0 && func_missing_arg $_G_opt && break + opt_mode=$1 + case $1 in + # Valid mode arguments: + clean|compile|execute|finish|install|link|relink|uninstall) ;; + + # Catch anything else as an error + *) func_error "invalid argument for $_G_opt" + exit_cmd=exit + break + ;; + esac + shift + ;; + + --no-silent|--no-quiet) + opt_quiet=false + func_append preserve_args " $_G_opt" + ;; + + --no-warnings|--no-warning|--no-warn) + opt_warning=false + func_append preserve_args " $_G_opt" + ;; + + --no-verbose) + opt_verbose=false + func_append preserve_args " $_G_opt" + ;; + + --silent|--quiet) + opt_quiet=: + opt_verbose=false + func_append preserve_args " $_G_opt" + ;; + + --tag) test $# = 0 && func_missing_arg $_G_opt && break + opt_tag=$1 + func_append preserve_args " $_G_opt $1" + func_enable_tag "$1" + shift + ;; + + --verbose|-v) opt_quiet=false + opt_verbose=: + func_append preserve_args " $_G_opt" + ;; + + # An option not handled by this hook function: + *) set dummy "$_G_opt" ${1+"$@"}; shift; break ;; + esac + done - # save first non-option argument - if test "$#" -gt 0; then - nonopt="$opt" - shift - fi - # preserve --debug - test "$opt_debug" = : || func_append preserve_args " --debug" + # save modified positional parameters for caller + func_quote_for_eval ${1+"$@"} + libtool_parse_options_result=$func_quote_for_eval_result +} +func_add_hook func_parse_options libtool_parse_options - case $host in - *cygwin* | *mingw* | *pw32* | *cegcc*) - # don't eliminate duplications in $postdeps and $predeps - opt_duplicate_compiler_generated_deps=: - ;; - *) - opt_duplicate_compiler_generated_deps=$opt_preserve_dup_deps - ;; - esac - $opt_help || { - # Sanity checks first: - func_check_version_match - if test "$build_libtool_libs" != yes && test "$build_old_libs" != yes; then - func_fatal_configuration "not configured to build any kind of library" +# libtool_validate_options [ARG]... +# --------------------------------- +# Perform any sanity checks on option settings and/or unconsumed +# arguments. +libtool_validate_options () +{ + # save first non-option argument + if test 0 -lt $#; then + nonopt=$1 + shift fi - # Darwin sucks - eval std_shrext=\"$shrext_cmds\" + # preserve --debug + test : = "$debug_cmd" || func_append preserve_args " --debug" - # Only execute mode is allowed to have -dlopen flags. - if test -n "$opt_dlopen" && test "$opt_mode" != execute; then - func_error "unrecognized option \`-dlopen'" - $ECHO "$help" 1>&2 - exit $EXIT_FAILURE - fi + case $host in + # Solaris2 added to fix http://debbugs.gnu.org/cgi/bugreport.cgi?bug=16452 + # see also: http://gcc.gnu.org/bugzilla/show_bug.cgi?id=59788 + *cygwin* | *mingw* | *pw32* | *cegcc* | *solaris2* | *os2*) + # don't eliminate duplications in $postdeps and $predeps + opt_duplicate_compiler_generated_deps=: + ;; + *) + opt_duplicate_compiler_generated_deps=$opt_preserve_dup_deps + ;; + esac - # Change the help message to a mode-specific one. - generic_help="$help" - help="Try \`$progname --help --mode=$opt_mode' for more information." - } + $opt_help || { + # Sanity checks first: + func_check_version_match + + test yes != "$build_libtool_libs" \ + && test yes != "$build_old_libs" \ + && func_fatal_configuration "not configured to build any kind of library" + + # Darwin sucks + eval std_shrext=\"$shrext_cmds\" + + # Only execute mode is allowed to have -dlopen flags. + if test -n "$opt_dlopen" && test execute != "$opt_mode"; then + func_error "unrecognized option '-dlopen'" + $ECHO "$help" 1>&2 + exit $EXIT_FAILURE + fi + # Change the help message to a mode-specific one. + generic_help=$help + help="Try '$progname --help --mode=$opt_mode' for more information." + } - # Bail if the options were screwed - $exit_cmd $EXIT_FAILURE + # Pass back the unparsed argument list + func_quote_for_eval ${1+"$@"} + libtool_validate_options_result=$func_quote_for_eval_result } +func_add_hook func_validate_options libtool_validate_options +# Process options as early as possible so that --help and --version +# can return quickly. +func_options ${1+"$@"} +eval set dummy "$func_options_result"; shift + ## ----------- ## ## Main. ## ## ----------- ## +magic='%%%MAGIC variable%%%' +magic_exe='%%%MAGIC EXE variable%%%' + +# Global variables. +extracted_archives= +extracted_serial=0 + +# If this variable is set in any of the actions, the command in it +# will be execed at the end. This prevents here-documents from being +# left over by shells. +exec_cmd= + + +# A function that is used when there is no print builtin or printf. +func_fallback_echo () +{ + eval 'cat <<_LTECHO_EOF +$1 +_LTECHO_EOF' +} + +# func_generated_by_libtool +# True iff stdin has been generated by Libtool. This function is only +# a basic sanity check; it will hardly flush out determined imposters. +func_generated_by_libtool_p () +{ + $GREP "^# Generated by .*$PACKAGE" > /dev/null 2>&1 +} + # func_lalib_p file -# True iff FILE is a libtool `.la' library or `.lo' object file. +# True iff FILE is a libtool '.la' library or '.lo' object file. # This function is only a basic sanity check; it will hardly flush out # determined imposters. func_lalib_p () { test -f "$1" && - $SED -e 4q "$1" 2>/dev/null \ - | $GREP "^# Generated by .*$PACKAGE" > /dev/null 2>&1 + $SED -e 4q "$1" 2>/dev/null | func_generated_by_libtool_p } # func_lalib_unsafe_p file -# True iff FILE is a libtool `.la' library or `.lo' object file. +# True iff FILE is a libtool '.la' library or '.lo' object file. # This function implements the same check as func_lalib_p without # resorting to external programs. To this end, it redirects stdin and # closes it afterwards, without saving the original file descriptor. # As a safety measure, use it only where a negative result would be -# fatal anyway. Works if `file' does not exist. +# fatal anyway. Works if 'file' does not exist. func_lalib_unsafe_p () { lalib_p=no @@ -1249,13 +2521,13 @@ func_lalib_unsafe_p () for lalib_p_l in 1 2 3 4 do read lalib_p_line - case "$lalib_p_line" in + case $lalib_p_line in \#\ Generated\ by\ *$PACKAGE* ) lalib_p=yes; break;; esac done exec 0<&5 5<&- fi - test "$lalib_p" = yes + test yes = "$lalib_p" } # func_ltwrapper_script_p file @@ -1264,7 +2536,8 @@ func_lalib_unsafe_p () # determined imposters. func_ltwrapper_script_p () { - func_lalib_p "$1" + test -f "$1" && + $lt_truncate_bin < "$1" 2>/dev/null | func_generated_by_libtool_p } # func_ltwrapper_executable_p file @@ -1289,7 +2562,7 @@ func_ltwrapper_scriptname () { func_dirname_and_basename "$1" "" "." func_stripname '' '.exe' "$func_basename_result" - func_ltwrapper_scriptname_result="$func_dirname_result/$objdir/${func_stripname_result}_ltshwrapper" + func_ltwrapper_scriptname_result=$func_dirname_result/$objdir/${func_stripname_result}_ltshwrapper } # func_ltwrapper_p file @@ -1308,11 +2581,13 @@ func_ltwrapper_p () # FAIL_CMD may read-access the current command in variable CMD! func_execute_cmds () { - $opt_debug + $debug_cmd + save_ifs=$IFS; IFS='~' for cmd in $1; do - IFS=$save_ifs + IFS=$sp$nl eval cmd=\"$cmd\" + IFS=$save_ifs func_show_eval "$cmd" "${2-:}" done IFS=$save_ifs @@ -1324,10 +2599,11 @@ func_execute_cmds () # Note that it is not necessary on cygwin/mingw to append a dot to # FILE even if both FILE and FILE.exe exist: automatic-append-.exe # behavior happens only for exec(3), not for open(2)! Also, sourcing -# `FILE.' does not work on cygwin managed mounts. +# 'FILE.' does not work on cygwin managed mounts. func_source () { - $opt_debug + $debug_cmd + case $1 in */* | *\\*) . "$1" ;; *) . "./$1" ;; @@ -1354,10 +2630,10 @@ func_resolve_sysroot () # store the result into func_replace_sysroot_result. func_replace_sysroot () { - case "$lt_sysroot:$1" in + case $lt_sysroot:$1 in ?*:"$lt_sysroot"*) func_stripname "$lt_sysroot" '' "$1" - func_replace_sysroot_result="=$func_stripname_result" + func_replace_sysroot_result='='$func_stripname_result ;; *) # Including no sysroot. @@ -1374,7 +2650,8 @@ func_replace_sysroot () # arg is usually of the form 'gcc ...' func_infer_tag () { - $opt_debug + $debug_cmd + if test -n "$available_tags" && test -z "$tagname"; then CC_quoted= for arg in $CC; do @@ -1393,7 +2670,7 @@ func_infer_tag () for z in $available_tags; do if $GREP "^# ### BEGIN LIBTOOL TAG CONFIG: $z$" < "$progpath" > /dev/null; then # Evaluate the configuration. - eval "`${SED} -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$z'$/,/^# ### END LIBTOOL TAG CONFIG: '$z'$/p' < $progpath`" + eval "`$SED -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$z'$/,/^# ### END LIBTOOL TAG CONFIG: '$z'$/p' < $progpath`" CC_quoted= for arg in $CC; do # Double-quote args containing other shell metacharacters. @@ -1418,7 +2695,7 @@ func_infer_tag () # line option must be used. if test -z "$tagname"; then func_echo "unable to infer tagged configuration" - func_fatal_error "specify a tag with \`--tag'" + func_fatal_error "specify a tag with '--tag'" # else # func_verbose "using $tagname tagged configuration" fi @@ -1434,15 +2711,15 @@ func_infer_tag () # but don't create it if we're doing a dry run. func_write_libtool_object () { - write_libobj=${1} - if test "$build_libtool_libs" = yes; then - write_lobj=\'${2}\' + write_libobj=$1 + if test yes = "$build_libtool_libs"; then + write_lobj=\'$2\' else write_lobj=none fi - if test "$build_old_libs" = yes; then - write_oldobj=\'${3}\' + if test yes = "$build_old_libs"; then + write_oldobj=\'$3\' else write_oldobj=none fi @@ -1450,7 +2727,7 @@ func_write_libtool_object () $opt_dry_run || { cat >${write_libobj}T </dev/null` - if test "$?" -eq 0 && test -n "${func_convert_core_file_wine_to_w32_tmp}"; then + if test "$?" -eq 0 && test -n "$func_convert_core_file_wine_to_w32_tmp"; then func_convert_core_file_wine_to_w32_result=`$ECHO "$func_convert_core_file_wine_to_w32_tmp" | - $SED -e "$lt_sed_naive_backslashify"` + $SED -e "$sed_naive_backslashify"` else func_convert_core_file_wine_to_w32_result= fi @@ -1514,18 +2792,19 @@ func_convert_core_file_wine_to_w32 () # are convertible, then the result may be empty. func_convert_core_path_wine_to_w32 () { - $opt_debug + $debug_cmd + # unfortunately, winepath doesn't convert paths, only file names - func_convert_core_path_wine_to_w32_result="" + func_convert_core_path_wine_to_w32_result= if test -n "$1"; then oldIFS=$IFS IFS=: for func_convert_core_path_wine_to_w32_f in $1; do IFS=$oldIFS func_convert_core_file_wine_to_w32 "$func_convert_core_path_wine_to_w32_f" - if test -n "$func_convert_core_file_wine_to_w32_result" ; then + if test -n "$func_convert_core_file_wine_to_w32_result"; then if test -z "$func_convert_core_path_wine_to_w32_result"; then - func_convert_core_path_wine_to_w32_result="$func_convert_core_file_wine_to_w32_result" + func_convert_core_path_wine_to_w32_result=$func_convert_core_file_wine_to_w32_result else func_append func_convert_core_path_wine_to_w32_result ";$func_convert_core_file_wine_to_w32_result" fi @@ -1554,7 +2833,8 @@ func_convert_core_path_wine_to_w32 () # environment variable; do not put it in $PATH. func_cygpath () { - $opt_debug + $debug_cmd + if test -n "$LT_CYGPATH" && test -f "$LT_CYGPATH"; then func_cygpath_result=`$LT_CYGPATH "$@" 2>/dev/null` if test "$?" -ne 0; then @@ -1563,7 +2843,7 @@ func_cygpath () fi else func_cygpath_result= - func_error "LT_CYGPATH is empty or specifies non-existent file: \`$LT_CYGPATH'" + func_error "LT_CYGPATH is empty or specifies non-existent file: '$LT_CYGPATH'" fi } #end: func_cygpath @@ -1574,10 +2854,11 @@ func_cygpath () # result in func_convert_core_msys_to_w32_result. func_convert_core_msys_to_w32 () { - $opt_debug + $debug_cmd + # awkward: cmd appends spaces to result func_convert_core_msys_to_w32_result=`( cmd //c echo "$1" ) 2>/dev/null | - $SED -e 's/[ ]*$//' -e "$lt_sed_naive_backslashify"` + $SED -e 's/[ ]*$//' -e "$sed_naive_backslashify"` } #end: func_convert_core_msys_to_w32 @@ -1588,13 +2869,14 @@ func_convert_core_msys_to_w32 () # func_to_host_file_result to ARG1). func_convert_file_check () { - $opt_debug - if test -z "$2" && test -n "$1" ; then + $debug_cmd + + if test -z "$2" && test -n "$1"; then func_error "Could not determine host file name corresponding to" - func_error " \`$1'" + func_error " '$1'" func_error "Continuing, but uninstalled executables may not work." # Fallback: - func_to_host_file_result="$1" + func_to_host_file_result=$1 fi } # end func_convert_file_check @@ -1606,10 +2888,11 @@ func_convert_file_check () # func_to_host_file_result to a simplistic fallback value (see below). func_convert_path_check () { - $opt_debug + $debug_cmd + if test -z "$4" && test -n "$3"; then func_error "Could not determine the host path corresponding to" - func_error " \`$3'" + func_error " '$3'" func_error "Continuing, but uninstalled executables may not work." # Fallback. This is a deliberately simplistic "conversion" and # should not be "improved". See libtool.info. @@ -1618,7 +2901,7 @@ func_convert_path_check () func_to_host_path_result=`echo "$3" | $SED -e "$lt_replace_pathsep_chars"` else - func_to_host_path_result="$3" + func_to_host_path_result=$3 fi fi } @@ -1630,9 +2913,10 @@ func_convert_path_check () # and appending REPL if ORIG matches BACKPAT. func_convert_path_front_back_pathsep () { - $opt_debug + $debug_cmd + case $4 in - $1 ) func_to_host_path_result="$3$func_to_host_path_result" + $1 ) func_to_host_path_result=$3$func_to_host_path_result ;; esac case $4 in @@ -1646,7 +2930,7 @@ func_convert_path_front_back_pathsep () ################################################## # $build to $host FILE NAME CONVERSION FUNCTIONS # ################################################## -# invoked via `$to_host_file_cmd ARG' +# invoked via '$to_host_file_cmd ARG' # # In each case, ARG is the path to be converted from $build to $host format. # Result will be available in $func_to_host_file_result. @@ -1657,7 +2941,8 @@ func_convert_path_front_back_pathsep () # in func_to_host_file_result. func_to_host_file () { - $opt_debug + $debug_cmd + $to_host_file_cmd "$1" } # end func_to_host_file @@ -1669,7 +2954,8 @@ func_to_host_file () # in (the comma separated) LAZY, no conversion takes place. func_to_tool_file () { - $opt_debug + $debug_cmd + case ,$2, in *,"$to_tool_file_cmd",*) func_to_tool_file_result=$1 @@ -1687,7 +2973,7 @@ func_to_tool_file () # Copy ARG to func_to_host_file_result. func_convert_file_noop () { - func_to_host_file_result="$1" + func_to_host_file_result=$1 } # end func_convert_file_noop @@ -1698,11 +2984,12 @@ func_convert_file_noop () # func_to_host_file_result. func_convert_file_msys_to_w32 () { - $opt_debug - func_to_host_file_result="$1" + $debug_cmd + + func_to_host_file_result=$1 if test -n "$1"; then func_convert_core_msys_to_w32 "$1" - func_to_host_file_result="$func_convert_core_msys_to_w32_result" + func_to_host_file_result=$func_convert_core_msys_to_w32_result fi func_convert_file_check "$1" "$func_to_host_file_result" } @@ -1714,8 +3001,9 @@ func_convert_file_msys_to_w32 () # func_to_host_file_result. func_convert_file_cygwin_to_w32 () { - $opt_debug - func_to_host_file_result="$1" + $debug_cmd + + func_to_host_file_result=$1 if test -n "$1"; then # because $build is cygwin, we call "the" cygpath in $PATH; no need to use # LT_CYGPATH in this case. @@ -1731,11 +3019,12 @@ func_convert_file_cygwin_to_w32 () # and a working winepath. Returns result in func_to_host_file_result. func_convert_file_nix_to_w32 () { - $opt_debug - func_to_host_file_result="$1" + $debug_cmd + + func_to_host_file_result=$1 if test -n "$1"; then func_convert_core_file_wine_to_w32 "$1" - func_to_host_file_result="$func_convert_core_file_wine_to_w32_result" + func_to_host_file_result=$func_convert_core_file_wine_to_w32_result fi func_convert_file_check "$1" "$func_to_host_file_result" } @@ -1747,12 +3036,13 @@ func_convert_file_nix_to_w32 () # Returns result in func_to_host_file_result. func_convert_file_msys_to_cygwin () { - $opt_debug - func_to_host_file_result="$1" + $debug_cmd + + func_to_host_file_result=$1 if test -n "$1"; then func_convert_core_msys_to_w32 "$1" func_cygpath -u "$func_convert_core_msys_to_w32_result" - func_to_host_file_result="$func_cygpath_result" + func_to_host_file_result=$func_cygpath_result fi func_convert_file_check "$1" "$func_to_host_file_result" } @@ -1765,13 +3055,14 @@ func_convert_file_msys_to_cygwin () # in func_to_host_file_result. func_convert_file_nix_to_cygwin () { - $opt_debug - func_to_host_file_result="$1" + $debug_cmd + + func_to_host_file_result=$1 if test -n "$1"; then # convert from *nix to w32, then use cygpath to convert from w32 to cygwin. func_convert_core_file_wine_to_w32 "$1" func_cygpath -u "$func_convert_core_file_wine_to_w32_result" - func_to_host_file_result="$func_cygpath_result" + func_to_host_file_result=$func_cygpath_result fi func_convert_file_check "$1" "$func_to_host_file_result" } @@ -1781,7 +3072,7 @@ func_convert_file_nix_to_cygwin () ############################################# # $build to $host PATH CONVERSION FUNCTIONS # ############################################# -# invoked via `$to_host_path_cmd ARG' +# invoked via '$to_host_path_cmd ARG' # # In each case, ARG is the path to be converted from $build to $host format. # The result will be available in $func_to_host_path_result. @@ -1805,10 +3096,11 @@ func_convert_file_nix_to_cygwin () to_host_path_cmd= func_init_to_host_path_cmd () { - $opt_debug + $debug_cmd + if test -z "$to_host_path_cmd"; then func_stripname 'func_convert_file_' '' "$to_host_file_cmd" - to_host_path_cmd="func_convert_path_${func_stripname_result}" + to_host_path_cmd=func_convert_path_$func_stripname_result fi } @@ -1818,7 +3110,8 @@ func_init_to_host_path_cmd () # in func_to_host_path_result. func_to_host_path () { - $opt_debug + $debug_cmd + func_init_to_host_path_cmd $to_host_path_cmd "$1" } @@ -1829,7 +3122,7 @@ func_to_host_path () # Copy ARG to func_to_host_path_result. func_convert_path_noop () { - func_to_host_path_result="$1" + func_to_host_path_result=$1 } # end func_convert_path_noop @@ -1840,8 +3133,9 @@ func_convert_path_noop () # func_to_host_path_result. func_convert_path_msys_to_w32 () { - $opt_debug - func_to_host_path_result="$1" + $debug_cmd + + func_to_host_path_result=$1 if test -n "$1"; then # Remove leading and trailing path separator characters from ARG. MSYS # behavior is inconsistent here; cygpath turns them into '.;' and ';.'; @@ -1849,7 +3143,7 @@ func_convert_path_msys_to_w32 () func_stripname : : "$1" func_to_host_path_tmp1=$func_stripname_result func_convert_core_msys_to_w32 "$func_to_host_path_tmp1" - func_to_host_path_result="$func_convert_core_msys_to_w32_result" + func_to_host_path_result=$func_convert_core_msys_to_w32_result func_convert_path_check : ";" \ "$func_to_host_path_tmp1" "$func_to_host_path_result" func_convert_path_front_back_pathsep ":*" "*:" ";" "$1" @@ -1863,8 +3157,9 @@ func_convert_path_msys_to_w32 () # func_to_host_file_result. func_convert_path_cygwin_to_w32 () { - $opt_debug - func_to_host_path_result="$1" + $debug_cmd + + func_to_host_path_result=$1 if test -n "$1"; then # See func_convert_path_msys_to_w32: func_stripname : : "$1" @@ -1883,14 +3178,15 @@ func_convert_path_cygwin_to_w32 () # a working winepath. Returns result in func_to_host_file_result. func_convert_path_nix_to_w32 () { - $opt_debug - func_to_host_path_result="$1" + $debug_cmd + + func_to_host_path_result=$1 if test -n "$1"; then # See func_convert_path_msys_to_w32: func_stripname : : "$1" func_to_host_path_tmp1=$func_stripname_result func_convert_core_path_wine_to_w32 "$func_to_host_path_tmp1" - func_to_host_path_result="$func_convert_core_path_wine_to_w32_result" + func_to_host_path_result=$func_convert_core_path_wine_to_w32_result func_convert_path_check : ";" \ "$func_to_host_path_tmp1" "$func_to_host_path_result" func_convert_path_front_back_pathsep ":*" "*:" ";" "$1" @@ -1904,15 +3200,16 @@ func_convert_path_nix_to_w32 () # Returns result in func_to_host_file_result. func_convert_path_msys_to_cygwin () { - $opt_debug - func_to_host_path_result="$1" + $debug_cmd + + func_to_host_path_result=$1 if test -n "$1"; then # See func_convert_path_msys_to_w32: func_stripname : : "$1" func_to_host_path_tmp1=$func_stripname_result func_convert_core_msys_to_w32 "$func_to_host_path_tmp1" func_cygpath -u -p "$func_convert_core_msys_to_w32_result" - func_to_host_path_result="$func_cygpath_result" + func_to_host_path_result=$func_cygpath_result func_convert_path_check : : \ "$func_to_host_path_tmp1" "$func_to_host_path_result" func_convert_path_front_back_pathsep ":*" "*:" : "$1" @@ -1927,8 +3224,9 @@ func_convert_path_msys_to_cygwin () # func_to_host_file_result. func_convert_path_nix_to_cygwin () { - $opt_debug - func_to_host_path_result="$1" + $debug_cmd + + func_to_host_path_result=$1 if test -n "$1"; then # Remove leading and trailing path separator characters from # ARG. msys behavior is inconsistent here, cygpath turns them @@ -1937,7 +3235,7 @@ func_convert_path_nix_to_cygwin () func_to_host_path_tmp1=$func_stripname_result func_convert_core_path_wine_to_w32 "$func_to_host_path_tmp1" func_cygpath -u -p "$func_convert_core_path_wine_to_w32_result" - func_to_host_path_result="$func_cygpath_result" + func_to_host_path_result=$func_cygpath_result func_convert_path_check : : \ "$func_to_host_path_tmp1" "$func_to_host_path_result" func_convert_path_front_back_pathsep ":*" "*:" : "$1" @@ -1946,13 +3244,31 @@ func_convert_path_nix_to_cygwin () # end func_convert_path_nix_to_cygwin +# func_dll_def_p FILE +# True iff FILE is a Windows DLL '.def' file. +# Keep in sync with _LT_DLL_DEF_P in libtool.m4 +func_dll_def_p () +{ + $debug_cmd + + func_dll_def_p_tmp=`$SED -n \ + -e 's/^[ ]*//' \ + -e '/^\(;.*\)*$/d' \ + -e 's/^\(EXPORTS\|LIBRARY\)\([ ].*\)*$/DEF/p' \ + -e q \ + "$1"` + test DEF = "$func_dll_def_p_tmp" +} + + # func_mode_compile arg... func_mode_compile () { - $opt_debug + $debug_cmd + # Get the compilation command and the source file. base_compile= - srcfile="$nonopt" # always keep a non-empty value in "srcfile" + srcfile=$nonopt # always keep a non-empty value in "srcfile" suppress_opt=yes suppress_output= arg_mode=normal @@ -1965,12 +3281,12 @@ func_mode_compile () case $arg_mode in arg ) # do not "continue". Instead, add this to base_compile - lastarg="$arg" + lastarg=$arg arg_mode=normal ;; target ) - libobj="$arg" + libobj=$arg arg_mode=normal continue ;; @@ -1980,7 +3296,7 @@ func_mode_compile () case $arg in -o) test -n "$libobj" && \ - func_fatal_error "you cannot specify \`-o' more than once" + func_fatal_error "you cannot specify '-o' more than once" arg_mode=target continue ;; @@ -2009,12 +3325,12 @@ func_mode_compile () func_stripname '-Wc,' '' "$arg" args=$func_stripname_result lastarg= - save_ifs="$IFS"; IFS=',' + save_ifs=$IFS; IFS=, for arg in $args; do - IFS="$save_ifs" + IFS=$save_ifs func_append_quoted lastarg "$arg" done - IFS="$save_ifs" + IFS=$save_ifs func_stripname ' ' '' "$lastarg" lastarg=$func_stripname_result @@ -2027,8 +3343,8 @@ func_mode_compile () # Accept the current argument as the source file. # The previous "srcfile" becomes the current argument. # - lastarg="$srcfile" - srcfile="$arg" + lastarg=$srcfile + srcfile=$arg ;; esac # case $arg ;; @@ -2043,13 +3359,13 @@ func_mode_compile () func_fatal_error "you must specify an argument for -Xcompile" ;; target) - func_fatal_error "you must specify a target with \`-o'" + func_fatal_error "you must specify a target with '-o'" ;; *) # Get the name of the library object. test -z "$libobj" && { func_basename "$srcfile" - libobj="$func_basename_result" + libobj=$func_basename_result } ;; esac @@ -2069,7 +3385,7 @@ func_mode_compile () case $libobj in *.lo) func_lo2o "$libobj"; obj=$func_lo2o_result ;; *) - func_fatal_error "cannot determine name of library object from \`$libobj'" + func_fatal_error "cannot determine name of library object from '$libobj'" ;; esac @@ -2078,8 +3394,8 @@ func_mode_compile () for arg in $later; do case $arg in -shared) - test "$build_libtool_libs" != yes && \ - func_fatal_configuration "can not build a shared library" + test yes = "$build_libtool_libs" \ + || func_fatal_configuration "cannot build a shared library" build_old_libs=no continue ;; @@ -2105,17 +3421,17 @@ func_mode_compile () func_quote_for_eval "$libobj" test "X$libobj" != "X$func_quote_for_eval_result" \ && $ECHO "X$libobj" | $GREP '[]~#^*{};<>?"'"'"' &()|`$[]' \ - && func_warning "libobj name \`$libobj' may not contain shell special characters." + && func_warning "libobj name '$libobj' may not contain shell special characters." func_dirname_and_basename "$obj" "/" "" - objname="$func_basename_result" - xdir="$func_dirname_result" - lobj=${xdir}$objdir/$objname + objname=$func_basename_result + xdir=$func_dirname_result + lobj=$xdir$objdir/$objname test -z "$base_compile" && \ func_fatal_help "you must specify a compilation command" # Delete any leftover library objects. - if test "$build_old_libs" = yes; then + if test yes = "$build_old_libs"; then removelist="$obj $lobj $libobj ${libobj}T" else removelist="$lobj $libobj ${libobj}T" @@ -2127,16 +3443,16 @@ func_mode_compile () pic_mode=default ;; esac - if test "$pic_mode" = no && test "$deplibs_check_method" != pass_all; then + if test no = "$pic_mode" && test pass_all != "$deplibs_check_method"; then # non-PIC code in shared libraries is not supported pic_mode=default fi # Calculate the filename of the output object if compiler does # not support -o with -c - if test "$compiler_c_o" = no; then - output_obj=`$ECHO "$srcfile" | $SED 's%^.*/%%; s%\.[^.]*$%%'`.${objext} - lockfile="$output_obj.lock" + if test no = "$compiler_c_o"; then + output_obj=`$ECHO "$srcfile" | $SED 's%^.*/%%; s%\.[^.]*$%%'`.$objext + lockfile=$output_obj.lock else output_obj= need_locks=no @@ -2145,12 +3461,12 @@ func_mode_compile () # Lock this critical section if it is needed # We use this script file to make the link, it avoids creating a new file - if test "$need_locks" = yes; then + if test yes = "$need_locks"; then until $opt_dry_run || ln "$progpath" "$lockfile" 2>/dev/null; do func_echo "Waiting for $lockfile to be removed" sleep 2 done - elif test "$need_locks" = warn; then + elif test warn = "$need_locks"; then if test -f "$lockfile"; then $ECHO "\ *** ERROR, $lockfile exists and contains: @@ -2158,7 +3474,7 @@ func_mode_compile () This indicates that another process is trying to use the same temporary object file, and libtool could not work around it because -your compiler does not support \`-c' and \`-o' together. If you +your compiler does not support '-c' and '-o' together. If you repeat this compilation, it may succeed, by chance, but you had better avoid parallel builds (make -j) in this platform, or get a better compiler." @@ -2180,11 +3496,11 @@ compiler." qsrcfile=$func_quote_for_eval_result # Only build a PIC object if we are building libtool libraries. - if test "$build_libtool_libs" = yes; then + if test yes = "$build_libtool_libs"; then # Without this assignment, base_compile gets emptied. fbsd_hideous_sh_bug=$base_compile - if test "$pic_mode" != no; then + if test no != "$pic_mode"; then command="$base_compile $qsrcfile $pic_flag" else # Don't build PIC code @@ -2201,7 +3517,7 @@ compiler." func_show_eval_locale "$command" \ 'test -n "$output_obj" && $RM $removelist; exit $EXIT_FAILURE' - if test "$need_locks" = warn && + if test warn = "$need_locks" && test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then $ECHO "\ *** ERROR, $lockfile contains: @@ -2212,7 +3528,7 @@ $srcfile This indicates that another process is trying to use the same temporary object file, and libtool could not work around it because -your compiler does not support \`-c' and \`-o' together. If you +your compiler does not support '-c' and '-o' together. If you repeat this compilation, it may succeed, by chance, but you had better avoid parallel builds (make -j) in this platform, or get a better compiler." @@ -2228,20 +3544,20 @@ compiler." fi # Allow error messages only from the first compilation. - if test "$suppress_opt" = yes; then + if test yes = "$suppress_opt"; then suppress_output=' >/dev/null 2>&1' fi fi # Only build a position-dependent object if we build old libraries. - if test "$build_old_libs" = yes; then - if test "$pic_mode" != yes; then + if test yes = "$build_old_libs"; then + if test yes != "$pic_mode"; then # Don't build PIC code command="$base_compile $qsrcfile$pie_flag" else command="$base_compile $qsrcfile $pic_flag" fi - if test "$compiler_c_o" = yes; then + if test yes = "$compiler_c_o"; then func_append command " -o $obj" fi @@ -2250,7 +3566,7 @@ compiler." func_show_eval_locale "$command" \ '$opt_dry_run || $RM $removelist; exit $EXIT_FAILURE' - if test "$need_locks" = warn && + if test warn = "$need_locks" && test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then $ECHO "\ *** ERROR, $lockfile contains: @@ -2261,7 +3577,7 @@ $srcfile This indicates that another process is trying to use the same temporary object file, and libtool could not work around it because -your compiler does not support \`-c' and \`-o' together. If you +your compiler does not support '-c' and '-o' together. If you repeat this compilation, it may succeed, by chance, but you had better avoid parallel builds (make -j) in this platform, or get a better compiler." @@ -2281,7 +3597,7 @@ compiler." func_write_libtool_object "$libobj" "$objdir/$objname" "$objname" # Unlock the critical section if it was locked - if test "$need_locks" != no; then + if test no != "$need_locks"; then removelist=$lockfile $RM "$lockfile" fi @@ -2291,7 +3607,7 @@ compiler." } $opt_help || { - test "$opt_mode" = compile && func_mode_compile ${1+"$@"} + test compile = "$opt_mode" && func_mode_compile ${1+"$@"} } func_mode_help () @@ -2311,7 +3627,7 @@ func_mode_help () Remove files from the build directory. RM is the name of the program to use to delete files associated with each FILE -(typically \`/bin/rm'). RM-OPTIONS are options (such as \`-f') to be passed +(typically '/bin/rm'). RM-OPTIONS are options (such as '-f') to be passed to RM. If FILE is a libtool library, object or program, all the files associated @@ -2330,16 +3646,16 @@ This mode accepts the following additional options: -no-suppress do not suppress compiler output for multiple passes -prefer-pic try to build PIC objects only -prefer-non-pic try to build non-PIC objects only - -shared do not build a \`.o' file suitable for static linking - -static only build a \`.o' file suitable for static linking + -shared do not build a '.o' file suitable for static linking + -static only build a '.o' file suitable for static linking -Wc,FLAG pass FLAG directly to the compiler -COMPILE-COMMAND is a command to be used in creating a \`standard' object file +COMPILE-COMMAND is a command to be used in creating a 'standard' object file from the given SOURCEFILE. The output file name is determined by removing the directory component from -SOURCEFILE, then substituting the C source code suffix \`.c' with the -library object suffix, \`.lo'." +SOURCEFILE, then substituting the C source code suffix '.c' with the +library object suffix, '.lo'." ;; execute) @@ -2352,7 +3668,7 @@ This mode accepts the following additional options: -dlopen FILE add the directory containing FILE to the library path -This mode sets the library path environment variable according to \`-dlopen' +This mode sets the library path environment variable according to '-dlopen' flags. If any of the ARGS are libtool executable wrappers, then they are translated @@ -2371,7 +3687,7 @@ Complete the installation of libtool libraries. Each LIBDIR is a directory that contains libtool libraries. The commands that this mode executes may require superuser privileges. Use -the \`--dry-run' option if you just want to see what would be executed." +the '--dry-run' option if you just want to see what would be executed." ;; install) @@ -2381,7 +3697,7 @@ the \`--dry-run' option if you just want to see what would be executed." Install executables or libraries. INSTALL-COMMAND is the installation command. The first component should be -either the \`install' or \`cp' program. +either the 'install' or 'cp' program. The following components of INSTALL-COMMAND are treated specially: @@ -2407,7 +3723,7 @@ The following components of LINK-COMMAND are treated specially: -avoid-version do not add a version suffix if possible -bindir BINDIR specify path to binaries directory (for systems where libraries must be found in the PATH setting at runtime) - -dlopen FILE \`-dlpreopen' FILE if it cannot be dlopened at runtime + -dlopen FILE '-dlpreopen' FILE if it cannot be dlopened at runtime -dlpreopen FILE link in FILE and add its symbols to lt_preloaded_symbols -export-dynamic allow symbols from OUTPUT-FILE to be resolved with dlsym(3) -export-symbols SYMFILE @@ -2421,7 +3737,8 @@ The following components of LINK-COMMAND are treated specially: -no-install link a not-installable executable -no-undefined declare that a library does not refer to external symbols -o OUTPUT-FILE create OUTPUT-FILE from the specified objects - -objectlist FILE Use a list of object files found in FILE to specify objects + -objectlist FILE use a list of object files found in FILE to specify objects + -os2dllname NAME force a short DLL name on OS/2 (no effect on other OSes) -precious-files-regex REGEX don't remove output files matching REGEX -release RELEASE specify package release information @@ -2441,20 +3758,20 @@ The following components of LINK-COMMAND are treated specially: -Xlinker FLAG pass linker-specific FLAG directly to the linker -XCClinker FLAG pass link-specific FLAG to the compiler driver (CC) -All other options (arguments beginning with \`-') are ignored. +All other options (arguments beginning with '-') are ignored. -Every other argument is treated as a filename. Files ending in \`.la' are +Every other argument is treated as a filename. Files ending in '.la' are treated as uninstalled libtool libraries, other files are standard or library object files. -If the OUTPUT-FILE ends in \`.la', then a libtool library is created, -only library objects (\`.lo' files) may be specified, and \`-rpath' is +If the OUTPUT-FILE ends in '.la', then a libtool library is created, +only library objects ('.lo' files) may be specified, and '-rpath' is required, except when creating a convenience library. -If OUTPUT-FILE ends in \`.a' or \`.lib', then a standard library is created -using \`ar' and \`ranlib', or on Windows using \`lib'. +If OUTPUT-FILE ends in '.a' or '.lib', then a standard library is created +using 'ar' and 'ranlib', or on Windows using 'lib'. -If OUTPUT-FILE ends in \`.lo' or \`.${objext}', then a reloadable object file +If OUTPUT-FILE ends in '.lo' or '.$objext', then a reloadable object file is created, otherwise an executable program is created." ;; @@ -2465,7 +3782,7 @@ is created, otherwise an executable program is created." Remove libraries from an installation directory. RM is the name of the program to use to delete files associated with each FILE -(typically \`/bin/rm'). RM-OPTIONS are options (such as \`-f') to be passed +(typically '/bin/rm'). RM-OPTIONS are options (such as '-f') to be passed to RM. If FILE is a libtool library, all the files associated with it are deleted. @@ -2473,17 +3790,17 @@ Otherwise, only FILE itself is deleted using RM." ;; *) - func_fatal_help "invalid operation mode \`$opt_mode'" + func_fatal_help "invalid operation mode '$opt_mode'" ;; esac echo - $ECHO "Try \`$progname --help' for more information about other modes." + $ECHO "Try '$progname --help' for more information about other modes." } # Now that we've collected a possible --mode arg, show help if necessary if $opt_help; then - if test "$opt_help" = :; then + if test : = "$opt_help"; then func_mode_help else { @@ -2491,7 +3808,7 @@ if $opt_help; then for opt_mode in compile link execute install finish uninstall clean; do func_mode_help done - } | sed -n '1p; 2,$s/^Usage:/ or: /p' + } | $SED -n '1p; 2,$s/^Usage:/ or: /p' { func_help noexit for opt_mode in compile link execute install finish uninstall clean; do @@ -2499,7 +3816,7 @@ if $opt_help; then func_mode_help done } | - sed '1d + $SED '1d /^When reporting/,/^Report/{ H d @@ -2516,16 +3833,17 @@ fi # func_mode_execute arg... func_mode_execute () { - $opt_debug + $debug_cmd + # The first argument is the command name. - cmd="$nonopt" + cmd=$nonopt test -z "$cmd" && \ func_fatal_help "you must specify a COMMAND" # Handle -dlopen flags immediately. for file in $opt_dlopen; do test -f "$file" \ - || func_fatal_help "\`$file' is not a file" + || func_fatal_help "'$file' is not a file" dir= case $file in @@ -2535,7 +3853,7 @@ func_mode_execute () # Check to see that this really is a libtool archive. func_lalib_unsafe_p "$file" \ - || func_fatal_help "\`$lib' is not a valid libtool archive" + || func_fatal_help "'$lib' is not a valid libtool archive" # Read the libtool library. dlname= @@ -2546,18 +3864,18 @@ func_mode_execute () if test -z "$dlname"; then # Warn if it was a shared library. test -n "$library_names" && \ - func_warning "\`$file' was not linked with \`-export-dynamic'" + func_warning "'$file' was not linked with '-export-dynamic'" continue fi func_dirname "$file" "" "." - dir="$func_dirname_result" + dir=$func_dirname_result if test -f "$dir/$objdir/$dlname"; then func_append dir "/$objdir" else if test ! -f "$dir/$dlname"; then - func_fatal_error "cannot find \`$dlname' in \`$dir' or \`$dir/$objdir'" + func_fatal_error "cannot find '$dlname' in '$dir' or '$dir/$objdir'" fi fi ;; @@ -2565,18 +3883,18 @@ func_mode_execute () *.lo) # Just add the directory containing the .lo file. func_dirname "$file" "" "." - dir="$func_dirname_result" + dir=$func_dirname_result ;; *) - func_warning "\`-dlopen' is ignored for non-libtool libraries and objects" + func_warning "'-dlopen' is ignored for non-libtool libraries and objects" continue ;; esac # Get the absolute pathname. absdir=`cd "$dir" && pwd` - test -n "$absdir" && dir="$absdir" + test -n "$absdir" && dir=$absdir # Now add the directory to shlibpath_var. if eval "test -z \"\$$shlibpath_var\""; then @@ -2588,7 +3906,7 @@ func_mode_execute () # This variable tells wrapper scripts just to set shlibpath_var # rather than running their programs. - libtool_execute_magic="$magic" + libtool_execute_magic=$magic # Check if any of the arguments is a wrapper script. args= @@ -2601,12 +3919,12 @@ func_mode_execute () if func_ltwrapper_script_p "$file"; then func_source "$file" # Transform arg to wrapped name. - file="$progdir/$program" + file=$progdir/$program elif func_ltwrapper_executable_p "$file"; then func_ltwrapper_scriptname "$file" func_source "$func_ltwrapper_scriptname_result" # Transform arg to wrapped name. - file="$progdir/$program" + file=$progdir/$program fi ;; esac @@ -2614,7 +3932,15 @@ func_mode_execute () func_append_quoted args "$file" done - if test "X$opt_dry_run" = Xfalse; then + if $opt_dry_run; then + # Display what would be done. + if test -n "$shlibpath_var"; then + eval "\$ECHO \"\$shlibpath_var=\$$shlibpath_var\"" + echo "export $shlibpath_var" + fi + $ECHO "$cmd$args" + exit $EXIT_SUCCESS + else if test -n "$shlibpath_var"; then # Export the shlibpath_var. eval "export $shlibpath_var" @@ -2631,25 +3957,18 @@ func_mode_execute () done # Now prepare to actually exec the command. - exec_cmd="\$cmd$args" - else - # Display what would be done. - if test -n "$shlibpath_var"; then - eval "\$ECHO \"\$shlibpath_var=\$$shlibpath_var\"" - echo "export $shlibpath_var" - fi - $ECHO "$cmd$args" - exit $EXIT_SUCCESS + exec_cmd=\$cmd$args fi } -test "$opt_mode" = execute && func_mode_execute ${1+"$@"} +test execute = "$opt_mode" && func_mode_execute ${1+"$@"} # func_mode_finish arg... func_mode_finish () { - $opt_debug + $debug_cmd + libs= libdirs= admincmds= @@ -2663,11 +3982,11 @@ func_mode_finish () if func_lalib_unsafe_p "$opt"; then func_append libs " $opt" else - func_warning "\`$opt' is not a valid libtool archive" + func_warning "'$opt' is not a valid libtool archive" fi else - func_fatal_error "invalid argument \`$opt'" + func_fatal_error "invalid argument '$opt'" fi done @@ -2682,12 +4001,12 @@ func_mode_finish () # Remove sysroot references if $opt_dry_run; then for lib in $libs; do - echo "removing references to $lt_sysroot and \`=' prefixes from $lib" + echo "removing references to $lt_sysroot and '=' prefixes from $lib" done else tmpdir=`func_mktempdir` for lib in $libs; do - sed -e "${sysroot_cmd} s/\([ ']-[LR]\)=/\1/g; s/\([ ']\)=/\1/g" $lib \ + $SED -e "$sysroot_cmd s/\([ ']-[LR]\)=/\1/g; s/\([ ']\)=/\1/g" $lib \ > $tmpdir/tmp-la mv -f $tmpdir/tmp-la $lib done @@ -2712,7 +4031,7 @@ func_mode_finish () fi # Exit here if they wanted silent mode. - $opt_silent && exit $EXIT_SUCCESS + $opt_quiet && exit $EXIT_SUCCESS if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then echo "----------------------------------------------------------------------" @@ -2723,27 +4042,27 @@ func_mode_finish () echo echo "If you ever happen to want to link against installed libraries" echo "in a given directory, LIBDIR, you must either use libtool, and" - echo "specify the full pathname of the library, or use the \`-LLIBDIR'" + echo "specify the full pathname of the library, or use the '-LLIBDIR'" echo "flag during linking and do at least one of the following:" if test -n "$shlibpath_var"; then - echo " - add LIBDIR to the \`$shlibpath_var' environment variable" + echo " - add LIBDIR to the '$shlibpath_var' environment variable" echo " during execution" fi if test -n "$runpath_var"; then - echo " - add LIBDIR to the \`$runpath_var' environment variable" + echo " - add LIBDIR to the '$runpath_var' environment variable" echo " during linking" fi if test -n "$hardcode_libdir_flag_spec"; then libdir=LIBDIR eval flag=\"$hardcode_libdir_flag_spec\" - $ECHO " - use the \`$flag' linker flag" + $ECHO " - use the '$flag' linker flag" fi if test -n "$admincmds"; then $ECHO " - have your system administrator run these commands:$admincmds" fi if test -f /etc/ld.so.conf; then - echo " - have your system administrator add LIBDIR to \`/etc/ld.so.conf'" + echo " - have your system administrator add LIBDIR to '/etc/ld.so.conf'" fi echo @@ -2762,18 +4081,20 @@ func_mode_finish () exit $EXIT_SUCCESS } -test "$opt_mode" = finish && func_mode_finish ${1+"$@"} +test finish = "$opt_mode" && func_mode_finish ${1+"$@"} # func_mode_install arg... func_mode_install () { - $opt_debug + $debug_cmd + # There may be an optional sh(1) argument at the beginning of # install_prog (especially on Windows NT). - if test "$nonopt" = "$SHELL" || test "$nonopt" = /bin/sh || + if test "$SHELL" = "$nonopt" || test /bin/sh = "$nonopt" || # Allow the use of GNU shtool's install command. - case $nonopt in *shtool*) :;; *) false;; esac; then + case $nonopt in *shtool*) :;; *) false;; esac + then # Aesthetically quote it. func_quote_for_eval "$nonopt" install_prog="$func_quote_for_eval_result " @@ -2800,7 +4121,7 @@ func_mode_install () opts= prev= install_type= - isdir=no + isdir=false stripme= no_mode=: for arg @@ -2813,7 +4134,7 @@ func_mode_install () fi case $arg in - -d) isdir=yes ;; + -d) isdir=: ;; -f) if $install_cp; then :; else prev=$arg @@ -2831,7 +4152,7 @@ func_mode_install () *) # If the previous option needed an argument, then skip it. if test -n "$prev"; then - if test "x$prev" = x-m && test -n "$install_override_mode"; then + if test X-m = "X$prev" && test -n "$install_override_mode"; then arg2=$install_override_mode no_mode=false fi @@ -2856,7 +4177,7 @@ func_mode_install () func_fatal_help "you must specify an install program" test -n "$prev" && \ - func_fatal_help "the \`$prev' option requires an argument" + func_fatal_help "the '$prev' option requires an argument" if test -n "$install_override_mode" && $no_mode; then if $install_cp; then :; else @@ -2878,19 +4199,19 @@ func_mode_install () dest=$func_stripname_result # Check to see that the destination is a directory. - test -d "$dest" && isdir=yes - if test "$isdir" = yes; then - destdir="$dest" + test -d "$dest" && isdir=: + if $isdir; then + destdir=$dest destname= else func_dirname_and_basename "$dest" "" "." - destdir="$func_dirname_result" - destname="$func_basename_result" + destdir=$func_dirname_result + destname=$func_basename_result # Not a directory, so check to see that there is only one file specified. set dummy $files; shift test "$#" -gt 1 && \ - func_fatal_help "\`$dest' is not a directory" + func_fatal_help "'$dest' is not a directory" fi case $destdir in [\\/]* | [A-Za-z]:[\\/]*) ;; @@ -2899,7 +4220,7 @@ func_mode_install () case $file in *.lo) ;; *) - func_fatal_help "\`$destdir' must be an absolute directory name" + func_fatal_help "'$destdir' must be an absolute directory name" ;; esac done @@ -2908,7 +4229,7 @@ func_mode_install () # This variable tells wrapper scripts just to set variables rather # than running their programs. - libtool_install_magic="$magic" + libtool_install_magic=$magic staticlibs= future_libdirs= @@ -2928,7 +4249,7 @@ func_mode_install () # Check to see that this really is a libtool archive. func_lalib_unsafe_p "$file" \ - || func_fatal_help "\`$file' is not a valid libtool archive" + || func_fatal_help "'$file' is not a valid libtool archive" library_names= old_library= @@ -2950,7 +4271,7 @@ func_mode_install () fi func_dirname "$file" "/" "" - dir="$func_dirname_result" + dir=$func_dirname_result func_append dir "$objdir" if test -n "$relink_command"; then @@ -2964,7 +4285,7 @@ func_mode_install () # are installed into $libdir/../bin (currently, that works fine) # but it's something to keep an eye on. test "$inst_prefix_dir" = "$destdir" && \ - func_fatal_error "error: cannot install \`$file' to a directory not ending in $libdir" + func_fatal_error "error: cannot install '$file' to a directory not ending in $libdir" if test -n "$inst_prefix_dir"; then # Stick the inst_prefix_dir data into the link command. @@ -2973,29 +4294,36 @@ func_mode_install () relink_command=`$ECHO "$relink_command" | $SED "s%@inst_prefix_dir@%%"` fi - func_warning "relinking \`$file'" + func_warning "relinking '$file'" func_show_eval "$relink_command" \ - 'func_fatal_error "error: relink \`$file'\'' with the above command before installing it"' + 'func_fatal_error "error: relink '\''$file'\'' with the above command before installing it"' fi # See the names of the shared library. set dummy $library_names; shift if test -n "$1"; then - realname="$1" + realname=$1 shift - srcname="$realname" - test -n "$relink_command" && srcname="$realname"T + srcname=$realname + test -n "$relink_command" && srcname=${realname}T # Install the shared library and build the symlinks. func_show_eval "$install_shared_prog $dir/$srcname $destdir/$realname" \ 'exit $?' - tstripme="$stripme" + tstripme=$stripme case $host_os in cygwin* | mingw* | pw32* | cegcc*) case $realname in *.dll.a) - tstripme="" + tstripme= + ;; + esac + ;; + os2*) + case $realname in + *_dll.a) + tstripme= ;; esac ;; @@ -3006,7 +4334,7 @@ func_mode_install () if test "$#" -gt 0; then # Delete the old symlinks, and create new ones. - # Try `ln -sf' first, because the `ln' binary might depend on + # Try 'ln -sf' first, because the 'ln' binary might depend on # the symlink we replace! Solaris /bin/ln does not understand -f, # so we also need to try rm && ln -s. for linkname @@ -3017,14 +4345,14 @@ func_mode_install () fi # Do each command in the postinstall commands. - lib="$destdir/$realname" + lib=$destdir/$realname func_execute_cmds "$postinstall_cmds" 'exit $?' fi # Install the pseudo-library for information purposes. func_basename "$file" - name="$func_basename_result" - instname="$dir/$name"i + name=$func_basename_result + instname=$dir/${name}i func_show_eval "$install_prog $instname $destdir/$name" 'exit $?' # Maybe install the static library, too. @@ -3036,11 +4364,11 @@ func_mode_install () # Figure out destination file name, if it wasn't already specified. if test -n "$destname"; then - destfile="$destdir/$destname" + destfile=$destdir/$destname else func_basename "$file" - destfile="$func_basename_result" - destfile="$destdir/$destfile" + destfile=$func_basename_result + destfile=$destdir/$destfile fi # Deduce the name of the destination old-style object file. @@ -3050,11 +4378,11 @@ func_mode_install () staticdest=$func_lo2o_result ;; *.$objext) - staticdest="$destfile" + staticdest=$destfile destfile= ;; *) - func_fatal_help "cannot copy a libtool object to \`$destfile'" + func_fatal_help "cannot copy a libtool object to '$destfile'" ;; esac @@ -3063,7 +4391,7 @@ func_mode_install () func_show_eval "$install_prog $file $destfile" 'exit $?' # Install the old object if enabled. - if test "$build_old_libs" = yes; then + if test yes = "$build_old_libs"; then # Deduce the name of the old-style object file. func_lo2o "$file" staticobj=$func_lo2o_result @@ -3075,23 +4403,23 @@ func_mode_install () *) # Figure out destination file name, if it wasn't already specified. if test -n "$destname"; then - destfile="$destdir/$destname" + destfile=$destdir/$destname else func_basename "$file" - destfile="$func_basename_result" - destfile="$destdir/$destfile" + destfile=$func_basename_result + destfile=$destdir/$destfile fi # If the file is missing, and there is a .exe on the end, strip it # because it is most likely a libtool script we actually want to # install - stripped_ext="" + stripped_ext= case $file in *.exe) if test ! -f "$file"; then func_stripname '' '.exe' "$file" file=$func_stripname_result - stripped_ext=".exe" + stripped_ext=.exe fi ;; esac @@ -3119,19 +4447,19 @@ func_mode_install () # Check the variables that should have been set. test -z "$generated_by_libtool_version" && \ - func_fatal_error "invalid libtool wrapper script \`$wrapper'" + func_fatal_error "invalid libtool wrapper script '$wrapper'" - finalize=yes + finalize=: for lib in $notinst_deplibs; do # Check to see that each library is installed. libdir= if test -f "$lib"; then func_source "$lib" fi - libfile="$libdir/"`$ECHO "$lib" | $SED 's%^.*/%%g'` ### testsuite: skip nested quoting test + libfile=$libdir/`$ECHO "$lib" | $SED 's%^.*/%%g'` if test -n "$libdir" && test ! -f "$libfile"; then - func_warning "\`$lib' has not been installed in \`$libdir'" - finalize=no + func_warning "'$lib' has not been installed in '$libdir'" + finalize=false fi done @@ -3139,29 +4467,29 @@ func_mode_install () func_source "$wrapper" outputname= - if test "$fast_install" = no && test -n "$relink_command"; then + if test no = "$fast_install" && test -n "$relink_command"; then $opt_dry_run || { - if test "$finalize" = yes; then + if $finalize; then tmpdir=`func_mktempdir` func_basename "$file$stripped_ext" - file="$func_basename_result" - outputname="$tmpdir/$file" + file=$func_basename_result + outputname=$tmpdir/$file # Replace the output file specification. relink_command=`$ECHO "$relink_command" | $SED 's%@OUTPUT@%'"$outputname"'%g'` - $opt_silent || { + $opt_quiet || { func_quote_for_expand "$relink_command" eval "func_echo $func_quote_for_expand_result" } if eval "$relink_command"; then : else - func_error "error: relink \`$file' with the above command before installing it" + func_error "error: relink '$file' with the above command before installing it" $opt_dry_run || ${RM}r "$tmpdir" continue fi - file="$outputname" + file=$outputname else - func_warning "cannot relink \`$file'" + func_warning "cannot relink '$file'" fi } else @@ -3198,10 +4526,10 @@ func_mode_install () for file in $staticlibs; do func_basename "$file" - name="$func_basename_result" + name=$func_basename_result # Set up the ranlib parameters. - oldlib="$destdir/$name" + oldlib=$destdir/$name func_to_tool_file "$oldlib" func_convert_file_msys_to_w32 tool_oldlib=$func_to_tool_file_result @@ -3216,18 +4544,18 @@ func_mode_install () done test -n "$future_libdirs" && \ - func_warning "remember to run \`$progname --finish$future_libdirs'" + func_warning "remember to run '$progname --finish$future_libdirs'" if test -n "$current_libdirs"; then # Maybe just do a dry run. $opt_dry_run && current_libdirs=" -n$current_libdirs" - exec_cmd='$SHELL $progpath $preserve_args --finish$current_libdirs' + exec_cmd='$SHELL "$progpath" $preserve_args --finish$current_libdirs' else exit $EXIT_SUCCESS fi } -test "$opt_mode" = install && func_mode_install ${1+"$@"} +test install = "$opt_mode" && func_mode_install ${1+"$@"} # func_generate_dlsyms outputname originator pic_p @@ -3235,16 +4563,17 @@ test "$opt_mode" = install && func_mode_install ${1+"$@"} # a dlpreopen symbol table. func_generate_dlsyms () { - $opt_debug - my_outputname="$1" - my_originator="$2" - my_pic_p="${3-no}" - my_prefix=`$ECHO "$my_originator" | sed 's%[^a-zA-Z0-9]%_%g'` + $debug_cmd + + my_outputname=$1 + my_originator=$2 + my_pic_p=${3-false} + my_prefix=`$ECHO "$my_originator" | $SED 's%[^a-zA-Z0-9]%_%g'` my_dlsyms= - if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then + if test -n "$dlfiles$dlprefiles" || test no != "$dlself"; then if test -n "$NM" && test -n "$global_symbol_pipe"; then - my_dlsyms="${my_outputname}S.c" + my_dlsyms=${my_outputname}S.c else func_error "not configured to extract global symbols from dlpreopened files" fi @@ -3255,7 +4584,7 @@ func_generate_dlsyms () "") ;; *.c) # Discover the nlist of each of the dlfiles. - nlist="$output_objdir/${my_outputname}.nm" + nlist=$output_objdir/$my_outputname.nm func_show_eval "$RM $nlist ${nlist}S ${nlist}T" @@ -3263,34 +4592,36 @@ func_generate_dlsyms () func_verbose "creating $output_objdir/$my_dlsyms" $opt_dry_run || $ECHO > "$output_objdir/$my_dlsyms" "\ -/* $my_dlsyms - symbol resolution table for \`$my_outputname' dlsym emulation. */ -/* Generated by $PROGRAM (GNU $PACKAGE$TIMESTAMP) $VERSION */ +/* $my_dlsyms - symbol resolution table for '$my_outputname' dlsym emulation. */ +/* Generated by $PROGRAM (GNU $PACKAGE) $VERSION */ #ifdef __cplusplus extern \"C\" { #endif -#if defined(__GNUC__) && (((__GNUC__ == 4) && (__GNUC_MINOR__ >= 4)) || (__GNUC__ > 4)) +#if defined __GNUC__ && (((__GNUC__ == 4) && (__GNUC_MINOR__ >= 4)) || (__GNUC__ > 4)) #pragma GCC diagnostic ignored \"-Wstrict-prototypes\" #endif /* Keep this code in sync between libtool.m4, ltmain, lt_system.h, and tests. */ -#if defined(_WIN32) || defined(__CYGWIN__) || defined(_WIN32_WCE) -/* DATA imports from DLLs on WIN32 con't be const, because runtime +#if defined _WIN32 || defined __CYGWIN__ || defined _WIN32_WCE +/* DATA imports from DLLs on WIN32 can't be const, because runtime relocations are performed -- see ld's documentation on pseudo-relocs. */ # define LT_DLSYM_CONST -#elif defined(__osf__) +#elif defined __osf__ /* This system does not cope well with relocations in const data. */ # define LT_DLSYM_CONST #else # define LT_DLSYM_CONST const #endif +#define STREQ(s1, s2) (strcmp ((s1), (s2)) == 0) + /* External symbol declarations for the compiler. */\ " - if test "$dlself" = yes; then - func_verbose "generating symbol list for \`$output'" + if test yes = "$dlself"; then + func_verbose "generating symbol list for '$output'" $opt_dry_run || echo ': @PROGRAM@ ' > "$nlist" @@ -3298,7 +4629,7 @@ extern \"C\" { progfiles=`$ECHO "$objs$old_deplibs" | $SP2NL | $SED "$lo2o" | $NL2SP` for progfile in $progfiles; do func_to_tool_file "$progfile" func_convert_file_msys_to_w32 - func_verbose "extracting global C symbols from \`$func_to_tool_file_result'" + func_verbose "extracting global C symbols from '$func_to_tool_file_result'" $opt_dry_run || eval "$NM $func_to_tool_file_result | $global_symbol_pipe >> '$nlist'" done @@ -3318,10 +4649,10 @@ extern \"C\" { # Prepare the list of exported symbols if test -z "$export_symbols"; then - export_symbols="$output_objdir/$outputname.exp" + export_symbols=$output_objdir/$outputname.exp $opt_dry_run || { $RM $export_symbols - eval "${SED} -n -e '/^: @PROGRAM@ $/d' -e 's/^.* \(.*\)$/\1/p' "'< "$nlist" > "$export_symbols"' + eval "$SED -n -e '/^: @PROGRAM@ $/d' -e 's/^.* \(.*\)$/\1/p' "'< "$nlist" > "$export_symbols"' case $host in *cygwin* | *mingw* | *cegcc* ) eval "echo EXPORTS "'> "$output_objdir/$outputname.def"' @@ -3331,7 +4662,7 @@ extern \"C\" { } else $opt_dry_run || { - eval "${SED} -e 's/\([].[*^$]\)/\\\\\1/g' -e 's/^/ /' -e 's/$/$/'"' < "$export_symbols" > "$output_objdir/$outputname.exp"' + eval "$SED -e 's/\([].[*^$]\)/\\\\\1/g' -e 's/^/ /' -e 's/$/$/'"' < "$export_symbols" > "$output_objdir/$outputname.exp"' eval '$GREP -f "$output_objdir/$outputname.exp" < "$nlist" > "$nlist"T' eval '$MV "$nlist"T "$nlist"' case $host in @@ -3345,22 +4676,22 @@ extern \"C\" { fi for dlprefile in $dlprefiles; do - func_verbose "extracting global C symbols from \`$dlprefile'" + func_verbose "extracting global C symbols from '$dlprefile'" func_basename "$dlprefile" - name="$func_basename_result" + name=$func_basename_result case $host in *cygwin* | *mingw* | *cegcc* ) # if an import library, we need to obtain dlname if func_win32_import_lib_p "$dlprefile"; then func_tr_sh "$dlprefile" eval "curr_lafile=\$libfile_$func_tr_sh_result" - dlprefile_dlbasename="" + dlprefile_dlbasename= if test -n "$curr_lafile" && func_lalib_p "$curr_lafile"; then # Use subshell, to avoid clobbering current variable values dlprefile_dlname=`source "$curr_lafile" && echo "$dlname"` - if test -n "$dlprefile_dlname" ; then + if test -n "$dlprefile_dlname"; then func_basename "$dlprefile_dlname" - dlprefile_dlbasename="$func_basename_result" + dlprefile_dlbasename=$func_basename_result else # no lafile. user explicitly requested -dlpreopen . $sharedlib_from_linklib_cmd "$dlprefile" @@ -3368,7 +4699,7 @@ extern \"C\" { fi fi $opt_dry_run || { - if test -n "$dlprefile_dlbasename" ; then + if test -n "$dlprefile_dlbasename"; then eval '$ECHO ": $dlprefile_dlbasename" >> "$nlist"' else func_warning "Could not compute DLL name from $name" @@ -3424,6 +4755,11 @@ extern \"C\" { echo '/* NONE */' >> "$output_objdir/$my_dlsyms" fi + func_show_eval '$RM "${nlist}I"' + if test -n "$global_symbol_to_import"; then + eval "$global_symbol_to_import"' < "$nlist"S > "$nlist"I' + fi + echo >> "$output_objdir/$my_dlsyms" "\ /* The mapping between symbol names and symbols. */ @@ -3432,11 +4768,30 @@ typedef struct { void *address; } lt_dlsymlist; extern LT_DLSYM_CONST lt_dlsymlist -lt_${my_prefix}_LTX_preloaded_symbols[]; +lt_${my_prefix}_LTX_preloaded_symbols[];\ +" + + if test -s "$nlist"I; then + echo >> "$output_objdir/$my_dlsyms" "\ +static void lt_syminit(void) +{ + LT_DLSYM_CONST lt_dlsymlist *symbol = lt_${my_prefix}_LTX_preloaded_symbols; + for (; symbol->name; ++symbol) + {" + $SED 's/.*/ if (STREQ (symbol->name, \"&\")) symbol->address = (void *) \&&;/' < "$nlist"I >> "$output_objdir/$my_dlsyms" + echo >> "$output_objdir/$my_dlsyms" "\ + } +}" + fi + echo >> "$output_objdir/$my_dlsyms" "\ LT_DLSYM_CONST lt_dlsymlist lt_${my_prefix}_LTX_preloaded_symbols[] = -{\ - { \"$my_originator\", (void *) 0 }," +{ {\"$my_originator\", (void *) 0}," + + if test -s "$nlist"I; then + echo >> "$output_objdir/$my_dlsyms" "\ + {\"@INIT@\", (void *) <_syminit}," + fi case $need_lib_prefix in no) @@ -3478,9 +4833,7 @@ static const void *lt_preloaded_setup() { *-*-hpux*) pic_flag_for_symtable=" $pic_flag" ;; *) - if test "X$my_pic_p" != Xno; then - pic_flag_for_symtable=" $pic_flag" - fi + $my_pic_p && pic_flag_for_symtable=" $pic_flag" ;; esac ;; @@ -3497,10 +4850,10 @@ static const void *lt_preloaded_setup() { func_show_eval '(cd $output_objdir && $LTCC$symtab_cflags -c$no_builtin_flag$pic_flag_for_symtable "$my_dlsyms")' 'exit $?' # Clean up the generated files. - func_show_eval '$RM "$output_objdir/$my_dlsyms" "$nlist" "${nlist}S" "${nlist}T"' + func_show_eval '$RM "$output_objdir/$my_dlsyms" "$nlist" "${nlist}S" "${nlist}T" "${nlist}I"' # Transform the symbol file into the correct name. - symfileobj="$output_objdir/${my_outputname}S.$objext" + symfileobj=$output_objdir/${my_outputname}S.$objext case $host in *cygwin* | *mingw* | *cegcc* ) if test -f "$output_objdir/$my_outputname.def"; then @@ -3518,7 +4871,7 @@ static const void *lt_preloaded_setup() { esac ;; *) - func_fatal_error "unknown suffix for \`$my_dlsyms'" + func_fatal_error "unknown suffix for '$my_dlsyms'" ;; esac else @@ -3532,6 +4885,32 @@ static const void *lt_preloaded_setup() { fi } +# func_cygming_gnu_implib_p ARG +# This predicate returns with zero status (TRUE) if +# ARG is a GNU/binutils-style import library. Returns +# with nonzero status (FALSE) otherwise. +func_cygming_gnu_implib_p () +{ + $debug_cmd + + func_to_tool_file "$1" func_convert_file_msys_to_w32 + func_cygming_gnu_implib_tmp=`$NM "$func_to_tool_file_result" | eval "$global_symbol_pipe" | $EGREP ' (_head_[A-Za-z0-9_]+_[ad]l*|[A-Za-z0-9_]+_[ad]l*_iname)$'` + test -n "$func_cygming_gnu_implib_tmp" +} + +# func_cygming_ms_implib_p ARG +# This predicate returns with zero status (TRUE) if +# ARG is an MS-style import library. Returns +# with nonzero status (FALSE) otherwise. +func_cygming_ms_implib_p () +{ + $debug_cmd + + func_to_tool_file "$1" func_convert_file_msys_to_w32 + func_cygming_ms_implib_tmp=`$NM "$func_to_tool_file_result" | eval "$global_symbol_pipe" | $GREP '_NULL_IMPORT_DESCRIPTOR'` + test -n "$func_cygming_ms_implib_tmp" +} + # func_win32_libid arg # return the library type of file 'arg' # @@ -3541,8 +4920,9 @@ static const void *lt_preloaded_setup() { # Despite the name, also deal with 64 bit binaries. func_win32_libid () { - $opt_debug - win32_libid_type="unknown" + $debug_cmd + + win32_libid_type=unknown win32_fileres=`file -L $1 2>/dev/null` case $win32_fileres in *ar\ archive\ import\ library*) # definitely import @@ -3552,16 +4932,29 @@ func_win32_libid () # Keep the egrep pattern in sync with the one in _LT_CHECK_MAGIC_METHOD. if eval $OBJDUMP -f $1 | $SED -e '10q' 2>/dev/null | $EGREP 'file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64)' >/dev/null; then - func_to_tool_file "$1" func_convert_file_msys_to_w32 - win32_nmres=`eval $NM -f posix -A \"$func_to_tool_file_result\" | - $SED -n -e ' + case $nm_interface in + "MS dumpbin") + if func_cygming_ms_implib_p "$1" || + func_cygming_gnu_implib_p "$1" + then + win32_nmres=import + else + win32_nmres= + fi + ;; + *) + func_to_tool_file "$1" func_convert_file_msys_to_w32 + win32_nmres=`eval $NM -f posix -A \"$func_to_tool_file_result\" | + $SED -n -e ' 1,100{ / I /{ - s,.*,import, + s|.*|import| p q } }'` + ;; + esac case $win32_nmres in import*) win32_libid_type="x86 archive import";; *) win32_libid_type="x86 archive static";; @@ -3593,7 +4986,8 @@ func_win32_libid () # $sharedlib_from_linklib_result func_cygming_dll_for_implib () { - $opt_debug + $debug_cmd + sharedlib_from_linklib_result=`$DLLTOOL --identify-strict --identify "$1"` } @@ -3610,7 +5004,8 @@ func_cygming_dll_for_implib () # specified import library. func_cygming_dll_for_implib_fallback_core () { - $opt_debug + $debug_cmd + match_literal=`$ECHO "$1" | $SED "$sed_make_literal_regex"` $OBJDUMP -s --section "$1" "$2" 2>/dev/null | $SED '/^Contents of section '"$match_literal"':/{ @@ -3646,8 +5041,8 @@ func_cygming_dll_for_implib_fallback_core () /./p' | # we now have a list, one entry per line, of the stringified # contents of the appropriate section of all members of the - # archive which possess that section. Heuristic: eliminate - # all those which have a first or second character that is + # archive that possess that section. Heuristic: eliminate + # all those that have a first or second character that is # a '.' (that is, objdump's representation of an unprintable # character.) This should work for all archives with less than # 0x302f exports -- but will fail for DLLs whose name actually @@ -3658,30 +5053,6 @@ func_cygming_dll_for_implib_fallback_core () $SED -e '/^\./d;/^.\./d;q' } -# func_cygming_gnu_implib_p ARG -# This predicate returns with zero status (TRUE) if -# ARG is a GNU/binutils-style import library. Returns -# with nonzero status (FALSE) otherwise. -func_cygming_gnu_implib_p () -{ - $opt_debug - func_to_tool_file "$1" func_convert_file_msys_to_w32 - func_cygming_gnu_implib_tmp=`$NM "$func_to_tool_file_result" | eval "$global_symbol_pipe" | $EGREP ' (_head_[A-Za-z0-9_]+_[ad]l*|[A-Za-z0-9_]+_[ad]l*_iname)$'` - test -n "$func_cygming_gnu_implib_tmp" -} - -# func_cygming_ms_implib_p ARG -# This predicate returns with zero status (TRUE) if -# ARG is an MS-style import library. Returns -# with nonzero status (FALSE) otherwise. -func_cygming_ms_implib_p () -{ - $opt_debug - func_to_tool_file "$1" func_convert_file_msys_to_w32 - func_cygming_ms_implib_tmp=`$NM "$func_to_tool_file_result" | eval "$global_symbol_pipe" | $GREP '_NULL_IMPORT_DESCRIPTOR'` - test -n "$func_cygming_ms_implib_tmp" -} - # func_cygming_dll_for_implib_fallback ARG # Platform-specific function to extract the # name of the DLL associated with the specified @@ -3695,16 +5066,17 @@ func_cygming_ms_implib_p () # $sharedlib_from_linklib_result func_cygming_dll_for_implib_fallback () { - $opt_debug - if func_cygming_gnu_implib_p "$1" ; then + $debug_cmd + + if func_cygming_gnu_implib_p "$1"; then # binutils import library sharedlib_from_linklib_result=`func_cygming_dll_for_implib_fallback_core '.idata$7' "$1"` - elif func_cygming_ms_implib_p "$1" ; then + elif func_cygming_ms_implib_p "$1"; then # ms-generated import library sharedlib_from_linklib_result=`func_cygming_dll_for_implib_fallback_core '.idata$6' "$1"` else # unknown - sharedlib_from_linklib_result="" + sharedlib_from_linklib_result= fi } @@ -3712,10 +5084,11 @@ func_cygming_dll_for_implib_fallback () # func_extract_an_archive dir oldlib func_extract_an_archive () { - $opt_debug - f_ex_an_ar_dir="$1"; shift - f_ex_an_ar_oldlib="$1" - if test "$lock_old_archive_extraction" = yes; then + $debug_cmd + + f_ex_an_ar_dir=$1; shift + f_ex_an_ar_oldlib=$1 + if test yes = "$lock_old_archive_extraction"; then lockfile=$f_ex_an_ar_oldlib.lock until $opt_dry_run || ln "$progpath" "$lockfile" 2>/dev/null; do func_echo "Waiting for $lockfile to be removed" @@ -3724,7 +5097,7 @@ func_extract_an_archive () fi func_show_eval "(cd \$f_ex_an_ar_dir && $AR x \"\$f_ex_an_ar_oldlib\")" \ 'stat=$?; rm -f "$lockfile"; exit $stat' - if test "$lock_old_archive_extraction" = yes; then + if test yes = "$lock_old_archive_extraction"; then $opt_dry_run || rm -f "$lockfile" fi if ($AR t "$f_ex_an_ar_oldlib" | sort | sort -uc >/dev/null 2>&1); then @@ -3738,22 +5111,23 @@ func_extract_an_archive () # func_extract_archives gentop oldlib ... func_extract_archives () { - $opt_debug - my_gentop="$1"; shift + $debug_cmd + + my_gentop=$1; shift my_oldlibs=${1+"$@"} - my_oldobjs="" - my_xlib="" - my_xabs="" - my_xdir="" + my_oldobjs= + my_xlib= + my_xabs= + my_xdir= for my_xlib in $my_oldlibs; do # Extract the objects. case $my_xlib in - [\\/]* | [A-Za-z]:[\\/]*) my_xabs="$my_xlib" ;; + [\\/]* | [A-Za-z]:[\\/]*) my_xabs=$my_xlib ;; *) my_xabs=`pwd`"/$my_xlib" ;; esac func_basename "$my_xlib" - my_xlib="$func_basename_result" + my_xlib=$func_basename_result my_xlib_u=$my_xlib while :; do case " $extracted_archives " in @@ -3765,7 +5139,7 @@ func_extract_archives () esac done extracted_archives="$extracted_archives $my_xlib_u" - my_xdir="$my_gentop/$my_xlib_u" + my_xdir=$my_gentop/$my_xlib_u func_mkdir_p "$my_xdir" @@ -3778,22 +5152,23 @@ func_extract_archives () cd $my_xdir || exit $? darwin_archive=$my_xabs darwin_curdir=`pwd` - darwin_base_archive=`basename "$darwin_archive"` + func_basename "$darwin_archive" + darwin_base_archive=$func_basename_result darwin_arches=`$LIPO -info "$darwin_archive" 2>/dev/null | $GREP Architectures 2>/dev/null || true` if test -n "$darwin_arches"; then darwin_arches=`$ECHO "$darwin_arches" | $SED -e 's/.*are://'` darwin_arch= func_verbose "$darwin_base_archive has multiple architectures $darwin_arches" - for darwin_arch in $darwin_arches ; do - func_mkdir_p "unfat-$$/${darwin_base_archive}-${darwin_arch}" - $LIPO -thin $darwin_arch -output "unfat-$$/${darwin_base_archive}-${darwin_arch}/${darwin_base_archive}" "${darwin_archive}" - cd "unfat-$$/${darwin_base_archive}-${darwin_arch}" - func_extract_an_archive "`pwd`" "${darwin_base_archive}" + for darwin_arch in $darwin_arches; do + func_mkdir_p "unfat-$$/$darwin_base_archive-$darwin_arch" + $LIPO -thin $darwin_arch -output "unfat-$$/$darwin_base_archive-$darwin_arch/$darwin_base_archive" "$darwin_archive" + cd "unfat-$$/$darwin_base_archive-$darwin_arch" + func_extract_an_archive "`pwd`" "$darwin_base_archive" cd "$darwin_curdir" - $RM "unfat-$$/${darwin_base_archive}-${darwin_arch}/${darwin_base_archive}" + $RM "unfat-$$/$darwin_base_archive-$darwin_arch/$darwin_base_archive" done # $darwin_arches ## Okay now we've a bunch of thin objects, gotta fatten them up :) - darwin_filelist=`find unfat-$$ -type f -name \*.o -print -o -name \*.lo -print | $SED -e "$basename" | sort -u` + darwin_filelist=`find unfat-$$ -type f -name \*.o -print -o -name \*.lo -print | $SED -e "$sed_basename" | sort -u` darwin_file= darwin_files= for darwin_file in $darwin_filelist; do @@ -3815,7 +5190,7 @@ func_extract_archives () my_oldobjs="$my_oldobjs "`find $my_xdir -name \*.$objext -print -o -name \*.lo -print | sort | $NL2SP` done - func_extract_archives_result="$my_oldobjs" + func_extract_archives_result=$my_oldobjs } @@ -3830,7 +5205,7 @@ func_extract_archives () # # ARG is the value that the WRAPPER_SCRIPT_BELONGS_IN_OBJDIR # variable will take. If 'yes', then the emitted script -# will assume that the directory in which it is stored is +# will assume that the directory where it is stored is # the $objdir directory. This is a cygwin/mingw-specific # behavior. func_emit_wrapper () @@ -3841,7 +5216,7 @@ func_emit_wrapper () #! $SHELL # $output - temporary wrapper script for $objdir/$outputname -# Generated by $PROGRAM (GNU $PACKAGE$TIMESTAMP) $VERSION +# Generated by $PROGRAM (GNU $PACKAGE) $VERSION # # The $output program cannot be directly executed until all the libtool # libraries that it depends on are installed. @@ -3898,9 +5273,9 @@ _LTECHO_EOF' # Very basic option parsing. These options are (a) specific to # the libtool wrapper, (b) are identical between the wrapper -# /script/ and the wrapper /executable/ which is used only on +# /script/ and the wrapper /executable/ that is used only on # windows platforms, and (c) all begin with the string "--lt-" -# (application programs are unlikely to have options which match +# (application programs are unlikely to have options that match # this pattern). # # There are only two supported options: --lt-debug and @@ -3933,7 +5308,7 @@ func_parse_lt_options () # Print the debug banner immediately: if test -n \"\$lt_option_debug\"; then - echo \"${outputname}:${output}:\${LINENO}: libtool wrapper (GNU $PACKAGE$TIMESTAMP) $VERSION\" 1>&2 + echo \"$outputname:$output:\$LINENO: libtool wrapper (GNU $PACKAGE) $VERSION\" 1>&2 fi } @@ -3944,7 +5319,7 @@ func_lt_dump_args () lt_dump_args_N=1; for lt_arg do - \$ECHO \"${outputname}:${output}:\${LINENO}: newargv[\$lt_dump_args_N]: \$lt_arg\" + \$ECHO \"$outputname:$output:\$LINENO: newargv[\$lt_dump_args_N]: \$lt_arg\" lt_dump_args_N=\`expr \$lt_dump_args_N + 1\` done } @@ -3958,7 +5333,7 @@ func_exec_program_core () *-*-mingw | *-*-os2* | *-cegcc*) $ECHO "\ if test -n \"\$lt_option_debug\"; then - \$ECHO \"${outputname}:${output}:\${LINENO}: newargv[0]: \$progdir\\\\\$program\" 1>&2 + \$ECHO \"$outputname:$output:\$LINENO: newargv[0]: \$progdir\\\\\$program\" 1>&2 func_lt_dump_args \${1+\"\$@\"} 1>&2 fi exec \"\$progdir\\\\\$program\" \${1+\"\$@\"} @@ -3968,7 +5343,7 @@ func_exec_program_core () *) $ECHO "\ if test -n \"\$lt_option_debug\"; then - \$ECHO \"${outputname}:${output}:\${LINENO}: newargv[0]: \$progdir/\$program\" 1>&2 + \$ECHO \"$outputname:$output:\$LINENO: newargv[0]: \$progdir/\$program\" 1>&2 func_lt_dump_args \${1+\"\$@\"} 1>&2 fi exec \"\$progdir/\$program\" \${1+\"\$@\"} @@ -4043,13 +5418,13 @@ func_exec_program () test -n \"\$absdir\" && thisdir=\"\$absdir\" " - if test "$fast_install" = yes; then + if test yes = "$fast_install"; then $ECHO "\ program=lt-'$outputname'$exeext progdir=\"\$thisdir/$objdir\" if test ! -f \"\$progdir/\$program\" || - { file=\`ls -1dt \"\$progdir/\$program\" \"\$progdir/../\$program\" 2>/dev/null | ${SED} 1q\`; \\ + { file=\`ls -1dt \"\$progdir/\$program\" \"\$progdir/../\$program\" 2>/dev/null | $SED 1q\`; \\ test \"X\$file\" != \"X\$progdir/\$program\"; }; then file=\"\$\$-\$program\" @@ -4066,7 +5441,7 @@ func_exec_program () if test -n \"\$relink_command\"; then if relink_command_output=\`eval \$relink_command 2>&1\`; then : else - $ECHO \"\$relink_command_output\" >&2 + \$ECHO \"\$relink_command_output\" >&2 $RM \"\$progdir/\$file\" exit 1 fi @@ -4101,7 +5476,7 @@ func_exec_program () fi # Export our shlibpath_var if we have one. - if test "$shlibpath_overrides_runpath" = yes && test -n "$shlibpath_var" && test -n "$temp_rpath"; then + if test yes = "$shlibpath_overrides_runpath" && test -n "$shlibpath_var" && test -n "$temp_rpath"; then $ECHO "\ # Add our own library path to $shlibpath_var $shlibpath_var=\"$temp_rpath\$$shlibpath_var\" @@ -4121,7 +5496,7 @@ func_exec_program () fi else # The program doesn't exist. - \$ECHO \"\$0: error: \\\`\$progdir/\$program' does not exist\" 1>&2 + \$ECHO \"\$0: error: '\$progdir/\$program' does not exist\" 1>&2 \$ECHO \"This script is just a wrapper for \$program.\" 1>&2 \$ECHO \"See the $PACKAGE documentation for more information.\" 1>&2 exit 1 @@ -4140,7 +5515,7 @@ func_emit_cwrapperexe_src () cat < #include +#define STREQ(s1, s2) (strcmp ((s1), (s2)) == 0) + /* declarations of non-ANSI functions */ -#if defined(__MINGW32__) +#if defined __MINGW32__ # ifdef __STRICT_ANSI__ int _putenv (const char *); # endif -#elif defined(__CYGWIN__) +#elif defined __CYGWIN__ # ifdef __STRICT_ANSI__ char *realpath (const char *, char *); int putenv (char *); int setenv (const char *, const char *, int); # endif -/* #elif defined (other platforms) ... */ +/* #elif defined other_platform || defined ... */ #endif /* portability defines, excluding path handling macros */ -#if defined(_MSC_VER) +#if defined _MSC_VER # define setmode _setmode # define stat _stat # define chmod _chmod # define getcwd _getcwd # define putenv _putenv # define S_IXUSR _S_IEXEC -# ifndef _INTPTR_T_DEFINED -# define _INTPTR_T_DEFINED -# define intptr_t int -# endif -#elif defined(__MINGW32__) +#elif defined __MINGW32__ # define setmode _setmode # define stat _stat # define chmod _chmod # define getcwd _getcwd # define putenv _putenv -#elif defined(__CYGWIN__) +#elif defined __CYGWIN__ # define HAVE_SETENV # define FOPEN_WB "wb" -/* #elif defined (other platforms) ... */ +/* #elif defined other platforms ... */ #endif -#if defined(PATH_MAX) +#if defined PATH_MAX # define LT_PATHMAX PATH_MAX -#elif defined(MAXPATHLEN) +#elif defined MAXPATHLEN # define LT_PATHMAX MAXPATHLEN #else # define LT_PATHMAX 1024 @@ -4234,8 +5607,8 @@ int setenv (const char *, const char *, int); # define PATH_SEPARATOR ':' #endif -#if defined (_WIN32) || defined (__MSDOS__) || defined (__DJGPP__) || \ - defined (__OS2__) +#if defined _WIN32 || defined __MSDOS__ || defined __DJGPP__ || \ + defined __OS2__ # define HAVE_DOS_BASED_FILE_SYSTEM # define FOPEN_WB "wb" # ifndef DIR_SEPARATOR_2 @@ -4268,10 +5641,10 @@ int setenv (const char *, const char *, int); #define XMALLOC(type, num) ((type *) xmalloc ((num) * sizeof(type))) #define XFREE(stale) do { \ - if (stale) { free ((void *) stale); stale = 0; } \ + if (stale) { free (stale); stale = 0; } \ } while (0) -#if defined(LT_DEBUGWRAPPER) +#if defined LT_DEBUGWRAPPER static int lt_debug = 1; #else static int lt_debug = 0; @@ -4300,11 +5673,16 @@ void lt_dump_script (FILE *f); EOF cat < 0) && IS_PATH_SEPARATOR (new_value[len-1])) + size_t len = strlen (new_value); + while ((len > 0) && IS_PATH_SEPARATOR (new_value[len-1])) { - new_value[len-1] = '\0'; + new_value[--len] = '\0'; } lt_setenv (name, new_value); XFREE (new_value); @@ -5082,27 +6460,47 @@ EOF # True if ARG is an import lib, as indicated by $file_magic_cmd func_win32_import_lib_p () { - $opt_debug + $debug_cmd + case `eval $file_magic_cmd \"\$1\" 2>/dev/null | $SED -e 10q` in *import*) : ;; *) false ;; esac } +# func_suncc_cstd_abi +# !!ONLY CALL THIS FOR SUN CC AFTER $compile_command IS FULLY EXPANDED!! +# Several compiler flags select an ABI that is incompatible with the +# Cstd library. Avoid specifying it if any are in CXXFLAGS. +func_suncc_cstd_abi () +{ + $debug_cmd + + case " $compile_command " in + *" -compat=g "*|*\ -std=c++[0-9][0-9]\ *|*" -library=stdcxx4 "*|*" -library=stlport4 "*) + suncc_use_cstd_abi=no + ;; + *) + suncc_use_cstd_abi=yes + ;; + esac +} + # func_mode_link arg... func_mode_link () { - $opt_debug + $debug_cmd + case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*) # It is impossible to link a dll without this setting, and # we shouldn't force the makefile maintainer to figure out - # which system we are compiling for in order to pass an extra + # what system we are compiling for in order to pass an extra # flag for every libtool invocation. # allow_undefined=no # FIXME: Unfortunately, there are problems with the above when trying - # to make a dll which has undefined symbols, in which case not + # to make a dll that has undefined symbols, in which case not # even a static library is built. For now, we need to specify # -no-undefined on the libtool link line when we can be certain # that all symbols are satisfied, otherwise we get a static library. @@ -5146,10 +6544,11 @@ func_mode_link () module=no no_install=no objs= + os2dllname= non_pic_objects= precious_files_regex= prefer_static_libs=no - preload=no + preload=false prev= prevarg= release= @@ -5161,7 +6560,7 @@ func_mode_link () vinfo= vinfo_number=no weak_libs= - single_module="${wl}-single_module" + single_module=$wl-single_module func_infer_tag $base_compile # We need to know -static, to get the right output filenames. @@ -5169,15 +6568,15 @@ func_mode_link () do case $arg in -shared) - test "$build_libtool_libs" != yes && \ - func_fatal_configuration "can not build a shared library" + test yes != "$build_libtool_libs" \ + && func_fatal_configuration "cannot build a shared library" build_old_libs=no break ;; -all-static | -static | -static-libtool-libs) case $arg in -all-static) - if test "$build_libtool_libs" = yes && test -z "$link_static_flag"; then + if test yes = "$build_libtool_libs" && test -z "$link_static_flag"; then func_warning "complete static linking is impossible in this configuration" fi if test -n "$link_static_flag"; then @@ -5210,7 +6609,7 @@ func_mode_link () # Go through the arguments, transforming them on the way. while test "$#" -gt 0; do - arg="$1" + arg=$1 shift func_quote_for_eval "$arg" qarg=$func_quote_for_eval_unquoted_result @@ -5227,21 +6626,21 @@ func_mode_link () case $prev in bindir) - bindir="$arg" + bindir=$arg prev= continue ;; dlfiles|dlprefiles) - if test "$preload" = no; then + $preload || { # Add the symbol object into the linking commands. func_append compile_command " @SYMFILE@" func_append finalize_command " @SYMFILE@" - preload=yes - fi + preload=: + } case $arg in *.la | *.lo) ;; # We handle these cases below. force) - if test "$dlself" = no; then + if test no = "$dlself"; then dlself=needless export_dynamic=yes fi @@ -5249,9 +6648,9 @@ func_mode_link () continue ;; self) - if test "$prev" = dlprefiles; then + if test dlprefiles = "$prev"; then dlself=yes - elif test "$prev" = dlfiles && test "$dlopen_self" != yes; then + elif test dlfiles = "$prev" && test yes != "$dlopen_self"; then dlself=yes else dlself=needless @@ -5261,7 +6660,7 @@ func_mode_link () continue ;; *) - if test "$prev" = dlfiles; then + if test dlfiles = "$prev"; then func_append dlfiles " $arg" else func_append dlprefiles " $arg" @@ -5272,14 +6671,14 @@ func_mode_link () esac ;; expsyms) - export_symbols="$arg" + export_symbols=$arg test -f "$arg" \ - || func_fatal_error "symbol file \`$arg' does not exist" + || func_fatal_error "symbol file '$arg' does not exist" prev= continue ;; expsyms_regex) - export_symbols_regex="$arg" + export_symbols_regex=$arg prev= continue ;; @@ -5297,7 +6696,13 @@ func_mode_link () continue ;; inst_prefix) - inst_prefix_dir="$arg" + inst_prefix_dir=$arg + prev= + continue + ;; + mllvm) + # Clang does not use LLVM to link, so we can simply discard any + # '-mllvm $arg' options when doing the link step. prev= continue ;; @@ -5321,21 +6726,21 @@ func_mode_link () if test -z "$pic_object" || test -z "$non_pic_object" || - test "$pic_object" = none && - test "$non_pic_object" = none; then - func_fatal_error "cannot find name of object for \`$arg'" + test none = "$pic_object" && + test none = "$non_pic_object"; then + func_fatal_error "cannot find name of object for '$arg'" fi # Extract subdirectory from the argument. func_dirname "$arg" "/" "" - xdir="$func_dirname_result" + xdir=$func_dirname_result - if test "$pic_object" != none; then + if test none != "$pic_object"; then # Prepend the subdirectory the object is found in. - pic_object="$xdir$pic_object" + pic_object=$xdir$pic_object - if test "$prev" = dlfiles; then - if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then + if test dlfiles = "$prev"; then + if test yes = "$build_libtool_libs" && test yes = "$dlopen_support"; then func_append dlfiles " $pic_object" prev= continue @@ -5346,7 +6751,7 @@ func_mode_link () fi # CHECK ME: I think I busted this. -Ossama - if test "$prev" = dlprefiles; then + if test dlprefiles = "$prev"; then # Preload the old-style object. func_append dlprefiles " $pic_object" prev= @@ -5354,23 +6759,23 @@ func_mode_link () # A PIC object. func_append libobjs " $pic_object" - arg="$pic_object" + arg=$pic_object fi # Non-PIC object. - if test "$non_pic_object" != none; then + if test none != "$non_pic_object"; then # Prepend the subdirectory the object is found in. - non_pic_object="$xdir$non_pic_object" + non_pic_object=$xdir$non_pic_object # A standard non-PIC object func_append non_pic_objects " $non_pic_object" - if test -z "$pic_object" || test "$pic_object" = none ; then - arg="$non_pic_object" + if test -z "$pic_object" || test none = "$pic_object"; then + arg=$non_pic_object fi else # If the PIC object exists, use it instead. # $xdir was prepended to $pic_object above. - non_pic_object="$pic_object" + non_pic_object=$pic_object func_append non_pic_objects " $non_pic_object" fi else @@ -5378,7 +6783,7 @@ func_mode_link () if $opt_dry_run; then # Extract subdirectory from the argument. func_dirname "$arg" "/" "" - xdir="$func_dirname_result" + xdir=$func_dirname_result func_lo2o "$arg" pic_object=$xdir$objdir/$func_lo2o_result @@ -5386,24 +6791,29 @@ func_mode_link () func_append libobjs " $pic_object" func_append non_pic_objects " $non_pic_object" else - func_fatal_error "\`$arg' is not a valid libtool object" + func_fatal_error "'$arg' is not a valid libtool object" fi fi done else - func_fatal_error "link input file \`$arg' does not exist" + func_fatal_error "link input file '$arg' does not exist" fi arg=$save_arg prev= continue ;; + os2dllname) + os2dllname=$arg + prev= + continue + ;; precious_regex) - precious_files_regex="$arg" + precious_files_regex=$arg prev= continue ;; release) - release="-$arg" + release=-$arg prev= continue ;; @@ -5415,7 +6825,7 @@ func_mode_link () func_fatal_error "only absolute run-paths are allowed" ;; esac - if test "$prev" = rpath; then + if test rpath = "$prev"; then case "$rpath " in *" $arg "*) ;; *) func_append rpath " $arg" ;; @@ -5430,7 +6840,7 @@ func_mode_link () continue ;; shrext) - shrext_cmds="$arg" + shrext_cmds=$arg prev= continue ;; @@ -5470,7 +6880,7 @@ func_mode_link () esac fi # test -n "$prev" - prevarg="$arg" + prevarg=$arg case $arg in -all-static) @@ -5484,7 +6894,7 @@ func_mode_link () -allow-undefined) # FIXME: remove this flag sometime in the future. - func_fatal_error "\`-allow-undefined' must not be used because it is the default" + func_fatal_error "'-allow-undefined' must not be used because it is the default" ;; -avoid-version) @@ -5516,7 +6926,7 @@ func_mode_link () if test -n "$export_symbols" || test -n "$export_symbols_regex"; then func_fatal_error "more than one -exported-symbols argument is not allowed" fi - if test "X$arg" = "X-export-symbols"; then + if test X-export-symbols = "X$arg"; then prev=expsyms else prev=expsyms_regex @@ -5550,9 +6960,9 @@ func_mode_link () func_stripname "-L" '' "$arg" if test -z "$func_stripname_result"; then if test "$#" -gt 0; then - func_fatal_error "require no space between \`-L' and \`$1'" + func_fatal_error "require no space between '-L' and '$1'" else - func_fatal_error "need path for \`-L' option" + func_fatal_error "need path for '-L' option" fi fi func_resolve_sysroot "$func_stripname_result" @@ -5563,8 +6973,8 @@ func_mode_link () *) absdir=`cd "$dir" && pwd` test -z "$absdir" && \ - func_fatal_error "cannot determine absolute directory name of \`$dir'" - dir="$absdir" + func_fatal_error "cannot determine absolute directory name of '$dir'" + dir=$absdir ;; esac case "$deplibs " in @@ -5599,7 +7009,7 @@ func_mode_link () ;; -l*) - if test "X$arg" = "X-lc" || test "X$arg" = "X-lm"; then + if test X-lc = "X$arg" || test X-lm = "X$arg"; then case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-beos* | *-cegcc* | *-*-haiku*) # These systems don't actually have a C or math library (as such) @@ -5607,11 +7017,11 @@ func_mode_link () ;; *-*-os2*) # These systems don't actually have a C library (as such) - test "X$arg" = "X-lc" && continue + test X-lc = "X$arg" && continue ;; - *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*) + *-*-openbsd* | *-*-freebsd* | *-*-dragonfly* | *-*-bitrig*) # Do not include libc due to us having libc/libc_r. - test "X$arg" = "X-lc" && continue + test X-lc = "X$arg" && continue ;; *-*-rhapsody* | *-*-darwin1.[012]) # Rhapsody C and math libraries are in the System framework @@ -5620,16 +7030,16 @@ func_mode_link () ;; *-*-sco3.2v5* | *-*-sco5v6*) # Causes problems with __ctype - test "X$arg" = "X-lc" && continue + test X-lc = "X$arg" && continue ;; *-*-sysv4.2uw2* | *-*-sysv5* | *-*-unixware* | *-*-OpenUNIX*) # Compiler inserts libc in the correct place for threads to work - test "X$arg" = "X-lc" && continue + test X-lc = "X$arg" && continue ;; esac - elif test "X$arg" = "X-lc_r"; then + elif test X-lc_r = "X$arg"; then case $host in - *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*) + *-*-openbsd* | *-*-freebsd* | *-*-dragonfly* | *-*-bitrig*) # Do not include libc_r directly, use -pthread flag. continue ;; @@ -5639,6 +7049,11 @@ func_mode_link () continue ;; + -mllvm) + prev=mllvm + continue + ;; + -module) module=yes continue @@ -5668,7 +7083,7 @@ func_mode_link () ;; -multi_module) - single_module="${wl}-multi_module" + single_module=$wl-multi_module continue ;; @@ -5682,8 +7097,8 @@ func_mode_link () *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-darwin* | *-cegcc*) # The PATH hackery in wrapper scripts is required on Windows # and Darwin in order for the loader to find any dlls it needs. - func_warning "\`-no-install' is ignored for $host" - func_warning "assuming \`-no-fast-install' instead" + func_warning "'-no-install' is ignored for $host" + func_warning "assuming '-no-fast-install' instead" fast_install=no ;; *) no_install=yes ;; @@ -5701,6 +7116,11 @@ func_mode_link () continue ;; + -os2dllname) + prev=os2dllname + continue + ;; + -o) prev=output ;; -precious-files-regex) @@ -5788,14 +7208,14 @@ func_mode_link () func_stripname '-Wc,' '' "$arg" args=$func_stripname_result arg= - save_ifs="$IFS"; IFS=',' + save_ifs=$IFS; IFS=, for flag in $args; do - IFS="$save_ifs" + IFS=$save_ifs func_quote_for_eval "$flag" func_append arg " $func_quote_for_eval_result" func_append compiler_flags " $func_quote_for_eval_result" done - IFS="$save_ifs" + IFS=$save_ifs func_stripname ' ' '' "$arg" arg=$func_stripname_result ;; @@ -5804,15 +7224,15 @@ func_mode_link () func_stripname '-Wl,' '' "$arg" args=$func_stripname_result arg= - save_ifs="$IFS"; IFS=',' + save_ifs=$IFS; IFS=, for flag in $args; do - IFS="$save_ifs" + IFS=$save_ifs func_quote_for_eval "$flag" func_append arg " $wl$func_quote_for_eval_result" func_append compiler_flags " $wl$func_quote_for_eval_result" func_append linker_flags " $func_quote_for_eval_result" done - IFS="$save_ifs" + IFS=$save_ifs func_stripname ' ' '' "$arg" arg=$func_stripname_result ;; @@ -5835,7 +7255,7 @@ func_mode_link () # -msg_* for osf cc -msg_*) func_quote_for_eval "$arg" - arg="$func_quote_for_eval_result" + arg=$func_quote_for_eval_result ;; # Flags to be passed through unchanged, with rationale: @@ -5847,25 +7267,46 @@ func_mode_link () # -m*, -t[45]*, -txscale* architecture-specific flags for GCC # -F/path path to uninstalled frameworks, gcc on darwin # -p, -pg, --coverage, -fprofile-* profiling flags for GCC + # -fstack-protector* stack protector flags for GCC # @file GCC response files # -tp=* Portland pgcc target processor selection # --sysroot=* for sysroot support - # -O*, -flto*, -fwhopr*, -fuse-linker-plugin GCC link-time optimization + # -O*, -g*, -flto*, -fwhopr*, -fuse-linker-plugin GCC link-time optimization + # -stdlib=* select c++ std lib with clang -64|-mips[0-9]|-r[0-9][0-9]*|-xarch=*|-xtarget=*|+DA*|+DD*|-q*|-m*| \ -t[45]*|-txscale*|-p|-pg|--coverage|-fprofile-*|-F*|@*|-tp=*|--sysroot=*| \ - -O*|-flto*|-fwhopr*|-fuse-linker-plugin) + -O*|-g*|-flto*|-fwhopr*|-fuse-linker-plugin|-fstack-protector*|-stdlib=*) func_quote_for_eval "$arg" - arg="$func_quote_for_eval_result" + arg=$func_quote_for_eval_result func_append compile_command " $arg" func_append finalize_command " $arg" func_append compiler_flags " $arg" continue ;; + -Z*) + if test os2 = "`expr $host : '.*\(os2\)'`"; then + # OS/2 uses -Zxxx to specify OS/2-specific options + compiler_flags="$compiler_flags $arg" + func_append compile_command " $arg" + func_append finalize_command " $arg" + case $arg in + -Zlinker | -Zstack) + prev=xcompiler + ;; + esac + continue + else + # Otherwise treat like 'Some other compiler flag' below + func_quote_for_eval "$arg" + arg=$func_quote_for_eval_result + fi + ;; + # Some other compiler flag. -* | +*) func_quote_for_eval "$arg" - arg="$func_quote_for_eval_result" + arg=$func_quote_for_eval_result ;; *.$objext) @@ -5886,21 +7327,21 @@ func_mode_link () if test -z "$pic_object" || test -z "$non_pic_object" || - test "$pic_object" = none && - test "$non_pic_object" = none; then - func_fatal_error "cannot find name of object for \`$arg'" + test none = "$pic_object" && + test none = "$non_pic_object"; then + func_fatal_error "cannot find name of object for '$arg'" fi # Extract subdirectory from the argument. func_dirname "$arg" "/" "" - xdir="$func_dirname_result" + xdir=$func_dirname_result - if test "$pic_object" != none; then + test none = "$pic_object" || { # Prepend the subdirectory the object is found in. - pic_object="$xdir$pic_object" + pic_object=$xdir$pic_object - if test "$prev" = dlfiles; then - if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then + if test dlfiles = "$prev"; then + if test yes = "$build_libtool_libs" && test yes = "$dlopen_support"; then func_append dlfiles " $pic_object" prev= continue @@ -5911,7 +7352,7 @@ func_mode_link () fi # CHECK ME: I think I busted this. -Ossama - if test "$prev" = dlprefiles; then + if test dlprefiles = "$prev"; then # Preload the old-style object. func_append dlprefiles " $pic_object" prev= @@ -5919,23 +7360,23 @@ func_mode_link () # A PIC object. func_append libobjs " $pic_object" - arg="$pic_object" - fi + arg=$pic_object + } # Non-PIC object. - if test "$non_pic_object" != none; then + if test none != "$non_pic_object"; then # Prepend the subdirectory the object is found in. - non_pic_object="$xdir$non_pic_object" + non_pic_object=$xdir$non_pic_object # A standard non-PIC object func_append non_pic_objects " $non_pic_object" - if test -z "$pic_object" || test "$pic_object" = none ; then - arg="$non_pic_object" + if test -z "$pic_object" || test none = "$pic_object"; then + arg=$non_pic_object fi else # If the PIC object exists, use it instead. # $xdir was prepended to $pic_object above. - non_pic_object="$pic_object" + non_pic_object=$pic_object func_append non_pic_objects " $non_pic_object" fi else @@ -5943,7 +7384,7 @@ func_mode_link () if $opt_dry_run; then # Extract subdirectory from the argument. func_dirname "$arg" "/" "" - xdir="$func_dirname_result" + xdir=$func_dirname_result func_lo2o "$arg" pic_object=$xdir$objdir/$func_lo2o_result @@ -5951,7 +7392,7 @@ func_mode_link () func_append libobjs " $pic_object" func_append non_pic_objects " $non_pic_object" else - func_fatal_error "\`$arg' is not a valid libtool object" + func_fatal_error "'$arg' is not a valid libtool object" fi fi ;; @@ -5967,11 +7408,11 @@ func_mode_link () # A libtool-controlled library. func_resolve_sysroot "$arg" - if test "$prev" = dlfiles; then + if test dlfiles = "$prev"; then # This library was specified with -dlopen. func_append dlfiles " $func_resolve_sysroot_result" prev= - elif test "$prev" = dlprefiles; then + elif test dlprefiles = "$prev"; then # The library was specified with -dlpreopen. func_append dlprefiles " $func_resolve_sysroot_result" prev= @@ -5986,7 +7427,7 @@ func_mode_link () # Unknown arguments in both finalize_command and compile_command need # to be aesthetically quoted because they are evaled later. func_quote_for_eval "$arg" - arg="$func_quote_for_eval_result" + arg=$func_quote_for_eval_result ;; esac # arg @@ -5998,9 +7439,9 @@ func_mode_link () done # argument parsing loop test -n "$prev" && \ - func_fatal_help "the \`$prevarg' option requires an argument" + func_fatal_help "the '$prevarg' option requires an argument" - if test "$export_dynamic" = yes && test -n "$export_dynamic_flag_spec"; then + if test yes = "$export_dynamic" && test -n "$export_dynamic_flag_spec"; then eval arg=\"$export_dynamic_flag_spec\" func_append compile_command " $arg" func_append finalize_command " $arg" @@ -6009,20 +7450,23 @@ func_mode_link () oldlibs= # calculate the name of the file, without its directory func_basename "$output" - outputname="$func_basename_result" - libobjs_save="$libobjs" + outputname=$func_basename_result + libobjs_save=$libobjs if test -n "$shlibpath_var"; then # get the directories listed in $shlibpath_var - eval shlib_search_path=\`\$ECHO \"\${$shlibpath_var}\" \| \$SED \'s/:/ /g\'\` + eval shlib_search_path=\`\$ECHO \"\$$shlibpath_var\" \| \$SED \'s/:/ /g\'\` else shlib_search_path= fi eval sys_lib_search_path=\"$sys_lib_search_path_spec\" eval sys_lib_dlsearch_path=\"$sys_lib_dlsearch_path_spec\" + # Definition is injected by LT_CONFIG during libtool generation. + func_munge_path_list sys_lib_dlsearch_path "$LT_SYS_LIBRARY_PATH" + func_dirname "$output" "/" "" - output_objdir="$func_dirname_result$objdir" + output_objdir=$func_dirname_result$objdir func_to_tool_file "$output_objdir/" tool_output_objdir=$func_to_tool_file_result # Create the object directory. @@ -6045,7 +7489,7 @@ func_mode_link () # Find all interdependent deplibs by searching for libraries # that are linked more than once (e.g. -la -lb -la) for deplib in $deplibs; do - if $opt_preserve_dup_deps ; then + if $opt_preserve_dup_deps; then case "$libs " in *" $deplib "*) func_append specialdeplibs " $deplib" ;; esac @@ -6053,7 +7497,7 @@ func_mode_link () func_append libs " $deplib" done - if test "$linkmode" = lib; then + if test lib = "$linkmode"; then libs="$predeps $libs $compiler_lib_search_path $postdeps" # Compute libraries that are listed more than once in $predeps @@ -6085,7 +7529,7 @@ func_mode_link () case $file in *.la) ;; *) - func_fatal_help "libraries can \`-dlopen' only libtool libraries: $file" + func_fatal_help "libraries can '-dlopen' only libtool libraries: $file" ;; esac done @@ -6093,7 +7537,7 @@ func_mode_link () prog) compile_deplibs= finalize_deplibs= - alldeplibs=no + alldeplibs=false newdlfiles= newdlprefiles= passes="conv scan dlopen dlpreopen link" @@ -6105,29 +7549,29 @@ func_mode_link () for pass in $passes; do # The preopen pass in lib mode reverses $deplibs; put it back here # so that -L comes before libs that need it for instance... - if test "$linkmode,$pass" = "lib,link"; then + if test lib,link = "$linkmode,$pass"; then ## FIXME: Find the place where the list is rebuilt in the wrong ## order, and fix it there properly tmp_deplibs= for deplib in $deplibs; do tmp_deplibs="$deplib $tmp_deplibs" done - deplibs="$tmp_deplibs" + deplibs=$tmp_deplibs fi - if test "$linkmode,$pass" = "lib,link" || - test "$linkmode,$pass" = "prog,scan"; then - libs="$deplibs" + if test lib,link = "$linkmode,$pass" || + test prog,scan = "$linkmode,$pass"; then + libs=$deplibs deplibs= fi - if test "$linkmode" = prog; then + if test prog = "$linkmode"; then case $pass in - dlopen) libs="$dlfiles" ;; - dlpreopen) libs="$dlprefiles" ;; + dlopen) libs=$dlfiles ;; + dlpreopen) libs=$dlprefiles ;; link) libs="$deplibs %DEPLIBS% $dependency_libs" ;; esac fi - if test "$linkmode,$pass" = "lib,dlpreopen"; then + if test lib,dlpreopen = "$linkmode,$pass"; then # Collect and forward deplibs of preopened libtool libs for lib in $dlprefiles; do # Ignore non-libtool-libs @@ -6148,26 +7592,26 @@ func_mode_link () esac done done - libs="$dlprefiles" + libs=$dlprefiles fi - if test "$pass" = dlopen; then + if test dlopen = "$pass"; then # Collect dlpreopened libraries - save_deplibs="$deplibs" + save_deplibs=$deplibs deplibs= fi for deplib in $libs; do lib= - found=no + found=false case $deplib in -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe \ |-threads|-fopenmp|-openmp|-mp|-xopenmp|-omp|-qsmp=*) - if test "$linkmode,$pass" = "prog,link"; then + if test prog,link = "$linkmode,$pass"; then compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" else func_append compiler_flags " $deplib" - if test "$linkmode" = lib ; then + if test lib = "$linkmode"; then case "$new_inherited_linker_flags " in *" $deplib "*) ;; * ) func_append new_inherited_linker_flags " $deplib" ;; @@ -6177,13 +7621,13 @@ func_mode_link () continue ;; -l*) - if test "$linkmode" != lib && test "$linkmode" != prog; then - func_warning "\`-l' is ignored for archives/objects" + if test lib != "$linkmode" && test prog != "$linkmode"; then + func_warning "'-l' is ignored for archives/objects" continue fi func_stripname '-l' '' "$deplib" name=$func_stripname_result - if test "$linkmode" = lib; then + if test lib = "$linkmode"; then searchdirs="$newlib_search_path $lib_search_path $compiler_lib_search_dirs $sys_lib_search_path $shlib_search_path" else searchdirs="$newlib_search_path $lib_search_path $sys_lib_search_path $shlib_search_path" @@ -6191,31 +7635,22 @@ func_mode_link () for searchdir in $searchdirs; do for search_ext in .la $std_shrext .so .a; do # Search the libtool library - lib="$searchdir/lib${name}${search_ext}" + lib=$searchdir/lib$name$search_ext if test -f "$lib"; then - if test "$search_ext" = ".la"; then - found=yes + if test .la = "$search_ext"; then + found=: else - found=no + found=false fi break 2 fi done done - if test "$found" != yes; then - # deplib doesn't seem to be a libtool library - if test "$linkmode,$pass" = "prog,link"; then - compile_deplibs="$deplib $compile_deplibs" - finalize_deplibs="$deplib $finalize_deplibs" - else - deplibs="$deplib $deplibs" - test "$linkmode" = lib && newdependency_libs="$deplib $newdependency_libs" - fi - continue - else # deplib is a libtool library + if $found; then + # deplib is a libtool library # If $allow_libtool_libs_with_static_runtimes && $deplib is a stdlib, # We need to do some special things here, and not later. - if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then + if test yes = "$allow_libtool_libs_with_static_runtimes"; then case " $predeps $postdeps " in *" $deplib "*) if func_lalib_p "$lib"; then @@ -6223,19 +7658,19 @@ func_mode_link () old_library= func_source "$lib" for l in $old_library $library_names; do - ll="$l" + ll=$l done - if test "X$ll" = "X$old_library" ; then # only static version available - found=no + if test "X$ll" = "X$old_library"; then # only static version available + found=false func_dirname "$lib" "" "." - ladir="$func_dirname_result" + ladir=$func_dirname_result lib=$ladir/$old_library - if test "$linkmode,$pass" = "prog,link"; then + if test prog,link = "$linkmode,$pass"; then compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" else deplibs="$deplib $deplibs" - test "$linkmode" = lib && newdependency_libs="$deplib $newdependency_libs" + test lib = "$linkmode" && newdependency_libs="$deplib $newdependency_libs" fi continue fi @@ -6244,15 +7679,25 @@ func_mode_link () *) ;; esac fi + else + # deplib doesn't seem to be a libtool library + if test prog,link = "$linkmode,$pass"; then + compile_deplibs="$deplib $compile_deplibs" + finalize_deplibs="$deplib $finalize_deplibs" + else + deplibs="$deplib $deplibs" + test lib = "$linkmode" && newdependency_libs="$deplib $newdependency_libs" + fi + continue fi ;; # -l *.ltframework) - if test "$linkmode,$pass" = "prog,link"; then + if test prog,link = "$linkmode,$pass"; then compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" else deplibs="$deplib $deplibs" - if test "$linkmode" = lib ; then + if test lib = "$linkmode"; then case "$new_inherited_linker_flags " in *" $deplib "*) ;; * ) func_append new_inherited_linker_flags " $deplib" ;; @@ -6265,18 +7710,18 @@ func_mode_link () case $linkmode in lib) deplibs="$deplib $deplibs" - test "$pass" = conv && continue + test conv = "$pass" && continue newdependency_libs="$deplib $newdependency_libs" func_stripname '-L' '' "$deplib" func_resolve_sysroot "$func_stripname_result" func_append newlib_search_path " $func_resolve_sysroot_result" ;; prog) - if test "$pass" = conv; then + if test conv = "$pass"; then deplibs="$deplib $deplibs" continue fi - if test "$pass" = scan; then + if test scan = "$pass"; then deplibs="$deplib $deplibs" else compile_deplibs="$deplib $compile_deplibs" @@ -6287,13 +7732,13 @@ func_mode_link () func_append newlib_search_path " $func_resolve_sysroot_result" ;; *) - func_warning "\`-L' is ignored for archives/objects" + func_warning "'-L' is ignored for archives/objects" ;; esac # linkmode continue ;; # -L -R*) - if test "$pass" = link; then + if test link = "$pass"; then func_stripname '-R' '' "$deplib" func_resolve_sysroot "$func_stripname_result" dir=$func_resolve_sysroot_result @@ -6311,7 +7756,7 @@ func_mode_link () lib=$func_resolve_sysroot_result ;; *.$libext) - if test "$pass" = conv; then + if test conv = "$pass"; then deplibs="$deplib $deplibs" continue fi @@ -6322,21 +7767,26 @@ func_mode_link () case " $dlpreconveniencelibs " in *" $deplib "*) ;; *) - valid_a_lib=no + valid_a_lib=false case $deplibs_check_method in match_pattern*) set dummy $deplibs_check_method; shift match_pattern_regex=`expr "$deplibs_check_method" : "$1 \(.*\)"` if eval "\$ECHO \"$deplib\"" 2>/dev/null | $SED 10q \ | $EGREP "$match_pattern_regex" > /dev/null; then - valid_a_lib=yes + valid_a_lib=: fi ;; pass_all) - valid_a_lib=yes + valid_a_lib=: ;; esac - if test "$valid_a_lib" != yes; then + if $valid_a_lib; then + echo + $ECHO "*** Warning: Linking the shared library $output against the" + $ECHO "*** static library $deplib is not portable!" + deplibs="$deplib $deplibs" + else echo $ECHO "*** Warning: Trying to link with static lib archive $deplib." echo "*** I have the capability to make that library automatically link in when" @@ -6344,18 +7794,13 @@ func_mode_link () echo "*** shared version of the library, which you do not appear to have" echo "*** because the file extensions .$libext of this argument makes me believe" echo "*** that it is just a static archive that I should not use here." - else - echo - $ECHO "*** Warning: Linking the shared library $output against the" - $ECHO "*** static library $deplib is not portable!" - deplibs="$deplib $deplibs" fi ;; esac continue ;; prog) - if test "$pass" != link; then + if test link != "$pass"; then deplibs="$deplib $deplibs" else compile_deplibs="$deplib $compile_deplibs" @@ -6366,10 +7811,10 @@ func_mode_link () esac # linkmode ;; # *.$libext *.lo | *.$objext) - if test "$pass" = conv; then + if test conv = "$pass"; then deplibs="$deplib $deplibs" - elif test "$linkmode" = prog; then - if test "$pass" = dlpreopen || test "$dlopen_support" != yes || test "$build_libtool_libs" = no; then + elif test prog = "$linkmode"; then + if test dlpreopen = "$pass" || test yes != "$dlopen_support" || test no = "$build_libtool_libs"; then # If there is no dlopen support or we're linking statically, # we need to preload. func_append newdlprefiles " $deplib" @@ -6382,22 +7827,20 @@ func_mode_link () continue ;; %DEPLIBS%) - alldeplibs=yes + alldeplibs=: continue ;; esac # case $deplib - if test "$found" = yes || test -f "$lib"; then : - else - func_fatal_error "cannot find the library \`$lib' or unhandled argument \`$deplib'" - fi + $found || test -f "$lib" \ + || func_fatal_error "cannot find the library '$lib' or unhandled argument '$deplib'" # Check to see that this really is a libtool archive. func_lalib_unsafe_p "$lib" \ - || func_fatal_error "\`$lib' is not a valid libtool archive" + || func_fatal_error "'$lib' is not a valid libtool archive" func_dirname "$lib" "" "." - ladir="$func_dirname_result" + ladir=$func_dirname_result dlname= dlopen= @@ -6427,30 +7870,30 @@ func_mode_link () done fi dependency_libs=`$ECHO " $dependency_libs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` - if test "$linkmode,$pass" = "lib,link" || - test "$linkmode,$pass" = "prog,scan" || - { test "$linkmode" != prog && test "$linkmode" != lib; }; then + if test lib,link = "$linkmode,$pass" || + test prog,scan = "$linkmode,$pass" || + { test prog != "$linkmode" && test lib != "$linkmode"; }; then test -n "$dlopen" && func_append dlfiles " $dlopen" test -n "$dlpreopen" && func_append dlprefiles " $dlpreopen" fi - if test "$pass" = conv; then + if test conv = "$pass"; then # Only check for convenience libraries deplibs="$lib $deplibs" if test -z "$libdir"; then if test -z "$old_library"; then - func_fatal_error "cannot find name of link library for \`$lib'" + func_fatal_error "cannot find name of link library for '$lib'" fi # It is a libtool convenience library, so add in its objects. func_append convenience " $ladir/$objdir/$old_library" func_append old_convenience " $ladir/$objdir/$old_library" - elif test "$linkmode" != prog && test "$linkmode" != lib; then - func_fatal_error "\`$lib' is not a convenience library" + elif test prog != "$linkmode" && test lib != "$linkmode"; then + func_fatal_error "'$lib' is not a convenience library" fi tmp_libs= for deplib in $dependency_libs; do deplibs="$deplib $deplibs" - if $opt_preserve_dup_deps ; then + if $opt_preserve_dup_deps; then case "$tmp_libs " in *" $deplib "*) func_append specialdeplibs " $deplib" ;; esac @@ -6464,26 +7907,26 @@ func_mode_link () # Get the name of the library we link against. linklib= if test -n "$old_library" && - { test "$prefer_static_libs" = yes || - test "$prefer_static_libs,$installed" = "built,no"; }; then + { test yes = "$prefer_static_libs" || + test built,no = "$prefer_static_libs,$installed"; }; then linklib=$old_library else for l in $old_library $library_names; do - linklib="$l" + linklib=$l done fi if test -z "$linklib"; then - func_fatal_error "cannot find name of link library for \`$lib'" + func_fatal_error "cannot find name of link library for '$lib'" fi # This library was specified with -dlopen. - if test "$pass" = dlopen; then - if test -z "$libdir"; then - func_fatal_error "cannot -dlopen a convenience library: \`$lib'" - fi + if test dlopen = "$pass"; then + test -z "$libdir" \ + && func_fatal_error "cannot -dlopen a convenience library: '$lib'" if test -z "$dlname" || - test "$dlopen_support" != yes || - test "$build_libtool_libs" = no; then + test yes != "$dlopen_support" || + test no = "$build_libtool_libs" + then # If there is no dlname, no dlopen support or we're linking # statically, we need to preload. We also need to preload any # dependent libraries so libltdl's deplib preloader doesn't @@ -6497,40 +7940,40 @@ func_mode_link () # We need an absolute path. case $ladir in - [\\/]* | [A-Za-z]:[\\/]*) abs_ladir="$ladir" ;; + [\\/]* | [A-Za-z]:[\\/]*) abs_ladir=$ladir ;; *) abs_ladir=`cd "$ladir" && pwd` if test -z "$abs_ladir"; then - func_warning "cannot determine absolute directory name of \`$ladir'" + func_warning "cannot determine absolute directory name of '$ladir'" func_warning "passing it literally to the linker, although it might fail" - abs_ladir="$ladir" + abs_ladir=$ladir fi ;; esac func_basename "$lib" - laname="$func_basename_result" + laname=$func_basename_result # Find the relevant object directory and library name. - if test "X$installed" = Xyes; then + if test yes = "$installed"; then if test ! -f "$lt_sysroot$libdir/$linklib" && test -f "$abs_ladir/$linklib"; then - func_warning "library \`$lib' was moved." - dir="$ladir" - absdir="$abs_ladir" - libdir="$abs_ladir" + func_warning "library '$lib' was moved." + dir=$ladir + absdir=$abs_ladir + libdir=$abs_ladir else - dir="$lt_sysroot$libdir" - absdir="$lt_sysroot$libdir" + dir=$lt_sysroot$libdir + absdir=$lt_sysroot$libdir fi - test "X$hardcode_automatic" = Xyes && avoidtemprpath=yes + test yes = "$hardcode_automatic" && avoidtemprpath=yes else if test ! -f "$ladir/$objdir/$linklib" && test -f "$abs_ladir/$linklib"; then - dir="$ladir" - absdir="$abs_ladir" + dir=$ladir + absdir=$abs_ladir # Remove this search path later func_append notinst_path " $abs_ladir" else - dir="$ladir/$objdir" - absdir="$abs_ladir/$objdir" + dir=$ladir/$objdir + absdir=$abs_ladir/$objdir # Remove this search path later func_append notinst_path " $abs_ladir" fi @@ -6539,11 +7982,11 @@ func_mode_link () name=$func_stripname_result # This library was specified with -dlpreopen. - if test "$pass" = dlpreopen; then - if test -z "$libdir" && test "$linkmode" = prog; then - func_fatal_error "only libraries may -dlpreopen a convenience library: \`$lib'" + if test dlpreopen = "$pass"; then + if test -z "$libdir" && test prog = "$linkmode"; then + func_fatal_error "only libraries may -dlpreopen a convenience library: '$lib'" fi - case "$host" in + case $host in # special handling for platforms with PE-DLLs. *cygwin* | *mingw* | *cegcc* ) # Linker will automatically link against shared library if both @@ -6587,9 +8030,9 @@ func_mode_link () if test -z "$libdir"; then # Link the convenience library - if test "$linkmode" = lib; then + if test lib = "$linkmode"; then deplibs="$dir/$old_library $deplibs" - elif test "$linkmode,$pass" = "prog,link"; then + elif test prog,link = "$linkmode,$pass"; then compile_deplibs="$dir/$old_library $compile_deplibs" finalize_deplibs="$dir/$old_library $finalize_deplibs" else @@ -6599,14 +8042,14 @@ func_mode_link () fi - if test "$linkmode" = prog && test "$pass" != link; then + if test prog = "$linkmode" && test link != "$pass"; then func_append newlib_search_path " $ladir" deplibs="$lib $deplibs" - linkalldeplibs=no - if test "$link_all_deplibs" != no || test -z "$library_names" || - test "$build_libtool_libs" = no; then - linkalldeplibs=yes + linkalldeplibs=false + if test no != "$link_all_deplibs" || test -z "$library_names" || + test no = "$build_libtool_libs"; then + linkalldeplibs=: fi tmp_libs= @@ -6618,14 +8061,14 @@ func_mode_link () ;; esac # Need to link against all dependency_libs? - if test "$linkalldeplibs" = yes; then + if $linkalldeplibs; then deplibs="$deplib $deplibs" else # Need to hardcode shared library paths # or/and link against static libraries newdependency_libs="$deplib $newdependency_libs" fi - if $opt_preserve_dup_deps ; then + if $opt_preserve_dup_deps; then case "$tmp_libs " in *" $deplib "*) func_append specialdeplibs " $deplib" ;; esac @@ -6635,15 +8078,15 @@ func_mode_link () continue fi # $linkmode = prog... - if test "$linkmode,$pass" = "prog,link"; then + if test prog,link = "$linkmode,$pass"; then if test -n "$library_names" && - { { test "$prefer_static_libs" = no || - test "$prefer_static_libs,$installed" = "built,yes"; } || + { { test no = "$prefer_static_libs" || + test built,yes = "$prefer_static_libs,$installed"; } || test -z "$old_library"; }; then # We need to hardcode the library path - if test -n "$shlibpath_var" && test -z "$avoidtemprpath" ; then + if test -n "$shlibpath_var" && test -z "$avoidtemprpath"; then # Make sure the rpath contains only unique directories. - case "$temp_rpath:" in + case $temp_rpath: in *"$absdir:"*) ;; *) func_append temp_rpath "$absdir:" ;; esac @@ -6672,9 +8115,9 @@ func_mode_link () esac fi # $linkmode,$pass = prog,link... - if test "$alldeplibs" = yes && - { test "$deplibs_check_method" = pass_all || - { test "$build_libtool_libs" = yes && + if $alldeplibs && + { test pass_all = "$deplibs_check_method" || + { test yes = "$build_libtool_libs" && test -n "$library_names"; }; }; then # We only need to search for static libraries continue @@ -6683,19 +8126,19 @@ func_mode_link () link_static=no # Whether the deplib will be linked statically use_static_libs=$prefer_static_libs - if test "$use_static_libs" = built && test "$installed" = yes; then + if test built = "$use_static_libs" && test yes = "$installed"; then use_static_libs=no fi if test -n "$library_names" && - { test "$use_static_libs" = no || test -z "$old_library"; }; then + { test no = "$use_static_libs" || test -z "$old_library"; }; then case $host in - *cygwin* | *mingw* | *cegcc*) + *cygwin* | *mingw* | *cegcc* | *os2*) # No point in relinking DLLs because paths are not encoded func_append notinst_deplibs " $lib" need_relink=no ;; *) - if test "$installed" = no; then + if test no = "$installed"; then func_append notinst_deplibs " $lib" need_relink=yes fi @@ -6705,24 +8148,24 @@ func_mode_link () # Warn about portability, can't link against -module's on some # systems (darwin). Don't bleat about dlopened modules though! - dlopenmodule="" + dlopenmodule= for dlpremoduletest in $dlprefiles; do if test "X$dlpremoduletest" = "X$lib"; then - dlopenmodule="$dlpremoduletest" + dlopenmodule=$dlpremoduletest break fi done - if test -z "$dlopenmodule" && test "$shouldnotlink" = yes && test "$pass" = link; then + if test -z "$dlopenmodule" && test yes = "$shouldnotlink" && test link = "$pass"; then echo - if test "$linkmode" = prog; then + if test prog = "$linkmode"; then $ECHO "*** Warning: Linking the executable $output against the loadable module" else $ECHO "*** Warning: Linking the shared library $output against the loadable module" fi $ECHO "*** $linklib is not portable!" fi - if test "$linkmode" = lib && - test "$hardcode_into_libs" = yes; then + if test lib = "$linkmode" && + test yes = "$hardcode_into_libs"; then # Hardcode the library path. # Skip directories that are in the system default run-time # search path. @@ -6750,43 +8193,43 @@ func_mode_link () # figure out the soname set dummy $library_names shift - realname="$1" + realname=$1 shift libname=`eval "\\$ECHO \"$libname_spec\""` # use dlname if we got it. it's perfectly good, no? if test -n "$dlname"; then - soname="$dlname" + soname=$dlname elif test -n "$soname_spec"; then # bleh windows case $host in - *cygwin* | mingw* | *cegcc*) + *cygwin* | mingw* | *cegcc* | *os2*) func_arith $current - $age major=$func_arith_result - versuffix="-$major" + versuffix=-$major ;; esac eval soname=\"$soname_spec\" else - soname="$realname" + soname=$realname fi # Make a new name for the extract_expsyms_cmds to use - soroot="$soname" + soroot=$soname func_basename "$soroot" - soname="$func_basename_result" + soname=$func_basename_result func_stripname 'lib' '.dll' "$soname" newlib=libimp-$func_stripname_result.a # If the library has no export list, then create one now if test -f "$output_objdir/$soname-def"; then : else - func_verbose "extracting exported symbol list from \`$soname'" + func_verbose "extracting exported symbol list from '$soname'" func_execute_cmds "$extract_expsyms_cmds" 'exit $?' fi # Create $newlib if test -f "$output_objdir/$newlib"; then :; else - func_verbose "generating import library for \`$soname'" + func_verbose "generating import library for '$soname'" func_execute_cmds "$old_archive_from_expsyms_cmds" 'exit $?' fi # make sure the library variables are pointing to the new library @@ -6794,58 +8237,58 @@ func_mode_link () linklib=$newlib fi # test -n "$old_archive_from_expsyms_cmds" - if test "$linkmode" = prog || test "$opt_mode" != relink; then + if test prog = "$linkmode" || test relink != "$opt_mode"; then add_shlibpath= add_dir= add= lib_linked=yes case $hardcode_action in immediate | unsupported) - if test "$hardcode_direct" = no; then - add="$dir/$linklib" + if test no = "$hardcode_direct"; then + add=$dir/$linklib case $host in - *-*-sco3.2v5.0.[024]*) add_dir="-L$dir" ;; - *-*-sysv4*uw2*) add_dir="-L$dir" ;; + *-*-sco3.2v5.0.[024]*) add_dir=-L$dir ;; + *-*-sysv4*uw2*) add_dir=-L$dir ;; *-*-sysv5OpenUNIX* | *-*-sysv5UnixWare7.[01].[10]* | \ - *-*-unixware7*) add_dir="-L$dir" ;; + *-*-unixware7*) add_dir=-L$dir ;; *-*-darwin* ) - # if the lib is a (non-dlopened) module then we can not + # if the lib is a (non-dlopened) module then we cannot # link against it, someone is ignoring the earlier warnings if /usr/bin/file -L $add 2> /dev/null | - $GREP ": [^:]* bundle" >/dev/null ; then + $GREP ": [^:]* bundle" >/dev/null; then if test "X$dlopenmodule" != "X$lib"; then $ECHO "*** Warning: lib $linklib is a module, not a shared library" - if test -z "$old_library" ; then + if test -z "$old_library"; then echo echo "*** And there doesn't seem to be a static archive available" echo "*** The link will probably fail, sorry" else - add="$dir/$old_library" + add=$dir/$old_library fi elif test -n "$old_library"; then - add="$dir/$old_library" + add=$dir/$old_library fi fi esac - elif test "$hardcode_minus_L" = no; then + elif test no = "$hardcode_minus_L"; then case $host in - *-*-sunos*) add_shlibpath="$dir" ;; + *-*-sunos*) add_shlibpath=$dir ;; esac - add_dir="-L$dir" - add="-l$name" - elif test "$hardcode_shlibpath_var" = no; then - add_shlibpath="$dir" - add="-l$name" + add_dir=-L$dir + add=-l$name + elif test no = "$hardcode_shlibpath_var"; then + add_shlibpath=$dir + add=-l$name else lib_linked=no fi ;; relink) - if test "$hardcode_direct" = yes && - test "$hardcode_direct_absolute" = no; then - add="$dir/$linklib" - elif test "$hardcode_minus_L" = yes; then - add_dir="-L$absdir" + if test yes = "$hardcode_direct" && + test no = "$hardcode_direct_absolute"; then + add=$dir/$linklib + elif test yes = "$hardcode_minus_L"; then + add_dir=-L$absdir # Try looking first in the location we're being installed to. if test -n "$inst_prefix_dir"; then case $libdir in @@ -6854,10 +8297,10 @@ func_mode_link () ;; esac fi - add="-l$name" - elif test "$hardcode_shlibpath_var" = yes; then - add_shlibpath="$dir" - add="-l$name" + add=-l$name + elif test yes = "$hardcode_shlibpath_var"; then + add_shlibpath=$dir + add=-l$name else lib_linked=no fi @@ -6865,7 +8308,7 @@ func_mode_link () *) lib_linked=no ;; esac - if test "$lib_linked" != yes; then + if test yes != "$lib_linked"; then func_fatal_configuration "unsupported hardcode properties" fi @@ -6875,15 +8318,15 @@ func_mode_link () *) func_append compile_shlibpath "$add_shlibpath:" ;; esac fi - if test "$linkmode" = prog; then + if test prog = "$linkmode"; then test -n "$add_dir" && compile_deplibs="$add_dir $compile_deplibs" test -n "$add" && compile_deplibs="$add $compile_deplibs" else test -n "$add_dir" && deplibs="$add_dir $deplibs" test -n "$add" && deplibs="$add $deplibs" - if test "$hardcode_direct" != yes && - test "$hardcode_minus_L" != yes && - test "$hardcode_shlibpath_var" = yes; then + if test yes != "$hardcode_direct" && + test yes != "$hardcode_minus_L" && + test yes = "$hardcode_shlibpath_var"; then case :$finalize_shlibpath: in *":$libdir:"*) ;; *) func_append finalize_shlibpath "$libdir:" ;; @@ -6892,33 +8335,33 @@ func_mode_link () fi fi - if test "$linkmode" = prog || test "$opt_mode" = relink; then + if test prog = "$linkmode" || test relink = "$opt_mode"; then add_shlibpath= add_dir= add= # Finalize command for both is simple: just hardcode it. - if test "$hardcode_direct" = yes && - test "$hardcode_direct_absolute" = no; then - add="$libdir/$linklib" - elif test "$hardcode_minus_L" = yes; then - add_dir="-L$libdir" - add="-l$name" - elif test "$hardcode_shlibpath_var" = yes; then + if test yes = "$hardcode_direct" && + test no = "$hardcode_direct_absolute"; then + add=$libdir/$linklib + elif test yes = "$hardcode_minus_L"; then + add_dir=-L$libdir + add=-l$name + elif test yes = "$hardcode_shlibpath_var"; then case :$finalize_shlibpath: in *":$libdir:"*) ;; *) func_append finalize_shlibpath "$libdir:" ;; esac - add="-l$name" - elif test "$hardcode_automatic" = yes; then + add=-l$name + elif test yes = "$hardcode_automatic"; then if test -n "$inst_prefix_dir" && - test -f "$inst_prefix_dir$libdir/$linklib" ; then - add="$inst_prefix_dir$libdir/$linklib" + test -f "$inst_prefix_dir$libdir/$linklib"; then + add=$inst_prefix_dir$libdir/$linklib else - add="$libdir/$linklib" + add=$libdir/$linklib fi else # We cannot seem to hardcode it, guess we'll fake it. - add_dir="-L$libdir" + add_dir=-L$libdir # Try looking first in the location we're being installed to. if test -n "$inst_prefix_dir"; then case $libdir in @@ -6927,10 +8370,10 @@ func_mode_link () ;; esac fi - add="-l$name" + add=-l$name fi - if test "$linkmode" = prog; then + if test prog = "$linkmode"; then test -n "$add_dir" && finalize_deplibs="$add_dir $finalize_deplibs" test -n "$add" && finalize_deplibs="$add $finalize_deplibs" else @@ -6938,43 +8381,43 @@ func_mode_link () test -n "$add" && deplibs="$add $deplibs" fi fi - elif test "$linkmode" = prog; then + elif test prog = "$linkmode"; then # Here we assume that one of hardcode_direct or hardcode_minus_L # is not unsupported. This is valid on all known static and # shared platforms. - if test "$hardcode_direct" != unsupported; then - test -n "$old_library" && linklib="$old_library" + if test unsupported != "$hardcode_direct"; then + test -n "$old_library" && linklib=$old_library compile_deplibs="$dir/$linklib $compile_deplibs" finalize_deplibs="$dir/$linklib $finalize_deplibs" else compile_deplibs="-l$name -L$dir $compile_deplibs" finalize_deplibs="-l$name -L$dir $finalize_deplibs" fi - elif test "$build_libtool_libs" = yes; then + elif test yes = "$build_libtool_libs"; then # Not a shared library - if test "$deplibs_check_method" != pass_all; then + if test pass_all != "$deplibs_check_method"; then # We're trying link a shared library against a static one # but the system doesn't support it. # Just print a warning and add the library to dependency_libs so # that the program can be linked against the static library. echo - $ECHO "*** Warning: This system can not link to static lib archive $lib." + $ECHO "*** Warning: This system cannot link to static lib archive $lib." echo "*** I have the capability to make that library automatically link in when" echo "*** you link to this library. But I can only do this if you have a" echo "*** shared version of the library, which you do not appear to have." - if test "$module" = yes; then + if test yes = "$module"; then echo "*** But as you try to build a module library, libtool will still create " echo "*** a static module, that should work as long as the dlopening application" echo "*** is linked with the -dlopen flag to resolve symbols at runtime." if test -z "$global_symbol_pipe"; then echo echo "*** However, this would only work if libtool was able to extract symbol" - echo "*** lists from a program, using \`nm' or equivalent, but libtool could" + echo "*** lists from a program, using 'nm' or equivalent, but libtool could" echo "*** not find such a program. So, this module is probably useless." - echo "*** \`nm' from GNU binutils and a full rebuild may help." + echo "*** 'nm' from GNU binutils and a full rebuild may help." fi - if test "$build_old_libs" = no; then + if test no = "$build_old_libs"; then build_libtool_libs=module build_old_libs=yes else @@ -6987,11 +8430,11 @@ func_mode_link () fi fi # link shared/static library? - if test "$linkmode" = lib; then + if test lib = "$linkmode"; then if test -n "$dependency_libs" && - { test "$hardcode_into_libs" != yes || - test "$build_old_libs" = yes || - test "$link_static" = yes; }; then + { test yes != "$hardcode_into_libs" || + test yes = "$build_old_libs" || + test yes = "$link_static"; }; then # Extract -R from dependency_libs temp_deplibs= for libdir in $dependency_libs; do @@ -7005,12 +8448,12 @@ func_mode_link () *) func_append temp_deplibs " $libdir";; esac done - dependency_libs="$temp_deplibs" + dependency_libs=$temp_deplibs fi func_append newlib_search_path " $absdir" # Link against this library - test "$link_static" = no && newdependency_libs="$abs_ladir/$laname $newdependency_libs" + test no = "$link_static" && newdependency_libs="$abs_ladir/$laname $newdependency_libs" # ... and its dependency_libs tmp_libs= for deplib in $dependency_libs; do @@ -7020,7 +8463,7 @@ func_mode_link () func_resolve_sysroot "$func_stripname_result";; *) func_resolve_sysroot "$deplib" ;; esac - if $opt_preserve_dup_deps ; then + if $opt_preserve_dup_deps; then case "$tmp_libs " in *" $func_resolve_sysroot_result "*) func_append specialdeplibs " $func_resolve_sysroot_result" ;; @@ -7029,12 +8472,12 @@ func_mode_link () func_append tmp_libs " $func_resolve_sysroot_result" done - if test "$link_all_deplibs" != no; then + if test no != "$link_all_deplibs"; then # Add the search paths of all dependency libraries for deplib in $dependency_libs; do path= case $deplib in - -L*) path="$deplib" ;; + -L*) path=$deplib ;; *.la) func_resolve_sysroot "$deplib" deplib=$func_resolve_sysroot_result @@ -7042,12 +8485,12 @@ func_mode_link () dir=$func_dirname_result # We need an absolute path. case $dir in - [\\/]* | [A-Za-z]:[\\/]*) absdir="$dir" ;; + [\\/]* | [A-Za-z]:[\\/]*) absdir=$dir ;; *) absdir=`cd "$dir" && pwd` if test -z "$absdir"; then - func_warning "cannot determine absolute directory name of \`$dir'" - absdir="$dir" + func_warning "cannot determine absolute directory name of '$dir'" + absdir=$dir fi ;; esac @@ -7055,35 +8498,35 @@ func_mode_link () case $host in *-*-darwin*) depdepl= - eval deplibrary_names=`${SED} -n -e 's/^library_names=\(.*\)$/\1/p' $deplib` - if test -n "$deplibrary_names" ; then - for tmp in $deplibrary_names ; do + eval deplibrary_names=`$SED -n -e 's/^library_names=\(.*\)$/\1/p' $deplib` + if test -n "$deplibrary_names"; then + for tmp in $deplibrary_names; do depdepl=$tmp done - if test -f "$absdir/$objdir/$depdepl" ; then - depdepl="$absdir/$objdir/$depdepl" - darwin_install_name=`${OTOOL} -L $depdepl | awk '{if (NR == 2) {print $1;exit}}'` + if test -f "$absdir/$objdir/$depdepl"; then + depdepl=$absdir/$objdir/$depdepl + darwin_install_name=`$OTOOL -L $depdepl | awk '{if (NR == 2) {print $1;exit}}'` if test -z "$darwin_install_name"; then - darwin_install_name=`${OTOOL64} -L $depdepl | awk '{if (NR == 2) {print $1;exit}}'` + darwin_install_name=`$OTOOL64 -L $depdepl | awk '{if (NR == 2) {print $1;exit}}'` fi - func_append compiler_flags " ${wl}-dylib_file ${wl}${darwin_install_name}:${depdepl}" - func_append linker_flags " -dylib_file ${darwin_install_name}:${depdepl}" + func_append compiler_flags " $wl-dylib_file $wl$darwin_install_name:$depdepl" + func_append linker_flags " -dylib_file $darwin_install_name:$depdepl" path= fi fi ;; *) - path="-L$absdir/$objdir" + path=-L$absdir/$objdir ;; esac else - eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib` + eval libdir=`$SED -n -e 's/^libdir=\(.*\)$/\1/p' $deplib` test -z "$libdir" && \ - func_fatal_error "\`$deplib' is not a valid libtool archive" + func_fatal_error "'$deplib' is not a valid libtool archive" test "$absdir" != "$libdir" && \ - func_warning "\`$deplib' seems to be moved" + func_warning "'$deplib' seems to be moved" - path="-L$absdir" + path=-L$absdir fi ;; esac @@ -7095,23 +8538,23 @@ func_mode_link () fi # link_all_deplibs != no fi # linkmode = lib done # for deplib in $libs - if test "$pass" = link; then - if test "$linkmode" = "prog"; then + if test link = "$pass"; then + if test prog = "$linkmode"; then compile_deplibs="$new_inherited_linker_flags $compile_deplibs" finalize_deplibs="$new_inherited_linker_flags $finalize_deplibs" else compiler_flags="$compiler_flags "`$ECHO " $new_inherited_linker_flags" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` fi fi - dependency_libs="$newdependency_libs" - if test "$pass" = dlpreopen; then + dependency_libs=$newdependency_libs + if test dlpreopen = "$pass"; then # Link the dlpreopened libraries before other libraries for deplib in $save_deplibs; do deplibs="$deplib $deplibs" done fi - if test "$pass" != dlopen; then - if test "$pass" != conv; then + if test dlopen != "$pass"; then + test conv = "$pass" || { # Make sure lib_search_path contains only unique directories. lib_search_path= for dir in $newlib_search_path; do @@ -7121,12 +8564,12 @@ func_mode_link () esac done newlib_search_path= - fi + } - if test "$linkmode,$pass" != "prog,link"; then - vars="deplibs" - else + if test prog,link = "$linkmode,$pass"; then vars="compile_deplibs finalize_deplibs" + else + vars=deplibs fi for var in $vars dependency_libs; do # Add libraries to $var in reverse order @@ -7184,62 +8627,93 @@ func_mode_link () eval $var=\"$tmp_libs\" done # for var fi + + # Add Sun CC postdeps if required: + test CXX = "$tagname" && { + case $host_os in + linux*) + case `$CC -V 2>&1 | sed 5q` in + *Sun\ C*) # Sun C++ 5.9 + func_suncc_cstd_abi + + if test no != "$suncc_use_cstd_abi"; then + func_append postdeps ' -library=Cstd -library=Crun' + fi + ;; + esac + ;; + + solaris*) + func_cc_basename "$CC" + case $func_cc_basename_result in + CC* | sunCC*) + func_suncc_cstd_abi + + if test no != "$suncc_use_cstd_abi"; then + func_append postdeps ' -library=Cstd -library=Crun' + fi + ;; + esac + ;; + esac + } + # Last step: remove runtime libs from dependency_libs # (they stay in deplibs) tmp_libs= - for i in $dependency_libs ; do + for i in $dependency_libs; do case " $predeps $postdeps $compiler_lib_search_path " in *" $i "*) - i="" + i= ;; esac - if test -n "$i" ; then + if test -n "$i"; then func_append tmp_libs " $i" fi done dependency_libs=$tmp_libs done # for pass - if test "$linkmode" = prog; then - dlfiles="$newdlfiles" + if test prog = "$linkmode"; then + dlfiles=$newdlfiles fi - if test "$linkmode" = prog || test "$linkmode" = lib; then - dlprefiles="$newdlprefiles" + if test prog = "$linkmode" || test lib = "$linkmode"; then + dlprefiles=$newdlprefiles fi case $linkmode in oldlib) - if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then - func_warning "\`-dlopen' is ignored for archives" + if test -n "$dlfiles$dlprefiles" || test no != "$dlself"; then + func_warning "'-dlopen' is ignored for archives" fi case " $deplibs" in *\ -l* | *\ -L*) - func_warning "\`-l' and \`-L' are ignored for archives" ;; + func_warning "'-l' and '-L' are ignored for archives" ;; esac test -n "$rpath" && \ - func_warning "\`-rpath' is ignored for archives" + func_warning "'-rpath' is ignored for archives" test -n "$xrpath" && \ - func_warning "\`-R' is ignored for archives" + func_warning "'-R' is ignored for archives" test -n "$vinfo" && \ - func_warning "\`-version-info/-version-number' is ignored for archives" + func_warning "'-version-info/-version-number' is ignored for archives" test -n "$release" && \ - func_warning "\`-release' is ignored for archives" + func_warning "'-release' is ignored for archives" test -n "$export_symbols$export_symbols_regex" && \ - func_warning "\`-export-symbols' is ignored for archives" + func_warning "'-export-symbols' is ignored for archives" # Now set the variables for building old libraries. build_libtool_libs=no - oldlibs="$output" + oldlibs=$output func_append objs "$old_deplibs" ;; lib) - # Make sure we only generate libraries of the form `libNAME.la'. + # Make sure we only generate libraries of the form 'libNAME.la'. case $outputname in lib*) func_stripname 'lib' '.la' "$outputname" @@ -7248,10 +8722,10 @@ func_mode_link () eval libname=\"$libname_spec\" ;; *) - test "$module" = no && \ - func_fatal_help "libtool library \`$output' must begin with \`lib'" + test no = "$module" \ + && func_fatal_help "libtool library '$output' must begin with 'lib'" - if test "$need_lib_prefix" != no; then + if test no != "$need_lib_prefix"; then # Add the "lib" prefix for modules if required func_stripname '' '.la' "$outputname" name=$func_stripname_result @@ -7265,8 +8739,8 @@ func_mode_link () esac if test -n "$objs"; then - if test "$deplibs_check_method" != pass_all; then - func_fatal_error "cannot build libtool library \`$output' from non-libtool objects on this host:$objs" + if test pass_all != "$deplibs_check_method"; then + func_fatal_error "cannot build libtool library '$output' from non-libtool objects on this host:$objs" else echo $ECHO "*** Warning: Linking the shared library $output against the non-libtool" @@ -7275,21 +8749,21 @@ func_mode_link () fi fi - test "$dlself" != no && \ - func_warning "\`-dlopen self' is ignored for libtool libraries" + test no = "$dlself" \ + || func_warning "'-dlopen self' is ignored for libtool libraries" set dummy $rpath shift - test "$#" -gt 1 && \ - func_warning "ignoring multiple \`-rpath's for a libtool library" + test 1 -lt "$#" \ + && func_warning "ignoring multiple '-rpath's for a libtool library" - install_libdir="$1" + install_libdir=$1 oldlibs= if test -z "$rpath"; then - if test "$build_libtool_libs" = yes; then + if test yes = "$build_libtool_libs"; then # Building a libtool convenience library. - # Some compilers have problems with a `.al' extension so + # Some compilers have problems with a '.al' extension so # convenience libraries should have the same extension an # archive normally would. oldlibs="$output_objdir/$libname.$libext $oldlibs" @@ -7298,20 +8772,20 @@ func_mode_link () fi test -n "$vinfo" && \ - func_warning "\`-version-info/-version-number' is ignored for convenience libraries" + func_warning "'-version-info/-version-number' is ignored for convenience libraries" test -n "$release" && \ - func_warning "\`-release' is ignored for convenience libraries" + func_warning "'-release' is ignored for convenience libraries" else # Parse the version information argument. - save_ifs="$IFS"; IFS=':' + save_ifs=$IFS; IFS=: set dummy $vinfo 0 0 0 shift - IFS="$save_ifs" + IFS=$save_ifs test -n "$7" && \ - func_fatal_help "too many parameters to \`-version-info'" + func_fatal_help "too many parameters to '-version-info'" # convert absolute version numbers to libtool ages # this retains compatibility with .la files and attempts @@ -7319,42 +8793,42 @@ func_mode_link () case $vinfo_number in yes) - number_major="$1" - number_minor="$2" - number_revision="$3" + number_major=$1 + number_minor=$2 + number_revision=$3 # # There are really only two kinds -- those that # use the current revision as the major version # and those that subtract age and use age as # a minor version. But, then there is irix - # which has an extra 1 added just for fun + # that has an extra 1 added just for fun # case $version_type in # correct linux to gnu/linux during the next big refactor - darwin|linux|osf|windows|none) + darwin|freebsd-elf|linux|osf|windows|none) func_arith $number_major + $number_minor current=$func_arith_result - age="$number_minor" - revision="$number_revision" + age=$number_minor + revision=$number_revision ;; - freebsd-aout|freebsd-elf|qnx|sunos) - current="$number_major" - revision="$number_minor" - age="0" + freebsd-aout|qnx|sunos) + current=$number_major + revision=$number_minor + age=0 ;; irix|nonstopux) func_arith $number_major + $number_minor current=$func_arith_result - age="$number_minor" - revision="$number_minor" + age=$number_minor + revision=$number_minor lt_irix_increment=no ;; esac ;; no) - current="$1" - revision="$2" - age="$3" + current=$1 + revision=$2 + age=$3 ;; esac @@ -7362,30 +8836,30 @@ func_mode_link () case $current in 0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;; *) - func_error "CURRENT \`$current' must be a nonnegative integer" - func_fatal_error "\`$vinfo' is not valid version information" + func_error "CURRENT '$current' must be a nonnegative integer" + func_fatal_error "'$vinfo' is not valid version information" ;; esac case $revision in 0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;; *) - func_error "REVISION \`$revision' must be a nonnegative integer" - func_fatal_error "\`$vinfo' is not valid version information" + func_error "REVISION '$revision' must be a nonnegative integer" + func_fatal_error "'$vinfo' is not valid version information" ;; esac case $age in 0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;; *) - func_error "AGE \`$age' must be a nonnegative integer" - func_fatal_error "\`$vinfo' is not valid version information" + func_error "AGE '$age' must be a nonnegative integer" + func_fatal_error "'$vinfo' is not valid version information" ;; esac if test "$age" -gt "$current"; then - func_error "AGE \`$age' is greater than the current interface number \`$current'" - func_fatal_error "\`$vinfo' is not valid version information" + func_error "AGE '$age' is greater than the current interface number '$current'" + func_fatal_error "'$vinfo' is not valid version information" fi # Calculate the version variables. @@ -7400,26 +8874,36 @@ func_mode_link () # verstring for coding it into the library header func_arith $current - $age major=.$func_arith_result - versuffix="$major.$age.$revision" + versuffix=$major.$age.$revision # Darwin ld doesn't like 0 for these options... func_arith $current + 1 minor_current=$func_arith_result - xlcverstring="${wl}-compatibility_version ${wl}$minor_current ${wl}-current_version ${wl}$minor_current.$revision" + xlcverstring="$wl-compatibility_version $wl$minor_current $wl-current_version $wl$minor_current.$revision" verstring="-compatibility_version $minor_current -current_version $minor_current.$revision" + # On Darwin other compilers + case $CC in + nagfor*) + verstring="$wl-compatibility_version $wl$minor_current $wl-current_version $wl$minor_current.$revision" + ;; + *) + verstring="-compatibility_version $minor_current -current_version $minor_current.$revision" + ;; + esac ;; freebsd-aout) - major=".$current" - versuffix=".$current.$revision"; + major=.$current + versuffix=.$current.$revision ;; freebsd-elf) - major=".$current" - versuffix=".$current" + func_arith $current - $age + major=.$func_arith_result + versuffix=$major.$age.$revision ;; irix | nonstopux) - if test "X$lt_irix_increment" = "Xno"; then + if test no = "$lt_irix_increment"; then func_arith $current - $age else func_arith $current - $age + 1 @@ -7430,69 +8914,74 @@ func_mode_link () nonstopux) verstring_prefix=nonstopux ;; *) verstring_prefix=sgi ;; esac - verstring="$verstring_prefix$major.$revision" + verstring=$verstring_prefix$major.$revision # Add in all the interfaces that we are compatible with. loop=$revision - while test "$loop" -ne 0; do + while test 0 -ne "$loop"; do func_arith $revision - $loop iface=$func_arith_result func_arith $loop - 1 loop=$func_arith_result - verstring="$verstring_prefix$major.$iface:$verstring" + verstring=$verstring_prefix$major.$iface:$verstring done - # Before this point, $major must not contain `.'. + # Before this point, $major must not contain '.'. major=.$major - versuffix="$major.$revision" + versuffix=$major.$revision ;; linux) # correct to gnu/linux during the next big refactor func_arith $current - $age major=.$func_arith_result - versuffix="$major.$age.$revision" + versuffix=$major.$age.$revision ;; osf) func_arith $current - $age major=.$func_arith_result - versuffix=".$current.$age.$revision" - verstring="$current.$age.$revision" + versuffix=.$current.$age.$revision + verstring=$current.$age.$revision # Add in all the interfaces that we are compatible with. loop=$age - while test "$loop" -ne 0; do + while test 0 -ne "$loop"; do func_arith $current - $loop iface=$func_arith_result func_arith $loop - 1 loop=$func_arith_result - verstring="$verstring:${iface}.0" + verstring=$verstring:$iface.0 done # Make executables depend on our current version. - func_append verstring ":${current}.0" + func_append verstring ":$current.0" ;; qnx) - major=".$current" - versuffix=".$current" + major=.$current + versuffix=.$current + ;; + + sco) + major=.$current + versuffix=.$current ;; sunos) - major=".$current" - versuffix=".$current.$revision" + major=.$current + versuffix=.$current.$revision ;; windows) # Use '-' rather than '.', since we only want one - # extension on DOS 8.3 filesystems. + # extension on DOS 8.3 file systems. func_arith $current - $age major=$func_arith_result - versuffix="-$major" + versuffix=-$major ;; *) - func_fatal_configuration "unknown library version type \`$version_type'" + func_fatal_configuration "unknown library version type '$version_type'" ;; esac @@ -7506,42 +8995,45 @@ func_mode_link () verstring= ;; *) - verstring="0.0" + verstring=0.0 ;; esac - if test "$need_version" = no; then + if test no = "$need_version"; then versuffix= else - versuffix=".0.0" + versuffix=.0.0 fi fi # Remove version info from name if versioning should be avoided - if test "$avoid_version" = yes && test "$need_version" = no; then + if test yes,no = "$avoid_version,$need_version"; then major= versuffix= - verstring="" + verstring= fi # Check to see if the archive will have undefined symbols. - if test "$allow_undefined" = yes; then - if test "$allow_undefined_flag" = unsupported; then - func_warning "undefined symbols not allowed in $host shared libraries" - build_libtool_libs=no - build_old_libs=yes + if test yes = "$allow_undefined"; then + if test unsupported = "$allow_undefined_flag"; then + if test yes = "$build_old_libs"; then + func_warning "undefined symbols not allowed in $host shared libraries; building static only" + build_libtool_libs=no + else + func_fatal_error "can't build $host shared library unless -no-undefined is specified" + fi fi else # Don't allow undefined symbols. - allow_undefined_flag="$no_undefined_flag" + allow_undefined_flag=$no_undefined_flag fi fi - func_generate_dlsyms "$libname" "$libname" "yes" + func_generate_dlsyms "$libname" "$libname" : func_append libobjs " $symfileobj" - test "X$libobjs" = "X " && libobjs= + test " " = "$libobjs" && libobjs= - if test "$opt_mode" != relink; then + if test relink != "$opt_mode"; then # Remove our outputs, but don't remove object files since they # may have been created when compiling PIC objects. removelist= @@ -7550,8 +9042,8 @@ func_mode_link () case $p in *.$objext | *.gcno) ;; - $output_objdir/$outputname | $output_objdir/$libname.* | $output_objdir/${libname}${release}.*) - if test "X$precious_files_regex" != "X"; then + $output_objdir/$outputname | $output_objdir/$libname.* | $output_objdir/$libname$release.*) + if test -n "$precious_files_regex"; then if $ECHO "$p" | $EGREP -e "$precious_files_regex" >/dev/null 2>&1 then continue @@ -7567,11 +9059,11 @@ func_mode_link () fi # Now set the variables for building old libraries. - if test "$build_old_libs" = yes && test "$build_libtool_libs" != convenience ; then + if test yes = "$build_old_libs" && test convenience != "$build_libtool_libs"; then func_append oldlibs " $output_objdir/$libname.$libext" # Transform .lo files to .o files. - oldobjs="$objs "`$ECHO "$libobjs" | $SP2NL | $SED "/\.${libext}$/d; $lo2o" | $NL2SP` + oldobjs="$objs "`$ECHO "$libobjs" | $SP2NL | $SED "/\.$libext$/d; $lo2o" | $NL2SP` fi # Eliminate all temporary directories. @@ -7592,13 +9084,13 @@ func_mode_link () *) func_append finalize_rpath " $libdir" ;; esac done - if test "$hardcode_into_libs" != yes || test "$build_old_libs" = yes; then + if test yes != "$hardcode_into_libs" || test yes = "$build_old_libs"; then dependency_libs="$temp_xrpath $dependency_libs" fi fi # Make sure dlfiles contains only unique files that won't be dlpreopened - old_dlfiles="$dlfiles" + old_dlfiles=$dlfiles dlfiles= for lib in $old_dlfiles; do case " $dlprefiles $dlfiles " in @@ -7608,7 +9100,7 @@ func_mode_link () done # Make sure dlprefiles contains only unique files - old_dlprefiles="$dlprefiles" + old_dlprefiles=$dlprefiles dlprefiles= for lib in $old_dlprefiles; do case "$dlprefiles " in @@ -7617,7 +9109,7 @@ func_mode_link () esac done - if test "$build_libtool_libs" = yes; then + if test yes = "$build_libtool_libs"; then if test -n "$rpath"; then case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-beos* | *-cegcc* | *-*-haiku*) @@ -7641,7 +9133,7 @@ func_mode_link () ;; *) # Add libc to deplibs on all other systems if necessary. - if test "$build_libtool_need_lc" = "yes"; then + if test yes = "$build_libtool_need_lc"; then func_append deplibs " -lc" fi ;; @@ -7657,9 +9149,9 @@ func_mode_link () # I'm not sure if I'm treating the release correctly. I think # release should show up in the -l (ie -lgmp5) so we don't want to # add it in twice. Is that correct? - release="" - versuffix="" - major="" + release= + versuffix= + major= newdeplibs= droppeddeps=no case $deplibs_check_method in @@ -7688,20 +9180,20 @@ EOF -l*) func_stripname -l '' "$i" name=$func_stripname_result - if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then + if test yes = "$allow_libtool_libs_with_static_runtimes"; then case " $predeps $postdeps " in *" $i "*) func_append newdeplibs " $i" - i="" + i= ;; esac fi - if test -n "$i" ; then + if test -n "$i"; then libname=`eval "\\$ECHO \"$libname_spec\""` deplib_matches=`eval "\\$ECHO \"$library_names_spec\""` set dummy $deplib_matches; shift deplib_match=$1 - if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0 ; then + if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0; then func_append newdeplibs " $i" else droppeddeps=yes @@ -7731,20 +9223,20 @@ EOF $opt_dry_run || $RM conftest if $LTCC $LTCFLAGS -o conftest conftest.c $i; then ldd_output=`ldd conftest` - if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then + if test yes = "$allow_libtool_libs_with_static_runtimes"; then case " $predeps $postdeps " in *" $i "*) func_append newdeplibs " $i" - i="" + i= ;; esac fi - if test -n "$i" ; then + if test -n "$i"; then libname=`eval "\\$ECHO \"$libname_spec\""` deplib_matches=`eval "\\$ECHO \"$library_names_spec\""` set dummy $deplib_matches; shift deplib_match=$1 - if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0 ; then + if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0; then func_append newdeplibs " $i" else droppeddeps=yes @@ -7781,24 +9273,24 @@ EOF -l*) func_stripname -l '' "$a_deplib" name=$func_stripname_result - if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then + if test yes = "$allow_libtool_libs_with_static_runtimes"; then case " $predeps $postdeps " in *" $a_deplib "*) func_append newdeplibs " $a_deplib" - a_deplib="" + a_deplib= ;; esac fi - if test -n "$a_deplib" ; then + if test -n "$a_deplib"; then libname=`eval "\\$ECHO \"$libname_spec\""` if test -n "$file_magic_glob"; then libnameglob=`func_echo_all "$libname" | $SED -e $file_magic_glob` else libnameglob=$libname fi - test "$want_nocaseglob" = yes && nocaseglob=`shopt -p nocaseglob` + test yes = "$want_nocaseglob" && nocaseglob=`shopt -p nocaseglob` for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do - if test "$want_nocaseglob" = yes; then + if test yes = "$want_nocaseglob"; then shopt -s nocaseglob potential_libs=`ls $i/$libnameglob[.-]* 2>/dev/null` $nocaseglob @@ -7816,25 +9308,25 @@ EOF # We might still enter an endless loop, since a link # loop can be closed while we follow links, # but so what? - potlib="$potent_lib" + potlib=$potent_lib while test -h "$potlib" 2>/dev/null; do - potliblink=`ls -ld $potlib | ${SED} 's/.* -> //'` + potliblink=`ls -ld $potlib | $SED 's/.* -> //'` case $potliblink in - [\\/]* | [A-Za-z]:[\\/]*) potlib="$potliblink";; - *) potlib=`$ECHO "$potlib" | $SED 's,[^/]*$,,'`"$potliblink";; + [\\/]* | [A-Za-z]:[\\/]*) potlib=$potliblink;; + *) potlib=`$ECHO "$potlib" | $SED 's|[^/]*$||'`"$potliblink";; esac done if eval $file_magic_cmd \"\$potlib\" 2>/dev/null | $SED -e 10q | $EGREP "$file_magic_regex" > /dev/null; then func_append newdeplibs " $a_deplib" - a_deplib="" + a_deplib= break 2 fi done done fi - if test -n "$a_deplib" ; then + if test -n "$a_deplib"; then droppeddeps=yes echo $ECHO "*** Warning: linker path does not have real file for library $a_deplib." @@ -7842,7 +9334,7 @@ EOF echo "*** you link to this library. But I can only do this if you have a" echo "*** shared version of the library, which you do not appear to have" echo "*** because I did check the linker path looking for a file starting" - if test -z "$potlib" ; then + if test -z "$potlib"; then $ECHO "*** with $libname but no candidates were found. (...for file magic test)" else $ECHO "*** with $libname and none of the candidates passed a file format test" @@ -7865,30 +9357,30 @@ EOF -l*) func_stripname -l '' "$a_deplib" name=$func_stripname_result - if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then + if test yes = "$allow_libtool_libs_with_static_runtimes"; then case " $predeps $postdeps " in *" $a_deplib "*) func_append newdeplibs " $a_deplib" - a_deplib="" + a_deplib= ;; esac fi - if test -n "$a_deplib" ; then + if test -n "$a_deplib"; then libname=`eval "\\$ECHO \"$libname_spec\""` for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do potential_libs=`ls $i/$libname[.-]* 2>/dev/null` for potent_lib in $potential_libs; do - potlib="$potent_lib" # see symlink-check above in file_magic test + potlib=$potent_lib # see symlink-check above in file_magic test if eval "\$ECHO \"$potent_lib\"" 2>/dev/null | $SED 10q | \ $EGREP "$match_pattern_regex" > /dev/null; then func_append newdeplibs " $a_deplib" - a_deplib="" + a_deplib= break 2 fi done done fi - if test -n "$a_deplib" ; then + if test -n "$a_deplib"; then droppeddeps=yes echo $ECHO "*** Warning: linker path does not have real file for library $a_deplib." @@ -7896,7 +9388,7 @@ EOF echo "*** you link to this library. But I can only do this if you have a" echo "*** shared version of the library, which you do not appear to have" echo "*** because I did check the linker path looking for a file starting" - if test -z "$potlib" ; then + if test -z "$potlib"; then $ECHO "*** with $libname but no candidates were found. (...for regex pattern test)" else $ECHO "*** with $libname and none of the candidates passed a file format test" @@ -7912,18 +9404,18 @@ EOF done # Gone through all deplibs. ;; none | unknown | *) - newdeplibs="" + newdeplibs= tmp_deplibs=`$ECHO " $deplibs" | $SED 's/ -lc$//; s/ -[LR][^ ]*//g'` - if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then - for i in $predeps $postdeps ; do + if test yes = "$allow_libtool_libs_with_static_runtimes"; then + for i in $predeps $postdeps; do # can't use Xsed below, because $i might contain '/' - tmp_deplibs=`$ECHO " $tmp_deplibs" | $SED "s,$i,,"` + tmp_deplibs=`$ECHO " $tmp_deplibs" | $SED "s|$i||"` done fi case $tmp_deplibs in *[!\ \ ]*) echo - if test "X$deplibs_check_method" = "Xnone"; then + if test none = "$deplibs_check_method"; then echo "*** Warning: inter-library dependencies are not supported in this platform." else echo "*** Warning: inter-library dependencies are not known to be supported." @@ -7947,8 +9439,8 @@ EOF ;; esac - if test "$droppeddeps" = yes; then - if test "$module" = yes; then + if test yes = "$droppeddeps"; then + if test yes = "$module"; then echo echo "*** Warning: libtool could not satisfy all declared inter-library" $ECHO "*** dependencies of module $libname. Therefore, libtool will create" @@ -7957,12 +9449,12 @@ EOF if test -z "$global_symbol_pipe"; then echo echo "*** However, this would only work if libtool was able to extract symbol" - echo "*** lists from a program, using \`nm' or equivalent, but libtool could" + echo "*** lists from a program, using 'nm' or equivalent, but libtool could" echo "*** not find such a program. So, this module is probably useless." - echo "*** \`nm' from GNU binutils and a full rebuild may help." + echo "*** 'nm' from GNU binutils and a full rebuild may help." fi - if test "$build_old_libs" = no; then - oldlibs="$output_objdir/$libname.$libext" + if test no = "$build_old_libs"; then + oldlibs=$output_objdir/$libname.$libext build_libtool_libs=module build_old_libs=yes else @@ -7973,14 +9465,14 @@ EOF echo "*** automatically added whenever a program is linked with this library" echo "*** or is declared to -dlopen it." - if test "$allow_undefined" = no; then + if test no = "$allow_undefined"; then echo echo "*** Since this library must not contain undefined symbols," echo "*** because either the platform does not support them or" echo "*** it was explicitly requested with -no-undefined," echo "*** libtool will only create a static version of it." - if test "$build_old_libs" = no; then - oldlibs="$output_objdir/$libname.$libext" + if test no = "$build_old_libs"; then + oldlibs=$output_objdir/$libname.$libext build_libtool_libs=module build_old_libs=yes else @@ -8026,7 +9518,7 @@ EOF *) func_append new_libs " $deplib" ;; esac done - deplibs="$new_libs" + deplibs=$new_libs # All the library-specific variables (install_libdir is set above). library_names= @@ -8034,25 +9526,25 @@ EOF dlname= # Test again, we may have decided not to build it any more - if test "$build_libtool_libs" = yes; then - # Remove ${wl} instances when linking with ld. + if test yes = "$build_libtool_libs"; then + # Remove $wl instances when linking with ld. # FIXME: should test the right _cmds variable. case $archive_cmds in *\$LD\ *) wl= ;; esac - if test "$hardcode_into_libs" = yes; then + if test yes = "$hardcode_into_libs"; then # Hardcode the library paths hardcode_libdirs= dep_rpath= - rpath="$finalize_rpath" - test "$opt_mode" != relink && rpath="$compile_rpath$rpath" + rpath=$finalize_rpath + test relink = "$opt_mode" || rpath=$compile_rpath$rpath for libdir in $rpath; do if test -n "$hardcode_libdir_flag_spec"; then if test -n "$hardcode_libdir_separator"; then func_replace_sysroot "$libdir" libdir=$func_replace_sysroot_result if test -z "$hardcode_libdirs"; then - hardcode_libdirs="$libdir" + hardcode_libdirs=$libdir else # Just accumulate the unique libdirs. case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in @@ -8077,7 +9569,7 @@ EOF # Substitute the hardcoded libdirs into the rpath. if test -n "$hardcode_libdir_separator" && test -n "$hardcode_libdirs"; then - libdir="$hardcode_libdirs" + libdir=$hardcode_libdirs eval "dep_rpath=\"$hardcode_libdir_flag_spec\"" fi if test -n "$runpath_var" && test -n "$perm_rpath"; then @@ -8091,8 +9583,8 @@ EOF test -n "$dep_rpath" && deplibs="$dep_rpath $deplibs" fi - shlibpath="$finalize_shlibpath" - test "$opt_mode" != relink && shlibpath="$compile_shlibpath$shlibpath" + shlibpath=$finalize_shlibpath + test relink = "$opt_mode" || shlibpath=$compile_shlibpath$shlibpath if test -n "$shlibpath"; then eval "$shlibpath_var='$shlibpath\$$shlibpath_var'; export $shlibpath_var" fi @@ -8102,19 +9594,19 @@ EOF eval library_names=\"$library_names_spec\" set dummy $library_names shift - realname="$1" + realname=$1 shift if test -n "$soname_spec"; then eval soname=\"$soname_spec\" else - soname="$realname" + soname=$realname fi if test -z "$dlname"; then dlname=$soname fi - lib="$output_objdir/$realname" + lib=$output_objdir/$realname linknames= for link do @@ -8128,7 +9620,7 @@ EOF delfiles= if test -n "$export_symbols" && test -n "$include_expsyms"; then $opt_dry_run || cp "$export_symbols" "$output_objdir/$libname.uexp" - export_symbols="$output_objdir/$libname.uexp" + export_symbols=$output_objdir/$libname.uexp func_append delfiles " $export_symbols" fi @@ -8137,31 +9629,31 @@ EOF cygwin* | mingw* | cegcc*) if test -n "$export_symbols" && test -z "$export_symbols_regex"; then # exporting using user supplied symfile - if test "x`$SED 1q $export_symbols`" != xEXPORTS; then + func_dll_def_p "$export_symbols" || { # and it's NOT already a .def file. Must figure out # which of the given symbols are data symbols and tag # them as such. So, trigger use of export_symbols_cmds. # export_symbols gets reassigned inside the "prepare # the list of exported symbols" if statement, so the # include_expsyms logic still works. - orig_export_symbols="$export_symbols" + orig_export_symbols=$export_symbols export_symbols= always_export_symbols=yes - fi + } fi ;; esac # Prepare the list of exported symbols if test -z "$export_symbols"; then - if test "$always_export_symbols" = yes || test -n "$export_symbols_regex"; then - func_verbose "generating symbol list for \`$libname.la'" - export_symbols="$output_objdir/$libname.exp" + if test yes = "$always_export_symbols" || test -n "$export_symbols_regex"; then + func_verbose "generating symbol list for '$libname.la'" + export_symbols=$output_objdir/$libname.exp $opt_dry_run || $RM $export_symbols cmds=$export_symbols_cmds - save_ifs="$IFS"; IFS='~' + save_ifs=$IFS; IFS='~' for cmd1 in $cmds; do - IFS="$save_ifs" + IFS=$save_ifs # Take the normal branch if the nm_file_list_spec branch # doesn't work or if tool conversion is not needed. case $nm_file_list_spec~$to_tool_file_cmd in @@ -8175,7 +9667,7 @@ EOF try_normal_branch=no ;; esac - if test "$try_normal_branch" = yes \ + if test yes = "$try_normal_branch" \ && { test "$len" -lt "$max_cmd_len" \ || test "$max_cmd_len" -le -1; } then @@ -8186,7 +9678,7 @@ EOF output_la=$func_basename_result save_libobjs=$libobjs save_output=$output - output=${output_objdir}/${output_la}.nm + output=$output_objdir/$output_la.nm func_to_tool_file "$output" libobjs=$nm_file_list_spec$func_to_tool_file_result func_append delfiles " $output" @@ -8209,8 +9701,8 @@ EOF break fi done - IFS="$save_ifs" - if test -n "$export_symbols_regex" && test "X$skipped_export" != "X:"; then + IFS=$save_ifs + if test -n "$export_symbols_regex" && test : != "$skipped_export"; then func_show_eval '$EGREP -e "$export_symbols_regex" "$export_symbols" > "${export_symbols}T"' func_show_eval '$MV "${export_symbols}T" "$export_symbols"' fi @@ -8218,16 +9710,16 @@ EOF fi if test -n "$export_symbols" && test -n "$include_expsyms"; then - tmp_export_symbols="$export_symbols" - test -n "$orig_export_symbols" && tmp_export_symbols="$orig_export_symbols" + tmp_export_symbols=$export_symbols + test -n "$orig_export_symbols" && tmp_export_symbols=$orig_export_symbols $opt_dry_run || eval '$ECHO "$include_expsyms" | $SP2NL >> "$tmp_export_symbols"' fi - if test "X$skipped_export" != "X:" && test -n "$orig_export_symbols"; then + if test : != "$skipped_export" && test -n "$orig_export_symbols"; then # The given exports_symbols file has to be filtered, so filter it. - func_verbose "filter symbol list for \`$libname.la' to tag DATA exports" + func_verbose "filter symbol list for '$libname.la' to tag DATA exports" # FIXME: $output_objdir/$libname.filter potentially contains lots of - # 's' commands which not all seds can handle. GNU sed should be fine + # 's' commands, which not all seds can handle. GNU sed should be fine # though. Also, the filter scales superlinearly with the number of # global variables. join(1) would be nice here, but unfortunately # isn't a blessed tool. @@ -8246,11 +9738,11 @@ EOF ;; esac done - deplibs="$tmp_deplibs" + deplibs=$tmp_deplibs if test -n "$convenience"; then if test -n "$whole_archive_flag_spec" && - test "$compiler_needs_object" = yes && + test yes = "$compiler_needs_object" && test -z "$libobjs"; then # extract the archives, so we have objects to list. # TODO: could optimize this to just extract one archive. @@ -8261,7 +9753,7 @@ EOF eval libobjs=\"\$libobjs $whole_archive_flag_spec\" test "X$libobjs" = "X " && libobjs= else - gentop="$output_objdir/${outputname}x" + gentop=$output_objdir/${outputname}x func_append generated " $gentop" func_extract_archives $gentop $convenience @@ -8270,18 +9762,18 @@ EOF fi fi - if test "$thread_safe" = yes && test -n "$thread_safe_flag_spec"; then + if test yes = "$thread_safe" && test -n "$thread_safe_flag_spec"; then eval flag=\"$thread_safe_flag_spec\" func_append linker_flags " $flag" fi # Make a backup of the uninstalled library when relinking - if test "$opt_mode" = relink; then + if test relink = "$opt_mode"; then $opt_dry_run || eval '(cd $output_objdir && $RM ${realname}U && $MV $realname ${realname}U)' || exit $? fi # Do each of the archive commands. - if test "$module" = yes && test -n "$module_cmds" ; then + if test yes = "$module" && test -n "$module_cmds"; then if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then eval test_cmds=\"$module_expsym_cmds\" cmds=$module_expsym_cmds @@ -8299,7 +9791,7 @@ EOF fi fi - if test "X$skipped_export" != "X:" && + if test : != "$skipped_export" && func_len " $test_cmds" && len=$func_len_result && test "$len" -lt "$max_cmd_len" || test "$max_cmd_len" -le -1; then @@ -8332,8 +9824,8 @@ EOF last_robj= k=1 - if test -n "$save_libobjs" && test "X$skipped_export" != "X:" && test "$with_gnu_ld" = yes; then - output=${output_objdir}/${output_la}.lnkscript + if test -n "$save_libobjs" && test : != "$skipped_export" && test yes = "$with_gnu_ld"; then + output=$output_objdir/$output_la.lnkscript func_verbose "creating GNU ld script: $output" echo 'INPUT (' > $output for obj in $save_libobjs @@ -8345,14 +9837,14 @@ EOF func_append delfiles " $output" func_to_tool_file "$output" output=$func_to_tool_file_result - elif test -n "$save_libobjs" && test "X$skipped_export" != "X:" && test "X$file_list_spec" != X; then - output=${output_objdir}/${output_la}.lnk + elif test -n "$save_libobjs" && test : != "$skipped_export" && test -n "$file_list_spec"; then + output=$output_objdir/$output_la.lnk func_verbose "creating linker input file list: $output" : > $output set x $save_libobjs shift firstobj= - if test "$compiler_needs_object" = yes; then + if test yes = "$compiler_needs_object"; then firstobj="$1 " shift fi @@ -8367,7 +9859,7 @@ EOF else if test -n "$save_libobjs"; then func_verbose "creating reloadable object files..." - output=$output_objdir/$output_la-${k}.$objext + output=$output_objdir/$output_la-$k.$objext eval test_cmds=\"$reload_cmds\" func_len " $test_cmds" len0=$func_len_result @@ -8379,13 +9871,13 @@ EOF func_len " $obj" func_arith $len + $func_len_result len=$func_arith_result - if test "X$objlist" = X || + if test -z "$objlist" || test "$len" -lt "$max_cmd_len"; then func_append objlist " $obj" else # The command $test_cmds is almost too long, add a # command to the queue. - if test "$k" -eq 1 ; then + if test 1 -eq "$k"; then # The first file doesn't have a previous command to add. reload_objs=$objlist eval concat_cmds=\"$reload_cmds\" @@ -8395,10 +9887,10 @@ EOF reload_objs="$objlist $last_robj" eval concat_cmds=\"\$concat_cmds~$reload_cmds~\$RM $last_robj\" fi - last_robj=$output_objdir/$output_la-${k}.$objext + last_robj=$output_objdir/$output_la-$k.$objext func_arith $k + 1 k=$func_arith_result - output=$output_objdir/$output_la-${k}.$objext + output=$output_objdir/$output_la-$k.$objext objlist=" $obj" func_len " $last_robj" func_arith $len0 + $func_len_result @@ -8410,9 +9902,9 @@ EOF # files will link in the last one created. test -z "$concat_cmds" || concat_cmds=$concat_cmds~ reload_objs="$objlist $last_robj" - eval concat_cmds=\"\${concat_cmds}$reload_cmds\" + eval concat_cmds=\"\$concat_cmds$reload_cmds\" if test -n "$last_robj"; then - eval concat_cmds=\"\${concat_cmds}~\$RM $last_robj\" + eval concat_cmds=\"\$concat_cmds~\$RM $last_robj\" fi func_append delfiles " $output" @@ -8420,9 +9912,9 @@ EOF output= fi - if ${skipped_export-false}; then - func_verbose "generating symbol list for \`$libname.la'" - export_symbols="$output_objdir/$libname.exp" + ${skipped_export-false} && { + func_verbose "generating symbol list for '$libname.la'" + export_symbols=$output_objdir/$libname.exp $opt_dry_run || $RM $export_symbols libobjs=$output # Append the command to create the export file. @@ -8431,16 +9923,16 @@ EOF if test -n "$last_robj"; then eval concat_cmds=\"\$concat_cmds~\$RM $last_robj\" fi - fi + } test -n "$save_libobjs" && func_verbose "creating a temporary reloadable object file: $output" # Loop through the commands generated above and execute them. - save_ifs="$IFS"; IFS='~' + save_ifs=$IFS; IFS='~' for cmd in $concat_cmds; do - IFS="$save_ifs" - $opt_silent || { + IFS=$save_ifs + $opt_quiet || { func_quote_for_expand "$cmd" eval "func_echo $func_quote_for_expand_result" } @@ -8448,7 +9940,7 @@ EOF lt_exit=$? # Restore the uninstalled library and exit - if test "$opt_mode" = relink; then + if test relink = "$opt_mode"; then ( cd "$output_objdir" && \ $RM "${realname}T" && \ $MV "${realname}U" "$realname" ) @@ -8457,7 +9949,7 @@ EOF exit $lt_exit } done - IFS="$save_ifs" + IFS=$save_ifs if test -n "$export_symbols_regex" && ${skipped_export-false}; then func_show_eval '$EGREP -e "$export_symbols_regex" "$export_symbols" > "${export_symbols}T"' @@ -8465,18 +9957,18 @@ EOF fi fi - if ${skipped_export-false}; then + ${skipped_export-false} && { if test -n "$export_symbols" && test -n "$include_expsyms"; then - tmp_export_symbols="$export_symbols" - test -n "$orig_export_symbols" && tmp_export_symbols="$orig_export_symbols" + tmp_export_symbols=$export_symbols + test -n "$orig_export_symbols" && tmp_export_symbols=$orig_export_symbols $opt_dry_run || eval '$ECHO "$include_expsyms" | $SP2NL >> "$tmp_export_symbols"' fi if test -n "$orig_export_symbols"; then # The given exports_symbols file has to be filtered, so filter it. - func_verbose "filter symbol list for \`$libname.la' to tag DATA exports" + func_verbose "filter symbol list for '$libname.la' to tag DATA exports" # FIXME: $output_objdir/$libname.filter potentially contains lots of - # 's' commands which not all seds can handle. GNU sed should be fine + # 's' commands, which not all seds can handle. GNU sed should be fine # though. Also, the filter scales superlinearly with the number of # global variables. join(1) would be nice here, but unfortunately # isn't a blessed tool. @@ -8485,7 +9977,7 @@ EOF export_symbols=$output_objdir/$libname.def $opt_dry_run || $SED -f $output_objdir/$libname.filter < $orig_export_symbols > $export_symbols fi - fi + } libobjs=$output # Restore the value of output. @@ -8499,7 +9991,7 @@ EOF # value of $libobjs for piecewise linking. # Do each of the archive commands. - if test "$module" = yes && test -n "$module_cmds" ; then + if test yes = "$module" && test -n "$module_cmds"; then if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then cmds=$module_expsym_cmds else @@ -8521,7 +10013,7 @@ EOF # Add any objects from preloaded convenience libraries if test -n "$dlprefiles"; then - gentop="$output_objdir/${outputname}x" + gentop=$output_objdir/${outputname}x func_append generated " $gentop" func_extract_archives $gentop $dlprefiles @@ -8529,11 +10021,12 @@ EOF test "X$libobjs" = "X " && libobjs= fi - save_ifs="$IFS"; IFS='~' + save_ifs=$IFS; IFS='~' for cmd in $cmds; do - IFS="$save_ifs" + IFS=$sp$nl eval cmd=\"$cmd\" - $opt_silent || { + IFS=$save_ifs + $opt_quiet || { func_quote_for_expand "$cmd" eval "func_echo $func_quote_for_expand_result" } @@ -8541,7 +10034,7 @@ EOF lt_exit=$? # Restore the uninstalled library and exit - if test "$opt_mode" = relink; then + if test relink = "$opt_mode"; then ( cd "$output_objdir" && \ $RM "${realname}T" && \ $MV "${realname}U" "$realname" ) @@ -8550,10 +10043,10 @@ EOF exit $lt_exit } done - IFS="$save_ifs" + IFS=$save_ifs # Restore the uninstalled library and exit - if test "$opt_mode" = relink; then + if test relink = "$opt_mode"; then $opt_dry_run || eval '(cd $output_objdir && $RM ${realname}T && $MV $realname ${realname}T && $MV ${realname}U $realname)' || exit $? if test -n "$convenience"; then @@ -8573,39 +10066,39 @@ EOF done # If -module or -export-dynamic was specified, set the dlname. - if test "$module" = yes || test "$export_dynamic" = yes; then + if test yes = "$module" || test yes = "$export_dynamic"; then # On all known operating systems, these are identical. - dlname="$soname" + dlname=$soname fi fi ;; obj) - if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then - func_warning "\`-dlopen' is ignored for objects" + if test -n "$dlfiles$dlprefiles" || test no != "$dlself"; then + func_warning "'-dlopen' is ignored for objects" fi case " $deplibs" in *\ -l* | *\ -L*) - func_warning "\`-l' and \`-L' are ignored for objects" ;; + func_warning "'-l' and '-L' are ignored for objects" ;; esac test -n "$rpath" && \ - func_warning "\`-rpath' is ignored for objects" + func_warning "'-rpath' is ignored for objects" test -n "$xrpath" && \ - func_warning "\`-R' is ignored for objects" + func_warning "'-R' is ignored for objects" test -n "$vinfo" && \ - func_warning "\`-version-info' is ignored for objects" + func_warning "'-version-info' is ignored for objects" test -n "$release" && \ - func_warning "\`-release' is ignored for objects" + func_warning "'-release' is ignored for objects" case $output in *.lo) test -n "$objs$old_deplibs" && \ - func_fatal_error "cannot build library object \`$output' from non-libtool objects" + func_fatal_error "cannot build library object '$output' from non-libtool objects" libobj=$output func_lo2o "$libobj" @@ -8613,7 +10106,7 @@ EOF ;; *) libobj= - obj="$output" + obj=$output ;; esac @@ -8626,17 +10119,19 @@ EOF # the extraction. reload_conv_objs= gentop= - # reload_cmds runs $LD directly, so let us get rid of - # -Wl from whole_archive_flag_spec and hope we can get by with - # turning comma into space.. - wl= - + # if reload_cmds runs $LD directly, get rid of -Wl from + # whole_archive_flag_spec and hope we can get by with turning comma + # into space. + case $reload_cmds in + *\$LD[\ \$]*) wl= ;; + esac if test -n "$convenience"; then if test -n "$whole_archive_flag_spec"; then eval tmp_whole_archive_flags=\"$whole_archive_flag_spec\" - reload_conv_objs=$reload_objs\ `$ECHO "$tmp_whole_archive_flags" | $SED 's|,| |g'` + test -n "$wl" || tmp_whole_archive_flags=`$ECHO "$tmp_whole_archive_flags" | $SED 's|,| |g'` + reload_conv_objs=$reload_objs\ $tmp_whole_archive_flags else - gentop="$output_objdir/${obj}x" + gentop=$output_objdir/${obj}x func_append generated " $gentop" func_extract_archives $gentop $convenience @@ -8645,12 +10140,12 @@ EOF fi # If we're not building shared, we need to use non_pic_objs - test "$build_libtool_libs" != yes && libobjs="$non_pic_objects" + test yes = "$build_libtool_libs" || libobjs=$non_pic_objects # Create the old-style object. - reload_objs="$objs$old_deplibs "`$ECHO "$libobjs" | $SP2NL | $SED "/\.${libext}$/d; /\.lib$/d; $lo2o" | $NL2SP`" $reload_conv_objs" ### testsuite: skip nested quoting test + reload_objs=$objs$old_deplibs' '`$ECHO "$libobjs" | $SP2NL | $SED "/\.$libext$/d; /\.lib$/d; $lo2o" | $NL2SP`' '$reload_conv_objs - output="$obj" + output=$obj func_execute_cmds "$reload_cmds" 'exit $?' # Exit if we aren't doing a library object file. @@ -8662,7 +10157,7 @@ EOF exit $EXIT_SUCCESS fi - if test "$build_libtool_libs" != yes; then + test yes = "$build_libtool_libs" || { if test -n "$gentop"; then func_show_eval '${RM}r "$gentop"' fi @@ -8672,12 +10167,12 @@ EOF # $show "echo timestamp > $libobj" # $opt_dry_run || eval "echo timestamp > $libobj" || exit $? exit $EXIT_SUCCESS - fi + } - if test -n "$pic_flag" || test "$pic_mode" != default; then + if test -n "$pic_flag" || test default != "$pic_mode"; then # Only do commands if we really have different PIC objects. reload_objs="$libobjs $reload_conv_objs" - output="$libobj" + output=$libobj func_execute_cmds "$reload_cmds" 'exit $?' fi @@ -8694,16 +10189,14 @@ EOF output=$func_stripname_result.exe;; esac test -n "$vinfo" && \ - func_warning "\`-version-info' is ignored for programs" + func_warning "'-version-info' is ignored for programs" test -n "$release" && \ - func_warning "\`-release' is ignored for programs" + func_warning "'-release' is ignored for programs" - test "$preload" = yes \ - && test "$dlopen_support" = unknown \ - && test "$dlopen_self" = unknown \ - && test "$dlopen_self_static" = unknown && \ - func_warning "\`LT_INIT([dlopen])' not used. Assuming no dlopen support." + $preload \ + && test unknown,unknown,unknown = "$dlopen_support,$dlopen_self,$dlopen_self_static" \ + && func_warning "'LT_INIT([dlopen])' not used. Assuming no dlopen support." case $host in *-*-rhapsody* | *-*-darwin1.[012]) @@ -8717,11 +10210,11 @@ EOF *-*-darwin*) # Don't allow lazy linking, it breaks C++ global constructors # But is supposedly fixed on 10.4 or later (yay!). - if test "$tagname" = CXX ; then + if test CXX = "$tagname"; then case ${MACOSX_DEPLOYMENT_TARGET-10.0} in 10.[0123]) - func_append compile_command " ${wl}-bind_at_load" - func_append finalize_command " ${wl}-bind_at_load" + func_append compile_command " $wl-bind_at_load" + func_append finalize_command " $wl-bind_at_load" ;; esac fi @@ -8757,7 +10250,7 @@ EOF *) func_append new_libs " $deplib" ;; esac done - compile_deplibs="$new_libs" + compile_deplibs=$new_libs func_append compile_command " $compile_deplibs" @@ -8781,7 +10274,7 @@ EOF if test -n "$hardcode_libdir_flag_spec"; then if test -n "$hardcode_libdir_separator"; then if test -z "$hardcode_libdirs"; then - hardcode_libdirs="$libdir" + hardcode_libdirs=$libdir else # Just accumulate the unique libdirs. case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in @@ -8804,7 +10297,7 @@ EOF fi case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*) - testbindir=`${ECHO} "$libdir" | ${SED} -e 's*/lib$*/bin*'` + testbindir=`$ECHO "$libdir" | $SED -e 's*/lib$*/bin*'` case :$dllsearchpath: in *":$libdir:"*) ;; ::) dllsearchpath=$libdir;; @@ -8821,10 +10314,10 @@ EOF # Substitute the hardcoded libdirs into the rpath. if test -n "$hardcode_libdir_separator" && test -n "$hardcode_libdirs"; then - libdir="$hardcode_libdirs" + libdir=$hardcode_libdirs eval rpath=\" $hardcode_libdir_flag_spec\" fi - compile_rpath="$rpath" + compile_rpath=$rpath rpath= hardcode_libdirs= @@ -8832,7 +10325,7 @@ EOF if test -n "$hardcode_libdir_flag_spec"; then if test -n "$hardcode_libdir_separator"; then if test -z "$hardcode_libdirs"; then - hardcode_libdirs="$libdir" + hardcode_libdirs=$libdir else # Just accumulate the unique libdirs. case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in @@ -8857,45 +10350,43 @@ EOF # Substitute the hardcoded libdirs into the rpath. if test -n "$hardcode_libdir_separator" && test -n "$hardcode_libdirs"; then - libdir="$hardcode_libdirs" + libdir=$hardcode_libdirs eval rpath=\" $hardcode_libdir_flag_spec\" fi - finalize_rpath="$rpath" + finalize_rpath=$rpath - if test -n "$libobjs" && test "$build_old_libs" = yes; then + if test -n "$libobjs" && test yes = "$build_old_libs"; then # Transform all the library objects into standard objects. compile_command=`$ECHO "$compile_command" | $SP2NL | $SED "$lo2o" | $NL2SP` finalize_command=`$ECHO "$finalize_command" | $SP2NL | $SED "$lo2o" | $NL2SP` fi - func_generate_dlsyms "$outputname" "@PROGRAM@" "no" + func_generate_dlsyms "$outputname" "@PROGRAM@" false # template prelinking step if test -n "$prelink_cmds"; then func_execute_cmds "$prelink_cmds" 'exit $?' fi - wrappers_required=yes + wrappers_required=: case $host in *cegcc* | *mingw32ce*) # Disable wrappers for cegcc and mingw32ce hosts, we are cross compiling anyway. - wrappers_required=no + wrappers_required=false ;; *cygwin* | *mingw* ) - if test "$build_libtool_libs" != yes; then - wrappers_required=no - fi + test yes = "$build_libtool_libs" || wrappers_required=false ;; *) - if test "$need_relink" = no || test "$build_libtool_libs" != yes; then - wrappers_required=no + if test no = "$need_relink" || test yes != "$build_libtool_libs"; then + wrappers_required=false fi ;; esac - if test "$wrappers_required" = no; then + $wrappers_required || { # Replace the output file specification. compile_command=`$ECHO "$compile_command" | $SED 's%@OUTPUT@%'"$output"'%g'` - link_command="$compile_command$compile_rpath" + link_command=$compile_command$compile_rpath # We have no uninstalled library dependencies, so finalize right now. exit_status=0 @@ -8908,12 +10399,12 @@ EOF fi # Delete the generated files. - if test -f "$output_objdir/${outputname}S.${objext}"; then - func_show_eval '$RM "$output_objdir/${outputname}S.${objext}"' + if test -f "$output_objdir/${outputname}S.$objext"; then + func_show_eval '$RM "$output_objdir/${outputname}S.$objext"' fi exit $exit_status - fi + } if test -n "$compile_shlibpath$finalize_shlibpath"; then compile_command="$shlibpath_var=\"$compile_shlibpath$finalize_shlibpath\$$shlibpath_var\" $compile_command" @@ -8943,9 +10434,9 @@ EOF fi fi - if test "$no_install" = yes; then + if test yes = "$no_install"; then # We don't need to create a wrapper script. - link_command="$compile_var$compile_command$compile_rpath" + link_command=$compile_var$compile_command$compile_rpath # Replace the output file specification. link_command=`$ECHO "$link_command" | $SED 's%@OUTPUT@%'"$output"'%g'` # Delete the old output file. @@ -8962,27 +10453,28 @@ EOF exit $EXIT_SUCCESS fi - if test "$hardcode_action" = relink; then - # Fast installation is not supported - link_command="$compile_var$compile_command$compile_rpath" - relink_command="$finalize_var$finalize_command$finalize_rpath" + case $hardcode_action,$fast_install in + relink,*) + # Fast installation is not supported + link_command=$compile_var$compile_command$compile_rpath + relink_command=$finalize_var$finalize_command$finalize_rpath - func_warning "this platform does not like uninstalled shared libraries" - func_warning "\`$output' will be relinked during installation" - else - if test "$fast_install" != no; then - link_command="$finalize_var$compile_command$finalize_rpath" - if test "$fast_install" = yes; then - relink_command=`$ECHO "$compile_var$compile_command$compile_rpath" | $SED 's%@OUTPUT@%\$progdir/\$file%g'` - else - # fast_install is set to needless - relink_command= - fi - else - link_command="$compile_var$compile_command$compile_rpath" - relink_command="$finalize_var$finalize_command$finalize_rpath" - fi - fi + func_warning "this platform does not like uninstalled shared libraries" + func_warning "'$output' will be relinked during installation" + ;; + *,yes) + link_command=$finalize_var$compile_command$finalize_rpath + relink_command=`$ECHO "$compile_var$compile_command$compile_rpath" | $SED 's%@OUTPUT@%\$progdir/\$file%g'` + ;; + *,no) + link_command=$compile_var$compile_command$compile_rpath + relink_command=$finalize_var$finalize_command$finalize_rpath + ;; + *,needless) + link_command=$finalize_var$compile_command$finalize_rpath + relink_command= + ;; + esac # Replace the output file specification. link_command=`$ECHO "$link_command" | $SED 's%@OUTPUT@%'"$output_objdir/$outputname"'%g'` @@ -9039,8 +10531,8 @@ EOF func_dirname_and_basename "$output" "" "." output_name=$func_basename_result output_path=$func_dirname_result - cwrappersource="$output_path/$objdir/lt-$output_name.c" - cwrapper="$output_path/$output_name.exe" + cwrappersource=$output_path/$objdir/lt-$output_name.c + cwrapper=$output_path/$output_name.exe $RM $cwrappersource $cwrapper trap "$RM $cwrappersource $cwrapper; exit $EXIT_FAILURE" 1 2 15 @@ -9061,7 +10553,7 @@ EOF trap "$RM $func_ltwrapper_scriptname_result; exit $EXIT_FAILURE" 1 2 15 $opt_dry_run || { # note: this script will not be executed, so do not chmod. - if test "x$build" = "x$host" ; then + if test "x$build" = "x$host"; then $cwrapper --lt-dump-script > $func_ltwrapper_scriptname_result else func_emit_wrapper no > $func_ltwrapper_scriptname_result @@ -9084,25 +10576,27 @@ EOF # See if we need to build an old-fashioned archive. for oldlib in $oldlibs; do - if test "$build_libtool_libs" = convenience; then - oldobjs="$libobjs_save $symfileobj" - addlibs="$convenience" - build_libtool_libs=no - else - if test "$build_libtool_libs" = module; then - oldobjs="$libobjs_save" + case $build_libtool_libs in + convenience) + oldobjs="$libobjs_save $symfileobj" + addlibs=$convenience build_libtool_libs=no - else + ;; + module) + oldobjs=$libobjs_save + addlibs=$old_convenience + build_libtool_libs=no + ;; + *) oldobjs="$old_deplibs $non_pic_objects" - if test "$preload" = yes && test -f "$symfileobj"; then - func_append oldobjs " $symfileobj" - fi - fi - addlibs="$old_convenience" - fi + $preload && test -f "$symfileobj" \ + && func_append oldobjs " $symfileobj" + addlibs=$old_convenience + ;; + esac if test -n "$addlibs"; then - gentop="$output_objdir/${outputname}x" + gentop=$output_objdir/${outputname}x func_append generated " $gentop" func_extract_archives $gentop $addlibs @@ -9110,13 +10604,13 @@ EOF fi # Do each command in the archive commands. - if test -n "$old_archive_from_new_cmds" && test "$build_libtool_libs" = yes; then + if test -n "$old_archive_from_new_cmds" && test yes = "$build_libtool_libs"; then cmds=$old_archive_from_new_cmds else # Add any objects from preloaded convenience libraries if test -n "$dlprefiles"; then - gentop="$output_objdir/${outputname}x" + gentop=$output_objdir/${outputname}x func_append generated " $gentop" func_extract_archives $gentop $dlprefiles @@ -9137,7 +10631,7 @@ EOF : else echo "copying selected object files to avoid basename conflicts..." - gentop="$output_objdir/${outputname}x" + gentop=$output_objdir/${outputname}x func_append generated " $gentop" func_mkdir_p "$gentop" save_oldobjs=$oldobjs @@ -9146,7 +10640,7 @@ EOF for obj in $save_oldobjs do func_basename "$obj" - objbase="$func_basename_result" + objbase=$func_basename_result case " $oldobjs " in " ") oldobjs=$obj ;; *[\ /]"$objbase "*) @@ -9215,18 +10709,18 @@ EOF else # the above command should be used before it gets too long oldobjs=$objlist - if test "$obj" = "$last_oldobj" ; then + if test "$obj" = "$last_oldobj"; then RANLIB=$save_RANLIB fi test -z "$concat_cmds" || concat_cmds=$concat_cmds~ - eval concat_cmds=\"\${concat_cmds}$old_archive_cmds\" + eval concat_cmds=\"\$concat_cmds$old_archive_cmds\" objlist= len=$len0 fi done RANLIB=$save_RANLIB oldobjs=$objlist - if test "X$oldobjs" = "X" ; then + if test -z "$oldobjs"; then eval cmds=\"\$concat_cmds\" else eval cmds=\"\$concat_cmds~\$old_archive_cmds\" @@ -9243,7 +10737,7 @@ EOF case $output in *.la) old_library= - test "$build_old_libs" = yes && old_library="$libname.$libext" + test yes = "$build_old_libs" && old_library=$libname.$libext func_verbose "creating $output" # Preserve any variables that may affect compiler behavior @@ -9258,31 +10752,31 @@ EOF fi done # Quote the link command for shipping. - relink_command="(cd `pwd`; $SHELL $progpath $preserve_args --mode=relink $libtool_args @inst_prefix_dir@)" + relink_command="(cd `pwd`; $SHELL \"$progpath\" $preserve_args --mode=relink $libtool_args @inst_prefix_dir@)" relink_command=`$ECHO "$relink_command" | $SED "$sed_quote_subst"` - if test "$hardcode_automatic" = yes ; then + if test yes = "$hardcode_automatic"; then relink_command= fi # Only create the output if not a dry run. $opt_dry_run || { for installed in no yes; do - if test "$installed" = yes; then + if test yes = "$installed"; then if test -z "$install_libdir"; then break fi - output="$output_objdir/$outputname"i + output=$output_objdir/${outputname}i # Replace all uninstalled libtool libraries with the installed ones newdependency_libs= for deplib in $dependency_libs; do case $deplib in *.la) func_basename "$deplib" - name="$func_basename_result" + name=$func_basename_result func_resolve_sysroot "$deplib" - eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $func_resolve_sysroot_result` + eval libdir=`$SED -n -e 's/^libdir=\(.*\)$/\1/p' $func_resolve_sysroot_result` test -z "$libdir" && \ - func_fatal_error "\`$deplib' is not a valid libtool archive" + func_fatal_error "'$deplib' is not a valid libtool archive" func_append newdependency_libs " ${lt_sysroot:+=}$libdir/$name" ;; -L*) @@ -9298,23 +10792,23 @@ EOF *) func_append newdependency_libs " $deplib" ;; esac done - dependency_libs="$newdependency_libs" + dependency_libs=$newdependency_libs newdlfiles= for lib in $dlfiles; do case $lib in *.la) func_basename "$lib" - name="$func_basename_result" - eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib` + name=$func_basename_result + eval libdir=`$SED -n -e 's/^libdir=\(.*\)$/\1/p' $lib` test -z "$libdir" && \ - func_fatal_error "\`$lib' is not a valid libtool archive" + func_fatal_error "'$lib' is not a valid libtool archive" func_append newdlfiles " ${lt_sysroot:+=}$libdir/$name" ;; *) func_append newdlfiles " $lib" ;; esac done - dlfiles="$newdlfiles" + dlfiles=$newdlfiles newdlprefiles= for lib in $dlprefiles; do case $lib in @@ -9324,34 +10818,34 @@ EOF # didn't already link the preopened objects directly into # the library: func_basename "$lib" - name="$func_basename_result" - eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib` + name=$func_basename_result + eval libdir=`$SED -n -e 's/^libdir=\(.*\)$/\1/p' $lib` test -z "$libdir" && \ - func_fatal_error "\`$lib' is not a valid libtool archive" + func_fatal_error "'$lib' is not a valid libtool archive" func_append newdlprefiles " ${lt_sysroot:+=}$libdir/$name" ;; esac done - dlprefiles="$newdlprefiles" + dlprefiles=$newdlprefiles else newdlfiles= for lib in $dlfiles; do case $lib in - [\\/]* | [A-Za-z]:[\\/]*) abs="$lib" ;; + [\\/]* | [A-Za-z]:[\\/]*) abs=$lib ;; *) abs=`pwd`"/$lib" ;; esac func_append newdlfiles " $abs" done - dlfiles="$newdlfiles" + dlfiles=$newdlfiles newdlprefiles= for lib in $dlprefiles; do case $lib in - [\\/]* | [A-Za-z]:[\\/]*) abs="$lib" ;; + [\\/]* | [A-Za-z]:[\\/]*) abs=$lib ;; *) abs=`pwd`"/$lib" ;; esac func_append newdlprefiles " $abs" done - dlprefiles="$newdlprefiles" + dlprefiles=$newdlprefiles fi $RM $output # place dlname in correct position for cygwin @@ -9367,10 +10861,9 @@ EOF case $host,$output,$installed,$module,$dlname in *cygwin*,*lai,yes,no,*.dll | *mingw*,*lai,yes,no,*.dll | *cegcc*,*lai,yes,no,*.dll) # If a -bindir argument was supplied, place the dll there. - if test "x$bindir" != x ; - then + if test -n "$bindir"; then func_relative_path "$install_libdir" "$bindir" - tdlname=$func_relative_path_result$dlname + tdlname=$func_relative_path_result/$dlname else # Otherwise fall back on heuristic. tdlname=../bin/$dlname @@ -9379,7 +10872,7 @@ EOF esac $ECHO > $output "\ # $outputname - a libtool library file -# Generated by $PROGRAM (GNU $PACKAGE$TIMESTAMP) $VERSION +# Generated by $PROGRAM (GNU $PACKAGE) $VERSION # # Please DO NOT delete this file! # It is necessary for linking the library. @@ -9393,7 +10886,7 @@ library_names='$library_names' # The name of the static archive. old_library='$old_library' -# Linker flags that can not go in dependency_libs. +# Linker flags that cannot go in dependency_libs. inherited_linker_flags='$new_inherited_linker_flags' # Libraries that this one depends upon. @@ -9419,7 +10912,7 @@ dlpreopen='$dlprefiles' # Directory that this library needs to be installed in: libdir='$install_libdir'" - if test "$installed" = no && test "$need_relink" = yes; then + if test no,yes = "$installed,$need_relink"; then $ECHO >> $output "\ relink_command=\"$relink_command\"" fi @@ -9434,27 +10927,29 @@ relink_command=\"$relink_command\"" exit $EXIT_SUCCESS } -{ test "$opt_mode" = link || test "$opt_mode" = relink; } && - func_mode_link ${1+"$@"} +if test link = "$opt_mode" || test relink = "$opt_mode"; then + func_mode_link ${1+"$@"} +fi # func_mode_uninstall arg... func_mode_uninstall () { - $opt_debug - RM="$nonopt" + $debug_cmd + + RM=$nonopt files= - rmforce= + rmforce=false exit_status=0 # This variable tells wrapper scripts just to set variables rather # than running their programs. - libtool_install_magic="$magic" + libtool_install_magic=$magic for arg do case $arg in - -f) func_append RM " $arg"; rmforce=yes ;; + -f) func_append RM " $arg"; rmforce=: ;; -*) func_append RM " $arg" ;; *) func_append files " $arg" ;; esac @@ -9467,18 +10962,18 @@ func_mode_uninstall () for file in $files; do func_dirname "$file" "" "." - dir="$func_dirname_result" - if test "X$dir" = X.; then - odir="$objdir" + dir=$func_dirname_result + if test . = "$dir"; then + odir=$objdir else - odir="$dir/$objdir" + odir=$dir/$objdir fi func_basename "$file" - name="$func_basename_result" - test "$opt_mode" = uninstall && odir="$dir" + name=$func_basename_result + test uninstall = "$opt_mode" && odir=$dir # Remember odir for removal later, being careful to avoid duplicates - if test "$opt_mode" = clean; then + if test clean = "$opt_mode"; then case " $rmdirs " in *" $odir "*) ;; *) func_append rmdirs " $odir" ;; @@ -9493,11 +10988,11 @@ func_mode_uninstall () elif test -d "$file"; then exit_status=1 continue - elif test "$rmforce" = yes; then + elif $rmforce; then continue fi - rmfiles="$file" + rmfiles=$file case $name in *.la) @@ -9511,7 +11006,7 @@ func_mode_uninstall () done test -n "$old_library" && func_append rmfiles " $odir/$old_library" - case "$opt_mode" in + case $opt_mode in clean) case " $library_names " in *" $dlname "*) ;; @@ -9522,12 +11017,12 @@ func_mode_uninstall () uninstall) if test -n "$library_names"; then # Do each command in the postuninstall commands. - func_execute_cmds "$postuninstall_cmds" 'test "$rmforce" = yes || exit_status=1' + func_execute_cmds "$postuninstall_cmds" '$rmforce || exit_status=1' fi if test -n "$old_library"; then # Do each command in the old_postuninstall commands. - func_execute_cmds "$old_postuninstall_cmds" 'test "$rmforce" = yes || exit_status=1' + func_execute_cmds "$old_postuninstall_cmds" '$rmforce || exit_status=1' fi # FIXME: should reinstall the best remaining shared library. ;; @@ -9543,21 +11038,19 @@ func_mode_uninstall () func_source $dir/$name # Add PIC object to the list of files to remove. - if test -n "$pic_object" && - test "$pic_object" != none; then + if test -n "$pic_object" && test none != "$pic_object"; then func_append rmfiles " $dir/$pic_object" fi # Add non-PIC object to the list of files to remove. - if test -n "$non_pic_object" && - test "$non_pic_object" != none; then + if test -n "$non_pic_object" && test none != "$non_pic_object"; then func_append rmfiles " $dir/$non_pic_object" fi fi ;; *) - if test "$opt_mode" = clean ; then + if test clean = "$opt_mode"; then noexename=$name case $file in *.exe) @@ -9584,12 +11077,12 @@ func_mode_uninstall () # note $name still contains .exe if it was in $file originally # as does the version of $file that was added into $rmfiles - func_append rmfiles " $odir/$name $odir/${name}S.${objext}" - if test "$fast_install" = yes && test -n "$relink_command"; then + func_append rmfiles " $odir/$name $odir/${name}S.$objext" + if test yes = "$fast_install" && test -n "$relink_command"; then func_append rmfiles " $odir/lt-$name" fi - if test "X$noexename" != "X$name" ; then - func_append rmfiles " $odir/lt-${noexename}.c" + if test "X$noexename" != "X$name"; then + func_append rmfiles " $odir/lt-$noexename.c" fi fi fi @@ -9598,7 +11091,7 @@ func_mode_uninstall () func_show_eval "$RM $rmfiles" 'exit_status=1' done - # Try to remove the ${objdir}s in the directories where we deleted files + # Try to remove the $objdir's in the directories where we deleted files for dir in $rmdirs; do if test -d "$dir"; then func_show_eval "rmdir $dir >/dev/null 2>&1" @@ -9608,16 +11101,17 @@ func_mode_uninstall () exit $exit_status } -{ test "$opt_mode" = uninstall || test "$opt_mode" = clean; } && - func_mode_uninstall ${1+"$@"} +if test uninstall = "$opt_mode" || test clean = "$opt_mode"; then + func_mode_uninstall ${1+"$@"} +fi test -z "$opt_mode" && { - help="$generic_help" + help=$generic_help func_fatal_help "you must specify a MODE" } test -z "$exec_cmd" && \ - func_fatal_help "invalid operation mode \`$opt_mode'" + func_fatal_help "invalid operation mode '$opt_mode'" if test -n "$exec_cmd"; then eval exec "$exec_cmd" @@ -9628,7 +11122,7 @@ exit $exit_status # The TAGs below are defined such that we never get into a situation -# in which we disable both kinds of libraries. Given conflicting +# where we disable both kinds of libraries. Given conflicting # choices, we go for a static library, that is the most portable, # since we can't tell whether shared libraries were disabled because # the user asked for that or because the platform doesn't support @@ -9651,5 +11145,3 @@ build_old_libs=`case $build_libtool_libs in yes) echo no;; *) echo yes;; esac` # mode:shell-script # sh-indentation:2 # End: -# vi:sw=2 - diff --git a/m4/libtool.m4 b/m4/libtool.m4 index 56666f0..a644432 100644 --- a/m4/libtool.m4 +++ b/m4/libtool.m4 @@ -1,8 +1,6 @@ # libtool.m4 - Configure libtool for the host system. -*-Autoconf-*- # -# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, -# 2006, 2007, 2008, 2009, 2010, 2011 Free Software -# Foundation, Inc. +# Copyright (C) 1996-2001, 2003-2015 Free Software Foundation, Inc. # Written by Gordon Matzigkeit, 1996 # # This file is free software; the Free Software Foundation gives @@ -10,36 +8,30 @@ # modifications, as long as this notice is preserved. m4_define([_LT_COPYING], [dnl -# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, -# 2006, 2007, 2008, 2009, 2010, 2011 Free Software -# Foundation, Inc. -# Written by Gordon Matzigkeit, 1996 -# -# This file is part of GNU Libtool. -# -# GNU Libtool is free software; you can redistribute it and/or -# modify it under the terms of the GNU General Public License as -# published by the Free Software Foundation; either version 2 of -# the License, or (at your option) any later version. +# Copyright (C) 2014 Free Software Foundation, Inc. +# This is free software; see the source for copying conditions. There is NO +# warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + +# GNU Libtool is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of of the License, or +# (at your option) any later version. # -# As a special exception to the GNU General Public License, -# if you distribute this file as part of a program or library that -# is built using GNU Libtool, you may include this file under the -# same distribution terms that you use for the rest of that program. +# As a special exception to the GNU General Public License, if you +# distribute this file as part of a program or library that is built +# using GNU Libtool, you may include this file under the same +# distribution terms that you use for the rest of that program. # -# GNU Libtool is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of +# GNU Libtool is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License -# along with GNU Libtool; see the file COPYING. If not, a copy -# can be downloaded from http://www.gnu.org/licenses/gpl.html, or -# obtained by writing to the Free Software Foundation, Inc., -# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +# along with this program. If not, see . ]) -# serial 57 LT_INIT +# serial 58 LT_INIT # LT_PREREQ(VERSION) @@ -67,7 +59,7 @@ esac # LT_INIT([OPTIONS]) # ------------------ AC_DEFUN([LT_INIT], -[AC_PREREQ([2.58])dnl We use AC_INCLUDES_DEFAULT +[AC_PREREQ([2.62])dnl We use AC_PATH_PROGS_FEATURE_CHECK AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT])dnl AC_BEFORE([$0], [LT_LANG])dnl AC_BEFORE([$0], [LT_OUTPUT])dnl @@ -91,7 +83,7 @@ dnl Parse OPTIONS _LT_SET_OPTIONS([$0], [$1]) # This can be used to rebuild libtool when needed -LIBTOOL_DEPS="$ltmain" +LIBTOOL_DEPS=$ltmain # Always use our own libtool. LIBTOOL='$(SHELL) $(top_builddir)/libtool' @@ -111,26 +103,43 @@ dnl AC_DEFUN([AC_PROG_LIBTOOL], []) dnl AC_DEFUN([AM_PROG_LIBTOOL], []) +# _LT_PREPARE_CC_BASENAME +# ----------------------- +m4_defun([_LT_PREPARE_CC_BASENAME], [ +# Calculate cc_basename. Skip known compiler wrappers and cross-prefix. +func_cc_basename () +{ + for cc_temp in @S|@*""; do + case $cc_temp in + compile | *[[\\/]]compile | ccache | *[[\\/]]ccache ) ;; + distcc | *[[\\/]]distcc | purify | *[[\\/]]purify ) ;; + \-*) ;; + *) break;; + esac + done + func_cc_basename_result=`$ECHO "$cc_temp" | $SED "s%.*/%%; s%^$host_alias-%%"` +} +])# _LT_PREPARE_CC_BASENAME + + # _LT_CC_BASENAME(CC) # ------------------- -# Calculate cc_basename. Skip known compiler wrappers and cross-prefix. +# It would be clearer to call AC_REQUIREs from _LT_PREPARE_CC_BASENAME, +# but that macro is also expanded into generated libtool script, which +# arranges for $SED and $ECHO to be set by different means. m4_defun([_LT_CC_BASENAME], -[for cc_temp in $1""; do - case $cc_temp in - compile | *[[\\/]]compile | ccache | *[[\\/]]ccache ) ;; - distcc | *[[\\/]]distcc | purify | *[[\\/]]purify ) ;; - \-*) ;; - *) break;; - esac -done -cc_basename=`$ECHO "$cc_temp" | $SED "s%.*/%%; s%^$host_alias-%%"` +[m4_require([_LT_PREPARE_CC_BASENAME])dnl +AC_REQUIRE([_LT_DECL_SED])dnl +AC_REQUIRE([_LT_PROG_ECHO_BACKSLASH])dnl +func_cc_basename $1 +cc_basename=$func_cc_basename_result ]) # _LT_FILEUTILS_DEFAULTS # ---------------------- # It is okay to use these file commands and assume they have been set -# sensibly after `m4_require([_LT_FILEUTILS_DEFAULTS])'. +# sensibly after 'm4_require([_LT_FILEUTILS_DEFAULTS])'. m4_defun([_LT_FILEUTILS_DEFAULTS], [: ${CP="cp -f"} : ${MV="mv -f"} @@ -177,15 +186,16 @@ m4_require([_LT_CHECK_SHAREDLIB_FROM_LINKLIB])dnl m4_require([_LT_CMD_OLD_ARCHIVE])dnl m4_require([_LT_CMD_GLOBAL_SYMBOLS])dnl m4_require([_LT_WITH_SYSROOT])dnl +m4_require([_LT_CMD_TRUNCATE])dnl _LT_CONFIG_LIBTOOL_INIT([ -# See if we are running on zsh, and set the options which allow our +# See if we are running on zsh, and set the options that allow our # commands through without removal of \ escapes INIT. -if test -n "\${ZSH_VERSION+set}" ; then +if test -n "\${ZSH_VERSION+set}"; then setopt NO_GLOB_SUBST fi ]) -if test -n "${ZSH_VERSION+set}" ; then +if test -n "${ZSH_VERSION+set}"; then setopt NO_GLOB_SUBST fi @@ -198,7 +208,7 @@ aix3*) # AIX sometimes has problems with the GCC collect2 program. For some # reason, if we set the COLLECT_NAMES environment variable, the problems # vanish in a puff of smoke. - if test "X${COLLECT_NAMES+set}" != Xset; then + if test set != "${COLLECT_NAMES+set}"; then COLLECT_NAMES= export COLLECT_NAMES fi @@ -209,14 +219,14 @@ esac ofile=libtool can_build_shared=yes -# All known linkers require a `.a' archive for static linking (except MSVC, +# All known linkers require a '.a' archive for static linking (except MSVC, # which needs '.lib'). libext=a -with_gnu_ld="$lt_cv_prog_gnu_ld" +with_gnu_ld=$lt_cv_prog_gnu_ld -old_CC="$CC" -old_CFLAGS="$CFLAGS" +old_CC=$CC +old_CFLAGS=$CFLAGS # Set sane defaults for various variables test -z "$CC" && CC=cc @@ -269,14 +279,14 @@ no_glob_subst='s/\*/\\\*/g' # _LT_PROG_LTMAIN # --------------- -# Note that this code is called both from `configure', and `config.status' +# Note that this code is called both from 'configure', and 'config.status' # now that we use AC_CONFIG_COMMANDS to generate libtool. Notably, -# `config.status' has no value for ac_aux_dir unless we are using Automake, +# 'config.status' has no value for ac_aux_dir unless we are using Automake, # so we pass a copy along to make sure it has a sensible value anyway. m4_defun([_LT_PROG_LTMAIN], [m4_ifdef([AC_REQUIRE_AUX_FILE], [AC_REQUIRE_AUX_FILE([ltmain.sh])])dnl _LT_CONFIG_LIBTOOL_INIT([ac_aux_dir='$ac_aux_dir']) -ltmain="$ac_aux_dir/ltmain.sh" +ltmain=$ac_aux_dir/ltmain.sh ])# _LT_PROG_LTMAIN @@ -286,7 +296,7 @@ ltmain="$ac_aux_dir/ltmain.sh" # So that we can recreate a full libtool script including additional # tags, we accumulate the chunks of code to send to AC_CONFIG_COMMANDS -# in macros and then make a single call at the end using the `libtool' +# in macros and then make a single call at the end using the 'libtool' # label. @@ -421,8 +431,8 @@ m4_define([_lt_decl_all_varnames], # _LT_CONFIG_STATUS_DECLARE([VARNAME]) # ------------------------------------ -# Quote a variable value, and forward it to `config.status' so that its -# declaration there will have the same value as in `configure'. VARNAME +# Quote a variable value, and forward it to 'config.status' so that its +# declaration there will have the same value as in 'configure'. VARNAME # must have a single quote delimited value for this to work. m4_define([_LT_CONFIG_STATUS_DECLARE], [$1='`$ECHO "$][$1" | $SED "$delay_single_quote_subst"`']) @@ -446,7 +456,7 @@ m4_defun([_LT_CONFIG_STATUS_DECLARATIONS], # Output comment and list of tags supported by the script m4_defun([_LT_LIBTOOL_TAGS], [_LT_FORMAT_COMMENT([The names of the tagged configurations supported by this script])dnl -available_tags="_LT_TAGS"dnl +available_tags='_LT_TAGS'dnl ]) @@ -474,7 +484,7 @@ m4_ifval([$2], [_$2])[]m4_popdef([_libtool_name])[]dnl # _LT_LIBTOOL_CONFIG_VARS # ----------------------- # Produce commented declarations of non-tagged libtool config variables -# suitable for insertion in the LIBTOOL CONFIG section of the `libtool' +# suitable for insertion in the LIBTOOL CONFIG section of the 'libtool' # script. Tagged libtool config variables (even for the LIBTOOL CONFIG # section) are produced by _LT_LIBTOOL_TAG_VARS. m4_defun([_LT_LIBTOOL_CONFIG_VARS], @@ -500,8 +510,8 @@ m4_define([_LT_TAGVAR], [m4_ifval([$2], [$1_$2], [$1])]) # Send accumulated output to $CONFIG_STATUS. Thanks to the lists of # variables for single and double quote escaping we saved from calls # to _LT_DECL, we can put quote escaped variables declarations -# into `config.status', and then the shell code to quote escape them in -# for loops in `config.status'. Finally, any additional code accumulated +# into 'config.status', and then the shell code to quote escape them in +# for loops in 'config.status'. Finally, any additional code accumulated # from calls to _LT_CONFIG_LIBTOOL_INIT is expanded. m4_defun([_LT_CONFIG_COMMANDS], [AC_PROVIDE_IFELSE([LT_OUTPUT], @@ -547,7 +557,7 @@ for var in lt_decl_all_varnames([[ \ ]], lt_decl_quote_varnames); do case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in *[[\\\\\\\`\\"\\\$]]*) - eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED \\"\\\$sed_quote_subst\\"\\\`\\\\\\"" + eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED \\"\\\$sed_quote_subst\\"\\\`\\\\\\"" ## exclude from sc_prohibit_nested_quotes ;; *) eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\"" @@ -560,7 +570,7 @@ for var in lt_decl_all_varnames([[ \ ]], lt_decl_dquote_varnames); do case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in *[[\\\\\\\`\\"\\\$]]*) - eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED -e \\"\\\$double_quote_subst\\" -e \\"\\\$sed_quote_subst\\" -e \\"\\\$delay_variable_subst\\"\\\`\\\\\\"" + eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED -e \\"\\\$double_quote_subst\\" -e \\"\\\$sed_quote_subst\\" -e \\"\\\$delay_variable_subst\\"\\\`\\\\\\"" ## exclude from sc_prohibit_nested_quotes ;; *) eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\"" @@ -576,7 +586,7 @@ _LT_OUTPUT_LIBTOOL_INIT # Generate a child script FILE with all initialization necessary to # reuse the environment learned by the parent script, and make the # file executable. If COMMENT is supplied, it is inserted after the -# `#!' sequence but before initialization text begins. After this +# '#!' sequence but before initialization text begins. After this # macro, additional text can be appended to FILE to form the body of # the child script. The macro ends with non-zero status if the # file could not be fully written (such as if the disk is full). @@ -598,7 +608,7 @@ AS_SHELL_SANITIZE _AS_PREPARE exec AS_MESSAGE_FD>&1 _ASEOF -test $lt_write_fail = 0 && chmod +x $1[]dnl +test 0 = "$lt_write_fail" && chmod +x $1[]dnl m4_popdef([AS_MESSAGE_LOG_FD])])])# _LT_GENERATED_FILE_INIT # LT_OUTPUT @@ -621,7 +631,7 @@ exec AS_MESSAGE_LOG_FD>>config.log } >&AS_MESSAGE_LOG_FD lt_cl_help="\ -\`$as_me' creates a local libtool stub from the current configuration, +'$as_me' creates a local libtool stub from the current configuration, for use in further configure time tests before the real libtool is generated. @@ -643,7 +653,7 @@ Copyright (C) 2011 Free Software Foundation, Inc. This config.lt script is free software; the Free Software Foundation gives unlimited permision to copy, distribute and modify it." -while test $[#] != 0 +while test 0 != $[#] do case $[1] in --version | --v* | -V ) @@ -656,10 +666,10 @@ do lt_cl_silent=: ;; -*) AC_MSG_ERROR([unrecognized option: $[1] -Try \`$[0] --help' for more information.]) ;; +Try '$[0] --help' for more information.]) ;; *) AC_MSG_ERROR([unrecognized argument: $[1] -Try \`$[0] --help' for more information.]) ;; +Try '$[0] --help' for more information.]) ;; esac shift done @@ -685,7 +695,7 @@ chmod +x "$CONFIG_LT" # open by configure. Here we exec the FD to /dev/null, effectively closing # config.log, so it can be properly (re)opened and appended to by config.lt. lt_cl_success=: -test "$silent" = yes && +test yes = "$silent" && lt_config_lt_args="$lt_config_lt_args --quiet" exec AS_MESSAGE_LOG_FD>/dev/null $SHELL "$CONFIG_LT" $lt_config_lt_args || lt_cl_success=false @@ -705,27 +715,31 @@ m4_defun([_LT_CONFIG], _LT_CONFIG_SAVE_COMMANDS([ m4_define([_LT_TAG], m4_if([$1], [], [C], [$1]))dnl m4_if(_LT_TAG, [C], [ - # See if we are running on zsh, and set the options which allow our + # See if we are running on zsh, and set the options that allow our # commands through without removal of \ escapes. - if test -n "${ZSH_VERSION+set}" ; then + if test -n "${ZSH_VERSION+set}"; then setopt NO_GLOB_SUBST fi - cfgfile="${ofile}T" + cfgfile=${ofile}T trap "$RM \"$cfgfile\"; exit 1" 1 2 15 $RM "$cfgfile" cat <<_LT_EOF >> "$cfgfile" #! $SHELL - -# `$ECHO "$ofile" | sed 's%^.*/%%'` - Provide generalized library-building support services. -# Generated automatically by $as_me ($PACKAGE$TIMESTAMP) $VERSION +# Generated automatically by $as_me ($PACKAGE) $VERSION # Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`: # NOTE: Changes made to this file will be lost: look at ltmain.sh. -# + +# Provide generalized library-building support services. +# Written by Gordon Matzigkeit, 1996 + _LT_COPYING _LT_LIBTOOL_TAGS +# Configured defaults for sys_lib_dlsearch_path munging. +: \${LT_SYS_LIBRARY_PATH="$configure_time_lt_sys_library_path"} + # ### BEGIN LIBTOOL CONFIG _LT_LIBTOOL_CONFIG_VARS _LT_LIBTOOL_TAG_VARS @@ -733,13 +747,24 @@ _LT_LIBTOOL_TAG_VARS _LT_EOF + cat <<'_LT_EOF' >> "$cfgfile" + +# ### BEGIN FUNCTIONS SHARED WITH CONFIGURE + +_LT_PREPARE_MUNGE_PATH_LIST +_LT_PREPARE_CC_BASENAME + +# ### END FUNCTIONS SHARED WITH CONFIGURE + +_LT_EOF + case $host_os in aix3*) cat <<\_LT_EOF >> "$cfgfile" # AIX sometimes has problems with the GCC collect2 program. For some # reason, if we set the COLLECT_NAMES environment variable, the problems # vanish in a puff of smoke. -if test "X${COLLECT_NAMES+set}" != Xset; then +if test set != "${COLLECT_NAMES+set}"; then COLLECT_NAMES= export COLLECT_NAMES fi @@ -756,8 +781,6 @@ _LT_EOF sed '$q' "$ltmain" >> "$cfgfile" \ || (rm -f "$cfgfile"; exit 1) - _LT_PROG_REPLACE_SHELLFNS - mv -f "$cfgfile" "$ofile" || (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile") chmod +x "$ofile" @@ -775,7 +798,6 @@ _LT_EOF [m4_if([$1], [], [ PACKAGE='$PACKAGE' VERSION='$VERSION' - TIMESTAMP='$TIMESTAMP' RM='$RM' ofile='$ofile'], []) ])dnl /_LT_CONFIG_SAVE_COMMANDS @@ -974,7 +996,7 @@ m4_defun_once([_LT_REQUIRED_DARWIN_CHECKS],[ AC_CACHE_CHECK([for -single_module linker flag],[lt_cv_apple_cc_single_mod], [lt_cv_apple_cc_single_mod=no - if test -z "${LT_MULTI_MODULE}"; then + if test -z "$LT_MULTI_MODULE"; then # By default we will add the -single_module flag. You can override # by either setting the environment variable LT_MULTI_MODULE # non-empty at configure time, or by adding -multi_module to the @@ -992,7 +1014,7 @@ m4_defun_once([_LT_REQUIRED_DARWIN_CHECKS],[ cat conftest.err >&AS_MESSAGE_LOG_FD # Otherwise, if the output was created with a 0 exit code from # the compiler, it worked. - elif test -f libconftest.dylib && test $_lt_result -eq 0; then + elif test -f libconftest.dylib && test 0 = "$_lt_result"; then lt_cv_apple_cc_single_mod=yes else cat conftest.err >&AS_MESSAGE_LOG_FD @@ -1010,7 +1032,7 @@ m4_defun_once([_LT_REQUIRED_DARWIN_CHECKS],[ AC_LINK_IFELSE([AC_LANG_PROGRAM([],[])], [lt_cv_ld_exported_symbols_list=yes], [lt_cv_ld_exported_symbols_list=no]) - LDFLAGS="$save_LDFLAGS" + LDFLAGS=$save_LDFLAGS ]) AC_CACHE_CHECK([for -force_load linker flag],[lt_cv_ld_force_load], @@ -1032,7 +1054,7 @@ _LT_EOF _lt_result=$? if test -s conftest.err && $GREP force_load conftest.err; then cat conftest.err >&AS_MESSAGE_LOG_FD - elif test -f conftest && test $_lt_result -eq 0 && $GREP forced_load conftest >/dev/null 2>&1 ; then + elif test -f conftest && test 0 = "$_lt_result" && $GREP forced_load conftest >/dev/null 2>&1; then lt_cv_ld_force_load=yes else cat conftest.err >&AS_MESSAGE_LOG_FD @@ -1042,32 +1064,32 @@ _LT_EOF ]) case $host_os in rhapsody* | darwin1.[[012]]) - _lt_dar_allow_undefined='${wl}-undefined ${wl}suppress' ;; + _lt_dar_allow_undefined='$wl-undefined ${wl}suppress' ;; darwin1.*) - _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;; + _lt_dar_allow_undefined='$wl-flat_namespace $wl-undefined ${wl}suppress' ;; darwin*) # darwin 5.x on # if running on 10.5 or later, the deployment target defaults # to the OS version, if on x86, and 10.4, the deployment # target defaults to 10.4. Don't you love it? case ${MACOSX_DEPLOYMENT_TARGET-10.0},$host in 10.0,*86*-darwin8*|10.0,*-darwin[[91]]*) - _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;; - 10.[[012]]*) - _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;; + _lt_dar_allow_undefined='$wl-undefined ${wl}dynamic_lookup' ;; + 10.[[012]][[,.]]*) + _lt_dar_allow_undefined='$wl-flat_namespace $wl-undefined ${wl}suppress' ;; 10.*) - _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;; + _lt_dar_allow_undefined='$wl-undefined ${wl}dynamic_lookup' ;; esac ;; esac - if test "$lt_cv_apple_cc_single_mod" = "yes"; then + if test yes = "$lt_cv_apple_cc_single_mod"; then _lt_dar_single_mod='$single_module' fi - if test "$lt_cv_ld_exported_symbols_list" = "yes"; then - _lt_dar_export_syms=' ${wl}-exported_symbols_list,$output_objdir/${libname}-symbols.expsym' + if test yes = "$lt_cv_ld_exported_symbols_list"; then + _lt_dar_export_syms=' $wl-exported_symbols_list,$output_objdir/$libname-symbols.expsym' else - _lt_dar_export_syms='~$NMEDIT -s $output_objdir/${libname}-symbols.expsym ${lib}' + _lt_dar_export_syms='~$NMEDIT -s $output_objdir/$libname-symbols.expsym $lib' fi - if test "$DSYMUTIL" != ":" && test "$lt_cv_ld_force_load" = "no"; then + if test : != "$DSYMUTIL" && test no = "$lt_cv_ld_force_load"; then _lt_dsymutil='~$DSYMUTIL $lib || :' else _lt_dsymutil= @@ -1087,29 +1109,29 @@ m4_defun([_LT_DARWIN_LINKER_FEATURES], _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_automatic, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported - if test "$lt_cv_ld_force_load" = "yes"; then - _LT_TAGVAR(whole_archive_flag_spec, $1)='`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience ${wl}-force_load,$conv\"; done; func_echo_all \"$new_convenience\"`' + if test yes = "$lt_cv_ld_force_load"; then + _LT_TAGVAR(whole_archive_flag_spec, $1)='`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience $wl-force_load,$conv\"; done; func_echo_all \"$new_convenience\"`' m4_case([$1], [F77], [_LT_TAGVAR(compiler_needs_object, $1)=yes], [FC], [_LT_TAGVAR(compiler_needs_object, $1)=yes]) else _LT_TAGVAR(whole_archive_flag_spec, $1)='' fi _LT_TAGVAR(link_all_deplibs, $1)=yes - _LT_TAGVAR(allow_undefined_flag, $1)="$_lt_dar_allow_undefined" + _LT_TAGVAR(allow_undefined_flag, $1)=$_lt_dar_allow_undefined case $cc_basename in - ifort*) _lt_dar_can_shared=yes ;; + ifort*|nagfor*) _lt_dar_can_shared=yes ;; *) _lt_dar_can_shared=$GCC ;; esac - if test "$_lt_dar_can_shared" = "yes"; then + if test yes = "$_lt_dar_can_shared"; then output_verbose_link_cmd=func_echo_all - _LT_TAGVAR(archive_cmds, $1)="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod${_lt_dsymutil}" - _LT_TAGVAR(module_cmds, $1)="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dsymutil}" - _LT_TAGVAR(archive_expsym_cmds, $1)="sed 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring ${_lt_dar_single_mod}${_lt_dar_export_syms}${_lt_dsymutil}" - _LT_TAGVAR(module_expsym_cmds, $1)="sed -e 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dar_export_syms}${_lt_dsymutil}" + _LT_TAGVAR(archive_cmds, $1)="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod$_lt_dsymutil" + _LT_TAGVAR(module_cmds, $1)="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags$_lt_dsymutil" + _LT_TAGVAR(archive_expsym_cmds, $1)="sed 's|^|_|' < \$export_symbols > \$output_objdir/\$libname-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod$_lt_dar_export_syms$_lt_dsymutil" + _LT_TAGVAR(module_expsym_cmds, $1)="sed -e 's|^|_|' < \$export_symbols > \$output_objdir/\$libname-symbols.expsym~\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags$_lt_dar_export_syms$_lt_dsymutil" m4_if([$1], [CXX], -[ if test "$lt_cv_apple_cc_single_mod" != "yes"; then - _LT_TAGVAR(archive_cmds, $1)="\$CC -r -keep_private_externs -nostdlib -o \${lib}-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \${lib}-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring${_lt_dsymutil}" - _LT_TAGVAR(archive_expsym_cmds, $1)="sed 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -r -keep_private_externs -nostdlib -o \${lib}-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \${lib}-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring${_lt_dar_export_syms}${_lt_dsymutil}" +[ if test yes != "$lt_cv_apple_cc_single_mod"; then + _LT_TAGVAR(archive_cmds, $1)="\$CC -r -keep_private_externs -nostdlib -o \$lib-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$lib-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring$_lt_dsymutil" + _LT_TAGVAR(archive_expsym_cmds, $1)="sed 's|^|_|' < \$export_symbols > \$output_objdir/\$libname-symbols.expsym~\$CC -r -keep_private_externs -nostdlib -o \$lib-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$lib-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring$_lt_dar_export_syms$_lt_dsymutil" fi ],[]) else @@ -1129,7 +1151,7 @@ m4_defun([_LT_DARWIN_LINKER_FEATURES], # Allow to override them for all tags through lt_cv_aix_libpath. m4_defun([_LT_SYS_MODULE_PATH_AIX], [m4_require([_LT_DECL_SED])dnl -if test "${lt_cv_aix_libpath+set}" = set; then +if test set = "${lt_cv_aix_libpath+set}"; then aix_libpath=$lt_cv_aix_libpath else AC_CACHE_VAL([_LT_TAGVAR([lt_cv_aix_libpath_], [$1])], @@ -1147,7 +1169,7 @@ else _LT_TAGVAR([lt_cv_aix_libpath_], [$1])=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` fi],[]) if test -z "$_LT_TAGVAR([lt_cv_aix_libpath_], [$1])"; then - _LT_TAGVAR([lt_cv_aix_libpath_], [$1])="/usr/lib:/lib" + _LT_TAGVAR([lt_cv_aix_libpath_], [$1])=/usr/lib:/lib fi ]) aix_libpath=$_LT_TAGVAR([lt_cv_aix_libpath_], [$1]) @@ -1167,8 +1189,8 @@ m4_define([_LT_SHELL_INIT], # ----------------------- # Find how we can fake an echo command that does not interpret backslash. # In particular, with Autoconf 2.60 or later we add some code to the start -# of the generated configure script which will find a shell with a builtin -# printf (which we can use as an echo command). +# of the generated configure script that will find a shell with a builtin +# printf (that we can use as an echo command). m4_defun([_LT_PROG_ECHO_BACKSLASH], [ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO @@ -1196,10 +1218,10 @@ fi # Invoke $ECHO with all args, space-separated. func_echo_all () { - $ECHO "$*" + $ECHO "$*" } -case "$ECHO" in +case $ECHO in printf*) AC_MSG_RESULT([printf]) ;; print*) AC_MSG_RESULT([print -r]) ;; *) AC_MSG_RESULT([cat]) ;; @@ -1225,16 +1247,17 @@ _LT_DECL([], [ECHO], [1], [An echo program that protects backslashes]) AC_DEFUN([_LT_WITH_SYSROOT], [AC_MSG_CHECKING([for sysroot]) AC_ARG_WITH([sysroot], -[ --with-sysroot[=DIR] Search for dependent libraries within DIR - (or the compiler's sysroot if not specified).], +[AS_HELP_STRING([--with-sysroot@<:@=DIR@:>@], + [Search for dependent libraries within DIR (or the compiler's sysroot + if not specified).])], [], [with_sysroot=no]) dnl lt_sysroot will always be passed unquoted. We quote it here dnl in case the user passed a directory name. lt_sysroot= -case ${with_sysroot} in #( +case $with_sysroot in #( yes) - if test "$GCC" = yes; then + if test yes = "$GCC"; then lt_sysroot=`$CC --print-sysroot 2>/dev/null` fi ;; #( @@ -1244,14 +1267,14 @@ case ${with_sysroot} in #( no|'') ;; #( *) - AC_MSG_RESULT([${with_sysroot}]) + AC_MSG_RESULT([$with_sysroot]) AC_MSG_ERROR([The sysroot must be an absolute path.]) ;; esac AC_MSG_RESULT([${lt_sysroot:-no}]) _LT_DECL([], [lt_sysroot], [0], [The root where to search for ]dnl -[dependent libraries, and in which our libraries should be installed.])]) +[dependent libraries, and where our libraries should be installed.])]) # _LT_ENABLE_LOCK # --------------- @@ -1259,31 +1282,33 @@ m4_defun([_LT_ENABLE_LOCK], [AC_ARG_ENABLE([libtool-lock], [AS_HELP_STRING([--disable-libtool-lock], [avoid locking (might break parallel builds)])]) -test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes +test no = "$enable_libtool_lock" || enable_libtool_lock=yes # Some flags need to be propagated to the compiler or linker for good # libtool support. case $host in ia64-*-hpux*) - # Find out which ABI we are using. + # Find out what ABI is being produced by ac_compile, and set mode + # options accordingly. echo 'int i;' > conftest.$ac_ext if AC_TRY_EVAL(ac_compile); then case `/usr/bin/file conftest.$ac_objext` in *ELF-32*) - HPUX_IA64_MODE="32" + HPUX_IA64_MODE=32 ;; *ELF-64*) - HPUX_IA64_MODE="64" + HPUX_IA64_MODE=64 ;; esac fi rm -rf conftest* ;; *-*-irix6*) - # Find out which ABI we are using. + # Find out what ABI is being produced by ac_compile, and set linker + # options accordingly. echo '[#]line '$LINENO' "configure"' > conftest.$ac_ext if AC_TRY_EVAL(ac_compile); then - if test "$lt_cv_prog_gnu_ld" = yes; then + if test yes = "$lt_cv_prog_gnu_ld"; then case `/usr/bin/file conftest.$ac_objext` in *32-bit*) LD="${LD-ld} -melf32bsmip" @@ -1312,9 +1337,46 @@ ia64-*-hpux*) rm -rf conftest* ;; -x86_64-*kfreebsd*-gnu|x86_64-*linux*|ppc*-*linux*|powerpc*-*linux*| \ +mips64*-*linux*) + # Find out what ABI is being produced by ac_compile, and set linker + # options accordingly. + echo '[#]line '$LINENO' "configure"' > conftest.$ac_ext + if AC_TRY_EVAL(ac_compile); then + emul=elf + case `/usr/bin/file conftest.$ac_objext` in + *32-bit*) + emul="${emul}32" + ;; + *64-bit*) + emul="${emul}64" + ;; + esac + case `/usr/bin/file conftest.$ac_objext` in + *MSB*) + emul="${emul}btsmip" + ;; + *LSB*) + emul="${emul}ltsmip" + ;; + esac + case `/usr/bin/file conftest.$ac_objext` in + *N32*) + emul="${emul}n32" + ;; + esac + LD="${LD-ld} -m $emul" + fi + rm -rf conftest* + ;; + +x86_64-*kfreebsd*-gnu|x86_64-*linux*|powerpc*-*linux*| \ s390*-*linux*|s390*-*tpf*|sparc*-*linux*) - # Find out which ABI we are using. + # Find out what ABI is being produced by ac_compile, and set linker + # options accordingly. Note that the listed cases only cover the + # situations where additional linker options are needed (such as when + # doing 32-bit compilation for a host where ld defaults to 64-bit, or + # vice versa); the common cases where no linker options are needed do + # not appear in the list. echo 'int i;' > conftest.$ac_ext if AC_TRY_EVAL(ac_compile); then case `/usr/bin/file conftest.o` in @@ -1324,9 +1386,19 @@ s390*-*linux*|s390*-*tpf*|sparc*-*linux*) LD="${LD-ld} -m elf_i386_fbsd" ;; x86_64-*linux*) - LD="${LD-ld} -m elf_i386" + case `/usr/bin/file conftest.o` in + *x86-64*) + LD="${LD-ld} -m elf32_x86_64" + ;; + *) + LD="${LD-ld} -m elf_i386" + ;; + esac + ;; + powerpc64le-*linux*) + LD="${LD-ld} -m elf32lppclinux" ;; - ppc64-*linux*|powerpc64-*linux*) + powerpc64-*linux*) LD="${LD-ld} -m elf32ppclinux" ;; s390x-*linux*) @@ -1345,7 +1417,10 @@ s390*-*linux*|s390*-*tpf*|sparc*-*linux*) x86_64-*linux*) LD="${LD-ld} -m elf_x86_64" ;; - ppc*-*linux*|powerpc*-*linux*) + powerpcle-*linux*) + LD="${LD-ld} -m elf64lppc" + ;; + powerpc-*linux*) LD="${LD-ld} -m elf64ppc" ;; s390*-*linux*|s390*-*tpf*) @@ -1363,19 +1438,20 @@ s390*-*linux*|s390*-*tpf*|sparc*-*linux*) *-*-sco3.2v5*) # On SCO OpenServer 5, we need -belf to get full-featured binaries. - SAVE_CFLAGS="$CFLAGS" + SAVE_CFLAGS=$CFLAGS CFLAGS="$CFLAGS -belf" AC_CACHE_CHECK([whether the C compiler needs -belf], lt_cv_cc_needs_belf, [AC_LANG_PUSH(C) AC_LINK_IFELSE([AC_LANG_PROGRAM([[]],[[]])],[lt_cv_cc_needs_belf=yes],[lt_cv_cc_needs_belf=no]) AC_LANG_POP]) - if test x"$lt_cv_cc_needs_belf" != x"yes"; then + if test yes != "$lt_cv_cc_needs_belf"; then # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf - CFLAGS="$SAVE_CFLAGS" + CFLAGS=$SAVE_CFLAGS fi ;; *-*solaris*) - # Find out which ABI we are using. + # Find out what ABI is being produced by ac_compile, and set linker + # options accordingly. echo 'int i;' > conftest.$ac_ext if AC_TRY_EVAL(ac_compile); then case `/usr/bin/file conftest.o` in @@ -1383,7 +1459,7 @@ s390*-*linux*|s390*-*tpf*|sparc*-*linux*) case $lt_cv_prog_gnu_ld in yes*) case $host in - i?86-*-solaris*) + i?86-*-solaris*|x86_64-*-solaris*) LD="${LD-ld} -m elf_x86_64" ;; sparc*-*-solaris*) @@ -1392,7 +1468,7 @@ s390*-*linux*|s390*-*tpf*|sparc*-*linux*) esac # GNU ld 2.21 introduced _sol2 emulations. Use them if available. if ${LD-ld} -V | grep _sol2 >/dev/null 2>&1; then - LD="${LD-ld}_sol2" + LD=${LD-ld}_sol2 fi ;; *) @@ -1408,7 +1484,7 @@ s390*-*linux*|s390*-*tpf*|sparc*-*linux*) ;; esac -need_locks="$enable_libtool_lock" +need_locks=$enable_libtool_lock ])# _LT_ENABLE_LOCK @@ -1427,11 +1503,11 @@ AC_CACHE_CHECK([for archiver @FILE support], [lt_cv_ar_at_file], [echo conftest.$ac_objext > conftest.lst lt_ar_try='$AR $AR_FLAGS libconftest.a @conftest.lst >&AS_MESSAGE_LOG_FD' AC_TRY_EVAL([lt_ar_try]) - if test "$ac_status" -eq 0; then + if test 0 -eq "$ac_status"; then # Ensure the archiver fails upon bogus file names. rm -f conftest.$ac_objext libconftest.a AC_TRY_EVAL([lt_ar_try]) - if test "$ac_status" -ne 0; then + if test 0 -ne "$ac_status"; then lt_cv_ar_at_file=@ fi fi @@ -1439,7 +1515,7 @@ AC_CACHE_CHECK([for archiver @FILE support], [lt_cv_ar_at_file], ]) ]) -if test "x$lt_cv_ar_at_file" = xno; then +if test no = "$lt_cv_ar_at_file"; then archiver_list_spec= else archiver_list_spec=$lt_cv_ar_at_file @@ -1470,7 +1546,7 @@ old_postuninstall_cmds= if test -n "$RANLIB"; then case $host_os in - openbsd*) + bitrig* | openbsd*) old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB -t \$tool_oldlib" ;; *) @@ -1506,7 +1582,7 @@ AC_CACHE_CHECK([$1], [$2], [$2=no m4_if([$4], , [ac_outfile=conftest.$ac_objext], [ac_outfile=$4]) echo "$lt_simple_compile_test_code" > conftest.$ac_ext - lt_compiler_flag="$3" + lt_compiler_flag="$3" ## exclude from sc_useless_quotes_in_assignment # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins @@ -1533,7 +1609,7 @@ AC_CACHE_CHECK([$1], [$2], $RM conftest* ]) -if test x"[$]$2" = xyes; then +if test yes = "[$]$2"; then m4_if([$5], , :, [$5]) else m4_if([$6], , :, [$6]) @@ -1555,7 +1631,7 @@ AC_DEFUN([_LT_LINKER_OPTION], m4_require([_LT_DECL_SED])dnl AC_CACHE_CHECK([$1], [$2], [$2=no - save_LDFLAGS="$LDFLAGS" + save_LDFLAGS=$LDFLAGS LDFLAGS="$LDFLAGS $3" echo "$lt_simple_link_test_code" > conftest.$ac_ext if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then @@ -1574,10 +1650,10 @@ AC_CACHE_CHECK([$1], [$2], fi fi $RM -r conftest* - LDFLAGS="$save_LDFLAGS" + LDFLAGS=$save_LDFLAGS ]) -if test x"[$]$2" = xyes; then +if test yes = "[$]$2"; then m4_if([$4], , :, [$4]) else m4_if([$5], , :, [$5]) @@ -1598,7 +1674,7 @@ AC_DEFUN([LT_CMD_MAX_LEN], AC_MSG_CHECKING([the maximum length of command line arguments]) AC_CACHE_VAL([lt_cv_sys_max_cmd_len], [dnl i=0 - teststring="ABCD" + teststring=ABCD case $build_os in msdosdjgpp*) @@ -1638,7 +1714,7 @@ AC_CACHE_VAL([lt_cv_sys_max_cmd_len], [dnl lt_cv_sys_max_cmd_len=8192; ;; - netbsd* | freebsd* | openbsd* | darwin* | dragonfly*) + bitrig* | darwin* | dragonfly* | freebsd* | netbsd* | openbsd*) # This has been around since 386BSD, at least. Likely further. if test -x /sbin/sysctl; then lt_cv_sys_max_cmd_len=`/sbin/sysctl -n kern.argmax` @@ -1688,22 +1764,23 @@ AC_CACHE_VAL([lt_cv_sys_max_cmd_len], [dnl ;; *) lt_cv_sys_max_cmd_len=`(getconf ARG_MAX) 2> /dev/null` - if test -n "$lt_cv_sys_max_cmd_len"; then + if test -n "$lt_cv_sys_max_cmd_len" && \ + test undefined != "$lt_cv_sys_max_cmd_len"; then lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4` lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3` else # Make teststring a little bigger before we do anything with it. # a 1K string should be a reasonable start. - for i in 1 2 3 4 5 6 7 8 ; do + for i in 1 2 3 4 5 6 7 8; do teststring=$teststring$teststring done SHELL=${SHELL-${CONFIG_SHELL-/bin/sh}} # If test is not a shell built-in, we'll probably end up computing a # maximum length that is only half of the actual maximum length, but # we can't tell. - while { test "X"`env echo "$teststring$teststring" 2>/dev/null` \ + while { test X`env echo "$teststring$teststring" 2>/dev/null` \ = "X$teststring$teststring"; } >/dev/null 2>&1 && - test $i != 17 # 1/2 MB should be enough + test 17 != "$i" # 1/2 MB should be enough do i=`expr $i + 1` teststring=$teststring$teststring @@ -1719,7 +1796,7 @@ AC_CACHE_VAL([lt_cv_sys_max_cmd_len], [dnl ;; esac ]) -if test -n $lt_cv_sys_max_cmd_len ; then +if test -n "$lt_cv_sys_max_cmd_len"; then AC_MSG_RESULT($lt_cv_sys_max_cmd_len) else AC_MSG_RESULT(none) @@ -1747,7 +1824,7 @@ m4_defun([_LT_HEADER_DLFCN], # ---------------------------------------------------------------- m4_defun([_LT_TRY_DLOPEN_SELF], [m4_require([_LT_HEADER_DLFCN])dnl -if test "$cross_compiling" = yes; then : +if test yes = "$cross_compiling"; then : [$4] else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 @@ -1794,9 +1871,9 @@ else # endif #endif -/* When -fvisbility=hidden is used, assume the code has been annotated +/* When -fvisibility=hidden is used, assume the code has been annotated correspondingly for the symbols needed. */ -#if defined(__GNUC__) && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3)) +#if defined __GNUC__ && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3)) int fnord () __attribute__((visibility("default"))); #endif @@ -1822,7 +1899,7 @@ int main () return status; }] _LT_EOF - if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext} 2>/dev/null; then + if AC_TRY_EVAL(ac_link) && test -s "conftest$ac_exeext" 2>/dev/null; then (./conftest; exit; ) >&AS_MESSAGE_LOG_FD 2>/dev/null lt_status=$? case x$lt_status in @@ -1843,7 +1920,7 @@ rm -fr conftest* # ------------------ AC_DEFUN([LT_SYS_DLOPEN_SELF], [m4_require([_LT_HEADER_DLFCN])dnl -if test "x$enable_dlopen" != xyes; then +if test yes != "$enable_dlopen"; then enable_dlopen=unknown enable_dlopen_self=unknown enable_dlopen_self_static=unknown @@ -1853,44 +1930,52 @@ else case $host_os in beos*) - lt_cv_dlopen="load_add_on" + lt_cv_dlopen=load_add_on lt_cv_dlopen_libs= lt_cv_dlopen_self=yes ;; mingw* | pw32* | cegcc*) - lt_cv_dlopen="LoadLibrary" + lt_cv_dlopen=LoadLibrary lt_cv_dlopen_libs= ;; cygwin*) - lt_cv_dlopen="dlopen" + lt_cv_dlopen=dlopen lt_cv_dlopen_libs= ;; darwin*) - # if libdl is installed we need to link against it + # if libdl is installed we need to link against it AC_CHECK_LIB([dl], [dlopen], - [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"],[ - lt_cv_dlopen="dyld" + [lt_cv_dlopen=dlopen lt_cv_dlopen_libs=-ldl],[ + lt_cv_dlopen=dyld lt_cv_dlopen_libs= lt_cv_dlopen_self=yes ]) ;; + tpf*) + # Don't try to run any link tests for TPF. We know it's impossible + # because TPF is a cross-compiler, and we know how we open DSOs. + lt_cv_dlopen=dlopen + lt_cv_dlopen_libs= + lt_cv_dlopen_self=no + ;; + *) AC_CHECK_FUNC([shl_load], - [lt_cv_dlopen="shl_load"], + [lt_cv_dlopen=shl_load], [AC_CHECK_LIB([dld], [shl_load], - [lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-ldld"], + [lt_cv_dlopen=shl_load lt_cv_dlopen_libs=-ldld], [AC_CHECK_FUNC([dlopen], - [lt_cv_dlopen="dlopen"], + [lt_cv_dlopen=dlopen], [AC_CHECK_LIB([dl], [dlopen], - [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"], + [lt_cv_dlopen=dlopen lt_cv_dlopen_libs=-ldl], [AC_CHECK_LIB([svld], [dlopen], - [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld"], + [lt_cv_dlopen=dlopen lt_cv_dlopen_libs=-lsvld], [AC_CHECK_LIB([dld], [dld_link], - [lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-ldld"]) + [lt_cv_dlopen=dld_link lt_cv_dlopen_libs=-ldld]) ]) ]) ]) @@ -1899,21 +1984,21 @@ else ;; esac - if test "x$lt_cv_dlopen" != xno; then - enable_dlopen=yes - else + if test no = "$lt_cv_dlopen"; then enable_dlopen=no + else + enable_dlopen=yes fi case $lt_cv_dlopen in dlopen) - save_CPPFLAGS="$CPPFLAGS" - test "x$ac_cv_header_dlfcn_h" = xyes && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H" + save_CPPFLAGS=$CPPFLAGS + test yes = "$ac_cv_header_dlfcn_h" && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H" - save_LDFLAGS="$LDFLAGS" + save_LDFLAGS=$LDFLAGS wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\" - save_LIBS="$LIBS" + save_LIBS=$LIBS LIBS="$lt_cv_dlopen_libs $LIBS" AC_CACHE_CHECK([whether a program can dlopen itself], @@ -1923,7 +2008,7 @@ else lt_cv_dlopen_self=no, lt_cv_dlopen_self=cross) ]) - if test "x$lt_cv_dlopen_self" = xyes; then + if test yes = "$lt_cv_dlopen_self"; then wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $lt_prog_compiler_static\" AC_CACHE_CHECK([whether a statically linked program can dlopen itself], lt_cv_dlopen_self_static, [dnl @@ -1933,9 +2018,9 @@ else ]) fi - CPPFLAGS="$save_CPPFLAGS" - LDFLAGS="$save_LDFLAGS" - LIBS="$save_LIBS" + CPPFLAGS=$save_CPPFLAGS + LDFLAGS=$save_LDFLAGS + LIBS=$save_LIBS ;; esac @@ -2027,8 +2112,8 @@ m4_defun([_LT_COMPILER_FILE_LOCKS], m4_require([_LT_FILEUTILS_DEFAULTS])dnl _LT_COMPILER_C_O([$1]) -hard_links="nottested" -if test "$_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)" = no && test "$need_locks" != no; then +hard_links=nottested +if test no = "$_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)" && test no != "$need_locks"; then # do not overwrite the value of need_locks provided by the user AC_MSG_CHECKING([if we can lock with hard links]) hard_links=yes @@ -2038,8 +2123,8 @@ if test "$_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)" = no && test "$need_locks" != ln conftest.a conftest.b 2>&5 || hard_links=no ln conftest.a conftest.b 2>/dev/null && hard_links=no AC_MSG_RESULT([$hard_links]) - if test "$hard_links" = no; then - AC_MSG_WARN([`$CC' does not support `-c -o', so `make -j' may be unsafe]) + if test no = "$hard_links"; then + AC_MSG_WARN(['$CC' does not support '-c -o', so 'make -j' may be unsafe]) need_locks=warn fi else @@ -2066,8 +2151,8 @@ objdir=$lt_cv_objdir _LT_DECL([], [objdir], [0], [The name of the directory that contains temporary libtool files])dnl m4_pattern_allow([LT_OBJDIR])dnl -AC_DEFINE_UNQUOTED(LT_OBJDIR, "$lt_cv_objdir/", - [Define to the sub-directory in which libtool stores uninstalled libraries.]) +AC_DEFINE_UNQUOTED([LT_OBJDIR], "$lt_cv_objdir/", + [Define to the sub-directory where libtool stores uninstalled libraries.]) ])# _LT_CHECK_OBJDIR @@ -2079,15 +2164,15 @@ m4_defun([_LT_LINKER_HARDCODE_LIBPATH], _LT_TAGVAR(hardcode_action, $1)= if test -n "$_LT_TAGVAR(hardcode_libdir_flag_spec, $1)" || test -n "$_LT_TAGVAR(runpath_var, $1)" || - test "X$_LT_TAGVAR(hardcode_automatic, $1)" = "Xyes" ; then + test yes = "$_LT_TAGVAR(hardcode_automatic, $1)"; then # We can hardcode non-existent directories. - if test "$_LT_TAGVAR(hardcode_direct, $1)" != no && + if test no != "$_LT_TAGVAR(hardcode_direct, $1)" && # If the only mechanism to avoid hardcoding is shlibpath_var, we # have to relink, otherwise we might link with an installed library # when we should be linking with a yet-to-be-installed one - ## test "$_LT_TAGVAR(hardcode_shlibpath_var, $1)" != no && - test "$_LT_TAGVAR(hardcode_minus_L, $1)" != no; then + ## test no != "$_LT_TAGVAR(hardcode_shlibpath_var, $1)" && + test no != "$_LT_TAGVAR(hardcode_minus_L, $1)"; then # Linking always hardcodes the temporary library directory. _LT_TAGVAR(hardcode_action, $1)=relink else @@ -2101,12 +2186,12 @@ else fi AC_MSG_RESULT([$_LT_TAGVAR(hardcode_action, $1)]) -if test "$_LT_TAGVAR(hardcode_action, $1)" = relink || - test "$_LT_TAGVAR(inherit_rpath, $1)" = yes; then +if test relink = "$_LT_TAGVAR(hardcode_action, $1)" || + test yes = "$_LT_TAGVAR(inherit_rpath, $1)"; then # Fast installation is not supported enable_fast_install=no -elif test "$shlibpath_overrides_runpath" = yes || - test "$enable_shared" = no; then +elif test yes = "$shlibpath_overrides_runpath" || + test no = "$enable_shared"; then # Fast installation is not necessary enable_fast_install=needless fi @@ -2130,7 +2215,7 @@ else # FIXME - insert some real tests, host_os isn't really good enough case $host_os in darwin*) - if test -n "$STRIP" ; then + if test -n "$STRIP"; then striplib="$STRIP -x" old_striplib="$STRIP -S" AC_MSG_RESULT([yes]) @@ -2148,6 +2233,47 @@ _LT_DECL([], [striplib], [1]) ])# _LT_CMD_STRIPLIB +# _LT_PREPARE_MUNGE_PATH_LIST +# --------------------------- +# Make sure func_munge_path_list() is defined correctly. +m4_defun([_LT_PREPARE_MUNGE_PATH_LIST], +[[# func_munge_path_list VARIABLE PATH +# ----------------------------------- +# VARIABLE is name of variable containing _space_ separated list of +# directories to be munged by the contents of PATH, which is string +# having a format: +# "DIR[:DIR]:" +# string "DIR[ DIR]" will be prepended to VARIABLE +# ":DIR[:DIR]" +# string "DIR[ DIR]" will be appended to VARIABLE +# "DIRP[:DIRP]::[DIRA:]DIRA" +# string "DIRP[ DIRP]" will be prepended to VARIABLE and string +# "DIRA[ DIRA]" will be appended to VARIABLE +# "DIR[:DIR]" +# VARIABLE will be replaced by "DIR[ DIR]" +func_munge_path_list () +{ + case x@S|@2 in + x) + ;; + *:) + eval @S|@1=\"`$ECHO @S|@2 | $SED 's/:/ /g'` \@S|@@S|@1\" + ;; + x:*) + eval @S|@1=\"\@S|@@S|@1 `$ECHO @S|@2 | $SED 's/:/ /g'`\" + ;; + *::*) + eval @S|@1=\"\@S|@@S|@1\ `$ECHO @S|@2 | $SED -e 's/.*:://' -e 's/:/ /g'`\" + eval @S|@1=\"`$ECHO @S|@2 | $SED -e 's/::.*//' -e 's/:/ /g'`\ \@S|@@S|@1\" + ;; + *) + eval @S|@1=\"`$ECHO @S|@2 | $SED 's/:/ /g'`\" + ;; + esac +} +]])# _LT_PREPARE_PATH_LIST + + # _LT_SYS_DYNAMIC_LINKER([TAG]) # ----------------------------- # PORTME Fill in your ld.so characteristics @@ -2158,17 +2284,18 @@ m4_require([_LT_FILEUTILS_DEFAULTS])dnl m4_require([_LT_DECL_OBJDUMP])dnl m4_require([_LT_DECL_SED])dnl m4_require([_LT_CHECK_SHELL_FEATURES])dnl +m4_require([_LT_PREPARE_MUNGE_PATH_LIST])dnl AC_MSG_CHECKING([dynamic linker characteristics]) m4_if([$1], [], [ -if test "$GCC" = yes; then +if test yes = "$GCC"; then case $host_os in - darwin*) lt_awk_arg="/^libraries:/,/LR/" ;; - *) lt_awk_arg="/^libraries:/" ;; + darwin*) lt_awk_arg='/^libraries:/,/LR/' ;; + *) lt_awk_arg='/^libraries:/' ;; esac case $host_os in - mingw* | cegcc*) lt_sed_strip_eq="s,=\([[A-Za-z]]:\),\1,g" ;; - *) lt_sed_strip_eq="s,=/,/,g" ;; + mingw* | cegcc*) lt_sed_strip_eq='s|=\([[A-Za-z]]:\)|\1|g' ;; + *) lt_sed_strip_eq='s|=/|/|g' ;; esac lt_search_path_spec=`$CC -print-search-dirs | awk $lt_awk_arg | $SED -e "s/^libraries://" -e $lt_sed_strip_eq` case $lt_search_path_spec in @@ -2184,28 +2311,35 @@ if test "$GCC" = yes; then ;; esac # Ok, now we have the path, separated by spaces, we can step through it - # and add multilib dir if necessary. + # and add multilib dir if necessary... lt_tmp_lt_search_path_spec= - lt_multi_os_dir=`$CC $CPPFLAGS $CFLAGS $LDFLAGS -print-multi-os-directory 2>/dev/null` + lt_multi_os_dir=/`$CC $CPPFLAGS $CFLAGS $LDFLAGS -print-multi-os-directory 2>/dev/null` + # ...but if some path component already ends with the multilib dir we assume + # that all is fine and trust -print-search-dirs as is (GCC 4.2? or newer). + case "$lt_multi_os_dir; $lt_search_path_spec " in + "/; "* | "/.; "* | "/./; "* | *"$lt_multi_os_dir "* | *"$lt_multi_os_dir/ "*) + lt_multi_os_dir= + ;; + esac for lt_sys_path in $lt_search_path_spec; do - if test -d "$lt_sys_path/$lt_multi_os_dir"; then - lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path/$lt_multi_os_dir" - else + if test -d "$lt_sys_path$lt_multi_os_dir"; then + lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path$lt_multi_os_dir" + elif test -n "$lt_multi_os_dir"; then test -d "$lt_sys_path" && \ lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path" fi done lt_search_path_spec=`$ECHO "$lt_tmp_lt_search_path_spec" | awk ' -BEGIN {RS=" "; FS="/|\n";} { - lt_foo=""; - lt_count=0; +BEGIN {RS = " "; FS = "/|\n";} { + lt_foo = ""; + lt_count = 0; for (lt_i = NF; lt_i > 0; lt_i--) { if ($lt_i != "" && $lt_i != ".") { if ($lt_i == "..") { lt_count++; } else { if (lt_count == 0) { - lt_foo="/" $lt_i lt_foo; + lt_foo = "/" $lt_i lt_foo; } else { lt_count--; } @@ -2219,7 +2353,7 @@ BEGIN {RS=" "; FS="/|\n";} { # for these hosts. case $host_os in mingw* | cegcc*) lt_search_path_spec=`$ECHO "$lt_search_path_spec" |\ - $SED 's,/\([[A-Za-z]]:\),\1,g'` ;; + $SED 's|/\([[A-Za-z]]:\)|\1|g'` ;; esac sys_lib_search_path_spec=`$ECHO "$lt_search_path_spec" | $lt_NL2SP` else @@ -2228,7 +2362,7 @@ fi]) library_names_spec= libname_spec='lib$name' soname_spec= -shrext_cmds=".so" +shrext_cmds=.so postinstall_cmds= postuninstall_cmds= finish_cmds= @@ -2245,14 +2379,17 @@ hardcode_into_libs=no # flags to be left without arguments need_version=unknown +AC_ARG_VAR([LT_SYS_LIBRARY_PATH], +[User-defined run-time library search path.]) + case $host_os in aix3*) version_type=linux # correct to gnu/linux during the next big refactor - library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a' + library_names_spec='$libname$release$shared_ext$versuffix $libname.a' shlibpath_var=LIBPATH # AIX 3 has no versioning support, so we append a major version to the name. - soname_spec='${libname}${release}${shared_ext}$major' + soname_spec='$libname$release$shared_ext$major' ;; aix[[4-9]]*) @@ -2260,41 +2397,91 @@ aix[[4-9]]*) need_lib_prefix=no need_version=no hardcode_into_libs=yes - if test "$host_cpu" = ia64; then + if test ia64 = "$host_cpu"; then # AIX 5 supports IA64 - library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}' + library_names_spec='$libname$release$shared_ext$major $libname$release$shared_ext$versuffix $libname$shared_ext' shlibpath_var=LD_LIBRARY_PATH else # With GCC up to 2.95.x, collect2 would create an import file # for dependence libraries. The import file would start with - # the line `#! .'. This would cause the generated library to - # depend on `.', always an invalid library. This was fixed in + # the line '#! .'. This would cause the generated library to + # depend on '.', always an invalid library. This was fixed in # development snapshots of GCC prior to 3.0. case $host_os in aix4 | aix4.[[01]] | aix4.[[01]].*) if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)' echo ' yes ' - echo '#endif'; } | ${CC} -E - | $GREP yes > /dev/null; then + echo '#endif'; } | $CC -E - | $GREP yes > /dev/null; then : else can_build_shared=no fi ;; esac - # AIX (on Power*) has no versioning support, so currently we can not hardcode correct + # Using Import Files as archive members, it is possible to support + # filename-based versioning of shared library archives on AIX. While + # this would work for both with and without runtime linking, it will + # prevent static linking of such archives. So we do filename-based + # shared library versioning with .so extension only, which is used + # when both runtime linking and shared linking is enabled. + # Unfortunately, runtime linking may impact performance, so we do + # not want this to be the default eventually. Also, we use the + # versioned .so libs for executables only if there is the -brtl + # linker flag in LDFLAGS as well, or --with-aix-soname=svr4 only. + # To allow for filename-based versioning support, we need to create + # libNAME.so.V as an archive file, containing: + # *) an Import File, referring to the versioned filename of the + # archive as well as the shared archive member, telling the + # bitwidth (32 or 64) of that shared object, and providing the + # list of exported symbols of that shared object, eventually + # decorated with the 'weak' keyword + # *) the shared object with the F_LOADONLY flag set, to really avoid + # it being seen by the linker. + # At run time we better use the real file rather than another symlink, + # but for link time we create the symlink libNAME.so -> libNAME.so.V + + case $with_aix_soname,$aix_use_runtimelinking in + # AIX (on Power*) has no versioning support, so currently we cannot hardcode correct # soname into executable. Probably we can add versioning support to # collect2, so additional links can be useful in future. - if test "$aix_use_runtimelinking" = yes; then + aix,yes) # traditional libtool + dynamic_linker='AIX unversionable lib.so' # If using run time linking (on AIX 4.2 or later) use lib.so # instead of lib.a to let people know that these are not # typical AIX shared libraries. - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - else + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' + ;; + aix,no) # traditional AIX only + dynamic_linker='AIX lib.a[(]lib.so.V[)]' # We preserve .a as extension for shared libraries through AIX4.2 # and later when we are not doing run time linking. - library_names_spec='${libname}${release}.a $libname.a' - soname_spec='${libname}${release}${shared_ext}$major' - fi + library_names_spec='$libname$release.a $libname.a' + soname_spec='$libname$release$shared_ext$major' + ;; + svr4,*) # full svr4 only + dynamic_linker="AIX lib.so.V[(]$shared_archive_member_spec.o[)]" + library_names_spec='$libname$release$shared_ext$major $libname$shared_ext' + # We do not specify a path in Import Files, so LIBPATH fires. + shlibpath_overrides_runpath=yes + ;; + *,yes) # both, prefer svr4 + dynamic_linker="AIX lib.so.V[(]$shared_archive_member_spec.o[)], lib.a[(]lib.so.V[)]" + library_names_spec='$libname$release$shared_ext$major $libname$shared_ext' + # unpreferred sharedlib libNAME.a needs extra handling + postinstall_cmds='test -n "$linkname" || linkname="$realname"~func_stripname "" ".so" "$linkname"~$install_shared_prog "$dir/$func_stripname_result.$libext" "$destdir/$func_stripname_result.$libext"~test -z "$tstripme" || test -z "$striplib" || $striplib "$destdir/$func_stripname_result.$libext"' + postuninstall_cmds='for n in $library_names $old_library; do :; done~func_stripname "" ".so" "$n"~test "$func_stripname_result" = "$n" || func_append rmfiles " $odir/$func_stripname_result.$libext"' + # We do not specify a path in Import Files, so LIBPATH fires. + shlibpath_overrides_runpath=yes + ;; + *,no) # both, prefer aix + dynamic_linker="AIX lib.a[(]lib.so.V[)], lib.so.V[(]$shared_archive_member_spec.o[)]" + library_names_spec='$libname$release.a $libname.a' + soname_spec='$libname$release$shared_ext$major' + # unpreferred sharedlib libNAME.so.V and symlink libNAME.so need extra handling + postinstall_cmds='test -z "$dlname" || $install_shared_prog $dir/$dlname $destdir/$dlname~test -z "$tstripme" || test -z "$striplib" || $striplib $destdir/$dlname~test -n "$linkname" || linkname=$realname~func_stripname "" ".a" "$linkname"~(cd "$destdir" && $LN_S -f $dlname $func_stripname_result.so)' + postuninstall_cmds='test -z "$dlname" || func_append rmfiles " $odir/$dlname"~for n in $old_library $library_names; do :; done~func_stripname "" ".a" "$n"~func_append rmfiles " $odir/$func_stripname_result.so"' + ;; + esac shlibpath_var=LIBPATH fi ;; @@ -2304,18 +2491,18 @@ amigaos*) powerpc) # Since July 2007 AmigaOS4 officially supports .so libraries. # When compiling the executable, add -use-dynld -Lsobjs: to the compileline. - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' ;; m68k) library_names_spec='$libname.ixlibrary $libname.a' # Create ${libname}_ixlibrary.a entries in /sys/libs. - finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`func_echo_all "$lib" | $SED '\''s%^.*/\([[^/]]*\)\.ixlibrary$%\1%'\''`; test $RM /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done' + finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`func_echo_all "$lib" | $SED '\''s%^.*/\([[^/]]*\)\.ixlibrary$%\1%'\''`; $RM /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done' ;; esac ;; beos*) - library_names_spec='${libname}${shared_ext}' + library_names_spec='$libname$shared_ext' dynamic_linker="$host_os ld.so" shlibpath_var=LIBRARY_PATH ;; @@ -2323,8 +2510,8 @@ beos*) bsdi[[45]]*) version_type=linux # correct to gnu/linux during the next big refactor need_version=no - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' + soname_spec='$libname$release$shared_ext$major' finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir' shlibpath_var=LD_LIBRARY_PATH sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib" @@ -2336,7 +2523,7 @@ bsdi[[45]]*) cygwin* | mingw* | pw32* | cegcc*) version_type=windows - shrext_cmds=".dll" + shrext_cmds=.dll need_version=no need_lib_prefix=no @@ -2345,8 +2532,8 @@ cygwin* | mingw* | pw32* | cegcc*) # gcc library_names_spec='$libname.dll.a' # DLL is installed to $(libdir)/../bin by postinstall_cmds - postinstall_cmds='base_file=`basename \${file}`~ - dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~ + postinstall_cmds='base_file=`basename \$file`~ + dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\$base_file'\''i; echo \$dlname'\''`~ dldir=$destdir/`dirname \$dlpath`~ test -d \$dldir || mkdir -p \$dldir~ $install_prog $dir/$dlname \$dldir/$dlname~ @@ -2362,17 +2549,17 @@ cygwin* | mingw* | pw32* | cegcc*) case $host_os in cygwin*) # Cygwin DLLs use 'cyg' prefix rather than 'lib' - soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}' + soname_spec='`echo $libname | sed -e 's/^lib/cyg/'``echo $release | $SED -e 's/[[.]]/-/g'`$versuffix$shared_ext' m4_if([$1], [],[ sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/lib/w32api"]) ;; mingw* | cegcc*) # MinGW DLLs use traditional 'lib' prefix - soname_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}' + soname_spec='$libname`echo $release | $SED -e 's/[[.]]/-/g'`$versuffix$shared_ext' ;; pw32*) # pw32 DLLs use 'pw' prefix rather than 'lib' - library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}' + library_names_spec='`echo $libname | sed -e 's/^lib/pw/'``echo $release | $SED -e 's/[[.]]/-/g'`$versuffix$shared_ext' ;; esac dynamic_linker='Win32 ld.exe' @@ -2381,8 +2568,8 @@ m4_if([$1], [],[ *,cl*) # Native MSVC libname_spec='$name' - soname_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}' - library_names_spec='${libname}.dll.lib' + soname_spec='$libname`echo $release | $SED -e 's/[[.]]/-/g'`$versuffix$shared_ext' + library_names_spec='$libname.dll.lib' case $build_os in mingw*) @@ -2409,7 +2596,7 @@ m4_if([$1], [],[ sys_lib_search_path_spec=`cygpath --path --unix "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` ;; *) - sys_lib_search_path_spec="$LIB" + sys_lib_search_path_spec=$LIB if $ECHO "$sys_lib_search_path_spec" | [$GREP ';[c-zC-Z]:/' >/dev/null]; then # It is most probably a Windows format PATH. sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` @@ -2422,8 +2609,8 @@ m4_if([$1], [],[ esac # DLL is installed to $(libdir)/../bin by postinstall_cmds - postinstall_cmds='base_file=`basename \${file}`~ - dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~ + postinstall_cmds='base_file=`basename \$file`~ + dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\$base_file'\''i; echo \$dlname'\''`~ dldir=$destdir/`dirname \$dlpath`~ test -d \$dldir || mkdir -p \$dldir~ $install_prog $dir/$dlname \$dldir/$dlname' @@ -2436,7 +2623,7 @@ m4_if([$1], [],[ *) # Assume MSVC wrapper - library_names_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext} $libname.lib' + library_names_spec='$libname`echo $release | $SED -e 's/[[.]]/-/g'`$versuffix$shared_ext $libname.lib' dynamic_linker='Win32 ld.exe' ;; esac @@ -2449,8 +2636,8 @@ darwin* | rhapsody*) version_type=darwin need_lib_prefix=no need_version=no - library_names_spec='${libname}${release}${major}$shared_ext ${libname}$shared_ext' - soname_spec='${libname}${release}${major}$shared_ext' + library_names_spec='$libname$release$major$shared_ext $libname$shared_ext' + soname_spec='$libname$release$major$shared_ext' shlibpath_overrides_runpath=yes shlibpath_var=DYLD_LIBRARY_PATH shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`' @@ -2463,8 +2650,8 @@ dgux*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext' - soname_spec='${libname}${release}${shared_ext}$major' + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' + soname_spec='$libname$release$shared_ext$major' shlibpath_var=LD_LIBRARY_PATH ;; @@ -2482,12 +2669,13 @@ freebsd* | dragonfly*) version_type=freebsd-$objformat case $version_type in freebsd-elf*) - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' + soname_spec='$libname$release$shared_ext$major' need_version=no need_lib_prefix=no ;; freebsd-*) - library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix' + library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix' need_version=yes ;; esac @@ -2512,26 +2700,15 @@ freebsd* | dragonfly*) esac ;; -gnu*) - version_type=linux # correct to gnu/linux during the next big refactor - need_lib_prefix=no - need_version=no - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=no - hardcode_into_libs=yes - ;; - haiku*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no dynamic_linker="$host_os runtime_loader" - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' + soname_spec='$libname$release$shared_ext$major' shlibpath_var=LIBRARY_PATH - shlibpath_overrides_runpath=yes + shlibpath_overrides_runpath=no sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/system/lib' hardcode_into_libs=yes ;; @@ -2549,14 +2726,15 @@ hpux9* | hpux10* | hpux11*) dynamic_linker="$host_os dld.so" shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - if test "X$HPUX_IA64_MODE" = X32; then + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' + soname_spec='$libname$release$shared_ext$major' + if test 32 = "$HPUX_IA64_MODE"; then sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib" + sys_lib_dlsearch_path_spec=/usr/lib/hpux32 else sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64" + sys_lib_dlsearch_path_spec=/usr/lib/hpux64 fi - sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec ;; hppa*64*) shrext_cmds='.sl' @@ -2564,8 +2742,8 @@ hpux9* | hpux10* | hpux11*) dynamic_linker="$host_os dld.sl" shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' + soname_spec='$libname$release$shared_ext$major' sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64" sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec ;; @@ -2574,8 +2752,8 @@ hpux9* | hpux10* | hpux11*) dynamic_linker="$host_os dld.sl" shlibpath_var=SHLIB_PATH shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' + soname_spec='$libname$release$shared_ext$major' ;; esac # HP-UX runs *really* slowly unless shared libraries are mode 555, ... @@ -2588,8 +2766,8 @@ interix[[3-9]]*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' + soname_spec='$libname$release$shared_ext$major' dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no @@ -2600,7 +2778,7 @@ irix5* | irix6* | nonstopux*) case $host_os in nonstopux*) version_type=nonstopux ;; *) - if test "$lt_cv_prog_gnu_ld" = yes; then + if test yes = "$lt_cv_prog_gnu_ld"; then version_type=linux # correct to gnu/linux during the next big refactor else version_type=irix @@ -2608,8 +2786,8 @@ irix5* | irix6* | nonstopux*) esac need_lib_prefix=no need_version=no - soname_spec='${libname}${release}${shared_ext}$major' - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}' + soname_spec='$libname$release$shared_ext$major' + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$release$shared_ext $libname$shared_ext' case $host_os in irix5* | nonstopux*) libsuff= shlibsuff= @@ -2628,8 +2806,8 @@ irix5* | irix6* | nonstopux*) esac shlibpath_var=LD_LIBRARY${shlibsuff}_PATH shlibpath_overrides_runpath=no - sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}" - sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}" + sys_lib_search_path_spec="/usr/lib$libsuff /lib$libsuff /usr/local/lib$libsuff" + sys_lib_dlsearch_path_spec="/usr/lib$libsuff /lib$libsuff" hardcode_into_libs=yes ;; @@ -2638,13 +2816,33 @@ linux*oldld* | linux*aout* | linux*coff*) dynamic_linker=no ;; +linux*android*) + version_type=none # Android doesn't support versioned libraries. + need_lib_prefix=no + need_version=no + library_names_spec='$libname$release$shared_ext' + soname_spec='$libname$release$shared_ext' + finish_cmds= + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + + # This implies no fast_install, which is unacceptable. + # Some rework will be needed to allow for fast_install + # before this can be enabled. + hardcode_into_libs=yes + + dynamic_linker='Android linker' + # Don't embed -rpath directories since the linker doesn't support them. + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' + ;; + # This must be glibc/ELF. -linux* | k*bsd*-gnu | kopensolaris*-gnu) +linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' + soname_spec='$libname$release$shared_ext$major' finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no @@ -2672,11 +2870,15 @@ linux* | k*bsd*-gnu | kopensolaris*-gnu) # Add ABI-specific directories to the system library path. sys_lib_dlsearch_path_spec="/lib64 /usr/lib64 /lib /usr/lib" - # Append ld.so.conf contents to the search path + # Ideally, we could use ldconfig to report *all* directores which are + # searched for libraries, however this is still not possible. Aside from not + # being certain /sbin/ldconfig is available, command + # 'ldconfig -N -X -v | grep ^/' on 64bit Fedora does not report /usr/lib64, + # even though it is searched at run-time. Try to do the best guess by + # appending ld.so.conf contents (and includes) to the search path. if test -f /etc/ld.so.conf; then lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \[$]2)); skip = 1; } { if (!skip) print \[$]0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[ ]*hwcap[ ]/d;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;s/"//g;/^$/d' | tr '\n' ' '` sys_lib_dlsearch_path_spec="$sys_lib_dlsearch_path_spec $lt_ld_extra" - fi # We used to test for /lib/ld.so.1 and disable shared libraries on @@ -2693,12 +2895,12 @@ netbsd*) need_lib_prefix=no need_version=no if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' + library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix' finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' dynamic_linker='NetBSD (a.out) ld.so' else - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' + soname_spec='$libname$release$shared_ext$major' dynamic_linker='NetBSD ld.elf_so' fi shlibpath_var=LD_LIBRARY_PATH @@ -2708,7 +2910,7 @@ netbsd*) newsos6) version_type=linux # correct to gnu/linux during the next big refactor - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes ;; @@ -2717,58 +2919,68 @@ newsos6) version_type=qnx need_lib_prefix=no need_version=no - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' + soname_spec='$libname$release$shared_ext$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes dynamic_linker='ldqnx.so' ;; -openbsd*) +openbsd* | bitrig*) version_type=sunos - sys_lib_dlsearch_path_spec="/usr/lib" + sys_lib_dlsearch_path_spec=/usr/lib need_lib_prefix=no - # Some older versions of OpenBSD (3.3 at least) *do* need versioned libs. - case $host_os in - openbsd3.3 | openbsd3.3.*) need_version=yes ;; - *) need_version=no ;; - esac - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' - finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' - shlibpath_var=LD_LIBRARY_PATH - if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then - case $host_os in - openbsd2.[[89]] | openbsd2.[[89]].*) - shlibpath_overrides_runpath=no - ;; - *) - shlibpath_overrides_runpath=yes - ;; - esac + if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`"; then + need_version=no else - shlibpath_overrides_runpath=yes + need_version=yes fi + library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix' + finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes ;; os2*) libname_spec='$name' - shrext_cmds=".dll" + version_type=windows + shrext_cmds=.dll + need_version=no need_lib_prefix=no - library_names_spec='$libname${shared_ext} $libname.a' + # OS/2 can only load a DLL with a base name of 8 characters or less. + soname_spec='`test -n "$os2dllname" && libname="$os2dllname"; + v=$($ECHO $release$versuffix | tr -d .-); + n=$($ECHO $libname | cut -b -$((8 - ${#v})) | tr . _); + $ECHO $n$v`$shared_ext' + library_names_spec='${libname}_dll.$libext' dynamic_linker='OS/2 ld.exe' - shlibpath_var=LIBPATH + shlibpath_var=BEGINLIBPATH + sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" + sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec + postinstall_cmds='base_file=`basename \$file`~ + dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\$base_file'\''i; $ECHO \$dlname'\''`~ + dldir=$destdir/`dirname \$dlpath`~ + test -d \$dldir || mkdir -p \$dldir~ + $install_prog $dir/$dlname \$dldir/$dlname~ + chmod a+x \$dldir/$dlname~ + if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then + eval '\''$striplib \$dldir/$dlname'\'' || exit \$?; + fi' + postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; $ECHO \$dlname'\''`~ + dlpath=$dir/\$dldll~ + $RM \$dlpath' ;; osf3* | osf4* | osf5*) version_type=osf need_lib_prefix=no need_version=no - soname_spec='${libname}${release}${shared_ext}$major' - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='$libname$release$shared_ext$major' + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' shlibpath_var=LD_LIBRARY_PATH sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib" - sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec" + sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec ;; rdos*) @@ -2779,8 +2991,8 @@ solaris*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' + soname_spec='$libname$release$shared_ext$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes @@ -2790,11 +3002,11 @@ solaris*) sunos4*) version_type=sunos - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' + library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix' finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes - if test "$with_gnu_ld" = yes; then + if test yes = "$with_gnu_ld"; then need_lib_prefix=no fi need_version=yes @@ -2802,8 +3014,8 @@ sunos4*) sysv4 | sysv4.3*) version_type=linux # correct to gnu/linux during the next big refactor - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' + soname_spec='$libname$release$shared_ext$major' shlibpath_var=LD_LIBRARY_PATH case $host_vendor in sni) @@ -2824,24 +3036,24 @@ sysv4 | sysv4.3*) ;; sysv4*MP*) - if test -d /usr/nec ;then + if test -d /usr/nec; then version_type=linux # correct to gnu/linux during the next big refactor - library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}' - soname_spec='$libname${shared_ext}.$major' + library_names_spec='$libname$shared_ext.$versuffix $libname$shared_ext.$major $libname$shared_ext' + soname_spec='$libname$shared_ext.$major' shlibpath_var=LD_LIBRARY_PATH fi ;; sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) - version_type=freebsd-elf + version_type=sco need_lib_prefix=no need_version=no - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext $libname$shared_ext' + soname_spec='$libname$release$shared_ext$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes - if test "$with_gnu_ld" = yes; then + if test yes = "$with_gnu_ld"; then sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib' else sys_lib_search_path_spec='/usr/ccs/lib /usr/lib' @@ -2859,7 +3071,7 @@ tpf*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes @@ -2867,8 +3079,8 @@ tpf*) uts4*) version_type=linux # correct to gnu/linux during the next big refactor - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' + soname_spec='$libname$release$shared_ext$major' shlibpath_var=LD_LIBRARY_PATH ;; @@ -2877,20 +3089,30 @@ uts4*) ;; esac AC_MSG_RESULT([$dynamic_linker]) -test "$dynamic_linker" = no && can_build_shared=no +test no = "$dynamic_linker" && can_build_shared=no variables_saved_for_relink="PATH $shlibpath_var $runpath_var" -if test "$GCC" = yes; then +if test yes = "$GCC"; then variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH" fi -if test "${lt_cv_sys_lib_search_path_spec+set}" = set; then - sys_lib_search_path_spec="$lt_cv_sys_lib_search_path_spec" +if test set = "${lt_cv_sys_lib_search_path_spec+set}"; then + sys_lib_search_path_spec=$lt_cv_sys_lib_search_path_spec fi -if test "${lt_cv_sys_lib_dlsearch_path_spec+set}" = set; then - sys_lib_dlsearch_path_spec="$lt_cv_sys_lib_dlsearch_path_spec" + +if test set = "${lt_cv_sys_lib_dlsearch_path_spec+set}"; then + sys_lib_dlsearch_path_spec=$lt_cv_sys_lib_dlsearch_path_spec fi +# remember unaugmented sys_lib_dlsearch_path content for libtool script decls... +configure_time_dlsearch_path=$sys_lib_dlsearch_path_spec + +# ... but it needs LT_SYS_LIBRARY_PATH munging for other configure-time code +func_munge_path_list sys_lib_dlsearch_path_spec "$LT_SYS_LIBRARY_PATH" + +# to be used as default LT_SYS_LIBRARY_PATH value in generated libtool +configure_time_lt_sys_library_path=$LT_SYS_LIBRARY_PATH + _LT_DECL([], [variables_saved_for_relink], [1], [Variables whose values should be saved in libtool wrapper scripts and restored at link time]) @@ -2923,39 +3145,41 @@ _LT_DECL([], [hardcode_into_libs], [0], [Whether we should hardcode library paths into libraries]) _LT_DECL([], [sys_lib_search_path_spec], [2], [Compile-time system search path for libraries]) -_LT_DECL([], [sys_lib_dlsearch_path_spec], [2], - [Run-time system search path for libraries]) +_LT_DECL([sys_lib_dlsearch_path_spec], [configure_time_dlsearch_path], [2], + [Detected run-time system search path for libraries]) +_LT_DECL([], [configure_time_lt_sys_library_path], [2], + [Explicit LT_SYS_LIBRARY_PATH set during ./configure time]) ])# _LT_SYS_DYNAMIC_LINKER # _LT_PATH_TOOL_PREFIX(TOOL) # -------------------------- -# find a file program which can recognize shared library +# find a file program that can recognize shared library AC_DEFUN([_LT_PATH_TOOL_PREFIX], [m4_require([_LT_DECL_EGREP])dnl AC_MSG_CHECKING([for $1]) AC_CACHE_VAL(lt_cv_path_MAGIC_CMD, [case $MAGIC_CMD in [[\\/*] | ?:[\\/]*]) - lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path. + lt_cv_path_MAGIC_CMD=$MAGIC_CMD # Let the user override the test with a path. ;; *) - lt_save_MAGIC_CMD="$MAGIC_CMD" - lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR + lt_save_MAGIC_CMD=$MAGIC_CMD + lt_save_ifs=$IFS; IFS=$PATH_SEPARATOR dnl $ac_dummy forces splitting on constant user-supplied paths. dnl POSIX.2 word splitting is done only on the output of word expansions, dnl not every word. This closes a longstanding sh security hole. ac_dummy="m4_if([$2], , $PATH, [$2])" for ac_dir in $ac_dummy; do - IFS="$lt_save_ifs" + IFS=$lt_save_ifs test -z "$ac_dir" && ac_dir=. - if test -f $ac_dir/$1; then - lt_cv_path_MAGIC_CMD="$ac_dir/$1" + if test -f "$ac_dir/$1"; then + lt_cv_path_MAGIC_CMD=$ac_dir/"$1" if test -n "$file_magic_test_file"; then case $deplibs_check_method in "file_magic "*) file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"` - MAGIC_CMD="$lt_cv_path_MAGIC_CMD" + MAGIC_CMD=$lt_cv_path_MAGIC_CMD if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null | $EGREP "$file_magic_regex" > /dev/null; then : @@ -2978,11 +3202,11 @@ _LT_EOF break fi done - IFS="$lt_save_ifs" - MAGIC_CMD="$lt_save_MAGIC_CMD" + IFS=$lt_save_ifs + MAGIC_CMD=$lt_save_MAGIC_CMD ;; esac]) -MAGIC_CMD="$lt_cv_path_MAGIC_CMD" +MAGIC_CMD=$lt_cv_path_MAGIC_CMD if test -n "$MAGIC_CMD"; then AC_MSG_RESULT($MAGIC_CMD) else @@ -3000,7 +3224,7 @@ dnl AC_DEFUN([AC_PATH_TOOL_PREFIX], []) # _LT_PATH_MAGIC # -------------- -# find a file program which can recognize a shared library +# find a file program that can recognize a shared library m4_defun([_LT_PATH_MAGIC], [_LT_PATH_TOOL_PREFIX(${ac_tool_prefix}file, /usr/bin$PATH_SEPARATOR$PATH) if test -z "$lt_cv_path_MAGIC_CMD"; then @@ -3027,16 +3251,16 @@ m4_require([_LT_PROG_ECHO_BACKSLASH])dnl AC_ARG_WITH([gnu-ld], [AS_HELP_STRING([--with-gnu-ld], [assume the C compiler uses GNU ld @<:@default=no@:>@])], - [test "$withval" = no || with_gnu_ld=yes], + [test no = "$withval" || with_gnu_ld=yes], [with_gnu_ld=no])dnl ac_prog=ld -if test "$GCC" = yes; then +if test yes = "$GCC"; then # Check if gcc -print-prog-name=ld gives a path. AC_MSG_CHECKING([for ld used by $CC]) case $host in *-*-mingw*) - # gcc leaves a trailing carriage return which upsets mingw + # gcc leaves a trailing carriage return, which upsets mingw ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;; *) ac_prog=`($CC -print-prog-name=ld) 2>&5` ;; @@ -3050,7 +3274,7 @@ if test "$GCC" = yes; then while $ECHO "$ac_prog" | $GREP "$re_direlt" > /dev/null 2>&1; do ac_prog=`$ECHO $ac_prog| $SED "s%$re_direlt%/%"` done - test -z "$LD" && LD="$ac_prog" + test -z "$LD" && LD=$ac_prog ;; "") # If it fails, then pretend we aren't using GCC. @@ -3061,37 +3285,37 @@ if test "$GCC" = yes; then with_gnu_ld=unknown ;; esac -elif test "$with_gnu_ld" = yes; then +elif test yes = "$with_gnu_ld"; then AC_MSG_CHECKING([for GNU ld]) else AC_MSG_CHECKING([for non-GNU ld]) fi AC_CACHE_VAL(lt_cv_path_LD, [if test -z "$LD"; then - lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR + lt_save_ifs=$IFS; IFS=$PATH_SEPARATOR for ac_dir in $PATH; do - IFS="$lt_save_ifs" + IFS=$lt_save_ifs test -z "$ac_dir" && ac_dir=. if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then - lt_cv_path_LD="$ac_dir/$ac_prog" + lt_cv_path_LD=$ac_dir/$ac_prog # Check to see if the program is GNU ld. I'd rather use --version, # but apparently some variants of GNU ld only accept -v. # Break only if it was the GNU/non-GNU ld that we prefer. case `"$lt_cv_path_LD" -v 2>&1 conftest.i +cat conftest.i conftest.i >conftest2.i +: ${lt_DD:=$DD} +AC_PATH_PROGS_FEATURE_CHECK([lt_DD], [dd], +[if "$ac_path_lt_DD" bs=32 count=1 conftest.out 2>/dev/null; then + cmp -s conftest.i conftest.out \ + && ac_cv_path_lt_DD="$ac_path_lt_DD" ac_path_lt_DD_found=: +fi]) +rm -f conftest.i conftest2.i conftest.out]) +])# _LT_PATH_DD + + +# _LT_CMD_TRUNCATE +# ---------------- +# find command to truncate a binary pipe +m4_defun([_LT_CMD_TRUNCATE], +[m4_require([_LT_PATH_DD]) +AC_CACHE_CHECK([how to truncate binary pipes], [lt_cv_truncate_bin], +[printf 0123456789abcdef0123456789abcdef >conftest.i +cat conftest.i conftest.i >conftest2.i +lt_cv_truncate_bin= +if "$ac_cv_path_lt_DD" bs=32 count=1 conftest.out 2>/dev/null; then + cmp -s conftest.i conftest.out \ + && lt_cv_truncate_bin="$ac_cv_path_lt_DD bs=4096 count=1" +fi +rm -f conftest.i conftest2.i conftest.out +test -z "$lt_cv_truncate_bin" && lt_cv_truncate_bin="$SED -e 4q"]) +_LT_DECL([lt_truncate_bin], [lt_cv_truncate_bin], [1], + [Command to truncate a binary pipe]) +])# _LT_CMD_TRUNCATE + + # _LT_CHECK_MAGIC_METHOD # ---------------------- # how to check for library dependencies @@ -3177,13 +3438,13 @@ lt_cv_deplibs_check_method='unknown' # Need to set the preceding variable on all platforms that support # interlibrary dependencies. # 'none' -- dependencies not supported. -# `unknown' -- same as none, but documents that we really don't know. +# 'unknown' -- same as none, but documents that we really don't know. # 'pass_all' -- all dependencies passed with no checks. # 'test_compile' -- check by making test program. # 'file_magic [[regex]]' -- check by looking for files in library path -# which responds to the $file_magic_cmd with a given extended regex. -# If you have `file' or equivalent on your system and you're not sure -# whether `pass_all' will *always* work, you probably want this one. +# that responds to the $file_magic_cmd with a given extended regex. +# If you have 'file' or equivalent on your system and you're not sure +# whether 'pass_all' will *always* work, you probably want this one. case $host_os in aix[[4-9]]*) @@ -3210,8 +3471,7 @@ mingw* | pw32*) # Base MSYS/MinGW do not provide the 'file' command needed by # func_win32_libid shell function, so use a weaker test based on 'objdump', # unless we find 'file', for example because we are cross-compiling. - # func_win32_libid assumes BSD nm, so disallow it if using MS dumpbin. - if ( test "$lt_cv_nm_interface" = "BSD nm" && file / ) >/dev/null 2>&1; then + if ( file / ) >/dev/null 2>&1; then lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL' lt_cv_file_magic_cmd='func_win32_libid' else @@ -3247,10 +3507,6 @@ freebsd* | dragonfly*) fi ;; -gnu*) - lt_cv_deplibs_check_method=pass_all - ;; - haiku*) lt_cv_deplibs_check_method=pass_all ;; @@ -3289,7 +3545,7 @@ irix5* | irix6* | nonstopux*) ;; # This must be glibc/ELF. -linux* | k*bsd*-gnu | kopensolaris*-gnu) +linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) lt_cv_deplibs_check_method=pass_all ;; @@ -3311,8 +3567,8 @@ newos6*) lt_cv_deplibs_check_method=pass_all ;; -openbsd*) - if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then +openbsd* | bitrig*) + if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`"; then lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|\.so|_pic\.a)$' else lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$' @@ -3365,6 +3621,9 @@ sysv4 | sysv4.3*) tpf*) lt_cv_deplibs_check_method=pass_all ;; +os2*) + lt_cv_deplibs_check_method=pass_all + ;; esac ]) @@ -3405,33 +3664,38 @@ AC_DEFUN([LT_PATH_NM], AC_CACHE_CHECK([for BSD- or MS-compatible name lister (nm)], lt_cv_path_NM, [if test -n "$NM"; then # Let the user override the test. - lt_cv_path_NM="$NM" + lt_cv_path_NM=$NM else - lt_nm_to_check="${ac_tool_prefix}nm" + lt_nm_to_check=${ac_tool_prefix}nm if test -n "$ac_tool_prefix" && test "$build" = "$host"; then lt_nm_to_check="$lt_nm_to_check nm" fi for lt_tmp_nm in $lt_nm_to_check; do - lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR + lt_save_ifs=$IFS; IFS=$PATH_SEPARATOR for ac_dir in $PATH /usr/ccs/bin/elf /usr/ccs/bin /usr/ucb /bin; do - IFS="$lt_save_ifs" + IFS=$lt_save_ifs test -z "$ac_dir" && ac_dir=. - tmp_nm="$ac_dir/$lt_tmp_nm" - if test -f "$tmp_nm" || test -f "$tmp_nm$ac_exeext" ; then + tmp_nm=$ac_dir/$lt_tmp_nm + if test -f "$tmp_nm" || test -f "$tmp_nm$ac_exeext"; then # Check to see if the nm accepts a BSD-compat flag. - # Adding the `sed 1q' prevents false positives on HP-UX, which says: + # Adding the 'sed 1q' prevents false positives on HP-UX, which says: # nm: unknown option "B" ignored # Tru64's nm complains that /dev/null is an invalid object file - case `"$tmp_nm" -B /dev/null 2>&1 | sed '1q'` in - */dev/null* | *'Invalid file or object type'*) + # MSYS converts /dev/null to NUL, MinGW nm treats NUL as empty + case $build_os in + mingw*) lt_bad_file=conftest.nm/nofile ;; + *) lt_bad_file=/dev/null ;; + esac + case `"$tmp_nm" -B $lt_bad_file 2>&1 | sed '1q'` in + *$lt_bad_file* | *'Invalid file or object type'*) lt_cv_path_NM="$tmp_nm -B" - break + break 2 ;; *) case `"$tmp_nm" -p /dev/null 2>&1 | sed '1q'` in */dev/null*) lt_cv_path_NM="$tmp_nm -p" - break + break 2 ;; *) lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but @@ -3442,21 +3706,21 @@ else esac fi done - IFS="$lt_save_ifs" + IFS=$lt_save_ifs done : ${lt_cv_path_NM=no} fi]) -if test "$lt_cv_path_NM" != "no"; then - NM="$lt_cv_path_NM" +if test no != "$lt_cv_path_NM"; then + NM=$lt_cv_path_NM else # Didn't find any BSD compatible name lister, look for dumpbin. if test -n "$DUMPBIN"; then : # Let the user override the test. else AC_CHECK_TOOLS(DUMPBIN, [dumpbin "link -dump"], :) - case `$DUMPBIN -symbols /dev/null 2>&1 | sed '1q'` in + case `$DUMPBIN -symbols -headers /dev/null 2>&1 | sed '1q'` in *COFF*) - DUMPBIN="$DUMPBIN -symbols" + DUMPBIN="$DUMPBIN -symbols -headers" ;; *) DUMPBIN=: @@ -3464,8 +3728,8 @@ else esac fi AC_SUBST([DUMPBIN]) - if test "$DUMPBIN" != ":"; then - NM="$DUMPBIN" + if test : != "$DUMPBIN"; then + NM=$DUMPBIN fi fi test -z "$NM" && NM=nm @@ -3511,8 +3775,8 @@ lt_cv_sharedlib_from_linklib_cmd, case $host_os in cygwin* | mingw* | pw32* | cegcc*) - # two different shell functions defined in ltmain.sh - # decide which to use based on capabilities of $DLLTOOL + # two different shell functions defined in ltmain.sh; + # decide which one to use based on capabilities of $DLLTOOL case `$DLLTOOL --help 2>&1` in *--identify-strict*) lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib @@ -3524,7 +3788,7 @@ cygwin* | mingw* | pw32* | cegcc*) ;; *) # fallback: assume linklib IS sharedlib - lt_cv_sharedlib_from_linklib_cmd="$ECHO" + lt_cv_sharedlib_from_linklib_cmd=$ECHO ;; esac ]) @@ -3551,13 +3815,28 @@ AC_CACHE_CHECK([if $MANIFEST_TOOL is a manifest tool], [lt_cv_path_mainfest_tool lt_cv_path_mainfest_tool=yes fi rm -f conftest*]) -if test "x$lt_cv_path_mainfest_tool" != xyes; then +if test yes != "$lt_cv_path_mainfest_tool"; then MANIFEST_TOOL=: fi _LT_DECL([], [MANIFEST_TOOL], [1], [Manifest tool])dnl ])# _LT_PATH_MANIFEST_TOOL +# _LT_DLL_DEF_P([FILE]) +# --------------------- +# True iff FILE is a Windows DLL '.def' file. +# Keep in sync with func_dll_def_p in the libtool script +AC_DEFUN([_LT_DLL_DEF_P], +[dnl + test DEF = "`$SED -n dnl + -e '\''s/^[[ ]]*//'\'' dnl Strip leading whitespace + -e '\''/^\(;.*\)*$/d'\'' dnl Delete empty lines and comments + -e '\''s/^\(EXPORTS\|LIBRARY\)\([[ ]].*\)*$/DEF/p'\'' dnl + -e q dnl Only consider the first "real" line + $1`" dnl +])# _LT_DLL_DEF_P + + # LT_LIB_M # -------- # check for math library @@ -3569,11 +3848,11 @@ case $host in # These system don't have libm, or don't need it ;; *-ncr-sysv4.3*) - AC_CHECK_LIB(mw, _mwvalidcheckl, LIBM="-lmw") + AC_CHECK_LIB(mw, _mwvalidcheckl, LIBM=-lmw) AC_CHECK_LIB(m, cos, LIBM="$LIBM -lm") ;; *) - AC_CHECK_LIB(m, cos, LIBM="-lm") + AC_CHECK_LIB(m, cos, LIBM=-lm) ;; esac AC_SUBST([LIBM]) @@ -3592,7 +3871,7 @@ m4_defun([_LT_COMPILER_NO_RTTI], _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)= -if test "$GCC" = yes; then +if test yes = "$GCC"; then case $cc_basename in nvcc*) _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -Xcompiler -fno-builtin' ;; @@ -3644,7 +3923,7 @@ cygwin* | mingw* | pw32* | cegcc*) symcode='[[ABCDGISTW]]' ;; hpux*) - if test "$host_cpu" = ia64; then + if test ia64 = "$host_cpu"; then symcode='[[ABCDEGRST]]' fi ;; @@ -3677,14 +3956,44 @@ case `$NM -V 2>&1` in symcode='[[ABCDGIRSTW]]' ;; esac +if test "$lt_cv_nm_interface" = "MS dumpbin"; then + # Gets list of data symbols to import. + lt_cv_sys_global_symbol_to_import="sed -n -e 's/^I .* \(.*\)$/\1/p'" + # Adjust the below global symbol transforms to fixup imported variables. + lt_cdecl_hook=" -e 's/^I .* \(.*\)$/extern __declspec(dllimport) char \1;/p'" + lt_c_name_hook=" -e 's/^I .* \(.*\)$/ {\"\1\", (void *) 0},/p'" + lt_c_name_lib_hook="\ + -e 's/^I .* \(lib.*\)$/ {\"\1\", (void *) 0},/p'\ + -e 's/^I .* \(.*\)$/ {\"lib\1\", (void *) 0},/p'" +else + # Disable hooks by default. + lt_cv_sys_global_symbol_to_import= + lt_cdecl_hook= + lt_c_name_hook= + lt_c_name_lib_hook= +fi + # Transform an extracted symbol line into a proper C declaration. # Some systems (esp. on ia64) link data and code symbols differently, # so use this general approach. -lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'" +lt_cv_sys_global_symbol_to_cdecl="sed -n"\ +$lt_cdecl_hook\ +" -e 's/^T .* \(.*\)$/extern int \1();/p'"\ +" -e 's/^$symcode$symcode* .* \(.*\)$/extern char \1;/p'" # Transform an extracted symbol line into symbol name and symbol address -lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([[^ ]]*\)[[ ]]*$/ {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([[^ ]]*\) \([[^ ]]*\)$/ {\"\2\", (void *) \&\2},/p'" -lt_cv_sys_global_symbol_to_c_name_address_lib_prefix="sed -n -e 's/^: \([[^ ]]*\)[[ ]]*$/ {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([[^ ]]*\) \(lib[[^ ]]*\)$/ {\"\2\", (void *) \&\2},/p' -e 's/^$symcode* \([[^ ]]*\) \([[^ ]]*\)$/ {\"lib\2\", (void *) \&\2},/p'" +lt_cv_sys_global_symbol_to_c_name_address="sed -n"\ +$lt_c_name_hook\ +" -e 's/^: \(.*\) .*$/ {\"\1\", (void *) 0},/p'"\ +" -e 's/^$symcode$symcode* .* \(.*\)$/ {\"\1\", (void *) \&\1},/p'" + +# Transform an extracted symbol line into symbol name with lib prefix and +# symbol address. +lt_cv_sys_global_symbol_to_c_name_address_lib_prefix="sed -n"\ +$lt_c_name_lib_hook\ +" -e 's/^: \(.*\) .*$/ {\"\1\", (void *) 0},/p'"\ +" -e 's/^$symcode$symcode* .* \(lib.*\)$/ {\"\1\", (void *) \&\1},/p'"\ +" -e 's/^$symcode$symcode* .* \(.*\)$/ {\"lib\1\", (void *) \&\1},/p'" # Handle CRLF in mingw tool chain opt_cr= @@ -3702,21 +4011,24 @@ for ac_symprfx in "" "_"; do # Write the raw and C identifiers. if test "$lt_cv_nm_interface" = "MS dumpbin"; then - # Fake it for dumpbin and say T for any non-static function - # and D for any global variable. + # Fake it for dumpbin and say T for any non-static function, + # D for any global variable and I for any imported variable. # Also find C++ and __fastcall symbols from MSVC++, # which start with @ or ?. lt_cv_sys_global_symbol_pipe="$AWK ['"\ " {last_section=section; section=\$ 3};"\ " /^COFF SYMBOL TABLE/{for(i in hide) delete hide[i]};"\ " /Section length .*#relocs.*(pick any)/{hide[last_section]=1};"\ +" /^ *Symbol name *: /{split(\$ 0,sn,\":\"); si=substr(sn[2],2)};"\ +" /^ *Type *: code/{print \"T\",si,substr(si,length(prfx))};"\ +" /^ *Type *: data/{print \"I\",si,substr(si,length(prfx))};"\ " \$ 0!~/External *\|/{next};"\ " / 0+ UNDEF /{next}; / UNDEF \([^|]\)*()/{next};"\ " {if(hide[section]) next};"\ -" {f=0}; \$ 0~/\(\).*\|/{f=1}; {printf f ? \"T \" : \"D \"};"\ -" {split(\$ 0, a, /\||\r/); split(a[2], s)};"\ -" s[1]~/^[@?]/{print s[1], s[1]; next};"\ -" s[1]~prfx {split(s[1],t,\"@\"); print t[1], substr(t[1],length(prfx))}"\ +" {f=\"D\"}; \$ 0~/\(\).*\|/{f=\"T\"};"\ +" {split(\$ 0,a,/\||\r/); split(a[2],s)};"\ +" s[1]~/^[@?]/{print f,s[1],s[1]; next};"\ +" s[1]~prfx {split(s[1],t,\"@\"); print f,t[1],substr(t[1],length(prfx))}"\ " ' prfx=^$ac_symprfx]" else lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[[ ]]\($symcode$symcode*\)[[ ]][[ ]]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'" @@ -3756,11 +4068,11 @@ _LT_EOF if $GREP ' nm_test_func$' "$nlist" >/dev/null; then cat <<_LT_EOF > conftest.$ac_ext /* Keep this code in sync between libtool.m4, ltmain, lt_system.h, and tests. */ -#if defined(_WIN32) || defined(__CYGWIN__) || defined(_WIN32_WCE) -/* DATA imports from DLLs on WIN32 con't be const, because runtime +#if defined _WIN32 || defined __CYGWIN__ || defined _WIN32_WCE +/* DATA imports from DLLs on WIN32 can't be const, because runtime relocations are performed -- see ld's documentation on pseudo-relocs. */ # define LT@&t@_DLSYM_CONST -#elif defined(__osf__) +#elif defined __osf__ /* This system does not cope well with relocations in const data. */ # define LT@&t@_DLSYM_CONST #else @@ -3786,7 +4098,7 @@ lt__PROGRAM__LTX_preloaded_symbols[[]] = { { "@PROGRAM@", (void *) 0 }, _LT_EOF - $SED "s/^$symcode$symcode* \(.*\) \(.*\)$/ {\"\2\", (void *) \&\2},/" < "$nlist" | $GREP -v main >> conftest.$ac_ext + $SED "s/^$symcode$symcode* .* \(.*\)$/ {\"\1\", (void *) \&\1},/" < "$nlist" | $GREP -v main >> conftest.$ac_ext cat <<\_LT_EOF >> conftest.$ac_ext {0, (void *) 0} }; @@ -3806,9 +4118,9 @@ _LT_EOF mv conftest.$ac_objext conftstm.$ac_objext lt_globsym_save_LIBS=$LIBS lt_globsym_save_CFLAGS=$CFLAGS - LIBS="conftstm.$ac_objext" + LIBS=conftstm.$ac_objext CFLAGS="$CFLAGS$_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)" - if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext}; then + if AC_TRY_EVAL(ac_link) && test -s conftest$ac_exeext; then pipe_works=yes fi LIBS=$lt_globsym_save_LIBS @@ -3829,7 +4141,7 @@ _LT_EOF rm -rf conftest* conftst* # Do not use the global_symbol_pipe unless it works. - if test "$pipe_works" = yes; then + if test yes = "$pipe_works"; then break else lt_cv_sys_global_symbol_pipe= @@ -3856,12 +4168,16 @@ _LT_DECL([global_symbol_pipe], [lt_cv_sys_global_symbol_pipe], [1], [Take the output of nm and produce a listing of raw symbols and C names]) _LT_DECL([global_symbol_to_cdecl], [lt_cv_sys_global_symbol_to_cdecl], [1], [Transform the output of nm in a proper C declaration]) +_LT_DECL([global_symbol_to_import], [lt_cv_sys_global_symbol_to_import], [1], + [Transform the output of nm into a list of symbols to manually relocate]) _LT_DECL([global_symbol_to_c_name_address], [lt_cv_sys_global_symbol_to_c_name_address], [1], [Transform the output of nm in a C name address pair]) _LT_DECL([global_symbol_to_c_name_address_lib_prefix], [lt_cv_sys_global_symbol_to_c_name_address_lib_prefix], [1], [Transform the output of nm in a C name address pair when lib prefix is needed]) +_LT_DECL([nm_interface], [lt_cv_nm_interface], [1], + [The name lister interface]) _LT_DECL([], [nm_file_list_spec], [1], [Specify filename containing input files for $NM]) ]) # _LT_CMD_GLOBAL_SYMBOLS @@ -3877,17 +4193,18 @@ _LT_TAGVAR(lt_prog_compiler_static, $1)= m4_if([$1], [CXX], [ # C++ specific cases for pic, static, wl, etc. - if test "$GXX" = yes; then + if test yes = "$GXX"; then _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' case $host_os in aix*) # All AIX code is PIC. - if test "$host_cpu" = ia64; then + if test ia64 = "$host_cpu"; then # AIX 5 now supports IA64 processor _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' fi + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; amigaos*) @@ -3898,8 +4215,8 @@ m4_if([$1], [CXX], [ ;; m68k) # FIXME: we need at least 68020 code to build shared libraries, but - # adding the `-m68020' flag to GCC prevents building anything better, - # like `-m68040'. + # adding the '-m68020' flag to GCC prevents building anything better, + # like '-m68040'. _LT_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4' ;; esac @@ -3915,6 +4232,11 @@ m4_if([$1], [CXX], [ # (--disable-auto-import) libraries m4_if([$1], [GCJ], [], [_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT']) + case $host_os in + os2*) + _LT_TAGVAR(lt_prog_compiler_static, $1)='$wl-static' + ;; + esac ;; darwin* | rhapsody*) # PIC is the default on this platform @@ -3964,7 +4286,7 @@ m4_if([$1], [CXX], [ case $host_os in aix[[4-9]]*) # All AIX code is PIC. - if test "$host_cpu" = ia64; then + if test ia64 = "$host_cpu"; then # AIX 5 now supports IA64 processor _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' else @@ -4005,14 +4327,14 @@ m4_if([$1], [CXX], [ case $cc_basename in CC*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' - _LT_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive' - if test "$host_cpu" != ia64; then + _LT_TAGVAR(lt_prog_compiler_static, $1)='$wl-a ${wl}archive' + if test ia64 != "$host_cpu"; then _LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z' fi ;; aCC*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' - _LT_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive' + _LT_TAGVAR(lt_prog_compiler_static, $1)='$wl-a ${wl}archive' case $host_cpu in hppa*64*|ia64*) # +Z the default @@ -4041,7 +4363,7 @@ m4_if([$1], [CXX], [ ;; esac ;; - linux* | k*bsd*-gnu | kopensolaris*-gnu) + linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) case $cc_basename in KCC*) # KAI C++ Compiler @@ -4049,7 +4371,7 @@ m4_if([$1], [CXX], [ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; ecpc* ) - # old Intel C++ for x86_64 which still supported -KPIC. + # old Intel C++ for x86_64, which still supported -KPIC. _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' @@ -4194,17 +4516,18 @@ m4_if([$1], [CXX], [ fi ], [ - if test "$GCC" = yes; then + if test yes = "$GCC"; then _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' case $host_os in aix*) # All AIX code is PIC. - if test "$host_cpu" = ia64; then + if test ia64 = "$host_cpu"; then # AIX 5 now supports IA64 processor _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' fi + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; amigaos*) @@ -4215,8 +4538,8 @@ m4_if([$1], [CXX], [ ;; m68k) # FIXME: we need at least 68020 code to build shared libraries, but - # adding the `-m68020' flag to GCC prevents building anything better, - # like `-m68040'. + # adding the '-m68020' flag to GCC prevents building anything better, + # like '-m68040'. _LT_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4' ;; esac @@ -4233,6 +4556,11 @@ m4_if([$1], [CXX], [ # (--disable-auto-import) libraries m4_if([$1], [GCJ], [], [_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT']) + case $host_os in + os2*) + _LT_TAGVAR(lt_prog_compiler_static, $1)='$wl-static' + ;; + esac ;; darwin* | rhapsody*) @@ -4303,7 +4631,7 @@ m4_if([$1], [CXX], [ case $host_os in aix*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' - if test "$host_cpu" = ia64; then + if test ia64 = "$host_cpu"; then # AIX 5 now supports IA64 processor _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' else @@ -4311,11 +4639,30 @@ m4_if([$1], [CXX], [ fi ;; + darwin* | rhapsody*) + # PIC is the default on this platform + # Common symbols not allowed in MH_DYLIB files + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common' + case $cc_basename in + nagfor*) + # NAG Fortran compiler + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,-Wl,,' + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + ;; + esac + ;; + mingw* | cygwin* | pw32* | os2* | cegcc*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). m4_if([$1], [GCJ], [], [_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT']) + case $host_os in + os2*) + _LT_TAGVAR(lt_prog_compiler_static, $1)='$wl-static' + ;; + esac ;; hpux9* | hpux10* | hpux11*) @@ -4331,7 +4678,7 @@ m4_if([$1], [CXX], [ ;; esac # Is there a better lt_prog_compiler_static that works with the bundled CC? - _LT_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive' + _LT_TAGVAR(lt_prog_compiler_static, $1)='$wl-a ${wl}archive' ;; irix5* | irix6* | nonstopux*) @@ -4340,9 +4687,9 @@ m4_if([$1], [CXX], [ _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' ;; - linux* | k*bsd*-gnu | kopensolaris*-gnu) + linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) case $cc_basename in - # old Intel for x86_64 which still supported -KPIC. + # old Intel for x86_64, which still supported -KPIC. ecc*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' @@ -4367,6 +4714,12 @@ m4_if([$1], [CXX], [ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; + tcc*) + # Fabrice Bellard et al's Tiny C Compiler + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' + ;; pgcc* | pgf77* | pgf90* | pgf95* | pgfortran*) # Portland Group compilers (*not* the Pentium gcc compiler, # which looks to be a dead project) @@ -4464,7 +4817,7 @@ m4_if([$1], [CXX], [ ;; sysv4*MP*) - if test -d /usr/nec ;then + if test -d /usr/nec; then _LT_TAGVAR(lt_prog_compiler_pic, $1)='-Kconform_pic' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' fi @@ -4493,7 +4846,7 @@ m4_if([$1], [CXX], [ fi ]) case $host_os in - # For platforms which do not support PIC, -DPIC is meaningless: + # For platforms that do not support PIC, -DPIC is meaningless: *djgpp*) _LT_TAGVAR(lt_prog_compiler_pic, $1)= ;; @@ -4559,17 +4912,21 @@ m4_if([$1], [CXX], [ case $host_os in aix[[4-9]]*) # If we're using GNU nm, then we don't want the "-C" option. - # -C means demangle to AIX nm, but means don't demangle with GNU nm - # Also, AIX nm treats weak defined symbols like other global defined - # symbols, whereas GNU nm marks them as "W". + # -C means demangle to GNU nm, but means don't demangle to AIX nm. + # Without the "-l" option, or with the "-B" option, AIX nm treats + # weak defined symbols like other global defined symbols, whereas + # GNU nm marks them as "W". + # While the 'weak' keyword is ignored in the Export File, we need + # it in the Import File for the 'aix-soname' feature, so we have + # to replace the "-B" option with "-P" for AIX nm. if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then - _LT_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && ([substr](\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' + _LT_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && ([substr](\$ 3,1,1) != ".")) { if (\$ 2 == "W") { print \$ 3 " weak" } else { print \$ 3 } } }'\'' | sort -u > $export_symbols' else - _LT_TAGVAR(export_symbols_cmds, $1)='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && ([substr](\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' + _LT_TAGVAR(export_symbols_cmds, $1)='`func_echo_all $NM | $SED -e '\''s/B\([[^B]]*\)$/P\1/'\''` -PCpgl $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) && ([substr](\$ 1,1,1) != ".")) { if ((\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) { print \$ 1 " weak" } else { print \$ 1 } } }'\'' | sort -u > $export_symbols' fi ;; pw32*) - _LT_TAGVAR(export_symbols_cmds, $1)="$ltdll_cmds" + _LT_TAGVAR(export_symbols_cmds, $1)=$ltdll_cmds ;; cygwin* | mingw* | cegcc*) case $cc_basename in @@ -4615,9 +4972,9 @@ m4_if([$1], [CXX], [ # included in the symbol list _LT_TAGVAR(include_expsyms, $1)= # exclude_expsyms can be an extended regexp of symbols to exclude - # it will be wrapped by ` (' and `)$', so one must not match beginning or - # end of line. Example: `a|bc|.*d.*' will exclude the symbols `a' and `bc', - # as well as any symbol that contains `d'. + # it will be wrapped by ' (' and ')$', so one must not match beginning or + # end of line. Example: 'a|bc|.*d.*' will exclude the symbols 'a' and 'bc', + # as well as any symbol that contains 'd'. _LT_TAGVAR(exclude_expsyms, $1)=['_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*'] # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out # platforms (ab)use it in PIC code, but their linkers get confused if @@ -4633,7 +4990,7 @@ dnl Note also adjust exclude_expsyms for C++ above. # FIXME: the MSVC++ port hasn't been tested in a loooong time # When not using gcc, we currently assume that we are using # Microsoft Visual C++. - if test "$GCC" != yes; then + if test yes != "$GCC"; then with_gnu_ld=no fi ;; @@ -4641,7 +4998,7 @@ dnl Note also adjust exclude_expsyms for C++ above. # we just hope/assume this is gcc and not c89 (= MSVC++) with_gnu_ld=yes ;; - openbsd*) + openbsd* | bitrig*) with_gnu_ld=no ;; esac @@ -4651,7 +5008,7 @@ dnl Note also adjust exclude_expsyms for C++ above. # On some targets, GNU ld is compatible enough with the native linker # that we're better off using the native interface for both. lt_use_gnu_ld_interface=no - if test "$with_gnu_ld" = yes; then + if test yes = "$with_gnu_ld"; then case $host_os in aix*) # The AIX port of GNU ld has always aspired to compatibility @@ -4673,24 +5030,24 @@ dnl Note also adjust exclude_expsyms for C++ above. esac fi - if test "$lt_use_gnu_ld_interface" = yes; then + if test yes = "$lt_use_gnu_ld_interface"; then # If archive_cmds runs LD, not CC, wlarc should be empty - wlarc='${wl}' + wlarc='$wl' # Set some defaults for GNU ld with shared library support. These # are reset later if shared libraries are not supported. Putting them # here allows them to be overridden if necessary. runpath_var=LD_RUN_PATH - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' - _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir' + _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl--export-dynamic' # ancient GNU ld didn't support --whole-archive et. al. if $LD --help 2>&1 | $GREP 'no-whole-archive' > /dev/null; then - _LT_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' + _LT_TAGVAR(whole_archive_flag_spec, $1)=$wlarc'--whole-archive$convenience '$wlarc'--no-whole-archive' else _LT_TAGVAR(whole_archive_flag_spec, $1)= fi supports_anon_versioning=no - case `$LD -v 2>&1` in + case `$LD -v | $SED -e 's/([^)]\+)\s\+//' 2>&1` in *GNU\ gold*) supports_anon_versioning=yes ;; *\ [[01]].* | *\ 2.[[0-9]].* | *\ 2.10.*) ;; # catch versions < 2.11 *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ... @@ -4703,7 +5060,7 @@ dnl Note also adjust exclude_expsyms for C++ above. case $host_os in aix[[3-9]]*) # On AIX/PPC, the GNU linker is very broken - if test "$host_cpu" != ia64; then + if test ia64 != "$host_cpu"; then _LT_TAGVAR(ld_shlibs, $1)=no cat <<_LT_EOF 1>&2 @@ -4722,7 +5079,7 @@ _LT_EOF case $host_cpu in powerpc) # see comment about AmigaOS4 .so support - _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='' ;; m68k) @@ -4738,7 +5095,7 @@ _LT_EOF _LT_TAGVAR(allow_undefined_flag, $1)=unsupported # Joseph Beckenbach says some releases of gcc # support --undefined. This deserves some investigation. FIXME - _LT_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + _LT_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' else _LT_TAGVAR(ld_shlibs, $1)=no fi @@ -4748,7 +5105,7 @@ _LT_EOF # _LT_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless, # as there is no search path for DLLs. _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' - _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-all-symbols' + _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl--export-all-symbols' _LT_TAGVAR(allow_undefined_flag, $1)=unsupported _LT_TAGVAR(always_export_symbols, $1)=no _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes @@ -4756,61 +5113,89 @@ _LT_EOF _LT_TAGVAR(exclude_expsyms, $1)=['[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname'] if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then - _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' - # If the export-symbols file already is a .def file (1st line - # is EXPORTS), use it as is; otherwise, prepend... - _LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then - cp $export_symbols $output_objdir/$soname.def; - else - echo EXPORTS > $output_objdir/$soname.def; - cat $export_symbols >> $output_objdir/$soname.def; - fi~ - $CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname $wl--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' + # If the export-symbols file already is a .def file, use it as + # is; otherwise, prepend EXPORTS... + _LT_TAGVAR(archive_expsym_cmds, $1)='if _LT_DLL_DEF_P([$export_symbols]); then + cp $export_symbols $output_objdir/$soname.def; + else + echo EXPORTS > $output_objdir/$soname.def; + cat $export_symbols >> $output_objdir/$soname.def; + fi~ + $CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname $wl--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; haiku*) - _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' _LT_TAGVAR(link_all_deplibs, $1)=yes ;; + os2*) + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' + _LT_TAGVAR(hardcode_minus_L, $1)=yes + _LT_TAGVAR(allow_undefined_flag, $1)=unsupported + shrext_cmds=.dll + _LT_TAGVAR(archive_cmds, $1)='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~ + $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~ + $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~ + $ECHO EXPORTS >> $output_objdir/$libname.def~ + emxexp $libobjs | $SED /"_DLL_InitTerm"/d >> $output_objdir/$libname.def~ + $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~ + emximp -o $lib $output_objdir/$libname.def' + _LT_TAGVAR(archive_expsym_cmds, $1)='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~ + $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~ + $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~ + $ECHO EXPORTS >> $output_objdir/$libname.def~ + prefix_cmds="$SED"~ + if test EXPORTS = "`$SED 1q $export_symbols`"; then + prefix_cmds="$prefix_cmds -e 1d"; + fi~ + prefix_cmds="$prefix_cmds -e \"s/^\(.*\)$/_\1/g\""~ + cat $export_symbols | $prefix_cmds >> $output_objdir/$libname.def~ + $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~ + emximp -o $lib $output_objdir/$libname.def' + _LT_TAGVAR(old_archive_From_new_cmds, $1)='emximp -o $output_objdir/${libname}_dll.a $output_objdir/$libname.def' + _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes + ;; + interix[[3-9]]*) _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=no - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' - _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath,$libdir' + _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E' # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc. # Instead, shared libraries are loaded at an image base (0x10000000 by # default) and relocated if they conflict, which is a slow very memory # consuming and fragmenting process. To avoid this, we pick a random, # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link # time. Moving up from 0x10000000 also allows more sbrk(2) space. - _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' - _LT_TAGVAR(archive_expsym_cmds, $1)='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-h,$soname $wl--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='sed "s|^|_|" $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-h,$soname $wl--retain-symbols-file,$output_objdir/$soname.expsym $wl--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' ;; gnu* | linux* | tpf* | k*bsd*-gnu | kopensolaris*-gnu) tmp_diet=no - if test "$host_os" = linux-dietlibc; then + if test linux-dietlibc = "$host_os"; then case $cc_basename in diet\ *) tmp_diet=yes;; # linux-dietlibc with static linking (!diet-dyn) esac fi if $LD --help 2>&1 | $EGREP ': supported targets:.* elf' > /dev/null \ - && test "$tmp_diet" = no + && test no = "$tmp_diet" then tmp_addflag=' $pic_flag' tmp_sharedflag='-shared' case $cc_basename,$host_cpu in pgcc*) # Portland Group C compiler - _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' + _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive' tmp_addflag=' $pic_flag' ;; pgf77* | pgf90* | pgf95* | pgfortran*) # Portland Group f77 and f90 compilers - _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' + _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive' tmp_addflag=' $pic_flag -Mnomain' ;; ecc*,ia64* | icc*,ia64*) # Intel C compiler on ia64 tmp_addflag=' -i_dynamic' ;; @@ -4821,42 +5206,47 @@ _LT_EOF lf95*) # Lahey Fortran 8.1 _LT_TAGVAR(whole_archive_flag_spec, $1)= tmp_sharedflag='--shared' ;; + nagfor*) # NAGFOR 5.3 + tmp_sharedflag='-Wl,-shared' ;; xl[[cC]]* | bgxl[[cC]]* | mpixl[[cC]]*) # IBM XL C 8.0 on PPC (deal with xlf below) tmp_sharedflag='-qmkshrobj' tmp_addflag= ;; nvcc*) # Cuda Compiler Driver 2.2 - _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' + _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive' _LT_TAGVAR(compiler_needs_object, $1)=yes ;; esac case `$CC -V 2>&1 | sed 5q` in *Sun\ C*) # Sun C 5.9 - _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' + _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive' _LT_TAGVAR(compiler_needs_object, $1)=yes tmp_sharedflag='-G' ;; *Sun\ F*) # Sun Fortran 8.3 tmp_sharedflag='-G' ;; esac - _LT_TAGVAR(archive_cmds, $1)='$CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + _LT_TAGVAR(archive_cmds, $1)='$CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' - if test "x$supports_anon_versioning" = xyes; then + if test yes = "$supports_anon_versioning"; then _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~ - cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ - echo "local: *; };" >> $output_objdir/$libname.ver~ - $CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib' + cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ + echo "local: *; };" >> $output_objdir/$libname.ver~ + $CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-version-script $wl$output_objdir/$libname.ver -o $lib' fi case $cc_basename in + tcc*) + _LT_TAGVAR(export_dynamic_flag_spec, $1)='-rdynamic' + ;; xlf* | bgf* | bgxlf* | mpixlf*) # IBM XL Fortran 10.1 on PPC cannot create shared libs itself _LT_TAGVAR(whole_archive_flag_spec, $1)='--whole-archive$convenience --no-whole-archive' - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir' _LT_TAGVAR(archive_cmds, $1)='$LD -shared $libobjs $deplibs $linker_flags -soname $soname -o $lib' - if test "x$supports_anon_versioning" = xyes; then + if test yes = "$supports_anon_versioning"; then _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~ - cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ - echo "local: *; };" >> $output_objdir/$libname.ver~ - $LD -shared $libobjs $deplibs $linker_flags -soname $soname -version-script $output_objdir/$libname.ver -o $lib' + cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ + echo "local: *; };" >> $output_objdir/$libname.ver~ + $LD -shared $libobjs $deplibs $linker_flags -soname $soname -version-script $output_objdir/$libname.ver -o $lib' fi ;; esac @@ -4870,8 +5260,8 @@ _LT_EOF _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib' wlarc= else - _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' - _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' fi ;; @@ -4889,8 +5279,8 @@ _LT_EOF _LT_EOF elif $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then - _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' - _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' else _LT_TAGVAR(ld_shlibs, $1)=no fi @@ -4902,7 +5292,7 @@ _LT_EOF _LT_TAGVAR(ld_shlibs, $1)=no cat <<_LT_EOF 1>&2 -*** Warning: Releases of the GNU linker prior to 2.16.91.0.3 can not +*** Warning: Releases of the GNU linker prior to 2.16.91.0.3 cannot *** reliably create shared libraries on SCO systems. Therefore, libtool *** is disabling shared libraries support. We urge you to upgrade GNU *** binutils to release 2.16.91.0.3 or newer. Another option is to modify @@ -4917,9 +5307,9 @@ _LT_EOF # DT_RUNPATH tag from executables and libraries. But doing so # requires that you compile everything twice, which is a pain. if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' - _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' - _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' else _LT_TAGVAR(ld_shlibs, $1)=no fi @@ -4936,15 +5326,15 @@ _LT_EOF *) if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then - _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' - _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; esac - if test "$_LT_TAGVAR(ld_shlibs, $1)" = no; then + if test no = "$_LT_TAGVAR(ld_shlibs, $1)"; then runpath_var= _LT_TAGVAR(hardcode_libdir_flag_spec, $1)= _LT_TAGVAR(export_dynamic_flag_spec, $1)= @@ -4960,7 +5350,7 @@ _LT_EOF # Note: this linker hardcodes the directories in LIBPATH if there # are no directories specified by -L. _LT_TAGVAR(hardcode_minus_L, $1)=yes - if test "$GCC" = yes && test -z "$lt_prog_compiler_static"; then + if test yes = "$GCC" && test -z "$lt_prog_compiler_static"; then # Neither direct hardcoding nor static linking is supported with a # broken collect2. _LT_TAGVAR(hardcode_direct, $1)=unsupported @@ -4968,34 +5358,57 @@ _LT_EOF ;; aix[[4-9]]*) - if test "$host_cpu" = ia64; then + if test ia64 = "$host_cpu"; then # On IA64, the linker does run time linking by default, so we don't # have to do anything special. aix_use_runtimelinking=no exp_sym_flag='-Bexport' - no_entry_flag="" + no_entry_flag= else # If we're using GNU nm, then we don't want the "-C" option. - # -C means demangle to AIX nm, but means don't demangle with GNU nm - # Also, AIX nm treats weak defined symbols like other global - # defined symbols, whereas GNU nm marks them as "W". + # -C means demangle to GNU nm, but means don't demangle to AIX nm. + # Without the "-l" option, or with the "-B" option, AIX nm treats + # weak defined symbols like other global defined symbols, whereas + # GNU nm marks them as "W". + # While the 'weak' keyword is ignored in the Export File, we need + # it in the Import File for the 'aix-soname' feature, so we have + # to replace the "-B" option with "-P" for AIX nm. if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then - _LT_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && ([substr](\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' + _LT_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && ([substr](\$ 3,1,1) != ".")) { if (\$ 2 == "W") { print \$ 3 " weak" } else { print \$ 3 } } }'\'' | sort -u > $export_symbols' else - _LT_TAGVAR(export_symbols_cmds, $1)='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && ([substr](\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' + _LT_TAGVAR(export_symbols_cmds, $1)='`func_echo_all $NM | $SED -e '\''s/B\([[^B]]*\)$/P\1/'\''` -PCpgl $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) && ([substr](\$ 1,1,1) != ".")) { if ((\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) { print \$ 1 " weak" } else { print \$ 1 } } }'\'' | sort -u > $export_symbols' fi aix_use_runtimelinking=no # Test if we are trying to use run time linking or normal # AIX style linking. If -brtl is somewhere in LDFLAGS, we - # need to do runtime linking. + # have runtime linking enabled, and use it for executables. + # For shared libraries, we enable/disable runtime linking + # depending on the kind of the shared library created - + # when "with_aix_soname,aix_use_runtimelinking" is: + # "aix,no" lib.a(lib.so.V) shared, rtl:no, for executables + # "aix,yes" lib.so shared, rtl:yes, for executables + # lib.a static archive + # "both,no" lib.so.V(shr.o) shared, rtl:yes + # lib.a(lib.so.V) shared, rtl:no, for executables + # "both,yes" lib.so.V(shr.o) shared, rtl:yes, for executables + # lib.a(lib.so.V) shared, rtl:no + # "svr4,*" lib.so.V(shr.o) shared, rtl:yes, for executables + # lib.a static archive case $host_os in aix4.[[23]]|aix4.[[23]].*|aix[[5-9]]*) for ld_flag in $LDFLAGS; do - if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then + if (test x-brtl = "x$ld_flag" || test x-Wl,-brtl = "x$ld_flag"); then aix_use_runtimelinking=yes break fi done + if test svr4,no = "$with_aix_soname,$aix_use_runtimelinking"; then + # With aix-soname=svr4, we create the lib.so.V shared archives only, + # so we don't have lib.a shared libs to link our executables. + # We have to force runtime linking in this case. + aix_use_runtimelinking=yes + LDFLAGS="$LDFLAGS -Wl,-brtl" + fi ;; esac @@ -5014,13 +5427,21 @@ _LT_EOF _LT_TAGVAR(hardcode_direct_absolute, $1)=yes _LT_TAGVAR(hardcode_libdir_separator, $1)=':' _LT_TAGVAR(link_all_deplibs, $1)=yes - _LT_TAGVAR(file_list_spec, $1)='${wl}-f,' + _LT_TAGVAR(file_list_spec, $1)='$wl-f,' + case $with_aix_soname,$aix_use_runtimelinking in + aix,*) ;; # traditional, no import file + svr4,* | *,yes) # use import file + # The Import File defines what to hardcode. + _LT_TAGVAR(hardcode_direct, $1)=no + _LT_TAGVAR(hardcode_direct_absolute, $1)=no + ;; + esac - if test "$GCC" = yes; then + if test yes = "$GCC"; then case $host_os in aix4.[[012]]|aix4.[[012]].*) # We only want to do this on AIX 4.2 and lower, the check # below for broken collect2 doesn't work under 4.3+ - collect2name=`${CC} -print-prog-name=collect2` + collect2name=`$CC -print-prog-name=collect2` if test -f "$collect2name" && strings "$collect2name" | $GREP resolve_lib_name >/dev/null then @@ -5039,61 +5460,80 @@ _LT_EOF ;; esac shared_flag='-shared' - if test "$aix_use_runtimelinking" = yes; then - shared_flag="$shared_flag "'${wl}-G' + if test yes = "$aix_use_runtimelinking"; then + shared_flag="$shared_flag "'$wl-G' fi + # Need to ensure runtime linking is disabled for the traditional + # shared library, or the linker may eventually find shared libraries + # /with/ Import File - we do not want to mix them. + shared_flag_aix='-shared' + shared_flag_svr4='-shared $wl-G' else # not using gcc - if test "$host_cpu" = ia64; then + if test ia64 = "$host_cpu"; then # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release # chokes on -Wl,-G. The following line is correct: shared_flag='-G' else - if test "$aix_use_runtimelinking" = yes; then - shared_flag='${wl}-G' + if test yes = "$aix_use_runtimelinking"; then + shared_flag='$wl-G' else - shared_flag='${wl}-bM:SRE' + shared_flag='$wl-bM:SRE' fi + shared_flag_aix='$wl-bM:SRE' + shared_flag_svr4='$wl-G' fi fi - _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-bexpall' + _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-bexpall' # It seems that -bexpall does not export symbols beginning with # underscore (_), so it is better to generate a list of symbols to export. _LT_TAGVAR(always_export_symbols, $1)=yes - if test "$aix_use_runtimelinking" = yes; then + if test aix,yes = "$with_aix_soname,$aix_use_runtimelinking"; then # Warning - without using the other runtime loading flags (-brtl), # -berok will link without error, but may produce a broken library. _LT_TAGVAR(allow_undefined_flag, $1)='-berok' # Determine the default libpath from the value encoded in an # empty executable. _LT_SYS_MODULE_PATH_AIX([$1]) - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath" - _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then func_echo_all "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag" + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-blibpath:$libdir:'"$aix_libpath" + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $deplibs $wl'$no_entry_flag' $compiler_flags `if test -n "$allow_undefined_flag"; then func_echo_all "$wl$allow_undefined_flag"; else :; fi` $wl'$exp_sym_flag:\$export_symbols' '$shared_flag else - if test "$host_cpu" = ia64; then - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $libdir:/usr/lib:/lib' + if test ia64 = "$host_cpu"; then + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-R $libdir:/usr/lib:/lib' _LT_TAGVAR(allow_undefined_flag, $1)="-z nodefs" - _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols" + _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\$wl$no_entry_flag"' $compiler_flags $wl$allow_undefined_flag '"\$wl$exp_sym_flag:\$export_symbols" else # Determine the default libpath from the value encoded in an # empty executable. _LT_SYS_MODULE_PATH_AIX([$1]) - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath" + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-blibpath:$libdir:'"$aix_libpath" # Warning - without using the other run time loading flags, # -berok will link without error, but may produce a broken library. - _LT_TAGVAR(no_undefined_flag, $1)=' ${wl}-bernotok' - _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-berok' - if test "$with_gnu_ld" = yes; then + _LT_TAGVAR(no_undefined_flag, $1)=' $wl-bernotok' + _LT_TAGVAR(allow_undefined_flag, $1)=' $wl-berok' + if test yes = "$with_gnu_ld"; then # We only use this code for GNU lds that support --whole-archive. - _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive$convenience ${wl}--no-whole-archive' + _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl--whole-archive$convenience $wl--no-whole-archive' else # Exported symbols can be pulled into shared objects from archives _LT_TAGVAR(whole_archive_flag_spec, $1)='$convenience' fi _LT_TAGVAR(archive_cmds_need_lc, $1)=yes - # This is similar to how AIX traditionally builds its shared libraries. - _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname' + _LT_TAGVAR(archive_expsym_cmds, $1)='$RM -r $output_objdir/$realname.d~$MKDIR $output_objdir/$realname.d' + # -brtl affects multiple linker settings, -berok does not and is overridden later + compiler_flags_filtered='`func_echo_all "$compiler_flags " | $SED -e "s%-brtl\\([[, ]]\\)%-berok\\1%g"`' + if test svr4 != "$with_aix_soname"; then + # This is similar to how AIX traditionally builds its shared libraries. + _LT_TAGVAR(archive_expsym_cmds, $1)="$_LT_TAGVAR(archive_expsym_cmds, $1)"'~$CC '$shared_flag_aix' -o $output_objdir/$realname.d/$soname $libobjs $deplibs $wl-bnoentry '$compiler_flags_filtered'$wl-bE:$export_symbols$allow_undefined_flag~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$realname.d/$soname' + fi + if test aix != "$with_aix_soname"; then + _LT_TAGVAR(archive_expsym_cmds, $1)="$_LT_TAGVAR(archive_expsym_cmds, $1)"'~$CC '$shared_flag_svr4' -o $output_objdir/$realname.d/$shared_archive_member_spec.o $libobjs $deplibs $wl-bnoentry '$compiler_flags_filtered'$wl-bE:$export_symbols$allow_undefined_flag~$STRIP -e $output_objdir/$realname.d/$shared_archive_member_spec.o~( func_echo_all "#! $soname($shared_archive_member_spec.o)"; if test shr_64 = "$shared_archive_member_spec"; then func_echo_all "# 64"; else func_echo_all "# 32"; fi; cat $export_symbols ) > $output_objdir/$realname.d/$shared_archive_member_spec.imp~$AR $AR_FLAGS $output_objdir/$soname $output_objdir/$realname.d/$shared_archive_member_spec.o $output_objdir/$realname.d/$shared_archive_member_spec.imp' + else + # used by -dlpreopen to get the symbols + _LT_TAGVAR(archive_expsym_cmds, $1)="$_LT_TAGVAR(archive_expsym_cmds, $1)"'~$MV $output_objdir/$realname.d/$soname $output_objdir' + fi + _LT_TAGVAR(archive_expsym_cmds, $1)="$_LT_TAGVAR(archive_expsym_cmds, $1)"'~$RM -r $output_objdir/$realname.d' fi fi ;; @@ -5102,7 +5542,7 @@ _LT_EOF case $host_cpu in powerpc) # see comment about AmigaOS4 .so support - _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='' ;; m68k) @@ -5132,16 +5572,17 @@ _LT_EOF # Tell ltmain to make .lib files, not .a files. libext=lib # Tell ltmain to make .dll files, not .so files. - shrext_cmds=".dll" + shrext_cmds=.dll # FIXME: Setting linknames here is a bad hack. - _LT_TAGVAR(archive_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-dll~linknames=' - _LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then - sed -n -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' -e '1\\\!p' < $export_symbols > $output_objdir/$soname.exp; - else - sed -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' < $export_symbols > $output_objdir/$soname.exp; - fi~ - $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~ - linknames=' + _LT_TAGVAR(archive_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~linknames=' + _LT_TAGVAR(archive_expsym_cmds, $1)='if _LT_DLL_DEF_P([$export_symbols]); then + cp "$export_symbols" "$output_objdir/$soname.def"; + echo "$tool_output_objdir$soname.def" > "$output_objdir/$soname.exp"; + else + $SED -e '\''s/^/-link -EXPORT:/'\'' < $export_symbols > $output_objdir/$soname.exp; + fi~ + $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~ + linknames=' # The linker will not automatically build a static lib if we build a DLL. # _LT_TAGVAR(old_archive_from_new_cmds, $1)='true' _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes @@ -5150,18 +5591,18 @@ _LT_EOF # Don't use ranlib _LT_TAGVAR(old_postinstall_cmds, $1)='chmod 644 $oldlib' _LT_TAGVAR(postlink_cmds, $1)='lt_outputfile="@OUTPUT@"~ - lt_tool_outputfile="@TOOL_OUTPUT@"~ - case $lt_outputfile in - *.exe|*.EXE) ;; - *) - lt_outputfile="$lt_outputfile.exe" - lt_tool_outputfile="$lt_tool_outputfile.exe" - ;; - esac~ - if test "$MANIFEST_TOOL" != ":" && test -f "$lt_outputfile.manifest"; then - $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1; - $RM "$lt_outputfile.manifest"; - fi' + lt_tool_outputfile="@TOOL_OUTPUT@"~ + case $lt_outputfile in + *.exe|*.EXE) ;; + *) + lt_outputfile=$lt_outputfile.exe + lt_tool_outputfile=$lt_tool_outputfile.exe + ;; + esac~ + if test : != "$MANIFEST_TOOL" && test -f "$lt_outputfile.manifest"; then + $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1; + $RM "$lt_outputfile.manifest"; + fi' ;; *) # Assume MSVC wrapper @@ -5170,7 +5611,7 @@ _LT_EOF # Tell ltmain to make .lib files, not .a files. libext=lib # Tell ltmain to make .dll files, not .so files. - shrext_cmds=".dll" + shrext_cmds=.dll # FIXME: Setting linknames here is a bad hack. _LT_TAGVAR(archive_cmds, $1)='$CC -o $lib $libobjs $compiler_flags `func_echo_all "$deplibs" | $SED '\''s/ -lc$//'\''` -link -dll~linknames=' # The linker will automatically build a .lib file if we build a DLL. @@ -5220,33 +5661,33 @@ _LT_EOF ;; hpux9*) - if test "$GCC" = yes; then - _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -shared $pic_flag ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' + if test yes = "$GCC"; then + _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -shared $pic_flag $wl+b $wl$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test "x$output_objdir/$soname" = "x$lib" || mv $output_objdir/$soname $lib' else - _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' + _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test "x$output_objdir/$soname" = "x$lib" || mv $output_objdir/$soname $lib' fi - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl+b $wl$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: _LT_TAGVAR(hardcode_direct, $1)=yes # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. _LT_TAGVAR(hardcode_minus_L, $1)=yes - _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' + _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E' ;; hpux10*) - if test "$GCC" = yes && test "$with_gnu_ld" = no; then - _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' + if test yes,no = "$GCC,$with_gnu_ld"; then + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $libobjs $deplibs $compiler_flags' else _LT_TAGVAR(archive_cmds, $1)='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' fi - if test "$with_gnu_ld" = no; then - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' + if test no = "$with_gnu_ld"; then + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl+b $wl$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_direct_absolute, $1)=yes - _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' + _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E' # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. _LT_TAGVAR(hardcode_minus_L, $1)=yes @@ -5254,25 +5695,25 @@ _LT_EOF ;; hpux11*) - if test "$GCC" = yes && test "$with_gnu_ld" = no; then + if test yes,no = "$GCC,$with_gnu_ld"; then case $host_cpu in hppa*64*) - _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $wl+h $wl$soname -o $lib $libobjs $deplibs $compiler_flags' ;; ia64*) - _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $wl+h $wl$soname $wl+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' ;; *) - _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $libobjs $deplibs $compiler_flags' ;; esac else case $host_cpu in hppa*64*) - _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' + _LT_TAGVAR(archive_cmds, $1)='$CC -b $wl+h $wl$soname -o $lib $libobjs $deplibs $compiler_flags' ;; ia64*) - _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' + _LT_TAGVAR(archive_cmds, $1)='$CC -b $wl+h $wl$soname $wl+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' ;; *) m4_if($1, [], [ @@ -5280,14 +5721,14 @@ _LT_EOF # (HP92453-01 A.11.01.20 doesn't, HP92453-01 B.11.X.35175-35176.GP does) _LT_LINKER_OPTION([if $CC understands -b], _LT_TAGVAR(lt_cv_prog_compiler__b, $1), [-b], - [_LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'], + [_LT_TAGVAR(archive_cmds, $1)='$CC -b $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $libobjs $deplibs $compiler_flags'], [_LT_TAGVAR(archive_cmds, $1)='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags'])], - [_LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags']) + [_LT_TAGVAR(archive_cmds, $1)='$CC -b $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $libobjs $deplibs $compiler_flags']) ;; esac fi - if test "$with_gnu_ld" = no; then - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' + if test no = "$with_gnu_ld"; then + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl+b $wl$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: case $host_cpu in @@ -5298,7 +5739,7 @@ _LT_EOF *) _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_direct_absolute, $1)=yes - _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' + _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E' # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. @@ -5309,16 +5750,16 @@ _LT_EOF ;; irix5* | irix6* | nonstopux*) - if test "$GCC" = yes; then - _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' + if test yes = "$GCC"; then + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib' # Try to use the -exported_symbol ld option, if it does not # work, assume that -exports_file does not work either and # implicitly export all symbols. # This should be the same for all languages, so no per-tag cache variable. AC_CACHE_CHECK([whether the $host_os linker accepts -exported_symbol], [lt_cv_irix_exported_symbol], - [save_LDFLAGS="$LDFLAGS" - LDFLAGS="$LDFLAGS -shared ${wl}-exported_symbol ${wl}foo ${wl}-update_registry ${wl}/dev/null" + [save_LDFLAGS=$LDFLAGS + LDFLAGS="$LDFLAGS -shared $wl-exported_symbol ${wl}foo $wl-update_registry $wl/dev/null" AC_LINK_IFELSE( [AC_LANG_SOURCE( [AC_LANG_CASE([C], [[int foo (void) { return 0; }]], @@ -5331,21 +5772,31 @@ _LT_EOF end]])])], [lt_cv_irix_exported_symbol=yes], [lt_cv_irix_exported_symbol=no]) - LDFLAGS="$save_LDFLAGS"]) - if test "$lt_cv_irix_exported_symbol" = yes; then - _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations ${wl}-exports_file ${wl}$export_symbols -o $lib' + LDFLAGS=$save_LDFLAGS]) + if test yes = "$lt_cv_irix_exported_symbol"; then + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations $wl-exports_file $wl$export_symbols -o $lib' fi else - _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' - _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -exports_file $export_symbols -o $lib' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -exports_file $export_symbols -o $lib' fi _LT_TAGVAR(archive_cmds_need_lc, $1)='no' - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: _LT_TAGVAR(inherit_rpath, $1)=yes _LT_TAGVAR(link_all_deplibs, $1)=yes ;; + linux*) + case $cc_basename in + tcc*) + # Fabrice Bellard et al's Tiny C Compiler + _LT_TAGVAR(ld_shlibs, $1)=yes + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' + ;; + esac + ;; + netbsd*) if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out @@ -5360,7 +5811,7 @@ _LT_EOF newsos6) _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(hardcode_direct, $1)=yes - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; @@ -5368,27 +5819,19 @@ _LT_EOF *nto* | *qnx*) ;; - openbsd*) + openbsd* | bitrig*) if test -f /usr/libexec/ld.so; then _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=no _LT_TAGVAR(hardcode_direct_absolute, $1)=yes - if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then + if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`"; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' - _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-retain-symbols-file,$export_symbols' - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' - _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags $wl-retain-symbols-file,$export_symbols' + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath,$libdir' + _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E' else - case $host_os in - openbsd[[01]].* | openbsd2.[[0-7]] | openbsd2.[[0-7]].*) - _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' - ;; - *) - _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' - ;; - esac + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath,$libdir' fi else _LT_TAGVAR(ld_shlibs, $1)=no @@ -5399,33 +5842,53 @@ _LT_EOF _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(hardcode_minus_L, $1)=yes _LT_TAGVAR(allow_undefined_flag, $1)=unsupported - _LT_TAGVAR(archive_cmds, $1)='$ECHO "LIBRARY $libname INITINSTANCE" > $output_objdir/$libname.def~$ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~echo DATA >> $output_objdir/$libname.def~echo " SINGLE NONSHARED" >> $output_objdir/$libname.def~echo EXPORTS >> $output_objdir/$libname.def~emxexp $libobjs >> $output_objdir/$libname.def~$CC -Zdll -Zcrtdll -o $lib $libobjs $deplibs $compiler_flags $output_objdir/$libname.def' - _LT_TAGVAR(old_archive_from_new_cmds, $1)='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def' + shrext_cmds=.dll + _LT_TAGVAR(archive_cmds, $1)='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~ + $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~ + $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~ + $ECHO EXPORTS >> $output_objdir/$libname.def~ + emxexp $libobjs | $SED /"_DLL_InitTerm"/d >> $output_objdir/$libname.def~ + $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~ + emximp -o $lib $output_objdir/$libname.def' + _LT_TAGVAR(archive_expsym_cmds, $1)='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~ + $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~ + $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~ + $ECHO EXPORTS >> $output_objdir/$libname.def~ + prefix_cmds="$SED"~ + if test EXPORTS = "`$SED 1q $export_symbols`"; then + prefix_cmds="$prefix_cmds -e 1d"; + fi~ + prefix_cmds="$prefix_cmds -e \"s/^\(.*\)$/_\1/g\""~ + cat $export_symbols | $prefix_cmds >> $output_objdir/$libname.def~ + $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~ + emximp -o $lib $output_objdir/$libname.def' + _LT_TAGVAR(old_archive_From_new_cmds, $1)='emximp -o $output_objdir/${libname}_dll.a $output_objdir/$libname.def' + _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes ;; osf3*) - if test "$GCC" = yes; then - _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' - _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' + if test yes = "$GCC"; then + _LT_TAGVAR(allow_undefined_flag, $1)=' $wl-expect_unresolved $wl\*' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared$allow_undefined_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib' else _LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*' - _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared$allow_undefined_flag $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib' fi _LT_TAGVAR(archive_cmds_need_lc, $1)='no' - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: ;; osf4* | osf5*) # as osf3* with the addition of -msym flag - if test "$GCC" = yes; then - _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' - _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $pic_flag $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' + if test yes = "$GCC"; then + _LT_TAGVAR(allow_undefined_flag, $1)=' $wl-expect_unresolved $wl\*' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared$allow_undefined_flag $pic_flag $libobjs $deplibs $compiler_flags $wl-msym $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib' + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir' else _LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*' - _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -msym -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared$allow_undefined_flag $libobjs $deplibs $compiler_flags -msym -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; printf "%s\\n" "-hidden">> $lib.exp~ - $CC -shared${allow_undefined_flag} ${wl}-input ${wl}$lib.exp $compiler_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && $ECHO "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib~$RM $lib.exp' + $CC -shared$allow_undefined_flag $wl-input $wl$lib.exp $compiler_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && $ECHO "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib~$RM $lib.exp' # Both c and cxx compiler support -rpath directly _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir' @@ -5436,24 +5899,24 @@ _LT_EOF solaris*) _LT_TAGVAR(no_undefined_flag, $1)=' -z defs' - if test "$GCC" = yes; then - wlarc='${wl}' - _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag ${wl}-z ${wl}text ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' + if test yes = "$GCC"; then + wlarc='$wl' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $wl-z ${wl}text $wl-h $wl$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ - $CC -shared $pic_flag ${wl}-z ${wl}text ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp' + $CC -shared $pic_flag $wl-z ${wl}text $wl-M $wl$lib.exp $wl-h $wl$soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp' else case `$CC -V 2>&1` in *"Compilers 5.0"*) wlarc='' - _LT_TAGVAR(archive_cmds, $1)='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags' + _LT_TAGVAR(archive_cmds, $1)='$LD -G$allow_undefined_flag -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ - $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$RM $lib.exp' + $LD -G$allow_undefined_flag -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$RM $lib.exp' ;; *) - wlarc='${wl}' - _LT_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $compiler_flags' + wlarc='$wl' + _LT_TAGVAR(archive_cmds, $1)='$CC -G$allow_undefined_flag -h $soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ - $CC -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp' + $CC -G$allow_undefined_flag -M $lib.exp -h $soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp' ;; esac fi @@ -5463,11 +5926,11 @@ _LT_EOF solaris2.[[0-5]] | solaris2.[[0-5]].*) ;; *) # The compiler driver will combine and reorder linker options, - # but understands `-z linker_flag'. GCC discards it without `$wl', + # but understands '-z linker_flag'. GCC discards it without '$wl', # but is careful enough not to reorder. # Supported since Solaris 2.6 (maybe 2.5.1?) - if test "$GCC" = yes; then - _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract' + if test yes = "$GCC"; then + _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl-z ${wl}allextract$convenience $wl-z ${wl}defaultextract' else _LT_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract' fi @@ -5477,10 +5940,10 @@ _LT_EOF ;; sunos4*) - if test "x$host_vendor" = xsequent; then + if test sequent = "$host_vendor"; then # Use $CC to link under sequent, because it throws in some extra .o # files that make .init and .fini sections work. - _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags' + _LT_TAGVAR(archive_cmds, $1)='$CC -G $wl-h $soname -o $lib $libobjs $deplibs $compiler_flags' else _LT_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags' fi @@ -5529,43 +5992,43 @@ _LT_EOF ;; sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[[01]].[[10]]* | unixware7* | sco3.2v5.0.[[024]]*) - _LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text' + _LT_TAGVAR(no_undefined_flag, $1)='$wl-z,text' _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=no runpath_var='LD_RUN_PATH' - if test "$GCC" = yes; then - _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' - _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + if test yes = "$GCC"; then + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' else - _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' - _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + _LT_TAGVAR(archive_cmds, $1)='$CC -G $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' fi ;; sysv5* | sco3.2v5* | sco5v6*) - # Note: We can NOT use -z defs as we might desire, because we do not + # Note: We CANNOT use -z defs as we might desire, because we do not # link with -lc, and that would cause any symbols used from libc to # always be unresolved, which means just about no library would # ever link correctly. If we're not using GNU ld we use -z text # though, which does catch some bad symbols but isn't as heavy-handed # as -z defs. - _LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text' - _LT_TAGVAR(allow_undefined_flag, $1)='${wl}-z,nodefs' + _LT_TAGVAR(no_undefined_flag, $1)='$wl-z,text' + _LT_TAGVAR(allow_undefined_flag, $1)='$wl-z,nodefs' _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=no - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R,$libdir' + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-R,$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=':' _LT_TAGVAR(link_all_deplibs, $1)=yes - _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Bexport' + _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-Bexport' runpath_var='LD_RUN_PATH' - if test "$GCC" = yes; then - _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' - _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + if test yes = "$GCC"; then + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' else - _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' - _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + _LT_TAGVAR(archive_cmds, $1)='$CC -G $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' fi ;; @@ -5580,17 +6043,17 @@ _LT_EOF ;; esac - if test x$host_vendor = xsni; then + if test sni = "$host_vendor"; then case $host in sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*) - _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Blargedynsym' + _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-Blargedynsym' ;; esac fi fi ]) AC_MSG_RESULT([$_LT_TAGVAR(ld_shlibs, $1)]) -test "$_LT_TAGVAR(ld_shlibs, $1)" = no && can_build_shared=no +test no = "$_LT_TAGVAR(ld_shlibs, $1)" && can_build_shared=no _LT_TAGVAR(with_gnu_ld, $1)=$with_gnu_ld @@ -5607,7 +6070,7 @@ x|xyes) # Assume -lc should be added _LT_TAGVAR(archive_cmds_need_lc, $1)=yes - if test "$enable_shared" = yes && test "$GCC" = yes; then + if test yes,yes = "$GCC,$enable_shared"; then case $_LT_TAGVAR(archive_cmds, $1) in *'~'*) # FIXME: we may have to deal with multi-command sequences. @@ -5687,12 +6150,12 @@ _LT_TAGDECL([], [hardcode_libdir_flag_spec], [1], _LT_TAGDECL([], [hardcode_libdir_separator], [1], [Whether we need a single "-rpath" flag with a separated argument]) _LT_TAGDECL([], [hardcode_direct], [0], - [Set to "yes" if using DIR/libNAME${shared_ext} during linking hardcodes + [Set to "yes" if using DIR/libNAME$shared_ext during linking hardcodes DIR into the resulting binary]) _LT_TAGDECL([], [hardcode_direct_absolute], [0], - [Set to "yes" if using DIR/libNAME${shared_ext} during linking hardcodes + [Set to "yes" if using DIR/libNAME$shared_ext during linking hardcodes DIR into the resulting binary and the resulting library dependency is - "absolute", i.e impossible to change by setting ${shlibpath_var} if the + "absolute", i.e impossible to change by setting $shlibpath_var if the library is relocated]) _LT_TAGDECL([], [hardcode_minus_L], [0], [Set to "yes" if using the -LDIR flag during linking hardcodes DIR @@ -5733,10 +6196,10 @@ dnl [Compiler flag to generate thread safe objects]) # ------------------------ # Ensure that the configuration variables for a C compiler are suitably # defined. These variables are subsequently used by _LT_CONFIG to write -# the compiler configuration to `libtool'. +# the compiler configuration to 'libtool'. m4_defun([_LT_LANG_C_CONFIG], [m4_require([_LT_DECL_EGREP])dnl -lt_save_CC="$CC" +lt_save_CC=$CC AC_LANG_PUSH(C) # Source file extension for C test sources. @@ -5776,18 +6239,18 @@ if test -n "$compiler"; then LT_SYS_DLOPEN_SELF _LT_CMD_STRIPLIB - # Report which library types will actually be built + # Report what library types will actually be built AC_MSG_CHECKING([if libtool supports shared libraries]) AC_MSG_RESULT([$can_build_shared]) AC_MSG_CHECKING([whether to build shared libraries]) - test "$can_build_shared" = "no" && enable_shared=no + test no = "$can_build_shared" && enable_shared=no # On AIX, shared libraries and static libraries use the same namespace, and # are all built from PIC. case $host_os in aix3*) - test "$enable_shared" = yes && enable_static=no + test yes = "$enable_shared" && enable_static=no if test -n "$RANLIB"; then archive_cmds="$archive_cmds~\$RANLIB \$lib" postinstall_cmds='$RANLIB $lib' @@ -5795,8 +6258,12 @@ if test -n "$compiler"; then ;; aix[[4-9]]*) - if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then - test "$enable_shared" = yes && enable_static=no + if test ia64 != "$host_cpu"; then + case $enable_shared,$with_aix_soname,$aix_use_runtimelinking in + yes,aix,yes) ;; # shared object as lib.so file only + yes,svr4,*) ;; # shared object as lib.so archive member only + yes,*) enable_static=no ;; # shared object in lib.a archive as well + esac fi ;; esac @@ -5804,13 +6271,13 @@ if test -n "$compiler"; then AC_MSG_CHECKING([whether to build static libraries]) # Make sure either enable_shared or enable_static is yes. - test "$enable_shared" = yes || enable_static=yes + test yes = "$enable_shared" || enable_static=yes AC_MSG_RESULT([$enable_static]) _LT_CONFIG($1) fi AC_LANG_POP -CC="$lt_save_CC" +CC=$lt_save_CC ])# _LT_LANG_C_CONFIG @@ -5818,14 +6285,14 @@ CC="$lt_save_CC" # -------------------------- # Ensure that the configuration variables for a C++ compiler are suitably # defined. These variables are subsequently used by _LT_CONFIG to write -# the compiler configuration to `libtool'. +# the compiler configuration to 'libtool'. m4_defun([_LT_LANG_CXX_CONFIG], [m4_require([_LT_FILEUTILS_DEFAULTS])dnl m4_require([_LT_DECL_EGREP])dnl m4_require([_LT_PATH_MANIFEST_TOOL])dnl -if test -n "$CXX" && ( test "X$CXX" != "Xno" && - ( (test "X$CXX" = "Xg++" && `g++ -v >/dev/null 2>&1` ) || - (test "X$CXX" != "Xg++"))) ; then +if test -n "$CXX" && ( test no != "$CXX" && + ( (test g++ = "$CXX" && `g++ -v >/dev/null 2>&1` ) || + (test g++ != "$CXX"))); then AC_PROG_CXXCPP else _lt_caught_CXX_error=yes @@ -5867,7 +6334,7 @@ _LT_TAGVAR(objext, $1)=$objext # the CXX compiler isn't working. Some variables (like enable_shared) # are currently assumed to apply to all compilers on this platform, # and will be corrupted by setting them based on a non-working compiler. -if test "$_lt_caught_CXX_error" != yes; then +if test yes != "$_lt_caught_CXX_error"; then # Code to be used in simple compile tests lt_simple_compile_test_code="int some_variable = 0;" @@ -5909,35 +6376,35 @@ if test "$_lt_caught_CXX_error" != yes; then if test -n "$compiler"; then # We don't want -fno-exception when compiling C++ code, so set the # no_builtin_flag separately - if test "$GXX" = yes; then + if test yes = "$GXX"; then _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin' else _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)= fi - if test "$GXX" = yes; then + if test yes = "$GXX"; then # Set up default GNU C++ configuration LT_PATH_LD # Check if GNU C++ uses GNU ld as the underlying linker, since the # archiving commands below assume that GNU ld is being used. - if test "$with_gnu_ld" = yes; then - _LT_TAGVAR(archive_cmds, $1)='$CC $pic_flag -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' - _LT_TAGVAR(archive_expsym_cmds, $1)='$CC $pic_flag -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + if test yes = "$with_gnu_ld"; then + _LT_TAGVAR(archive_cmds, $1)='$CC $pic_flag -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC $pic_flag -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' - _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir' + _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl--export-dynamic' # If archive_cmds runs LD, not CC, wlarc should be empty # XXX I think wlarc can be eliminated in ltcf-cxx, but I need to # investigate it a little bit more. (MM) - wlarc='${wl}' + wlarc='$wl' # ancient GNU ld didn't support --whole-archive et. al. if eval "`$CC -print-prog-name=ld` --help 2>&1" | $GREP 'no-whole-archive' > /dev/null; then - _LT_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' + _LT_TAGVAR(whole_archive_flag_spec, $1)=$wlarc'--whole-archive$convenience '$wlarc'--no-whole-archive' else _LT_TAGVAR(whole_archive_flag_spec, $1)= fi @@ -5973,18 +6440,30 @@ if test "$_lt_caught_CXX_error" != yes; then _LT_TAGVAR(ld_shlibs, $1)=no ;; aix[[4-9]]*) - if test "$host_cpu" = ia64; then + if test ia64 = "$host_cpu"; then # On IA64, the linker does run time linking by default, so we don't # have to do anything special. aix_use_runtimelinking=no exp_sym_flag='-Bexport' - no_entry_flag="" + no_entry_flag= else aix_use_runtimelinking=no # Test if we are trying to use run time linking or normal # AIX style linking. If -brtl is somewhere in LDFLAGS, we - # need to do runtime linking. + # have runtime linking enabled, and use it for executables. + # For shared libraries, we enable/disable runtime linking + # depending on the kind of the shared library created - + # when "with_aix_soname,aix_use_runtimelinking" is: + # "aix,no" lib.a(lib.so.V) shared, rtl:no, for executables + # "aix,yes" lib.so shared, rtl:yes, for executables + # lib.a static archive + # "both,no" lib.so.V(shr.o) shared, rtl:yes + # lib.a(lib.so.V) shared, rtl:no, for executables + # "both,yes" lib.so.V(shr.o) shared, rtl:yes, for executables + # lib.a(lib.so.V) shared, rtl:no + # "svr4,*" lib.so.V(shr.o) shared, rtl:yes, for executables + # lib.a static archive case $host_os in aix4.[[23]]|aix4.[[23]].*|aix[[5-9]]*) for ld_flag in $LDFLAGS; do case $ld_flag in @@ -5994,6 +6473,13 @@ if test "$_lt_caught_CXX_error" != yes; then ;; esac done + if test svr4,no = "$with_aix_soname,$aix_use_runtimelinking"; then + # With aix-soname=svr4, we create the lib.so.V shared archives only, + # so we don't have lib.a shared libs to link our executables. + # We have to force runtime linking in this case. + aix_use_runtimelinking=yes + LDFLAGS="$LDFLAGS -Wl,-brtl" + fi ;; esac @@ -6012,13 +6498,21 @@ if test "$_lt_caught_CXX_error" != yes; then _LT_TAGVAR(hardcode_direct_absolute, $1)=yes _LT_TAGVAR(hardcode_libdir_separator, $1)=':' _LT_TAGVAR(link_all_deplibs, $1)=yes - _LT_TAGVAR(file_list_spec, $1)='${wl}-f,' + _LT_TAGVAR(file_list_spec, $1)='$wl-f,' + case $with_aix_soname,$aix_use_runtimelinking in + aix,*) ;; # no import file + svr4,* | *,yes) # use import file + # The Import File defines what to hardcode. + _LT_TAGVAR(hardcode_direct, $1)=no + _LT_TAGVAR(hardcode_direct_absolute, $1)=no + ;; + esac - if test "$GXX" = yes; then + if test yes = "$GXX"; then case $host_os in aix4.[[012]]|aix4.[[012]].*) # We only want to do this on AIX 4.2 and lower, the check # below for broken collect2 doesn't work under 4.3+ - collect2name=`${CC} -print-prog-name=collect2` + collect2name=`$CC -print-prog-name=collect2` if test -f "$collect2name" && strings "$collect2name" | $GREP resolve_lib_name >/dev/null then @@ -6036,64 +6530,84 @@ if test "$_lt_caught_CXX_error" != yes; then fi esac shared_flag='-shared' - if test "$aix_use_runtimelinking" = yes; then - shared_flag="$shared_flag "'${wl}-G' + if test yes = "$aix_use_runtimelinking"; then + shared_flag=$shared_flag' $wl-G' fi + # Need to ensure runtime linking is disabled for the traditional + # shared library, or the linker may eventually find shared libraries + # /with/ Import File - we do not want to mix them. + shared_flag_aix='-shared' + shared_flag_svr4='-shared $wl-G' else # not using gcc - if test "$host_cpu" = ia64; then + if test ia64 = "$host_cpu"; then # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release # chokes on -Wl,-G. The following line is correct: shared_flag='-G' else - if test "$aix_use_runtimelinking" = yes; then - shared_flag='${wl}-G' + if test yes = "$aix_use_runtimelinking"; then + shared_flag='$wl-G' else - shared_flag='${wl}-bM:SRE' + shared_flag='$wl-bM:SRE' fi + shared_flag_aix='$wl-bM:SRE' + shared_flag_svr4='$wl-G' fi fi - _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-bexpall' + _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-bexpall' # It seems that -bexpall does not export symbols beginning with # underscore (_), so it is better to generate a list of symbols to # export. _LT_TAGVAR(always_export_symbols, $1)=yes - if test "$aix_use_runtimelinking" = yes; then + if test aix,yes = "$with_aix_soname,$aix_use_runtimelinking"; then # Warning - without using the other runtime loading flags (-brtl), # -berok will link without error, but may produce a broken library. - _LT_TAGVAR(allow_undefined_flag, $1)='-berok' + # The "-G" linker flag allows undefined symbols. + _LT_TAGVAR(no_undefined_flag, $1)='-bernotok' # Determine the default libpath from the value encoded in an empty # executable. _LT_SYS_MODULE_PATH_AIX([$1]) - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath" + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-blibpath:$libdir:'"$aix_libpath" - _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then func_echo_all "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag" + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $deplibs $wl'$no_entry_flag' $compiler_flags `if test -n "$allow_undefined_flag"; then func_echo_all "$wl$allow_undefined_flag"; else :; fi` $wl'$exp_sym_flag:\$export_symbols' '$shared_flag else - if test "$host_cpu" = ia64; then - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $libdir:/usr/lib:/lib' + if test ia64 = "$host_cpu"; then + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-R $libdir:/usr/lib:/lib' _LT_TAGVAR(allow_undefined_flag, $1)="-z nodefs" - _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols" + _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\$wl$no_entry_flag"' $compiler_flags $wl$allow_undefined_flag '"\$wl$exp_sym_flag:\$export_symbols" else # Determine the default libpath from the value encoded in an # empty executable. _LT_SYS_MODULE_PATH_AIX([$1]) - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath" + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-blibpath:$libdir:'"$aix_libpath" # Warning - without using the other run time loading flags, # -berok will link without error, but may produce a broken library. - _LT_TAGVAR(no_undefined_flag, $1)=' ${wl}-bernotok' - _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-berok' - if test "$with_gnu_ld" = yes; then + _LT_TAGVAR(no_undefined_flag, $1)=' $wl-bernotok' + _LT_TAGVAR(allow_undefined_flag, $1)=' $wl-berok' + if test yes = "$with_gnu_ld"; then # We only use this code for GNU lds that support --whole-archive. - _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive$convenience ${wl}--no-whole-archive' + _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl--whole-archive$convenience $wl--no-whole-archive' else # Exported symbols can be pulled into shared objects from archives _LT_TAGVAR(whole_archive_flag_spec, $1)='$convenience' fi _LT_TAGVAR(archive_cmds_need_lc, $1)=yes - # This is similar to how AIX traditionally builds its shared - # libraries. - _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname' + _LT_TAGVAR(archive_expsym_cmds, $1)='$RM -r $output_objdir/$realname.d~$MKDIR $output_objdir/$realname.d' + # -brtl affects multiple linker settings, -berok does not and is overridden later + compiler_flags_filtered='`func_echo_all "$compiler_flags " | $SED -e "s%-brtl\\([[, ]]\\)%-berok\\1%g"`' + if test svr4 != "$with_aix_soname"; then + # This is similar to how AIX traditionally builds its shared + # libraries. Need -bnortl late, we may have -brtl in LDFLAGS. + _LT_TAGVAR(archive_expsym_cmds, $1)="$_LT_TAGVAR(archive_expsym_cmds, $1)"'~$CC '$shared_flag_aix' -o $output_objdir/$realname.d/$soname $libobjs $deplibs $wl-bnoentry '$compiler_flags_filtered'$wl-bE:$export_symbols$allow_undefined_flag~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$realname.d/$soname' + fi + if test aix != "$with_aix_soname"; then + _LT_TAGVAR(archive_expsym_cmds, $1)="$_LT_TAGVAR(archive_expsym_cmds, $1)"'~$CC '$shared_flag_svr4' -o $output_objdir/$realname.d/$shared_archive_member_spec.o $libobjs $deplibs $wl-bnoentry '$compiler_flags_filtered'$wl-bE:$export_symbols$allow_undefined_flag~$STRIP -e $output_objdir/$realname.d/$shared_archive_member_spec.o~( func_echo_all "#! $soname($shared_archive_member_spec.o)"; if test shr_64 = "$shared_archive_member_spec"; then func_echo_all "# 64"; else func_echo_all "# 32"; fi; cat $export_symbols ) > $output_objdir/$realname.d/$shared_archive_member_spec.imp~$AR $AR_FLAGS $output_objdir/$soname $output_objdir/$realname.d/$shared_archive_member_spec.o $output_objdir/$realname.d/$shared_archive_member_spec.imp' + else + # used by -dlpreopen to get the symbols + _LT_TAGVAR(archive_expsym_cmds, $1)="$_LT_TAGVAR(archive_expsym_cmds, $1)"'~$MV $output_objdir/$realname.d/$soname $output_objdir' + fi + _LT_TAGVAR(archive_expsym_cmds, $1)="$_LT_TAGVAR(archive_expsym_cmds, $1)"'~$RM -r $output_objdir/$realname.d' fi fi ;; @@ -6103,7 +6617,7 @@ if test "$_lt_caught_CXX_error" != yes; then _LT_TAGVAR(allow_undefined_flag, $1)=unsupported # Joseph Beckenbach says some releases of gcc # support --undefined. This deserves some investigation. FIXME - _LT_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + _LT_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' else _LT_TAGVAR(ld_shlibs, $1)=no fi @@ -6131,57 +6645,58 @@ if test "$_lt_caught_CXX_error" != yes; then # Tell ltmain to make .lib files, not .a files. libext=lib # Tell ltmain to make .dll files, not .so files. - shrext_cmds=".dll" + shrext_cmds=.dll # FIXME: Setting linknames here is a bad hack. - _LT_TAGVAR(archive_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-dll~linknames=' - _LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then - $SED -n -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' -e '1\\\!p' < $export_symbols > $output_objdir/$soname.exp; - else - $SED -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' < $export_symbols > $output_objdir/$soname.exp; - fi~ - $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~ - linknames=' + _LT_TAGVAR(archive_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~linknames=' + _LT_TAGVAR(archive_expsym_cmds, $1)='if _LT_DLL_DEF_P([$export_symbols]); then + cp "$export_symbols" "$output_objdir/$soname.def"; + echo "$tool_output_objdir$soname.def" > "$output_objdir/$soname.exp"; + else + $SED -e '\''s/^/-link -EXPORT:/'\'' < $export_symbols > $output_objdir/$soname.exp; + fi~ + $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~ + linknames=' # The linker will not automatically build a static lib if we build a DLL. # _LT_TAGVAR(old_archive_from_new_cmds, $1)='true' _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes # Don't use ranlib _LT_TAGVAR(old_postinstall_cmds, $1)='chmod 644 $oldlib' _LT_TAGVAR(postlink_cmds, $1)='lt_outputfile="@OUTPUT@"~ - lt_tool_outputfile="@TOOL_OUTPUT@"~ - case $lt_outputfile in - *.exe|*.EXE) ;; - *) - lt_outputfile="$lt_outputfile.exe" - lt_tool_outputfile="$lt_tool_outputfile.exe" - ;; - esac~ - func_to_tool_file "$lt_outputfile"~ - if test "$MANIFEST_TOOL" != ":" && test -f "$lt_outputfile.manifest"; then - $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1; - $RM "$lt_outputfile.manifest"; - fi' + lt_tool_outputfile="@TOOL_OUTPUT@"~ + case $lt_outputfile in + *.exe|*.EXE) ;; + *) + lt_outputfile=$lt_outputfile.exe + lt_tool_outputfile=$lt_tool_outputfile.exe + ;; + esac~ + func_to_tool_file "$lt_outputfile"~ + if test : != "$MANIFEST_TOOL" && test -f "$lt_outputfile.manifest"; then + $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1; + $RM "$lt_outputfile.manifest"; + fi' ;; *) # g++ # _LT_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless, # as there is no search path for DLLs. _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' - _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-all-symbols' + _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl--export-all-symbols' _LT_TAGVAR(allow_undefined_flag, $1)=unsupported _LT_TAGVAR(always_export_symbols, $1)=no _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then - _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' - # If the export-symbols file already is a .def file (1st line - # is EXPORTS), use it as is; otherwise, prepend... - _LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then - cp $export_symbols $output_objdir/$soname.def; - else - echo EXPORTS > $output_objdir/$soname.def; - cat $export_symbols >> $output_objdir/$soname.def; - fi~ - $CC -shared -nostdlib $output_objdir/$soname.def $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname $wl--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' + # If the export-symbols file already is a .def file, use it as + # is; otherwise, prepend EXPORTS... + _LT_TAGVAR(archive_expsym_cmds, $1)='if _LT_DLL_DEF_P([$export_symbols]); then + cp $export_symbols $output_objdir/$soname.def; + else + echo EXPORTS > $output_objdir/$soname.def; + cat $export_symbols >> $output_objdir/$soname.def; + fi~ + $CC -shared -nostdlib $output_objdir/$soname.def $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname $wl--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' else _LT_TAGVAR(ld_shlibs, $1)=no fi @@ -6192,6 +6707,34 @@ if test "$_lt_caught_CXX_error" != yes; then _LT_DARWIN_LINKER_FEATURES($1) ;; + os2*) + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' + _LT_TAGVAR(hardcode_minus_L, $1)=yes + _LT_TAGVAR(allow_undefined_flag, $1)=unsupported + shrext_cmds=.dll + _LT_TAGVAR(archive_cmds, $1)='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~ + $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~ + $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~ + $ECHO EXPORTS >> $output_objdir/$libname.def~ + emxexp $libobjs | $SED /"_DLL_InitTerm"/d >> $output_objdir/$libname.def~ + $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~ + emximp -o $lib $output_objdir/$libname.def' + _LT_TAGVAR(archive_expsym_cmds, $1)='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~ + $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~ + $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~ + $ECHO EXPORTS >> $output_objdir/$libname.def~ + prefix_cmds="$SED"~ + if test EXPORTS = "`$SED 1q $export_symbols`"; then + prefix_cmds="$prefix_cmds -e 1d"; + fi~ + prefix_cmds="$prefix_cmds -e \"s/^\(.*\)$/_\1/g\""~ + cat $export_symbols | $prefix_cmds >> $output_objdir/$libname.def~ + $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~ + emximp -o $lib $output_objdir/$libname.def' + _LT_TAGVAR(old_archive_From_new_cmds, $1)='emximp -o $output_objdir/${libname}_dll.a $output_objdir/$libname.def' + _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes + ;; + dgux*) case $cc_basename in ec++*) @@ -6226,18 +6769,15 @@ if test "$_lt_caught_CXX_error" != yes; then _LT_TAGVAR(ld_shlibs, $1)=yes ;; - gnu*) - ;; - haiku*) - _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' _LT_TAGVAR(link_all_deplibs, $1)=yes ;; hpux9*) - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl+b $wl$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: - _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' + _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH, # but as the default @@ -6249,7 +6789,7 @@ if test "$_lt_caught_CXX_error" != yes; then _LT_TAGVAR(ld_shlibs, $1)=no ;; aCC*) - _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -b ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' + _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -b $wl+b $wl$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test "x$output_objdir/$soname" = "x$lib" || mv $output_objdir/$soname $lib' # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. @@ -6258,11 +6798,11 @@ if test "$_lt_caught_CXX_error" != yes; then # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. - output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $EGREP "\-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' + output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $EGREP "\-L"`; list= ; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' ;; *) - if test "$GXX" = yes; then - _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -shared -nostdlib $pic_flag ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' + if test yes = "$GXX"; then + _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -shared -nostdlib $pic_flag $wl+b $wl$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test "x$output_objdir/$soname" = "x$lib" || mv $output_objdir/$soname $lib' else # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no @@ -6272,15 +6812,15 @@ if test "$_lt_caught_CXX_error" != yes; then ;; hpux10*|hpux11*) - if test $with_gnu_ld = no; then - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' + if test no = "$with_gnu_ld"; then + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl+b $wl$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: case $host_cpu in hppa*64*|ia64*) ;; *) - _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' + _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E' ;; esac fi @@ -6306,13 +6846,13 @@ if test "$_lt_caught_CXX_error" != yes; then aCC*) case $host_cpu in hppa*64*) - _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' + _LT_TAGVAR(archive_cmds, $1)='$CC -b $wl+h $wl$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; ia64*) - _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' + _LT_TAGVAR(archive_cmds, $1)='$CC -b $wl+h $wl$soname $wl+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; *) - _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' + _LT_TAGVAR(archive_cmds, $1)='$CC -b $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; esac # Commands to make compiler produce verbose output that lists @@ -6323,20 +6863,20 @@ if test "$_lt_caught_CXX_error" != yes; then # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. - output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $GREP "\-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' + output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $GREP "\-L"`; list= ; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' ;; *) - if test "$GXX" = yes; then - if test $with_gnu_ld = no; then + if test yes = "$GXX"; then + if test no = "$with_gnu_ld"; then case $host_cpu in hppa*64*) - _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -fPIC $wl+h $wl$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; ia64*) - _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $pic_flag ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $pic_flag $wl+h $wl$soname $wl+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; *) - _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $pic_flag $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; esac fi @@ -6351,22 +6891,22 @@ if test "$_lt_caught_CXX_error" != yes; then interix[[3-9]]*) _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=no - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' - _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath,$libdir' + _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E' # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc. # Instead, shared libraries are loaded at an image base (0x10000000 by # default) and relocated if they conflict, which is a slow very memory # consuming and fragmenting process. To avoid this, we pick a random, # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link # time. Moving up from 0x10000000 also allows more sbrk(2) space. - _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' - _LT_TAGVAR(archive_expsym_cmds, $1)='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-h,$soname $wl--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='sed "s|^|_|" $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-h,$soname $wl--retain-symbols-file,$output_objdir/$soname.expsym $wl--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' ;; irix5* | irix6*) case $cc_basename in CC*) # SGI C++ - _LT_TAGVAR(archive_cmds, $1)='$CC -shared -all -multigot $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared -all -multigot $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib' # Archives containing C++ object files must be created using # "CC -ar", where "CC" is the IRIX C++ compiler. This is @@ -6375,22 +6915,22 @@ if test "$_lt_caught_CXX_error" != yes; then _LT_TAGVAR(old_archive_cmds, $1)='$CC -ar -WR,-u -o $oldlib $oldobjs' ;; *) - if test "$GXX" = yes; then - if test "$with_gnu_ld" = no; then - _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' + if test yes = "$GXX"; then + if test no = "$with_gnu_ld"; then + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib' else - _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` -o $lib' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` -o $lib' fi fi _LT_TAGVAR(link_all_deplibs, $1)=yes ;; esac - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: _LT_TAGVAR(inherit_rpath, $1)=yes ;; - linux* | k*bsd*-gnu | kopensolaris*-gnu) + linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) case $cc_basename in KCC*) # Kuck and Associates, Inc. (KAI) C++ Compiler @@ -6398,8 +6938,8 @@ if test "$_lt_caught_CXX_error" != yes; then # KCC will only create a shared library if the output file # ends with ".so" (or ".sl" for HP-UX), so rename the library # to its proper name (with version) after linking. - _LT_TAGVAR(archive_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib' - _LT_TAGVAR(archive_expsym_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib ${wl}-retain-symbols-file,$export_symbols; mv \$templib $lib' + _LT_TAGVAR(archive_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\$tempext\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\$tempext\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib $wl-retain-symbols-file,$export_symbols; mv \$templib $lib' # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. @@ -6408,10 +6948,10 @@ if test "$_lt_caught_CXX_error" != yes; then # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. - output_verbose_link_cmd='templist=`$CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 | $GREP "ld"`; rm -f libconftest$shared_ext; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' + output_verbose_link_cmd='templist=`$CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 | $GREP "ld"`; rm -f libconftest$shared_ext; list= ; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' - _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath,$libdir' + _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl--export-dynamic' # Archives containing C++ object files must be created using # "CC -Bstatic", where "CC" is the KAI C++ compiler. @@ -6425,59 +6965,59 @@ if test "$_lt_caught_CXX_error" != yes; then # earlier do not add the objects themselves. case `$CC -V 2>&1` in *"Version 7."*) - _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' - _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' ;; *) # Version 8.0 or newer tmp_idyn= case $host_cpu in ia64*) tmp_idyn=' -i_dynamic';; esac - _LT_TAGVAR(archive_cmds, $1)='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' - _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' ;; esac _LT_TAGVAR(archive_cmds_need_lc, $1)=no - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' - _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' - _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive$convenience ${wl}--no-whole-archive' + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath,$libdir' + _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl--export-dynamic' + _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl--whole-archive$convenience $wl--no-whole-archive' ;; pgCC* | pgcpp*) # Portland Group C++ compiler case `$CC -V` in *pgCC\ [[1-5]].* | *pgcpp\ [[1-5]].*) _LT_TAGVAR(prelink_cmds, $1)='tpldir=Template.dir~ - rm -rf $tpldir~ - $CC --prelink_objects --instantiation_dir $tpldir $objs $libobjs $compile_deplibs~ - compile_command="$compile_command `find $tpldir -name \*.o | sort | $NL2SP`"' + rm -rf $tpldir~ + $CC --prelink_objects --instantiation_dir $tpldir $objs $libobjs $compile_deplibs~ + compile_command="$compile_command `find $tpldir -name \*.o | sort | $NL2SP`"' _LT_TAGVAR(old_archive_cmds, $1)='tpldir=Template.dir~ - rm -rf $tpldir~ - $CC --prelink_objects --instantiation_dir $tpldir $oldobjs$old_deplibs~ - $AR $AR_FLAGS $oldlib$oldobjs$old_deplibs `find $tpldir -name \*.o | sort | $NL2SP`~ - $RANLIB $oldlib' + rm -rf $tpldir~ + $CC --prelink_objects --instantiation_dir $tpldir $oldobjs$old_deplibs~ + $AR $AR_FLAGS $oldlib$oldobjs$old_deplibs `find $tpldir -name \*.o | sort | $NL2SP`~ + $RANLIB $oldlib' _LT_TAGVAR(archive_cmds, $1)='tpldir=Template.dir~ - rm -rf $tpldir~ - $CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~ - $CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | sort | $NL2SP` $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib' + rm -rf $tpldir~ + $CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~ + $CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | sort | $NL2SP` $postdep_objects $compiler_flags $wl-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='tpldir=Template.dir~ - rm -rf $tpldir~ - $CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~ - $CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | sort | $NL2SP` $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname ${wl}-retain-symbols-file ${wl}$export_symbols -o $lib' + rm -rf $tpldir~ + $CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~ + $CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | sort | $NL2SP` $postdep_objects $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' ;; *) # Version 6 and above use weak symbols - _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib' - _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname ${wl}-retain-symbols-file ${wl}$export_symbols -o $lib' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' ;; esac - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}--rpath ${wl}$libdir' - _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' - _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl--rpath $wl$libdir' + _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl--export-dynamic' + _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive' ;; cxx*) # Compaq C++ - _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' - _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib ${wl}-retain-symbols-file $wl$export_symbols' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname -o $lib $wl-retain-symbols-file $wl$export_symbols' runpath_var=LD_RUN_PATH _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir' @@ -6491,18 +7031,18 @@ if test "$_lt_caught_CXX_error" != yes; then # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. - output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "ld"`; templist=`func_echo_all "$templist" | $SED "s/\(^.*ld.*\)\( .*ld .*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "X$list" | $Xsed' + output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "ld"`; templist=`func_echo_all "$templist" | $SED "s/\(^.*ld.*\)\( .*ld .*$\)/\1/"`; list= ; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "X$list" | $Xsed' ;; xl* | mpixl* | bgxl*) # IBM XL 8.0 on PPC, with GNU ld - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' - _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' - _LT_TAGVAR(archive_cmds, $1)='$CC -qmkshrobj $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' - if test "x$supports_anon_versioning" = xyes; then + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir' + _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl--export-dynamic' + _LT_TAGVAR(archive_cmds, $1)='$CC -qmkshrobj $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' + if test yes = "$supports_anon_versioning"; then _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~ - cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ - echo "local: *; };" >> $output_objdir/$libname.ver~ - $CC -qmkshrobj $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib' + cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ + echo "local: *; };" >> $output_objdir/$libname.ver~ + $CC -qmkshrobj $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-version-script $wl$output_objdir/$libname.ver -o $lib' fi ;; *) @@ -6510,10 +7050,10 @@ if test "$_lt_caught_CXX_error" != yes; then *Sun\ C*) # Sun C++ 5.9 _LT_TAGVAR(no_undefined_flag, $1)=' -zdefs' - _LT_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' - _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-retain-symbols-file ${wl}$export_symbols' + _LT_TAGVAR(archive_cmds, $1)='$CC -G$allow_undefined_flag -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G$allow_undefined_flag -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-retain-symbols-file $wl$export_symbols' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' - _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' + _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive' _LT_TAGVAR(compiler_needs_object, $1)=yes # Not sure whether something based on @@ -6571,22 +7111,17 @@ if test "$_lt_caught_CXX_error" != yes; then _LT_TAGVAR(ld_shlibs, $1)=yes ;; - openbsd2*) - # C++ shared libraries are fairly broken - _LT_TAGVAR(ld_shlibs, $1)=no - ;; - - openbsd*) + openbsd* | bitrig*) if test -f /usr/libexec/ld.so; then _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=no _LT_TAGVAR(hardcode_direct_absolute, $1)=yes _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib' - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' - if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then - _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-retain-symbols-file,$export_symbols -o $lib' - _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' - _LT_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath,$libdir' + if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`"; then + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-retain-symbols-file,$export_symbols -o $lib' + _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E' + _LT_TAGVAR(whole_archive_flag_spec, $1)=$wlarc'--whole-archive$convenience '$wlarc'--no-whole-archive' fi output_verbose_link_cmd=func_echo_all else @@ -6602,9 +7137,9 @@ if test "$_lt_caught_CXX_error" != yes; then # KCC will only create a shared library if the output file # ends with ".so" (or ".sl" for HP-UX), so rename the library # to its proper name (with version) after linking. - _LT_TAGVAR(archive_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo "$lib" | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib' + _LT_TAGVAR(archive_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo "$lib" | $SED -e "s/\$tempext\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib' - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath,$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: # Archives containing C++ object files must be created using @@ -6622,17 +7157,17 @@ if test "$_lt_caught_CXX_error" != yes; then cxx*) case $host in osf3*) - _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' - _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $soname `test -n "$verstring" && func_echo_all "${wl}-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' + _LT_TAGVAR(allow_undefined_flag, $1)=' $wl-expect_unresolved $wl\*' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared$allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $soname `test -n "$verstring" && func_echo_all "$wl-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib' + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir' ;; *) _LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*' - _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared$allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done~ - echo "-hidden">> $lib.exp~ - $CC -shared$allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname ${wl}-input ${wl}$lib.exp `test -n "$verstring" && $ECHO "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib~ - $RM $lib.exp' + echo "-hidden">> $lib.exp~ + $CC -shared$allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname $wl-input $wl$lib.exp `test -n "$verstring" && $ECHO "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib~ + $RM $lib.exp' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir' ;; esac @@ -6647,21 +7182,21 @@ if test "$_lt_caught_CXX_error" != yes; then # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. - output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "ld" | $GREP -v "ld:"`; templist=`func_echo_all "$templist" | $SED "s/\(^.*ld.*\)\( .*ld.*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' + output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "ld" | $GREP -v "ld:"`; templist=`func_echo_all "$templist" | $SED "s/\(^.*ld.*\)\( .*ld.*$\)/\1/"`; list= ; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' ;; *) - if test "$GXX" = yes && test "$with_gnu_ld" = no; then - _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' + if test yes,no = "$GXX,$with_gnu_ld"; then + _LT_TAGVAR(allow_undefined_flag, $1)=' $wl-expect_unresolved $wl\*' case $host in osf3*) - _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib' ;; *) - _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib $allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-msym $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib' ;; esac - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: # Commands to make compiler produce verbose output that lists @@ -6707,9 +7242,9 @@ if test "$_lt_caught_CXX_error" != yes; then # Sun C++ 4.2, 5.x and Centerline C++ _LT_TAGVAR(archive_cmds_need_lc,$1)=yes _LT_TAGVAR(no_undefined_flag, $1)=' -zdefs' - _LT_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' + _LT_TAGVAR(archive_cmds, $1)='$CC -G$allow_undefined_flag -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ - $CC -G${allow_undefined_flag} ${wl}-M ${wl}$lib.exp -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp' + $CC -G$allow_undefined_flag $wl-M $wl$lib.exp -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' _LT_TAGVAR(hardcode_shlibpath_var, $1)=no @@ -6717,7 +7252,7 @@ if test "$_lt_caught_CXX_error" != yes; then solaris2.[[0-5]] | solaris2.[[0-5]].*) ;; *) # The compiler driver will combine and reorder linker options, - # but understands `-z linker_flag'. + # but understands '-z linker_flag'. # Supported since Solaris 2.6 (maybe 2.5.1?) _LT_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract' ;; @@ -6734,30 +7269,30 @@ if test "$_lt_caught_CXX_error" != yes; then ;; gcx*) # Green Hills C++ Compiler - _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-h $wl$soname -o $lib' # The C++ compiler must be used to create the archive. _LT_TAGVAR(old_archive_cmds, $1)='$CC $LDFLAGS -archive -o $oldlib $oldobjs' ;; *) # GNU C++ compiler with Solaris linker - if test "$GXX" = yes && test "$with_gnu_ld" = no; then - _LT_TAGVAR(no_undefined_flag, $1)=' ${wl}-z ${wl}defs' + if test yes,no = "$GXX,$with_gnu_ld"; then + _LT_TAGVAR(no_undefined_flag, $1)=' $wl-z ${wl}defs' if $CC --version | $GREP -v '^2\.7' > /dev/null; then - _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-h $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ - $CC -shared $pic_flag -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp' + $CC -shared $pic_flag -nostdlib $wl-M $wl$lib.exp $wl-h $wl$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp' # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"' else - # g++ 2.7 appears to require `-G' NOT `-shared' on this + # g++ 2.7 appears to require '-G' NOT '-shared' on this # platform. - _LT_TAGVAR(archive_cmds, $1)='$CC -G -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' + _LT_TAGVAR(archive_cmds, $1)='$CC -G -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-h $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ - $CC -G -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp' + $CC -G -nostdlib $wl-M $wl$lib.exp $wl-h $wl$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp' # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when @@ -6765,11 +7300,11 @@ if test "$_lt_caught_CXX_error" != yes; then output_verbose_link_cmd='$CC -G $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"' fi - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $wl$libdir' + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-R $wl$libdir' case $host_os in solaris2.[[0-5]] | solaris2.[[0-5]].*) ;; *) - _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract' + _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl-z ${wl}allextract$convenience $wl-z ${wl}defaultextract' ;; esac fi @@ -6778,52 +7313,52 @@ if test "$_lt_caught_CXX_error" != yes; then ;; sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[[01]].[[10]]* | unixware7* | sco3.2v5.0.[[024]]*) - _LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text' + _LT_TAGVAR(no_undefined_flag, $1)='$wl-z,text' _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=no runpath_var='LD_RUN_PATH' case $cc_basename in CC*) - _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' - _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + _LT_TAGVAR(archive_cmds, $1)='$CC -G $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' ;; *) - _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' - _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' ;; esac ;; sysv5* | sco3.2v5* | sco5v6*) - # Note: We can NOT use -z defs as we might desire, because we do not + # Note: We CANNOT use -z defs as we might desire, because we do not # link with -lc, and that would cause any symbols used from libc to # always be unresolved, which means just about no library would # ever link correctly. If we're not using GNU ld we use -z text # though, which does catch some bad symbols but isn't as heavy-handed # as -z defs. - _LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text' - _LT_TAGVAR(allow_undefined_flag, $1)='${wl}-z,nodefs' + _LT_TAGVAR(no_undefined_flag, $1)='$wl-z,text' + _LT_TAGVAR(allow_undefined_flag, $1)='$wl-z,nodefs' _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=no - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R,$libdir' + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-R,$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=':' _LT_TAGVAR(link_all_deplibs, $1)=yes - _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Bexport' + _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-Bexport' runpath_var='LD_RUN_PATH' case $cc_basename in CC*) - _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' - _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + _LT_TAGVAR(archive_cmds, $1)='$CC -G $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(old_archive_cmds, $1)='$CC -Tprelink_objects $oldobjs~ - '"$_LT_TAGVAR(old_archive_cmds, $1)" + '"$_LT_TAGVAR(old_archive_cmds, $1)" _LT_TAGVAR(reload_cmds, $1)='$CC -Tprelink_objects $reload_objs~ - '"$_LT_TAGVAR(reload_cmds, $1)" + '"$_LT_TAGVAR(reload_cmds, $1)" ;; *) - _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' - _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' ;; esac ;; @@ -6854,10 +7389,10 @@ if test "$_lt_caught_CXX_error" != yes; then esac AC_MSG_RESULT([$_LT_TAGVAR(ld_shlibs, $1)]) - test "$_LT_TAGVAR(ld_shlibs, $1)" = no && can_build_shared=no + test no = "$_LT_TAGVAR(ld_shlibs, $1)" && can_build_shared=no - _LT_TAGVAR(GCC, $1)="$GXX" - _LT_TAGVAR(LD, $1)="$LD" + _LT_TAGVAR(GCC, $1)=$GXX + _LT_TAGVAR(LD, $1)=$LD ## CAVEAT EMPTOR: ## There is no encapsulation within the following macros, do not change @@ -6884,7 +7419,7 @@ if test "$_lt_caught_CXX_error" != yes; then lt_cv_path_LD=$lt_save_path_LD lt_cv_prog_gnu_ldcxx=$lt_cv_prog_gnu_ld lt_cv_prog_gnu_ld=$lt_save_with_gnu_ld -fi # test "$_lt_caught_CXX_error" != yes +fi # test yes != "$_lt_caught_CXX_error" AC_LANG_POP ])# _LT_LANG_CXX_CONFIG @@ -6906,13 +7441,14 @@ AC_REQUIRE([_LT_DECL_SED]) AC_REQUIRE([_LT_PROG_ECHO_BACKSLASH]) func_stripname_cnf () { - case ${2} in - .*) func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%\\\\${2}\$%%"`;; - *) func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%${2}\$%%"`;; + case @S|@2 in + .*) func_stripname_result=`$ECHO "@S|@3" | $SED "s%^@S|@1%%; s%\\\\@S|@2\$%%"`;; + *) func_stripname_result=`$ECHO "@S|@3" | $SED "s%^@S|@1%%; s%@S|@2\$%%"`;; esac } # func_stripname_cnf ])# _LT_FUNC_STRIPNAME_CNF + # _LT_SYS_HIDDEN_LIBDEPS([TAGNAME]) # --------------------------------- # Figure out "hidden" library dependencies from verbose @@ -6996,13 +7532,13 @@ if AC_TRY_EVAL(ac_compile); then pre_test_object_deps_done=no for p in `eval "$output_verbose_link_cmd"`; do - case ${prev}${p} in + case $prev$p in -L* | -R* | -l*) # Some compilers place space between "-{L,R}" and the path. # Remove the space. - if test $p = "-L" || - test $p = "-R"; then + if test x-L = "$p" || + test x-R = "$p"; then prev=$p continue fi @@ -7018,16 +7554,16 @@ if AC_TRY_EVAL(ac_compile); then case $p in =*) func_stripname_cnf '=' '' "$p"; p=$lt_sysroot$func_stripname_result ;; esac - if test "$pre_test_object_deps_done" = no; then - case ${prev} in + if test no = "$pre_test_object_deps_done"; then + case $prev in -L | -R) # Internal compiler library paths should come after those # provided the user. The postdeps already come after the # user supplied libs so there is no need to process them. if test -z "$_LT_TAGVAR(compiler_lib_search_path, $1)"; then - _LT_TAGVAR(compiler_lib_search_path, $1)="${prev}${p}" + _LT_TAGVAR(compiler_lib_search_path, $1)=$prev$p else - _LT_TAGVAR(compiler_lib_search_path, $1)="${_LT_TAGVAR(compiler_lib_search_path, $1)} ${prev}${p}" + _LT_TAGVAR(compiler_lib_search_path, $1)="${_LT_TAGVAR(compiler_lib_search_path, $1)} $prev$p" fi ;; # The "-l" case would never come before the object being @@ -7035,9 +7571,9 @@ if AC_TRY_EVAL(ac_compile); then esac else if test -z "$_LT_TAGVAR(postdeps, $1)"; then - _LT_TAGVAR(postdeps, $1)="${prev}${p}" + _LT_TAGVAR(postdeps, $1)=$prev$p else - _LT_TAGVAR(postdeps, $1)="${_LT_TAGVAR(postdeps, $1)} ${prev}${p}" + _LT_TAGVAR(postdeps, $1)="${_LT_TAGVAR(postdeps, $1)} $prev$p" fi fi prev= @@ -7052,15 +7588,15 @@ if AC_TRY_EVAL(ac_compile); then continue fi - if test "$pre_test_object_deps_done" = no; then + if test no = "$pre_test_object_deps_done"; then if test -z "$_LT_TAGVAR(predep_objects, $1)"; then - _LT_TAGVAR(predep_objects, $1)="$p" + _LT_TAGVAR(predep_objects, $1)=$p else _LT_TAGVAR(predep_objects, $1)="$_LT_TAGVAR(predep_objects, $1) $p" fi else if test -z "$_LT_TAGVAR(postdep_objects, $1)"; then - _LT_TAGVAR(postdep_objects, $1)="$p" + _LT_TAGVAR(postdep_objects, $1)=$p else _LT_TAGVAR(postdep_objects, $1)="$_LT_TAGVAR(postdep_objects, $1) $p" fi @@ -7091,51 +7627,6 @@ interix[[3-9]]*) _LT_TAGVAR(postdep_objects,$1)= _LT_TAGVAR(postdeps,$1)= ;; - -linux*) - case `$CC -V 2>&1 | sed 5q` in - *Sun\ C*) - # Sun C++ 5.9 - - # The more standards-conforming stlport4 library is - # incompatible with the Cstd library. Avoid specifying - # it if it's in CXXFLAGS. Ignore libCrun as - # -library=stlport4 depends on it. - case " $CXX $CXXFLAGS " in - *" -library=stlport4 "*) - solaris_use_stlport4=yes - ;; - esac - - if test "$solaris_use_stlport4" != yes; then - _LT_TAGVAR(postdeps,$1)='-library=Cstd -library=Crun' - fi - ;; - esac - ;; - -solaris*) - case $cc_basename in - CC* | sunCC*) - # The more standards-conforming stlport4 library is - # incompatible with the Cstd library. Avoid specifying - # it if it's in CXXFLAGS. Ignore libCrun as - # -library=stlport4 depends on it. - case " $CXX $CXXFLAGS " in - *" -library=stlport4 "*) - solaris_use_stlport4=yes - ;; - esac - - # Adding this requires a known-good setup of shared libraries for - # Sun compiler versions before 5.6, else PIC objects from an old - # archive will be linked into the output, leading to subtle bugs. - if test "$solaris_use_stlport4" != yes; then - _LT_TAGVAR(postdeps,$1)='-library=Cstd -library=Crun' - fi - ;; - esac - ;; esac ]) @@ -7144,7 +7635,7 @@ case " $_LT_TAGVAR(postdeps, $1) " in esac _LT_TAGVAR(compiler_lib_search_dirs, $1)= if test -n "${_LT_TAGVAR(compiler_lib_search_path, $1)}"; then - _LT_TAGVAR(compiler_lib_search_dirs, $1)=`echo " ${_LT_TAGVAR(compiler_lib_search_path, $1)}" | ${SED} -e 's! -L! !g' -e 's!^ !!'` + _LT_TAGVAR(compiler_lib_search_dirs, $1)=`echo " ${_LT_TAGVAR(compiler_lib_search_path, $1)}" | $SED -e 's! -L! !g' -e 's!^ !!'` fi _LT_TAGDECL([], [compiler_lib_search_dirs], [1], [The directories searched by this compiler when creating a shared library]) @@ -7164,10 +7655,10 @@ _LT_TAGDECL([], [compiler_lib_search_path], [1], # -------------------------- # Ensure that the configuration variables for a Fortran 77 compiler are # suitably defined. These variables are subsequently used by _LT_CONFIG -# to write the compiler configuration to `libtool'. +# to write the compiler configuration to 'libtool'. m4_defun([_LT_LANG_F77_CONFIG], [AC_LANG_PUSH(Fortran 77) -if test -z "$F77" || test "X$F77" = "Xno"; then +if test -z "$F77" || test no = "$F77"; then _lt_disable_F77=yes fi @@ -7204,7 +7695,7 @@ _LT_TAGVAR(objext, $1)=$objext # the F77 compiler isn't working. Some variables (like enable_shared) # are currently assumed to apply to all compilers on this platform, # and will be corrupted by setting them based on a non-working compiler. -if test "$_lt_disable_F77" != yes; then +if test yes != "$_lt_disable_F77"; then # Code to be used in simple compile tests lt_simple_compile_test_code="\ subroutine t @@ -7226,7 +7717,7 @@ if test "$_lt_disable_F77" != yes; then _LT_LINKER_BOILERPLATE # Allow CC to be a program name with arguments. - lt_save_CC="$CC" + lt_save_CC=$CC lt_save_GCC=$GCC lt_save_CFLAGS=$CFLAGS CC=${F77-"f77"} @@ -7240,21 +7731,25 @@ if test "$_lt_disable_F77" != yes; then AC_MSG_RESULT([$can_build_shared]) AC_MSG_CHECKING([whether to build shared libraries]) - test "$can_build_shared" = "no" && enable_shared=no + test no = "$can_build_shared" && enable_shared=no # On AIX, shared libraries and static libraries use the same namespace, and # are all built from PIC. case $host_os in aix3*) - test "$enable_shared" = yes && enable_static=no + test yes = "$enable_shared" && enable_static=no if test -n "$RANLIB"; then archive_cmds="$archive_cmds~\$RANLIB \$lib" postinstall_cmds='$RANLIB $lib' fi ;; aix[[4-9]]*) - if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then - test "$enable_shared" = yes && enable_static=no + if test ia64 != "$host_cpu"; then + case $enable_shared,$with_aix_soname,$aix_use_runtimelinking in + yes,aix,yes) ;; # shared object as lib.so file only + yes,svr4,*) ;; # shared object as lib.so archive member only + yes,*) enable_static=no ;; # shared object in lib.a archive as well + esac fi ;; esac @@ -7262,11 +7757,11 @@ if test "$_lt_disable_F77" != yes; then AC_MSG_CHECKING([whether to build static libraries]) # Make sure either enable_shared or enable_static is yes. - test "$enable_shared" = yes || enable_static=yes + test yes = "$enable_shared" || enable_static=yes AC_MSG_RESULT([$enable_static]) - _LT_TAGVAR(GCC, $1)="$G77" - _LT_TAGVAR(LD, $1)="$LD" + _LT_TAGVAR(GCC, $1)=$G77 + _LT_TAGVAR(LD, $1)=$LD ## CAVEAT EMPTOR: ## There is no encapsulation within the following macros, do not change @@ -7283,9 +7778,9 @@ if test "$_lt_disable_F77" != yes; then fi # test -n "$compiler" GCC=$lt_save_GCC - CC="$lt_save_CC" - CFLAGS="$lt_save_CFLAGS" -fi # test "$_lt_disable_F77" != yes + CC=$lt_save_CC + CFLAGS=$lt_save_CFLAGS +fi # test yes != "$_lt_disable_F77" AC_LANG_POP ])# _LT_LANG_F77_CONFIG @@ -7295,11 +7790,11 @@ AC_LANG_POP # ------------------------- # Ensure that the configuration variables for a Fortran compiler are # suitably defined. These variables are subsequently used by _LT_CONFIG -# to write the compiler configuration to `libtool'. +# to write the compiler configuration to 'libtool'. m4_defun([_LT_LANG_FC_CONFIG], [AC_LANG_PUSH(Fortran) -if test -z "$FC" || test "X$FC" = "Xno"; then +if test -z "$FC" || test no = "$FC"; then _lt_disable_FC=yes fi @@ -7336,7 +7831,7 @@ _LT_TAGVAR(objext, $1)=$objext # the FC compiler isn't working. Some variables (like enable_shared) # are currently assumed to apply to all compilers on this platform, # and will be corrupted by setting them based on a non-working compiler. -if test "$_lt_disable_FC" != yes; then +if test yes != "$_lt_disable_FC"; then # Code to be used in simple compile tests lt_simple_compile_test_code="\ subroutine t @@ -7358,7 +7853,7 @@ if test "$_lt_disable_FC" != yes; then _LT_LINKER_BOILERPLATE # Allow CC to be a program name with arguments. - lt_save_CC="$CC" + lt_save_CC=$CC lt_save_GCC=$GCC lt_save_CFLAGS=$CFLAGS CC=${FC-"f95"} @@ -7374,21 +7869,25 @@ if test "$_lt_disable_FC" != yes; then AC_MSG_RESULT([$can_build_shared]) AC_MSG_CHECKING([whether to build shared libraries]) - test "$can_build_shared" = "no" && enable_shared=no + test no = "$can_build_shared" && enable_shared=no # On AIX, shared libraries and static libraries use the same namespace, and # are all built from PIC. case $host_os in aix3*) - test "$enable_shared" = yes && enable_static=no + test yes = "$enable_shared" && enable_static=no if test -n "$RANLIB"; then archive_cmds="$archive_cmds~\$RANLIB \$lib" postinstall_cmds='$RANLIB $lib' fi ;; aix[[4-9]]*) - if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then - test "$enable_shared" = yes && enable_static=no + if test ia64 != "$host_cpu"; then + case $enable_shared,$with_aix_soname,$aix_use_runtimelinking in + yes,aix,yes) ;; # shared object as lib.so file only + yes,svr4,*) ;; # shared object as lib.so archive member only + yes,*) enable_static=no ;; # shared object in lib.a archive as well + esac fi ;; esac @@ -7396,11 +7895,11 @@ if test "$_lt_disable_FC" != yes; then AC_MSG_CHECKING([whether to build static libraries]) # Make sure either enable_shared or enable_static is yes. - test "$enable_shared" = yes || enable_static=yes + test yes = "$enable_shared" || enable_static=yes AC_MSG_RESULT([$enable_static]) - _LT_TAGVAR(GCC, $1)="$ac_cv_fc_compiler_gnu" - _LT_TAGVAR(LD, $1)="$LD" + _LT_TAGVAR(GCC, $1)=$ac_cv_fc_compiler_gnu + _LT_TAGVAR(LD, $1)=$LD ## CAVEAT EMPTOR: ## There is no encapsulation within the following macros, do not change @@ -7420,7 +7919,7 @@ if test "$_lt_disable_FC" != yes; then GCC=$lt_save_GCC CC=$lt_save_CC CFLAGS=$lt_save_CFLAGS -fi # test "$_lt_disable_FC" != yes +fi # test yes != "$_lt_disable_FC" AC_LANG_POP ])# _LT_LANG_FC_CONFIG @@ -7430,7 +7929,7 @@ AC_LANG_POP # -------------------------- # Ensure that the configuration variables for the GNU Java Compiler compiler # are suitably defined. These variables are subsequently used by _LT_CONFIG -# to write the compiler configuration to `libtool'. +# to write the compiler configuration to 'libtool'. m4_defun([_LT_LANG_GCJ_CONFIG], [AC_REQUIRE([LT_PROG_GCJ])dnl AC_LANG_SAVE @@ -7464,7 +7963,7 @@ CC=${GCJ-"gcj"} CFLAGS=$GCJFLAGS compiler=$CC _LT_TAGVAR(compiler, $1)=$CC -_LT_TAGVAR(LD, $1)="$LD" +_LT_TAGVAR(LD, $1)=$LD _LT_CC_BASENAME([$compiler]) # GCJ did not exist at the time GCC didn't implicitly link libc in. @@ -7501,7 +8000,7 @@ CFLAGS=$lt_save_CFLAGS # -------------------------- # Ensure that the configuration variables for the GNU Go compiler # are suitably defined. These variables are subsequently used by _LT_CONFIG -# to write the compiler configuration to `libtool'. +# to write the compiler configuration to 'libtool'. m4_defun([_LT_LANG_GO_CONFIG], [AC_REQUIRE([LT_PROG_GO])dnl AC_LANG_SAVE @@ -7535,7 +8034,7 @@ CC=${GOC-"gccgo"} CFLAGS=$GOFLAGS compiler=$CC _LT_TAGVAR(compiler, $1)=$CC -_LT_TAGVAR(LD, $1)="$LD" +_LT_TAGVAR(LD, $1)=$LD _LT_CC_BASENAME([$compiler]) # Go did not exist at the time GCC didn't implicitly link libc in. @@ -7572,7 +8071,7 @@ CFLAGS=$lt_save_CFLAGS # ------------------------- # Ensure that the configuration variables for the Windows resource compiler # are suitably defined. These variables are subsequently used by _LT_CONFIG -# to write the compiler configuration to `libtool'. +# to write the compiler configuration to 'libtool'. m4_defun([_LT_LANG_RC_CONFIG], [AC_REQUIRE([LT_PROG_RC])dnl AC_LANG_SAVE @@ -7588,7 +8087,7 @@ _LT_TAGVAR(objext, $1)=$objext lt_simple_compile_test_code='sample MENU { MENUITEM "&Soup", 100, CHECKED }' # Code to be used in simple link tests -lt_simple_link_test_code="$lt_simple_compile_test_code" +lt_simple_link_test_code=$lt_simple_compile_test_code # ltmain only uses $CC for tagged configurations so make sure $CC is set. _LT_TAG_COMPILER @@ -7598,7 +8097,7 @@ _LT_COMPILER_BOILERPLATE _LT_LINKER_BOILERPLATE # Allow CC to be a program name with arguments. -lt_save_CC="$CC" +lt_save_CC=$CC lt_save_CFLAGS=$CFLAGS lt_save_GCC=$GCC GCC= @@ -7627,7 +8126,7 @@ AC_DEFUN([LT_PROG_GCJ], [m4_ifdef([AC_PROG_GCJ], [AC_PROG_GCJ], [m4_ifdef([A][M_PROG_GCJ], [A][M_PROG_GCJ], [AC_CHECK_TOOL(GCJ, gcj,) - test "x${GCJFLAGS+set}" = xset || GCJFLAGS="-g -O2" + test set = "${GCJFLAGS+set}" || GCJFLAGS="-g -O2" AC_SUBST(GCJFLAGS)])])[]dnl ]) @@ -7738,7 +8237,7 @@ lt_ac_count=0 # Add /usr/xpg4/bin/sed as it is typically found on Solaris # along with /bin/sed that truncates output. for lt_ac_sed in $lt_ac_sed_list /usr/xpg4/bin/sed; do - test ! -f $lt_ac_sed && continue + test ! -f "$lt_ac_sed" && continue cat /dev/null > conftest.in lt_ac_count=0 echo $ECHO_N "0123456789$ECHO_C" >conftest.in @@ -7755,9 +8254,9 @@ for lt_ac_sed in $lt_ac_sed_list /usr/xpg4/bin/sed; do $lt_ac_sed -e 's/a$//' < conftest.nl >conftest.out || break cmp -s conftest.out conftest.nl || break # 10000 chars as input seems more than enough - test $lt_ac_count -gt 10 && break + test 10 -lt "$lt_ac_count" && break lt_ac_count=`expr $lt_ac_count + 1` - if test $lt_ac_count -gt $lt_ac_max; then + if test "$lt_ac_count" -gt "$lt_ac_max"; then lt_ac_max=$lt_ac_count lt_cv_path_SED=$lt_ac_sed fi @@ -7781,27 +8280,7 @@ dnl AC_DEFUN([LT_AC_PROG_SED], []) # Find out whether the shell is Bourne or XSI compatible, # or has some other useful features. m4_defun([_LT_CHECK_SHELL_FEATURES], -[AC_MSG_CHECKING([whether the shell understands some XSI constructs]) -# Try some XSI features -xsi_shell=no -( _lt_dummy="a/b/c" - test "${_lt_dummy##*/},${_lt_dummy%/*},${_lt_dummy#??}"${_lt_dummy%"$_lt_dummy"}, \ - = c,a/b,b/c, \ - && eval 'test $(( 1 + 1 )) -eq 2 \ - && test "${#_lt_dummy}" -eq 5' ) >/dev/null 2>&1 \ - && xsi_shell=yes -AC_MSG_RESULT([$xsi_shell]) -_LT_CONFIG_LIBTOOL_INIT([xsi_shell='$xsi_shell']) - -AC_MSG_CHECKING([whether the shell understands "+="]) -lt_shell_append=no -( foo=bar; set foo baz; eval "$[1]+=\$[2]" && test "$foo" = barbaz ) \ - >/dev/null 2>&1 \ - && lt_shell_append=yes -AC_MSG_RESULT([$lt_shell_append]) -_LT_CONFIG_LIBTOOL_INIT([lt_shell_append='$lt_shell_append']) - -if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then +[if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then lt_unset=unset else lt_unset=false @@ -7825,102 +8304,9 @@ _LT_DECL([NL2SP], [lt_NL2SP], [1], [turn newlines into spaces])dnl ])# _LT_CHECK_SHELL_FEATURES -# _LT_PROG_FUNCTION_REPLACE (FUNCNAME, REPLACEMENT-BODY) -# ------------------------------------------------------ -# In `$cfgfile', look for function FUNCNAME delimited by `^FUNCNAME ()$' and -# '^} FUNCNAME ', and replace its body with REPLACEMENT-BODY. -m4_defun([_LT_PROG_FUNCTION_REPLACE], -[dnl { -sed -e '/^$1 ()$/,/^} # $1 /c\ -$1 ()\ -{\ -m4_bpatsubsts([$2], [$], [\\], [^\([ ]\)], [\\\1]) -} # Extended-shell $1 implementation' "$cfgfile" > $cfgfile.tmp \ - && mv -f "$cfgfile.tmp" "$cfgfile" \ - || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") -test 0 -eq $? || _lt_function_replace_fail=: -]) - - -# _LT_PROG_REPLACE_SHELLFNS -# ------------------------- -# Replace existing portable implementations of several shell functions with -# equivalent extended shell implementations where those features are available.. -m4_defun([_LT_PROG_REPLACE_SHELLFNS], -[if test x"$xsi_shell" = xyes; then - _LT_PROG_FUNCTION_REPLACE([func_dirname], [dnl - case ${1} in - */*) func_dirname_result="${1%/*}${2}" ;; - * ) func_dirname_result="${3}" ;; - esac]) - - _LT_PROG_FUNCTION_REPLACE([func_basename], [dnl - func_basename_result="${1##*/}"]) - - _LT_PROG_FUNCTION_REPLACE([func_dirname_and_basename], [dnl - case ${1} in - */*) func_dirname_result="${1%/*}${2}" ;; - * ) func_dirname_result="${3}" ;; - esac - func_basename_result="${1##*/}"]) - - _LT_PROG_FUNCTION_REPLACE([func_stripname], [dnl - # pdksh 5.2.14 does not do ${X%$Y} correctly if both X and Y are - # positional parameters, so assign one to ordinary parameter first. - func_stripname_result=${3} - func_stripname_result=${func_stripname_result#"${1}"} - func_stripname_result=${func_stripname_result%"${2}"}]) - - _LT_PROG_FUNCTION_REPLACE([func_split_long_opt], [dnl - func_split_long_opt_name=${1%%=*} - func_split_long_opt_arg=${1#*=}]) - - _LT_PROG_FUNCTION_REPLACE([func_split_short_opt], [dnl - func_split_short_opt_arg=${1#??} - func_split_short_opt_name=${1%"$func_split_short_opt_arg"}]) - - _LT_PROG_FUNCTION_REPLACE([func_lo2o], [dnl - case ${1} in - *.lo) func_lo2o_result=${1%.lo}.${objext} ;; - *) func_lo2o_result=${1} ;; - esac]) - - _LT_PROG_FUNCTION_REPLACE([func_xform], [ func_xform_result=${1%.*}.lo]) - - _LT_PROG_FUNCTION_REPLACE([func_arith], [ func_arith_result=$(( $[*] ))]) - - _LT_PROG_FUNCTION_REPLACE([func_len], [ func_len_result=${#1}]) -fi - -if test x"$lt_shell_append" = xyes; then - _LT_PROG_FUNCTION_REPLACE([func_append], [ eval "${1}+=\\${2}"]) - - _LT_PROG_FUNCTION_REPLACE([func_append_quoted], [dnl - func_quote_for_eval "${2}" -dnl m4 expansion turns \\\\ into \\, and then the shell eval turns that into \ - eval "${1}+=\\\\ \\$func_quote_for_eval_result"]) - - # Save a `func_append' function call where possible by direct use of '+=' - sed -e 's%func_append \([[a-zA-Z_]]\{1,\}\) "%\1+="%g' $cfgfile > $cfgfile.tmp \ - && mv -f "$cfgfile.tmp" "$cfgfile" \ - || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") - test 0 -eq $? || _lt_function_replace_fail=: -else - # Save a `func_append' function call even when '+=' is not available - sed -e 's%func_append \([[a-zA-Z_]]\{1,\}\) "%\1="$\1%g' $cfgfile > $cfgfile.tmp \ - && mv -f "$cfgfile.tmp" "$cfgfile" \ - || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") - test 0 -eq $? || _lt_function_replace_fail=: -fi - -if test x"$_lt_function_replace_fail" = x":"; then - AC_MSG_WARN([Unable to substitute extended shell functions in $ofile]) -fi -]) - # _LT_PATH_CONVERSION_FUNCTIONS # ----------------------------- -# Determine which file name conversion functions should be used by +# Determine what file name conversion functions should be used by # func_to_host_file (and, implicitly, by func_to_host_path). These are needed # for certain cross-compile configurations and native mingw. m4_defun([_LT_PATH_CONVERSION_FUNCTIONS], diff --git a/m4/ltoptions.m4 b/m4/ltoptions.m4 index 5d9acd8..94b0829 100644 --- a/m4/ltoptions.m4 +++ b/m4/ltoptions.m4 @@ -1,14 +1,14 @@ # Helper functions for option handling. -*- Autoconf -*- # -# Copyright (C) 2004, 2005, 2007, 2008, 2009 Free Software Foundation, -# Inc. +# Copyright (C) 2004-2005, 2007-2009, 2011-2015 Free Software +# Foundation, Inc. # Written by Gary V. Vaughan, 2004 # # 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. -# serial 7 ltoptions.m4 +# serial 8 ltoptions.m4 # This is to help aclocal find these macros, as it can't see m4_define. AC_DEFUN([LTOPTIONS_VERSION], [m4_if([1])]) @@ -29,7 +29,7 @@ m4_define([_LT_SET_OPTION], [m4_define(_LT_MANGLE_OPTION([$1], [$2]))dnl m4_ifdef(_LT_MANGLE_DEFUN([$1], [$2]), _LT_MANGLE_DEFUN([$1], [$2]), - [m4_warning([Unknown $1 option `$2'])])[]dnl + [m4_warning([Unknown $1 option '$2'])])[]dnl ]) @@ -75,13 +75,15 @@ m4_if([$1],[LT_INIT],[ dnl dnl If no reference was made to various pairs of opposing options, then dnl we run the default mode handler for the pair. For example, if neither - dnl `shared' nor `disable-shared' was passed, we enable building of shared + dnl 'shared' nor 'disable-shared' was passed, we enable building of shared dnl archives by default: _LT_UNLESS_OPTIONS([LT_INIT], [shared disable-shared], [_LT_ENABLE_SHARED]) _LT_UNLESS_OPTIONS([LT_INIT], [static disable-static], [_LT_ENABLE_STATIC]) _LT_UNLESS_OPTIONS([LT_INIT], [pic-only no-pic], [_LT_WITH_PIC]) _LT_UNLESS_OPTIONS([LT_INIT], [fast-install disable-fast-install], - [_LT_ENABLE_FAST_INSTALL]) + [_LT_ENABLE_FAST_INSTALL]) + _LT_UNLESS_OPTIONS([LT_INIT], [aix-soname=aix aix-soname=both aix-soname=svr4], + [_LT_WITH_AIX_SONAME([aix])]) ]) ])# _LT_SET_OPTIONS @@ -112,7 +114,7 @@ AU_DEFUN([AC_LIBTOOL_DLOPEN], [_LT_SET_OPTION([LT_INIT], [dlopen]) AC_DIAGNOSE([obsolete], [$0: Remove this warning and the call to _LT_SET_OPTION when you -put the `dlopen' option into LT_INIT's first parameter.]) +put the 'dlopen' option into LT_INIT's first parameter.]) ]) dnl aclocal-1.4 backwards compatibility: @@ -148,7 +150,7 @@ AU_DEFUN([AC_LIBTOOL_WIN32_DLL], _LT_SET_OPTION([LT_INIT], [win32-dll]) AC_DIAGNOSE([obsolete], [$0: Remove this warning and the call to _LT_SET_OPTION when you -put the `win32-dll' option into LT_INIT's first parameter.]) +put the 'win32-dll' option into LT_INIT's first parameter.]) ]) dnl aclocal-1.4 backwards compatibility: @@ -157,9 +159,9 @@ dnl AC_DEFUN([AC_LIBTOOL_WIN32_DLL], []) # _LT_ENABLE_SHARED([DEFAULT]) # ---------------------------- -# implement the --enable-shared flag, and supports the `shared' and -# `disable-shared' LT_INIT options. -# DEFAULT is either `yes' or `no'. If omitted, it defaults to `yes'. +# implement the --enable-shared flag, and supports the 'shared' and +# 'disable-shared' LT_INIT options. +# DEFAULT is either 'yes' or 'no'. If omitted, it defaults to 'yes'. m4_define([_LT_ENABLE_SHARED], [m4_define([_LT_ENABLE_SHARED_DEFAULT], [m4_if($1, no, no, yes)])dnl AC_ARG_ENABLE([shared], @@ -172,14 +174,14 @@ AC_ARG_ENABLE([shared], *) enable_shared=no # Look at the argument we got. We use all the common list separators. - lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," + lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR, for pkg in $enableval; do - IFS="$lt_save_ifs" + IFS=$lt_save_ifs if test "X$pkg" = "X$p"; then enable_shared=yes fi done - IFS="$lt_save_ifs" + IFS=$lt_save_ifs ;; esac], [enable_shared=]_LT_ENABLE_SHARED_DEFAULT) @@ -211,9 +213,9 @@ dnl AC_DEFUN([AM_DISABLE_SHARED], []) # _LT_ENABLE_STATIC([DEFAULT]) # ---------------------------- -# implement the --enable-static flag, and support the `static' and -# `disable-static' LT_INIT options. -# DEFAULT is either `yes' or `no'. If omitted, it defaults to `yes'. +# implement the --enable-static flag, and support the 'static' and +# 'disable-static' LT_INIT options. +# DEFAULT is either 'yes' or 'no'. If omitted, it defaults to 'yes'. m4_define([_LT_ENABLE_STATIC], [m4_define([_LT_ENABLE_STATIC_DEFAULT], [m4_if($1, no, no, yes)])dnl AC_ARG_ENABLE([static], @@ -226,14 +228,14 @@ AC_ARG_ENABLE([static], *) enable_static=no # Look at the argument we got. We use all the common list separators. - lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," + lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR, for pkg in $enableval; do - IFS="$lt_save_ifs" + IFS=$lt_save_ifs if test "X$pkg" = "X$p"; then enable_static=yes fi done - IFS="$lt_save_ifs" + IFS=$lt_save_ifs ;; esac], [enable_static=]_LT_ENABLE_STATIC_DEFAULT) @@ -265,9 +267,9 @@ dnl AC_DEFUN([AM_DISABLE_STATIC], []) # _LT_ENABLE_FAST_INSTALL([DEFAULT]) # ---------------------------------- -# implement the --enable-fast-install flag, and support the `fast-install' -# and `disable-fast-install' LT_INIT options. -# DEFAULT is either `yes' or `no'. If omitted, it defaults to `yes'. +# implement the --enable-fast-install flag, and support the 'fast-install' +# and 'disable-fast-install' LT_INIT options. +# DEFAULT is either 'yes' or 'no'. If omitted, it defaults to 'yes'. m4_define([_LT_ENABLE_FAST_INSTALL], [m4_define([_LT_ENABLE_FAST_INSTALL_DEFAULT], [m4_if($1, no, no, yes)])dnl AC_ARG_ENABLE([fast-install], @@ -280,14 +282,14 @@ AC_ARG_ENABLE([fast-install], *) enable_fast_install=no # Look at the argument we got. We use all the common list separators. - lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," + lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR, for pkg in $enableval; do - IFS="$lt_save_ifs" + IFS=$lt_save_ifs if test "X$pkg" = "X$p"; then enable_fast_install=yes fi done - IFS="$lt_save_ifs" + IFS=$lt_save_ifs ;; esac], [enable_fast_install=]_LT_ENABLE_FAST_INSTALL_DEFAULT) @@ -304,14 +306,14 @@ AU_DEFUN([AC_ENABLE_FAST_INSTALL], [_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[fast-install]) AC_DIAGNOSE([obsolete], [$0: Remove this warning and the call to _LT_SET_OPTION when you put -the `fast-install' option into LT_INIT's first parameter.]) +the 'fast-install' option into LT_INIT's first parameter.]) ]) AU_DEFUN([AC_DISABLE_FAST_INSTALL], [_LT_SET_OPTION([LT_INIT], [disable-fast-install]) AC_DIAGNOSE([obsolete], [$0: Remove this warning and the call to _LT_SET_OPTION when you put -the `disable-fast-install' option into LT_INIT's first parameter.]) +the 'disable-fast-install' option into LT_INIT's first parameter.]) ]) dnl aclocal-1.4 backwards compatibility: @@ -319,11 +321,64 @@ dnl AC_DEFUN([AC_ENABLE_FAST_INSTALL], []) dnl AC_DEFUN([AM_DISABLE_FAST_INSTALL], []) +# _LT_WITH_AIX_SONAME([DEFAULT]) +# ---------------------------------- +# implement the --with-aix-soname flag, and support the `aix-soname=aix' +# and `aix-soname=both' and `aix-soname=svr4' LT_INIT options. DEFAULT +# is either `aix', `both' or `svr4'. If omitted, it defaults to `aix'. +m4_define([_LT_WITH_AIX_SONAME], +[m4_define([_LT_WITH_AIX_SONAME_DEFAULT], [m4_if($1, svr4, svr4, m4_if($1, both, both, aix))])dnl +shared_archive_member_spec= +case $host,$enable_shared in +power*-*-aix[[5-9]]*,yes) + AC_MSG_CHECKING([which variant of shared library versioning to provide]) + AC_ARG_WITH([aix-soname], + [AS_HELP_STRING([--with-aix-soname=aix|svr4|both], + [shared library versioning (aka "SONAME") variant to provide on AIX, @<:@default=]_LT_WITH_AIX_SONAME_DEFAULT[@:>@.])], + [case $withval in + aix|svr4|both) + ;; + *) + AC_MSG_ERROR([Unknown argument to --with-aix-soname]) + ;; + esac + lt_cv_with_aix_soname=$with_aix_soname], + [AC_CACHE_VAL([lt_cv_with_aix_soname], + [lt_cv_with_aix_soname=]_LT_WITH_AIX_SONAME_DEFAULT) + with_aix_soname=$lt_cv_with_aix_soname]) + AC_MSG_RESULT([$with_aix_soname]) + if test aix != "$with_aix_soname"; then + # For the AIX way of multilib, we name the shared archive member + # based on the bitwidth used, traditionally 'shr.o' or 'shr_64.o', + # and 'shr.imp' or 'shr_64.imp', respectively, for the Import File. + # Even when GNU compilers ignore OBJECT_MODE but need '-maix64' flag, + # the AIX toolchain works better with OBJECT_MODE set (default 32). + if test 64 = "${OBJECT_MODE-32}"; then + shared_archive_member_spec=shr_64 + else + shared_archive_member_spec=shr + fi + fi + ;; +*) + with_aix_soname=aix + ;; +esac + +_LT_DECL([], [shared_archive_member_spec], [0], + [Shared archive member basename, for filename based shared library versioning on AIX])dnl +])# _LT_WITH_AIX_SONAME + +LT_OPTION_DEFINE([LT_INIT], [aix-soname=aix], [_LT_WITH_AIX_SONAME([aix])]) +LT_OPTION_DEFINE([LT_INIT], [aix-soname=both], [_LT_WITH_AIX_SONAME([both])]) +LT_OPTION_DEFINE([LT_INIT], [aix-soname=svr4], [_LT_WITH_AIX_SONAME([svr4])]) + + # _LT_WITH_PIC([MODE]) # -------------------- -# implement the --with-pic flag, and support the `pic-only' and `no-pic' +# implement the --with-pic flag, and support the 'pic-only' and 'no-pic' # LT_INIT options. -# MODE is either `yes' or `no'. If omitted, it defaults to `both'. +# MODE is either 'yes' or 'no'. If omitted, it defaults to 'both'. m4_define([_LT_WITH_PIC], [AC_ARG_WITH([pic], [AS_HELP_STRING([--with-pic@<:@=PKGS@:>@], @@ -334,19 +389,17 @@ m4_define([_LT_WITH_PIC], *) pic_mode=default # Look at the argument we got. We use all the common list separators. - lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," + lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR, for lt_pkg in $withval; do - IFS="$lt_save_ifs" + IFS=$lt_save_ifs if test "X$lt_pkg" = "X$lt_p"; then pic_mode=yes fi done - IFS="$lt_save_ifs" + IFS=$lt_save_ifs ;; esac], - [pic_mode=default]) - -test -z "$pic_mode" && pic_mode=m4_default([$1], [default]) + [pic_mode=m4_default([$1], [default])]) _LT_DECL([], [pic_mode], [0], [What type of objects to build])dnl ])# _LT_WITH_PIC @@ -359,7 +412,7 @@ AU_DEFUN([AC_LIBTOOL_PICMODE], [_LT_SET_OPTION([LT_INIT], [pic-only]) AC_DIAGNOSE([obsolete], [$0: Remove this warning and the call to _LT_SET_OPTION when you -put the `pic-only' option into LT_INIT's first parameter.]) +put the 'pic-only' option into LT_INIT's first parameter.]) ]) dnl aclocal-1.4 backwards compatibility: diff --git a/m4/ltsugar.m4 b/m4/ltsugar.m4 index 9000a05..48bc934 100644 --- a/m4/ltsugar.m4 +++ b/m4/ltsugar.m4 @@ -1,6 +1,7 @@ # ltsugar.m4 -- libtool m4 base layer. -*-Autoconf-*- # -# Copyright (C) 2004, 2005, 2007, 2008 Free Software Foundation, Inc. +# Copyright (C) 2004-2005, 2007-2008, 2011-2015 Free Software +# Foundation, Inc. # Written by Gary V. Vaughan, 2004 # # This file is free software; the Free Software Foundation gives @@ -33,7 +34,7 @@ m4_define([_lt_join], # ------------ # Manipulate m4 lists. # These macros are necessary as long as will still need to support -# Autoconf-2.59 which quotes differently. +# Autoconf-2.59, which quotes differently. m4_define([lt_car], [[$1]]) m4_define([lt_cdr], [m4_if([$#], 0, [m4_fatal([$0: cannot be called without arguments])], @@ -44,7 +45,7 @@ m4_define([lt_unquote], $1) # lt_append(MACRO-NAME, STRING, [SEPARATOR]) # ------------------------------------------ -# Redefine MACRO-NAME to hold its former content plus `SEPARATOR'`STRING'. +# Redefine MACRO-NAME to hold its former content plus 'SEPARATOR''STRING'. # Note that neither SEPARATOR nor STRING are expanded; they are appended # to MACRO-NAME as is (leaving the expansion for when MACRO-NAME is invoked). # No SEPARATOR is output if MACRO-NAME was previously undefined (different diff --git a/m4/ltversion.m4 b/m4/ltversion.m4 index 07a8602..fa04b52 100644 --- a/m4/ltversion.m4 +++ b/m4/ltversion.m4 @@ -1,6 +1,6 @@ # ltversion.m4 -- version numbers -*- Autoconf -*- # -# Copyright (C) 2004 Free Software Foundation, Inc. +# Copyright (C) 2004, 2011-2015 Free Software Foundation, Inc. # Written by Scott James Remnant, 2004 # # This file is free software; the Free Software Foundation gives @@ -9,15 +9,15 @@ # @configure_input@ -# serial 3337 ltversion.m4 +# serial 4179 ltversion.m4 # This file is part of GNU Libtool -m4_define([LT_PACKAGE_VERSION], [2.4.2]) -m4_define([LT_PACKAGE_REVISION], [1.3337]) +m4_define([LT_PACKAGE_VERSION], [2.4.6]) +m4_define([LT_PACKAGE_REVISION], [2.4.6]) AC_DEFUN([LTVERSION_VERSION], -[macro_version='2.4.2' -macro_revision='1.3337' +[macro_version='2.4.6' +macro_revision='2.4.6' _LT_DECL(, macro_version, 0, [Which release of libtool.m4 was used?]) _LT_DECL(, macro_revision, 0) ]) diff --git a/m4/lt~obsolete.m4 b/m4/lt~obsolete.m4 index c573da9..c6b26f8 100644 --- a/m4/lt~obsolete.m4 +++ b/m4/lt~obsolete.m4 @@ -1,6 +1,7 @@ # lt~obsolete.m4 -- aclocal satisfying obsolete definitions. -*-Autoconf-*- # -# Copyright (C) 2004, 2005, 2007, 2009 Free Software Foundation, Inc. +# Copyright (C) 2004-2005, 2007, 2009, 2011-2015 Free Software +# Foundation, Inc. # Written by Scott James Remnant, 2004. # # This file is free software; the Free Software Foundation gives @@ -11,7 +12,7 @@ # These exist entirely to fool aclocal when bootstrapping libtool. # -# In the past libtool.m4 has provided macros via AC_DEFUN (or AU_DEFUN) +# In the past libtool.m4 has provided macros via AC_DEFUN (or AU_DEFUN), # which have later been changed to m4_define as they aren't part of the # exported API, or moved to Autoconf or Automake where they belong. # @@ -25,7 +26,7 @@ # included after everything else. This provides aclocal with the # AC_DEFUNs it wants, but when m4 processes it, it doesn't do anything # because those macros already exist, or will be overwritten later. -# We use AC_DEFUN over AU_DEFUN for compatibility with aclocal-1.6. +# We use AC_DEFUN over AU_DEFUN for compatibility with aclocal-1.6. # # Anytime we withdraw an AC_DEFUN or AU_DEFUN, remember to add it here. # Yes, that means every name once taken will need to remain here until diff --git a/missing b/missing index cdea514..f62bbae 100755 --- a/missing +++ b/missing @@ -1,9 +1,9 @@ #! /bin/sh # Common wrapper for a few potentially missing GNU programs. -scriptversion=2012-06-26.16; # UTC +scriptversion=2013-10-28.13; # UTC -# Copyright (C) 1996-2013 Free Software Foundation, Inc. +# Copyright (C) 1996-2014 Free Software Foundation, Inc. # Originally written by Fran,cois Pinard , 1996. # This program is free software; you can redistribute it and/or modify @@ -160,7 +160,7 @@ give_advice () ;; autom4te*) echo "You might have modified some maintainer files that require" - echo "the 'automa4te' program to be rebuilt." + echo "the 'autom4te' program to be rebuilt." program_details 'autom4te' ;; bison*|yacc*) diff --git a/rpm/389-ds-base.spec.in b/rpm/389-ds-base.spec.in index ad0ffda..b3adc77 100644 --- a/rpm/389-ds-base.spec.in +++ b/rpm/389-ds-base.spec.in @@ -1063,7 +1063,7 @@ Ticket 399 - slapi_ldap_bind() doesn't check bind results - Bug 745259 - Incorrect entryUSN index under high load in replicated environment - d439e3a use slapi_hexchar2int and slapi_str_to_u8 everywhere - 5910551 csn_init_as_string should not use sscanf -- b53ba00 reduce calls to csn_as_string and slapi_log_error +- b53ba00 reduce calls to csn_as_string and slapi_log_err - c897267 fix member variable name error in slapi_uniqueIDFormat - 66808e5 uniqueid formatting - use slapi_u8_to_hex instead of sprintf - 580a875 csn_as_string - use slapi_uN_to_hex instead of sprintf